Page MenuHomec4science

No OneTemporary

File Metadata

Created
Sat, Aug 24, 16:27
This file is larger than 256 KB, so syntax highlighting was skipped.
This document is not UTF8. It was detected as ISO-8859-1 (Latin 1) and converted to UTF8 for display.
diff --git a/shrine-webclient/src/main/html/README.md b/shrine-webclient/src/main/html/README.md
new file mode 100644
index 000000000..d4a92b8ea
--- /dev/null
+++ b/shrine-webclient/src/main/html/README.md
@@ -0,0 +1,2 @@
+# dev-shrine-webclient
+Development repository for the SHRINE Webclient
diff --git a/shrine-webclient/src/main/html/assets/blank.html b/shrine-webclient/src/main/html/assets/blank.html
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/help_viewer.css b/shrine-webclient/src/main/html/assets/help_viewer.css
old mode 100755
new mode 100644
index fcff11796..d421830b3
--- a/shrine-webclient/src/main/html/assets/help_viewer.css
+++ b/shrine-webclient/src/main/html/assets/help_viewer.css
@@ -1,18 +1,18 @@
-#help-viewer-panel .bd {
- overflow:auto;
- background-color:fff;
- padding:10px;
-}
-
-#help-viewer-panel .ft {
- height:15px;
- padding:0;
-}
-
-#help-viewer-panel .yui-resize-handle-br {
- right:0;
- bottom:0;
- height: 8px;
- width: 8px;
- position:absolute;
+#help-viewer-panel .bd {
+ overflow:auto;
+ background-color:fff;
+ padding:10px;
+}
+
+#help-viewer-panel .ft {
+ height:15px;
+ padding:0;
+}
+
+#help-viewer-panel .yui-resize-handle-br {
+ right:0;
+ bottom:0;
+ height: 8px;
+ width: 8px;
+ position:absolute;
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/assets/i2b2-NEW.css b/shrine-webclient/src/main/html/assets/i2b2-NEW.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/i2b2.css b/shrine-webclient/src/main/html/assets/i2b2.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/b_clear.gif b/shrine-webclient/src/main/html/assets/images/b_clear.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/b_dropdown.gif b/shrine-webclient/src/main/html/assets/images/b_dropdown.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/background.gif b/shrine-webclient/src/main/html/assets/images/background.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/msg_request.gif b/shrine-webclient/src/main/html/assets/images/msg_request.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/msg_response.gif b/shrine-webclient/src/main/html/assets/images/msg_response.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/msg_stack.gif b/shrine-webclient/src/main/html/assets/images/msg_stack.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/options.gif b/shrine-webclient/src/main/html/assets/images/options.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/spacer.gif b/shrine-webclient/src/main/html/assets/images/spacer.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/splitter.handle.image.gif b/shrine-webclient/src/main/html/assets/images/splitter.handle.image.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/thumb-n.gif b/shrine-webclient/src/main/html/assets/images/thumb-n.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/title.gif b/shrine-webclient/src/main/html/assets/images/title.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/title_back.gif b/shrine-webclient/src/main/html/assets/images/title_back.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/images/top_hive.gif b/shrine-webclient/src/main/html/assets/images/top_hive.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/assets/mod-treeview.css b/shrine-webclient/src/main/html/assets/mod-treeview.css
old mode 100755
new mode 100644
index fbbb32286..9b49ee7f7
--- a/shrine-webclient/src/main/html/assets/mod-treeview.css
+++ b/shrine-webclient/src/main/html/assets/mod-treeview.css
@@ -1,17 +1,17 @@
-
-.ygtvtn, .ygtvtm, .ygtvtmh,
-.ygtvtp, .ygtvtph, .ygtvln,
-.ygtvlm, .ygtvlmh, .ygtvlp,
-.ygtvlph, .ygtvloading, .ygtvdepthcell,
-.ygtvblankdepthcell {
- width:16px !important;
- height:18px !important;
-}
-
-.ygtvspacer {
- height: 10px !important;
- width: 10px !important;
- margin:0px 4px !important;
- text-decoration: none !important;
- display: block;
-}
+
+.ygtvtn, .ygtvtm, .ygtvtmh,
+.ygtvtp, .ygtvtph, .ygtvln,
+.ygtvlm, .ygtvlmh, .ygtvlp,
+.ygtvlph, .ygtvloading, .ygtvdepthcell,
+.ygtvblankdepthcell {
+ width:16px !important;
+ height:18px !important;
+}
+
+.ygtvspacer {
+ height: 10px !important;
+ width: 10px !important;
+ margin:0px 4px !important;
+ text-decoration: none !important;
+ display: block;
+}
diff --git a/shrine-webclient/src/main/html/assets/msg-viewer.html b/shrine-webclient/src/main/html/assets/msg-viewer.html
old mode 100755
new mode 100644
index 333415efa..7a303e3f1
--- a/shrine-webclient/src/main/html/assets/msg-viewer.html
+++ b/shrine-webclient/src/main/html/assets/msg-viewer.html
@@ -1,401 +1,401 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-<head>
- <title>Message Log</title>
- <link rel="stylesheet" type="text/css" href="../assets/msg_sniffer.css" />
- <!--[if lte IE 6]>
- <link rel="stylesheet" type="text/css" href="msg_snifferIE6.css"/>
- <![endif]-->
- <!-- Prototype JS framework -->
- <script type="text/javascript" src="../js-ext/prototype.js"></script>
-</head>
-<body onload="initialize();" class="msgSnifferViewer">
-<script>
- try {
- // copy over some namespace references
- var i2b2 = window.opener.i2b2;
-
- var SnifferDisplay = {
- _viewCommSide: "BOTH",
- _filteredView: false,
- changedOrigin: function(refSelect) {
- SnifferDisplay.renderFilteredList();
- },
- changedChannel: function(refSelect) {
- SnifferDisplay.renderActions();
- SnifferDisplay.renderFilteredList();
- },
- changedAction: function(refSelect) {
- SnifferDisplay.renderFilteredList();
- },
- renderFilteredList: function() {
- var matches = new Hash();
- var origin = false;
- var channel = false;
- var action = false;
-
- // clear XML display panel
- var rs = Element.select(document.body, ".msgXML");
- rs[0].innerHTML = '&nbsp;';
- rs[0].scrollTop = 0;
-
- // get form data
- var filtered = !(!SnifferDisplay._filteredView);
- if (filtered && SnifferDisplay._filteredView.origins && !(!SnifferDisplay._filteredView.origins.push)) {
- origin = SnifferDisplay._filteredView.origins;
- } else {
- var t = document.getElementById('sniffer_Origin');
- if (t.options[t.selectedIndex].value != "ALL" ) {
- origin = t.options[t.selectedIndex].value;
- }
- }
-
- if (filtered && SnifferDisplay._filteredView.cells && !(!SnifferDisplay._filteredView.cells.push)) {
- channel = SnifferDisplay._filteredView.cells;
- } else {
- var t = document.getElementById('sniffer_CommChannel');
- if (t.options[t.selectedIndex].value != "ALL" ) {
- channel = t.options[t.selectedIndex].value;
- }
- }
-
- if (filtered && SnifferDisplay._filteredView.actions && !(!SnifferDisplay._filteredView.actions.push)) {
- action = SnifferDisplay._filteredView.actions;
- } else {
- var t = document.getElementById('sniffer_ChannelAction');
- if (t.options[t.selectedIndex].value != "ALL" ) {
- action = t.options[t.selectedIndex].value;
- }
- }
- // sieve results from msg log
- var DB = i2b2.hive.MsgSniffer.signalMessageDB;
- for (var i=0; i<DB.length; i++) {
- var mThresh = 0;
- var mVal = 0;
- var rec = DB[i];
- if (origin) {
- mThresh++;
- if (origin.push) {
- for (var i2=0; i2 < origin.length; i2++) {
- if (rec.SignalOrigin==origin[i2]) {
- mVal++;
- break;
- }
- }
- } else {
- if (rec.SignalOrigin==origin) { mVal++; }
- }
- }
- if (channel) {
- mThresh++;
- if (channel.push) {
- for (var i2=0; i2 < channel.length; i2++) {
- if (rec.CellName==channel[i2]) {
- mVal++;
- break;
- }
- }
- } else {
- if (rec.CellName==channel) { mVal++; }
- }
- }
- if (action) {
- mThresh++;
- if (action.push) {
- for (var i2=0; i2 < action.length; i2++) {
- if (rec.CellAction==action[i2]) {
- mVal++;
- break;
- }
- }
- } else {
- if (rec.CellAction==action) { mVal++; }
- }
- }
- if (mVal==mThresh) { matches.set(i, rec); }
- }
-
- // clear the current msg index listing
- var lst = $('sniffer_MatchMsgList');
- while( lst.hasChildNodes() ) { lst.removeChild( lst.lastChild ); }
-
- // render the list of matching messages
- var tmpl = document.getElementById('sniffer_msg-REC'); // template code
- var time0 = false;
- if (matches.keys().length > 0) {
- matches.each(function(val) {
- var index = val[0];
- val = val[1];
- var disp = tmpl.cloneNode(true);
- disp.id = "sniffer_msg-"+index;
- // calculate T+x time string
- if (!time0) {
- // first record
- time0 = val.SignalTimestamp.valueOf();
- }
- var leadZeros = function(v, l) {
- var t = parseInt(v) + "";
- while (t.length < l) {
- t = "0" + t;
- }
- return t;
- }
- var tDiff = Math.abs(time0 - val.SignalTimestamp.valueOf());
- var tDisp = leadZeros((tDiff % 1000) / 10, 2);
- var x = tDiff / 1000;
- tDisp = leadZeros(x % 60, 2)+"." + tDisp;
- x = x / 60;
- tDisp = leadZeros(x % 60, 2)+":" + tDisp;
- // display to time node
- var el = Element.select(disp, ".msgTime")[0];
- el.innerHTML = "T+"+tDisp;
- el.title = val.SignalTimestamp.toLocaleTimeString();
- // display other nodes
- var el = Element.select(disp, ".msgChan")[0];
- el.innerHTML = val.CellName;
- var el = Element.select(disp, ".msgAction")[0];
- el.innerHTML = val.CellAction;
- var el = Element.select(disp, ".msgOrigin")[0];
- el.innerHTML = val.SignalOrigin;
- // change the color of the recieved message button if an error has occured
- if (val.CommDetails.error) {
- var el = Element.select(disp, ".recvStatus")[0];
- Element.addClassName(el, "msgError");
- }
- lst.appendChild(disp);
- Element.show(disp);
- });
- } else {
- lst.innerHTML = "&nbsp;";
- }
- },
- renderOrigins: function() {
- if (SnifferDisplay._filteredView && SnifferDisplay._filteredView.origins) {
- return true;
- }
- var sn = document.getElementById('sniffer_Origin');
- while( sn.hasChildNodes() ) { sn.removeChild( sn.lastChild ); }
- // populate dropdown
- var pno = document.createElement('OPTION');
- pno.setAttribute('value', 'ALL');
- var pnt = document.createTextNode('All Origins');
- pno.appendChild(pnt);
- sn.appendChild(pno);
- for (var i=0; i<i2b2.hive.MsgSniffer.signalOrigins.length; i++) {
- var t = i2b2.hive.MsgSniffer.signalOrigins[i];
- var pno = document.createElement('OPTION');
- pno.setAttribute('value', t);
- var pnt = document.createTextNode(t);
- pno.appendChild(pnt);
- sn.appendChild(pno);
- }
- sn.selectedIndex = 0;
- },
- renderChannels: function() {
- var sn = document.getElementById('sniffer_CommChannel');
- while( sn.hasChildNodes() ) { sn.removeChild( sn.lastChild ); }
- // populate dropdown
- var isFiltered = (SnifferDisplay._filteredView && SnifferDisplay._filteredView.cells && !(!SnifferDisplay._filteredView.cells.push));
-
- if (!isFiltered) {
- var pno = document.createElement('OPTION');
- pno.setAttribute('value', 'ALL');
- var pnt = document.createTextNode('All Cells');
- pno.appendChild(pnt);
- sn.appendChild(pno);
- }
- for (var i=0; i<i2b2.hive.MsgSniffer.sniffSources.length; i++) {
- var t = i2b2.hive.MsgSniffer.sniffSources[i];
- var doAdd = true;
- if (isFiltered) {
- // apply filter
- var doAdd = false;
- for (var fi=0; fi < SnifferDisplay._filteredView.cells.length; fi++) {
- if (SnifferDisplay._filteredView.cells[fi] == t.channelCode) {
- doAdd = true;
- break;
- }
- }
- }
- if (doAdd) {
- var pno = document.createElement('OPTION');
- pno.setAttribute('value', t.channelCode);
- var pnt = document.createTextNode(t.channelName);
- pno.appendChild(pnt);
- sn.appendChild(pno);
- }
- }
- sn.selectedIndex = 0;
- },
- renderActions: function() {
- var sn = document.getElementById('sniffer_ChannelAction');
- while( sn.hasChildNodes() ) { sn.removeChild( sn.lastChild ); }
- // populate dropdown
- var pno = document.createElement('OPTION');
- pno.setAttribute('value', 'ALL');
- var pnt = document.createTextNode('All Actions');
- pno.appendChild(pnt);
- sn.appendChild(pno);
- sn.selectedIndex = 0;
- // find currently selected cell
- var c = document.getElementById('sniffer_CommChannel')
- c = c.options[c.selectedIndex].value;
- if (c == "ALL") { return true; }
- for (var i=0; i<i2b2.hive.MsgSniffer.sniffSources.length; i++) {
- if (i2b2.hive.MsgSniffer.sniffSources[i].channelCode == c) {
- c = i;
- break;
- }
- }
- for (var i=0; i<i2b2.hive.MsgSniffer.sniffSources[c].channelActions.length; i++) {
- var t = i2b2.hive.MsgSniffer.sniffSources[c].channelActions[i];
- var pno = document.createElement('OPTION');
- pno.setAttribute('value', t);
- var pnt = document.createTextNode(t);
- pno.appendChild(pnt);
- sn.appendChild(pno);
- }
- },
- refresh: function() {
- SnifferDisplay.renderOrigins();
- SnifferDisplay.renderChannels();
- SnifferDisplay.renderActions();
- SnifferDisplay.renderFilteredList();
- },
- showMsg: function(el, commSide) {
- if (commSide != "SENT" && commSide != "RCVD" ) { commSide = false; }
- var t = this._extract_id(el);
- var cn = "selected"; // class name
- if (!t) { return false; }
-
- // deselect previous
- var rs = Element.select(document.body, ".IndexRecord."+cn);
- for (var i=0; i<rs.length; i++) {
- Element.removeClassName(rs[i], cn);
- }
-
- // select new
- var t2 = document.getElementById("sniffer_msg-"+t);
- if (!Element.hasClassName(t2, cn)) {
- t2.className += (t2.className ? ' ' : '') + cn;
- }
- var rec = i2b2.hive.MsgSniffer.signalMessageDB[t];
- // tweak GUI when error occurs
- var cssError = "";
- if (rec.CommDetails.error) {
- cssError = "msgError";
- }
- // display XML
- commSide = this._viewCommSide;
- var output = "";
- if (commSide=="BOTH" || commSide=="SENT") {
- output += '<pre class="msgXML msgSent">'+i2b2.h.Escape(rec.CommDetails.msgRequest)+'</pre>';
- }
- if (commSide=="BOTH" || commSide=="RCVD") {
- output += '<pre class="msgXML msgRcvd '+cssError+'">'+i2b2.h.Escape(rec.CommDetails.msgResponse)+'</pre>';
- }
- var rs = Element.select(document.body, ".msgXML");
- rs[0].innerHTML = output;
- rs[0].scrollTop = 0;
- },
- showSingleCommSide: function(commSide) {
- if (commSide!="SENT" && commSide!="RCVD") { commSide = "BOTH"; }
- this._viewCommSide = commSide;
- // set to view both if next click does not hit the SEND or RCVD buttons
- setTimeout("SnifferDisplay._viewCommSide='BOTH'",200);
- },
- ClearLog: function() {
- if(confirm("Are you sure you want to delete ALL messages in the log?")) {
- i2b2.hive.MsgSniffer.signalMessageDB = [];
- this.refresh.call(this);
- }
- },
- _extract_id: function(div) {
- var t1 = div;
- while (!t1.id) {
- t1 = t1.parentNode;
- if (!t1) { break; }
- }
- var t2 = t1.id;
- var rec_num = t2.lastIndexOf('-');
- if (rec_num > 0) {
- rec_num = t2.slice(rec_num+1);
- return rec_num;
- } else {
- return false;
- }
- },
- resize: function(evt) {
- if (window.outerHeight < 260) { window.outerHeight = 260; }
- if (window.outerWidth < 600) { window.outerWidth = 600; }
- }
- };
- } catch(e) { alert('XML Message viewer failed to initialize.'); }
- function initialize() {
- var t = i2b2.hive.MsgSniffer.asyncStackFilter;
- if (t) {
- SnifferDisplay._filteredView = Object.clone(t);
- delete t;
- i2b2.hive.MsgSniffer.asyncStackFilter = false;
- $('sniffer_Origin').hide();
- $('sniffer_CommChannel').hide();
- $('sniffer_ChannelAction').hide();
- var t = $('view_stack_name')
- t.show();
-// t.innerHTML = SnifferDisplay._filteredView.title;
- } else {
- SnifferDisplay._filteredView = false;
- }
- SnifferDisplay.refresh.call(SnifferDisplay);
- Event.observe(window, 'resize', SnifferDisplay.resize.bindAsEventListener(SnifferDisplay));
- }
-</script>
-<form style="margin:0px; padding:0px;">
-<div id="sniffer_Filters" style="height:30px;border-top:1px solid #FFF;border-left:1px solid #FFF;border-bottom:1px solid #678;border-right:1px solid #678; background: #BCD; z-index:100;">
- <div class="filters" style="position:absolute;top:5px; white-space:nowrap; overflow:hidden; margin-left:8px">
- <div style="width:240px; float:left; display:none; font-family:arial,helvetica" id="view_stack_name">XML Message History</div>
- <select style="width:150px;" id="sniffer_Origin" onchange="SnifferDisplay.changedOrigin(this)">
- <option value="ALL" selected="selected">All Views</option>
- </select>
- <select style="width:150px;" style="margin-left:0px;" id="sniffer_CommChannel" onchange="SnifferDisplay.changedChannel(this)">
- <option value="ALL">All Cells</option>
- </select>
- <select style="width:250px;" id="sniffer_ChannelAction" onchange="SnifferDisplay.changedAction(this)">
- <option value="ALL" selected="selected">All Actions</option>
- </select>
- </div>
-
-
-</div>
-
-<div id="sniffer_MatchMsgList" style="position:absolute;top:32px;left:0px;background:#DBE8EF; width:250px; overflow:scroll;border-bottom:1px solid #678; bottom:0px; padding-bottom:18px; margin-bottom:18px"></div>
-<div id="sniffer_ListButtons" style="position:absolute; left:0px; bottom:2px; width:250px; height:28px; z-index:10; background: #F0F0F0; padding: 5px 0px 0px; align:center; border-top: 1px solid #F8F8F8">
- <input type="button" style="float: right; margin-right: 15px; width:70px;" value="Clear" onclick="SnifferDisplay.ClearLog()"/>
- <input type="button" style="margin:0px 5px; width:70px;" value="Refresh" onclick="SnifferDisplay.refresh()"/>
-</div>
-
-<div id="sniffer_MatchMsgDisp" class="msgXML" style="background: #FFF; padding: 3px; overflow:auto; position:absolute; top:32px; right:0px; left:250px; bottom:0px"></div>
-
-</form>
-<div id="sniffer_msg-REC" class="IndexRecord" style="border-top:1px solid #FFF;border-left:1px solid #FFF;border-bottom:1px solid #678; width:227px;display:none;" onclick="SnifferDisplay.showMsg(this)">
- <table style="font-size:inherit; width:227px;" cellspacing="0">
- <tbody>
- <tr>
- <td rowspan="2" width="26">
- <div class="sentStatus" title="Request" onclick="SnifferDisplay.showSingleCommSide('SENT')">sent</div>
- <div class="recvStatus" title="Response" onclick="SnifferDisplay.showSingleCommSide('RCVD')">rcvd</div>
- </td>
- <td><div class="msgAction">action</div></td>
- <td align="right"><div class="msgChan">cell</div></td>
- </tr>
- <tr>
- <td colspan="2">
- called by <span class="msgOrigin">origin</span> @
- <span class="msgTime" title="12:45:01 AM">T+1</span>
- </td>
- </tr>
- </tbody>
- </table>
-</div>
-</body>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+ <title>Message Log</title>
+ <link rel="stylesheet" type="text/css" href="../assets/msg_sniffer.css" />
+ <!--[if lte IE 6]>
+ <link rel="stylesheet" type="text/css" href="msg_snifferIE6.css"/>
+ <![endif]-->
+ <!-- Prototype JS framework -->
+ <script type="text/javascript" src="../js-ext/prototype.js"></script>
+</head>
+<body onload="initialize();" class="msgSnifferViewer">
+<script>
+ try {
+ // copy over some namespace references
+ var i2b2 = window.opener.i2b2;
+
+ var SnifferDisplay = {
+ _viewCommSide: "BOTH",
+ _filteredView: false,
+ changedOrigin: function(refSelect) {
+ SnifferDisplay.renderFilteredList();
+ },
+ changedChannel: function(refSelect) {
+ SnifferDisplay.renderActions();
+ SnifferDisplay.renderFilteredList();
+ },
+ changedAction: function(refSelect) {
+ SnifferDisplay.renderFilteredList();
+ },
+ renderFilteredList: function() {
+ var matches = new Hash();
+ var origin = false;
+ var channel = false;
+ var action = false;
+
+ // clear XML display panel
+ var rs = Element.select(document.body, ".msgXML");
+ rs[0].innerHTML = '&nbsp;';
+ rs[0].scrollTop = 0;
+
+ // get form data
+ var filtered = !(!SnifferDisplay._filteredView);
+ if (filtered && SnifferDisplay._filteredView.origins && !(!SnifferDisplay._filteredView.origins.push)) {
+ origin = SnifferDisplay._filteredView.origins;
+ } else {
+ var t = document.getElementById('sniffer_Origin');
+ if (t.options[t.selectedIndex].value != "ALL" ) {
+ origin = t.options[t.selectedIndex].value;
+ }
+ }
+
+ if (filtered && SnifferDisplay._filteredView.cells && !(!SnifferDisplay._filteredView.cells.push)) {
+ channel = SnifferDisplay._filteredView.cells;
+ } else {
+ var t = document.getElementById('sniffer_CommChannel');
+ if (t.options[t.selectedIndex].value != "ALL" ) {
+ channel = t.options[t.selectedIndex].value;
+ }
+ }
+
+ if (filtered && SnifferDisplay._filteredView.actions && !(!SnifferDisplay._filteredView.actions.push)) {
+ action = SnifferDisplay._filteredView.actions;
+ } else {
+ var t = document.getElementById('sniffer_ChannelAction');
+ if (t.options[t.selectedIndex].value != "ALL" ) {
+ action = t.options[t.selectedIndex].value;
+ }
+ }
+ // sieve results from msg log
+ var DB = i2b2.hive.MsgSniffer.signalMessageDB;
+ for (var i=0; i<DB.length; i++) {
+ var mThresh = 0;
+ var mVal = 0;
+ var rec = DB[i];
+ if (origin) {
+ mThresh++;
+ if (origin.push) {
+ for (var i2=0; i2 < origin.length; i2++) {
+ if (rec.SignalOrigin==origin[i2]) {
+ mVal++;
+ break;
+ }
+ }
+ } else {
+ if (rec.SignalOrigin==origin) { mVal++; }
+ }
+ }
+ if (channel) {
+ mThresh++;
+ if (channel.push) {
+ for (var i2=0; i2 < channel.length; i2++) {
+ if (rec.CellName==channel[i2]) {
+ mVal++;
+ break;
+ }
+ }
+ } else {
+ if (rec.CellName==channel) { mVal++; }
+ }
+ }
+ if (action) {
+ mThresh++;
+ if (action.push) {
+ for (var i2=0; i2 < action.length; i2++) {
+ if (rec.CellAction==action[i2]) {
+ mVal++;
+ break;
+ }
+ }
+ } else {
+ if (rec.CellAction==action) { mVal++; }
+ }
+ }
+ if (mVal==mThresh) { matches.set(i, rec); }
+ }
+
+ // clear the current msg index listing
+ var lst = $('sniffer_MatchMsgList');
+ while( lst.hasChildNodes() ) { lst.removeChild( lst.lastChild ); }
+
+ // render the list of matching messages
+ var tmpl = document.getElementById('sniffer_msg-REC'); // template code
+ var time0 = false;
+ if (matches.keys().length > 0) {
+ matches.each(function(val) {
+ var index = val[0];
+ val = val[1];
+ var disp = tmpl.cloneNode(true);
+ disp.id = "sniffer_msg-"+index;
+ // calculate T+x time string
+ if (!time0) {
+ // first record
+ time0 = val.SignalTimestamp.valueOf();
+ }
+ var leadZeros = function(v, l) {
+ var t = parseInt(v) + "";
+ while (t.length < l) {
+ t = "0" + t;
+ }
+ return t;
+ }
+ var tDiff = Math.abs(time0 - val.SignalTimestamp.valueOf());
+ var tDisp = leadZeros((tDiff % 1000) / 10, 2);
+ var x = tDiff / 1000;
+ tDisp = leadZeros(x % 60, 2)+"." + tDisp;
+ x = x / 60;
+ tDisp = leadZeros(x % 60, 2)+":" + tDisp;
+ // display to time node
+ var el = Element.select(disp, ".msgTime")[0];
+ el.innerHTML = "T+"+tDisp;
+ el.title = val.SignalTimestamp.toLocaleTimeString();
+ // display other nodes
+ var el = Element.select(disp, ".msgChan")[0];
+ el.innerHTML = val.CellName;
+ var el = Element.select(disp, ".msgAction")[0];
+ el.innerHTML = val.CellAction;
+ var el = Element.select(disp, ".msgOrigin")[0];
+ el.innerHTML = val.SignalOrigin;
+ // change the color of the recieved message button if an error has occured
+ if (val.CommDetails.error) {
+ var el = Element.select(disp, ".recvStatus")[0];
+ Element.addClassName(el, "msgError");
+ }
+ lst.appendChild(disp);
+ Element.show(disp);
+ });
+ } else {
+ lst.innerHTML = "&nbsp;";
+ }
+ },
+ renderOrigins: function() {
+ if (SnifferDisplay._filteredView && SnifferDisplay._filteredView.origins) {
+ return true;
+ }
+ var sn = document.getElementById('sniffer_Origin');
+ while( sn.hasChildNodes() ) { sn.removeChild( sn.lastChild ); }
+ // populate dropdown
+ var pno = document.createElement('OPTION');
+ pno.setAttribute('value', 'ALL');
+ var pnt = document.createTextNode('All Origins');
+ pno.appendChild(pnt);
+ sn.appendChild(pno);
+ for (var i=0; i<i2b2.hive.MsgSniffer.signalOrigins.length; i++) {
+ var t = i2b2.hive.MsgSniffer.signalOrigins[i];
+ var pno = document.createElement('OPTION');
+ pno.setAttribute('value', t);
+ var pnt = document.createTextNode(t);
+ pno.appendChild(pnt);
+ sn.appendChild(pno);
+ }
+ sn.selectedIndex = 0;
+ },
+ renderChannels: function() {
+ var sn = document.getElementById('sniffer_CommChannel');
+ while( sn.hasChildNodes() ) { sn.removeChild( sn.lastChild ); }
+ // populate dropdown
+ var isFiltered = (SnifferDisplay._filteredView && SnifferDisplay._filteredView.cells && !(!SnifferDisplay._filteredView.cells.push));
+
+ if (!isFiltered) {
+ var pno = document.createElement('OPTION');
+ pno.setAttribute('value', 'ALL');
+ var pnt = document.createTextNode('All Cells');
+ pno.appendChild(pnt);
+ sn.appendChild(pno);
+ }
+ for (var i=0; i<i2b2.hive.MsgSniffer.sniffSources.length; i++) {
+ var t = i2b2.hive.MsgSniffer.sniffSources[i];
+ var doAdd = true;
+ if (isFiltered) {
+ // apply filter
+ var doAdd = false;
+ for (var fi=0; fi < SnifferDisplay._filteredView.cells.length; fi++) {
+ if (SnifferDisplay._filteredView.cells[fi] == t.channelCode) {
+ doAdd = true;
+ break;
+ }
+ }
+ }
+ if (doAdd) {
+ var pno = document.createElement('OPTION');
+ pno.setAttribute('value', t.channelCode);
+ var pnt = document.createTextNode(t.channelName);
+ pno.appendChild(pnt);
+ sn.appendChild(pno);
+ }
+ }
+ sn.selectedIndex = 0;
+ },
+ renderActions: function() {
+ var sn = document.getElementById('sniffer_ChannelAction');
+ while( sn.hasChildNodes() ) { sn.removeChild( sn.lastChild ); }
+ // populate dropdown
+ var pno = document.createElement('OPTION');
+ pno.setAttribute('value', 'ALL');
+ var pnt = document.createTextNode('All Actions');
+ pno.appendChild(pnt);
+ sn.appendChild(pno);
+ sn.selectedIndex = 0;
+ // find currently selected cell
+ var c = document.getElementById('sniffer_CommChannel')
+ c = c.options[c.selectedIndex].value;
+ if (c == "ALL") { return true; }
+ for (var i=0; i<i2b2.hive.MsgSniffer.sniffSources.length; i++) {
+ if (i2b2.hive.MsgSniffer.sniffSources[i].channelCode == c) {
+ c = i;
+ break;
+ }
+ }
+ for (var i=0; i<i2b2.hive.MsgSniffer.sniffSources[c].channelActions.length; i++) {
+ var t = i2b2.hive.MsgSniffer.sniffSources[c].channelActions[i];
+ var pno = document.createElement('OPTION');
+ pno.setAttribute('value', t);
+ var pnt = document.createTextNode(t);
+ pno.appendChild(pnt);
+ sn.appendChild(pno);
+ }
+ },
+ refresh: function() {
+ SnifferDisplay.renderOrigins();
+ SnifferDisplay.renderChannels();
+ SnifferDisplay.renderActions();
+ SnifferDisplay.renderFilteredList();
+ },
+ showMsg: function(el, commSide) {
+ if (commSide != "SENT" && commSide != "RCVD" ) { commSide = false; }
+ var t = this._extract_id(el);
+ var cn = "selected"; // class name
+ if (!t) { return false; }
+
+ // deselect previous
+ var rs = Element.select(document.body, ".IndexRecord."+cn);
+ for (var i=0; i<rs.length; i++) {
+ Element.removeClassName(rs[i], cn);
+ }
+
+ // select new
+ var t2 = document.getElementById("sniffer_msg-"+t);
+ if (!Element.hasClassName(t2, cn)) {
+ t2.className += (t2.className ? ' ' : '') + cn;
+ }
+ var rec = i2b2.hive.MsgSniffer.signalMessageDB[t];
+ // tweak GUI when error occurs
+ var cssError = "";
+ if (rec.CommDetails.error) {
+ cssError = "msgError";
+ }
+ // display XML
+ commSide = this._viewCommSide;
+ var output = "";
+ if (commSide=="BOTH" || commSide=="SENT") {
+ output += '<pre class="msgXML msgSent">'+i2b2.h.Escape(rec.CommDetails.msgRequest)+'</pre>';
+ }
+ if (commSide=="BOTH" || commSide=="RCVD") {
+ output += '<pre class="msgXML msgRcvd '+cssError+'">'+i2b2.h.Escape(rec.CommDetails.msgResponse)+'</pre>';
+ }
+ var rs = Element.select(document.body, ".msgXML");
+ rs[0].innerHTML = output;
+ rs[0].scrollTop = 0;
+ },
+ showSingleCommSide: function(commSide) {
+ if (commSide!="SENT" && commSide!="RCVD") { commSide = "BOTH"; }
+ this._viewCommSide = commSide;
+ // set to view both if next click does not hit the SEND or RCVD buttons
+ setTimeout("SnifferDisplay._viewCommSide='BOTH'",200);
+ },
+ ClearLog: function() {
+ if(confirm("Are you sure you want to delete ALL messages in the log?")) {
+ i2b2.hive.MsgSniffer.signalMessageDB = [];
+ this.refresh.call(this);
+ }
+ },
+ _extract_id: function(div) {
+ var t1 = div;
+ while (!t1.id) {
+ t1 = t1.parentNode;
+ if (!t1) { break; }
+ }
+ var t2 = t1.id;
+ var rec_num = t2.lastIndexOf('-');
+ if (rec_num > 0) {
+ rec_num = t2.slice(rec_num+1);
+ return rec_num;
+ } else {
+ return false;
+ }
+ },
+ resize: function(evt) {
+ if (window.outerHeight < 260) { window.outerHeight = 260; }
+ if (window.outerWidth < 600) { window.outerWidth = 600; }
+ }
+ };
+ } catch(e) { alert('XML Message viewer failed to initialize.'); }
+ function initialize() {
+ var t = i2b2.hive.MsgSniffer.asyncStackFilter;
+ if (t) {
+ SnifferDisplay._filteredView = Object.clone(t);
+ delete t;
+ i2b2.hive.MsgSniffer.asyncStackFilter = false;
+ $('sniffer_Origin').hide();
+ $('sniffer_CommChannel').hide();
+ $('sniffer_ChannelAction').hide();
+ var t = $('view_stack_name')
+ t.show();
+// t.innerHTML = SnifferDisplay._filteredView.title;
+ } else {
+ SnifferDisplay._filteredView = false;
+ }
+ SnifferDisplay.refresh.call(SnifferDisplay);
+ Event.observe(window, 'resize', SnifferDisplay.resize.bindAsEventListener(SnifferDisplay));
+ }
+</script>
+<form style="margin:0px; padding:0px;">
+<div id="sniffer_Filters" style="height:30px;border-top:1px solid #FFF;border-left:1px solid #FFF;border-bottom:1px solid #678;border-right:1px solid #678; background: #BCD; z-index:100;">
+ <div class="filters" style="position:absolute;top:5px; white-space:nowrap; overflow:hidden; margin-left:8px">
+ <div style="width:240px; float:left; display:none; font-family:arial,helvetica" id="view_stack_name">XML Message History</div>
+ <select style="width:150px;" id="sniffer_Origin" onchange="SnifferDisplay.changedOrigin(this)">
+ <option value="ALL" selected="selected">All Views</option>
+ </select>
+ <select style="width:150px;" style="margin-left:0px;" id="sniffer_CommChannel" onchange="SnifferDisplay.changedChannel(this)">
+ <option value="ALL">All Cells</option>
+ </select>
+ <select style="width:250px;" id="sniffer_ChannelAction" onchange="SnifferDisplay.changedAction(this)">
+ <option value="ALL" selected="selected">All Actions</option>
+ </select>
+ </div>
+
+
+</div>
+
+<div id="sniffer_MatchMsgList" style="position:absolute;top:32px;left:0px;background:#DBE8EF; width:250px; overflow:scroll;border-bottom:1px solid #678; bottom:0px; padding-bottom:18px; margin-bottom:18px"></div>
+<div id="sniffer_ListButtons" style="position:absolute; left:0px; bottom:2px; width:250px; height:28px; z-index:10; background: #F0F0F0; padding: 5px 0px 0px; align:center; border-top: 1px solid #F8F8F8">
+ <input type="button" style="float: right; margin-right: 15px; width:70px;" value="Clear" onclick="SnifferDisplay.ClearLog()"/>
+ <input type="button" style="margin:0px 5px; width:70px;" value="Refresh" onclick="SnifferDisplay.refresh()"/>
+</div>
+
+<div id="sniffer_MatchMsgDisp" class="msgXML" style="background: #FFF; padding: 3px; overflow:auto; position:absolute; top:32px; right:0px; left:250px; bottom:0px"></div>
+
+</form>
+<div id="sniffer_msg-REC" class="IndexRecord" style="border-top:1px solid #FFF;border-left:1px solid #FFF;border-bottom:1px solid #678; width:227px;display:none;" onclick="SnifferDisplay.showMsg(this)">
+ <table style="font-size:inherit; width:227px;" cellspacing="0">
+ <tbody>
+ <tr>
+ <td rowspan="2" width="26">
+ <div class="sentStatus" title="Request" onclick="SnifferDisplay.showSingleCommSide('SENT')">sent</div>
+ <div class="recvStatus" title="Response" onclick="SnifferDisplay.showSingleCommSide('RCVD')">rcvd</div>
+ </td>
+ <td><div class="msgAction">action</div></td>
+ <td align="right"><div class="msgChan">cell</div></td>
+ </tr>
+ <tr>
+ <td colspan="2">
+ called by <span class="msgOrigin">origin</span> @
+ <span class="msgTime" title="12:45:01 AM">T+1</span>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+</body>
</html>
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/assets/msg_sniffer.css b/shrine-webclient/src/main/html/assets/msg_sniffer.css
old mode 100755
new mode 100644
index f89c6b2ce..5016b5748
--- a/shrine-webclient/src/main/html/assets/msg_sniffer.css
+++ b/shrine-webclient/src/main/html/assets/msg_sniffer.css
@@ -1,83 +1,83 @@
-#commViewerSingleMsg-body PRE.msgXML.msgSent {
- border-left: 8px solid #FFAFAF;
- padding: 4px;
-}
-
-#commViewerSingleMsg-body PRE.msgXML.msgReceive {
- border-left: 8px solid #AFFFAF;
- padding: 4px;
-}
-
-
-BODY.msgSnifferViewer {
- margin:0px;
- padding:0px;
- background:#BCE
-}
-
-BODY.msgSnifferViewer DIV.IndexRecord {
- font-size:10px !important;
- clear:both;
- padding:2px;
- cursor: pointer;
- width:250px;
-}
-
-BODY.msgSnifferViewer DIV.IndexRecord.selected { background-color: #FFD }
-
-BODY.msgSnifferViewer DIV.msgChan,
-BODY.msgSnifferViewer DIV.msgAction,
-BODY.msgSnifferViewer DIV.msgOrigin,
-BODY.msgSnifferViewer DIV.msgTime,
-{
- line-height: 10px;
- font-size: 10px !important;
-}
-
-BODY.msgSnifferViewer DIV.recvStatus,
-BODY.msgSnifferViewer DIV.sentStatus {
- height: 12px;
- width:22px;
- float: left;
- border: 1px solid #000;
- text-align: center;
- line-height:10px;
- font-size:10px;
-}
-
-BODY.msgSnifferViewer DIV.sentStatus {
- background: #E99;
- border-bottom: none;
-}
-BODY.msgSnifferViewer DIV.recvStatus {
- background: #9E9;
- clear:both;
-}
-
-
-BODY.msgSnifferViewer DIV.msgXML {
- background:#FFFFFF;
- border:1px solid #678;
- border-top:none;
- xheight:100%;
- xoverflow:scroll;
- xwidth:100%;
-}
-BODY.msgSnifferViewer pre.msgXML {
- border-left:8px solid;
- padding:4px;
-}
-BODY.msgSnifferViewer pre.msgXML.msgSent {
- border-color:#FFAFAF;
-}
-BODY.msgSnifferViewer pre.msgXML.msgRcvd {
- border-color:#AFFFAF;
-}
-
-BODY.msgSnifferViewer DIV.recvStatus.msgError {
- background:#FFFF90 !important;
-}
-
-body.msgSnifferViewer pre.msgXML.msgError {
- border-color:#FFFF90 !important;
-}
+#commViewerSingleMsg-body PRE.msgXML.msgSent {
+ border-left: 8px solid #FFAFAF;
+ padding: 4px;
+}
+
+#commViewerSingleMsg-body PRE.msgXML.msgReceive {
+ border-left: 8px solid #AFFFAF;
+ padding: 4px;
+}
+
+
+BODY.msgSnifferViewer {
+ margin:0px;
+ padding:0px;
+ background:#BCE
+}
+
+BODY.msgSnifferViewer DIV.IndexRecord {
+ font-size:10px !important;
+ clear:both;
+ padding:2px;
+ cursor: pointer;
+ width:250px;
+}
+
+BODY.msgSnifferViewer DIV.IndexRecord.selected { background-color: #FFD }
+
+BODY.msgSnifferViewer DIV.msgChan,
+BODY.msgSnifferViewer DIV.msgAction,
+BODY.msgSnifferViewer DIV.msgOrigin,
+BODY.msgSnifferViewer DIV.msgTime,
+{
+ line-height: 10px;
+ font-size: 10px !important;
+}
+
+BODY.msgSnifferViewer DIV.recvStatus,
+BODY.msgSnifferViewer DIV.sentStatus {
+ height: 12px;
+ width:22px;
+ float: left;
+ border: 1px solid #000;
+ text-align: center;
+ line-height:10px;
+ font-size:10px;
+}
+
+BODY.msgSnifferViewer DIV.sentStatus {
+ background: #E99;
+ border-bottom: none;
+}
+BODY.msgSnifferViewer DIV.recvStatus {
+ background: #9E9;
+ clear:both;
+}
+
+
+BODY.msgSnifferViewer DIV.msgXML {
+ background:#FFFFFF;
+ border:1px solid #678;
+ border-top:none;
+ xheight:100%;
+ xoverflow:scroll;
+ xwidth:100%;
+}
+BODY.msgSnifferViewer pre.msgXML {
+ border-left:8px solid;
+ padding:4px;
+}
+BODY.msgSnifferViewer pre.msgXML.msgSent {
+ border-color:#FFAFAF;
+}
+BODY.msgSnifferViewer pre.msgXML.msgRcvd {
+ border-color:#AFFFAF;
+}
+
+BODY.msgSnifferViewer DIV.recvStatus.msgError {
+ background:#FFFF90 !important;
+}
+
+body.msgSnifferViewer pre.msgXML.msgError {
+ border-color:#FFFF90 !important;
+}
diff --git a/shrine-webclient/src/main/html/assets/msg_snifferIE6.css b/shrine-webclient/src/main/html/assets/msg_snifferIE6.css
old mode 100755
new mode 100644
index af4933d87..d1758fd03
--- a/shrine-webclient/src/main/html/assets/msg_snifferIE6.css
+++ b/shrine-webclient/src/main/html/assets/msg_snifferIE6.css
@@ -1,21 +1,21 @@
-DIV#sniffer_Filters {
- width: 722px !important;
-}
-DIV#sniffer_MatchMsgDisp {
- height: 448px !important;
- top: 30px !important;
- width: 472px !important;
-}
-DIV#sniffer_MatchMsgList {
- height: 448px !important;
- top: 30px !important;
-}
-
-DIV#sniffer_ListButtons {
- top: 441px !important;
- height: 36px !important;
-}
-
-TBODY TR TD {
- font-size: 10px !important;
+DIV#sniffer_Filters {
+ width: 722px !important;
+}
+DIV#sniffer_MatchMsgDisp {
+ height: 448px !important;
+ top: 30px !important;
+ width: 472px !important;
+}
+DIV#sniffer_MatchMsgList {
+ height: 448px !important;
+ top: 30px !important;
+}
+
+DIV#sniffer_ListButtons {
+ top: 441px !important;
+ height: 36px !important;
+}
+
+TBODY TR TD {
+ font-size: 10px !important;
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/assets/new-treeview.css b/shrine-webclient/src/main/html/assets/new-treeview.css
old mode 100755
new mode 100644
index 205c9e4e9..931230b21
--- a/shrine-webclient/src/main/html/assets/new-treeview.css
+++ b/shrine-webclient/src/main/html/assets/new-treeview.css
@@ -1,104 +1,104 @@
-/*
-Copyright (c) 2008, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-version: 2.5.1
-*/
-/* first or middle sibling, no children */
-
-.ygtvtn {
- width:16px; height:18px;
- background: url(sprite-orig.gif) 0 -5600px no-repeat;
-}
-
-/* first or middle sibling, collapsable */
-.ygtvtm {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 -4000px no-repeat;
-}
-
-/* first or middle sibling, collapsable, hover */
-.ygtvtmh {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 -4800px no-repeat;
-}
-
-/* first or middle sibling, expandable */
-.ygtvtp {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 -6400px no-repeat;
-}
-
-/* first or middle sibling, expandable, hover */
-.ygtvtph {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 -7200px no-repeat;
-}
-
-/* last sibling, no children */
-.ygtvln {
- width:16px; height:18px;
- background: url(sprite-orig.gif) 0 -1600px no-repeat;
-}
-
-/* Last sibling, collapsable */
-.ygtvlm {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 0px no-repeat;
-}
-
-/* Last sibling, collapsable, hover */
-.ygtvlmh {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 -800px no-repeat;
-}
-
-/* Last sibling, expandable */
-.ygtvlp {
- width:16px; height:18px;
- cursor:pointer ;
- background: url(sprite-orig.gif) 0 -2400px no-repeat;
-}
-
-/* Last sibling, expandable, hover */
-.ygtvlph {
- width:16px; height:18px; cursor:pointer ;
- background: url(sprite-orig.gif) 0 -3200px no-repeat;
-}
-
-/* Loading icon */
-.ygtvloading {
- width:16px; height:18px; cursor:pointer ;
- background: url(treeview-loading.gif) 0 0 no-repeat;
-}
-
-/* the style for the empty cells that are used for rendering the depth
- * of the node */
-.ygtvdepthcell {
- width:16px; height:18px;
- background: url(sprite-orig.gif) 0 -8000px no-repeat;
-}
-
-.ygtvblankdepthcell { width:16px; height:18px; }
-
-/* the style of the div around each node */
-.ygtvitem { }
-
-/* the style of the div around each node's collection of children */
-.ygtvchildren { }
-* html .ygtvchildren { height:2%; }
-
-/* the style of the text label in ygTextNode */
-.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
- margin-left:2px;
- text-decoration: none;
- background-color: white; /* workaround for IE font smoothing bug */
-}
-
-.ygtvspacer { height: 10px; width: 10px; margin: 2px; }
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.5.1
+*/
+/* first or middle sibling, no children */
+
+.ygtvtn {
+ width:16px; height:18px;
+ background: url(sprite-orig.gif) 0 -5600px no-repeat;
+}
+
+/* first or middle sibling, collapsable */
+.ygtvtm {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -4000px no-repeat;
+}
+
+/* first or middle sibling, collapsable, hover */
+.ygtvtmh {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -4800px no-repeat;
+}
+
+/* first or middle sibling, expandable */
+.ygtvtp {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -6400px no-repeat;
+}
+
+/* first or middle sibling, expandable, hover */
+.ygtvtph {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -7200px no-repeat;
+}
+
+/* last sibling, no children */
+.ygtvln {
+ width:16px; height:18px;
+ background: url(sprite-orig.gif) 0 -1600px no-repeat;
+}
+
+/* Last sibling, collapsable */
+.ygtvlm {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 0px no-repeat;
+}
+
+/* Last sibling, collapsable, hover */
+.ygtvlmh {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -800px no-repeat;
+}
+
+/* Last sibling, expandable */
+.ygtvlp {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -2400px no-repeat;
+}
+
+/* Last sibling, expandable, hover */
+.ygtvlph {
+ width:16px; height:18px; cursor:pointer ;
+ background: url(sprite-orig.gif) 0 -3200px no-repeat;
+}
+
+/* Loading icon */
+.ygtvloading {
+ width:16px; height:18px; cursor:pointer ;
+ background: url(treeview-loading.gif) 0 0 no-repeat;
+}
+
+/* the style for the empty cells that are used for rendering the depth
+ * of the node */
+.ygtvdepthcell {
+ width:16px; height:18px;
+ background: url(sprite-orig.gif) 0 -8000px no-repeat;
+}
+
+.ygtvblankdepthcell { width:16px; height:18px; }
+
+/* the style of the div around each node */
+.ygtvitem { }
+
+/* the style of the div around each node's collection of children */
+.ygtvchildren { }
+* html .ygtvchildren { height:2%; }
+
+/* the style of the text label in ygTextNode */
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
+ margin-left:2px;
+ text-decoration: none;
+ background-color: white; /* workaround for IE font smoothing bug */
+}
+
+.ygtvspacer { height: 10px; width: 10px; margin: 2px; }
diff --git a/shrine-webclient/src/main/html/assets/tree.css b/shrine-webclient/src/main/html/assets/tree.css
old mode 100755
new mode 100644
index 334236d32..c712c1b51
--- a/shrine-webclient/src/main/html/assets/tree.css
+++ b/shrine-webclient/src/main/html/assets/tree.css
@@ -1,103 +1,103 @@
-/*
-Copyright (c) 2006, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.com/yui/license.txt
-Version: 0.11.3
-*/
-
-/* first or middle sibling, no children */
-.ygtvtn {
- width:16px; height:18px;
- background: url('yui/build/treeview/assets/tn.gif') 0 0 no-repeat;
-}
-
-/* first or middle sibling, collapsable */
-.ygtvtm {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/tm.gif') 0 0 no-repeat;
-}
-
-/* first or middle sibling, collapsable, hover */
-.ygtvtmh {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/tmh.gif') 0 0 no-repeat;
-}
-
-/* first or middle sibling, expandable */
-.ygtvtp {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/tp.gif') 0 0 no-repeat;
-}
-
-/* first or middle sibling, expandable, hover */
-.ygtvtph {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/tph.gif') 0 0 no-repeat;
-}
-
-/* last sibling, no children */
-.ygtvln {
- width:16px; height:18px;
- background: url('yui/build/treeview/assets/ln.gif') 0 0 no-repeat;
-}
-
-/* Last sibling, collapsable */
-.ygtvlm {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/lm.gif') 0 0 no-repeat;
-}
-
-/* Last sibling, collapsable, hover */
-.ygtvlmh {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/lmh.gif') 0 0 no-repeat;
-}
-
-/* Last sibling, expandable */
-.ygtvlp {
- width:16px; height:18px;
- cursor:pointer ;
- background: url('yui/build/treeview/assets/lp.gif') 0 0 no-repeat;
-}
-
-/* Last sibling, expandable, hover */
-.ygtvlph {
- width:16px; height:18px; cursor:pointer ;
- background: url('yui/build/treeview/assets/lph.gif') 0 0 no-repeat;
-}
-
-/* Loading icon */
-.ygtvloading {
- width:16px; height:18px;
- background: url('yui/build/treeview/assets/loading.gif') 0 0 no-repeat;
-}
-
-/* the style for the empty cells that are used for rendering the depth
- * of the node */
-.ygtvdepthcell {
- width:16px; height:18px;
- background: url('yui/build/treeview/assets/vline.gif') 0 0 no-repeat;
-}
-
-.ygtvblankdepthcell { width:16px; height:18px; }
-
-/* the style of the div around each node */
-.ygtvitem { }
-
-/* the style of the div around each node's collection of children */
-.ygtvchildren { }
-* html .ygtvchildren { height:2%; }
-
-/* the style of the text label in ygTextNode */
-.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
- margin-left:2px;
- text-decoration: none;
-}
-
-.ygtvspacer { height: 10px; width: 10px; margin: 2px; }
+/*
+Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.com/yui/license.txt
+Version: 0.11.3
+*/
+
+/* first or middle sibling, no children */
+.ygtvtn {
+ width:16px; height:18px;
+ background: url('yui/build/treeview/assets/tn.gif') 0 0 no-repeat;
+}
+
+/* first or middle sibling, collapsable */
+.ygtvtm {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/tm.gif') 0 0 no-repeat;
+}
+
+/* first or middle sibling, collapsable, hover */
+.ygtvtmh {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/tmh.gif') 0 0 no-repeat;
+}
+
+/* first or middle sibling, expandable */
+.ygtvtp {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/tp.gif') 0 0 no-repeat;
+}
+
+/* first or middle sibling, expandable, hover */
+.ygtvtph {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/tph.gif') 0 0 no-repeat;
+}
+
+/* last sibling, no children */
+.ygtvln {
+ width:16px; height:18px;
+ background: url('yui/build/treeview/assets/ln.gif') 0 0 no-repeat;
+}
+
+/* Last sibling, collapsable */
+.ygtvlm {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/lm.gif') 0 0 no-repeat;
+}
+
+/* Last sibling, collapsable, hover */
+.ygtvlmh {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/lmh.gif') 0 0 no-repeat;
+}
+
+/* Last sibling, expandable */
+.ygtvlp {
+ width:16px; height:18px;
+ cursor:pointer ;
+ background: url('yui/build/treeview/assets/lp.gif') 0 0 no-repeat;
+}
+
+/* Last sibling, expandable, hover */
+.ygtvlph {
+ width:16px; height:18px; cursor:pointer ;
+ background: url('yui/build/treeview/assets/lph.gif') 0 0 no-repeat;
+}
+
+/* Loading icon */
+.ygtvloading {
+ width:16px; height:18px;
+ background: url('yui/build/treeview/assets/loading.gif') 0 0 no-repeat;
+}
+
+/* the style for the empty cells that are used for rendering the depth
+ * of the node */
+.ygtvdepthcell {
+ width:16px; height:18px;
+ background: url('yui/build/treeview/assets/vline.gif') 0 0 no-repeat;
+}
+
+.ygtvblankdepthcell { width:16px; height:18px; }
+
+/* the style of the div around each node */
+.ygtvitem { }
+
+/* the style of the div around each node's collection of children */
+.ygtvchildren { }
+* html .ygtvchildren { height:2%; }
+
+/* the style of the text label in ygTextNode */
+.ygtvlabel, .ygtvlabel:link, .ygtvlabel:visited, .ygtvlabel:hover {
+ margin-left:2px;
+ text-decoration: none;
+}
+
+.ygtvspacer { height: 10px; width: 10px; margin: 2px; }
diff --git a/shrine-webclient/src/main/html/i2b2 license 2.1-1159.txt b/shrine-webclient/src/main/html/i2b2 license 2.1-1159.txt
old mode 100755
new mode 100644
index afa7cdcc1..c0afeb6dc
--- a/shrine-webclient/src/main/html/i2b2 license 2.1-1159.txt
+++ b/shrine-webclient/src/main/html/i2b2 license 2.1-1159.txt
@@ -1,56 +1,56 @@
-
-i2b2 Software License ("Software License")
-Version 2.1 - 1/15/2009
-
-
- This Software License covers downloads from the i2b2 project ("i2b2") maintained by the Brigham and Women's Hospital, Inc. ("BWH").
-
- Your downloading, copying, modifying, displaying, distributing or use of any software and/or data from i2b2 (collectively, the "Software") constitutes acceptance of all of the terms and conditions of this Software License. If you do not agree to such terms and conditions, you have no right to download, copy, modify, display, distribute or use the Software.
-
-
-1. As used in this Software License, "you" means the individual downloading and/or using, reproducing, modifying, displaying and/or distributing the Software and the institution or entity which employs or is otherwise affiliated with such individual in connection therewith. The BWH hereby grants you, with right to sublicense, with respect to BWH's rights in the software, and related technical data, if any, which is the subject of this Software License, a royalty-free, non-exclusive license to use, reproduce, make derivative works of, display and distribute the Software, provided that:
-
-(a) You accept and adhere to all of the terms and conditions of this Software License;
-
-(b) In connection with any copy of or sublicense of all or any portion of the Software, all of the terms and conditions in this Software License shall appear in and shall apply to such copy and such sublicensee, including without limitation all source and executable forms and on any user documentation, prefaced with the following words: "All or portions of this licensed product (such portions are the "Software") have been obtained under license from The Brigham and Women's Hospital, Inc. and are subject to the following terms and conditions:"
-
-(c) You preserve and maintain all applicable attributions, copyright notices and licenses included in or applicable to the Software.
-
-
-
-2. Modifications to the Software shall mean any addition to or deletion from the substance or structure of either the Software or any previous Modifications. When Software is released as a series of files, a Modification is: (i) any addition to or deletion from the contents of a file containing the Software or previous Modifications; or (ii) any new file that contains any part of the Software or previous Modifications.
-
-(a) You agree that you will deliver, and you will cause all sublicensees to deliver, to BWH copies of all Modifications that are made to the Software, on or before the date on which the Modifications are distributed to any third party, and you hereby grant to BWH, and will cause all of your sublicensees to grant to BWH, a non-exclusive, royalty-free, irrevocable, non-terminable license to use, reproduce, make derivative works of, display, perform, and distribute any and all Modifications in source code and binary code form for any purpose and to sublicense such rights to others.
-
-(b) You agree that all Modifications of the Software must be clearly identified and marked as such, and must not be misrepresented as being the original Software.
-
-(c) You agree to consider making, but are under no obligation to make, the source code of any of your Modifications to the Software freely available to others on an open source basis.
-
-
-
-3. The license granted under this Software License includes without limitation the right to (i) incorporate the Software into proprietary programs (subject to any restrictions applicable to such programs), (ii) add your own copyright statement to your Modifications of the Software, and (iii) provide additional or different license terms and conditions in your sublicenses of Modifications of the Software; provided that in each case your use, reproduction or distribution of such modifications otherwise complies with the conditions stated in this Software License.
-
-
-4. This Software License does not grant any rights with respect to third party software, except those rights that BWH has been authorized by a third party to grant to you, and accordingly you are solely responsible for (i) obtaining any permissions from third parties that you need to use, reproduce, make derivative works of, display and distribute the Software, and (ii) informing your sublicensees, including without limitation your end-users, of their obligations to secure any such required permissions.
-
-
-5. The Software has been designed for research purposes only and has not been reviewed or approved by the Food and Drug Administration or by any other agency. YOU ACKNOWLEDGE AND AGREE THAT CLINICAL APPLICATIONS ARE NEITHER RECOMMENDED NOR ADVISED. Any commercialization of the Software is at the sole risk of the party or parties engaged in such commercialization. You further agree to use, reproduce, make derivative works of, display and distribute the Software in compliance with all applicable governmental laws, regulations and orders, including without limitation those relating to export and import control.
-
-
-6. The Software is provided "AS IS" and neither BWH nor any contributor to the software (each a "Contributor") shall have any obligation to provide maintenance, support, updates, enhancements or modifications thereto. You acknowledge and agree that you are responsible for your selection, testing, modification, use and distribution of the Software, in any form, and that you hereby expressly waive any claim for any loss, damage, or injury that may occur as a result of your use or distribution of the Software. You agree that you are responsible for obtaining and will maintain insurance providing coverage (including but not limited to general liability and product liability insurance) that is appropriate in light of the waivers and assumptions of liability set forth in this Software License. You furthermore waive any right of recovery against BWH or any Contributor (including any right of subrogation against BWH or any Contributor or any insurer of BWH or any Contributor) for loss or damage arising out of or incident to your use or distribution of the Software.
-
-7. BWH AND ALL CONTRIBUTORS SPECIFICALLY DISCLAIM ALL EXPRESS AND IMPLIED WARRANTIES OF ANY KIND INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL BWH OR ANY CONTRIBUTOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ARISING IN ANY WAY RELATED TO THE SOFTWARE, EVEN IF BWH OR ANY CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. TO THE MAXIMUM EXTENT NOT PROHIBITED BY LAW OR REGULATION, YOU FURTHER ASSUME ALL LIABILITY FOR YOUR USE, REPRODUCTION, MAKING OF DERIVATIVE WORKS, DISPLAY, LICENSE OR DISTRIBUTION OF THE SOFTWARE AND AGREE TO INDEMNIFY AND HOLD HARMLESS BWH AND ALL CONTRIBUTORS (AND ALL RELATED INDIVIDUALS AND ENTITIES) FROM AND AGAINST ANY AND ALL CLAIMS, SUITS, ACTIONS, DEMANDS AND JUDGMENTS ARISING THEREFROM OR FROM ANY MODIFICATIONS OF THE SOFTWARE DELIVERED TO BWH HEREUNDER.
-
-
-8. None of the names, logos or trademarks of BWH or any of BWH's affiliates or any of the Contributors, or any funding agency, may be used to endorse or promote products produced in whole or in part by operation of the Software or derived from or based on the Software without specific prior written permission from the applicable party.
-
-
-9. Any use, reproduction or distribution of the Software which is not in accordance with this Software License shall automatically revoke all rights granted to you under this Software License and render Paragraphs 1 and 2 of this Software License null and void.
-
-
-10. This Software License does not grant any rights in or to any intellectual property owned by BWH or any Contributor except those rights expressly granted hereunder.
-
-
-Version 2.1 - 1/15/08
-
-
+
+i2b2 Software License ("Software License")
+Version 2.1 - 1/15/2009
+
+
+ This Software License covers downloads from the i2b2 project ("i2b2") maintained by the Brigham and Women's Hospital, Inc. ("BWH").
+
+ Your downloading, copying, modifying, displaying, distributing or use of any software and/or data from i2b2 (collectively, the "Software") constitutes acceptance of all of the terms and conditions of this Software License. If you do not agree to such terms and conditions, you have no right to download, copy, modify, display, distribute or use the Software.
+
+
+1. As used in this Software License, "you" means the individual downloading and/or using, reproducing, modifying, displaying and/or distributing the Software and the institution or entity which employs or is otherwise affiliated with such individual in connection therewith. The BWH hereby grants you, with right to sublicense, with respect to BWH's rights in the software, and related technical data, if any, which is the subject of this Software License, a royalty-free, non-exclusive license to use, reproduce, make derivative works of, display and distribute the Software, provided that:
+
+(a) You accept and adhere to all of the terms and conditions of this Software License;
+
+(b) In connection with any copy of or sublicense of all or any portion of the Software, all of the terms and conditions in this Software License shall appear in and shall apply to such copy and such sublicensee, including without limitation all source and executable forms and on any user documentation, prefaced with the following words: "All or portions of this licensed product (such portions are the "Software") have been obtained under license from The Brigham and Women's Hospital, Inc. and are subject to the following terms and conditions:"
+
+(c) You preserve and maintain all applicable attributions, copyright notices and licenses included in or applicable to the Software.
+
+
+
+2. Modifications to the Software shall mean any addition to or deletion from the substance or structure of either the Software or any previous Modifications. When Software is released as a series of files, a Modification is: (i) any addition to or deletion from the contents of a file containing the Software or previous Modifications; or (ii) any new file that contains any part of the Software or previous Modifications.
+
+(a) You agree that you will deliver, and you will cause all sublicensees to deliver, to BWH copies of all Modifications that are made to the Software, on or before the date on which the Modifications are distributed to any third party, and you hereby grant to BWH, and will cause all of your sublicensees to grant to BWH, a non-exclusive, royalty-free, irrevocable, non-terminable license to use, reproduce, make derivative works of, display, perform, and distribute any and all Modifications in source code and binary code form for any purpose and to sublicense such rights to others.
+
+(b) You agree that all Modifications of the Software must be clearly identified and marked as such, and must not be misrepresented as being the original Software.
+
+(c) You agree to consider making, but are under no obligation to make, the source code of any of your Modifications to the Software freely available to others on an open source basis.
+
+
+
+3. The license granted under this Software License includes without limitation the right to (i) incorporate the Software into proprietary programs (subject to any restrictions applicable to such programs), (ii) add your own copyright statement to your Modifications of the Software, and (iii) provide additional or different license terms and conditions in your sublicenses of Modifications of the Software; provided that in each case your use, reproduction or distribution of such modifications otherwise complies with the conditions stated in this Software License.
+
+
+4. This Software License does not grant any rights with respect to third party software, except those rights that BWH has been authorized by a third party to grant to you, and accordingly you are solely responsible for (i) obtaining any permissions from third parties that you need to use, reproduce, make derivative works of, display and distribute the Software, and (ii) informing your sublicensees, including without limitation your end-users, of their obligations to secure any such required permissions.
+
+
+5. The Software has been designed for research purposes only and has not been reviewed or approved by the Food and Drug Administration or by any other agency. YOU ACKNOWLEDGE AND AGREE THAT CLINICAL APPLICATIONS ARE NEITHER RECOMMENDED NOR ADVISED. Any commercialization of the Software is at the sole risk of the party or parties engaged in such commercialization. You further agree to use, reproduce, make derivative works of, display and distribute the Software in compliance with all applicable governmental laws, regulations and orders, including without limitation those relating to export and import control.
+
+
+6. The Software is provided "AS IS" and neither BWH nor any contributor to the software (each a "Contributor") shall have any obligation to provide maintenance, support, updates, enhancements or modifications thereto. You acknowledge and agree that you are responsible for your selection, testing, modification, use and distribution of the Software, in any form, and that you hereby expressly waive any claim for any loss, damage, or injury that may occur as a result of your use or distribution of the Software. You agree that you are responsible for obtaining and will maintain insurance providing coverage (including but not limited to general liability and product liability insurance) that is appropriate in light of the waivers and assumptions of liability set forth in this Software License. You furthermore waive any right of recovery against BWH or any Contributor (including any right of subrogation against BWH or any Contributor or any insurer of BWH or any Contributor) for loss or damage arising out of or incident to your use or distribution of the Software.
+
+7. BWH AND ALL CONTRIBUTORS SPECIFICALLY DISCLAIM ALL EXPRESS AND IMPLIED WARRANTIES OF ANY KIND INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL BWH OR ANY CONTRIBUTOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ARISING IN ANY WAY RELATED TO THE SOFTWARE, EVEN IF BWH OR ANY CONTRIBUTOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. TO THE MAXIMUM EXTENT NOT PROHIBITED BY LAW OR REGULATION, YOU FURTHER ASSUME ALL LIABILITY FOR YOUR USE, REPRODUCTION, MAKING OF DERIVATIVE WORKS, DISPLAY, LICENSE OR DISTRIBUTION OF THE SOFTWARE AND AGREE TO INDEMNIFY AND HOLD HARMLESS BWH AND ALL CONTRIBUTORS (AND ALL RELATED INDIVIDUALS AND ENTITIES) FROM AND AGAINST ANY AND ALL CLAIMS, SUITS, ACTIONS, DEMANDS AND JUDGMENTS ARISING THEREFROM OR FROM ANY MODIFICATIONS OF THE SOFTWARE DELIVERED TO BWH HEREUNDER.
+
+
+8. None of the names, logos or trademarks of BWH or any of BWH's affiliates or any of the Contributors, or any funding agency, may be used to endorse or promote products produced in whole or in part by operation of the Software or derived from or based on the Software without specific prior written permission from the applicable party.
+
+
+9. Any use, reproduction or distribution of the Software which is not in accordance with this Software License shall automatically revoke all rights granted to you under this Software License and render Paragraphs 1 and 2 of this Software License null and void.
+
+
+10. This Software License does not grant any rights in or to any intellectual property owned by BWH or any Contributor except those rights expressly granted hereunder.
+
+
+Version 2.1 - 1/15/08
+
+
diff --git a/shrine-webclient/src/main/html/i2b2_config_data.js b/shrine-webclient/src/main/html/i2b2_config_data.js
index 765adc67b..f74ed8f8e 100644
--- a/shrine-webclient/src/main/html/i2b2_config_data.js
+++ b/shrine-webclient/src/main/html/i2b2_config_data.js
@@ -1,22 +1,24 @@
-{
- urlProxy: '/shrine-proxy/request",
- urlFramework: 'js-i2b2/',
- loginTimeout: 15, // in seconds
- username_label: 'test username:', //Username Label
- password_label: 'test password:', //Password Label
- clientHelpUrl: 'help/pdf/shrine-client-guide.pdf',
- networkHelpUrl: 'help/pdf/shrine-network-guide.pdf',
- wikiBaseUrl: 'https://open.med.harvard.edu/wiki/display/SHRINE/',
-
- // -------------------------------------------------------------------------------------------
- // THESE ARE ALL THE DOMAINS A USER CAN LOGIN TO
- lstDomains: [{
- domain: 'i2b2demo',
- name: 'Harvard',
- debug: true,
- urlCellPM: 'https://shrine-dev1.catalyst/i2b2/services/PMService/',
- allowAnalysis: true,
- isSHRINE: true
- }]
- // -------------------------------------------------------------------------------------------
-}
+{
+ urlProxy: "index.php",
+ urlFramework: "js-i2b2/",
+ loginTimeout: 15, // in seconds
+ //JIRA|SHRINE-519:Charles McGow
+ username_label:"SHRINE Username:", //Username Label
+ password_label:"SHRINE Password:", //Password Label
+ clientHelpUrl: 'help/pdf/shrine-client-guide.pdf',
+ networkHelpUrl:'help/pdf/shrine-network-guide.pdf',
+ wikiBaseUrl: 'https://open.med.harvard.edu/wiki/display/SHRINE/',
+ //JIRA|SHRINE-519:Charles McGow
+ // -------------------------------------------------------------------------------------------
+ // THESE ARE ALL THE DOMAINS A USER CAN LOGIN TO
+ lstDomains: [
+ { domain: "shrinedomain",
+ name: "SHRINE",
+ urlCellPM: "http://127.0.0.1/i2b2/services/PMService/",
+ allowAnalysis: false,
+ debug: true,
+ isSHRINE: true
+ }
+ ]
+ // -------------------------------------------------------------------------------------------
+}
diff --git a/shrine-webclient/src/main/html/i2b2_config_data.js-orig b/shrine-webclient/src/main/html/i2b2_config_data.js-orig
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/index.html b/shrine-webclient/src/main/html/index.html
old mode 100755
new mode 100644
index 95b9b3fa5..a7d2388dc
--- a/shrine-webclient/src/main/html/index.html
+++ b/shrine-webclient/src/main/html/index.html
@@ -1,1389 +1,1430 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
-<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
+<meta http-equiv="X-UA-Compatible" content="IE=8,11" />
<title>Shrine Web Client</title>
<!--
* *************************
* i2b2 Web Client
- * v1.7.02
+ * v1.7.07
* *************************
- * @modified: 06/15/2014
+ * @modified: 03/20/2016
* Contributors:
* Nick Benik
* Griffin Weber, MD, PhD
* Mike Mendis
* Shawn Murphy MD, PhD
+ * Nich Wattanasin
*
*/-->
<script type="text/javascript">
- var i2b2build = "1.7.001 [02/04/2014 4:07 PM] ";
+ var i2b2build = "1.7.007 [03/20/2016 4:07 PM] ";
+
+ //ie does not support trim method
+ if(typeof String.prototype.trim !== 'function') {
+ String.prototype.trim = function() {
+ return this.replace(/^\s+|\s+$/g, '');
+ };
+ }
</script>
<!-- LOAD YUI FROM Yahoo's CDN
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/yahoo/yahoo.js" ></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/event/event.js" ></script>
<script type="text/javascript" src="http://yui.yahooapis.com/2.5.2/build/dom/dom.js"></script>
... etc ...
-->
<!-- LOAD YUI FROM local server -->
<script type="text/javascript" src="js-ext/lodash/lodash.min.js"></script>
<script type="text/javascript" src="js-ext/yui/build/yahoo/yahoo.js" ></script>
<script type="text/javascript" src="js-ext/yui/build/event/event.js" ></script>
<script type="text/javascript" src="js-ext/yui/build/dom/dom.js"></script>
<script type="text/javascript" src="js-ext/yui/build/yuiloader/yuiloader.js"></script>
<script type="text/javascript" src="js-ext/yui/build/dragdrop/dragdrop.js" ></script>
<script type="text/javascript" src="js-ext/yui/build/element/element.js"></script>
<script type="text/javascript" src="js-ext/yui/build/container/container_core.js"></script>
<script type="text/javascript" src="js-ext/yui/build/container/container.js"></script>
<script type="text/javascript" src="js-ext/yui/build/resize/resize.js"></script>
<script type="text/javascript" src="js-ext/yui/build/utilities/utilities.js"></script>
<script type="text/javascript" src="js-ext/yui/build/menu/menu.js" ></script>
<script type="text/javascript" src="js-ext/yui/build/calendar/calendar.js"></script>
<script type="text/javascript" src="js-ext/yui/build/treeview/treeview.js" ></script>
<script type="text/javascript" src="js-ext/yui/build/tabview/tabview.js"></script>
<script type="text/javascript" src="js-ext/yui/build/animation/animation.js"></script>
<script type="text/javascript" src="js-ext/yui/build/datasource/datasource.js"></script>
<script type="text/javascript" src="js-ext/yui/build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="js-ext/yui/build/json/json-min.js"></script>
<script type="text/javascript" src="js-ext/yui/build/datatable/datatable.js"></script>
<script type="text/javascript" src="js-ext/yui/build/button/button.js"></script>
<script type="text/javascript" src="js-ext/yui/build/paginator/paginator-min.js"></script>
<script type="text/javascript" src="js-ext/yui/build/slider/slider-min.js"></script>
+
+<!-- BG -->
+<link type="text/css" href="js-i2b2/cells/CRC/assets/query_report.css" rel="stylesheet" />
+<!-- Load d3.js -->
+<script type="text/javascript" src="js-ext/d3code/d3.v3.js"></script>
+<!-- Load c3.js and stylesheet -->
+<link href="js-ext/c3code/c3.css" rel="stylesheet" type="text/css">
+<script src="js-ext/c3code/c3.js"></script>
+<!-- Load jquery code and turn off $ BG-->
+<script src="js-ext/jquerycode/jquery-1.11.1.js"></script>
+<script>
+$.noConflict();
+// Code that uses other library's $ can follow here.
+</script>
+<!-- BG -->
<!--
<link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/combo?2.6.0/build/assets/skins/sam/skin.css">
-->
<link rel="stylesheet" type="text/css" href="js-ext/yui/build/assets/skins/sam/skin.css">
<link rel="stylesheet" type="text/css" href="js-i2b2/ui.styles/ui.styles.css">
<!-- Bug in IE - use MINIMUM number of LINK and STYLE tags in the DOM as possible: http://support.microsoft.com/kb/262161 -->
<style>
@import url(js-ext/yui/build/fonts/fonts-min.css);
@import url(js-ext/yui/build/tabview/assets/skins/sam/tabview.css);
@import url(js-ext/yui/build/menu/assets/skins/sam/menu.css);
@import url(js-ext/yui/build/button/assets/skins/sam/button.css);
@import url(js-ext/yui/build/container/assets/skins/sam/container.css);
@import url(js-ext/yui/build/container/assets/container.css);
@import url(js-ext/yui/build/calendar/assets/calendar.css);
@import url(js-ext/yui/build/treeview/assets/treeview-core.css);
@import url(js-ext/yui/build/resize/assets/skins/sam/resize.css);
@import url(assets/mod-treeview.css);
@import url(assets/help_viewer.css);
@import url(assets/msg_sniffer.css);
</style>
<script type="text/javascript" src="js-ext/idle-timer.js"></script>
<script type="text/javascript" src="js-ext/YUI_DataTable_PasswordCellEditor.js"></script>
<script type="text/javascript" src="js-ext/YUI_DataTable_MD5CellEditor.js"></script>
<!-- External libraries -->
<script type="text/javascript" src="js-ext/prototype.js"></script>
<script type="text/javascript" src="js-ext/firebug/firebugx.js"></script>
<script type="text/javascript" src="js-ext/excanvas.js"></script>
<script type="text/javascript" src="js-ext/bubbling-min.js"></script>
<script type="text/javascript" src="js-ext/accordion-min.js"></script>
<style type="text/css">
.myAccordion {
float: left;
width: 260px;
float: left;
}
.myAccordion .yui-cms-accordion {
width: 230px;
position:relative;
z-index:10000;
}
.myAccordion .moreinfo {
padding-left: 30px;
}
.myAccordion .yui-cms-accordion .yui-cms-item {
list-style-type: none;
float: left;
display: inline;
width: auto;
}
.myAccordion .yui-cms-accordion .yui-cms-item .accordionToggleItem {
width: 1px;
height: 1px;
display: block;
background: url(assets/images/accordion.gif) no-repeat 0px -200px;
text-decoration: none;
float: left;
}
.myAccordion .yui-cms-accordion .yui-cms-item.selected .accordionToggleItem {
background: url(assets/images/accordion.gif) no-repeat 0px -300px;
}
.myAccordion .yui-cms-accordion .yui-cms-item .bd {
width: 0px;
overflow: hidden;
}
.myAccordion .yui-cms-accordion .yui-cms-item .bd .fixed {
background: none repeat scroll 0 50% #BBCCEE;
padding: 5px;
border: 1px solid #667788;
overflow: hidden;
width: 200px;
height: 250px;
}
.myAccordion .yui-cms-accordion .yui-cms-item .bd .fixedbody {
background: none repeat scroll 0 0 #FFFFFF;
border: 1px solid #667788;
padding: 1px 5px;
height: 245px;
}
</style>
<!-- load i2b2 framework -->
<script type="text/javascript" src="js-i2b2/i2b2_loader.js"></script>
<link type="text/css" href="assets/i2b2.css" rel="stylesheet" />
<link type="text/css" href="assets/i2b2-NEW.css" rel="stylesheet" />
<!-- other auxiliary javascript source files -->
<script type="text/javascript" src="js-i2b2/hive/hive.ui.js"></script>
<!-- SHRINE Enhanced Error -->
<script src="js-i2b2/cells/SHRINE/EnhancedError.js"></script>
<!-- include test helper until tests can be externalized via phantom.js -->
<!-- script type="text/javascript" src="test/jasmine/src/labValueTestHelper.js"></script -->
<script type="text/javascript">
/****************************************************/
/******************** INITIALIZE ********************/
/****************************************************/
// declare and obtain the dimension of the initial browser viewport and initialize screen width division
var rightSideProportion = 0.65;
var initBrowserViewPortDim = document.viewport.getDimensions();
var rightSideWidth = initBrowserViewPortDim.width * rightSideProportion; // this component will take up 75% of the screen
function initI2B2()
{
//debugOnScreen("default.htm.initI2B2: browserViewPort = " + initBrowserViewPortDim.width + " " + initBrowserViewPortDim.height );
i2b2.events.afterCellInit.subscribe(
(function(en,co,a) {
var cellObj = co[0];
var cellCode = cellObj.cellCode;
switch (cellCode) {
case "PM":
// This i2b2 design implementation uses a prebuild login DIV we connect the Project Management cell to
// handle this method of login, the other method used for login is the PM Cell's built in floating
// modal dialog box to prompt for login credentials. You can edit the look and feel of this dialog box
// by editing the CSS file. You can remark out the lines below with no ill effect. Use the following
// javascript function to display the modal login form: i2b2.hive.PM.doLoginDialog();
//cellObj.doConnectForm($('loginusr'),$('loginpass'),$('logindomain'), $('loginsubmit'));
i2b2.PM.doLoginDialog();
break;
}
})
);
i2b2.events.afterHiveInit.subscribe(
(function(ename) {
// Misc GUI actions that need to be done after loading
$('QPD1').style.background = '#FFFFFF';
$('queryBalloon1').style.display = 'block';
})
);
i2b2.events.afterLogin.subscribe(
(function()
{
// after successful login hide the login box and display the application GUI
$('topBar').style.display = 'block';
$('screenQueryData').style.display = 'block';
var splitterName = 'main.splitter';
// update dimension values
initBrowserViewPortDim = document.viewport.getDimensions();
rightSideWidth = initBrowserViewPortDim.width * rightSideProportion; // this component will take up 60% of the screen
if (i2b2.PM.model.admin_only)
{
i2b2.hive.MasterView.setViewMode('Admin');
$('viewMode-Patients').style.display = 'none';
$('viewMode-Analysis').style.display = 'none';
// hide the splitter from view since we don't need it in admin-only mode
var splitter = $( splitterName );
splitter.style.visibility="hidden";
}
else
{
// create the splitter object only after login and not in admin-only mode
i2b2.hive.mySplitter = new Splitter(splitterName, {cont: 'screenQueryData'});
i2b2.hive.MasterView.initViewMode(); //tdw9
}
$('viewMode-Project').innerHTML = "Project: " + i2b2.PM.model.login_projectname;
$('viewMode-User').innerHTML = "User: " + i2b2.PM.model.login_fullname;
$('viewMode-User').title = i2b2.PM.model.userRoles;
if (i2b2.PM.model.login_debugging) { $('debugMsgSniffer').show(); }
}), i2b2
);
// start the i2b2 framework
i2b2.Init();
}
/**
* Grab help links from configuration file.
*/
function initHelp(){
//grab references to anchor elements.
var clientHelp = document.getElementById('clientHelp'),
networkHelp = document.getElementById('networkHelp'),
networkStatus = document.getElementById('networkStatus'),
dlgNetworkStatus= document.getElementById('dlgNetworkStatus');
//anonymous click handler to open client help in new window.
clientHelp.onclick = function(){
window.open(
i2b2.hive.cfg.clientHelpUrl,
'_blank'
);
};
//anonymous click handler to open network help in new window.
networkHelp.onclick = function(){
window.open(
i2b2.hive.cfg.networkHelpUrl,
'_blank'
);
}
if(i2b2.hive.cfg.networkStatusUrl !== undefined) {
dlgNetworkStatus.style.display = networkStatus.style.display = 'inherit';
//anonymous click handler to open network help in new window.
dlgNetworkStatus.onClick = networkStatus.onclick = function(evt){
window.open(
i2b2.hive.cfg.networkStatusUrl,
'_blank'
);
}
}
}
function init() {
// ------------------------------------------------------
// put any pre-i2b2 initialization code here
// ------------------------------------------------------
// initialize the i2b2 framework
initI2B2();
//grab help links from configuration.
initHelp();
}
YAHOO.util.Event.addListener(window, "load", init);
/********************************************************/
/******************** JAVASCRIPT END ********************/
/********************************************************/
</script>
</head>
<body class="yui-skin-sam">
<div id="title-back"></div>
<div class="pageMask" id="topMask" style="display:none;">&nbsp;</div>
<div id="project-request-viewer-panel" style="display:none;">
<div class="hd">i2b2 Web Client Project Request</div>
<div class="bd" id="project-request-viewer-body">
<p>Lorem Ipsum...</p>
</div>
<div class="ft"></div>
</div>
<div id="modifier-viewer-panel" style="display:none;">
<div class="hd">i2b2 Web Client Modifier</div>
<div class="bd" id="modifier-viewer-body">
<p>Lorem Ipsum...</p>
</div>
<div class="ft"></div>
</div>
<div id="help-viewer-panel" style="display:none;">
<div class="hd">i2b2 Web Client Help</div>
<div class="bd" id="help-viewer-body">
<p>Please wait loading help.</p>
</div>
<div class="ft"></div>
</div>
<div id="commViewerSingleMsg-panel" style="display:none;">
<div class="hd">XML Message</div>
<div class="bd" id="commViewerSingleMsg-body"><div class="xmlMsg"></div></div>
<div class="ft"></div>
</div>
<div id="PM-announcement-panel" style="display:none;">
<div class="hd" id="PM-announcement-title">Announcements</div>
<div class="bd" id="PM-announcement-body">
<p>Lorem Ipsum...</p>
</div>
<div class="ft"></div>
</div>
<div id="SHRINE-info-panel" style="display:none;">
<div class="hd" id="SHRINE-info-title">Topic</div>
<div class="bd" id="SHRINE-info-body">
<p>Lorem Ipsum...</p>
</div>
<div class="ft"></div>
</div>
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="topBarTable">
<tr>
<td align="left" valign="middle"><img src="assets/images/title.gif" id="topBarTitle" border="0" alt="" /></td>
<td align="left" valign="middle"><div id="viewMode-Project"></div></td>
<td align="right" valign="middle"><div id="viewMode-User"></div></td>
<td align="right" valign="middle">
<div id="topBar" style="display:none;">
<!-- <form name="projectsForm" style="margin: 0pt; padding: 0pt;" onSubmit="i2b2.PM.selectProject(); return false;">
<select style="font-size:11px;float:left;" onChange="i2b2.PM.view.modal.projectDialog.loadProject()" name="projects" id="loginProjs2"></select>
<input type="hidden" value="" name="i2b2_projects_modal_dialog"/>
</form>
-->
<span id="viewMode-Patients">
<a href="Javascript:void(0)" onClick="i2b2.hive.MasterView.setViewMode('Patients');">Find Patients</a>
&nbsp;|&nbsp; </span>
<!-- <span id="viewMode-Admin">
<a href="Javascript:void(0)" onClick="i2b2.hive.MasterView.setViewMode('Admin');">Admin</a>
&nbsp;|&nbsp;
</span>
-->
<!--span id="viewMode-Analysis">
<a href="Javascript:void(0)" onClick="i2b2.hive.MasterView.setViewMode('Analysis');">Analysis Tools</a>
&nbsp;|&nbsp; </span-->
<span id="debugMsgSniffer" style="display:none">
<a href="Javascript:void(0)" onClick="i2b2.hive.MsgSniffer.show();">Message Log</a>
&nbsp;|&nbsp; </span>
<a id="clientHelp" style="cursor: pointer">Help</a>
&nbsp;|&nbsp;
<a id="networkHelp" style="cursor: pointer">Network Help</a>
&nbsp;|&nbsp;
<a id="networkStatus" style="cursor: pointer; display: none">Network
Status</a>
&nbsp;|&nbsp;
<a href="Javascript:void(0);" onClick="i2b2.PM.doLogout();">Logout</a> </div> </td>
</tr>
</table>
<div id="screenQueryData" style="display:none">
<!-- ############### <ONT View> ############### -->
<div id="ontMainBox" style="display:none">
<div id="ontTopTabs">
<div style="position:absolute;z-index:200;">
<div id="tabNavigate" class="tabBox active" onClick="i2b2.ONT.view.main.selectTab('nav')">
<div>Navigate Terms</div>
</div>
<div id="tabFind" class="tabBox" onClick="i2b2.ONT.view.main.selectTab('find')">
<div>Find Terms</div>
</div>
</div>
<div class="opXML">
<!-- <a href="JavaScript:showXML('ONT',i2b2.ONT.view.main.currentTab,'Request');" class="debug"><img src="assets/images/msg_request.gif" border="0" width="16" height="16" alt="Show XML Request" title="Show XML Request" /></a> -->
<!-- <a href="JavaScript:showXML('ONT',i2b2.ONT.view.main.currentTab,'Response');" class="debug"><img src="assets/images/msg_response.gif" border="0" width="16" height="16" alt="Show XML Response" title="Show XML Response" /></a> -->
<a href="JavaScript:showXML('ONT',i2b2.ONT.view.main.currentTab,'Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a>
<a href="JavaScript:i2b2.ONT.view.main.showOptions();"><img src="assets/images/options.gif" border="0" width="16" height="16" alt="Show Options" title="Show Options" /></a>
<a href="JavaScript:i2b2.ONT.view.main.ZoomView();"><img id="ontZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/ONT/assets/zoom_icon.gif" alt="Resize Workspace" title="Resize Workspace" /></a> </div>
</div>
<div id="ontMainDisp">
<div id="ontNavDisp">
<!--<div id="standardQuery">Standard Query Items</div>-->
<div id="ontNavResults"></div>
</div>
<div id="ontFindDisp" style="display:none">
<a id="ontFindTabName" href="Javascript:i2b2.ONT.view.find.selectSubTab('names')" class="findSubTabSelected" >Search by Names</a>
<a id="ontFindTabCode" href="Javascript:i2b2.ONT.view.find.selectSubTab('codes')" class="findSubTab" >Search by Codes</a>
<div id="ontFindFrameName" class="findSubFrame">
<form id="ontFormFindName" method="post" action="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchName();" style="margin:0px; padding:0px;">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:100%;">
<tr>
<td style="width:100px;" valign="middle"><select name="ontFindStrategy" style="width:90px;overflow:hidden;font-size:11px;"><option value="contains">Containing</option><option value="exact">Exact</option><option value="left">Starting with</option><option value="right">Ending with</option></select></td>
<td valign="middle"><input name="ontFindNameMatch" type="text" maxlength="100" style="border:1px solid #7c9cba;width:100%;font-size:11px;" /></td>
</tr>
<tr><td colspan="2" style="height:5px;overflow:hidden;"></td></tr>
<tr>
<td valign="middle" style="width:135px;"><div class="ontFindButton"><a href="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchName();">Find</a></div><div id="ontFindNameButtonWorking" style="display:none">Searching...</div></td>
<td valign="middle"><select id="ontFindCategory" name="ontFindCategory" style="font-size:11px;"><option value="i2b2">Any Category</option></select></td>
</tr>
</table>
</form>
</div>
<div id="ontSearchNamesResults" oncontextmenu="return false"></div>
<div id="ontFindFrameCode" class="findSubFrame" style="display:none">
<form id="ontFormFindCode" method="post" action="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchCode();" style="margin:1px; padding:0px;">
<div><input id="ontFindCodeMatch" type="text" maxlength="100" style="border:1px solid #7c9cba;width:95%;font-size:11px;" /></div>
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;width:100%; margin-top:5px;">
<tr>
<td style="width:100px;" valign="middle">
<div class="ontFindButton" style=""><a href="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchCode();">Find</a></div><div id="ontFindCodeButtonWorking" style="display:none;"><img src="js-i2b2/cells/ONT/assets/loadera16.gif"/></div>
</td>
<td style="width:280px;" valign="middle">
<select id="ontFindCoding" name="ontFindCoding" style="font-size:11px;">
<option value="">Loading...</option>
</select>
</td>
</tr>
</table>
</form>
</div>
<div id="ontSearchCodesResults" oncontextmenu="return false"></div>
<div id="ontFindFrameModifier" style="display:none" class="findSubFrame">
<div id="ontFindFrameModifierTitle"></div>
<form id="ontFormFindModifier" method="post" action="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchModifier();" style="margin:0px; padding:0px;">
<table border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse;">
<tr>
<td style="width:100px;" valign="middle"><select name="ontFindStrategy" style="width:90px;overflow:hidden;font-size:11px;"><option value="contains">Containing</option><option value="exact">Exact</option><option value="left">Starting with</option><option value="right">Ending with</option></select></td>
<td colspan="2" valign="middle"><input name="ontFindModifierMatch" type="text" maxlength="100" style="border:1px solid #7c9cba;width:100%;font-size:11px;" /></td>
</tr>
<tr><td colspan="3" style="height:5px;overflow:hidden;"></td></tr>
<tr>
<td valign="middle"><div class="ontFindButton" style="width:75px;"><a href="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchModifier('name');">Find Name</a></div><div id="ontFindNameButtonWorking" style="display:none;"><img src="js-i2b2/cells/ONT/assets/loadera16.gif"/></div></td>
<td valign="middle"><div class="ontFindButton" style="width:75px;"><a href="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchModifier('code');">Find Code</a></div><div id="ontFindNameButtonWorking" style="display:none;"><img src="js-i2b2/cells/ONT/assets/loadera16.gif"/></div></td>
<td valign="middle"><div class="ontFindButton" style="width:75px;"><a href="JavaScript:i2b2.ONT.ctrlr.FindBy.clickSearchModifier('all');">Get All</a></div><div id="ontFindNameButtonWorking" style="display:none;"><img src="js-i2b2/cells/ONT/assets/loadera16.gif"/></div></td>
</tr>
</table>
</form>
</div>
<div id="ontSearchModifiersResults" oncontextmenu="return false"></div>
</div>
<div id="ontBalloonBox" xonmouseover="i2b2.ONT.view.main.hballoon.hideBalloons()">
<!--
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tr><td align="center">
<div id="ontBalloon">drag an<br />item<br />from here</div>
</td></tr></table>
-->
</div>
</div>
<!--
<div class="myAccordion">
<div class="yui-cms-accordion vertical fast">
<div class="yui-cms-item">
<a href="#" class="accordionToggleItem" title="click to expand">&nbsp;</a>
<div class="bd">
<div class="fixed" id="ontModifier">
Modifier Info
</div>
</div>
</div>
</div>
</div>
-->
<div style="clear:both;"></div>
</div>
<!-- ############### </ONT View> ############### -->
<!-- ############### <PM Navigation View> ############### -->
<div id="pmNav" style="display:none;">
<div class="TopTabs">
<div class="tabBox active">
<div>PM Navigation</div>
</div>
</div>
<div class="bodyBox">
<div id="pmNavTreeview" class="StatusBoxText"></div>
</div>
</div>
<!-- ############### </PM Navigation View> ############### -->
<!-- ############### <PM Main Table View> ############### -->
<div id="pmMain" style="display:none;">
<div class="TopTabs">
<div class="tabBox active">
<div id="pmMainTitle">Primary Table</div>
</div>
<div class="opXML">
<a href="JavaScript:showXML('PM','Admin','Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a> </div>
</div>
<div class="bodyBox">
<div id="pmAdminMainView" class="StatusBoxText" style="overflow:auto">
<div id="pmAdminHelp" style="margin-bottom:20px">Intro to PM Administration interface</div>
<div id="pmAdminMainTableview" style="display:none"></div>
<div id="pmAdminTableviewButtons" style="display:none; margin-bottom:25px">testing</div>
<div id="pmAdminParamTableview" style="display:none;"></div>
<div id="pmAdminParamTableviewButtons" style="display:none; margin-bottom:25px">testing</div>
</div>
</div>
</div>
<!-- ############### </PM Main Table View> ############### -->
<!-- ############### <PM Parmeter View> ############### -->
<div id="pmParam" style="display:none;">
<div class="TopTabs">
<div class="tabBox active">
<div>Parameter</div>
</div>
<div class="opXML">
<a href="JavaScript:showXML('PM','main','Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a>
<a href="JavaScript:i2b2.WORK.view.main.ZoomView();"><img id="wrkZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/WORK/assets/zoom_icon.gif" alt="Resize Workspace" title="Resize Workspace" /></a> </div>
</div>
<div class="bodyBox">
<span id="goParam" class="yui-button yui-push-button" style="float:right;">
<span class="first-child">
<button type="button">Add</button>
</span>
</span>
<br clear="all"/>
<!-- <div id="wrkTreeview" class="StatusBoxText"></div> -->
<div id="pmParamTableview" class="StatusBoxText"></div>
</div>
</div>
<!-- ############### </PM Parmeter View> ############### -->
<!-- ############### <WRK View> ############### -->
<div id="wrkWorkplace" style="display:none;">
<div class="TopTabs">
<div class="tabBox active">
<div>Workplace</div>
</div>
<div class="opXML">
<!-- <a href="JavaScript:showXML('WORK','main','Request');" class="debug"><img src="assets/images/msg_request.gif" border="0" width="16" height="16" alt="Show XML Request" title="Show XML Request" /></a> -->
<!-- <a href="JavaScript:showXML('WORK','main','Response');" class="debug"><img src="assets/images/msg_response.gif" border="0" width="16" height="16" alt="Show XML Response" title="Show XML Response" /></a> -->
<a href="JavaScript:showXML('WORK','main','Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a>
<!-- <a href="JavaScript:i2b2.WORK.view.main.showOptions();"><img src="assets/images/options.gif" border="0" width="16" height="16" alt="Show Options" title="Show Options" /></a> -->
<a href="JavaScript:i2b2.WORK.view.main.ZoomView();"><img id="wrkZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/WORK/assets/zoom_icon.gif" alt="Resize Workspace" title="Resize Workspace" /></a> </div>
</div>
<div class="bodyBox">
<div id="wrkTreeview" class="StatusBoxText"></div>
</div>
</div>
<!-- ############### </WRK View> ############### -->
<!-- ############### <CRC History View> ############### -->
<div id="crcHistoryBox" style="display:none;">
<div class="TopTabs">
<div class="tabBox active">
<div>Previous Queries</div>
</div>
<div class="opXML">
<!-- <a href="JavaScript:showXML('CRC','history','Request');" class="debug"><img src="assets/images/msg_request.gif" border="0" width="16" height="16" alt="Show XML Request" title="Show XML Request" /></a> -->
<!-- <a href="JavaScript:showXML('CRC','history','Response');" class="debug"><img src="assets/images/msg_response.gif" border="0" width="16" height="16" alt="Show XML Response" title="Show XML Response" /></a> -->
<a href="JavaScript:showXML('CRC','history','Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a>
<!-- added refresh history button -->
<a href="JavaScript:i2b2.CRC.ctrlr.history.Refresh();">
<div id='refPrevQS' style='display:inline'>
<img height="16" width="16" border="0" title="Refresh Previous Queries" alt="Refresh Previous Queries" src="assets/images/refreshButton.JPG">
</div>
<div id='refPrev2QS' style='display:none'>
<img height="16" width="16" border="0" title="Refresh Previous Queries" alt="Refresh Previous Queries" src="assets/images/loadera16.gif">
</div>
</a>
<a href="JavaScript:i2b2.CRC.view.history.showOptions();"><img src="assets/images/options.gif" border="0" width="16" height="16" alt="Show Options" title="Show Options" /></a>
<a href="JavaScript:i2b2.CRC.view.history.ZoomView();"><img id="histZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/WORK/assets/zoom_icon.gif" alt="Resize Workspace" title="Resize Workspace" /></a> </div>
</div>
<div class="bodyBox">
<div id="crcHistoryData" oncontextmenu="return false"></div>
</div>
</div>
<!-- ############### </CRC History View> ############### -->
<!-- ############### <CRC QueryTool View> ############### -->
<div id="crcQueryToolBox">
<div class="TopTabs">
<div class="tabBox active">
<div>Query Tool</div>
</div>
<div class="opXML">
<!-- <a href="JavaScript:showXML('CRC','QT','Request');" class="debug"><img src="assets/images/msg_request.gif" border="0" width="16" height="16" alt="Show XML Request" title="Show XML Request" /></a> -->
<!-- <a href="JavaScript:showXML('CRC','QT','Response');" class="debug"><img src="assets/images/msg_response.gif" border="0" width="16" height="16" alt="Show XML Response" title="Show XML Response" /></a> -->
<a href="JavaScript:showXML('CRC','QT','Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a>
<a href="JavaScript:i2b2.CRC.view.QT.showOptions();"><img src="assets/images/options.gif" border="0" width="16" height="16" alt="Show Options" title="Show Options" /></a>
<a href="JavaScript:i2b2.CRC.view.QT.ZoomView();"><img id="qtZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/CRC/assets/zoom_icon.gif" alt="Resize Workspace" title="Resize Workspace" /></a> </div>
</div>
<div class="bodyBox" id="crcQueryToolBox.bodyBox">
<div class="queryNameBar" id="queryNameBar" style="width:512px;">
<div class="queryLabel">Query Name:&nbsp;</div>
<div id="queryName"></div>
</div>
<div class="queryNameBar" id="temporalConstraintBar" style="width:512px;">
<div class="queryLabel" id="temporalConstraintLabel" style="width:120px; visibility:hidden">Temporal Constraint:&nbsp;</div>
<div class="qryTemporalConstraint" id="temporalConstraintDiv" style="float:left;overflow:hidden">
<input type="submit" id="queryTiming" name="queryTiming" value="Treat all groups independently">
<select id="menubutton1select" name="menubutton1select">
<option value="ANY">Treat all groups independently</option>
<option value="SAMEVISIT">Selected groups occur in the same financial encounter</option>
<option value="TEMPORAL">Define sequence of Events</option>
</select>
</div>
</div>
<div class="queryNameBar" id="defineTemporalBar" style="width:512px;display:none;">
<div class="qryTemporalConstraint" id="temporalConstraintDiv" style="float:left;overflow:hidden">
<input type="submit" id="defineTemporal" name="defineTemporal" value="Population in which events occur">
<select id="menubutton2select" name="menubutton2select">
<option value="0">Population in which events occur</option>
<option value="1">Event 1</option>
<option value="2">Event 2</option>
<option value="BUILDER">Define order of events</option>
<!-- <option value="ENCOUNTER">Selected groups occur in financial encounters in the specified order</option>
<option value="SAMEINSTANCENUM">Items Instance will be the same</option> -->
</select>
<button id="addDefineGroup">New Event</button>
</div>
</div>
<div id="crcQryToolPanels" style="width:512px;overflow:hidden;">
<div id = "crc.innerQueryPanel" style="width:550px;">
<div class="qryPanel">
<div class="qryPanelTitle">
<div class="qryPanelClear" style="float:right"><a href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[0].doDelete();"><img src="js-i2b2/cells/CRC/assets/QryTool_b_clear.gif" border="0" alt="Clear" /></a></div>
<div id="queryPanelTitle1">Group 1</div>
</div>
<div class="qryPanelButtonBar">
<div class="qryButtonDate" style="float:left"><a id="queryPanelDatesB1" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.dateConstraint.showDates(0)" title="Select the date range for this group's criterion to have occured within...">Dates</a></div>
<div class="qryButtonOccurs" style="float:left"><a id="queryPanelOccursB1" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[0].showOccurs()" title="Select the minimum number of times this group's criterion has occured...">Occurs &gt; <span id="QP1Occurs">0</span>x</a></div>
<div class="qryButtonExclude" style="float:left"><a id="queryPanelExcludeB1" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[0].doExclude()" title="Exclude records matching this group's criteria...">Exclude</a></div>
</div>
<div class="qryPanelTiming">
<div id="queryPanelTimingText" style="float:left">
<input type="submit" id="queryPanelTimingB1" name="queryPanelTiming" value="Treat Independently">
<select id="menubutton1select" name="menubutton1select">
<option value="ANY">Treat Independently</option>
<option value="SAMEVISIT">Occurs in Same Encounter</option>
</select>
</div>
<div class="qryButtonLimitB1" id="qryButtonLimitB1" style="display:none; float:right;"><a id="queryPanelLimitB1" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[0].showLimit()" title="Select the minimum number of times this group's criterion has occured...">Limit</a></div>
<!-- <div class="qryPanelButtonBar2">
<div class="qryPanelTiming" id="queryPanelTimingB1" style="float:left"></div> -->
</div>
<div id="QPD1" style="clear:both" oncontextmenu="return false" class="queryPanel"></div>
</div>
<div class="qryPanel" style="margin-left:2px;">
<div class="qryPanelTitle">
<div class="qryPanelClear" style="float:right"><a href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[1].doDelete();"><img src="js-i2b2/cells/CRC/assets/QryTool_b_clear.gif" border="0" alt="Clear" /></a></div>
<div id="queryPanelTitle2">Group 2</div>
</div>
<div class="qryPanelButtonBar">
<div class="qryButtonDate" style="float:left"><a id="queryPanelDatesB2" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.dateConstraint.showDates(1)" title="Select the date range for this group's criterion to have occured within...">Dates</a></div>
<div class="qryButtonOccurs" style="float:left"><a id="queryPanelOccursB2" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[1].showOccurs()" title="Select the minimum number of times this group's criterion has occured...">Occurs &gt; <span id="QP2Occurs">0</span>x</a></div>
<div class="qryButtonExclude" style="float:left"><a id="queryPanelExcludeB2" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[1].doExclude()" title="Exclude records matching this group's criteria...">Exclude</a></div>
</div>
<div class="qryPanelTiming" style="float:left">
<input type="submit" id="queryPanelTimingB2" name="queryPanelTiming" value="Treat Independently">
<select id="menubutton1select" name="menubutton1select">
<option value="ANY">Treat Independently</option>
<option value="SAMEVISIT">Occurs in Same Encounter</option>
</select>
</div>
<div id="QPD2" style="clear:both" oncontextmenu="return false" class="queryPanel"></div>
</div>
<div class="qryPanel" style="margin-left:2px;">
<div class="qryPanelTitle">
<div class="qryPanelClear" style="float:right"><a href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[2].doDelete();"><img src="js-i2b2/cells/CRC/assets/QryTool_b_clear.gif" border="0" alt="Clear" /></a></div>
<div id="queryPanelTitle3">Group 3</div>
</div>
<div class="qryPanelButtonBar">
<div class="qryButtonDate" style="float:left"><a id="queryPanelDatesB3" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.dateConstraint.showDates(2)" title="Select the date range for this group's criterion to have occured within...">Dates</a></div>
<div class="qryButtonOccurs" style="float:left"><a id="queryPanelOccursB3" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[2].showOccurs()" title="Select the minimum number of times this group's criterion has occured...">Occurs &gt; <span id="QP3Occurs">0</span>x</a></div>
<div class="qryButtonExclude" style="float:left"><a id="queryPanelExcludeB3" class="queryPanelButton" href="JavaScript:i2b2.CRC.ctrlr.QT.panelControllers[2].doExclude()" title="Exclude records matching this group's criteria...">Exclude</a></div>
</div>
<div class="qryPanelTiming" style="float:left">
<input type="submit" id="queryPanelTimingB3" name="queryPanelTiming" value="Treat Independently">
<select id="menubutton1select" name="menubutton1select">
<option value="ANY">Treat Independently</option>
<option value="SAMEVISIT">Occurs in Same Encounter</option>
</select>
</div>
<div id="QPD3" style="clear:both" oncontextmenu="return false" class="queryPanel"></div>
</div>
<div style="clear:both; width:100%; height:5px; overflow:hidden;"></div>
<!-- query topic panel added in -->
<div id="queryTopicPanel" style="margin-bottom:6px; display:none">
<select id="queryTopicSelect" style="height:20px; width:330px; border: solid 1px #6677AA;">
<option value="">---- Select a Query Topic ----</option>
</select>
<!--
<a class="topicButton" href="javascript:void(0)"
style="height: 21px; top:1px; position:relative; width:43px" onclick="i2b2.SHRINE.TopicInfo()">Info</a>
-->
<a class="topicButton" href="javascript:void(0)"
style="height: 21px; top:1px; position:relative; width: 133px"
onclick="i2b2.SHRINE.RequestTopic()">Request New Topic</a>
</div>
<div id="queryBalloonBox" onMouseOver="i2b2.CRC.view.QT.hballoon.hideBalloons()">
<div class="queryBalloon" id="queryBalloon1">drop a<br />term<br />on here</div>
<div class="queryBalloonAnd" id="queryBalloonAnd1">AND</div>
<div class="queryBalloon" id="queryBalloon2">drop a<br />term<br />on here</div>
<div class="queryBalloonAnd" id="queryBalloonAnd2">AND</div>
<div class="queryBalloon" id="queryBalloon3">drop a<br />term<br />on here</div>
</div>
</div>
<div id = "crc.temoralBuilder" style="width:550px;display:none;">
<div id="temporalbuilders" style="overflow:auto;">
<div class="relationshipAmongEvents" id="temporalbuilder_0">
<select id="preloc1[0]" name="preloc1[0]" style="width:100px;"><option value="STARTDATE">Start of</option><option value="ENDDATE">End of</option></select>
<select id="instanceopf1[0]" name="instanceopf1[0]" style="width:150px;"><option value="FIRST">the First Ever</option><option value="LAST">the Last Ever</option><option value="ANY">any</option></select>
<select id="instancevent1[0]" name="instancevent1[0]" style="width:100px;"><option value="Event 1" selected="selected">Event 1</option><option value="Event 2">Event 2</option></select>
<br/>
<select id="postloc[0]" name="postloc[0]" style="width:150px;">
<option value="LESS">Occurs Before</option>
<option value="LESSEQUAL">Occurs On Or Before</option>
<option value="EQUAL">Equals</option>
<option value="GREATER">Occurs On Or After</option>
<option value="GREATEREQUAL">Occurs After</option>
</select>
<br/>
<select id="preloc2[0]" name="preloc2[0]" style="width:100px;"><option value="STARTDATE">Start of</option><option value="ENDDATE">End of</option></select>
<select id="instanceopf2[0]" name="instanceopf2[0]" style="width:150px;"><option value="FIRST">the First Ever</option><option value="LAST">the Last Ever</option><option value="ANY">any</option></select>
<select id="instancevent2[0]" name="instancevent2[0]" style="width:100px;"><option value="Event 1">Event 1</option><option value="Event 2" selected="selected">Event 2</option></select>
<br/>
<input id="bytime1[0]" name="bytime1[0]" type="checkbox">By <select id="byspan1[0]" name="byspan1[0]" style="width:50px;"><option value="GREATER">&gt;</option><option value="GREATEREQUAL" selected="selected">&ge;</option><option value="EQUAL">=</option><option value="LESSEQUAL">&le;</option><option value="LESS">&lt;</option></select>
<input id="bytimevalue1[0]" name="bytimevalue1[0]" style="width:50px;" type="text" value="1">
<select id="bytimeunit1[0]" name="bytimeunit1[0]" style="width:100px;">
<option value="HOUR">hour(s)</option>
<option value="DAY" selected="selected">day(s)</option>
<option value="MONTH">month(s)</option>
<option value="YEAR">year(s)</option></select>
<br/>
<input id="bytime2[0]" name="bytime2[0]" type="checkbox">And <select id="byspan2[0]" name="byspan2[0]" style="width:50px;"><option value="GREATER">&gt;</option><option value="GREATEREQUAL">&ge;</option><option value="EQUAL">=</option><option value="LESSEQUAL" selected="selected">&le;</option><option value="LESS">&lt;</option></select>
<input id="bytimevalue2[0]" name="bytimevalue2[0]" style="width:50px;" type="text" value="1">
<select id="bytimeunit2[0]" name="bytimeunit2[0]" style="width:100px;">
<option value="HOUR">hour(s)</option>
<option value="DAY" selected="selected">day(s)</option>
<option value="MONTH">month(s)</option>
<option value="YEAR">year(s)</option></select>
</div>
</div>
<center>
<div id="addTemporalBox"><a href="JavaScript:i2b2.CRC.ctrlr.QT.doAddTemporal()">Add Temporal Relationship</a></div>
</center>
</div>
</div>
<div id="qryToolFooter" style="width:512px; overflow:hidden">
<div id="runBox"><a href="JavaScript:i2b2.CRC.ctrlr.QT.doQueryRun()"><span id="runBoxText">Run Query</span></a></div>
<div id="newBox"><a href="JavaScript:i2b2.CRC.ctrlr.QT.doQueryClear();">Clear</a></div>
<div id="printQueryBox"><a href="JavaScript:i2b2.CRC.ctrlr.QT.doPrintQuery();">Print Query</a></div>
<div id="groupCount" style="width:75px;float:left;height:16px;overflow:hidden;"></div>
<div id="scrollBox">
<a href="JavaScript:i2b2.CRC.ctrlr.QT.doScrollFirst();"><img id="panelScrollFirst" src="js-i2b2/cells/CRC/assets/QryTool_b_first_hide.gif" border="0" alt="Go First" /></a>
<a href="JavaScript:i2b2.CRC.ctrlr.QT.doScrollPrev();"><img id="panelScrollPrev" src="js-i2b2/cells/CRC/assets/QryTool_b_prev_hide.gif" border="0" alt="Go Previous" /></a>
<a href="JavaScript:i2b2.CRC.ctrlr.QT.doScrollNew();"><img src="js-i2b2/cells/CRC/assets/QryTool_b_newgroup.gif" border="0" alt="Add New" /></a>
<a href="JavaScript:i2b2.CRC.ctrlr.QT.doScrollNext();"><img id="panelScrollNext" src="js-i2b2/cells/CRC/assets/QryTool_b_next_hide.gif" border="0" alt="Go Next" /></a>
<a href="JavaScript:i2b2.CRC.ctrlr.QT.doScrollLast();"><img id="panelScrollLast" src="js-i2b2/cells/CRC/assets/QryTool_b_last_hide.gif" border="0" alt="Go Last" /></a>
</div>
</div>
</div>
</div>
<!-- ############### <CRC Status View> ############### -->
<div id="crcStatusBox" style="display:none">
<div class="TopTabs">
- <div class="tabBox tabQueryStatus active"><div>Query Status</div></div>
+ <div class="tabBox tabQueryStatus active" onClick="i2b2.CRC.view.status.selectTab('status')">
+ <div>Query Status</div>
+ </div>
<div class="opXML">
- <a href="JavaScript:i2b2.CRC.ctrlr.QT.doPrintQuery();"><img id="qtPrintImg" width="16" height="16" border="0" src="js-i2b2/cells/CRC/assets/printer_img.gif" alt="Print Query" title="Print Query" /></a>
+ <a href="JavaScript:i2b2.CRC.ctrlr.QT.doPrintQuery();"><img id="qtPrintImg" width="16" height="16" border="0" src="js-i2b2/cells/CRC/assets/printer_img.gif" alt="Print Query" title="Print Query" /></a>&nbsp;
+ <a href="JavaScript:i2b2.CRC.view.status.ZoomView();"><img width="16" height="16" border="0" src="js-i2b2/cells/CRC/assets/zoom_icon.gif" alt="Resize Workspace" /></a>
</div>
-
+ <!-- BG -->
+ <div class="tabBox tabQueryGraphs" onClick="i2b2.CRC.view.status.selectTab('graphs')">
+ <div>Graph Results</div>
+ </div>
+ <div class="tabBox tabQueryReport" onClick="i2b2.CRC.view.status.selectTab('queryReport')">
+ <div>Query Report</div>
+ </div>
+ <div class="tabBox tabDownloadData" onClick="i2b2.CRC.view.status.selectTab('downloadData')">
+ <div>Download Results</div>
+ </div>
+ <!-- BG -->
</div>
<div class="StatusBox">
<div id="infoQueryStatusText" class="StatusBoxText" oncontextmenu="return false"></div>
+ <!-- BG -->
+ <div id="infoQueryStatusChart" class="StatusBoxChart" oncontextmenu="return false" style="display:none"></div>
+ <div id="infoQueryStatusReport" class="StatusBoxReport" oncontextmenu="return false" style="display:none"></div>
+ <div id="infoDownloadStatusData" class="StatusBoxDownload" oncontextmenu="return false" style="display:none"></div>
+ <!-- BG -->
</div>
</div>
<!-- ############### <Workplace> ############### -->
<div class="PluginListBox" style="display:none;">
</div>
<!-- ############### </Workplace> ############### -->
<!-- ############### <PluginMgr List View> ############### -->
<div id="anaPluginListBox" style="display:none">
<div class="TopTabs">
<div class="tabBox tabPluginList active" ><div>Plugins</div></div>
<div class="opXML">
<!-- <a href="JavaScript:i2b2.PLUGINMGR.view.list.showOptions();"><img src="assets/images/options.gif" border="0" width="16" height="16"></a> -->
<a href="JavaScript:i2b2.PLUGINMGR.view.list.ZoomView();"><img id="pluglstZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/CRC/assets/zoom_icon.gif" alt="Resize Workspace" /></a> </div>
</div>
<a id="plugListRecDETAIL-CLONE" class="pluginRecordBox DETAIL" style="display:none">
<div class="Icon"><img src="js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_32x32.gif" alt="" /></div>
<div class="txtBoundBox">
<div class="Name">Plugin Name</div>
<div class="Descript">Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</div>
</div>
<div style="clear:both"></div>
</a>
<a id="plugListRecSUMMARY-CLONE" class="pluginRecordBox SUMMARY" style="display:none">
<div class="Icon"><img src="js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_16x16.gif" alt="" /></div>
<div class="txtBoundBox Name">Plugin Name</div>
<div style="clear:both"></div>
</a>
<div class="PluginListBox">
<div class="topmenu" oncontextmenu="return false">
<form style="margin-top:1px;" action="javascript:void(0)">
<div style="float:left;"><select id="anaPluginView" style="width:160px" onChange="i2b2.PLUGINMGR.view.list.Render()"><option value="DETAIL">Detailed List View</option><option value="SUMMARY">Summary List View</option></select></div>
Category: <select id="anaPluginCats" style="width:200px" onChange="i2b2.PLUGINMGR.view.list.Render();"><option value="">Loading...</option></select>
</form>
</div>
<div id="anaPluginList" oncontextmenu="return false"></div>
</div>
<div style="clear:both;"></div>
</div>
<!-- ############### </PluginMgr List View> ############### -->
<!-- ############### <Plugin Viewer> ############### -->
<div id="anaPluginViewBox" style="display:none">
<div class="TopTabs">
<div class="tabBox active"><div>Plugin Viewer</div></div>
<div class="opXML">
<!-- <a href="JavaScript:showXML('PLUGINMGR','PlugView','Request');" class="debug"><img src="assets/images/msg_request.gif" border="0" width="16" height="16" alt="Show XML Request" title="Show XML Request" /></a> -->
<!-- <a href="JavaScript:showXML('PLUGINMGR','PlugView','Response');" class="debug"><img src="assets/images/msg_response.gif" border="0" width="16" height="16" alt="Show XML Response" title="Show XML Response" /></a> -->
<a href="JavaScript:showXML('PLUGINMGR','PlugView','Stack');" class="debug"><img src="assets/images/msg_stack.gif" border="0" width="16" height="16" alt="Show XML Message Stack" title="Show XML Message Stack" /></a>
<a href="JavaScript:i2b2.PLUGINMGR.view.PlugView.showOptions();"><img src="assets/images/options.gif" border="0" width="16" height="16" alt="Show Options" title="Show Options" /></a>
<a href="JavaScript:i2b2.PLUGINMGR.ctrlr.main.ZoomView();"><img id="plugviewZoomImg" width="16" height="16" border="0" src="js-i2b2/cells/PLUGINMGR/assets/zoom_icon.gif" alt="Resize Workspace" title="Resize Workspace" /></a> </div>
</div>
<div class="PluginViewBox">
<div id="anaPluginViewFrame" oncontextmenu="return false">
<div class="initialMsg">Select a plugin to load from the "Plugins" window.</div>
</div>
<iframe id="anaPluginIFRAME" src="assets/blank.html" style="display:none"></iframe>
</div>
<div style="clear:both;"></div>
</div>
<!-- ############### </Plugin Viewer> ############### -->
<div class="pageMask" id="itemOptionsMask" style="display:none" onClick="hidePopMenu();" onMouseDown="hidePopMenu();"></div>
<div class="pageMask" id="itemConstraintsMask" style="background-color: #000; filter:alpha(opacity=25); -moz-opacity:0.25;opacity: 0.25; display:none">&nbsp;</div>
<div id="itemOptions" style="display:none"></div>
<div id="itemConstraints" style=""></div>
<!-- ############### <Option Screens> ############### -->
<div id="optionsQT" style="display:none;">
<div class="hd" style="background:#6677AA;">Query Tool Options</div>
<div class="bd">
<center>
<table style="font-size:12px">
<!-- <tr><td>Maximum Number of Children to Display:</td><td><input id="MaxChldDisp" style="width:35px" /></td></tr> -->
<tr><td>Maximum Time to Wait for XML Response (in seconds):</td><td><input id="QryTimeout" style="width:35px" /></td></tr>
</table>
</center>
</div>
</div>
<div id="optionsHistory" style="display:none;">
<div class="hd" style="background:#6677AA;">Options for "Previous Queries" Window</div>
<div class="bd">
<center><br />
<table style="font-size:12px">
<tr><td>Maximum Number of Queries to Display:</td><td><input id="HISTMaxQryDisp" style="width:35px" /></td></tr>
<tr><td colspan="2"><br />Sort Queries</td></tr><tr><td colspan="2" class="dateBorder" align="center"><table id="HISToptSortBox" style="font-size:12px; text-align:left;">
<tr><td><input type="radio" name="HISTsortBy" id="HISTsortByNAME" value="NAME" checked="checked" /> By Name</td></tr><tr><td><input type="radio" name="HISTsortBy" id="HISTsortByDATE" value="DATE" /> By Create Date</td></tr>
<tr><td colspan="2"><hr width="75%" /></td></tr>
<tr><td><input type="radio" name="HISTsortOrder" id="HISTsortOrderASC" value="ASC" checked="checked" /> Ascending</td><td><input type="radio" name="HISTsortOrder" id="HISTsortOrderDESC" value="DESC" /> Descending</td>
</tr></table></td></tr>
</table>
</center>
</div>
</div>
<div id="optionsOntNav" style="display:none;">
<div class="hd" style="background:#6677AA;">Options for Navigating Terms</div>
<div class="bd">
<br />
<div style="font-size:12px; margin-left:50px" >Maximum Number of Children to Display: <input id="ONTNAVMaxQryDisp" style="width:35px" value="200" /></div>
<div style="margin-left:50px"><input type="checkbox" id="ONTNAVshowHiddens" /> Show Hidden Terms</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTNAVshowSynonyms" /> Show Synonymous Terms</div>
<div style="margin-left:50px"><input type="checkbox" checked id="ONTNAVshowPatientCounts" /> Enable Patient Counts</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTNAVshowShortTooltips" /> Use Short Tooltips</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTNAVshowCodeTooltips" /> Show Concept Codes in Tooltips</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTNAVdisableModifiers" /> Disable Modifiers</div>
</div>
</div>
<div id="optionsOntFind" style="display:none;">
<div class="hd" style="background:#6677AA;">Options for Finding Terms</div>
<div class="bd">
<br />
<div style="font-size:12px; margin-left:50px" >Maximum Number of Children to Display: <input id="ONTFINDMaxQryDisp" style="width:35px" value="200" /></div>
<div style="margin-left:50px"><input type="checkbox" id="ONTFINDshowHiddens" /> Show Hidden Terms</div>
<div style="margin-left:50px"><input type="checkbox" checked id="ONTFINDshowSynonyms" /> Show Synonymous Terms</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTFINDshowPatientCounts" /> Enable Patient Counts</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTFINDshowShortTooltips" /> Use Short Tooltips</div>
<div style="margin-left:50px"><input type="checkbox" checked id="ONTFINDshowCodeTooltips" /> Show Concept Codes in Tooltips</div>
<div style="margin-left:50px"><input type="checkbox" id="ONTFINDdisableModifiers" /> Disable Modifiers</div>
</div>
</div>
<!-- ############### </Option Screens> ############### -->
<div id="calendarDiv" style="z-index:1520; display:none;"></div>
<!-- DO NOT MOVE calendarDivMask IE 5/6/7 has major z-index bug -->
<div id="calendarDivMask" style="display:none; z-index:1510; position:absolute; background-image:url('null.gif')" onClick="i2b2.CRC.ctrlr.dateConstraint.hideCalendar()"></div>
<div id="constraintDates" style="display:none;">
<div class="hd" style="background:#6677AA;">Constrain Group by Date Range</div>
<div class="bd">
<br />
<center>
<table style="font-size:12px">
<tr><td>From:</td><td></td><td>To:</td></tr>
<tr>
<td class="dateBorder">
<table><tr>
<td valign="middle"><input id="checkboxDateStart" type="checkbox" onChange="i2b2.CRC.ctrlr.dateConstraint.toggleDate()" /></td>
<td valign="middle"><input id="constraintDateStart" value="01/31/2008" style="width:75px;" disabled="disabled" /></td>
<td valign="middle"><a href="Javascript:i2b2.CRC.ctrlr.dateConstraint.doShowCalendar('S')"><img id="dropDateStart" style="position:relative; top:1px; border:none;" class="calendarDropdown" src="assets/images/b_dropdown.gif" alt="" /></a>&nbsp;</td>
</tr></table>
</td>
<td>&nbsp;&nbsp;&nbsp;</td>
<td class="dateBorder">
<table>
<tr>
<td valign="middle"><input id="checkboxDateEnd" type="checkbox" onChange="i2b2.CRC.ctrlr.dateConstraint.toggleDate()" /></td>
<td valign="middle"><input id="constraintDateEnd" value="12/31/2008" style="width:75px;" disabled="disabled" /></td>
<td valign="middle"><a href="Javascript:i2b2.CRC.ctrlr.dateConstraint.doShowCalendar('E');"><img id="dropDateEnd" style="position:relative; top:1px" class="calendarDropdown" border="0" src="assets/images/b_dropdown.gif" alt=""/></a>&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</center>
<br /><br />
</div>
</div>
<div id="constraintOccurs" style="display:none;">
<div class="hd" style="background:#6677AA;">Constrain Group by Number of Occurances</div>
<div class="bd">
<br />Event(s) within the group occur more than
<select style="width: 46px;" id="constraintOccursInput" name="constraintOccursInput">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
</select> times.<br/>
<br/>
<div id="constraintEncounterBased" style="display:none;">
<input type="checkbox" id="constraintEncounterFirst" name="constraintEncounterBefore">Only use FIRST financial encounter in which the event(s) occur.<br/>
<input type="checkbox" id="constraintEncounterLast" name="constraintEncounterLast">Only use LAST financial encounter in which the event(s) occur.
</div>
<div id="constraintTextBased" style="display:none;">
<p>Application of relevance for text searches only</p>
Percent of the matching documents which should be returned where documents with the highest relevance will be returned first.
<div id="slider-bg" class="yui-h-slider" tabindex="-1" title="Slider" style="float:left;">
<div id="slider-thumb" class="yui-slider-thumb"><img src="assets/images/thumb-n.gif"></div>
</div>
<div style="float:left;padding:5px 0 0 5px;">
<span id="slider-value">100</span>%
</div>
<br clear="all"/>
</div>
</div>
</div>
<!-- ############### Temporal Interval Limits ############### -->
<div id="constraintLimits" style="display:none;">
<div class="hd" style="background:#6677AA;">Temporal Interval Limits</div>
<div class="bd">
This group must occur<br/>
<input type="checkbox" id="aaa" name="aaa">At least
<select style="width: 46px;" id="bbb" name="bbb">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
<select style="width: 100px; margin-bottom:5px;" id="ccc" name="ccc">
<option value="1">Days(s)</option>
<option value="2">Month(s)</option>
<option value="3">Year(s)</option>
</select>
after the previous group.
<br/>
<input type="checkbox" id="ddd" name="ddd">No more than
<select style="width: 46px;" id="bbb" name="bbb">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
<select style="width: 100px; margin-bottom:5px;" id="ccc" name="ccc">
<option value="1">Days(s)</option>
<option value="2">Month(s)</option>
<option value="3">Year(s)</option>
</select>
after the previous group.
<br/>
<input type="checkbox" id="ddd" name="ddd">At least
<select style="width: 46px;" id="bbb" name="bbb">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
<select style="width: 100px; margin-bottom:5px;" id="ccc" name="ccc">
<option value="1">Days(s)</option>
<option value="2">Month(s)</option>
<option value="3">Year(s)</option>
</select>
before the next group.
<br/>
<input type="checkbox" id="ddd" name="ddd">No more than
<select style="width: 46px;" id="bbb" name="bbb">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
<select style="width: 100px; margin-bottom:5px;" id="ccc" name="ccc">
<option value="1">Days(s)</option>
<option value="2">Month(s)</option>
<option value="3">Year(s)</option>
</select>
before the next group.
<br/>
</div>
</div>
<!-- ############### <LabRange> ############### -->
<div id="itemLabRange" style="display:none;">
<div class="hd" style="background:#6677AA;">Lab Range Constraint</div>
<div class="bd modLabValues">
<div style="margin: 0px 5% 12px; text-align: center;" id="valueContraintText"></div>
<div class="mlvBody">
<div class="mlvtop">
<div class="mlvModesGroup">
<div class="mlvMode"><input name="mlvfrmType" id="mlvfrmTypeNONE" value="NO_VALUE" type="radio" checked="checked" /> No value</div>
<div class="mlvMode"><input name="mlvfrmType" id="mlvfrmTypeFLAG" value="BY_FLAG" type="radio" /> By flag</div>
<div class="mlvMode"><input name="mlvfrmType" id="mlvfrmTypeVALUE" value="BY_VALUE" type="radio" /> By value</div>
</div>
<div class="mlvInputGroup">
<div id="mlvfrmFLAG" style="display:none">
Please select a range:<br />
<select id='mlvfrmFlagValue'><option value="">Loading...</option></select>
</div>
<div id="mlvfrmVALUE" style="display:none">
<p id="mlvfrmEnterOperator">
Please select operator:<br />
<select id='mlvfrmOperator'>
<option value="LT">LESS THAN (&lt;)</option>
<option value="LE">LESS THAN OR EQUAL TO (&lt;=)</option>
<option value="EQ">EQUAL (=)</option>
<option value="BETWEEN">BETWEEN</option>
<option value="GT">GREATER THAN (&gt;)</option>
<option value="GE">GREATER THAN OR EQUAL (&gt;=)</option>
</select>
</p>
<p id="mlvfrmEnterStringOperator">
Please select operator:<br />
<select id='mlvfrmStringOperator'>
<option value="LIKE[contains]">Contains</option>
<option value="LIKE[exact]">Exact</option>
<option value="LIKE[begin]">Starts With</option>
<option value="LIKE[end]">Ends With</option>
</select>
</p>
<p id="mlvfrmEnterVal">
Please enter a value:<br />
<input id="mlvfrmNumericValue" class="numInput" />
</p>
<p id="mlvfrmEnterVals" style="display:none">Please enter values:<br />
<input id="mlvfrmNumericValueLow" class="numInput" /> &nbsp;-&nbsp; <input id="mlvfrmNumericValueHigh" class="numInput" />
</p>
<p id="mlvfrmEnterStr">Enter Search Text:<br /><input id="mlvfrmStrValue" class="strInput" /> </p>
<p id="mlvfrmEnterDbOperator"><input id="mlvfrmDbOperator" type="checkbox"/> Use Database Operators <i>(Advanced Searching)</i><br/></p>
<p id="mlvfrmEnterEnum">Please select a value:<br />
<select id="mlvfrmEnumValue" class="enumInput" multiple="multiple" size="5" style="overflow: scroll; width: 562px;">
<option value="">Loading...</option>
</select>
</p>
</div>
</div>
<div style="clear:both;height:1px;overflow:hidden;"></div>
<!-- BEGIN snm0 -->
<!-- Lab value bars display section -->
<div id="mlvfrmBarContainer" style="margin: 10px; padding: 10px; text-align: center; border: 1px solid #000080; height: auto; display:none">
<!-- <div id="mlvfrmBarContainer" class="barContainer" style="white-space:nowrap; display:none"> -->
<div style="height: 55px">
<!-- top text -->
<div>Click on a bar segment to help specify a value or range:</div>
<div>Range in <span id="mlvfrmLblUnits" style="font-decoration:italic bold">mm/Hg</span></div>
<!-- bars are drawn -->
<div id="barToxL" style="float:left; background: none repeat scroll 0% 0% rgb(0, 0, 0); height: 15px; width: 72px;">
<a href="#lblToxL" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Toxic low value" class="barlink">&nbsp;</a></div>
<div id="barLofL" style="float:left; background: none repeat scroll 0% 0% rgb(255, 0, 0); height: 15px; width: 72px;">
<a href="#lblLofL" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Abnormal low value" class="barlink">&nbsp;</a></div>
<div id="barHofL" style="float:left; background: none repeat scroll 0% 0% rgb(255, 255, 0); height: 15px; width: 72px;">
<a href="#lblHofL" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Indeterminant low value" class="barlink">&nbsp;</a></div>
<div id="barNorm" style="float:left; background: none repeat scroll 0% 0% rgb(0, 255, 0); height: 15px; width: 72px;">
<a href="#" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Normal" class="barlink">&nbsp;</a></div>
<div id="barLofH" style="float:left; background: none repeat scroll 0% 0% rgb(255, 255, 0); height: 15px; width: 72px;">
<a href="#lblLofH" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Indeterminant high value" class="barlink">&nbsp;</a></div>
<div id="barHofH" style="float:left; background: none repeat scroll 0% 0% rgb(255, 0, 0); height: 15px; width: 72px;">
<a href="#lblHofH" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Abnormal high value" class="barlink">&nbsp;</a></div>
<div id="barToxH" style="float:left; background: none repeat scroll 0% 0% rgb(0, 0, 0); height: 15px; width: 72px;">
<a href="#lblToxH" onclick="i2b2.CRC.view.modalLabValues.updateValue(event)" title="Toxic high value" class="barlink">&nbsp;</a></div>
<!-- labels are drawn -->
<div id="lblToxL" style="float: left; text-align: right; width: 72px;">&nbsp;</div>
<div id="lblLofL" style="float: left; text-align: right; width: 72px;">&nbsp;</div>
<div id="lblHofL" style="float: left; text-align: right; width: 72px;">&nbsp;</div>
<div id="lblNorm" style="float: left; text-align: left; width: 72px;">&nbsp;</div>
<div id="lblLofH" style="float: left; text-align: left; width: 72px;">&nbsp;</div>
<div id="lblHofH" style="float: left; text-align: left; width: 72px;">&nbsp;</div>
<div id="lblToxH" style="float: left; text-align: left; width: 72px;">&nbsp;</div>
</div>
</div>
<!-- Units display section -->
<div id="mlvfrmUnitsContainer" style="margin: 10px 0px 0px 15px; display:none">
<div style="float:left; text-align:left; bottom: 0">Units = &nbsp;</div>
<span><select id='mlvfrmUnits' class="units" style="width: 500px; float:left;"><option value="0">Loading...</option></select></span>
<span id="mlvUnitExcluded" style="color:#900; margin-left: 20px">A value cannot be specified for these units.</span>
</div>
<!-- END snm0 -->
</div>
</div>
</div>
</div>
<!-- ############### </LabRange> ############### -->
<!-- ############### <Query Rename Dialog> ############### -->
<div id="dialogQmName" style="display:none;">
<div class="hd" style="background:#6677AA;">Query Name</div>
<div class="bd">
<br />
<div style="font-size:12px; margin-left:50px" >Please type a name for the query:</div>
<div style="margin-left:50px"><input id="inputQueryName" style="width:275px" /></div>
</div>
</div>
<!-- ############### </Query Rename Dialog> ############### -->
<!-- ############### <Query Run Dialog> ############### -->
<div id="dialogQryRun" style="display:none;">
<div class="hd" style="background:#6677AA;">Run Query</div>
<div class="bd">
<br />
<div style="font-size:12px; margin-left:50px" >Please type a name for the query:</div>
<div style="margin-left:50px"><input class="inputQueryName" style="width:275px" /></div>
<div style="height:25px;"></div>
<div style="font-size:12px; margin-left:50px" >Please check the query result type(s):</div>
<div style="border: 1px solid rgb(171, 173, 179); height:100px; overflow:auto; margin-left: 50px; width: 275px; padding: 4px" id="dialogQryRunResultType">
<div id="crcDlgResultOutputPRC"><input type="checkbox" class="chkQueryType"
name="queryType"
value="patient_count_xml"
checked="checked" /> Patient
Count (aggregate number only)</div>
<div id="crcDlgResultOutputPRS">
<input type="checkbox" class="chkQueryType"
name="queryType"
value="patient_set_xml"
/> Patient Set (list of matching patients)</div>
<div id="crcDlgResultOutputENS">
<input type="checkbox" class="chkQueryType"
name="queryType"
value="encounter_set_xml"
/> Encounter Set (list of matching encounters)</div>
</div>
</div>
</div>
<!-- ############### </Query Run Dialog> ############### -->
<!-- ############### <Query Error Detail> ############### -->
<div id="dialogErrorDetail" style="display:none;">
<div class="hd" style="background:#6677AA;">Query Error Detail</div>
<div class="bd">
<br />
<button id='btnExpandErrorDetail'>More
Detail
</button>
<button id='btnContractErrorDetail'
style='display: none'>Less Detail
</button>
<a id="dlgNetworkStatus"
style="cursor: pointer; position:absolute; right:20px;
top: 58px; text-decoration:
underline; color:blue; display: none">Network
Status</a>
<div style="border: 1px solid #C0C0C0; max-height: 450px;
background-color: #FFFFFF; overflow: scroll; word-wrap: break-word; padding: 10px 5px;"
id="errorDetailDiv" class="StatusBoxText">
</div>
</div>
</div>
<!-- ############### </Query Error Detail> ############### -->
<!-- ############### <Query Run Dialog> ###############
<div id="dialogQryRun" style="display:none;">
<div class="hd" style="background:#6677AA;">Run Query</div>
<div class="bd">
<br />
<div style="font-size:12px; margin-left:50px" >Please type a name for the query:</div>
<div style="margin-left:50px"><input class="inputQueryName" style="width:275px" /></div>
<div style="height:25px;"></div>
<div style="font-size:12px; margin-left:50px" >Please check the query result type(s):</div>
<div style="border: 1px solid rgb(171, 173, 179); height:100px; overflow:auto; margin-left: 50px; width: 275px; padding: 4px" id="dialogQryRunResultType">
<div id="crcDlgResultOutputPRC"><input type="checkbox" class="chkQueryType" name="queryType" value="patient_count_xml" checked="checked" /> Patient Count (aggregate number only)</div>
</div>
</div>
</div>
<!-- ############### </Query Run Dialog> ############### -->
<!-- ############### <Timeout Dialog> ############### -->
<div id="dialogTimeout" style="display:none;">
<div class="hd" style="background:#6677AA;">Session Timing Out</div>
<div class="bd">
<br />
<div style="font-size:12px; margin-left:10px" >Your session will automatically time out in 5 minutes due to inactivity. Please click "OK" to continue your session, or click cancel to log out.</div>
<div style="height:15px;"></div>
</div>
</div>
<!-- ############### </Timeout Dialog> ############### -->
<!-- ############### <Draggable Splitter> ############### -->
<div id="main.splitter" class="vertical_splitter" style="top:33px"></div> <!-- Overwriting the default top position -->
<!-- Debug output -->
<!-- <div id="main.debug" style="position: absolute; top: 300px; left: 300px; color: red"> <p></p><br> </div> -->
<!-- ############### <Draggable Splitter> ############### -->
<!-- ############### <Query Flag Dialog> ############### -->
<div id="dialogQryFlag" style="display:none;">
<div class="hd" style="background:#6677AA;">Flag Query</div>
<div class="bd">
<br/>
<div style="font-size:12px; margin-left:50px">Please type a message:</div>
<div style="margin-left:50px">
<input id="inputQueryFlagMessage" style="width:275px"/>
</div>
</div>
</div>
</div>
</body>
</html>
diff --git a/shrine-webclient/src/main/html/js-ext/YUI_DataTable_MD5CellEditor.js b/shrine-webclient/src/main/html/js-ext/YUI_DataTable_MD5CellEditor.js
old mode 100755
new mode 100644
index bde302c80..345978768
--- a/shrine-webclient/src/main/html/js-ext/YUI_DataTable_MD5CellEditor.js
+++ b/shrine-webclient/src/main/html/js-ext/YUI_DataTable_MD5CellEditor.js
@@ -1,532 +1,532 @@
-/**
- * MD5CellEditor
- * A YUI DataTable extension
- * Originally made by Mihaly Koles, http://koles.hu, 2009.02.10.
- * Original version: http://koles.hu/sandbox/yui_datatable_password/YUI_DataTable_MD5CellEditor.js
- */
-
-var Ev = YAHOO.util.Event,
- lang = YAHOO.lang,
- widget = YAHOO.widget,
- ua = YAHOO.env.ua;
-
-//Password field editor with two text inputs
-widget.MD5CellEditor = function(oConfigs) {
- this._sId = "yui-md5ceditor" + YAHOO.widget.BaseCellEditor._nCount++;
- widget.MD5CellEditor.superclass.constructor.call(this, "textbox", oConfigs);
-};
-
-lang.extend(widget.MD5CellEditor, widget.BaseCellEditor, {
- textbox0 : null,
- textbox1 : null,
- msgEl : null,
- renderForm : function() {
- var elTextbox0, elTextbox1, elForm;
- // Bug 1802582: SF3/Mac needs a form element wrapping the input
- if(ua.webkit>420) {
- elForm = this.getContainerEl().appendChild(document.createElement("form"))
- }
- else {
- elForm = this.getContainerEl();
- }
- elForm.style.textAlign="right";
- elForm.appendChild(document.createElement("label")).innerHTML="Key:";
- elTextbox0= document.createElement("input");
- // elTextbox0.type = "password";
- elForm.appendChild(elTextbox0);
- elForm.appendChild(document.createElement("br"));
- // elForm.appendChild(document.createElement("label")).innerHTML="Confirm:";
- // elTextbox1= document.createElement("input");
- // elTextbox1.type = "password";
- // elForm.appendChild(elTextbox1);
- // elForm.appendChild(document.createElement("br"));
- this.msgEl=elForm.appendChild(document.createElement("span"));
-
- this.textbox0 = elTextbox0;
- this.textbox0.value = "";
-
- // this.textbox1 = elTextbox1;
-
- // Save on enter by default
- // Bug: 1802582 Set up a listener on each textbox to track on keypress
- // since SF/OP can't preventDefault on keydown
- Ev.addListener(elTextbox0, "keyup", function(v){
- if (this.checkPasswords())
- {
- if((v.keyCode === 13)) {
- // Prevent form submit
- YAHOO.util.Event.preventDefault(v);
- this.save();
- }
- }
- }, this, true);
-
-// Ev.addListener(elTextbox1, "keyup", function(v){
-// if (this.checkPasswords())
-// {
-// if((v.keyCode === 13)) {
- // Prevent form submit
- // YAHOO.util.Event.preventDefault(v);
- // this.save();
- // }
- // }
- // }, this, true);
-
- if(this.disableBtns) {
- // By default this is no-op since enter saves by default
- this.handleDisabledBtns();
- }
- },
- checkPasswords : function()
- {
- if (this.textbox0.value==null
- || this.textbox0.value==""
- //|| this.textbox1.value==null
- //|| this.textbox1.value==""
- )
- {
- this.msgEl.innerHTML="";
- return false;
- }
- else {
-
- this.msgEl.innerHTML="New MD5 Key: " + hex_md5(this.textbox0.value).toLowerCase().substring(0,3);
- this.msgEl.style.color="#008000";
- return true;
-// if (this.textbox0.value == this.textbox1.value) {
- // this.msgEl.innerHTML="New password is confirmed.";
- // this.msgEl.style.color="#008000";
- // return true;
- // }
- // else {
- // this.msgEl.innerHTML="Password don't match!";
- // this.msgEl.style.color="#800000";
- // return false;
- // }
- }
- },
- move : function() {
- this.textbox0.style.width = this.getTdEl().offsetWidth + "px";
- // this.textbox1.style.width = this.getTdEl().offsetWidth + "px";
- widget.MD5CellEditor.superclass.move.call(this);
- },
- resetForm : function() {
- this.textbox0.value = ""; // lang.isValue(this.value) ? this.value.toString() : "";
- // this.textbox1.value = lang.isValue(this.value) ? this.value.toString() : "";
- },
- focus : function() {
- this.textbox0.focus();
- this.textbox0.select();
- },
- handleDisabledBtns : function() {
- this.subscribe("blurEvent", function(v){
- if (this.checkPasswords()) {
- // Save on blur
- this.save();
- }
- }, this, true);
- },
- getInputValue : function() {
- if (this.checkPasswords()) return hex_md5(this.textbox0.value).toLowerCase().substring(0,3); //this.textbox0.value;
- else return "";
- }
-});
-
-// Copy static members to MD5CellEditor class
-lang.augmentObject(widget.MD5CellEditor, widget.BaseCellEditor);
-
-
-//cell formatter for password fields
-DataTableUtils={
- PasswordFormatter:function(el,oRecord,oColumn,oData){
- if (oData==null || oData=='') oData='xxxxxxxx';
- {
- el.innerHTML='';
- var oStr = new String(oData);
- for (var i=0; i<oStr.length; i++)
- el.innerHTML+="*";
- }
- }
-}
-
-
-/*
- * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
- * Digest Algorithm, as defined in RFC 1321.
- * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
- * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
- * Distributed under the BSD License
- * See http://pajhome.org.uk/crypt/md5 for more info.
- */
-
-
-/*
- * Configurable variables. You may need to tweak these to be compatible with
- * the server-side, but the defaults work in most cases.
- */
-var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
-var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
-
-/*
- * These are the functions you'll usually want to call
- * They take string arguments and return either hex or base-64 encoded strings
- */
-function hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
-function b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
-function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
-function hex_hmac_md5(k, d)
- { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
-function b64_hmac_md5(k, d)
- { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
-function any_hmac_md5(k, d, e)
- { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
-
-/*
- * Perform a simple self-test to see if the VM is working
- */
-function md5_vm_test()
-{
- return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
-}
-
-/*
- * Calculate the MD5 of a raw string
- */
-function rstr_md5(s)
-{
- return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
-}
-
-/*
- * Calculate the HMAC-MD5, of a key and some data (raw strings)
- */
-function rstr_hmac_md5(key, data)
-{
- var bkey = rstr2binl(key);
- if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
-
- var ipad = Array(16), opad = Array(16);
- for(var i = 0; i < 16; i++)
- {
- ipad[i] = bkey[i] ^ 0x36363636;
- opad[i] = bkey[i] ^ 0x5C5C5C5C;
- }
-
- var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
- return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
-}
-
-/*
- * Convert a raw string to a hex string
- */
-function rstr2hex(input)
-{
- try { hexcase } catch(e) { hexcase=0; }
- var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
- var output = "";
- var x;
- for(var i = 0; i < input.length; i++)
- {
- x = input.charCodeAt(i);
- output += hex_tab.charAt((x >>> 4) & 0x0F)
- + hex_tab.charAt( x & 0x0F);
- }
- return output;
-}
-
-/*
- * Convert a raw string to a base-64 string
- */
-function rstr2b64(input)
-{
- try { b64pad } catch(e) { b64pad=''; }
- var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
- var output = "";
- var len = input.length;
- for(var i = 0; i < len; i += 3)
- {
- var triplet = (input.charCodeAt(i) << 16)
- | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
- | (i + 2 < len ? input.charCodeAt(i+2) : 0);
- for(var j = 0; j < 4; j++)
- {
- if(i * 8 + j * 6 > input.length * 8) output += b64pad;
- else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
- }
- }
- return output;
-}
-
-/*
- * Convert a raw string to an arbitrary string encoding
- */
-function rstr2any(input, encoding)
-{
- var divisor = encoding.length;
- var i, j, q, x, quotient;
-
- /* Convert to an array of 16-bit big-endian values, forming the dividend */
- var dividend = Array(Math.ceil(input.length / 2));
- for(i = 0; i < dividend.length; i++)
- {
- dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
- }
-
- /*
- * Repeatedly perform a long division. The binary array forms the dividend,
- * the length of the encoding is the divisor. Once computed, the quotient
- * forms the dividend for the next step. All remainders are stored for later
- * use.
- */
- var full_length = Math.ceil(input.length * 8 /
- (Math.log(encoding.length) / Math.log(2)));
- var remainders = Array(full_length);
- for(j = 0; j < full_length; j++)
- {
- quotient = Array();
- x = 0;
- for(i = 0; i < dividend.length; i++)
- {
- x = (x << 16) + dividend[i];
- q = Math.floor(x / divisor);
- x -= q * divisor;
- if(quotient.length > 0 || q > 0)
- quotient[quotient.length] = q;
- }
- remainders[j] = x;
- dividend = quotient;
- }
-
- /* Convert the remainders to the output string */
- var output = "";
- for(i = remainders.length - 1; i >= 0; i--)
- output += encoding.charAt(remainders[i]);
-
- return output;
-}
-
-/*
- * Encode a string as utf-8.
- * For efficiency, this assumes the input is valid utf-16.
- */
-function str2rstr_utf8(input)
-{
- var output = "";
- var i = -1;
- var x, y;
-
- while(++i < input.length)
- {
- /* Decode utf-16 surrogate pairs */
- x = input.charCodeAt(i);
- y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
- if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
- {
- x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
- i++;
- }
-
- /* Encode output as utf-8 */
- if(x <= 0x7F)
- output += String.fromCharCode(x);
- else if(x <= 0x7FF)
- output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
- 0x80 | ( x & 0x3F));
- else if(x <= 0xFFFF)
- output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
- 0x80 | ((x >>> 6 ) & 0x3F),
- 0x80 | ( x & 0x3F));
- else if(x <= 0x1FFFFF)
- output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
- 0x80 | ((x >>> 12) & 0x3F),
- 0x80 | ((x >>> 6 ) & 0x3F),
- 0x80 | ( x & 0x3F));
- }
- return output;
-}
-
-/*
- * Encode a string as utf-16
- */
-function str2rstr_utf16le(input)
-{
- var output = "";
- for(var i = 0; i < input.length; i++)
- output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
- (input.charCodeAt(i) >>> 8) & 0xFF);
- return output;
-}
-
-function str2rstr_utf16be(input)
-{
- var output = "";
- for(var i = 0; i < input.length; i++)
- output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
- input.charCodeAt(i) & 0xFF);
- return output;
-}
-
-/*
- * Convert a raw string to an array of little-endian words
- * Characters >255 have their high-byte silently ignored.
- */
-function rstr2binl(input)
-{
- var output = Array(input.length >> 2);
- for(var i = 0; i < output.length; i++)
- output[i] = 0;
- for(var i = 0; i < input.length * 8; i += 8)
- output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
- return output;
-}
-
-/*
- * Convert an array of little-endian words to a string
- */
-function binl2rstr(input)
-{
- var output = "";
- for(var i = 0; i < input.length * 32; i += 8)
- output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
- return output;
-}
-
-/*
- * Calculate the MD5 of an array of little-endian words, and a bit length.
- */
-function binl_md5(x, len)
-{
- /* append padding */
- x[len >> 5] |= 0x80 << ((len) % 32);
- x[(((len + 64) >>> 9) << 4) + 14] = len;
-
- var a = 1732584193;
- var b = -271733879;
- var c = -1732584194;
- var d = 271733878;
-
- for(var i = 0; i < x.length; i += 16)
- {
- var olda = a;
- var oldb = b;
- var oldc = c;
- var oldd = d;
-
- a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
- d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
- c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
- b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
- a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
- d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
- c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
- b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
- a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
- d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
- c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
- b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
- a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
- d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
- c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
- b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
-
- a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
- d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
- c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
- b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
- a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
- d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
- c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
- b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
- a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
- d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
- c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
- b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
- a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
- d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
- c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
- b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
-
- a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
- d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
- c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
- b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
- a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
- d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
- c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
- b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
- a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
- d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
- c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
- b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
- a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
- d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
- c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
- b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
-
- a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
- d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
- c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
- b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
- a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
- d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
- c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
- b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
- a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
- d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
- c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
- b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
- a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
- d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
- c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
- b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
-
- a = safe_add(a, olda);
- b = safe_add(b, oldb);
- c = safe_add(c, oldc);
- d = safe_add(d, oldd);
- }
- return Array(a, b, c, d);
-}
-
-/*
- * These functions implement the four basic operations the algorithm uses.
- */
-function md5_cmn(q, a, b, x, s, t)
-{
- return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
-}
-function md5_ff(a, b, c, d, x, s, t)
-{
- return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
-}
-function md5_gg(a, b, c, d, x, s, t)
-{
- return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
-}
-function md5_hh(a, b, c, d, x, s, t)
-{
- return md5_cmn(b ^ c ^ d, a, b, x, s, t);
-}
-function md5_ii(a, b, c, d, x, s, t)
-{
- return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
-}
-
-/*
- * Add integers, wrapping at 2^32. This uses 16-bit operations internally
- * to work around bugs in some JS interpreters.
- */
-function safe_add(x, y)
-{
- var lsw = (x & 0xFFFF) + (y & 0xFFFF);
- var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
- return (msw << 16) | (lsw & 0xFFFF);
-}
-
-/*
- * Bitwise rotate a 32-bit number to the left.
- */
-function bit_rol(num, cnt)
-{
- return (num << cnt) | (num >>> (32 - cnt));
-}
+/**
+ * MD5CellEditor
+ * A YUI DataTable extension
+ * Originally made by Mihaly Koles, http://koles.hu, 2009.02.10.
+ * Original version: http://koles.hu/sandbox/yui_datatable_password/YUI_DataTable_MD5CellEditor.js
+ */
+
+var Ev = YAHOO.util.Event,
+ lang = YAHOO.lang,
+ widget = YAHOO.widget,
+ ua = YAHOO.env.ua;
+
+//Password field editor with two text inputs
+widget.MD5CellEditor = function(oConfigs) {
+ this._sId = "yui-md5ceditor" + YAHOO.widget.BaseCellEditor._nCount++;
+ widget.MD5CellEditor.superclass.constructor.call(this, "textbox", oConfigs);
+};
+
+lang.extend(widget.MD5CellEditor, widget.BaseCellEditor, {
+ textbox0 : null,
+ textbox1 : null,
+ msgEl : null,
+ renderForm : function() {
+ var elTextbox0, elTextbox1, elForm;
+ // Bug 1802582: SF3/Mac needs a form element wrapping the input
+ if(ua.webkit>420) {
+ elForm = this.getContainerEl().appendChild(document.createElement("form"))
+ }
+ else {
+ elForm = this.getContainerEl();
+ }
+ elForm.style.textAlign="right";
+ elForm.appendChild(document.createElement("label")).innerHTML="Key:";
+ elTextbox0= document.createElement("input");
+ // elTextbox0.type = "password";
+ elForm.appendChild(elTextbox0);
+ elForm.appendChild(document.createElement("br"));
+ // elForm.appendChild(document.createElement("label")).innerHTML="Confirm:";
+ // elTextbox1= document.createElement("input");
+ // elTextbox1.type = "password";
+ // elForm.appendChild(elTextbox1);
+ // elForm.appendChild(document.createElement("br"));
+ this.msgEl=elForm.appendChild(document.createElement("span"));
+
+ this.textbox0 = elTextbox0;
+ this.textbox0.value = "";
+
+ // this.textbox1 = elTextbox1;
+
+ // Save on enter by default
+ // Bug: 1802582 Set up a listener on each textbox to track on keypress
+ // since SF/OP can't preventDefault on keydown
+ Ev.addListener(elTextbox0, "keyup", function(v){
+ if (this.checkPasswords())
+ {
+ if((v.keyCode === 13)) {
+ // Prevent form submit
+ YAHOO.util.Event.preventDefault(v);
+ this.save();
+ }
+ }
+ }, this, true);
+
+// Ev.addListener(elTextbox1, "keyup", function(v){
+// if (this.checkPasswords())
+// {
+// if((v.keyCode === 13)) {
+ // Prevent form submit
+ // YAHOO.util.Event.preventDefault(v);
+ // this.save();
+ // }
+ // }
+ // }, this, true);
+
+ if(this.disableBtns) {
+ // By default this is no-op since enter saves by default
+ this.handleDisabledBtns();
+ }
+ },
+ checkPasswords : function()
+ {
+ if (this.textbox0.value==null
+ || this.textbox0.value==""
+ //|| this.textbox1.value==null
+ //|| this.textbox1.value==""
+ )
+ {
+ this.msgEl.innerHTML="";
+ return false;
+ }
+ else {
+
+ this.msgEl.innerHTML="New MD5 Key: " + hex_md5(this.textbox0.value).toLowerCase().substring(0,3);
+ this.msgEl.style.color="#008000";
+ return true;
+// if (this.textbox0.value == this.textbox1.value) {
+ // this.msgEl.innerHTML="New password is confirmed.";
+ // this.msgEl.style.color="#008000";
+ // return true;
+ // }
+ // else {
+ // this.msgEl.innerHTML="Password don't match!";
+ // this.msgEl.style.color="#800000";
+ // return false;
+ // }
+ }
+ },
+ move : function() {
+ this.textbox0.style.width = this.getTdEl().offsetWidth + "px";
+ // this.textbox1.style.width = this.getTdEl().offsetWidth + "px";
+ widget.MD5CellEditor.superclass.move.call(this);
+ },
+ resetForm : function() {
+ this.textbox0.value = ""; // lang.isValue(this.value) ? this.value.toString() : "";
+ // this.textbox1.value = lang.isValue(this.value) ? this.value.toString() : "";
+ },
+ focus : function() {
+ this.textbox0.focus();
+ this.textbox0.select();
+ },
+ handleDisabledBtns : function() {
+ this.subscribe("blurEvent", function(v){
+ if (this.checkPasswords()) {
+ // Save on blur
+ this.save();
+ }
+ }, this, true);
+ },
+ getInputValue : function() {
+ if (this.checkPasswords()) return hex_md5(this.textbox0.value).toLowerCase().substring(0,3); //this.textbox0.value;
+ else return "";
+ }
+});
+
+// Copy static members to MD5CellEditor class
+lang.augmentObject(widget.MD5CellEditor, widget.BaseCellEditor);
+
+
+//cell formatter for password fields
+DataTableUtils={
+ PasswordFormatter:function(el,oRecord,oColumn,oData){
+ if (oData==null || oData=='') oData='xxxxxxxx';
+ {
+ el.innerHTML='';
+ var oStr = new String(oData);
+ for (var i=0; i<oStr.length; i++)
+ el.innerHTML+="*";
+ }
+ }
+}
+
+
+/*
+ * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
+ * Digest Algorithm, as defined in RFC 1321.
+ * Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
+ * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
+ * Distributed under the BSD License
+ * See http://pajhome.org.uk/crypt/md5 for more info.
+ */
+
+
+/*
+ * Configurable variables. You may need to tweak these to be compatible with
+ * the server-side, but the defaults work in most cases.
+ */
+var hexcase = 0; /* hex output format. 0 - lowercase; 1 - uppercase */
+var b64pad = ""; /* base-64 pad character. "=" for strict RFC compliance */
+
+/*
+ * These are the functions you'll usually want to call
+ * They take string arguments and return either hex or base-64 encoded strings
+ */
+function hex_md5(s) { return rstr2hex(rstr_md5(str2rstr_utf8(s))); }
+function b64_md5(s) { return rstr2b64(rstr_md5(str2rstr_utf8(s))); }
+function any_md5(s, e) { return rstr2any(rstr_md5(str2rstr_utf8(s)), e); }
+function hex_hmac_md5(k, d)
+ { return rstr2hex(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
+function b64_hmac_md5(k, d)
+ { return rstr2b64(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d))); }
+function any_hmac_md5(k, d, e)
+ { return rstr2any(rstr_hmac_md5(str2rstr_utf8(k), str2rstr_utf8(d)), e); }
+
+/*
+ * Perform a simple self-test to see if the VM is working
+ */
+function md5_vm_test()
+{
+ return hex_md5("abc").toLowerCase() == "900150983cd24fb0d6963f7d28e17f72";
+}
+
+/*
+ * Calculate the MD5 of a raw string
+ */
+function rstr_md5(s)
+{
+ return binl2rstr(binl_md5(rstr2binl(s), s.length * 8));
+}
+
+/*
+ * Calculate the HMAC-MD5, of a key and some data (raw strings)
+ */
+function rstr_hmac_md5(key, data)
+{
+ var bkey = rstr2binl(key);
+ if(bkey.length > 16) bkey = binl_md5(bkey, key.length * 8);
+
+ var ipad = Array(16), opad = Array(16);
+ for(var i = 0; i < 16; i++)
+ {
+ ipad[i] = bkey[i] ^ 0x36363636;
+ opad[i] = bkey[i] ^ 0x5C5C5C5C;
+ }
+
+ var hash = binl_md5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
+ return binl2rstr(binl_md5(opad.concat(hash), 512 + 128));
+}
+
+/*
+ * Convert a raw string to a hex string
+ */
+function rstr2hex(input)
+{
+ try { hexcase } catch(e) { hexcase=0; }
+ var hex_tab = hexcase ? "0123456789ABCDEF" : "0123456789abcdef";
+ var output = "";
+ var x;
+ for(var i = 0; i < input.length; i++)
+ {
+ x = input.charCodeAt(i);
+ output += hex_tab.charAt((x >>> 4) & 0x0F)
+ + hex_tab.charAt( x & 0x0F);
+ }
+ return output;
+}
+
+/*
+ * Convert a raw string to a base-64 string
+ */
+function rstr2b64(input)
+{
+ try { b64pad } catch(e) { b64pad=''; }
+ var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+ var output = "";
+ var len = input.length;
+ for(var i = 0; i < len; i += 3)
+ {
+ var triplet = (input.charCodeAt(i) << 16)
+ | (i + 1 < len ? input.charCodeAt(i+1) << 8 : 0)
+ | (i + 2 < len ? input.charCodeAt(i+2) : 0);
+ for(var j = 0; j < 4; j++)
+ {
+ if(i * 8 + j * 6 > input.length * 8) output += b64pad;
+ else output += tab.charAt((triplet >>> 6*(3-j)) & 0x3F);
+ }
+ }
+ return output;
+}
+
+/*
+ * Convert a raw string to an arbitrary string encoding
+ */
+function rstr2any(input, encoding)
+{
+ var divisor = encoding.length;
+ var i, j, q, x, quotient;
+
+ /* Convert to an array of 16-bit big-endian values, forming the dividend */
+ var dividend = Array(Math.ceil(input.length / 2));
+ for(i = 0; i < dividend.length; i++)
+ {
+ dividend[i] = (input.charCodeAt(i * 2) << 8) | input.charCodeAt(i * 2 + 1);
+ }
+
+ /*
+ * Repeatedly perform a long division. The binary array forms the dividend,
+ * the length of the encoding is the divisor. Once computed, the quotient
+ * forms the dividend for the next step. All remainders are stored for later
+ * use.
+ */
+ var full_length = Math.ceil(input.length * 8 /
+ (Math.log(encoding.length) / Math.log(2)));
+ var remainders = Array(full_length);
+ for(j = 0; j < full_length; j++)
+ {
+ quotient = Array();
+ x = 0;
+ for(i = 0; i < dividend.length; i++)
+ {
+ x = (x << 16) + dividend[i];
+ q = Math.floor(x / divisor);
+ x -= q * divisor;
+ if(quotient.length > 0 || q > 0)
+ quotient[quotient.length] = q;
+ }
+ remainders[j] = x;
+ dividend = quotient;
+ }
+
+ /* Convert the remainders to the output string */
+ var output = "";
+ for(i = remainders.length - 1; i >= 0; i--)
+ output += encoding.charAt(remainders[i]);
+
+ return output;
+}
+
+/*
+ * Encode a string as utf-8.
+ * For efficiency, this assumes the input is valid utf-16.
+ */
+function str2rstr_utf8(input)
+{
+ var output = "";
+ var i = -1;
+ var x, y;
+
+ while(++i < input.length)
+ {
+ /* Decode utf-16 surrogate pairs */
+ x = input.charCodeAt(i);
+ y = i + 1 < input.length ? input.charCodeAt(i + 1) : 0;
+ if(0xD800 <= x && x <= 0xDBFF && 0xDC00 <= y && y <= 0xDFFF)
+ {
+ x = 0x10000 + ((x & 0x03FF) << 10) + (y & 0x03FF);
+ i++;
+ }
+
+ /* Encode output as utf-8 */
+ if(x <= 0x7F)
+ output += String.fromCharCode(x);
+ else if(x <= 0x7FF)
+ output += String.fromCharCode(0xC0 | ((x >>> 6 ) & 0x1F),
+ 0x80 | ( x & 0x3F));
+ else if(x <= 0xFFFF)
+ output += String.fromCharCode(0xE0 | ((x >>> 12) & 0x0F),
+ 0x80 | ((x >>> 6 ) & 0x3F),
+ 0x80 | ( x & 0x3F));
+ else if(x <= 0x1FFFFF)
+ output += String.fromCharCode(0xF0 | ((x >>> 18) & 0x07),
+ 0x80 | ((x >>> 12) & 0x3F),
+ 0x80 | ((x >>> 6 ) & 0x3F),
+ 0x80 | ( x & 0x3F));
+ }
+ return output;
+}
+
+/*
+ * Encode a string as utf-16
+ */
+function str2rstr_utf16le(input)
+{
+ var output = "";
+ for(var i = 0; i < input.length; i++)
+ output += String.fromCharCode( input.charCodeAt(i) & 0xFF,
+ (input.charCodeAt(i) >>> 8) & 0xFF);
+ return output;
+}
+
+function str2rstr_utf16be(input)
+{
+ var output = "";
+ for(var i = 0; i < input.length; i++)
+ output += String.fromCharCode((input.charCodeAt(i) >>> 8) & 0xFF,
+ input.charCodeAt(i) & 0xFF);
+ return output;
+}
+
+/*
+ * Convert a raw string to an array of little-endian words
+ * Characters >255 have their high-byte silently ignored.
+ */
+function rstr2binl(input)
+{
+ var output = Array(input.length >> 2);
+ for(var i = 0; i < output.length; i++)
+ output[i] = 0;
+ for(var i = 0; i < input.length * 8; i += 8)
+ output[i>>5] |= (input.charCodeAt(i / 8) & 0xFF) << (i%32);
+ return output;
+}
+
+/*
+ * Convert an array of little-endian words to a string
+ */
+function binl2rstr(input)
+{
+ var output = "";
+ for(var i = 0; i < input.length * 32; i += 8)
+ output += String.fromCharCode((input[i>>5] >>> (i % 32)) & 0xFF);
+ return output;
+}
+
+/*
+ * Calculate the MD5 of an array of little-endian words, and a bit length.
+ */
+function binl_md5(x, len)
+{
+ /* append padding */
+ x[len >> 5] |= 0x80 << ((len) % 32);
+ x[(((len + 64) >>> 9) << 4) + 14] = len;
+
+ var a = 1732584193;
+ var b = -271733879;
+ var c = -1732584194;
+ var d = 271733878;
+
+ for(var i = 0; i < x.length; i += 16)
+ {
+ var olda = a;
+ var oldb = b;
+ var oldc = c;
+ var oldd = d;
+
+ a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
+ d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
+ c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
+ b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
+ a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
+ d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
+ c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
+ b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
+ a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
+ d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
+ c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
+ b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
+ a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
+ d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
+ c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
+ b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
+
+ a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
+ d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
+ c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
+ b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
+ a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
+ d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
+ c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
+ b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
+ a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
+ d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
+ c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
+ b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
+ a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
+ d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
+ c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
+ b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
+
+ a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
+ d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
+ c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
+ b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
+ a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
+ d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
+ c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
+ b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
+ a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
+ d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
+ c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
+ b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
+ a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
+ d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
+ c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
+ b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
+
+ a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
+ d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
+ c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
+ b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
+ a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
+ d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
+ c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
+ b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
+ a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
+ d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
+ c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
+ b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
+ a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
+ d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
+ c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
+ b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
+
+ a = safe_add(a, olda);
+ b = safe_add(b, oldb);
+ c = safe_add(c, oldc);
+ d = safe_add(d, oldd);
+ }
+ return Array(a, b, c, d);
+}
+
+/*
+ * These functions implement the four basic operations the algorithm uses.
+ */
+function md5_cmn(q, a, b, x, s, t)
+{
+ return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
+}
+function md5_ff(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
+}
+function md5_gg(a, b, c, d, x, s, t)
+{
+ return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
+}
+function md5_hh(a, b, c, d, x, s, t)
+{
+ return md5_cmn(b ^ c ^ d, a, b, x, s, t);
+}
+function md5_ii(a, b, c, d, x, s, t)
+{
+ return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
+}
+
+/*
+ * Add integers, wrapping at 2^32. This uses 16-bit operations internally
+ * to work around bugs in some JS interpreters.
+ */
+function safe_add(x, y)
+{
+ var lsw = (x & 0xFFFF) + (y & 0xFFFF);
+ var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return (msw << 16) | (lsw & 0xFFFF);
+}
+
+/*
+ * Bitwise rotate a 32-bit number to the left.
+ */
+function bit_rol(num, cnt)
+{
+ return (num << cnt) | (num >>> (32 - cnt));
+}
diff --git a/shrine-webclient/src/main/html/js-ext/YUI_DataTable_PasswordCellEditor.js b/shrine-webclient/src/main/html/js-ext/YUI_DataTable_PasswordCellEditor.js
old mode 100755
new mode 100644
index 4f54ea4d9..20566ca69
--- a/shrine-webclient/src/main/html/js-ext/YUI_DataTable_PasswordCellEditor.js
+++ b/shrine-webclient/src/main/html/js-ext/YUI_DataTable_PasswordCellEditor.js
@@ -1,143 +1,143 @@
-/**
- * PasswordCellEditor
- * A YUI DataTable extension
- * Originally made by Mihaly Koles, http://koles.hu, 2009.02.10.
- * Original version: http://koles.hu/sandbox/yui_datatable_password/YUI_DataTable_PasswordCellEditor.js
- */
-
-var Ev = YAHOO.util.Event,
- lang = YAHOO.lang,
- widget = YAHOO.widget,
- ua = YAHOO.env.ua;
-
-//Password field editor with two text inputs
-widget.PasswordCellEditor = function(oConfigs) {
- this._sId = "yui-passwordceditor" + YAHOO.widget.BaseCellEditor._nCount++;
- widget.PasswordCellEditor.superclass.constructor.call(this, "textbox", oConfigs);
-};
-
-lang.extend(widget.PasswordCellEditor, widget.BaseCellEditor, {
- textbox0 : null,
- textbox1 : null,
- msgEl : null,
- renderForm : function() {
- var elTextbox0, elTextbox1, elForm;
- // Bug 1802582: SF3/Mac needs a form element wrapping the input
- if(ua.webkit>420) {
- elForm = this.getContainerEl().appendChild(document.createElement("form"))
- }
- else {
- elForm = this.getContainerEl();
- }
- elForm.style.textAlign="right";
- elForm.appendChild(document.createElement("label")).innerHTML="Password:";
- elTextbox0= document.createElement("input");
- elTextbox0.type = "password";
- elForm.appendChild(elTextbox0);
- elForm.appendChild(document.createElement("br"));
- elForm.appendChild(document.createElement("label")).innerHTML="Confirm:";
- elTextbox1= document.createElement("input");
- elTextbox1.type = "password";
- elForm.appendChild(elTextbox1);
- elForm.appendChild(document.createElement("br"));
- this.msgEl=elForm.appendChild(document.createElement("span"));
-
- this.textbox0 = elTextbox0;
- this.textbox1 = elTextbox1;
-
- // Save on enter by default
- // Bug: 1802582 Set up a listener on each textbox to track on keypress
- // since SF/OP can't preventDefault on keydown
- Ev.addListener(elTextbox0, "keyup", function(v){
- if (this.checkPasswords())
- {
- if((v.keyCode === 13)) {
- // Prevent form submit
- YAHOO.util.Event.preventDefault(v);
- this.save();
- }
- }
- }, this, true);
-
- Ev.addListener(elTextbox1, "keyup", function(v){
- if (this.checkPasswords())
- {
- if((v.keyCode === 13)) {
- // Prevent form submit
- YAHOO.util.Event.preventDefault(v);
- this.save();
- }
- }
- }, this, true);
-
- if(this.disableBtns) {
- // By default this is no-op since enter saves by default
- this.handleDisabledBtns();
- }
- },
- checkPasswords : function()
- {
- if (this.textbox0.value==null
- || this.textbox0.value==""
- || this.textbox1.value==null
- || this.textbox1.value=="")
- {
- this.msgEl.innerHTML="";
- return false;
- }
- else {
- if (this.textbox0.value == this.textbox1.value) {
- this.msgEl.innerHTML="New password is confirmed.";
- this.msgEl.style.color="#008000";
- return true;
- }
- else {
- this.msgEl.innerHTML="Password don't match!";
- this.msgEl.style.color="#800000";
- return false;
- }
- }
- },
- move : function() {
- this.textbox0.style.width = this.getTdEl().offsetWidth + "px";
- this.textbox1.style.width = this.getTdEl().offsetWidth + "px";
- widget.PasswordCellEditor.superclass.move.call(this);
- },
- resetForm : function() {
- this.textbox0.value = lang.isValue(this.value) ? this.value.toString() : "";
- this.textbox1.value = lang.isValue(this.value) ? this.value.toString() : "";
- },
- focus : function() {
- this.textbox0.focus();
- this.textbox0.select();
- },
- handleDisabledBtns : function() {
- this.subscribe("blurEvent", function(v){
- if (this.checkPasswords()) {
- // Save on blur
- this.save();
- }
- }, this, true);
- },
- getInputValue : function() {
- if (this.checkPasswords()) return this.textbox0.value;
- else return "";
- }
-});
-
-// Copy static members to PasswordCellEditor class
-lang.augmentObject(widget.PasswordCellEditor, widget.BaseCellEditor);
-
-
-//cell formatter for password fields
-DataTableUtils={
- PasswordFormatter:function(el,oRecord,oColumn,oData){
- if (oData==null || oData=='') oData='xxxxxxxx';
- {
- el.innerHTML='';
- var oStr = new String(oData);
- for (var i=0; i<oStr.length; i++)
- el.innerHTML+="*";
- }
- }
-}
+/**
+ * PasswordCellEditor
+ * A YUI DataTable extension
+ * Originally made by Mihaly Koles, http://koles.hu, 2009.02.10.
+ * Original version: http://koles.hu/sandbox/yui_datatable_password/YUI_DataTable_PasswordCellEditor.js
+ */
+
+var Ev = YAHOO.util.Event,
+ lang = YAHOO.lang,
+ widget = YAHOO.widget,
+ ua = YAHOO.env.ua;
+
+//Password field editor with two text inputs
+widget.PasswordCellEditor = function(oConfigs) {
+ this._sId = "yui-passwordceditor" + YAHOO.widget.BaseCellEditor._nCount++;
+ widget.PasswordCellEditor.superclass.constructor.call(this, "textbox", oConfigs);
+};
+
+lang.extend(widget.PasswordCellEditor, widget.BaseCellEditor, {
+ textbox0 : null,
+ textbox1 : null,
+ msgEl : null,
+ renderForm : function() {
+ var elTextbox0, elTextbox1, elForm;
+ // Bug 1802582: SF3/Mac needs a form element wrapping the input
+ if(ua.webkit>420) {
+ elForm = this.getContainerEl().appendChild(document.createElement("form"))
+ }
+ else {
+ elForm = this.getContainerEl();
+ }
+ elForm.style.textAlign="right";
+ elForm.appendChild(document.createElement("label")).innerHTML="Password:";
+ elTextbox0= document.createElement("input");
+ elTextbox0.type = "password";
+ elForm.appendChild(elTextbox0);
+ elForm.appendChild(document.createElement("br"));
+ elForm.appendChild(document.createElement("label")).innerHTML="Confirm:";
+ elTextbox1= document.createElement("input");
+ elTextbox1.type = "password";
+ elForm.appendChild(elTextbox1);
+ elForm.appendChild(document.createElement("br"));
+ this.msgEl=elForm.appendChild(document.createElement("span"));
+
+ this.textbox0 = elTextbox0;
+ this.textbox1 = elTextbox1;
+
+ // Save on enter by default
+ // Bug: 1802582 Set up a listener on each textbox to track on keypress
+ // since SF/OP can't preventDefault on keydown
+ Ev.addListener(elTextbox0, "keyup", function(v){
+ if (this.checkPasswords())
+ {
+ if((v.keyCode === 13)) {
+ // Prevent form submit
+ YAHOO.util.Event.preventDefault(v);
+ this.save();
+ }
+ }
+ }, this, true);
+
+ Ev.addListener(elTextbox1, "keyup", function(v){
+ if (this.checkPasswords())
+ {
+ if((v.keyCode === 13)) {
+ // Prevent form submit
+ YAHOO.util.Event.preventDefault(v);
+ this.save();
+ }
+ }
+ }, this, true);
+
+ if(this.disableBtns) {
+ // By default this is no-op since enter saves by default
+ this.handleDisabledBtns();
+ }
+ },
+ checkPasswords : function()
+ {
+ if (this.textbox0.value==null
+ || this.textbox0.value==""
+ || this.textbox1.value==null
+ || this.textbox1.value=="")
+ {
+ this.msgEl.innerHTML="";
+ return false;
+ }
+ else {
+ if (this.textbox0.value == this.textbox1.value) {
+ this.msgEl.innerHTML="New password is confirmed.";
+ this.msgEl.style.color="#008000";
+ return true;
+ }
+ else {
+ this.msgEl.innerHTML="Password don't match!";
+ this.msgEl.style.color="#800000";
+ return false;
+ }
+ }
+ },
+ move : function() {
+ this.textbox0.style.width = this.getTdEl().offsetWidth + "px";
+ this.textbox1.style.width = this.getTdEl().offsetWidth + "px";
+ widget.PasswordCellEditor.superclass.move.call(this);
+ },
+ resetForm : function() {
+ this.textbox0.value = lang.isValue(this.value) ? this.value.toString() : "";
+ this.textbox1.value = lang.isValue(this.value) ? this.value.toString() : "";
+ },
+ focus : function() {
+ this.textbox0.focus();
+ this.textbox0.select();
+ },
+ handleDisabledBtns : function() {
+ this.subscribe("blurEvent", function(v){
+ if (this.checkPasswords()) {
+ // Save on blur
+ this.save();
+ }
+ }, this, true);
+ },
+ getInputValue : function() {
+ if (this.checkPasswords()) return this.textbox0.value;
+ else return "";
+ }
+});
+
+// Copy static members to PasswordCellEditor class
+lang.augmentObject(widget.PasswordCellEditor, widget.BaseCellEditor);
+
+
+//cell formatter for password fields
+DataTableUtils={
+ PasswordFormatter:function(el,oRecord,oColumn,oData){
+ if (oData==null || oData=='') oData='xxxxxxxx';
+ {
+ el.innerHTML='';
+ var oStr = new String(oData);
+ for (var i=0; i<oStr.length; i++)
+ el.innerHTML+="*";
+ }
+ }
+}
diff --git a/shrine-webclient/src/main/html/js-ext/accordion-min.js b/shrine-webclient/src/main/html/js-ext/accordion-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/bubbling-min.js b/shrine-webclient/src/main/html/js-ext/bubbling-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/c3code/c3.css b/shrine-webclient/src/main/html/js-ext/c3code/c3.css
new file mode 100644
index 000000000..568648f5e
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/c3code/c3.css
@@ -0,0 +1,203 @@
+/*-- Chart --*/
+
+.c3 svg {
+ font: 10px sans-serif;
+}
+.c3 path, .c3 line {
+ fill: none;
+ stroke: #000;
+}
+.c3 text {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none;
+}
+
+.c3-legend-item-tile,
+.c3-xgrid-focus,
+.c3-ygrid,
+.c3-event-rect,
+.c3-bars path {
+ shape-rendering: crispEdges;
+}
+
+.c3-chart-arc path {
+ stroke: #fff;
+
+}
+.c3-chart-arc text {
+ fill: #fff;
+ font-size: 13px;
+}
+
+/*-- Axis --*/
+
+.c3-axis-x .tick {
+}
+.c3-axis-x-label {
+}
+
+.c3-axis-y .tick {
+}
+.c3-axis-y-label {
+}
+
+.c3-axis-y2 .tick {
+}
+.c3-axis-y2-label {
+}
+
+/*-- Grid --*/
+
+.c3-grid line {
+ stroke: #aaa;
+}
+.c3-grid text {
+ fill: #aaa;
+}
+.c3-xgrid, .c3-ygrid {
+ stroke-dasharray: 3 3;
+}
+.c3-xgrid-focus {
+}
+
+/*-- Text on Chart --*/
+
+.c3-text {
+}
+
+.c3-text.c3-empty {
+ fill: #808080;
+ font-size: 2em;
+}
+
+/*-- Line --*/
+
+.c3-line {
+ stroke-width: 1px;
+}
+/*-- Point --*/
+
+.c3-circle._expanded_ {
+ stroke-width: 1px;
+ stroke: white;
+}
+.c3-selected-circle {
+ fill: white;
+ stroke-width: 2px;
+}
+
+/*-- Bar --*/
+
+.c3-bar {
+ stroke-width: 0;
+}
+.c3-bar._expanded_ {
+ fill-opacity: 0.75;
+}
+
+/*-- Arc --*/
+
+.c3-chart-arcs-title {
+ font-size: 1.3em;
+}
+
+/*-- Focus --*/
+
+.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step {
+ stroke-width: 2px;
+}
+
+/*-- Region --*/
+
+.c3-region {
+ fill: steelblue;
+ fill-opacity: .1;
+}
+
+/*-- Brush --*/
+
+.c3-brush .extent {
+ fill-opacity: .1;
+}
+
+/*-- Select - Drag --*/
+
+.c3-dragarea {
+}
+
+/*-- Legend --*/
+
+.c3-legend-item {
+ font-size: 12px;
+}
+
+.c3-legend-background {
+ opacity: 0.75;
+ fill: white;
+ stroke: lightgray;
+ stroke-width: 1
+}
+
+/*-- Tooltip --*/
+
+.c3-tooltip {
+ border-collapse:collapse;
+ border-spacing:0;
+ background-color:#fff;
+ empty-cells:show;
+ -webkit-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
+ -moz-box-shadow: 7px 7px 12px -9px rgb(119,119,119);
+ box-shadow: 7px 7px 12px -9px rgb(119,119,119);
+ opacity: 0.9;
+}
+.c3-tooltip tr {
+ border:1px solid #CCC;
+}
+.c3-tooltip th {
+ background-color: #aaa;
+ font-size:14px;
+ padding:2px 5px;
+ text-align:left;
+ color:#FFF;
+}
+.c3-tooltip td {
+ font-size:13px;
+ padding: 3px 6px;
+ background-color:#fff;
+ border-left:1px dotted #999;
+}
+.c3-tooltip td > span {
+ display: inline-block;
+ width: 10px;
+ height: 10px;
+ margin-right: 6px;
+}
+.c3-tooltip td.value{
+ text-align: right;
+}
+
+.c3-area {
+ stroke-width: 0;
+ opacity: 0.2;
+}
+
+.c3-chart-arcs .c3-chart-arcs-background {
+ fill: #e0e0e0;
+ stroke: none;
+}
+.c3-chart-arcs .c3-chart-arcs-gauge-unit {
+ fill: #000;
+ font-size: 16px;
+}
+.c3-chart-arcs .c3-chart-arcs-gauge-max {
+ fill: #777;
+}
+.c3-chart-arcs .c3-chart-arcs-gauge-min {
+ fill: #777;
+}
+
+.c3-chart-arc .c3-gauge-value {
+ fill: #000;
+ font-size: 28px;
+}
diff --git a/shrine-webclient/src/main/html/js-ext/c3code/c3.css.new b/shrine-webclient/src/main/html/js-ext/c3code/c3.css.new
new file mode 100644
index 000000000..ab0b70abe
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/c3code/c3.css.new
@@ -0,0 +1,158 @@
+/*-- Chart --*/
+.c3 svg {
+ font: 10px sans-serif; }
+
+.c3 path, .c3 line {
+ fill: none;
+ stroke: #000; }
+
+.c3 text {
+ -webkit-user-select: none;
+ -moz-user-select: none;
+ user-select: none; }
+
+.c3-legend-item-tile, .c3-xgrid-focus, .c3-ygrid, .c3-event-rect, .c3-bars path {
+ shape-rendering: crispEdges; }
+
+.c3-chart-arc path {
+ stroke: #fff; }
+
+.c3-chart-arc text {
+ fill: #fff;
+ font-size: 13px; }
+
+/*-- Axis --*/
+/*-- Grid --*/
+.c3-grid line {
+ stroke: #aaa; }
+
+.c3-grid text {
+ fill: #aaa; }
+
+.c3-xgrid, .c3-ygrid {
+ stroke-dasharray: 3 3; }
+
+/*-- Text on Chart --*/
+.c3-text.c3-empty {
+ fill: #808080;
+ font-size: 2em; }
+
+/*-- Line --*/
+.c3-line {
+ stroke-width: 1px; }
+
+/*-- Point --*/
+.c3-circle._expanded_ {
+ stroke-width: 1px;
+ stroke: white; }
+
+.c3-selected-circle {
+ fill: white;
+ stroke-width: 2px; }
+
+/*-- Bar --*/
+.c3-bar {
+ stroke-width: 0; }
+
+.c3-bar._expanded_ {
+ fill-opacity: 0.75; }
+
+/*-- Focus --*/
+.c3-target.c3-focused {
+ opacity: 1; }
+
+.c3-target.c3-focused path.c3-line, .c3-target.c3-focused path.c3-step {
+ stroke-width: 2px; }
+
+.c3-target.c3-defocused {
+ opacity: 0.3 !important; }
+
+/*-- Region --*/
+.c3-region {
+ fill: steelblue;
+ fill-opacity: 0.1; }
+
+/*-- Brush --*/
+.c3-brush .extent {
+ fill-opacity: 0.1; }
+
+/*-- Select - Drag --*/
+/*-- Legend --*/
+.c3-legend-item {
+ font-size: 12px; }
+
+.c3-legend-item-hidden {
+ opacity: 0.15; }
+
+.c3-legend-background {
+ opacity: 0.75;
+ fill: white;
+ stroke: lightgray;
+ stroke-width: 1; }
+
+/*-- Tooltip --*/
+.c3-tooltip-container {
+ z-index: 10; }
+
+.c3-tooltip {
+ border-collapse: collapse;
+ border-spacing: 0;
+ background-color: #fff;
+ empty-cells: show;
+ -webkit-box-shadow: 7px 7px 12px -9px #777777;
+ -moz-box-shadow: 7px 7px 12px -9px #777777;
+ box-shadow: 7px 7px 12px -9px #777777;
+ opacity: 0.9; }
+
+.c3-tooltip tr {
+ border: 1px solid #CCC; }
+
+.c3-tooltip th {
+ background-color: #aaa;
+ font-size: 14px;
+ padding: 2px 5px;
+ text-align: left;
+ color: #FFF; }
+
+.c3-tooltip td {
+ font-size: 13px;
+ padding: 3px 6px;
+ background-color: #fff;
+ border-left: 1px dotted #999; }
+
+.c3-tooltip td > span {
+ display: inline-block;
+ width: 10px;
+ height: 10px;
+ margin-right: 6px; }
+
+.c3-tooltip td.value {
+ text-align: right; }
+
+/*-- Area --*/
+.c3-area {
+ stroke-width: 0;
+ opacity: 0.2; }
+
+/*-- Arc --*/
+.c3-chart-arcs-title {
+ dominant-baseline: middle;
+ font-size: 1.3em; }
+
+.c3-chart-arcs .c3-chart-arcs-background {
+ fill: #e0e0e0;
+ stroke: none; }
+
+.c3-chart-arcs .c3-chart-arcs-gauge-unit {
+ fill: #000;
+ font-size: 16px; }
+
+.c3-chart-arcs .c3-chart-arcs-gauge-max {
+ fill: #777; }
+
+.c3-chart-arcs .c3-chart-arcs-gauge-min {
+ fill: #777; }
+
+.c3-chart-arc .c3-gauge-value {
+ fill: #000;
+ /* font-size: 28px !important;*/ }
diff --git a/shrine-webclient/src/main/html/js-ext/c3code/c3.js b/shrine-webclient/src/main/html/js-ext/c3code/c3.js
new file mode 100644
index 000000000..4c9cfda5b
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/c3code/c3.js
@@ -0,0 +1,6118 @@
+(function (window) {
+ 'use strict';
+
+ /*global define, module, exports, require */
+
+ var c3 = { version: "0.3.0" };
+
+ var c3_chart_fn, c3_chart_internal_fn;
+
+ function Chart(config) {
+ var $$ = this.internal = new ChartInternal(this);
+ $$.loadConfig(config);
+ $$.init();
+
+ // bind "this" to nested API
+ (function bindThis(fn, target, argThis) {
+ for (var key in fn) {
+ target[key] = fn[key].bind(argThis);
+ if (Object.keys(fn[key]).length > 0) {
+ bindThis(fn[key], target[key], argThis);
+ }
+ }
+ })(c3_chart_fn, this, this);
+ }
+
+ function ChartInternal(api) {
+ var $$ = this;
+ $$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
+ $$.api = api;
+ $$.config = $$.getDefaultConfig();
+ $$.data = {};
+ $$.cache = {};
+ $$.axes = {};
+ }
+
+ c3.generate = function (config) {
+ return new Chart(config);
+ };
+
+ c3.chart = {
+ fn: Chart.prototype,
+ internal: {
+ fn: ChartInternal.prototype
+ }
+ };
+ c3_chart_fn = c3.chart.fn;
+ c3_chart_internal_fn = c3.chart.internal.fn;
+
+
+ c3_chart_internal_fn.init = function () {
+ var $$ = this, config = $$.config;
+
+ $$.initParams();
+
+ if (config.data_url) {
+ $$.convertUrlToData(config.data_url, config.data_mimeType, config.data_keys, $$.initWithData);
+ }
+ else if (config.data_json) {
+ $$.initWithData($$.convertJsonToData(config.data_json, config.data_keys));
+ }
+ else if (config.data_rows) {
+ $$.initWithData($$.convertRowsToData(config.data_rows));
+ }
+ else if (config.data_columns) {
+ $$.initWithData($$.convertColumnsToData(config.data_columns));
+ }
+ else {
+ throw Error('url or json or rows or columns is required.');
+ }
+ };
+
+ c3_chart_internal_fn.initParams = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+
+ // MEMO: clipId needs to be unique because it conflicts when multiple charts exist
+ $$.clipId = "c3-" + (+new Date()) + '-clip',
+ $$.clipIdForXAxis = $$.clipId + '-xaxis',
+ $$.clipIdForYAxis = $$.clipId + '-yaxis',
+ $$.clipPath = $$.getClipPath($$.clipId),
+ $$.clipPathForXAxis = $$.getClipPath($$.clipIdForXAxis),
+ $$.clipPathForYAxis = $$.getClipPath($$.clipIdForYAxis);
+
+ $$.dragStart = null;
+ $$.dragging = false;
+ $$.cancelClick = false;
+ $$.mouseover = false;
+ $$.transiting = false;
+
+ $$.color = $$.generateColor();
+ $$.levelColor = $$.generateLevelColor();
+
+ $$.dataTimeFormat = config.data_xLocaltime ? d3.time.format : d3.time.format.utc;
+ $$.axisTimeFormat = config.axis_x_localtime ? d3.time.format : d3.time.format.utc;
+ $$.defaultAxisTimeFormat = $$.axisTimeFormat.multi([
+ [".%L", function (d) { return d.getMilliseconds(); }],
+ [":%S", function (d) { return d.getSeconds(); }],
+ ["%I:%M", function (d) { return d.getMinutes(); }],
+ ["%I %p", function (d) { return d.getHours(); }],
+ ["%-m/%-d", function (d) { return d.getDay() && d.getDate() !== 1; }],
+ ["%-m/%-d", function (d) { return d.getDate() !== 1; }],
+ ["%-m/%-d", function (d) { return d.getMonth(); }],
+ ["%Y/%-m/%-d", function () { return true; }]
+ ]);
+
+ $$.hiddenTargetIds = [];
+ $$.hiddenLegendIds = [];
+
+ $$.xOrient = config.axis_rotated ? "left" : "bottom";
+ $$.yOrient = config.axis_rotated ? "bottom" : "left";
+ $$.y2Orient = config.axis_rotated ? "top" : "right";
+ $$.subXOrient = config.axis_rotated ? "left" : "bottom";
+
+ $$.isLegendRight = config.legend_position === 'right';
+ $$.isLegendInset = config.legend_position === 'inset';
+ $$.isLegendTop = config.legend_inset_anchor === 'top-left' || config.legend_inset_anchor === 'top-right';
+ $$.isLegendLeft = config.legend_inset_anchor === 'top-left' || config.legend_inset_anchor === 'bottom-left';
+ $$.legendStep = 0;
+ $$.legendItemWidth = 0;
+ $$.legendItemHeight = 0;
+ $$.legendOpacityForHidden = 0.15;
+
+ $$.currentMaxTickWidth = 0;
+
+ $$.rotated_padding_left = 30;
+ $$.rotated_padding_right = config.axis_rotated && !config.axis_x_show ? 0 : 30;
+ $$.rotated_padding_top = 5;
+
+ $$.withoutFadeIn = {};
+
+ $$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js
+ };
+
+ c3_chart_internal_fn.initWithData = function (data) {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ var main, binding = true;
+
+ if ($$.initPie) { $$.initPie(); }
+ if ($$.initBrush) { $$.initBrush(); }
+ if ($$.initZoom) { $$.initZoom(); }
+
+ $$.selectChart = d3.select(config.bindto);
+ if ($$.selectChart.empty()) {
+ $$.selectChart = d3.select(document.createElement('div')).style('opacity', 0);
+ $$.observeInserted($$.selectChart);
+ binding = false;
+ }
+ $$.selectChart.html("").classed("c3", true);
+
+ // Init data as targets
+ $$.data.xs = {};
+ $$.data.targets = $$.convertDataToTargets(data);
+
+ if (config.data_filter) {
+ $$.data.targets = $$.data.targets.filter(config.data_filter);
+ }
+
+ // Set targets to hide if needed
+ if (config.data_hide) {
+ $$.addHiddenTargetIds(config.data_hide === true ? $$.mapToIds($$.data.targets) : config.data_hide);
+ }
+
+ // when gauge, hide legend // TODO: fix
+ if ($$.hasType('gauge')) {
+ config.legend_show = false;
+ }
+
+ // Init sizes and scales
+ $$.updateSizes();
+ $$.updateScales();
+
+ // Set domains for each scale
+ $$.x.domain(d3.extent($$.getXDomain($$.data.targets)));
+ $$.y.domain($$.getYDomain($$.data.targets, 'y'));
+ $$.y2.domain($$.getYDomain($$.data.targets, 'y2'));
+ $$.subX.domain($$.x.domain());
+ $$.subY.domain($$.y.domain());
+ $$.subY2.domain($$.y2.domain());
+
+ // Save original x domain for zoom update
+ $$.orgXDomain = $$.x.domain();
+
+ // Set initialized scales to brush and zoom
+ if ($$.brush) { $$.brush.scale($$.subX); }
+ if (config.zoom_enabled) { $$.zoom.scale($$.x); }
+
+ /*-- Basic Elements --*/
+
+ // Define svgs
+ $$.svg = $$.selectChart.append("svg")
+ .style("overflow", "hidden")
+ .on('mouseenter', function () { return config.onmouseover.call($$); })
+ .on('mouseleave', function () { return config.onmouseout.call($$); });
+
+ // Define defs
+ $$.defs = $$.svg.append("defs");
+ $$.defs.append("clipPath").attr("id", $$.clipId).append("rect");
+ $$.defs.append("clipPath").attr("id", $$.clipIdForXAxis).append("rect");
+ $$.defs.append("clipPath").attr("id", $$.clipIdForYAxis).append("rect");
+ $$.updateSvgSize();
+
+ // Define regions
+ main = $$.main = $$.svg.append("g").attr("transform", $$.getTranslate('main'));
+
+ if ($$.initSubchart) { $$.initSubchart(); }
+ if ($$.initTooltip) { $$.initTooltip(); }
+ if ($$.initLegend) { $$.initLegend(); }
+
+ /*-- Main Region --*/
+
+ // text when empty
+ main.append("text")
+ .attr("class", CLASS.text + ' ' + CLASS.empty)
+ .attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
+ .attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE.
+
+ // Regions
+ $$.initRegion();
+
+ // Grids
+ $$.initGrid();
+
+ // Define g for chart area
+ main.append('g')
+ .attr("clip-path", $$.clipPath)
+ .attr('class', CLASS.chart);
+
+ // Cover whole with rects for events
+ $$.initEventRect();
+
+ // Define g for bar chart area
+ if ($$.initBar) { $$.initBar(); }
+
+ // Define g for line chart area
+ if ($$.initLine) { $$.initLine(); }
+
+ // Define g for arc chart area
+ if ($$.initArc) { $$.initArc(); }
+ if ($$.initGauge) { $$.initGauge(); }
+
+ // Define g for text area
+ if ($$.initText) { $$.initText(); }
+
+ // if zoom privileged, insert rect to forefront
+ // TODO: is this needed?
+ main.insert('rect', config.zoom_privileged ? null : 'g.' + CLASS.regions)
+ .attr('class', CLASS.zoomRect)
+ .attr('width', $$.width)
+ .attr('height', $$.height)
+ .style('opacity', 0)
+ .on("dblclick.zoom", null);
+
+ // Set default extent if defined
+ if (config.axis_x_default) {
+ $$.brush.extent(isFunction(config.axis_x_default) ? config.axis_x_default($$.getXDomain()) : config.axis_x_default);
+ }
+
+ // Add Axis
+ $$.initAxis();
+
+ // Set targets
+ $$.updateTargets($$.data.targets);
+
+ // Draw with targets
+ if (binding) {
+ $$.updateDimension();
+ $$.redraw({
+ withTransform: true,
+ withUpdateXDomain: true,
+ withUpdateOrgXDomain: true,
+ withTransitionForAxis: false
+ });
+ }
+
+ // Bind resize event
+ if (window.onresize == null) {
+ window.onresize = $$.generateResize();
+ }
+ if (window.onresize.add) {
+ window.onresize.add(function () {
+ config.onresize.call($$);
+ });
+ window.onresize.add(function () {
+ $$.api.flush();
+ });
+ window.onresize.add(function () {
+ config.onresized.call($$);
+ });
+ }
+
+ // export element of the chart
+ $$.api.element = $$.selectChart.node();
+ };
+
+ c3_chart_internal_fn.smoothLines = function (el, type) {
+ var $$ = this;
+ if (type === 'grid') {
+ el.each(function () {
+ var g = $$.d3.select(this),
+ x1 = g.attr('x1'),
+ x2 = g.attr('x2'),
+ y1 = g.attr('y1'),
+ y2 = g.attr('y2');
+ g.attr({
+ 'x1': Math.ceil(x1),
+ 'x2': Math.ceil(x2),
+ 'y1': Math.ceil(y1),
+ 'y2': Math.ceil(y2)
+ });
+ });
+ }
+ };
+
+
+ c3_chart_internal_fn.updateSizes = function () {
+ var $$ = this, config = $$.config;
+ var legendHeight = $$.legend ? $$.getLegendHeight() : 0,
+ legendWidth = $$.legend ? $$.getLegendWidth() : 0,
+ legendHeightForBottom = $$.isLegendRight || $$.isLegendInset ? 0 : legendHeight,
+ hasArc = $$.hasArcType(),
+ xAxisHeight = config.axis_rotated || hasArc ? 0 : $$.getHorizontalAxisHeight('x'),
+ subchartHeight = config.subchart_show && !hasArc ? (config.subchart_size_height + xAxisHeight) : 0;
+
+ $$.currentWidth = $$.getCurrentWidth();
+ $$.currentHeight = $$.getCurrentHeight();
+
+ // for main
+ $$.margin = config.axis_rotated ? {
+ top: $$.getHorizontalAxisHeight('y2') + $$.getCurrentPaddingTop(),
+ right: hasArc ? 0 : $$.getCurrentPaddingRight(),
+ bottom: $$.getHorizontalAxisHeight('y') + legendHeightForBottom + $$.getCurrentPaddingBottom(),
+ left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft())
+ } : {
+ top: 4 + $$.getCurrentPaddingTop(), // for top tick text
+ right: hasArc ? 0 : $$.getCurrentPaddingRight(),
+ bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
+ left: hasArc ? 0 : $$.getCurrentPaddingLeft()
+ };
+
+ // for subchart
+ $$.margin2 = config.axis_rotated ? {
+ top: $$.margin.top,
+ right: NaN,
+ bottom: 20 + legendHeightForBottom,
+ left: $$.rotated_padding_left
+ } : {
+ top: $$.currentHeight - subchartHeight - legendHeightForBottom,
+ right: NaN,
+ bottom: xAxisHeight + legendHeightForBottom,
+ left: $$.margin.left
+ };
+
+ // for legend
+ $$.margin3 = {
+ top: 0,
+ right: NaN,
+ bottom: 0,
+ left: 0
+ };
+ if ($$.updateSizeForLegend) { $$.updateSizeForLegend(legendHeight, legendWidth); }
+
+ $$.width = $$.currentWidth - $$.margin.left - $$.margin.right;
+ $$.height = $$.currentHeight - $$.margin.top - $$.margin.bottom;
+ if ($$.width < 0) { $$.width = 0; }
+ if ($$.height < 0) { $$.height = 0; }
+
+ $$.width2 = config.axis_rotated ? $$.margin.left - $$.rotated_padding_left - $$.rotated_padding_right : $$.width;
+ $$.height2 = config.axis_rotated ? $$.height : $$.currentHeight - $$.margin2.top - $$.margin2.bottom;
+ if ($$.width2 < 0) { $$.width2 = 0; }
+ if ($$.height2 < 0) { $$.height2 = 0; }
+
+ // for arc
+ $$.arcWidth = $$.width - ($$.isLegendRight ? legendWidth + 10 : 0);
+ $$.arcHeight = $$.height - ($$.isLegendRight ? 0 : 10);
+ if ($$.updateRadius) { $$.updateRadius(); }
+
+ if ($$.isLegendRight && hasArc) {
+ $$.margin3.left = $$.arcWidth / 2 + $$.radiusExpanded * 1.1;
+ }
+ };
+
+ c3_chart_internal_fn.updateTargets = function (targets) {
+ var $$ = this, config = $$.config;
+
+ /*-- Main --*/
+
+ //-- Text --//
+ $$.updateTargetsForText(targets);
+
+ //-- Bar --//
+ $$.updateTargetsForBar(targets);
+
+ //-- Line --//
+ $$.updateTargetsForLine(targets);
+
+ //-- Arc --//
+ if ($$.updateTargetsForArc) { $$.updateTargetsForArc(targets); }
+ if ($$.updateTargetsForSubchart) { $$.updateTargetsForSubchart(targets); }
+
+ /*-- Show --*/
+
+ // Fade-in each chart
+ $$.svg.selectAll('.' + CLASS.target).filter(function (d) { return $$.isTargetToShow(d.id); })
+ .transition().duration(config.transition_duration)
+ .style("opacity", 1);
+ };
+
+ c3_chart_internal_fn.redraw = function (options, transitions) {
+ var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config;
+ var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType);
+ var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis, withTransform, withUpdateXDomain, withUpdateOrgXDomain, withLegend;
+ var hideAxis = $$.hasArcType();
+ var drawArea, drawBar, drawLine, xForText, yForText;
+ var duration, durationForExit, durationForAxis;
+ var waitForDraw, flow;
+ var targetsToShow = $$.filterTargetsToShow($$.data.targets), tickValues, i, intervalForCulling;
+ var xv = $$.xv.bind($$),
+ cx = ($$.config.axis_rotated ? $$.circleY : $$.circleX).bind($$),
+ cy = ($$.config.axis_rotated ? $$.circleX : $$.circleY).bind($$);
+
+ options = options || {};
+ withY = getOption(options, "withY", true);
+ withSubchart = getOption(options, "withSubchart", true);
+ withTransition = getOption(options, "withTransition", true);
+ withTransform = getOption(options, "withTransform", false);
+ withUpdateXDomain = getOption(options, "withUpdateXDomain", false);
+ withUpdateOrgXDomain = getOption(options, "withUpdateOrgXDomain", false);
+ withLegend = getOption(options, "withLegend", false);
+ withTransitionForExit = getOption(options, "withTransitionForExit", withTransition);
+ withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition);
+
+ duration = withTransition ? config.transition_duration : 0;
+ durationForExit = withTransitionForExit ? duration : 0;
+ durationForAxis = withTransitionForAxis ? duration : 0;
+
+ transitions = transitions || $$.generateAxisTransitions(durationForAxis);
+
+ // update legend and transform each g
+ if (withLegend && config.legend_show) {
+ $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
+ }
+
+ // MEMO: needed for grids calculation
+ if ($$.isCategorized() && targetsToShow.length === 0) {
+ $$.x.domain([0, $$.axes.x.selectAll('.tick').size()]);
+ }
+
+ if (targetsToShow.length) {
+ $$.updateXDomain(targetsToShow, withUpdateXDomain, withUpdateOrgXDomain);
+ // update axis tick values according to options
+ if (!config.axis_x_tick_values && (config.axis_x_tick_fit || config.axis_x_tick_count)) {
+ tickValues = $$.generateTickValues($$.mapTargetsToUniqueXs(targetsToShow), config.axis_x_tick_count);
+ $$.xAxis.tickValues(tickValues);
+ $$.subXAxis.tickValues(tickValues);
+ }
+ } else {
+ $$.xAxis.tickValues([]);
+ $$.subXAxis.tickValues([]);
+ }
+
+ $$.y.domain($$.getYDomain(targetsToShow, 'y'));
+ $$.y2.domain($$.getYDomain(targetsToShow, 'y2'));
+
+ // axes
+ $$.redrawAxis(transitions, hideAxis);
+
+ // Update axis label
+ $$.updateAxisLabels(withTransition);
+
+ // show/hide if manual culling needed
+ if (withUpdateXDomain && targetsToShow.length) {
+ if (config.axis_x_tick_culling && tickValues) {
+ for (i = 1; i < tickValues.length; i++) {
+ if (tickValues.length / i < config.axis_x_tick_culling_max) {
+ intervalForCulling = i;
+ break;
+ }
+ }
+ $$.svg.selectAll('.' + CLASS.axisX + ' .tick text').each(function (e) {
+ var index = tickValues.indexOf(e);
+ if (index >= 0) {
+ d3.select(this).style('display', index % intervalForCulling ? 'none' : 'block');
+ }
+ });
+ } else {
+ $$.svg.selectAll('.' + CLASS.axisX + ' .tick text').style('display', 'block');
+ }
+ }
+
+ // rotate tick text if needed
+ if (!config.axis_rotated && config.axis_x_tick_rotate) {
+ $$.rotateTickText($$.axes.x, transitions.axisX, config.axis_x_tick_rotate);
+ }
+
+ // setup drawer - MEMO: these must be called after axis updated
+ drawArea = $$.generateDrawArea ? $$.generateDrawArea(areaIndices, false) : undefined;
+ drawBar = $$.generateDrawBar ? $$.generateDrawBar(barIndices) : undefined;
+ drawLine = $$.generateDrawLine ? $$.generateDrawLine(lineIndices, false) : undefined;
+ xForText = $$.generateXYForText(barIndices, true);
+ yForText = $$.generateXYForText(barIndices, false);
+
+ // Update sub domain
+ $$.subY.domain($$.y.domain());
+ $$.subY2.domain($$.y2.domain());
+
+ // tooltip
+ $$.tooltip.style("display", "none");
+
+ // xgrid focus
+ $$.updateXgridFocus();
+
+ // Data empty label positioning and text.
+ main.select("text." + CLASS.text + '.' + CLASS.empty)
+ .attr("x", $$.width / 2)
+ .attr("y", $$.height / 2)
+ .text(config.data_empty_label_text)
+ .transition()
+ .style('opacity', targetsToShow.length ? 0 : 1);
+
+ // grid
+ $$.redrawGrid(duration, withY);
+
+ // rect for regions
+ $$.redrawRegion(duration);
+
+ // bars
+ $$.redrawBar(durationForExit);
+
+ // lines, areas and cricles
+ $$.redrawLine(durationForExit);
+ $$.redrawArea(durationForExit);
+ if (config.point_show) { $$.redrawCircle(); }
+
+ // text
+ if ($$.hasDataLabel()) {
+ $$.redrawText(durationForExit);
+ }
+
+ // arc
+ if ($$.redrawArc) { $$.redrawArc(duration, durationForExit, withTransform); }
+
+ // subchart
+ if ($$.redrawSubchart) {
+ $$.redrawSubchart(withSubchart, transitions, duration, durationForExit, areaIndices, barIndices, lineIndices);
+ }
+
+ // circles for select
+ main.selectAll('.' + CLASS.selectedCircles)
+ .filter($$.isBarType.bind($$))
+ .selectAll('circle')
+ .remove();
+
+ // event rect
+ if (config.interaction_enabled) {
+ $$.redrawEventRect();
+ }
+
+ // transition should be derived from one transition
+ d3.transition().duration(duration).each(function () {
+ var transitions = [];
+
+ $$.addTransitionForBar(transitions, drawBar);
+ $$.addTransitionForLine(transitions, drawLine);
+ $$.addTransitionForArea(transitions, drawArea);
+ if (config.point_show) { $$.addTransitionForCircle(transitions, cx, cy); }
+ $$.addTransitionForText(transitions, xForText, yForText, options.flow);
+ $$.addTransitionForRegion(transitions);
+ $$.addTransitionForGrid(transitions);
+
+ // Wait for end of transitions if called from flow API
+ if (options.flow) {
+ waitForDraw = $$.generateWait();
+ transitions.forEach(function (t) {
+ waitForDraw.add(t);
+ });
+ flow = $$.generateFlow({
+ targets: targetsToShow,
+ flow: options.flow,
+ duration: duration,
+ drawBar: drawBar,
+ drawLine: drawLine,
+ drawArea: drawArea,
+ cx: cx,
+ cy: cy,
+ xv: xv,
+ xForText: xForText,
+ yForText: yForText
+ });
+ }
+ })
+ .call(waitForDraw || function () {}, flow || function () {});
+
+ // update fadein condition
+ $$.mapToIds($$.data.targets).forEach(function (id) {
+ $$.withoutFadeIn[id] = true;
+ });
+
+ if ($$.updateZoom) { $$.updateZoom(); }
+ };
+
+ c3_chart_internal_fn.updateAndRedraw = function (options) {
+ var $$ = this, config = $$.config, transitions;
+ options = options || {};
+ // same with redraw
+ options.withTransition = getOption(options, "withTransition", true);
+ options.withTransform = getOption(options, "withTransform", false);
+ options.withLegend = getOption(options, "withLegend", false);
+ // NOT same with redraw
+ options.withUpdateXDomain = true;
+ options.withUpdateOrgXDomain = true;
+ options.withTransitionForExit = false;
+ options.withTransitionForTransform = getOption(options, "withTransitionForTransform", options.withTransition);
+ // MEMO: this needs to be called before updateLegend and it means this ALWAYS needs to be called)
+ $$.updateSizes();
+ // MEMO: called in updateLegend in redraw if withLegend
+ if (!(options.withLegend && config.legend_show)) {
+ transitions = $$.generateAxisTransitions(options.withTransitionForAxis ? config.transition_duration : 0);
+ // Update scales
+ $$.updateScales();
+ $$.updateSvgSize();
+ // Update g positions
+ $$.transformAll(options.withTransitionForTransform, transitions);
+ }
+ // Draw with new sizes & scales
+ $$.redraw(options, transitions);
+ };
+
+ c3_chart_internal_fn.isTimeSeries = function () {
+ return this.config.axis_x_type === 'timeseries';
+ };
+ c3_chart_internal_fn.isCategorized = function () {
+ return this.config.axis_x_type.indexOf('categor') >= 0;
+ };
+ c3_chart_internal_fn.isCustomX = function () {
+ var $$ = this, config = $$.config;
+ return !$$.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));
+ };
+
+ c3_chart_internal_fn.getTranslate = function (target) {
+ var $$ = this, config = $$.config, x, y;
+ if (target === 'main') {
+ x = asHalfPixel($$.margin.left);
+ y = asHalfPixel($$.margin.top);
+ } else if (target === 'context') {
+ x = asHalfPixel($$.margin2.left);
+ y = asHalfPixel($$.margin2.top);
+ } else if (target === 'legend') {
+ x = $$.margin3.left;
+ y = $$.margin3.top;
+ } else if (target === 'x') {
+ x = 0;
+ y = config.axis_rotated ? 0 : $$.height;
+ } else if (target === 'y') {
+ x = 0;
+ y = config.axis_rotated ? $$.height : 0;
+ } else if (target === 'y2') {
+ x = config.axis_rotated ? 0 : $$.width;
+ y = config.axis_rotated ? 1 : 0;
+ } else if (target === 'subx') {
+ x = 0;
+ y = config.axis_rotated ? 0 : $$.height2;
+ } else if (target === 'arc') {
+ x = $$.arcWidth / 2;
+ y = $$.arcHeight / 2;
+ }
+ return "translate(" + x + "," + y + ")";
+ };
+ c3_chart_internal_fn.initialOpacity = function (d) {
+ return d.value !== null && this.withoutFadeIn[d.id] ? 1 : 0;
+ };
+ c3_chart_internal_fn.opacityForCircle = function (d) {
+ var $$ = this;
+ return isValue(d.value) ? $$.isScatterType(d) ? 0.5 : 1 : 0;
+ };
+ c3_chart_internal_fn.opacityForText = function () {
+ return this.hasDataLabel() ? 1 : 0;
+ };
+ c3_chart_internal_fn.xx = function (d) {
+ return d ? this.x(d.x) : null;
+ };
+ c3_chart_internal_fn.xv = function (d) {
+ var $$ = this;
+ return Math.ceil($$.x($$.isTimeSeries() ? $$.parseDate(d.value) : d.value));
+ };
+ c3_chart_internal_fn.yv = function (d) {
+ var $$ = this,
+ yScale = d.axis && d.axis === 'y2' ? $$.y2 : $$.y;
+ return Math.ceil(yScale(d.value));
+ };
+ c3_chart_internal_fn.subxx = function (d) {
+ return d ? this.subX(d.x) : null;
+ };
+
+ c3_chart_internal_fn.transformMain = function (withTransition, transitions) {
+ var $$ = this,
+ xAxis, yAxis, y2Axis;
+ if (transitions && transitions.axisX) {
+ xAxis = transitions.axisX;
+ } else {
+ xAxis = $$.main.select('.' + CLASS.axisX);
+ if (withTransition) { xAxis = xAxis.transition(); }
+ }
+ if (transitions && transitions.axisY) {
+ yAxis = transitions.axisY;
+ } else {
+ yAxis = $$.main.select('.' + CLASS.axisY);
+ if (withTransition) { yAxis = yAxis.transition(); }
+ }
+ if (transitions && transitions.axisY2) {
+ y2Axis = transitions.axisY2;
+ } else {
+ y2Axis = $$.main.select('.' + CLASS.axisY2);
+ if (withTransition) { y2Axis = y2Axis.transition(); }
+ }
+ (withTransition ? $$.main.transition() : $$.main).attr("transform", $$.getTranslate('main'));
+ xAxis.attr("transform", $$.getTranslate('x'));
+ yAxis.attr("transform", $$.getTranslate('y'));
+ y2Axis.attr("transform", $$.getTranslate('y2'));
+ $$.main.select('.' + CLASS.chartArcs).attr("transform", $$.getTranslate('arc'));
+ };
+ c3_chart_internal_fn.transformAll = function (withTransition, transitions) {
+ var $$ = this;
+ $$.transformMain(withTransition, transitions);
+ if ($$.config.subchart_show) { $$.transformContext(withTransition, transitions); }
+ if ($$.legend) { $$.transformLegend(withTransition); }
+ };
+
+ c3_chart_internal_fn.updateSvgSize = function () {
+ var $$ = this;
+ $$.svg.attr('width', $$.currentWidth).attr('height', $$.currentHeight);
+ $$.svg.select('#' + $$.clipId).select('rect')
+ .attr('width', $$.width)
+ .attr('height', $$.height);
+ $$.svg.select('#' + $$.clipIdForXAxis).select('rect')
+ .attr('x', $$.getXAxisClipX.bind($$))
+ .attr('y', $$.getXAxisClipY.bind($$))
+ .attr('width', $$.getXAxisClipWidth.bind($$))
+ .attr('height', $$.getXAxisClipHeight.bind($$));
+ $$.svg.select('#' + $$.clipIdForYAxis).select('rect')
+ .attr('x', $$.getYAxisClipX.bind($$))
+ .attr('y', $$.getYAxisClipY.bind($$))
+ .attr('width', $$.getYAxisClipWidth.bind($$))
+ .attr('height', $$.getYAxisClipHeight.bind($$));
+ $$.svg.select('.' + CLASS.zoomRect)
+ .attr('width', $$.width)
+ .attr('height', $$.height);
+ // MEMO: parent div's height will be bigger than svg when <!DOCTYPE html>
+ $$.selectChart.style('max-height', $$.currentHeight + "px");
+ };
+
+
+ c3_chart_internal_fn.updateDimension = function () {
+ var $$ = this;
+ if ($$.config.axis_rotated) {
+ $$.axes.x.call($$.xAxis);
+ $$.axes.subx.call($$.subXAxis);
+ } else {
+ $$.axes.y.call($$.yAxis);
+ $$.axes.y2.call($$.y2Axis);
+ }
+ $$.updateSizes();
+ $$.updateScales();
+ $$.updateSvgSize();
+ $$.transformAll(false);
+ };
+
+ c3_chart_internal_fn.observeInserted = function (selection) {
+ var $$ = this, observer = new MutationObserver(function (mutations) {
+ mutations.forEach(function (mutation) {
+ if (mutation.type === 'childList' && mutation.previousSibling) {
+ observer.disconnect();
+ // need to wait for completion of load because size calculation requires the actual sizes determined after that completion
+ var interval = window.setInterval(function () {
+ // parentNode will NOT be null when completed
+ if (selection.node().parentNode) {
+ window.clearInterval(interval);
+ $$.updateDimension();
+ $$.redraw({
+ withTransform: true,
+ withUpdateXDomain: true,
+ withUpdateOrgXDomain: true,
+ withTransition: false,
+ withTransitionForTransform: false,
+ withLegend: true
+ });
+ selection.transition().style('opacity', 1);
+ }
+ }, 10);
+ }
+ });
+ });
+ observer.observe(selection.node(), {attributes: true, childList: true, characterData: true});
+ };
+
+
+ c3_chart_internal_fn.generateResize = function () {
+ var resizeFunctions = [];
+ function callResizeFunctions() {
+ resizeFunctions.forEach(function (f) {
+ f();
+ });
+ }
+ callResizeFunctions.add = function (f) {
+ resizeFunctions.push(f);
+ };
+ return callResizeFunctions;
+ };
+
+ c3_chart_internal_fn.endall = function (transition, callback) {
+ var n = 0;
+ transition
+ .each(function () { ++n; })
+ .each("end", function () {
+ if (!--n) { callback.apply(this, arguments); }
+ });
+ };
+ c3_chart_internal_fn.generateWait = function () {
+ var transitionsToWait = [],
+ f = function (transition, callback) {
+ var timer = setInterval(function () {
+ var done = 0;
+ transitionsToWait.forEach(function (t) {
+ if (t.empty()) {
+ done += 1;
+ return;
+ }
+ try {
+ t.transition();
+ } catch (e) {
+ done += 1;
+ }
+ });
+ if (done === transitionsToWait.length) {
+ clearInterval(timer);
+ if (callback) { callback(); }
+ }
+ }, 10);
+ };
+ f.add = function (transition) {
+ transitionsToWait.push(transition);
+ };
+ return f;
+ };
+
+ c3_chart_internal_fn.parseDate = function (date) {
+ var $$ = this, parsedDate;
+ if (date instanceof Date) {
+ parsedDate = date;
+ } else if (typeof date === 'number') {
+ parsedDate = new Date(date);
+ } else {
+ parsedDate = $$.dataTimeFormat($$.config.data_xFormat).parse(date);
+ }
+ if (!parsedDate || isNaN(+parsedDate)) {
+ window.console.error("Failed to parse x '" + date + "' to Date object");
+ }
+ return parsedDate;
+ };
+
+ c3_chart_internal_fn.getDefaultConfig = function () {
+ var config = {
+ bindto: '#chart',
+ size_width: undefined,
+ size_height: undefined,
+ padding_left: undefined,
+ padding_right: undefined,
+ padding_top: undefined,
+ padding_bottom: undefined,
+ zoom_enabled: false,
+ zoom_extent: undefined,
+ zoom_privileged: false,
+ zoom_onzoom: function () {},
+ interaction_enabled: true,
+ onmouseover: function () {},
+ onmouseout: function () {},
+ onresize: function () {},
+ onresized: function () {},
+ transition_duration: 350,
+ data_x: undefined,
+ data_xs: {},
+ data_xFormat: '%Y-%m-%d',
+ data_xLocaltime: true,
+ data_idConverter: function (id) { return id; },
+ data_names: {},
+ data_classes: {},
+ data_groups: [],
+ data_axes: {},
+ data_type: undefined,
+ data_types: {},
+ data_labels: {},
+ data_order: 'desc',
+ data_regions: {},
+ data_color: undefined,
+ data_colors: {},
+ data_hide: false,
+ data_filter: undefined,
+ data_selection_enabled: false,
+ data_selection_grouped: false,
+ data_selection_isselectable: function () { return true; },
+ data_selection_multiple: true,
+ data_onclick: function () {},
+ data_onmouseover: function () {},
+ data_onmouseout: function () {},
+ data_onselected: function () {},
+ data_onunselected: function () {},
+ data_ondragstart: function () {},
+ data_ondragend: function () {},
+ data_url: undefined,
+ data_json: undefined,
+ data_rows: undefined,
+ data_columns: undefined,
+ data_mimeType: undefined,
+ data_keys: undefined,
+ // configuration for no plot-able data supplied.
+ data_empty_label_text: "",
+ // subchart
+ subchart_show: false,
+ subchart_size_height: 60,
+ subchart_onbrush: function () {},
+ // color
+ color_pattern: [],
+ color_threshold: {},
+ // legend
+ legend_show: true,
+ legend_position: 'bottom',
+ legend_inset_anchor: 'top-left',
+ legend_inset_x: 10,
+ legend_inset_y: 0,
+ legend_inset_step: undefined,
+ legend_item_onclick: undefined,
+ legend_item_onmouseover: undefined,
+ legend_item_onmouseout: undefined,
+ legend_equally: false,
+ // axis
+ axis_rotated: false,
+ axis_x_show: true,
+ axis_x_type: 'indexed',
+ axis_x_localtime: true,
+ axis_x_categories: [],
+ axis_x_tick_centered: false,
+ axis_x_tick_format: undefined,
+ axis_x_tick_culling: {},
+ axis_x_tick_culling_max: 10,
+ axis_x_tick_count: undefined,
+ axis_x_tick_fit: true,
+ axis_x_tick_values: null,
+ axis_x_tick_rotate: undefined,
+ axis_x_tick_outer: true,
+ axis_x_max: null,
+ axis_x_min: null,
+ axis_x_padding: {},
+ axis_x_height: undefined,
+ axis_x_default: undefined,
+ axis_x_label: {},
+ axis_y_show: true,
+ axis_y_max: undefined,
+ axis_y_min: undefined,
+ axis_y_center: undefined,
+ axis_y_label: {},
+ axis_y_tick_format: undefined,
+ axis_y_tick_outer: true,
+ axis_y_padding: undefined,
+ axis_y_ticks: 10,
+ axis_y2_show: false,
+ axis_y2_max: undefined,
+ axis_y2_min: undefined,
+ axis_y2_center: undefined,
+ axis_y2_label: {},
+ axis_y2_tick_format: undefined,
+ axis_y2_tick_outer: true,
+ axis_y2_padding: undefined,
+ axis_y2_ticks: 10,
+ // grid
+ grid_x_show: false,
+ grid_x_type: 'tick',
+ grid_x_lines: [],
+ grid_y_show: false,
+ // not used
+ // grid_y_type: 'tick',
+ grid_y_lines: [],
+ grid_y_ticks: 10,
+ grid_focus_show: true,
+ // point - point of each data
+ point_show: true,
+ point_r: 2.5,
+ point_focus_expand_enabled: true,
+ point_focus_expand_r: undefined,
+ point_select_r: undefined,
+ line_connect_null: false,
+ // bar
+ bar_width: undefined,
+ bar_width_ratio: 0.6,
+ bar_width_max: undefined,
+ bar_zerobased: true,
+ // area
+ area_zerobased: true,
+ // pie
+ pie_label_show: true,
+ pie_label_format: undefined,
+ pie_label_threshold: 0.05,
+ pie_sort: true,
+ pie_expand: true,
+ // gauge
+ gauge_label_show: true,
+ gauge_label_format: undefined,
+ gauge_expand: true,
+ gauge_min: 0,
+ gauge_max: 100,
+ gauge_units: undefined,
+ gauge_width: undefined,
+ // donut
+ donut_label_show: true,
+ donut_label_format: undefined,
+ donut_label_threshold: 0.05,
+ donut_width: undefined,
+ donut_sort: true,
+ donut_expand: true,
+ donut_title: "",
+ // region - region to change style
+ regions: [],
+ // tooltip - show when mouseover on each data
+ tooltip_show: true,
+ tooltip_grouped: true,
+ tooltip_format_title: undefined,
+ tooltip_format_name: undefined,
+ tooltip_format_value: undefined,
+ tooltip_contents: function (d, defaultTitleFormat, defaultValueFormat, color) {
+ return this.getTooltipContent ? this.getTooltipContent(d, defaultTitleFormat, defaultValueFormat, color) : '';
+ },
+ tooltip_init_show: false,
+ tooltip_init_x: 0,
+ tooltip_init_position: {top: '0px', left: '50px'}
+ };
+
+ Object.keys(this.additionalConfig).forEach(function (key) {
+ config[key] = this.additionalConfig[key];
+ }, this);
+
+ return config;
+ };
+ c3_chart_internal_fn.additionalConfig = {};
+
+ c3_chart_internal_fn.loadConfig = function (config) {
+ var this_config = this.config, target, keys, read;
+ function find() {
+ var key = keys.shift();
+ // console.log("key =>", key, ", target =>", target);
+ if (key && target && typeof target === 'object' && key in target) {
+ target = target[key];
+ return find();
+ }
+ else if (!key) {
+ return target;
+ }
+ else {
+ return undefined;
+ }
+ }
+ Object.keys(this_config).forEach(function (key) {
+ target = config;
+ keys = key.split('_');
+ read = find();
+ // console.log("CONFIG : ", key, read);
+ if (isDefined(read)) {
+ this_config[key] = read;
+ }
+ });
+ };
+
+ c3_chart_internal_fn.getScale = function (min, max, forTimeseries) {
+ return (forTimeseries ? this.d3.time.scale() : this.d3.scale.linear()).range([min, max]);
+ };
+ c3_chart_internal_fn.getX = function (min, max, domain, offset) {
+ var $$ = this,
+ scale = $$.getScale(min, max, $$.isTimeSeries()),
+ _scale = domain ? scale.domain(domain) : scale, key;
+ // Define customized scale if categorized axis
+ if ($$.isCategorized()) {
+ offset = offset || function () { return 0; };
+ scale = function (d, raw) {
+ var v = _scale(d) + offset(d);
+ return raw ? v : Math.ceil(v);
+ };
+ } else {
+ scale = function (d, raw) {
+ var v = _scale(d);
+ return raw ? v : Math.ceil(v);
+ };
+ }
+ // define functions
+ for (key in _scale) {
+ scale[key] = _scale[key];
+ }
+ scale.orgDomain = function () {
+ return _scale.domain();
+ };
+ // define custom domain() for categorized axis
+ if ($$.isCategorized()) {
+ scale.domain = function (domain) {
+ if (!arguments.length) {
+ domain = this.orgDomain();
+ return [domain[0], domain[1] + 1];
+ }
+ _scale.domain(domain);
+ return scale;
+ };
+ }
+ return scale;
+ };
+ c3_chart_internal_fn.getY = function (min, max, domain) {
+ var scale = this.getScale(min, max);
+ if (domain) { scale.domain(domain); }
+ return scale;
+ };
+ c3_chart_internal_fn.getYScale = function (id) {
+ return this.getAxisId(id) === 'y2' ? this.y2 : this.y;
+ };
+ c3_chart_internal_fn.getSubYScale = function (id) {
+ return this.getAxisId(id) === 'y2' ? this.subY2 : this.subY;
+ };
+ c3_chart_internal_fn.updateScales = function () {
+ var $$ = this, config = $$.config,
+ forInit = !$$.x;
+ // update edges
+ $$.xMin = config.axis_rotated ? 1 : 0;
+ $$.xMax = config.axis_rotated ? $$.height : $$.width;
+ $$.yMin = config.axis_rotated ? 0 : $$.height;
+ $$.yMax = config.axis_rotated ? $$.width : 1;
+ $$.subXMin = $$.xMin;
+ $$.subXMax = $$.xMax;
+ $$.subYMin = config.axis_rotated ? 0 : $$.height2;
+ $$.subYMax = config.axis_rotated ? $$.width2 : 1;
+ // update scales
+ $$.x = $$.getX($$.xMin, $$.xMax, forInit ? undefined : $$.x.orgDomain(), function () { return $$.xAxis.tickOffset(); });
+ $$.y = $$.getY($$.yMin, $$.yMax, forInit ? undefined : $$.y.domain());
+ $$.y2 = $$.getY($$.yMin, $$.yMax, forInit ? undefined : $$.y2.domain());
+ $$.subX = $$.getX($$.xMin, $$.xMax, $$.orgXDomain, function (d) { return d % 1 ? 0 : $$.subXAxis.tickOffset(); });
+ $$.subY = $$.getY($$.subYMin, $$.subYMax, forInit ? undefined : $$.subY.domain());
+ $$.subY2 = $$.getY($$.subYMin, $$.subYMax, forInit ? undefined : $$.subY2.domain());
+ // update axes
+ $$.xAxisTickFormat = $$.getXAxisTickFormat();
+ $$.xAxisTickValues = config.axis_x_tick_values ? config.axis_x_tick_values : (forInit ? undefined : $$.xAxis.tickValues());
+ $$.xAxis = $$.getXAxis($$.x, $$.xOrient, $$.xAxisTickFormat, $$.xAxisTickValues);
+ $$.subXAxis = $$.getXAxis($$.subX, $$.subXOrient, $$.xAxisTickFormat, $$.xAxisTickValues);
+ $$.yAxis = $$.getYAxis($$.y, $$.yOrient, config.axis_y_tick_format, config.axis_y_ticks);
+ $$.y2Axis = $$.getYAxis($$.y2, $$.y2Orient, config.axis_y2_tick_format, config.axis_y2_ticks);
+ // Set initialized scales to brush and zoom
+ if (!forInit) {
+ if ($$.brush) { $$.brush.scale($$.subX); }
+ if (config.zoom_enabled) { $$.zoom.scale($$.x); }
+ }
+ // update for arc
+ if ($$.updateArc) { $$.updateArc(); }
+ };
+
+ c3_chart_internal_fn.getYDomainMin = function (targets) {
+ var $$ = this, config = $$.config,
+ ids = $$.mapToIds(targets), ys = $$.getValuesAsIdKeyed(targets),
+ j, k, baseId, idsInGroup, id, hasNegativeValue;
+ if (config.data_groups.length > 0) {
+ hasNegativeValue = $$.hasNegativeValueInTargets(targets);
+ for (j = 0; j < config.data_groups.length; j++) {
+ // Determine baseId
+ idsInGroup = config.data_groups[j].filter(function (id) { return ids.indexOf(id) >= 0; });
+ if (idsInGroup.length === 0) { continue; }
+ baseId = idsInGroup[0];
+ // Consider negative values
+ if (hasNegativeValue && ys[baseId]) {
+ ys[baseId].forEach(function (v, i) {
+ ys[baseId][i] = v < 0 ? v : 0;
+ });
+ }
+ // Compute min
+ for (k = 1; k < idsInGroup.length; k++) {
+ id = idsInGroup[k];
+ if (! ys[id]) { continue; }
+ ys[id].forEach(function (v, i) {
+ if ($$.getAxisId(id) === $$.getAxisId(baseId) && ys[baseId] && !(hasNegativeValue && +v > 0)) {
+ ys[baseId][i] += +v;
+ }
+ });
+ }
+ }
+ }
+ return $$.d3.min(Object.keys(ys).map(function (key) { return $$.d3.min(ys[key]); }));
+ };
+ c3_chart_internal_fn.getYDomainMax = function (targets) {
+ var $$ = this, config = $$.config,
+ ids = $$.mapToIds(targets), ys = $$.getValuesAsIdKeyed(targets),
+ j, k, baseId, idsInGroup, id, hasPositiveValue;
+ if (config.data_groups.length > 0) {
+ hasPositiveValue = $$.hasPositiveValueInTargets(targets);
+ for (j = 0; j < config.data_groups.length; j++) {
+ // Determine baseId
+ idsInGroup = config.data_groups[j].filter(function (id) { return ids.indexOf(id) >= 0; });
+ if (idsInGroup.length === 0) { continue; }
+ baseId = idsInGroup[0];
+ // Consider positive values
+ if (hasPositiveValue && ys[baseId]) {
+ ys[baseId].forEach(function (v, i) {
+ ys[baseId][i] = v > 0 ? v : 0;
+ });
+ }
+ // Compute max
+ for (k = 1; k < idsInGroup.length; k++) {
+ id = idsInGroup[k];
+ if (! ys[id]) { continue; }
+ ys[id].forEach(function (v, i) {
+ if ($$.getAxisId(id) === $$.getAxisId(baseId) && ys[baseId] && !(hasPositiveValue && +v < 0)) {
+ ys[baseId][i] += +v;
+ }
+ });
+ }
+ }
+ }
+ return $$.d3.max(Object.keys(ys).map(function (key) { return $$.d3.max(ys[key]); }));
+ };
+ c3_chart_internal_fn.getYDomain = function (targets, axisId) {
+ var $$ = this, config = $$.config,
+ yTargets = targets.filter(function (d) { return $$.getAxisId(d.id) === axisId; }),
+ yMin = axisId === 'y2' ? config.axis_y2_min : config.axis_y_min,
+ yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max,
+ yDomainMin = isValue(yMin) ? yMin : $$.getYDomainMin(yTargets),
+ yDomainMax = isValue(yMax) ? yMax : $$.getYDomainMax(yTargets),
+ domainLength, padding, padding_top, padding_bottom,
+ center = axisId === 'y2' ? config.axis_y2_center : config.axis_y_center,
+ yDomainAbs, lengths, diff, ratio, isAllPositive, isAllNegative,
+ isZeroBased = ($$.hasType('bar', yTargets) && config.bar_zerobased) || ($$.hasType('area', yTargets) && config.area_zerobased),
+ showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated,
+ showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated;
+ if (yTargets.length === 0) { // use current domain if target of axisId is none
+ return axisId === 'y2' ? $$.y2.domain() : $$.y.domain();
+ }
+ if (yDomainMin === yDomainMax) {
+ yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0;
+ }
+ isAllPositive = yDomainMin >= 0 && yDomainMax >= 0;
+ isAllNegative = yDomainMin <= 0 && yDomainMax <= 0;
+
+ // Bar/Area chart should be 0-based if all positive|negative
+ if (isZeroBased) {
+ if (isAllPositive) { yDomainMin = 0; }
+ if (isAllNegative) { yDomainMax = 0; }
+ }
+
+ domainLength = Math.abs(yDomainMax - yDomainMin);
+ padding = padding_top = padding_bottom = domainLength * 0.1;
+
+ if (center) {
+ yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
+ yDomainMax = yDomainAbs - center;
+ yDomainMin = center - yDomainAbs;
+ }
+ // add padding for data label
+ if (showHorizontalDataLabel) {
+ lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, axisId, 'width');
+ diff = diffDomain($$.y.range());
+ ratio = [lengths[0] / diff, lengths[1] / diff];
+ padding_top += domainLength * (ratio[1] / (1 - ratio[0] - ratio[1]));
+ padding_bottom += domainLength * (ratio[0] / (1 - ratio[0] - ratio[1]));
+ } else if (showVerticalDataLabel) {
+ lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, axisId, 'height');
+ padding_top += lengths[1];
+ padding_bottom += lengths[0];
+ }
+ if (axisId === 'y' && config.axis_y_padding) {
+ padding_top = $$.getAxisPadding(config.axis_y_padding, 'top', padding, domainLength);
+ padding_bottom = $$.getAxisPadding(config.axis_y_padding, 'bottom', padding, domainLength);
+ }
+ if (axisId === 'y2' && config.axis_y2_padding) {
+ padding_top = $$.getAxisPadding(config.axis_y2_padding, 'top', padding, domainLength);
+ padding_bottom = $$.getAxisPadding(config.axis_y2_padding, 'bottom', padding, domainLength);
+ }
+ // Bar/Area chart should be 0-based if all positive|negative
+ if (isZeroBased) {
+ if (isAllPositive) { padding_bottom = yDomainMin; }
+ if (isAllNegative) { padding_top = -yDomainMax; }
+ }
+ return [yDomainMin - padding_bottom, yDomainMax + padding_top];
+ };
+ c3_chart_internal_fn.getXDomainMin = function (targets) {
+ var $$ = this, config = $$.config;
+ return config.axis_x_min ?
+ ($$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min) :
+ $$.d3.min(targets, function (t) { return $$.d3.min(t.values, function (v) { return v.x; }); });
+ };
+ c3_chart_internal_fn.getXDomainMax = function (targets) {
+ var $$ = this, config = $$.config;
+ return config.axis_x_max ?
+ ($$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max) :
+ $$.d3.max(targets, function (t) { return $$.d3.max(t.values, function (v) { return v.x; }); });
+ };
+ c3_chart_internal_fn.getXDomainPadding = function (targets) {
+ var $$ = this, config = $$.config,
+ edgeX = this.getEdgeX(targets), diff = edgeX[1] - edgeX[0],
+ maxDataCount, padding, paddingLeft, paddingRight;
+ if ($$.isCategorized()) {
+ padding = 0;
+ } else if ($$.hasType('bar', targets)) {
+ maxDataCount = $$.getMaxDataCount();
+ padding = maxDataCount > 1 ? (diff / (maxDataCount - 1)) / 2 : 0.5;
+ } else {
+ padding = diff * 0.01;
+ }
+ if (typeof config.axis_x_padding === 'object' && notEmpty(config.axis_x_padding)) {
+ paddingLeft = isValue(config.axis_x_padding.left) ? config.axis_x_padding.left : padding;
+ paddingRight = isValue(config.axis_x_padding.right) ? config.axis_x_padding.right : padding;
+ } else if (typeof config.axis_x_padding === 'number') {
+ paddingLeft = paddingRight = config.axis_x_padding;
+ } else {
+ paddingLeft = paddingRight = padding;
+ }
+ return {left: paddingLeft, right: paddingRight};
+ };
+ c3_chart_internal_fn.getXDomain = function (targets) {
+ var $$ = this,
+ xDomain = [$$.getXDomainMin(targets), $$.getXDomainMax(targets)],
+ firstX = xDomain[0], lastX = xDomain[1],
+ padding = $$.getXDomainPadding(targets),
+ min = 0, max = 0;
+ // show center of x domain if min and max are the same
+ if ((firstX - lastX) === 0 && !$$.isCategorized()) {
+ firstX = $$.isTimeSeries() ? new Date(firstX.getTime() * 0.5) : -0.5;
+ lastX = $$.isTimeSeries() ? new Date(lastX.getTime() * 1.5) : 0.5;
+ }
+ if (firstX || firstX === 0) {
+ min = $$.isTimeSeries() ? new Date(firstX.getTime() - padding.left) : firstX - padding.left;
+ }
+ if (lastX || lastX === 0) {
+ max = $$.isTimeSeries() ? new Date(lastX.getTime() + padding.right) : lastX + padding.right;
+ }
+ return [min, max];
+ };
+ c3_chart_internal_fn.updateXDomain = function (targets, withUpdateXDomain, withUpdateOrgXDomain, domain) {
+ var $$ = this, config = $$.config;
+ if (withUpdateOrgXDomain) {
+ $$.x.domain(domain ? domain : $$.d3.extent($$.getXDomain(targets)));
+ $$.orgXDomain = $$.x.domain();
+ if (config.zoom_enabled) { $$.zoom.scale($$.x).updateScaleExtent(); }
+ $$.subX.domain($$.x.domain());
+ if ($$.brush) { $$.brush.scale($$.subX); }
+ }
+ if (withUpdateXDomain) {
+ $$.x.domain(domain ? domain : (!$$.brush || $$.brush.empty()) ? $$.orgXDomain : $$.brush.extent());
+ if (config.zoom_enabled) { $$.zoom.scale($$.x).updateScaleExtent(); }
+ }
+ return $$.x.domain();
+ };
+
+ c3_chart_internal_fn.isX = function (key) {
+ var $$ = this, config = $$.config;
+ return (config.data_x && key === config.data_x) || (notEmpty(config.data_xs) && hasValue(config.data_xs, key));
+ };
+ c3_chart_internal_fn.isNotX = function (key) {
+ return !this.isX(key);
+ };
+ c3_chart_internal_fn.getXKey = function (id) {
+ var $$ = this, config = $$.config;
+ return config.data_x ? config.data_x : notEmpty(config.data_xs) ? config.data_xs[id] : null;
+ };
+ c3_chart_internal_fn.getXValuesOfXKey = function (key, targets) {
+ var $$ = this,
+ xValues, ids = targets && notEmpty(targets) ? $$.mapToIds(targets) : [];
+ ids.forEach(function (id) {
+ if ($$.getXKey(id) === key) {
+ xValues = $$.data.xs[id];
+ }
+ });
+ return xValues;
+ };
+ c3_chart_internal_fn.getXValue = function (id, i) {
+ var $$ = this;
+ return id in $$.data.xs && $$.data.xs[id] && isValue($$.data.xs[id][i]) ? $$.data.xs[id][i] : i;
+ };
+ c3_chart_internal_fn.getOtherTargetXs = function () {
+ var $$ = this,
+ idsForX = Object.keys($$.data.xs);
+ return idsForX.length ? $$.data.xs[idsForX[0]] : null;
+ };
+ c3_chart_internal_fn.getOtherTargetX = function (index) {
+ var xs = this.getOtherTargetXs();
+ return xs && index < xs.length ? xs[index] : null;
+ };
+ c3_chart_internal_fn.addXs = function (xs) {
+ var $$ = this;
+ Object.keys(xs).forEach(function (id) {
+ $$.config.data_xs[id] = xs[id];
+ });
+ };
+ c3_chart_internal_fn.hasMultipleX = function (xs) {
+ return this.d3.set(Object.keys(xs).map(function (id) { return xs[id]; })).size() > 1;
+ };
+ c3_chart_internal_fn.isMultipleX = function () {
+ var $$ = this, config = $$.config;
+ return notEmpty(config.data_xs) && $$.hasMultipleX(config.data_xs);
+ };
+ c3_chart_internal_fn.addName = function (data) {
+ var $$ = this, name;
+ if (data) {
+ name = $$.config.data_names[data.id];
+ data.name = name ? name : data.id;
+ }
+ return data;
+ };
+ c3_chart_internal_fn.getValueOnIndex = function (values, index) {
+ var valueOnIndex = values.filter(function (v) { return v.index === index; });
+ return valueOnIndex.length ? valueOnIndex[0] : null;
+ };
+ c3_chart_internal_fn.updateTargetX = function (targets, x) {
+ var $$ = this;
+ targets.forEach(function (t) {
+ t.values.forEach(function (v, i) {
+ v.x = $$.generateTargetX(x[i], t.id, i);
+ });
+ $$.data.xs[t.id] = x;
+ });
+ };
+ c3_chart_internal_fn.updateTargetXs = function (targets, xs) {
+ var $$ = this;
+ targets.forEach(function (t) {
+ if (xs[t.id]) {
+ $$.updateTargetX([t], xs[t.id]);
+ }
+ });
+ };
+ c3_chart_internal_fn.generateTargetX = function (rawX, id, index) {
+ var $$ = this, x;
+ if ($$.isTimeSeries()) {
+ x = rawX ? $$.parseDate(rawX) : $$.parseDate($$.getXValue(id, index));
+ }
+ else if ($$.isCustomX() && !$$.isCategorized()) {
+ x = isValue(rawX) ? +rawX : $$.getXValue(id, index);
+ }
+ else {
+ x = index;
+ }
+ return x;
+ };
+ c3_chart_internal_fn.cloneTarget = function (target) {
+ return {
+ id : target.id,
+ id_org : target.id_org,
+ values : target.values.map(function (d) {
+ return {x: d.x, value: d.value, id: d.id};
+ })
+ };
+ };
+ c3_chart_internal_fn.getPrevX = function (i) {
+ var $$ = this, value = $$.getValueOnIndex($$.data.targets[0].values, i - 1);
+ return value ? value.x : null;
+ };
+ c3_chart_internal_fn.getNextX = function (i) {
+ var $$ = this, value = $$.getValueOnIndex($$.data.targets[0].values, i + 1);
+ return value ? value.x : null;
+ };
+ c3_chart_internal_fn.getMaxDataCount = function () {
+ var $$ = this;
+ return $$.d3.max($$.data.targets, function (t) { return t.values.length; });
+ };
+ c3_chart_internal_fn.getMaxDataCountTarget = function (targets) {
+ var length = targets.length, max = 0, maxTarget;
+ if (length > 1) {
+ targets.forEach(function (t) {
+ if (t.values.length > max) {
+ maxTarget = t;
+ max = t.values.length;
+ }
+ });
+ } else {
+ maxTarget = length ? targets[0] : null;
+ }
+ return maxTarget;
+ };
+ c3_chart_internal_fn.getEdgeX = function (targets) {
+ var target = this.getMaxDataCountTarget(targets), firstData, lastData;
+ if (!target) {
+ return [0, 0];
+ }
+ firstData = target.values[0], lastData = target.values[target.values.length - 1];
+ return [firstData.x, lastData.x];
+ };
+ c3_chart_internal_fn.mapToIds = function (targets) {
+ return targets.map(function (d) { return d.id; });
+ };
+ c3_chart_internal_fn.mapToTargetIds = function (ids) {
+ var $$ = this;
+ return ids ? (isString(ids) ? [ids] : ids) : $$.mapToIds($$.data.targets);
+ };
+ c3_chart_internal_fn.hasTarget = function (targets, id) {
+ var ids = this.mapToIds(targets), i;
+ for (i = 0; i < ids.length; i++) {
+ if (ids[i] === id) {
+ return true;
+ }
+ }
+ return false;
+ };
+ c3_chart_internal_fn.isTargetToShow = function (targetId) {
+ return this.hiddenTargetIds.indexOf(targetId) < 0;
+ };
+ c3_chart_internal_fn.isLegendToShow = function (targetId) {
+ return this.hiddenLegendIds.indexOf(targetId) < 0;
+ };
+ c3_chart_internal_fn.filterTargetsToShow = function (targets) {
+ var $$ = this;
+ return targets.filter(function (t) { return $$.isTargetToShow(t.id); });
+ };
+ c3_chart_internal_fn.mapTargetsToUniqueXs = function (targets) {
+ var $$ = this;
+ var xs = $$.d3.set($$.d3.merge(targets.map(function (t) { return t.values.map(function (v) { return v.x; }); }))).values();
+ return $$.isTimeSeries() ? xs.map(function (x) { return new Date(x); }) : xs.map(function (x) { return +x; });
+ };
+ c3_chart_internal_fn.addHiddenTargetIds = function (targetIds) {
+ this.hiddenTargetIds = this.hiddenTargetIds.concat(targetIds);
+ };
+ c3_chart_internal_fn.removeHiddenTargetIds = function (targetIds) {
+ this.hiddenTargetIds = this.hiddenTargetIds.filter(function (id) { return targetIds.indexOf(id) < 0; });
+ };
+ c3_chart_internal_fn.addHiddenLegendIds = function (targetIds) {
+ this.hiddenLegendIds = this.hiddenLegendIds.concat(targetIds);
+ };
+ c3_chart_internal_fn.removeHiddenLegendIds = function (targetIds) {
+ this.hiddenLegendIds = this.hiddenLegendIds.filter(function (id) { return targetIds.indexOf(id) < 0; });
+ };
+ c3_chart_internal_fn.getValuesAsIdKeyed = function (targets) {
+ var ys = {};
+ targets.forEach(function (t) {
+ ys[t.id] = [];
+ t.values.forEach(function (v) {
+ ys[t.id].push(v.value);
+ });
+ });
+ return ys;
+ };
+ c3_chart_internal_fn.checkValueInTargets = function (targets, checker) {
+ var ids = Object.keys(targets), i, j, values;
+ for (i = 0; i < ids.length; i++) {
+ values = targets[ids[i]].values;
+ for (j = 0; j < values.length; j++) {
+ if (checker(values[j].value)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+ c3_chart_internal_fn.hasNegativeValueInTargets = function (targets) {
+ return this.checkValueInTargets(targets, function (v) { return v < 0; });
+ };
+ c3_chart_internal_fn.hasPositiveValueInTargets = function (targets) {
+ return this.checkValueInTargets(targets, function (v) { return v > 0; });
+ };
+ c3_chart_internal_fn.isOrderDesc = function () {
+ var config = this.config;
+ return config.data_order && config.data_order.toLowerCase() === 'desc';
+ };
+ c3_chart_internal_fn.isOrderAsc = function () {
+ var config = this.config;
+ return config.data_order && config.data_order.toLowerCase() === 'asc';
+ };
+ c3_chart_internal_fn.orderTargets = function (targets) {
+ var $$ = this, config = $$.config, orderAsc = $$.isOrderAsc(), orderDesc = $$.isOrderDesc();
+ if (orderAsc || orderDesc) {
+ targets.sort(function (t1, t2) {
+ var reducer = function (p, c) { return p + Math.abs(c.value); };
+ var t1Sum = t1.values.reduce(reducer, 0),
+ t2Sum = t2.values.reduce(reducer, 0);
+ return orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
+ });
+ } else if (isFunction(config.data_order)) {
+ targets.sort(config.data_order);
+ } // TODO: accept name array for order
+ return targets;
+ };
+ c3_chart_internal_fn.filterSameX = function (targets, x) {
+ return this.d3.merge(targets.map(function (t) { return t.values; })).filter(function (v) { return v.x - x === 0; });
+ };
+ c3_chart_internal_fn.filterRemoveNull = function (data) {
+ return data.filter(function (d) { return isValue(d.value); });
+ };
+ c3_chart_internal_fn.hasDataLabel = function () {
+ var config = this.config;
+ if (typeof config.data_labels === 'boolean' && config.data_labels) {
+ return true;
+ } else if (typeof config.data_labels === 'object' && notEmpty(config.data_labels)) {
+ return true;
+ }
+ return false;
+ };
+ c3_chart_internal_fn.getDataLabelLength = function (min, max, axisId, key) {
+ var $$ = this,
+ lengths = [0, 0], paddingCoef = 1.3;
+ $$.selectChart.select('svg').selectAll('.dummy')
+ .data([min, max])
+ .enter().append('text')
+ .text(function (d) { return $$.formatByAxisId(axisId)(d); })
+ .each(function (d, i) {
+ lengths[i] = this.getBoundingClientRect()[key] * paddingCoef;
+ })
+ .remove();
+ return lengths;
+ };
+ c3_chart_internal_fn.isNoneArc = function (d) {
+ return this.hasTarget(this.data.targets, d.id);
+ },
+ c3_chart_internal_fn.isArc = function (d) {
+ return 'data' in d && this.hasTarget(this.data.targets, d.data.id);
+ };
+ c3_chart_internal_fn.findSameXOfValues = function (values, index) {
+ var i, targetX = values[index].x, sames = [];
+ for (i = index - 1; i >= 0; i--) {
+ if (targetX !== values[i].x) { break; }
+ sames.push(values[i]);
+ }
+ for (i = index; i < values.length; i++) {
+ if (targetX !== values[i].x) { break; }
+ sames.push(values[i]);
+ }
+ return sames;
+ };
+
+ c3_chart_internal_fn.findClosestOfValues = function (values, pos, _min, _max) { // MEMO: values must be sorted by x
+ var $$ = this,
+ min = _min ? _min : 0,
+ max = _max ? _max : values.length - 1,
+ med = Math.floor((max - min) / 2) + min,
+ value = values[med],
+ diff = $$.x(value.x) - pos[$$.config.axis_rotated ? 1 : 0],
+ candidates;
+
+ // Update range for search
+ diff > 0 ? max = med : min = med;
+
+ // if candidates are two closest min and max, stop recursive call
+ if ((max - min) === 1 || (min === 0 && max === 0)) {
+
+ // Get candidates that has same min and max index
+ candidates = [];
+ if (values[min].x || values[min].x === 0) {
+ candidates = candidates.concat($$.findSameXOfValues(values, min));
+ }
+ if (values[max].x || values[max].x === 0) {
+ candidates = candidates.concat($$.findSameXOfValues(values, max));
+ }
+
+ // Determine the closest and return
+ return $$.findClosest(candidates, pos);
+ }
+
+ return $$.findClosestOfValues(values, pos, min, max);
+ };
+ c3_chart_internal_fn.findClosestFromTargets = function (targets, pos) {
+ var $$ = this, candidates;
+
+ // map to array of closest points of each target
+ candidates = targets.map(function (target) {
+ return $$.findClosestOfValues(target.values, pos);
+ });
+
+ // decide closest point and return
+ return $$.findClosest(candidates, pos);
+ };
+ c3_chart_internal_fn.findClosest = function (values, pos) {
+ var $$ = this, minDist, closest;
+ values.forEach(function (v) {
+ var d = $$.dist(v, pos);
+ if (d < minDist || ! minDist) {
+ minDist = d;
+ closest = v;
+ }
+ });
+ return closest;
+ };
+ c3_chart_internal_fn.dist = function (data, pos) {
+ var $$ = this, config = $$.config,
+ yScale = $$.getAxisId(data.id) === 'y' ? $$.y : $$.y2,
+ xIndex = config.axis_rotated ? 1 : 0,
+ yIndex = config.axis_rotated ? 0 : 1;
+ return Math.pow($$.x(data.x) - pos[xIndex], 2) + Math.pow(yScale(data.value) - pos[yIndex], 2);
+ };
+
+ c3_chart_internal_fn.convertUrlToData = function (url, mimeType, keys, done) {
+ var $$ = this, type = mimeType ? mimeType : 'csv';
+ $$.d3.xhr(url, function (error, data) {
+ var d;
+ if (type === 'json') {
+ d = $$.convertJsonToData(JSON.parse(data.response), keys);
+ } else {
+ d = $$.convertCsvToData(data.response);
+ }
+ done.call($$, d);
+ });
+ };
+ c3_chart_internal_fn.convertCsvToData = function (csv) {
+ var d3 = this.d3, rows = d3.csv.parseRows(csv), d;
+ if (rows.length === 1) {
+ d = [{}];
+ rows[0].forEach(function (id) {
+ d[0][id] = null;
+ });
+ } else {
+ d = d3.csv.parse(csv);
+ }
+ return d;
+ };
+ c3_chart_internal_fn.convertJsonToData = function (json, keys) {
+ var $$ = this,
+ new_rows = [], targetKeys, data;
+ if (keys) { // when keys specified, json would be an array that includes objects
+ targetKeys = keys.value;
+ if (keys.x) {
+ targetKeys.push(keys.x);
+ $$.config.data_x = keys.x;
+ }
+ new_rows.push(targetKeys);
+ json.forEach(function (o) {
+ var new_row = [];
+ targetKeys.forEach(function (key) {
+ // convert undefined to null because undefined data will be removed in convertDataToTargets()
+ var v = isUndefined(o[key]) ? null : o[key];
+ new_row.push(v);
+ });
+ new_rows.push(new_row);
+ });
+ data = $$.convertRowsToData(new_rows);
+ } else {
+ Object.keys(json).forEach(function (key) {
+ new_rows.push([key].concat(json[key]));
+ });
+ data = $$.convertColumnsToData(new_rows);
+ }
+ return data;
+ };
+ c3_chart_internal_fn.convertRowsToData = function (rows) {
+ var keys = rows[0], new_row = {}, new_rows = [], i, j;
+ for (i = 1; i < rows.length; i++) {
+ new_row = {};
+ for (j = 0; j < rows[i].length; j++) {
+ if (isUndefined(rows[i][j])) {
+ throw new Error("Source data is missing a component at (" + i + "," + j + ")!");
+ }
+ new_row[keys[j]] = rows[i][j];
+ }
+ new_rows.push(new_row);
+ }
+ return new_rows;
+ };
+ c3_chart_internal_fn.convertColumnsToData = function (columns) {
+ var new_rows = [], i, j, key;
+ for (i = 0; i < columns.length; i++) {
+ key = columns[i][0];
+ for (j = 1; j < columns[i].length; j++) {
+ if (isUndefined(new_rows[j - 1])) {
+ new_rows[j - 1] = {};
+ }
+ if (isUndefined(columns[i][j])) {
+ throw new Error("Source data is missing a component at (" + i + "," + j + ")!");
+ }
+ new_rows[j - 1][key] = columns[i][j];
+ }
+ }
+ return new_rows;
+ };
+ c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) {
+ var $$ = this, config = $$.config,
+ ids = $$.d3.keys(data[0]).filter($$.isNotX, $$),
+ xs = $$.d3.keys(data[0]).filter($$.isX, $$),
+ targets;
+
+ // save x for update data by load when custom x and c3.x API
+ ids.forEach(function (id) {
+ var xKey = $$.getXKey(id);
+
+ if ($$.isCustomX() || $$.isTimeSeries()) {
+ // if included in input data
+ if (xs.indexOf(xKey) >= 0) {
+ $$.data.xs[id] = (appendXs && $$.data.xs[id] ? $$.data.xs[id] : []).concat(
+ data.map(function (d) { return d[xKey]; })
+ .filter(isValue)
+ .map(function (rawX, i) { return $$.generateTargetX(rawX, id, i); })
+ );
+ }
+ // if not included in input data, find from preloaded data of other id's x
+ else if (config.data_x) {
+ $$.data.xs[id] = $$.getOtherTargetXs();
+ }
+ // if not included in input data, find from preloaded data
+ else if (notEmpty(config.data_xs)) {
+ $$.data.xs[id] = $$.getXValuesOfXKey(xKey, $$.data.targets);
+ }
+ // MEMO: if no x included, use same x of current will be used
+ } else {
+ $$.data.xs[id] = data.map(function (d, i) { return i; });
+ }
+ });
+
+
+ // check x is defined
+ ids.forEach(function (id) {
+ if (!$$.data.xs[id]) {
+ throw new Error('x is not defined for id = "' + id + '".');
+ }
+ });
+
+ // convert to target
+ targets = ids.map(function (id, index) {
+ var convertedId = config.data_idConverter(id);
+ return {
+ id: convertedId,
+ id_org: id,
+ values: data.map(function (d, i) {
+ var xKey = $$.getXKey(id), rawX = d[xKey], x = $$.generateTargetX(rawX, id, i);
+ // use x as categories if custom x and categorized
+ if ($$.isCustomX() && $$.isCategorized() && index === 0 && rawX) {
+ if (i === 0) { config.axis_x_categories = []; }
+ config.axis_x_categories.push(rawX);
+ }
+ // mark as x = undefined if value is undefined and filter to remove after mapped
+ if (isUndefined(d[id]) || $$.data.xs[id].length <= i) {
+ x = undefined;
+ }
+ return {x: x, value: d[id] !== null && !isNaN(d[id]) ? +d[id] : null, id: convertedId};
+ }).filter(function (v) { return isDefined(v.x); })
+ };
+ });
+
+ // finish targets
+ targets.forEach(function (t) {
+ var i;
+ // sort values by its x
+ t.values = t.values.sort(function (v1, v2) {
+ var x1 = v1.x || v1.x === 0 ? v1.x : Infinity,
+ x2 = v2.x || v2.x === 0 ? v2.x : Infinity;
+ return x1 - x2;
+ });
+ // indexing each value
+ i = 0;
+ t.values.forEach(function (v) {
+ v.index = i++;
+ });
+ // this needs to be sorted because its index and value.index is identical
+ $$.data.xs[t.id].sort(function (v1, v2) {
+ return v1 - v2;
+ });
+ });
+
+ // set target types
+ if (config.data_type) {
+ $$.setTargetType($$.mapToIds(targets).filter(function (id) { return ! (id in config.data_types); }), config.data_type);
+ }
+
+ // cache as original id keyed
+ targets.forEach(function (d) {
+ $$.addCache(d.id_org, d);
+ });
+
+ return targets;
+ };
+
+ c3_chart_internal_fn.load = function (targets, args) {
+ var $$ = this;
+ if (targets) {
+ // filter loading targets if needed
+ if (args.filter) {
+ targets = targets.filter(args.filter);
+ }
+ // set type if args.types || args.type specified
+ if (args.type || args.types) {
+ targets.forEach(function (t) {
+ $$.setTargetType(t.id, args.types ? args.types[t.id] : args.type);
+ });
+ }
+ // Update/Add data
+ $$.data.targets.forEach(function (d) {
+ for (var i = 0; i < targets.length; i++) {
+ if (d.id === targets[i].id) {
+ d.values = targets[i].values;
+ targets.splice(i, 1);
+ break;
+ }
+ }
+ });
+ $$.data.targets = $$.data.targets.concat(targets); // add remained
+ }
+
+ // Set targets
+ $$.updateTargets($$.data.targets);
+
+ // Redraw with new targets
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+
+ if (args.done) { args.done(); }
+ };
+ c3_chart_internal_fn.loadFromArgs = function (args) {
+ var $$ = this;
+ if (args.data) {
+ $$.load($$.convertDataToTargets(args.data), args);
+ }
+ else if (args.url) {
+ $$.convertUrlToData(args.url, args.mimeType, args.keys, function (data) {
+ $$.load($$.convertDataToTargets(data), args);
+ });
+ }
+ else if (args.json) {
+ $$.load($$.convertDataToTargets($$.convertJsonToData(args.json, args.keys)), args);
+ }
+ else if (args.rows) {
+ $$.load($$.convertDataToTargets($$.convertRowsToData(args.rows)), args);
+ }
+ else if (args.columns) {
+ $$.load($$.convertDataToTargets($$.convertColumnsToData(args.columns)), args);
+ }
+ else {
+ $$.load(null, args);
+ }
+ };
+ c3_chart_internal_fn.unload = function (targetIds, done) {
+ var $$ = this;
+ if (!done) {
+ done = function () {};
+ }
+ // filter existing target
+ targetIds = targetIds.filter(function (id) { return $$.hasTarget($$.data.targets, id); });
+ // If no target, call done and return
+ if (!targetIds || targetIds.length === 0) {
+ done();
+ return;
+ }
+ $$.svg.selectAll(targetIds.map(function (id) { return $$.selectorTarget(id); }))
+ .transition()
+ .style('opacity', 0)
+ .remove()
+ .call($$.endall, done);
+ targetIds.forEach(function (id) {
+ // Reset fadein for future load
+ $$.withoutFadeIn[id] = false;
+ // Remove target's elements
+ if ($$.legend) {
+ $$.legend.selectAll('.' + CLASS.legendItem + $$.getTargetSelectorSuffix(id)).remove();
+ }
+ // Remove target
+ $$.data.targets = $$.data.targets.filter(function (t) {
+ return t.id !== id;
+ });
+ });
+ };
+
+ c3_chart_internal_fn.categoryName = function (i) {
+ var config = this.config;
+ return i < config.axis_x_categories.length ? config.axis_x_categories[i] : i;
+ };
+
+ c3_chart_internal_fn.initEventRect = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.eventRects)
+ .style('fill-opacity', 0);
+ };
+ c3_chart_internal_fn.redrawEventRect = function () {
+ var $$ = this, config = $$.config,
+ eventRectUpdate, maxDataCountTarget,
+ isMultipleX = $$.isMultipleX();
+
+ // rects for mouseover
+ var eventRects = $$.main.select('.' + CLASS.eventRects)
+ .style('cursor', config.zoom_enabled ? config.axis_rotated ? 'ns-resize' : 'ew-resize' : null)
+ .classed(CLASS.eventRectsMultiple, isMultipleX)
+ .classed(CLASS.eventRectsSingle, !isMultipleX);
+
+ // clear old rects
+ eventRects.selectAll('.' + CLASS.eventRect).remove();
+
+ // open as public variable
+ $$.eventRect = eventRects.selectAll('.' + CLASS.eventRect);
+
+ if (isMultipleX) {
+ eventRectUpdate = $$.eventRect.data([0]);
+ // enter : only one rect will be added
+ $$.generateEventRectsForMultipleXs(eventRectUpdate.enter());
+ // update
+ $$.updateEventRect(eventRectUpdate);
+ // exit : not needed because always only one rect exists
+ }
+ else {
+ // Set data and update $$.eventRect
+ maxDataCountTarget = $$.getMaxDataCountTarget($$.data.targets);
+ eventRects.datum(maxDataCountTarget ? maxDataCountTarget.values : []);
+ $$.eventRect = eventRects.selectAll('.' + CLASS.eventRect);
+ eventRectUpdate = $$.eventRect.data(function (d) { return d; });
+ // enter
+ $$.generateEventRectsForSingleX(eventRectUpdate.enter());
+ // update
+ $$.updateEventRect(eventRectUpdate);
+ // exit
+ eventRectUpdate.exit().remove();
+ }
+ };
+ c3_chart_internal_fn.updateEventRect = function (eventRectUpdate) {
+ var $$ = this, config = $$.config,
+ x, y, w, h, rectW, rectX;
+
+ // set update selection if null
+ eventRectUpdate = eventRectUpdate || $$.eventRect.data(function (d) { return d; });
+
+ if ($$.isMultipleX()) {
+ // TODO: rotated not supported yet
+ x = 0;
+ y = 0;
+ w = $$.width;
+ h = $$.height;
+ }
+ else {
+ if (($$.isCustomX() || $$.isTimeSeries()) && !$$.isCategorized()) {
+ rectW = function (d) {
+ var prevX = $$.getPrevX(d.index), nextX = $$.getNextX(d.index), dx = $$.data.xs[d.id][d.index],
+ w = ($$.x(nextX ? nextX : dx) - $$.x(prevX ? prevX : dx)) / 2;
+ return w < 0 ? 0 : w;
+ };
+ rectX = function (d) {
+ var prevX = $$.getPrevX(d.index), dx = $$.data.xs[d.id][d.index];
+ return ($$.x(dx) + $$.x(prevX ? prevX : dx)) / 2;
+ };
+ } else {
+ rectW = $$.getEventRectWidth();
+ rectX = function (d) {
+ return $$.x(d.x) - (rectW / 2);
+ };
+ }
+ x = config.axis_rotated ? 0 : rectX;
+ y = config.axis_rotated ? rectX : 0;
+ w = config.axis_rotated ? $$.width : rectW;
+ h = config.axis_rotated ? rectW : $$.height;
+ }
+
+ eventRectUpdate
+ .attr('class', $$.classEvent.bind($$))
+ .attr("x", x)
+ .attr("y", y)
+ .attr("width", w)
+ .attr("height", h);
+ };
+ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ eventRectEnter.append("rect")
+ .attr("class", $$.classEvent.bind($$))
+ .style("cursor", config.data_selection_enabled && config.data_selection_grouped ? "pointer" : null)
+ .on('mouseover', function (d) {
+ var index = d.index, selectedData, newData;
+
+ if ($$.dragging) { return; } // do nothing if dragging
+ if ($$.hasArcType()) { return; }
+
+ selectedData = $$.data.targets.map(function (t) {
+ return $$.addName($$.getValueOnIndex(t.values, index));
+ });
+
+ // Sort selectedData as names order
+ newData = [];
+ Object.keys(config.data_names).forEach(function (id) {
+ for (var j = 0; j < selectedData.length; j++) {
+ if (selectedData[j] && selectedData[j].id === id) {
+ newData.push(selectedData[j]);
+ selectedData.shift(j);
+ break;
+ }
+ }
+ });
+ selectedData = newData.concat(selectedData); // Add remained
+
+ // Expand shapes for selection
+ if (config.point_focus_expand_enabled) { $$.expandCircles(index); }
+ $$.expandBars(index);
+
+ // Call event handler
+ $$.main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
+ config.data_onmouseover.call($$, d);
+ });
+ })
+ .on('mouseout', function (d) {
+ var index = d.index;
+ if ($$.hasArcType()) { return; }
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+ // Undo expanded shapes
+ $$.unexpandCircles(index);
+ $$.unexpandBars();
+ // Call event handler
+ $$.main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
+ config.data_onmouseout.call($$, d);
+ });
+ })
+ .on('mousemove', function (d) {
+ var selectedData, index = d.index,
+ eventRect = $$.svg.select('.' + CLASS.eventRect + '-' + index);
+
+ if ($$.dragging) { return; } // do nothing when dragging
+ if ($$.hasArcType()) { return; }
+
+ // Show tooltip
+ selectedData = $$.filterTargetsToShow($$.data.targets).map(function (t) {
+ return $$.addName($$.getValueOnIndex(t.values, index));
+ });
+
+ if (config.tooltip_grouped) {
+ $$.showTooltip(selectedData, d3.mouse(this));
+ $$.showXGridFocus(selectedData);
+ }
+
+ if (config.tooltip_grouped && (!config.data_selection_enabled || config.data_selection_grouped)) {
+ return;
+ }
+
+ $$.main.selectAll('.' + CLASS.shape + '-' + index)
+ .each(function () {
+ d3.select(this).classed(CLASS.EXPANDED, true);
+ if (config.data_selection_enabled) {
+ eventRect.style('cursor', config.data_selection_grouped ? 'pointer' : null);
+ }
+ if (!config.tooltip_grouped) {
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+ if (!config.data_selection_grouped) {
+ $$.unexpandCircles(index);
+ $$.unexpandBars();
+ }
+ }
+ })
+ .filter(function (d) {
+ if (this.nodeName === 'circle') {
+ return $$.isWithinCircle(this, $$.pointSelectR(d));
+ }
+ else if (this.nodeName === 'path') {
+ return $$.isWithinBar(this);
+ }
+ })
+ .each(function (d) {
+ if (config.data_selection_enabled && (config.data_selection_grouped || config.data_selection_isselectable(d))) {
+ eventRect.style('cursor', 'pointer');
+ }
+ if (!config.tooltip_grouped) {
+ $$.showTooltip([d], d3.mouse(this));
+ $$.showXGridFocus([d]);
+ if (config.point_focus_expand_enabled) { $$.expandCircles(index, d.id); }
+ $$.expandBars(index, d.id);
+ }
+ });
+ })
+ .on('click', function (d) {
+ var index = d.index;
+ if ($$.hasArcType() || !$$.toggleShape) { return; }
+ if ($$.cancelClick) {
+ $$.cancelClick = false;
+ return;
+ }
+ $$.main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
+ $$.toggleShape(this, d, index);
+ });
+ })
+ .call(
+ d3.behavior.drag().origin(Object)
+ .on('drag', function () { $$.drag(d3.mouse(this)); })
+ .on('dragstart', function () { $$.dragstart(d3.mouse(this)); })
+ .on('dragend', function () { $$.dragend(); })
+ )
+ .on("dblclick.zoom", null);
+ };
+
+ c3_chart_internal_fn.generateEventRectsForMultipleXs = function (eventRectEnter) {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ eventRectEnter.append('rect')
+ .attr('x', 0)
+ .attr('y', 0)
+ .attr('width', $$.width)
+ .attr('height', $$.height)
+ .attr('class', CLASS.eventRect)
+ .on('mouseout', function () {
+ if ($$.hasArcType()) { return; }
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+ $$.unexpandCircles();
+ })
+ .on('mousemove', function () {
+ var targetsToShow = $$.filterTargetsToShow($$.data.targets);
+ var mouse, closest, sameXData, selectedData;
+
+ if ($$.dragging) { return; } // do nothing when dragging
+ if ($$.hasArcType(targetsToShow)) { return; }
+
+ mouse = d3.mouse(this);
+ closest = $$.findClosestFromTargets(targetsToShow, mouse);
+
+ if (! closest) { return; }
+
+ if ($$.isScatterType(closest)) {
+ sameXData = [closest];
+ } else {
+ sameXData = $$.filterSameX(targetsToShow, closest.x);
+ }
+
+ // show tooltip when cursor is close to some point
+ selectedData = sameXData.map(function (d) {
+ return $$.addName(d);
+ });
+ $$.showTooltip(selectedData, mouse);
+
+ // expand points
+ if (config.point_focus_expand_enabled) {
+ $$.unexpandCircles();
+ $$.expandCircles(closest.index, closest.id);
+ }
+
+ // Show xgrid focus line
+ $$.showXGridFocus(selectedData);
+
+ // Show cursor as pointer if point is close to mouse position
+ if ($$.dist(closest, mouse) < 100) {
+ $$.svg.select('.' + CLASS.eventRect).style('cursor', 'pointer');
+ if (!$$.mouseover) {
+ config.data_onmouseover.call($$, closest);
+ $$.mouseover = true;
+ }
+ } else if ($$.mouseover) {
+ $$.svg.select('.' + CLASS.eventRect).style('cursor', null);
+ config.data_onmouseout.call($$, closest);
+ $$.mouseover = false;
+ }
+ })
+ .on('click', function () {
+ var targetsToShow = $$.filterTargetsToShow($$.data.targets);
+ var mouse, closest;
+
+ if ($$.hasArcType(targetsToShow)) { return; }
+
+ mouse = d3.mouse(this);
+ closest = $$.findClosestFromTargets(targetsToShow, mouse);
+
+ if (! closest) { return; }
+
+ // select if selection enabled
+ if ($$.dist(closest, mouse) < 100 && $$.toggleShape) {
+ $$.main.select('.' + CLASS.circles + $$.getTargetSelectorSuffix(closest.id)).select('.' + CLASS.circle + '-' + closest.index).each(function () {
+ $$.toggleShape(this, closest, closest.index);
+ });
+ }
+ })
+ .call(
+ d3.behavior.drag().origin(Object)
+ .on('drag', function () { $$.drag(d3.mouse(this)); })
+ .on('dragstart', function () { $$.dragstart(d3.mouse(this)); })
+ .on('dragend', function () { $$.dragend(); })
+ )
+ .on("dblclick.zoom", null);
+ };
+
+ c3_chart_internal_fn.getCurrentWidth = function () {
+ var $$ = this, config = $$.config;
+ return config.size_width ? config.size_width : $$.getParentWidth();
+ };
+ c3_chart_internal_fn.getCurrentHeight = function () {
+ var $$ = this, config = $$.config,
+ h = config.size_height ? config.size_height : $$.getParentHeight();
+ return h > 0 ? h : 320;
+ };
+ c3_chart_internal_fn.getCurrentPaddingTop = function () {
+ var config = this.config;
+ return isValue(config.padding_top) ? config.padding_top : 0;
+ };
+ c3_chart_internal_fn.getCurrentPaddingBottom = function () {
+ var config = this.config;
+ return isValue(config.padding_bottom) ? config.padding_bottom : 0;
+ };
+ c3_chart_internal_fn.getCurrentPaddingLeft = function () {
+ var $$ = this, config = $$.config;
+ if (isValue(config.padding_left)) {
+ return config.padding_left;
+ } else if (config.axis_rotated) {
+ return !config.axis_x_show ? 1 : Math.max(ceil10($$.getAxisWidthByAxisId('x')), 40);
+ } else {
+ return !config.axis_y_show ? 1 : ceil10($$.getAxisWidthByAxisId('y'));
+ }
+ };
+ c3_chart_internal_fn.getCurrentPaddingRight = function () {
+ var $$ = this, config = $$.config,
+ defaultPadding = 10, legendWidthOnRight = $$.isLegendRight ? $$.getLegendWidth() + 20 : 0;
+ if (isValue(config.padding_right)) {
+ return config.padding_right + 1; // 1 is needed not to hide tick line
+ } else if (config.axis_rotated) {
+ return defaultPadding + legendWidthOnRight;
+ } else {
+ return (!config.axis_y2_show ? defaultPadding : ceil10($$.getAxisWidthByAxisId('y2'))) + legendWidthOnRight;
+ }
+ };
+
+ c3_chart_internal_fn.getParentRectValue = function (key) {
+ var parent = this.selectChart.node(), v;
+ while (parent && parent.tagName !== 'BODY') {
+ v = parent.getBoundingClientRect()[key];
+ if (v) {
+ break;
+ }
+ parent = parent.parentNode;
+ }
+ return v;
+ };
+ c3_chart_internal_fn.getParentWidth = function () {
+ return this.getParentRectValue('width');
+ };
+ c3_chart_internal_fn.getParentHeight = function () {
+ var h = this.selectChart.style('height');
+ return h.indexOf('px') > 0 ? +h.replace('px', '') : 0;
+ };
+
+
+ c3_chart_internal_fn.getSvgLeft = function () {
+ var $$ = this, config = $$.config,
+ leftAxisClass = config.axis_rotated ? CLASS.axisX : CLASS.axisY,
+ leftAxis = $$.main.select('.' + leftAxisClass).node(),
+ svgRect = leftAxis ? leftAxis.getBoundingClientRect() : {right: 0},
+ chartRect = $$.selectChart.node().getBoundingClientRect(),
+ hasArc = $$.hasArcType(),
+ svgLeft = svgRect.right - chartRect.left - (hasArc ? 0 : $$.getCurrentPaddingLeft());
+ return svgLeft > 0 ? svgLeft : 0;
+ };
+
+
+ c3_chart_internal_fn.getAxisWidthByAxisId = function (id) {
+ var $$ = this, position = $$.getAxisLabelPositionById(id);
+ return position.isInner ? 20 + $$.getMaxTickWidth(id) : 40 + $$.getMaxTickWidth(id);
+ };
+ c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) {
+ var $$ = this, config = $$.config;
+ if (axisId === 'x' && !config.axis_x_show) { return 0; }
+ if (axisId === 'x' && config.axis_x_height) { return config.axis_x_height; }
+ if (axisId === 'y' && !config.axis_y_show) { return config.legend_show && !$$.isLegendRight && !$$.isLegendInset ? 10 : 1; }
+ if (axisId === 'y2' && !config.axis_y2_show) { return $$.rotated_padding_top; }
+ return ($$.getAxisLabelPositionById(axisId).isInner ? 30 : 40) + (axisId === 'y2' ? -10 : 0);
+ };
+
+ c3_chart_internal_fn.getEventRectWidth = function () {
+ var $$ = this;
+ var target = $$.getMaxDataCountTarget($$.data.targets),
+ firstData, lastData, base, maxDataCount, ratio, w;
+ if (!target) {
+ return 0;
+ }
+ firstData = target.values[0], lastData = target.values[target.values.length - 1];
+ base = $$.x(lastData.x) - $$.x(firstData.x);
+ if (base === 0) {
+ return $$.config.axis_rotated ? $$.height : $$.width;
+ }
+ maxDataCount = $$.getMaxDataCount();
+ ratio = ($$.hasType('bar') ? (maxDataCount - ($$.isCategorized() ? 0.25 : 1)) / maxDataCount : 1);
+ w = maxDataCount > 1 ? (base * ratio) / (maxDataCount - 1) : base;
+ return w < 1 ? 1 : w;
+ };
+
+ c3_chart_internal_fn.getShapeIndices = function (typeFilter) {
+ var $$ = this, config = $$.config,
+ indices = {}, i = 0, j, k;
+ $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$)).forEach(function (d) {
+ for (j = 0; j < config.data_groups.length; j++) {
+ if (config.data_groups[j].indexOf(d.id) < 0) { continue; }
+ for (k = 0; k < config.data_groups[j].length; k++) {
+ if (config.data_groups[j][k] in indices) {
+ indices[d.id] = indices[config.data_groups[j][k]];
+ break;
+ }
+ }
+ }
+ if (isUndefined(indices[d.id])) { indices[d.id] = i++; }
+ });
+ indices.__max__ = i - 1;
+ return indices;
+ };
+ c3_chart_internal_fn.getShapeX = function (offset, targetsNum, indices, isSub) {
+ var $$ = this, scale = isSub ? $$.subX : $$.x;
+ return function (d) {
+ var index = d.id in indices ? indices[d.id] : 0;
+ return d.x || d.x === 0 ? scale(d.x) - offset * (targetsNum / 2 - index) : 0;
+ };
+ };
+ c3_chart_internal_fn.getShapeY = function (isSub) {
+ var $$ = this;
+ return function (d) {
+ var scale = isSub ? $$.getSubYScale(d.id) : $$.getYScale(d.id);
+ return scale(d.value);
+ };
+ };
+ c3_chart_internal_fn.getShapeOffset = function (typeFilter, indices, isSub) {
+ var $$ = this,
+ targets = $$.orderTargets($$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))),
+ targetIds = targets.map(function (t) { return t.id; });
+ return function (d, i) {
+ var scale = isSub ? $$.getSubYScale(d.id) : $$.getYScale(d.id),
+ y0 = scale(0), offset = y0;
+ targets.forEach(function (t) {
+ if (t.id === d.id || indices[t.id] !== indices[d.id]) { return; }
+ if (targetIds.indexOf(t.id) < targetIds.indexOf(d.id) && t.values[i].value * d.value >= 0) {
+ offset += scale(t.values[i].value) - y0;
+ }
+ });
+ return offset;
+ };
+ };
+
+ c3_chart_internal_fn.getInterpolate = function (d) {
+ var $$ = this;
+ return $$.isSplineType(d) ? "cardinal" : $$.isStepType(d) ? "step-after" : "linear";
+ };
+
+ c3_chart_internal_fn.initLine = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartLines);
+ };
+ c3_chart_internal_fn.updateTargetsForLine = function (targets) {
+ var $$ = this, config = $$.config,
+ mainLineUpdate, mainLineEnter,
+ classChartLine = $$.classChartLine.bind($$),
+ classLines = $$.classLines.bind($$),
+ classAreas = $$.classAreas.bind($$),
+ classCircles = $$.classCircles.bind($$);
+ mainLineUpdate = $$.main.select('.' + CLASS.chartLines).selectAll('.' + CLASS.chartLine)
+ .data(targets)
+ .attr('class', classChartLine);
+ mainLineEnter = mainLineUpdate.enter().append('g')
+ .attr('class', classChartLine)
+ .style('opacity', 0)
+ .style("pointer-events", "none");
+ // Lines for each data
+ mainLineEnter.append('g')
+ .attr("class", classLines);
+ // Areas
+ mainLineEnter.append('g')
+ .attr('class', classAreas);
+ // Circles for each data point on lines
+ mainLineEnter.append('g')
+ .attr("class", function (d) { return $$.generateClass(CLASS.selectedCircles, d.id); });
+ mainLineEnter.append('g')
+ .attr("class", classCircles)
+ .style("cursor", function (d) { return config.data_selection_isselectable(d) ? "pointer" : null; });
+ // Update date for selected circles
+ targets.forEach(function (t) {
+ $$.main.selectAll('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(t.id)).selectAll('.' + CLASS.selectedCircle).each(function (d) {
+ d.value = t.values[d.index].value;
+ });
+ });
+ // MEMO: can not keep same color...
+ //mainLineUpdate.exit().remove();
+ };
+ c3_chart_internal_fn.redrawLine = function (durationForExit) {
+ var $$ = this;
+ $$.mainLine = $$.main.selectAll('.' + CLASS.lines).selectAll('.' + CLASS.line)
+ .data($$.lineData.bind($$));
+ $$.mainLine.enter().append('path')
+ .attr('class', $$.classLine.bind($$))
+ .style("stroke", $$.color);
+ $$.mainLine
+ .style("opacity", $$.initialOpacity.bind($$))
+ .attr('transform', null);
+ $$.mainLine.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.addTransitionForLine = function (transitions, drawLine) {
+ var $$ = this;
+ transitions.push($$.mainLine.transition()
+ .attr("d", drawLine)
+ .style("stroke", $$.color)
+ .style("opacity", 1));
+ };
+ c3_chart_internal_fn.generateDrawLine = function (lineIndices, isSub) {
+ var $$ = this, config = $$.config,
+ line = $$.d3.svg.line(),
+ getPoint = $$.generateGetLinePoint(lineIndices, isSub),
+ yScaleGetter = isSub ? $$.getSubYScale : $$.getYScale,
+ xValue = function (d) { return (isSub ? $$.subxx : $$.xx).call($$, d); },
+ yValue = function (d, i) {
+ return config.data_groups.length > 0 ? getPoint(d, i)[0][1] : yScaleGetter.call($$, d.id)(d.value);
+ };
+
+ line = config.axis_rotated ? line.x(yValue).y(xValue) : line.x(xValue).y(yValue);
+ if (!config.line_connect_null) { line = line.defined(function (d) { return d.value != null; }); }
+ return function (d) {
+ var data = config.line_connect_null ? $$.filterRemoveNull(d.values) : d.values,
+ x = isSub ? $$.x : $$.subX, y = yScaleGetter.call($$, d.id), x0 = 0, y0 = 0, path;
+ if ($$.isLineType(d)) {
+ if (config.data_regions[d.id]) {
+ path = $$.lineWithRegions(data, x, y, config.data_regions[d.id]);
+ } else {
+ path = line.interpolate($$.getInterpolate(d))(data);
+ }
+ } else {
+ if (data[0]) {
+ x0 = x(data[0].x);
+ y0 = y(data[0].value);
+ }
+ path = config.axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
+ }
+ return path ? path : "M 0 0";
+ };
+ };
+ c3_chart_internal_fn.generateGetLinePoint = function (lineIndices, isSub) { // partial duplication of generateGetBarPoints
+ var $$ = this, config = $$.config,
+ lineTargetsNum = lineIndices.__max__ + 1,
+ x = $$.getShapeX(0, lineTargetsNum, lineIndices, !!isSub),
+ y = $$.getShapeY(!!isSub),
+ lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, !!isSub),
+ yScale = isSub ? $$.getSubYScale : $$.getYScale;
+ return function (d, i) {
+ var y0 = yScale.call($$, d.id)(0),
+ offset = lineOffset(d, i) || y0, // offset is for stacked area chart
+ posX = x(d), posY = y(d);
+ // fix posY not to overflow opposite quadrant
+ if (config.axis_rotated) {
+ if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; }
+ }
+ // 1 point that marks the line position
+ return [
+ [posX, posY - (y0 - offset)]
+ ];
+ };
+ };
+
+
+ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
+ var $$ = this, config = $$.config,
+ prev = -1, i, j,
+ s = "M", sWithRegion,
+ xp, yp, dx, dy, dd, diff, diffx2,
+ xValue, yValue,
+ regions = [];
+
+ function isWithinRegions(x, regions) {
+ var i;
+ for (i = 0; i < regions.length; i++) {
+ if (regions[i].start < x && x <= regions[i].end) { return true; }
+ }
+ return false;
+ }
+
+ // Check start/end of regions
+ if (isDefined(_regions)) {
+ for (i = 0; i < _regions.length; i++) {
+ regions[i] = {};
+ if (isUndefined(_regions[i].start)) {
+ regions[i].start = d[0].x;
+ } else {
+ regions[i].start = $$.isTimeSeries() ? $$.parseDate(_regions[i].start) : _regions[i].start;
+ }
+ if (isUndefined(_regions[i].end)) {
+ regions[i].end = d[d.length - 1].x;
+ } else {
+ regions[i].end = $$.isTimeSeries() ? $$.parseDate(_regions[i].end) : _regions[i].end;
+ }
+ }
+ }
+
+ // Set scales
+ xValue = config.axis_rotated ? function (d) { return y(d.value); } : function (d) { return x(d.x); };
+ yValue = config.axis_rotated ? function (d) { return x(d.x); } : function (d) { return y(d.value); };
+
+ // Define svg generator function for region
+ if ($$.isTimeSeries()) {
+ sWithRegion = function (d0, d1, j, diff) {
+ var x0 = d0.x.getTime(), x_diff = d1.x - d0.x,
+ xv0 = new Date(x0 + x_diff * j),
+ xv1 = new Date(x0 + x_diff * (j + diff));
+ return "M" + x(xv0) + " " + y(yp(j)) + " " + x(xv1) + " " + y(yp(j + diff));
+ };
+ } else {
+ sWithRegion = function (d0, d1, j, diff) {
+ return "M" + x(xp(j), true) + " " + y(yp(j)) + " " + x(xp(j + diff), true) + " " + y(yp(j + diff));
+ };
+ }
+
+ // Generate
+ for (i = 0; i < d.length; i++) {
+
+ // Draw as normal
+ if (isUndefined(regions) || ! isWithinRegions(d[i].x, regions)) {
+ s += " " + xValue(d[i]) + " " + yValue(d[i]);
+ }
+ // Draw with region // TODO: Fix for horizotal charts
+ else {
+ xp = $$.getScale(d[i - 1].x, d[i].x, $$.isTimeSeries());
+ yp = $$.getScale(d[i - 1].value, d[i].value);
+
+ dx = x(d[i].x) - x(d[i - 1].x);
+ dy = y(d[i].value) - y(d[i - 1].value);
+ dd = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
+ diff = 2 / dd;
+ diffx2 = diff * 2;
+
+ for (j = diff; j <= 1; j += diffx2) {
+ s += sWithRegion(d[i - 1], d[i], j, diff);
+ }
+ }
+ prev = d[i].x;
+ }
+
+ return s;
+ };
+
+
+ c3_chart_internal_fn.redrawArea = function (durationForExit) {
+ var $$ = this, d3 = $$.d3;
+ $$.mainArea = $$.main.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area)
+ .data($$.lineData.bind($$));
+ $$.mainArea.enter().append('path')
+ .attr("class", $$.classArea.bind($$))
+ .style("fill", $$.color)
+ .style("opacity", function () { $$.orgAreaOpacity = +d3.select(this).style('opacity'); return 0; });
+ $$.mainArea
+ .style("opacity", $$.orgAreaOpacity);
+ $$.mainArea.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.addTransitionForArea = function (transitions, drawArea) {
+ var $$ = this;
+ transitions.push($$.mainArea.transition()
+ .attr("d", drawArea)
+ .style("fill", $$.color)
+ .style("opacity", $$.orgAreaOpacity));
+ };
+ c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
+ var $$ = this, config = $$.config, area = $$.d3.svg.area(),
+ getPoint = $$.generateGetAreaPoint(areaIndices, isSub),
+ yScaleGetter = isSub ? $$.getSubYScale : $$.getYScale,
+ xValue = function (d) { return (isSub ? $$.subxx : $$.xx).call($$, d); },
+ value0 = function (d, i) {
+ return config.data_groups.length > 0 ? getPoint(d, i)[0][1] : yScaleGetter.call($$, d.id)(0);
+ },
+ value1 = function (d, i) {
+ return config.data_groups.length > 0 ? getPoint(d, i)[1][1] : yScaleGetter.call($$, d.id)(d.value);
+ };
+
+ area = config.axis_rotated ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(value0).y1(value1);
+ if (!config.line_connect_null) {
+ area = area.defined(function (d) { return d.value !== null; });
+ }
+
+ return function (d) {
+ var data = config.line_connect_null ? $$.filterRemoveNull(d.values) : d.values, x0 = 0, y0 = 0, path;
+ if ($$.isAreaType(d)) {
+ path = area.interpolate($$.getInterpolate(d))(data);
+ } else {
+ if (data[0]) {
+ x0 = $$.x(data[0].x);
+ y0 = $$.getYScale(d.id)(data[0].value);
+ }
+ path = config.axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
+ }
+ return path ? path : "M 0 0";
+ };
+ };
+
+ c3_chart_internal_fn.generateGetAreaPoint = function (areaIndices, isSub) { // partial duplication of generateGetBarPoints
+ var $$ = this, config = $$.config,
+ areaTargetsNum = areaIndices.__max__ + 1,
+ x = $$.getShapeX(0, areaTargetsNum, areaIndices, !!isSub),
+ y = $$.getShapeY(!!isSub),
+ areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, !!isSub),
+ yScale = isSub ? $$.getSubYScale : $$.getYScale;
+ return function (d, i) {
+ var y0 = yScale.call($$, d.id)(0),
+ offset = areaOffset(d, i) || y0, // offset is for stacked area chart
+ posX = x(d), posY = y(d);
+ // fix posY not to overflow opposite quadrant
+ if (config.axis_rotated) {
+ if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; }
+ }
+ // 1 point that marks the area position
+ return [
+ [posX, offset],
+ [posX, posY - (y0 - offset)]
+ ];
+ };
+ };
+
+
+ c3_chart_internal_fn.redrawCircle = function () {
+ var $$ = this;
+ $$.mainCircle = $$.main.selectAll('.' + CLASS.circles).selectAll('.' + CLASS.circle)
+ .data($$.lineOrScatterData.bind($$));
+ $$.mainCircle.enter().append("circle")
+ .attr("class", $$.classCircle.bind($$))
+ .attr("r", $$.pointR.bind($$))
+ .style("fill", $$.color);
+ $$.mainCircle
+ .style("opacity", $$.initialOpacity.bind($$));
+ $$.mainCircle.exit().remove();
+ };
+ c3_chart_internal_fn.addTransitionForCircle = function (transitions, cx, cy) {
+ var $$ = this;
+ transitions.push($$.mainCircle.transition()
+ .style('opacity', $$.opacityForCircle.bind($$))
+ .style("fill", $$.color)
+ .attr("cx", cx)
+ .attr("cy", cy));
+ transitions.push($$.main.selectAll('.' + CLASS.selectedCircle).transition()
+ .attr("cx", cx)
+ .attr("cy", cy));
+ };
+ c3_chart_internal_fn.circleX = function (d) {
+ return d.x || d.x === 0 ? this.x(d.x) : null;
+ };
+ c3_chart_internal_fn.circleY = function (d, i) {
+ var $$ = this,
+ lineIndices = $$.getShapeIndices($$.isLineType), getPoint = $$.generateGetLinePoint(lineIndices);
+ return $$.config.data_groups.length > 0 ? getPoint(d, i)[0][1] : $$.getYScale(d.id)(d.value);
+ };
+ c3_chart_internal_fn.getCircles = function (i, id) {
+ var $$ = this;
+ return (id ? $$.main.selectAll('.' + CLASS.circles + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS.circle + (isValue(i) ? '-' + i : ''));
+ };
+ c3_chart_internal_fn.expandCircles = function (i, id) {
+ var $$ = this,
+ r = $$.pointExpandedR.bind($$);
+ $$.getCircles(i, id)
+ .classed(CLASS.EXPANDED, true)
+ .attr('r', r);
+ };
+ c3_chart_internal_fn.unexpandCircles = function (i) {
+ var $$ = this,
+ r = $$.pointR.bind($$);
+ $$.getCircles(i)
+ .filter(function () { return $$.d3.select(this).classed(CLASS.EXPANDED); })
+ .classed(CLASS.EXPANDED, false)
+ .attr('r', r);
+ };
+ c3_chart_internal_fn.pointR = function (d) {
+ var $$ = this, config = $$.config;
+ return config.point_show && !$$.isStepType(d) ? (isFunction(config.point_r) ? config.point_r(d) : config.point_r) : 0;
+ };
+ c3_chart_internal_fn.pointExpandedR = function (d) {
+ var $$ = this, config = $$.config;
+ return config.point_focus_expand_enabled ? (config.point_focus_expand_r ? config.point_focus_expand_r : $$.pointR(d) * 1.75) : $$.pointR(d);
+ };
+ c3_chart_internal_fn.pointSelectR = function (d) {
+ var $$ = this, config = $$.config;
+ return config.point_select_r ? config.point_select_r : $$.pointR(d) * 4;
+ };
+ c3_chart_internal_fn.isWithinCircle = function (_this, _r) {
+ var d3 = this.d3,
+ mouse = d3.mouse(_this), d3_this = d3.select(_this),
+ cx = d3_this.attr("cx") * 1, cy = d3_this.attr("cy") * 1;
+ return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < _r;
+ };
+
+ c3_chart_internal_fn.initBar = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartBars);
+ };
+ c3_chart_internal_fn.updateTargetsForBar = function (targets) {
+ var $$ = this, config = $$.config,
+ mainBarUpdate, mainBarEnter,
+ classChartBar = $$.classChartBar.bind($$),
+ classBars = $$.classBars.bind($$);
+ mainBarUpdate = $$.main.select('.' + CLASS.chartBars).selectAll('.' + CLASS.chartBar)
+ .data(targets)
+ .attr('class', classChartBar);
+ mainBarEnter = mainBarUpdate.enter().append('g')
+ .attr('class', classChartBar)
+ .style('opacity', 0)
+ .style("pointer-events", "none");
+ // Bars for each data
+ mainBarEnter.append('g')
+ .attr("class", classBars)
+ .style("cursor", function (d) { return config.data_selection_isselectable(d) ? "pointer" : null; });
+
+ };
+ c3_chart_internal_fn.redrawBar = function (durationForExit) {
+ var $$ = this,
+ barData = $$.barData.bind($$),
+ classBar = $$.classBar.bind($$),
+ initialOpacity = $$.initialOpacity.bind($$),
+ color = function (d) { return $$.color(d.id); };
+ $$.mainBar = $$.main.selectAll('.' + CLASS.bars).selectAll('.' + CLASS.bar)
+ .data(barData);
+ $$.mainBar.enter().append('path')
+ .attr("class", classBar)
+ .style("stroke", color)
+ .style("fill", color);
+ $$.mainBar
+ .style("opacity", initialOpacity);
+ $$.mainBar.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.addTransitionForBar = function (transitions, drawBar) {
+ var $$ = this;
+ transitions.push($$.mainBar.transition()
+ .attr('d', drawBar)
+ .style("fill", $$.color)
+ .style("opacity", 1));
+ };
+ c3_chart_internal_fn.getBarW = function (axis, barTargetsNum) {
+ var $$ = this, config = $$.config,
+ w = typeof config.bar_width === 'number' ? config.bar_width : barTargetsNum ? (axis.tickOffset() * 2 * config.bar_width_ratio) / barTargetsNum : 0;
+ return config.bar_width_max && w > config.bar_width_max ? config.bar_width_max : w;
+ };
+ c3_chart_internal_fn.getBars = function (i) {
+ var $$ = this;
+ return $$.main.selectAll('.' + CLASS.bar + (isValue(i) ? '-' + i : ''));
+ };
+ c3_chart_internal_fn.expandBars = function (i) {
+ var $$ = this;
+ $$.getBars(i).classed(CLASS.EXPANDED, true);
+ };
+ c3_chart_internal_fn.unexpandBars = function (i) {
+ var $$ = this;
+ $$.getBars(i).classed(CLASS.EXPANDED, false);
+ };
+ c3_chart_internal_fn.generateDrawBar = function (barIndices, isSub) {
+ var $$ = this, config = $$.config,
+ getPoints = $$.generateGetBarPoints(barIndices, isSub);
+ return function (d, i) {
+ // 4 points that make a bar
+ var points = getPoints(d, i);
+
+ // switch points if axis is rotated, not applicable for sub chart
+ var indexX = config.axis_rotated ? 1 : 0;
+ var indexY = config.axis_rotated ? 0 : 1;
+
+ var path = 'M ' + points[0][indexX] + ',' + points[0][indexY] + ' ' +
+ 'L' + points[1][indexX] + ',' + points[1][indexY] + ' ' +
+ 'L' + points[2][indexX] + ',' + points[2][indexY] + ' ' +
+ 'L' + points[3][indexX] + ',' + points[3][indexY] + ' ' +
+ 'z';
+
+ return path;
+ };
+ };
+ c3_chart_internal_fn.generateGetBarPoints = function (barIndices, isSub) {
+ var $$ = this,
+ barTargetsNum = barIndices.__max__ + 1,
+ barW = $$.getBarW($$.xAxis, barTargetsNum),
+ barX = $$.getShapeX(barW, barTargetsNum, barIndices, !!isSub),
+ barY = $$.getShapeY(!!isSub),
+ barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub),
+ yScale = isSub ? $$.getSubYScale : $$.getYScale;
+ return function (d, i) {
+ var y0 = yScale.call($$, d.id)(0),
+ offset = barOffset(d, i) || y0, // offset is for stacked bar chart
+ posX = barX(d), posY = barY(d);
+ // fix posY not to overflow opposite quadrant
+ if ($$.config.axis_rotated) {
+ if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; }
+ }
+ // 4 points that make a bar
+ return [
+ [posX, offset],
+ [posX, posY - (y0 - offset)],
+ [posX + barW, posY - (y0 - offset)],
+ [posX + barW, offset]
+ ];
+ };
+ };
+ c3_chart_internal_fn.isWithinBar = function (_this) {
+ var d3 = this.d3,
+ mouse = d3.mouse(_this), box = _this.getBoundingClientRect(),
+ seg0 = _this.pathSegList.getItem(0), seg1 = _this.pathSegList.getItem(1),
+ x = seg0.x, y = Math.min(seg0.y, seg1.y), w = box.width, h = box.height, offset = 2,
+ sx = x - offset, ex = x + w + offset, sy = y + h + offset, ey = y - offset;
+ return sx < mouse[0] && mouse[0] < ex && ey < mouse[1] && mouse[1] < sy;
+ };
+
+ c3_chart_internal_fn.initText = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartTexts);
+ $$.mainText = $$.d3.selectAll([]);
+ };
+ c3_chart_internal_fn.updateTargetsForText = function (targets) {
+ var $$ = this, mainTextUpdate, mainTextEnter,
+ classChartText = $$.classChartText.bind($$),
+ classTexts = $$.classTexts.bind($$);
+ mainTextUpdate = $$.main.select('.' + CLASS.chartTexts).selectAll('.' + CLASS.chartText)
+ .data(targets)
+ .attr('class', classChartText);
+ mainTextEnter = mainTextUpdate.enter().append('g')
+ .attr('class', classChartText)
+ .style('opacity', 0)
+ .style("pointer-events", "none");
+ mainTextEnter.append('g')
+ .attr('class', classTexts);
+ };
+ c3_chart_internal_fn.redrawText = function (durationForExit) {
+ var $$ = this, config = $$.config,
+ barOrLineData = $$.barOrLineData.bind($$),
+ classText = $$.classText.bind($$);
+ $$.mainText = $$.main.selectAll('.' + CLASS.texts).selectAll('.' + CLASS.text)
+ .data(barOrLineData);
+ $$.mainText.enter().append('text')
+ .attr("class", classText)
+ .attr('text-anchor', function (d) { return config.axis_rotated ? (d.value < 0 ? 'end' : 'start') : 'middle'; })
+ .style("stroke", 'none')
+ .style("fill", function (d) { return $$.color(d); })
+ .style("fill-opacity", 0);
+ $$.mainText
+ .text(function (d) { return $$.formatByAxisId($$.getAxisId(d.id))(d.value, d.id); });
+ $$.mainText.exit()
+ .transition().duration(durationForExit)
+ .style('fill-opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.addTransitionForText = function (transitions, xForText, yForText, forFlow) {
+ var $$ = this,
+ opacityForText = forFlow ? 0 : $$.opacityForText.bind($$);
+ transitions.push($$.mainText.transition()
+ .attr('x', xForText)
+ .attr('y', yForText)
+ .style("fill", $$.color)
+ .style("fill-opacity", opacityForText));
+ };
+ c3_chart_internal_fn.getTextRect = function (text, cls) {
+ var rect;
+ this.d3.select('body').selectAll('.dummy')
+ .data([text])
+ .enter().append('text')
+ .classed(cls ? cls : "", true)
+ .text(text)
+ .each(function () { rect = this.getBoundingClientRect(); })
+ .remove();
+ return rect;
+ };
+ c3_chart_internal_fn.generateXYForText = function (barIndices, forX) {
+ var $$ = this,
+ getPoints = $$.generateGetBarPoints(barIndices, false),
+ getter = forX ? $$.getXForText : $$.getYForText;
+ return function (d, i) {
+ return getter.call($$, getPoints(d, i), d, this);
+ };
+ };
+ c3_chart_internal_fn.getXForText = function (points, d, textElement) {
+ var $$ = this,
+ box = textElement.getBoundingClientRect(), xPos, padding;
+ if ($$.config.axis_rotated) {
+ padding = $$.isBarType(d) ? 4 : 6;
+ xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
+ } else {
+ xPos = $$.hasType('bar') ? (points[2][0] + points[0][0]) / 2 : points[0][0];
+ }
+ return xPos > $$.width ? $$.width - box.width : xPos;
+ };
+ c3_chart_internal_fn.getYForText = function (points, d, textElement) {
+ var $$ = this,
+ box = textElement.getBoundingClientRect(), yPos;
+ if ($$.config.axis_rotated) {
+ yPos = (points[0][0] + points[2][0] + box.height * 0.6) / 2;
+ } else {
+ yPos = points[2][1] + (d.value < 0 ? box.height : $$.isBarType(d) ? -3 : -6);
+ }
+ return yPos < box.height ? box.height : yPos;
+ };
+
+ c3_chart_internal_fn.setTargetType = function (targetIds, type) {
+ var $$ = this, config = $$.config;
+ $$.mapToTargetIds(targetIds).forEach(function (id) {
+ $$.withoutFadeIn[id] = (type === config.data_types[id]);
+ config.data_types[id] = type;
+ });
+ if (!targetIds) {
+ config.data_type = type;
+ }
+ };
+ c3_chart_internal_fn.hasType = function (type, targets) {
+ var $$ = this, types = $$.config.data_types, has = false;
+ (targets || $$.data.targets).forEach(function (t) {
+ if ((types[t.id] && types[t.id].indexOf(type) >= 0) || (!(t.id in types) && type === 'line')) {
+ has = true;
+ }
+ });
+ return has;
+ };
+ c3_chart_internal_fn.hasArcType = function (targets) {
+ return this.hasType('pie', targets) || this.hasType('donut', targets) || this.hasType('gauge', targets);
+ };
+ c3_chart_internal_fn.isLineType = function (d) {
+ var config = this.config, id = isString(d) ? d : d.id;
+ return !config.data_types[id] || ['line', 'spline', 'area', 'area-spline', 'step', 'area-step'].indexOf(config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isStepType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return ['step', 'area-step'].indexOf(this.config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isSplineType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return ['spline', 'area-spline'].indexOf(this.config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isAreaType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return ['area', 'area-spline', 'area-step'].indexOf(this.config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isBarType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'bar';
+ };
+ c3_chart_internal_fn.isScatterType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'scatter';
+ };
+ c3_chart_internal_fn.isPieType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'pie';
+ };
+ c3_chart_internal_fn.isGaugeType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'gauge';
+ };
+ c3_chart_internal_fn.isDonutType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'donut';
+ };
+ c3_chart_internal_fn.isArcType = function (d) {
+ return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d);
+ };
+ c3_chart_internal_fn.lineData = function (d) {
+ return this.isLineType(d) ? [d] : [];
+ };
+ c3_chart_internal_fn.arcData = function (d) {
+ return this.isArcType(d.data) ? [d] : [];
+ };
+ /* not used
+ function scatterData(d) {
+ return isScatterType(d) ? d.values : [];
+ }
+ */
+ c3_chart_internal_fn.barData = function (d) {
+ return this.isBarType(d) ? d.values : [];
+ };
+ c3_chart_internal_fn.lineOrScatterData = function (d) {
+ return this.isLineType(d) || this.isScatterType(d) ? d.values : [];
+ };
+ c3_chart_internal_fn.barOrLineData = function (d) {
+ return this.isBarType(d) || this.isLineType(d) ? d.values : [];
+ };
+
+ c3_chart_internal_fn.initGrid = function () {
+ var $$ = this, config = $$.config, d3 = $$.d3;
+ $$.grid = $$.main.append('g')
+ .attr("clip-path", $$.clipPath)
+ .attr('class', CLASS.grid);
+ if (config.grid_x_show) {
+ $$.grid.append("g").attr("class", CLASS.xgrids);
+ }
+ if (config.grid_y_show) {
+ $$.grid.append('g').attr('class', CLASS.ygrids);
+ }
+ $$.grid.append('g').attr("class", CLASS.xgridLines);
+ $$.grid.append('g').attr('class', CLASS.ygridLines);
+ if (config.grid_focus_show) {
+ $$.grid.append('g')
+ .attr("class", CLASS.xgridFocus)
+ .append('line')
+ .attr('class', CLASS.xgridFocus);
+ }
+ $$.xgrid = d3.selectAll([]);
+ $$.xgridLines = d3.selectAll([]);
+ };
+
+ c3_chart_internal_fn.updateXGrid = function (withoutUpdate) {
+ var $$ = this, config = $$.config, d3 = $$.d3,
+ xgridData = $$.generateGridData(config.grid_x_type, $$.x),
+ tickOffset = $$.isCategorized() ? $$.xAxis.tickOffset() : 0;
+
+ $$.xgridAttr = config.axis_rotated ? {
+ 'x1': 0,
+ 'x2': $$.width,
+ 'y1': function (d) { return $$.x(d) - tickOffset; },
+ 'y2': function (d) { return $$.x(d) - tickOffset; }
+ } : {
+ 'x1': function (d) { return $$.x(d) + tickOffset; },
+ 'x2': function (d) { return $$.x(d) + tickOffset; },
+ 'y1': 0,
+ 'y2': $$.height
+ };
+
+ $$.xgrid = $$.main.select('.' + CLASS.xgrids).selectAll('.' + CLASS.xgrid)
+ .data(xgridData);
+ $$.xgrid.enter().append('line').attr("class", CLASS.xgrid);
+ if (!withoutUpdate) {
+ $$.xgrid.attr($$.xgridAttr)
+ .style("opacity", function () { return +d3.select(this).attr(config.axis_rotated ? 'y1' : 'x1') === (config.axis_rotated ? $$.height : 0) ? 0 : 1; });
+ }
+ $$.xgrid.exit().remove();
+ };
+
+ c3_chart_internal_fn.updateYGrid = function () {
+ var $$ = this, config = $$.config;
+ $$.ygrid = $$.main.select('.' + CLASS.ygrids).selectAll('.' + CLASS.ygrid)
+ .data($$.y.ticks(config.grid_y_ticks));
+ $$.ygrid.enter().append('line')
+ .attr('class', CLASS.ygrid);
+ $$.ygrid.attr("x1", config.axis_rotated ? $$.y : 0)
+ .attr("x2", config.axis_rotated ? $$.y : $$.width)
+ .attr("y1", config.axis_rotated ? 0 : $$.y)
+ .attr("y2", config.axis_rotated ? $$.height : $$.y);
+ $$.ygrid.exit().remove();
+ $$.smoothLines($$.ygrid, 'grid');
+ };
+
+
+ c3_chart_internal_fn.redrawGrid = function (duration, withY) {
+ var $$ = this, main = $$.main, config = $$.config,
+ xgridLine, ygridLine, yv;
+ main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
+ if (config.grid_x_show) {
+ $$.updateXGrid();
+ }
+ $$.xgridLines = main.select('.' + CLASS.xgridLines).selectAll('.' + CLASS.xgridLine)
+ .data(config.grid_x_lines);
+ // enter
+ xgridLine = $$.xgridLines.enter().append('g')
+ .attr("class", function (d) { return CLASS.xgridLine + (d.class ? ' ' + d.class : ''); });
+ xgridLine.append('line')
+ .style("opacity", 0);
+ xgridLine.append('text')
+ .attr("text-anchor", "end")
+ .attr("transform", config.axis_rotated ? "" : "rotate(-90)")
+ .attr('dx', config.axis_rotated ? 0 : -$$.margin.top)
+ .attr('dy', -5)
+ .style("opacity", 0);
+ // udpate
+ // done in d3.transition() of the end of this function
+ // exit
+ $$.xgridLines.exit().transition().duration(duration)
+ .style("opacity", 0)
+ .remove();
+
+ // Y-Grid
+ if (withY && config.grid_y_show) {
+ $$.updateYGrid();
+ }
+ if (withY) {
+ $$.ygridLines = main.select('.' + CLASS.ygridLines).selectAll('.' + CLASS.ygridLine)
+ .data(config.grid_y_lines);
+ // enter
+ ygridLine = $$.ygridLines.enter().append('g')
+ .attr("class", function (d) { return CLASS.ygridLine + (d.class ? ' ' + d.class : ''); });
+ ygridLine.append('line')
+ .style("opacity", 0);
+ ygridLine.append('text')
+ .attr("text-anchor", "end")
+ .attr("transform", config.axis_rotated ? "rotate(-90)" : "")
+ .attr('dx', config.axis_rotated ? 0 : -$$.margin.top)
+ .attr('dy', -5)
+ .style("opacity", 0);
+ // update
+ yv = $$.yv.bind($$);
+ $$.ygridLines.select('line')
+ .transition().duration(duration)
+ .attr("x1", config.axis_rotated ? yv : 0)
+ .attr("x2", config.axis_rotated ? yv : $$.width)
+ .attr("y1", config.axis_rotated ? 0 : yv)
+ .attr("y2", config.axis_rotated ? $$.height : yv)
+ .style("opacity", 1);
+ $$.ygridLines.select('text')
+ .transition().duration(duration)
+ .attr("x", config.axis_rotated ? 0 : $$.width)
+ .attr("y", yv)
+ .text(function (d) { return d.text; })
+ .style("opacity", 1);
+ // exit
+ $$.ygridLines.exit().transition().duration(duration)
+ .style("opacity", 0)
+ .remove();
+ }
+ };
+ c3_chart_internal_fn.addTransitionForGrid = function (transitions) {
+ var $$ = this, config = $$.config, xv = $$.xv.bind($$);
+ transitions.push($$.xgridLines.select('line').transition()
+ .attr("x1", config.axis_rotated ? 0 : xv)
+ .attr("x2", config.axis_rotated ? $$.width : xv)
+ .attr("y1", config.axis_rotated ? xv : $$.margin.top)
+ .attr("y2", config.axis_rotated ? xv : $$.height)
+ .style("opacity", 1));
+ transitions.push($$.xgridLines.select('text').transition()
+ .attr("x", config.axis_rotated ? $$.width : 0)
+ .attr("y", xv)
+ .text(function (d) { return d.text; })
+ .style("opacity", 1));
+ };
+ c3_chart_internal_fn.showXGridFocus = function (selectedData) {
+ var $$ = this, config = $$.config,
+ dataToShow = selectedData.filter(function (d) { return d && isValue(d.value); }),
+ focusEl = $$.main.selectAll('line.' + CLASS.xgridFocus),
+ xx = $$.xx.bind($$);
+ if (! config.tooltip_show) { return; }
+ // Hide when scatter plot exists
+ if ($$.hasType('scatter') || $$.hasArcType()) { return; }
+ focusEl
+ .style("visibility", "visible")
+ .data([dataToShow[0]])
+ .attr(config.axis_rotated ? 'y1' : 'x1', xx)
+ .attr(config.axis_rotated ? 'y2' : 'x2', xx);
+ $$.smoothLines(focusEl, 'grid');
+ };
+ c3_chart_internal_fn.hideXGridFocus = function () {
+ this.main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
+ };
+ c3_chart_internal_fn.updateXgridFocus = function () {
+ var $$ = this, config = $$.config;
+ $$.main.select('line.' + CLASS.xgridFocus)
+ .attr("x1", config.axis_rotated ? 0 : -10)
+ .attr("x2", config.axis_rotated ? $$.width : -10)
+ .attr("y1", config.axis_rotated ? -10 : 0)
+ .attr("y2", config.axis_rotated ? -10 : $$.height);
+ };
+ c3_chart_internal_fn.generateGridData = function (type, scale) {
+ var $$ = this,
+ gridData = [], xDomain, firstYear, lastYear, i,
+ tickNum = $$.main.select("." + CLASS.axisX).selectAll('.tick').size();
+ if (type === 'year') {
+ xDomain = $$.getXDomain();
+ firstYear = xDomain[0].getFullYear();
+ lastYear = xDomain[1].getFullYear();
+ for (i = firstYear; i <= lastYear; i++) {
+ gridData.push(new Date(i + '-01-01 00:00:00'));
+ }
+ } else {
+ gridData = scale.ticks(10);
+ if (gridData.length > tickNum) { // use only int
+ gridData = gridData.filter(function (d) { return ("" + d).indexOf('.') < 0; });
+ }
+ }
+ return gridData;
+ };
+ c3_chart_internal_fn.getGridFilterToRemove = function (params) {
+ return params ? function (line) {
+ var found = false;
+ [].concat(params).forEach(function (param) {
+ if ((('value' in param && line.value === params.value) || ('class' in param && line.class === params.class))) {
+ found = true;
+ }
+ });
+ return found;
+ } : function () { return true; };
+ };
+ c3_chart_internal_fn.removeGridLines = function (params, forX) {
+ var $$ = this, config = $$.config,
+ toRemove = $$.getGridFilterToRemove(params),
+ toShow = function (line) { return !toRemove(line); },
+ classLines = forX ? CLASS.xgridLines : CLASS.ygridLines,
+ classLine = forX ? CLASS.xgridLine : CLASS.ygridLine;
+ $$.main.select('.' + classLines).selectAll('.' + classLine).filter(toRemove)
+ .transition().duration(config.transition_duration)
+ .style('opacity', 0).remove();
+ if (forX) {
+ config.grid_x_lines = config.grid_x_lines.filter(toShow);
+ } else {
+ config.grid_y_lines = config.grid_y_lines.filter(toShow);
+ }
+ };
+
+ c3_chart_internal_fn.initTooltip = function () {
+ var $$ = this, config = $$.config, i;
+ $$.tooltip = $$.selectChart
+ .style("position", "relative")
+ .append("div")
+ .style("position", "absolute")
+ .style("pointer-events", "none")
+ .style("z-index", "10")
+ .style("display", "none");
+ // Show tooltip if needed
+ if (config.tooltip_init_show) {
+ if ($$.isTimeSeries() && isString(config.tooltip_init_x)) {
+ config.tooltip_init_x = $$.parseDate(config.tooltip_init_x);
+ for (i = 0; i < $$.data.targets[0].values.length; i++) {
+ if (($$.data.targets[0].values[i].x - config.tooltip_init_x) === 0) { break; }
+ }
+ config.tooltip_init_x = i;
+ }
+ $$.tooltip.html(config.tooltip_contents.call($$, $$.data.targets.map(function (d) {
+ return $$.addName(d.values[config.tooltip_init_x]);
+ }), $$.getXAxisTickFormat(), $$.getYFormat($$.hasArcType()), $$.color));
+ $$.tooltip.style("top", config.tooltip_init_position.top)
+ .style("left", config.tooltip_init_position.left)
+ .style("display", "block");
+ }
+ };
+ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaultValueFormat, color) {
+ var $$ = this, config = $$.config,
+ titleFormat = config.tooltip_format_title || defaultTitleFormat,
+ nameFormat = config.tooltip_format_name || function (name) { return name; },
+ valueFormat = config.tooltip_format_value || defaultValueFormat,
+ text, i, title, value, name, bgcolor;
+ for (i = 0; i < d.length; i++) {
+ if (! (d[i] && (d[i].value || d[i].value === 0))) { continue; }
+
+ if (! text) {
+ title = titleFormat ? titleFormat(d[i].x) : d[i].x;
+ text = "<table class='" + CLASS.tooltip + "'>" + (title || title === 0 ? "<tr><th colspan='2'>" + title + "</th></tr>" : "");
+ }
+
+ name = nameFormat(d[i].name);
+ value = valueFormat(d[i].value, d[i].ratio, d[i].id, d[i].index);
+ bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id);
+
+ text += "<tr class='" + CLASS.tooltipName + "-" + d[i].id + "'>";
+ text += "<td class='name'><span style='background-color:" + bgcolor + "'></span>" + name + "</td>";
+ text += "<td class='value'>" + value + "</td>";
+ text += "</tr>";
+ }
+ return text + "</table>";
+ };
+ c3_chart_internal_fn.showTooltip = function (selectedData, mouse) {
+ var $$ = this, config = $$.config;
+ var tWidth, tHeight, svgLeft, tooltipLeft, tooltipRight, tooltipTop, chartRight;
+ var forArc = $$.hasArcType(),
+ dataToShow = selectedData.filter(function (d) { return d && isValue(d.value); });
+ if (dataToShow.length === 0 || !config.tooltip_show) {
+ return;
+ }
+ $$.tooltip.html(config.tooltip_contents.call($$, selectedData, $$.getXAxisTickFormat(), $$.getYFormat(forArc), $$.color)).style("display", "block");
+
+ // Get tooltip dimensions
+ tWidth = $$.tooltip.property('offsetWidth');
+ tHeight = $$.tooltip.property('offsetHeight');
+ // Determin tooltip position
+ if (forArc) {
+ tooltipLeft = ($$.width / 2) + mouse[0];
+ tooltipTop = ($$.height / 2) + mouse[1] + 20;
+ } else {
+ if (config.axis_rotated) {
+ svgLeft = $$.getSvgLeft();
+ tooltipLeft = svgLeft + mouse[0] + 100;
+ tooltipRight = tooltipLeft + tWidth;
+ chartRight = $$.getCurrentWidth() - $$.getCurrentPaddingRight();
+ tooltipTop = $$.x(dataToShow[0].x) + 20;
+ } else {
+ svgLeft = $$.getSvgLeft();
+ tooltipLeft = svgLeft + $$.getCurrentPaddingLeft() + $$.x(dataToShow[0].x) + 20;
+ tooltipRight = tooltipLeft + tWidth;
+ chartRight = svgLeft + $$.getCurrentWidth() - $$.getCurrentPaddingRight();
+ tooltipTop = mouse[1] + 15;
+ }
+
+ if (tooltipRight > chartRight) {
+ tooltipLeft -= tooltipRight - chartRight;
+ }
+ if (tooltipTop + tHeight > $$.getCurrentHeight() && tooltipTop > tHeight + 30) {
+ tooltipTop -= tHeight + 30;
+ }
+ }
+ // Set tooltip
+ $$.tooltip
+ .style("top", tooltipTop + "px")
+ .style("left", tooltipLeft + 'px');
+ };
+ c3_chart_internal_fn.hideTooltip = function () {
+ this.tooltip.style("display", "none");
+ };
+
+ c3_chart_internal_fn.initLegend = function () {
+ var $$ = this;
+ $$.legend = $$.svg.append("g").attr("transform", $$.getTranslate('legend'));
+ if (!$$.config.legend_show) {
+ $$.legend.style('visibility', 'hidden');
+ $$.hiddenLegendIds = $$.mapToIds($$.data.targets);
+ }
+ // MEMO: call here to update legend box and tranlate for all
+ // MEMO: translate will be upated by this, so transform not needed in updateLegend()
+ $$.updateLegend($$.mapToIds($$.data.targets), {withTransform: false, withTransitionForTransform: false, withTransition: false});
+ };
+ c3_chart_internal_fn.updateSizeForLegend = function (legendHeight, legendWidth) {
+ var $$ = this, config = $$.config, insetLegendPosition = {
+ top: $$.isLegendTop ? $$.getCurrentPaddingTop() + config.legend_inset_y + 5.5 : $$.currentHeight - legendHeight - $$.getCurrentPaddingBottom() - config.legend_inset_y,
+ left: $$.isLegendLeft ? $$.getCurrentPaddingLeft() + config.legend_inset_x + 0.5 : $$.currentWidth - legendWidth - $$.getCurrentPaddingRight() - config.legend_inset_x + 0.5
+ };
+ $$.margin3 = {
+ top: $$.isLegendRight ? 0 : $$.isLegendInset ? insetLegendPosition.top : $$.currentHeight - legendHeight,
+ right: NaN,
+ bottom: 0,
+ left: $$.isLegendRight ? $$.currentWidth - legendWidth : $$.isLegendInset ? insetLegendPosition.left : 0
+ };
+ };
+ c3_chart_internal_fn.transformLegend = function (withTransition) {
+ var $$ = this;
+ (withTransition ? $$.legend.transition() : $$.legend).attr("transform", $$.getTranslate('legend'));
+ };
+ c3_chart_internal_fn.updateLegendStep = function (step) {
+ this.legendStep = step;
+ };
+ c3_chart_internal_fn.updateLegendItemWidth = function (w) {
+ this.legendItemWidth = w;
+ };
+ c3_chart_internal_fn.updateLegendItemHeight = function (h) {
+ this.legendItemHeight = h;
+ };
+ c3_chart_internal_fn.getLegendWidth = function () {
+ var $$ = this;
+ return $$.config.legend_show ? $$.isLegendRight || $$.isLegendInset ? $$.legendItemWidth * ($$.legendStep + 1) : $$.currentWidth : 0;
+ };
+ c3_chart_internal_fn.getLegendHeight = function () {
+ var $$ = this, config = $$.config, h = 0;
+ if (config.legend_show) {
+ if ($$.isLegendRight) {
+ h = $$.currentHeight;
+ } else if ($$.isLegendInset) {
+ h = config.legend_inset_step ? Math.max(20, $$.legendItemHeight) * (config.legend_inset_step + 1) : $$.height;
+ } else {
+ h = Math.max(20, $$.legendItemHeight) * ($$.legendStep + 1);
+ }
+ }
+ return h;
+ };
+ c3_chart_internal_fn.opacityForLegend = function (legendItem) {
+ var $$ = this;
+ return legendItem.classed(CLASS.legendItemHidden) ? $$.legendOpacityForHidden : 1;
+ };
+ c3_chart_internal_fn.opacityForUnfocusedLegend = function (legendItem) {
+ var $$ = this;
+ return legendItem.classed(CLASS.legendItemHidden) ? $$.legendOpacityForHidden : 0.3;
+ };
+ c3_chart_internal_fn.toggleFocusLegend = function (id, focus) {
+ var $$ = this;
+ $$.legend.selectAll('.' + CLASS.legendItem)
+ .transition().duration(100)
+ .style('opacity', function (_id) {
+ var This = $$.d3.select(this);
+ if (id && _id !== id) {
+ return focus ? $$.opacityForUnfocusedLegend(This) : $$.opacityForLegend(This);
+ } else {
+ return focus ? $$.opacityForLegend(This) : $$.opacityForUnfocusedLegend(This);
+ }
+ });
+ };
+ c3_chart_internal_fn.revertLegend = function () {
+ var $$ = this, d3 = $$.d3;
+ $$.legend.selectAll('.' + CLASS.legendItem)
+ .transition().duration(100)
+ .style('opacity', function () { return $$.opacityForLegend(d3.select(this)); });
+ };
+ c3_chart_internal_fn.showLegend = function (targetIds) {
+ var $$ = this, config = $$.config;
+ if (!config.legend_show) {
+ config.legend_show = true;
+ $$.legend.style('visibility', 'visible');
+ }
+ $$.removeHiddenLegendIds(targetIds);
+ $$.legend.selectAll($$.selectorLegends(targetIds))
+ .style('visibility', 'visible')
+ .transition()
+ .style('opacity', function () { return $$.opacityForLegend($$.d3.select(this)); });
+ };
+ c3_chart_internal_fn.hideLegend = function (targetIds) {
+ var $$ = this, config = $$.config;
+ if (config.legend_show && isEmpty(targetIds)) {
+ config.legend_show = false;
+ $$.legend.style('visibility', 'hidden');
+ }
+ $$.addHiddenLegendIds(targetIds);
+ $$.legend.selectAll($$.selectorLegends(targetIds))
+ .style('opacity', 0)
+ .style('visibility', 'hidden');
+ };
+ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
+ var $$ = this, config = $$.config;
+ var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect;
+ var paddingTop = 4, paddingRight = 36, maxWidth = 0, maxHeight = 0, posMin = 10;
+ var l, totalLength = 0, offsets = {}, widths = {}, heights = {}, margins = [0], steps = {}, step = 0;
+ var withTransition, withTransitionForTransform;
+ var hasFocused = $$.legend.selectAll('.' + CLASS.legendItemFocused).size();
+ var texts, rects, tiles;
+
+ options = options || {};
+ withTransition = getOption(options, "withTransition", true);
+ withTransitionForTransform = getOption(options, "withTransitionForTransform", true);
+
+ function updatePositions(textElement, id, reset) {
+ var box = $$.getTextRect(textElement.textContent, CLASS.legendItem),
+ itemWidth = Math.ceil((box.width + paddingRight) / 10) * 10,
+ itemHeight = Math.ceil((box.height + paddingTop) / 10) * 10,
+ itemLength = $$.isLegendRight || $$.isLegendInset ? itemHeight : itemWidth,
+ areaLength = $$.isLegendRight || $$.isLegendInset ? $$.getLegendHeight() : $$.getLegendWidth(),
+ margin, maxLength;
+
+ // MEMO: care about condifion of step, totalLength
+ function updateValues(id, withoutStep) {
+ if (!withoutStep) {
+ margin = (areaLength - totalLength - itemLength) / 2;
+ if (margin < posMin) {
+ margin = (areaLength - itemLength) / 2;
+ totalLength = 0;
+ step++;
+ }
+ }
+ steps[id] = step;
+ margins[step] = $$.isLegendInset ? 10 : margin;
+ offsets[id] = totalLength;
+ totalLength += itemLength;
+ }
+
+ if (reset) {
+ totalLength = 0;
+ step = 0;
+ maxWidth = 0;
+ maxHeight = 0;
+ }
+
+ if (config.legend_show && !$$.isLegendToShow(id)) {
+ widths[id] = heights[id] = steps[id] = offsets[id] = 0;
+ return;
+ }
+
+ widths[id] = itemWidth;
+ heights[id] = itemHeight;
+
+ if (!maxWidth || itemWidth >= maxWidth) { maxWidth = itemWidth; }
+ if (!maxHeight || itemHeight >= maxHeight) { maxHeight = itemHeight; }
+ maxLength = $$.isLegendRight || $$.isLegendInset ? maxHeight : maxWidth;
+
+ if (config.legend_equally) {
+ Object.keys(widths).forEach(function (id) { widths[id] = maxWidth; });
+ Object.keys(heights).forEach(function (id) { heights[id] = maxHeight; });
+ margin = (areaLength - maxLength * targetIds.length) / 2;
+ if (margin < posMin) {
+ totalLength = 0;
+ step = 0;
+ targetIds.forEach(function (id) { updateValues(id); });
+ }
+ else {
+ updateValues(id, true);
+ }
+ } else {
+ updateValues(id);
+ }
+ }
+
+ if ($$.isLegendRight) {
+ xForLegend = function (id) { return maxWidth * steps[id]; };
+ yForLegend = function (id) { return margins[steps[id]] + offsets[id]; };
+ } else if ($$.isLegendInset) {
+ xForLegend = function (id) { return maxWidth * steps[id] + 10; };
+ yForLegend = function (id) { return margins[steps[id]] + offsets[id]; };
+ } else {
+ xForLegend = function (id) { return margins[steps[id]] + offsets[id]; };
+ yForLegend = function (id) { return maxHeight * steps[id]; };
+ }
+ xForLegendText = function (id, i) { return xForLegend(id, i) + 14; };
+ yForLegendText = function (id, i) { return yForLegend(id, i) + 9; };
+ xForLegendRect = function (id, i) { return xForLegend(id, i) - 4; };
+ yForLegendRect = function (id, i) { return yForLegend(id, i) - 7; };
+
+ // Define g for legend area
+ l = $$.legend.selectAll('.' + CLASS.legendItem)
+ .data(targetIds)
+ .enter().append('g')
+ .attr('class', function (id) { return $$.generateClass(CLASS.legendItem, id); })
+ .style('visibility', function (id) { return $$.isLegendToShow(id) ? 'visible' : 'hidden'; })
+ .style('cursor', 'pointer')
+ .on('click', function (id) {
+ config.legend_item_onclick ? config.legend_item_onclick.call($$, id) : $$.api.toggle(id);
+ })
+ .on('mouseover', function (id) {
+ $$.d3.select(this).classed(CLASS.legendItemFocused, true);
+ if (!$$.transiting) {
+ $$.api.focus(id);
+ }
+ if (config.legend_item_onmouseover) {
+ config.legend_item_onmouseover.call($$, id);
+ }
+ })
+ .on('mouseout', function (id) {
+ $$.d3.select(this).classed(CLASS.legendItemFocused, false);
+ if (!$$.transiting) {
+ $$.api.revert();
+ }
+ if (config.legend_item_onmouseout) {
+ config.legend_item_onmouseout.call($$, id);
+ }
+ });
+ l.append('text')
+ .text(function (id) { return isDefined(config.data_names[id]) ? config.data_names[id] : id; })
+ .each(function (id, i) { updatePositions(this, id, i === 0); })
+ .style("pointer-events", "none")
+ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200)
+ .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegendText);
+ l.append('rect')
+ .attr("class", CLASS.legendItemEvent)
+ .style('fill-opacity', 0)
+ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendRect : -200)
+ .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegendRect);
+ l.append('rect')
+ .attr("class", CLASS.legendItemTile)
+ .style("pointer-events", "none")
+ .style('fill', $$.color)
+ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200)
+ .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegend)
+ .attr('width', 10)
+ .attr('height', 10);
+ // Set background for inset legend
+ if ($$.isLegendInset && maxWidth !== 0) {
+ $$.legend.insert('g', '.' + CLASS.legendItem)
+ .attr("class", CLASS.legendBackground)
+ .append('rect')
+ .attr('height', $$.getLegendHeight() - 10)
+ .attr('width', maxWidth * (step + 1) + 10);
+ }
+
+ texts = $$.legend.selectAll('text')
+ .data(targetIds)
+ .text(function (id) { return isDefined(config.data_names[id]) ? config.data_names[id] : id; }) // MEMO: needed for update
+ .each(function (id, i) { updatePositions(this, id, i === 0); });
+ (withTransition ? texts.transition() : texts)
+ .attr('x', xForLegendText)
+ .attr('y', yForLegendText);
+
+ rects = $$.legend.selectAll('rect.' + CLASS.legendItemEvent)
+ .data(targetIds);
+ (withTransition ? rects.transition() : rects)
+ .attr('width', function (id) { return widths[id]; })
+ .attr('height', function (id) { return heights[id]; })
+ .attr('x', xForLegendRect)
+ .attr('y', yForLegendRect);
+
+ tiles = $$.legend.selectAll('rect.' + CLASS.legendItemTile)
+ .data(targetIds);
+ (withTransition ? tiles.transition() : tiles)
+ .style('fill', $$.color)
+ .attr('x', xForLegend)
+ .attr('y', yForLegend);
+
+ // toggle legend state
+ $$.legend.selectAll('.' + CLASS.legendItem)
+ .classed(CLASS.legendItemHidden, function (id) { return !$$.isTargetToShow(id); })
+ .transition()
+ .style('opacity', function (id) {
+ var This = $$.d3.select(this);
+ if ($$.isTargetToShow(id)) {
+ return !hasFocused || This.classed(CLASS.legendItemFocused) ? $$.opacityForLegend(This) : $$.opacityForUnfocusedLegend(This);
+ } else {
+ return $$.legendOpacityForHidden;
+ }
+ });
+
+ // Update all to reflect change of legend
+ $$.updateLegendItemWidth(maxWidth);
+ $$.updateLegendItemHeight(maxHeight);
+ $$.updateLegendStep(step);
+ // Update size and scale
+ $$.updateSizes();
+ $$.updateScales();
+ $$.updateSvgSize();
+ // Update g positions
+ $$.transformAll(withTransitionForTransform, transitions);
+ };
+
+ c3_chart_internal_fn.initAxis = function () {
+ var $$ = this, config = $$.config, main = $$.main;
+ $$.axes.x = main.append("g")
+ .attr("class", CLASS.axis + ' ' + CLASS.axisX)
+ .attr("clip-path", $$.clipPathForXAxis)
+ .attr("transform", $$.getTranslate('x'))
+ .style("visibility", config.axis_x_show ? 'visible' : 'hidden');
+ $$.axes.x.append("text")
+ .attr("class", CLASS.axisXLabel)
+ .attr("transform", config.axis_rotated ? "rotate(-90)" : "")
+ .style("text-anchor", $$.textAnchorForXAxisLabel.bind($$));
+
+ $$.axes.y = main.append("g")
+ .attr("class", CLASS.axis + ' ' + CLASS.axisY)
+ .attr("clip-path", $$.clipPathForYAxis)
+ .attr("transform", $$.getTranslate('y'))
+ .style("visibility", config.axis_y_show ? 'visible' : 'hidden');
+ $$.axes.y.append("text")
+ .attr("class", CLASS.axisYLabel)
+ .attr("transform", config.axis_rotated ? "" : "rotate(-90)")
+ .style("text-anchor", $$.textAnchorForYAxisLabel.bind($$));
+
+ $$.axes.y2 = main.append("g")
+ .attr("class", CLASS.axis + ' ' + CLASS.axisY2)
+ // clip-path?
+ .attr("transform", $$.getTranslate('y2'))
+ .style("visibility", config.axis_y2_show ? 'visible' : 'hidden');
+ $$.axes.y2.append("text")
+ .attr("class", CLASS.axisY2Label)
+ .attr("transform", config.axis_rotated ? "" : "rotate(-90)")
+ .style("text-anchor", $$.textAnchorForY2AxisLabel.bind($$));
+ };
+ c3_chart_internal_fn.getXAxis = function (scale, orient, tickFormat, tickValues) {
+ var $$ = this, config = $$.config,
+ axis = c3_axis($$.d3, $$.isCategorized()).scale(scale).orient(orient);
+
+ // Set tick
+ axis.tickFormat(tickFormat).tickValues(tickValues);
+ if ($$.isCategorized()) {
+ axis.tickCentered(config.axis_x_tick_centered);
+ if (isEmpty(config.axis_x_tick_culling)) {
+ config.axis_x_tick_culling = false;
+ }
+ } else {
+ // TODO: move this to c3_axis
+ axis.tickOffset = function () {
+ var edgeX = $$.getEdgeX($$.data.targets), diff = $$.x(edgeX[1]) - $$.x(edgeX[0]),
+ base = diff ? diff : (config.axis_rotated ? $$.height : $$.width);
+ return (base / $$.getMaxDataCount()) / 2;
+ };
+ }
+
+ return axis;
+ };
+ c3_chart_internal_fn.getYAxis = function (scale, orient, tickFormat, ticks) {
+ return c3_axis(this.d3).scale(scale).orient(orient).tickFormat(tickFormat).ticks(ticks);
+ };
+ c3_chart_internal_fn.getAxisId = function (id) {
+ var config = this.config;
+ return id in config.data_axes ? config.data_axes[id] : 'y';
+ };
+ c3_chart_internal_fn.getXAxisTickFormat = function () {
+ var $$ = this, config = $$.config,
+ format = $$.isTimeSeries() ? $$.defaultAxisTimeFormat : $$.isCategorized() ? $$.categoryName : function (v) { return v < 0 ? v.toFixed(0) : v; };
+ if (config.axis_x_tick_format) {
+ if (isFunction(config.axis_x_tick_format)) {
+ format = config.axis_x_tick_format;
+ } else if ($$.isTimeSeries()) {
+ format = function (date) {
+ return date ? $$.axisTimeFormat(config.axis_x_tick_format)(date) : "";
+ };
+ }
+ }
+ return isFunction(format) ? function (v) { return format.call($$, v); } : format;
+ };
+ c3_chart_internal_fn.getAxisLabelOptionByAxisId = function (axisId) {
+ var $$ = this, config = $$.config, option;
+ if (axisId === 'y') {
+ option = config.axis_y_label;
+ } else if (axisId === 'y2') {
+ option = config.axis_y2_label;
+ } else if (axisId === 'x') {
+ option = config.axis_x_label;
+ }
+ return option;
+ };
+ c3_chart_internal_fn.getAxisLabelText = function (axisId) {
+ var option = this.getAxisLabelOptionByAxisId(axisId);
+ return isString(option) ? option : option ? option.text : null;
+ };
+ c3_chart_internal_fn.setAxisLabelText = function (axisId, text) {
+ var $$ = this, config = $$.config,
+ option = $$.getAxisLabelOptionByAxisId(axisId);
+ if (isString(option)) {
+ if (axisId === 'y') {
+ config.axis_y_label = text;
+ } else if (axisId === 'y2') {
+ config.axis_y2_label = text;
+ } else if (axisId === 'x') {
+ config.axis_x_label = text;
+ }
+ } else if (option) {
+ option.text = text;
+ }
+ };
+ c3_chart_internal_fn.getAxisLabelPosition = function (axisId, defaultPosition) {
+ var option = this.getAxisLabelOptionByAxisId(axisId),
+ position = (option && typeof option === 'object' && option.position) ? option.position : defaultPosition;
+ return {
+ isInner: position.indexOf('inner') >= 0,
+ isOuter: position.indexOf('outer') >= 0,
+ isLeft: position.indexOf('left') >= 0,
+ isCenter: position.indexOf('center') >= 0,
+ isRight: position.indexOf('right') >= 0,
+ isTop: position.indexOf('top') >= 0,
+ isMiddle: position.indexOf('middle') >= 0,
+ isBottom: position.indexOf('bottom') >= 0
+ };
+ };
+ c3_chart_internal_fn.getXAxisLabelPosition = function () {
+ return this.getAxisLabelPosition('x', this.config.axis_rotated ? 'inner-top' : 'inner-right');
+ };
+ c3_chart_internal_fn.getYAxisLabelPosition = function () {
+ return this.getAxisLabelPosition('y', this.config.axis_rotated ? 'inner-right' : 'inner-top');
+ };
+ c3_chart_internal_fn.getY2AxisLabelPosition = function () {
+ return this.getAxisLabelPosition('y2', this.config.axis_rotated ? 'inner-right' : 'inner-top');
+ };
+ c3_chart_internal_fn.getAxisLabelPositionById = function (id) {
+ return id === 'y2' ? this.getY2AxisLabelPosition() : id === 'y' ? this.getYAxisLabelPosition() : this.getXAxisLabelPosition();
+ };
+ c3_chart_internal_fn.textForXAxisLabel = function () {
+ return this.getAxisLabelText('x');
+ };
+ c3_chart_internal_fn.textForYAxisLabel = function () {
+ return this.getAxisLabelText('y');
+ };
+ c3_chart_internal_fn.textForY2AxisLabel = function () {
+ return this.getAxisLabelText('y2');
+ };
+ c3_chart_internal_fn.xForAxisLabel = function (forHorizontal, position) {
+ var $$ = this;
+ if (forHorizontal) {
+ return position.isLeft ? 0 : position.isCenter ? $$.width / 2 : $$.width;
+ } else {
+ return position.isBottom ? -$$.height : position.isMiddle ? -$$.height / 2 : 0;
+ }
+ };
+ c3_chart_internal_fn.dxForAxisLabel = function (forHorizontal, position) {
+ if (forHorizontal) {
+ return position.isLeft ? "0.5em" : position.isRight ? "-0.5em" : "0";
+ } else {
+ return position.isTop ? "-0.5em" : position.isBottom ? "0.5em" : "0";
+ }
+ };
+ c3_chart_internal_fn.textAnchorForAxisLabel = function (forHorizontal, position) {
+ if (forHorizontal) {
+ return position.isLeft ? 'start' : position.isCenter ? 'middle' : 'end';
+ } else {
+ return position.isBottom ? 'start' : position.isMiddle ? 'middle' : 'end';
+ }
+ };
+ c3_chart_internal_fn.xForXAxisLabel = function () {
+ return this.xForAxisLabel(!this.config.axis_rotated, this.getXAxisLabelPosition());
+ };
+ c3_chart_internal_fn.xForYAxisLabel = function () {
+ return this.xForAxisLabel(this.config.axis_rotated, this.getYAxisLabelPosition());
+ };
+ c3_chart_internal_fn.xForY2AxisLabel = function () {
+ return this.xForAxisLabel(this.config.axis_rotated, this.getY2AxisLabelPosition());
+ };
+ c3_chart_internal_fn.dxForXAxisLabel = function () {
+ return this.dxForAxisLabel(!this.config.axis_rotated, this.getXAxisLabelPosition());
+ };
+ c3_chart_internal_fn.dxForYAxisLabel = function () {
+ return this.dxForAxisLabel(this.config.axis_rotated, this.getYAxisLabelPosition());
+ };
+ c3_chart_internal_fn.dxForY2AxisLabel = function () {
+ return this.dxForAxisLabel(this.config.axis_rotated, this.getY2AxisLabelPosition());
+ };
+ c3_chart_internal_fn.dyForXAxisLabel = function () {
+ var $$ = this, config = $$.config,
+ position = $$.getXAxisLabelPosition();
+ if (config.axis_rotated) {
+ return position.isInner ? "1.2em" : -25 - $$.getMaxTickWidth('x');
+ } else {
+ return position.isInner ? "-0.5em" : config.axis_x_height ? config.axis_x_height - 10 : "3em";
+ }
+ };
+ c3_chart_internal_fn.dyForYAxisLabel = function () {
+ var $$ = this,
+ position = $$.getYAxisLabelPosition();
+ if ($$.config.axis_rotated) {
+ return position.isInner ? "-0.5em" : "3em";
+ } else {
+ return position.isInner ? "1.2em" : -20 - $$.getMaxTickWidth('y');
+ }
+ };
+ c3_chart_internal_fn.dyForY2AxisLabel = function () {
+ var $$ = this,
+ position = $$.getY2AxisLabelPosition();
+ if ($$.config.axis_rotated) {
+ return position.isInner ? "1.2em" : "-2.2em";
+ } else {
+ return position.isInner ? "-0.5em" : 30 + this.getMaxTickWidth('y2');
+ }
+ };
+ c3_chart_internal_fn.textAnchorForXAxisLabel = function () {
+ var $$ = this;
+ return $$.textAnchorForAxisLabel(!$$.config.axis_rotated, $$.getXAxisLabelPosition());
+ };
+ c3_chart_internal_fn.textAnchorForYAxisLabel = function () {
+ var $$ = this;
+ return $$.textAnchorForAxisLabel($$.config.axis_rotated, $$.getYAxisLabelPosition());
+ };
+ c3_chart_internal_fn.textAnchorForY2AxisLabel = function () {
+ var $$ = this;
+ return $$.textAnchorForAxisLabel($$.config.axis_rotated, $$.getY2AxisLabelPosition());
+ };
+
+ c3_chart_internal_fn.xForRotatedTickText = function (r) {
+ return 10 * Math.sin(Math.PI * (r / 180));
+ };
+ c3_chart_internal_fn.yForRotatedTickText = function (r) {
+ return 11.5 - 2.5 * (r / 15);
+ };
+ c3_chart_internal_fn.rotateTickText = function (axis, transition, rotate) {
+ axis.selectAll('.tick text')
+ .style("text-anchor", "start");
+ transition.selectAll('.tick text')
+ .attr("y", this.yForRotatedTickText(rotate))
+ .attr("x", this.xForRotatedTickText(rotate))
+ .attr("transform", "rotate(" + rotate + ")");
+ };
+
+ c3_chart_internal_fn.getMaxTickWidth = function (id) {
+ var $$ = this, config = $$.config,
+ maxWidth = 0, targetsToShow, scale, axis;
+ if ($$.svg) {
+ targetsToShow = $$.filterTargetsToShow($$.data.targets);
+ if (id === 'y') {
+ scale = $$.y.copy().domain($$.getYDomain(targetsToShow, 'y'));
+ axis = $$.getYAxis(scale, $$.yOrient, config.axis_y_tick_format, config.axis_y_ticks);
+ } else if (id === 'y2') {
+ scale = $$.y2.copy().domain($$.getYDomain(targetsToShow, 'y2'));
+ axis = $$.getYAxis(scale, $$.y2Orient, config.axis_y2_tick_format, config.axis_y2_ticks);
+ } else {
+ scale = $$.x.copy().domain($$.getXDomain(targetsToShow));
+ axis = $$.getXAxis(scale, $$.xOrient, $$.getXAxisTickFormat(), config.axis_x_tick_values ? config.axis_x_tick_values : $$.xAxis.tickValues());
+ }
+ $$.main.append("g").call(axis).each(function () {
+ $$.d3.select(this).selectAll('text').each(function () {
+ var box = this.getBoundingClientRect();
+ if (maxWidth < box.width) { maxWidth = box.width; }
+ });
+ }).remove();
+ }
+ $$.currentMaxTickWidth = maxWidth <= 0 ? $$.currentMaxTickWidth : maxWidth;
+ return $$.currentMaxTickWidth;
+ };
+
+ c3_chart_internal_fn.updateAxisLabels = function (withTransition) {
+ var $$ = this;
+ var axisXLabel = $$.main.select('.' + CLASS.axisX + ' .' + CLASS.axisXLabel),
+ axisYLabel = $$.main.select('.' + CLASS.axisY + ' .' + CLASS.axisYLabel),
+ axisY2Label = $$.main.select('.' + CLASS.axisY2 + ' .' + CLASS.axisY2Label);
+ (withTransition ? axisXLabel.transition() : axisXLabel)
+ .attr("x", $$.xForXAxisLabel.bind($$))
+ .attr("dx", $$.dxForXAxisLabel.bind($$))
+ .attr("dy", $$.dyForXAxisLabel.bind($$))
+ .text($$.textForXAxisLabel.bind($$));
+ (withTransition ? axisYLabel.transition() : axisYLabel)
+ .attr("x", $$.xForYAxisLabel.bind($$))
+ .attr("dx", $$.dxForYAxisLabel.bind($$))
+ .attr("dy", $$.dyForYAxisLabel.bind($$))
+ .text($$.textForYAxisLabel.bind($$));
+ (withTransition ? axisY2Label.transition() : axisY2Label)
+ .attr("x", $$.xForY2AxisLabel.bind($$))
+ .attr("dx", $$.dxForY2AxisLabel.bind($$))
+ .attr("dy", $$.dyForY2AxisLabel.bind($$))
+ .text($$.textForY2AxisLabel.bind($$));
+ };
+
+ c3_chart_internal_fn.getAxisPadding = function (padding, key, defaultValue, all) {
+ var ratio = padding.unit === 'ratio' ? all : 1;
+ return isValue(padding[key]) ? padding[key] * ratio : defaultValue;
+ };
+
+ c3_chart_internal_fn.generateTickValues = function (xs, tickCount) {
+ var $$ = this;
+ var tickValues = xs, targetCount, start, end, count, interval, i, tickValue;
+ if (tickCount) {
+ targetCount = isFunction(tickCount) ? tickCount() : tickCount;
+ // compute ticks according to $$.config.axis_x_tick_count
+ if (targetCount === 1) {
+ tickValues = [xs[0]];
+ } else if (targetCount === 2) {
+ tickValues = [xs[0], xs[xs.length - 1]];
+ } else if (targetCount > 2) {
+ count = targetCount - 2;
+ start = xs[0];
+ end = xs[xs.length - 1];
+ interval = (end - start) / (count + 1);
+ // re-construct uniqueXs
+ tickValues = [start];
+ for (i = 0; i < count; i++) {
+ tickValue = +start + interval * (i + 1);
+ tickValues.push($$.isTimeSeries() ? new Date(tickValue) : tickValue);
+ }
+ tickValues.push(end);
+ }
+ }
+ if (!$$.isTimeSeries()) { tickValues = tickValues.sort(function (a, b) { return a - b; }); }
+ return tickValues;
+ };
+ c3_chart_internal_fn.generateAxisTransitions = function (duration) {
+ var $$ = this, axes = $$.axes;
+ return {
+ axisX: duration ? axes.x.transition().duration(duration) : axes.x,
+ axisY: duration ? axes.y.transition().duration(duration) : axes.y,
+ axisY2: duration ? axes.y2.transition().duration(duration) : axes.y2,
+ axisSubX: duration ? axes.subx.transition().duration(duration) : axes.subx
+ };
+ };
+ c3_chart_internal_fn.redrawAxis = function (transitions, isHidden) {
+ var $$ = this;
+ $$.axes.x.style("opacity", isHidden ? 0 : 1);
+ $$.axes.y.style("opacity", isHidden ? 0 : 1);
+ $$.axes.y2.style("opacity", isHidden ? 0 : 1);
+ $$.axes.subx.style("opacity", isHidden ? 0 : 1);
+ transitions.axisX.call($$.xAxis);
+ transitions.axisY.call($$.yAxis);
+ transitions.axisY2.call($$.y2Axis);
+ transitions.axisSubX.call($$.subXAxis);
+ };
+
+ c3_chart_internal_fn.getClipPath = function (id) {
+ var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
+ return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
+ };
+ c3_chart_internal_fn.getAxisClipX = function (forHorizontal) {
+ // axis line width + padding for left
+ return forHorizontal ? -(1 + 30) : -(this.margin.left - 1);
+ };
+ c3_chart_internal_fn.getAxisClipY = function (forHorizontal) {
+ return forHorizontal ? -20 : -4;
+ };
+ c3_chart_internal_fn.getXAxisClipX = function () {
+ var $$ = this;
+ return $$.getAxisClipX(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getXAxisClipY = function () {
+ var $$ = this;
+ return $$.getAxisClipY(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipX = function () {
+ var $$ = this;
+ return $$.getAxisClipX($$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipY = function () {
+ var $$ = this;
+ return $$.getAxisClipY($$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getAxisClipWidth = function (forHorizontal) {
+ var $$ = this;
+ // width + axis line width + padding for left/right
+ return forHorizontal ? $$.width + 2 + 30 + 30 : $$.margin.left + 20;
+ };
+ c3_chart_internal_fn.getAxisClipHeight = function (forHorizontal) {
+ var $$ = this, config = $$.config;
+ return forHorizontal ? (config.axis_x_height ? config.axis_x_height : 0) + 80 : $$.height + 8;
+ };
+ c3_chart_internal_fn.getXAxisClipWidth = function () {
+ var $$ = this;
+ return $$.getAxisClipWidth(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getXAxisClipHeight = function () {
+ var $$ = this;
+ return $$.getAxisClipHeight(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipWidth = function () {
+ var $$ = this;
+ return $$.getAxisClipWidth($$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipHeight = function () {
+ var $$ = this;
+ return $$.getAxisClipHeight($$.config.axis_rotated);
+ };
+
+ c3_chart_internal_fn.initPie = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ $$.pie = d3.layout.pie().value(function (d) {
+ return d.values.reduce(function (a, b) { return a + b.value; }, 0);
+ });
+ if (!config.data_order || !config.pie_sort || !config.donut_sort) {
+ $$.pie.sort(null);
+ }
+ };
+
+ c3_chart_internal_fn.updateRadius = function () {
+ var $$ = this, config = $$.config,
+ w = config.gauge_width || config.donut_width;
+ $$.radiusExpanded = Math.min($$.arcWidth, $$.arcHeight) / 2;
+ $$.radius = $$.radiusExpanded * 0.95;
+ $$.innerRadiusRatio = w ? ($$.radius - w) / $$.radius : 0.6;
+ $$.innerRadius = $$.hasType('donut') || $$.hasType('gauge') ? $$.radius * $$.innerRadiusRatio : 0;
+ };
+
+ c3_chart_internal_fn.updateArc = function () {
+ var $$ = this;
+ $$.svgArc = $$.getSvgArc();
+ $$.svgArcExpanded = $$.getSvgArcExpanded();
+ $$.svgArcExpandedSub = $$.getSvgArcExpanded(0.98);
+ };
+
+ c3_chart_internal_fn.updateAngle = function (d) {
+ var $$ = this, config = $$.config,
+ found = false, index = 0;
+ $$.pie($$.filterTargetsToShow($$.data.targets)).sort($$.descByStartAngle).forEach(function (t) {
+ if (! found && t.data.id === d.data.id) {
+ found = true;
+ d = t;
+ d.index = index;
+ }
+ index++;
+ });
+ if (isNaN(d.endAngle)) {
+ d.endAngle = d.startAngle;
+ }
+ if ($$.isGaugeType(d.data)) {
+ var gMin = config.gauge_min, gMax = config.gauge_max,
+ gF = Math.abs(gMin) + gMax,
+ aTic = (Math.PI) / gF;
+ d.startAngle = (-1 * (Math.PI / 2)) + (aTic * Math.abs(gMin));
+ d.endAngle = d.startAngle + (aTic * ((d.value > gMax) ? gMax : d.value));
+ }
+ return found ? d : null;
+ };
+
+ c3_chart_internal_fn.getSvgArc = function () {
+ var $$ = this,
+ arc = $$.d3.svg.arc().outerRadius($$.radius).innerRadius($$.innerRadius),
+ newArc = function (d, withoutUpdate) {
+ var updated;
+ if (withoutUpdate) { return arc(d); } // for interpolate
+ updated = $$.updateAngle(d);
+ return updated ? arc(updated) : "M 0 0";
+ };
+ // TODO: extends all function
+ newArc.centroid = arc.centroid;
+ return newArc;
+ };
+
+ c3_chart_internal_fn.getSvgArcExpanded = function (rate) {
+ var $$ = this,
+ arc = $$.d3.svg.arc().outerRadius($$.radiusExpanded * (rate ? rate : 1)).innerRadius($$.innerRadius);
+ return function (d) {
+ var updated = $$.updateAngle(d);
+ return updated ? arc(updated) : "M 0 0";
+ };
+ };
+
+ c3_chart_internal_fn.getArc = function (d, withoutUpdate, force) {
+ return force || this.isArcType(d.data) ? this.svgArc(d, withoutUpdate) : "M 0 0";
+ };
+
+
+ c3_chart_internal_fn.transformForArcLabel = function (d) {
+ var $$ = this,
+ updated = $$.updateAngle(d), c, x, y, h, ratio, translate = "";
+ if (updated && !$$.hasType('gauge')) {
+ c = this.svgArc.centroid(updated);
+ x = isNaN(c[0]) ? 0 : c[0];
+ y = isNaN(c[1]) ? 0 : c[1];
+ h = Math.sqrt(x * x + y * y);
+ // TODO: ratio should be an option?
+ ratio = $$.radius && h ? (36 / $$.radius > 0.375 ? 1.175 - 36 / $$.radius : 0.8) * $$.radius / h : 0;
+ translate = "translate(" + (x * ratio) + ',' + (y * ratio) + ")";
+ }
+ return translate;
+ };
+
+ c3_chart_internal_fn.getArcRatio = function (d) {
+ var $$ = this,
+ whole = $$.hasType('gauge') ? Math.PI : (Math.PI * 2);
+ return d ? (d.endAngle - d.startAngle) / whole : null;
+ };
+
+ c3_chart_internal_fn.convertToArcData = function (d) {
+ return this.addName({
+ id: d.data.id,
+ value: d.value,
+ ratio: this.getArcRatio(d),
+ index: d.index
+ });
+ };
+
+ c3_chart_internal_fn.textForArcLabel = function (d) {
+ var $$ = this,
+ updated, value, ratio, format;
+ if (! $$.shouldShowArcLabel()) { return ""; }
+ updated = $$.updateAngle(d);
+ value = updated ? updated.value : null;
+ ratio = $$.getArcRatio(updated);
+ if (! $$.hasType('gauge') && ! $$.meetsArcLabelThreshold(ratio)) { return ""; }
+ format = $$.getArcLabelFormat();
+ return format ? format(value, ratio) : $$.defaultArcValueFormat(value, ratio);
+ };
+
+ c3_chart_internal_fn.expandArc = function (id, withoutFadeOut) {
+ var $$ = this,
+ target = $$.svg.selectAll('.' + CLASS.chartArc + $$.selectorTarget(id)),
+ noneTargets = $$.svg.selectAll('.' + CLASS.arc).filter(function (data) { return data.data.id !== id; });
+
+ if ($$.shouldExpand(id)) {
+ target.selectAll('path')
+ .transition().duration(50)
+ .attr("d", $$.svgArcExpanded)
+ .transition().duration(100)
+ .attr("d", $$.svgArcExpandedSub)
+ .each(function (d) {
+ if ($$.isDonutType(d.data)) {
+ // callback here
+ }
+ });
+ }
+ if (!withoutFadeOut) {
+ noneTargets.style("opacity", 0.3);
+ }
+ };
+
+ c3_chart_internal_fn.unexpandArc = function (id) {
+ var $$ = this,
+ target = $$.svg.selectAll('.' + CLASS.chartArc + $$.selectorTarget(id));
+ target.selectAll('path.' + CLASS.arc)
+ .transition().duration(50)
+ .attr("d", $$.svgArc);
+ $$.svg.selectAll('.' + CLASS.arc)
+ .style("opacity", 1);
+ };
+
+ c3_chart_internal_fn.shouldExpand = function (id) {
+ var $$ = this, config = $$.config;
+ return ($$.isDonutType(id) && config.donut_expand) || ($$.isGaugeType(id) && config.gauge_expand) || ($$.isPieType(id) && config.pie_expand);
+ };
+
+ c3_chart_internal_fn.shouldShowArcLabel = function () {
+ var $$ = this, config = $$.config, shouldShow = true;
+ if ($$.hasType('donut')) {
+ shouldShow = config.donut_label_show;
+ } else if ($$.hasType('pie')) {
+ shouldShow = config.pie_label_show;
+ }
+ // when gauge, always true
+ return shouldShow;
+ };
+
+ c3_chart_internal_fn.meetsArcLabelThreshold = function (ratio) {
+ var $$ = this, config = $$.config,
+ threshold = $$.hasType('donut') ? config.donut_label_threshold : config.pie_label_threshold;
+ return ratio >= threshold;
+ };
+
+ c3_chart_internal_fn.getArcLabelFormat = function () {
+ var $$ = this, config = $$.config,
+ format = config.pie_label_format;
+ if ($$.hasType('gauge')) {
+ format = config.gauge_label_format;
+ } else if ($$.hasType('donut')) {
+ format = config.donut_label_format;
+ }
+ return format;
+ };
+
+ c3_chart_internal_fn.getArcTitle = function () {
+ var $$ = this;
+ return $$.hasType('donut') ? $$.config.donut_title : "";
+ };
+
+ c3_chart_internal_fn.descByStartAngle = function (a, b) {
+ return a.startAngle - b.startAngle;
+ };
+
+ c3_chart_internal_fn.updateTargetsForArc = function (targets) {
+ var $$ = this, main = $$.main,
+ mainPieUpdate, mainPieEnter,
+ classChartArc = $$.classChartArc.bind($$),
+ classArcs = $$.classArcs.bind($$);
+ mainPieUpdate = main.select('.' + CLASS.chartArcs).selectAll('.' + CLASS.chartArc)
+ .data($$.pie(targets))
+ .attr("class", classChartArc);
+ mainPieEnter = mainPieUpdate.enter().append("g")
+ .attr("class", classChartArc);
+ mainPieEnter.append('g')
+ .attr('class', classArcs);
+ mainPieEnter.append("text")
+ .attr("dy", $$.hasType('gauge') ? "-0.35em" : ".35em")
+ .style("opacity", 0)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none");
+ // MEMO: can not keep same color..., but not bad to update color in redraw
+ //mainPieUpdate.exit().remove();
+ };
+
+ c3_chart_internal_fn.initArc = function () {
+ var $$ = this;
+ $$.arcs = $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartArcs)
+ .attr("transform", $$.getTranslate('arc'));
+ $$.arcs.append('text')
+ .attr('class', CLASS.chartArcsTitle)
+ .style("text-anchor", "middle")
+ .text($$.getArcTitle());
+ };
+
+ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransform) {
+ var $$ = this, d3 = $$.d3, config = $$.config, main = $$.main,
+ mainArc;
+ mainArc = main.selectAll('.' + CLASS.arcs).selectAll('.' + CLASS.arc)
+ .data($$.arcData.bind($$));
+ mainArc.enter().append('path')
+ .attr("class", $$.classArc.bind($$))
+ .style("fill", function (d) { return $$.color(d.data); })
+ .style("cursor", function (d) { return config.data_selection_isselectable(d) ? "pointer" : null; })
+ .style("opacity", 0)
+ .each(function (d) {
+ if ($$.isGaugeType(d.data)) {
+ d.startAngle = d.endAngle = -1 * (Math.PI / 2);
+ }
+ this._current = d;
+ })
+ .on('mouseover', function (d) {
+ var updated, arcData;
+ if ($$.transiting) { // skip while transiting
+ return;
+ }
+ updated = $$.updateAngle(d);
+ arcData = $$.convertToArcData(updated);
+ // transitions
+ $$.expandArc(updated.data.id);
+ $$.toggleFocusLegend(updated.data.id, true);
+ $$.config.data_onmouseover(arcData, this);
+ })
+ .on('mousemove', function (d) {
+ var updated = $$.updateAngle(d),
+ arcData = $$.convertToArcData(updated),
+ selectedData = [arcData];
+ $$.showTooltip(selectedData, d3.mouse(this));
+ })
+ .on('mouseout', function (d) {
+ var updated, arcData;
+ if ($$.transiting) { // skip while transiting
+ return;
+ }
+ updated = $$.updateAngle(d);
+ arcData = $$.convertToArcData(updated);
+ // transitions
+ $$.unexpandArc(updated.data.id);
+ $$.revertLegend();
+ $$.hideTooltip();
+ $$.config.data_onmouseout(arcData, this);
+ })
+ .on('click', function (d, i) {
+ var updated, arcData;
+ if (!$$.toggleShape) {
+ return;
+ }
+ updated = $$.updateAngle(d);
+ arcData = $$.convertToArcData(updated);
+ $$.toggleShape(this, arcData, i); // onclick called in toogleShape()
+ });
+ mainArc
+ .attr("transform", function (d) { return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : ""; })
+ .style("opacity", function (d) { return d === this._current ? 0 : 1; })
+ .each(function () { $$.transiting = true; })
+ .transition().duration(duration)
+ .attrTween("d", function (d) {
+ var updated = $$.updateAngle(d), interpolate;
+ if (! updated) {
+ return function () { return "M 0 0"; };
+ }
+ // if (this._current === d) {
+ // this._current = {
+ // startAngle: Math.PI*2,
+ // endAngle: Math.PI*2,
+ // };
+ // }
+ if (isNaN(this._current.endAngle)) {
+ this._current.endAngle = this._current.startAngle;
+ }
+ interpolate = d3.interpolate(this._current, updated);
+ this._current = interpolate(0);
+ return function (t) { return $$.getArc(interpolate(t), true); };
+ })
+ .attr("transform", withTransform ? "scale(1)" : "")
+ .style("fill", function (d) {
+ return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
+ }) // Where gauge reading color would receive customization.
+ .style("opacity", 1)
+ .call($$.endall, function () {
+ $$.transiting = false;
+ });
+ mainArc.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ main.selectAll('.' + CLASS.chartArc).select('text')
+ .style("opacity", 0)
+ .attr('class', function (d) { return $$.isGaugeType(d.data) ? CLASS.gaugeValue : ''; })
+ .text($$.textForArcLabel.bind($$))
+ .attr("transform", $$.transformForArcLabel.bind($$))
+ .transition().duration(duration)
+ .style("opacity", function (d) { return $$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? 1 : 0; });
+ main.select('.' + CLASS.chartArcsTitle)
+ .style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0);
+
+ };
+ c3_chart_internal_fn.initGauge = function () {
+ var $$ = this, config = $$.config, arcs = $$.arcs;
+ if ($$.hasType('gauge')) {
+ arcs.append('path')
+ .attr("class", CLASS.chartArcsBackground)
+ .attr("d", function () {
+ var d = {
+ data: [{value: config.gauge_max}],
+ startAngle: -1 * (Math.PI / 2),
+ endAngle: Math.PI / 2
+ };
+ return $$.getArc(d, true, true);
+ });
+ arcs.append("text")
+ .attr("dy", ".75em")
+ .attr("class", CLASS.chartArcsGaugeUnit)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none")
+ .text(config.gauge_label_show ? config.gauge_units : '');
+ arcs.append("text")
+ .attr("dx", -1 * ($$.innerRadius + (($$.radius - $$.innerRadius) / 2)) + "px")
+ .attr("dy", "1.2em")
+ .attr("class", CLASS.chartArcsGaugeMin)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none")
+ .text(config.gauge_label_show ? config.gauge_min : '');
+ arcs.append("text")
+ .attr("dx", $$.innerRadius + (($$.radius - $$.innerRadius) / 2) + "px")
+ .attr("dy", "1.2em")
+ .attr("class", CLASS.chartArcsGaugeMax)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none")
+ .text(config.gauge_label_show ? config.gauge_max : '');
+ }
+ };
+
+ c3_chart_internal_fn.initRegion = function () {
+ var $$ = this;
+ $$.main.append('g')
+ .attr("clip-path", $$.clipPath)
+ .attr("class", CLASS.regions);
+ };
+ c3_chart_internal_fn.redrawRegion = function (duration) {
+ var $$ = this, config = $$.config;
+ $$.mainRegion = $$.main.select('.' + CLASS.regions).selectAll('.' + CLASS.region)
+ .data(config.regions);
+ $$.mainRegion.enter().append('g')
+ .attr('class', $$.classRegion.bind($$))
+ .append('rect')
+ .style("fill-opacity", 0);
+ $$.mainRegion.exit().transition().duration(duration)
+ .style("opacity", 0)
+ .remove();
+ };
+ c3_chart_internal_fn.addTransitionForRegion = function (transitions) {
+ var $$ = this,
+ x = $$.regionX.bind($$),
+ y = $$.regionY.bind($$),
+ w = $$.regionWidth.bind($$),
+ h = $$.regionHeight.bind($$);
+ transitions.push($$.mainRegion.selectAll('rect').transition()
+ .attr("x", x)
+ .attr("y", y)
+ .attr("width", w)
+ .attr("height", h)
+ .style("fill-opacity", function (d) { return isValue(d.opacity) ? d.opacity : 0.1; }));
+ };
+ c3_chart_internal_fn.regionX = function (d) {
+ var $$ = this, config = $$.config,
+ xPos, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ xPos = config.axis_rotated ? ('start' in d ? yScale(d.start) : 0) : 0;
+ } else {
+ xPos = config.axis_rotated ? 0 : ('start' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.start) : d.start) : 0);
+ }
+ return xPos;
+ };
+ c3_chart_internal_fn.regionY = function (d) {
+ var $$ = this, config = $$.config,
+ yPos, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ yPos = config.axis_rotated ? 0 : ('end' in d ? yScale(d.end) : 0);
+ } else {
+ yPos = config.axis_rotated ? ('start' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.start) : d.start) : 0) : 0;
+ }
+ return yPos;
+ };
+ c3_chart_internal_fn.regionWidth = function (d) {
+ var $$ = this, config = $$.config,
+ start = $$.regionX(d), end, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ end = config.axis_rotated ? ('end' in d ? yScale(d.end) : $$.width) : $$.width;
+ } else {
+ end = config.axis_rotated ? $$.width : ('end' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.end) : d.end) : $$.width);
+ }
+ return end < start ? 0 : end - start;
+ };
+ c3_chart_internal_fn.regionHeight = function (d) {
+ var $$ = this, config = $$.config,
+ start = this.regionY(d), end, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ end = config.axis_rotated ? $$.height : ('start' in d ? yScale(d.start) : $$.height);
+ } else {
+ end = config.axis_rotated ? ('end' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.end) : d.end) : $$.height) : $$.height;
+ }
+ return end < start ? 0 : end - start;
+ };
+ c3_chart_internal_fn.isRegionOnX = function (d) {
+ return !d.axis || d.axis === 'x';
+ };
+
+ c3_chart_internal_fn.drag = function (mouse) {
+ var $$ = this, config = $$.config, main = $$.main, d3 = $$.d3;
+ var sx, sy, mx, my, minX, maxX, minY, maxY;
+
+ if ($$.hasArcType()) { return; }
+ if (! config.data_selection_enabled) { return; } // do nothing if not selectable
+ if (config.zoom_enabled && ! $$.zoom.altDomain) { return; } // skip if zoomable because of conflict drag dehavior
+ if (!config.data_selection_multiple) { return; } // skip when single selection because drag is used for multiple selection
+
+ sx = $$.dragStart[0];
+ sy = $$.dragStart[1];
+ mx = mouse[0];
+ my = mouse[1];
+ minX = Math.min(sx, mx);
+ maxX = Math.max(sx, mx);
+ minY = (config.data_selection_grouped) ? $$.margin.top : Math.min(sy, my);
+ maxY = (config.data_selection_grouped) ? $$.height : Math.max(sy, my);
+
+ main.select('.' + CLASS.dragarea)
+ .attr('x', minX)
+ .attr('y', minY)
+ .attr('width', maxX - minX)
+ .attr('height', maxY - minY);
+ // TODO: binary search when multiple xs
+ main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape)
+ .filter(function (d) { return config.data_selection_isselectable(d); })
+ .each(function (d, i) {
+ var shape = d3.select(this),
+ isSelected = shape.classed(CLASS.SELECTED),
+ isIncluded = shape.classed(CLASS.INCLUDED),
+ _x, _y, _w, _h, toggle, isWithin = false, box;
+ if (shape.classed(CLASS.circle)) {
+ _x = shape.attr("cx") * 1;
+ _y = shape.attr("cy") * 1;
+ toggle = $$.togglePoint;
+ isWithin = minX < _x && _x < maxX && minY < _y && _y < maxY;
+ }
+ else if (shape.classed(CLASS.bar)) {
+ box = getPathBox(this);
+ _x = box.x;
+ _y = box.y;
+ _w = box.width;
+ _h = box.height;
+ toggle = $$.toggleBar;
+ isWithin = !(maxX < _x || _x + _w < minX) && !(maxY < _y || _y + _h < minY);
+ } else {
+ // line/area selection not supported yet
+ return;
+ }
+ if (isWithin ^ isIncluded) {
+ shape.classed(CLASS.INCLUDED, !isIncluded);
+ // TODO: included/unincluded callback here
+ shape.classed(CLASS.SELECTED, !isSelected);
+ toggle.call($$, !isSelected, shape, d, i);
+ }
+ });
+ };
+
+ c3_chart_internal_fn.dragstart = function (mouse) {
+ var $$ = this, config = $$.config;
+ if ($$.hasArcType()) { return; }
+ if (! config.data_selection_enabled) { return; } // do nothing if not selectable
+ $$.dragStart = mouse;
+ $$.main.select('.' + CLASS.chart).append('rect')
+ .attr('class', CLASS.dragarea)
+ .style('opacity', 0.1);
+ $$.dragging = true;
+ $$.config.data_ondragstart();
+ };
+
+ c3_chart_internal_fn.dragend = function () {
+ var $$ = this, config = $$.config;
+ if ($$.hasArcType()) { return; }
+ if (! config.data_selection_enabled) { return; } // do nothing if not selectable
+ $$.main.select('.' + CLASS.dragarea)
+ .transition().duration(100)
+ .style('opacity', 0)
+ .remove();
+ $$.main.selectAll('.' + CLASS.shape)
+ .classed(CLASS.INCLUDED, false);
+ $$.dragging = false;
+ $$.config.data_ondragend();
+ };
+
+
+ c3_chart_internal_fn.selectPoint = function (target, d, i) {
+ var $$ = this, config = $$.config,
+ cx = (config.axis_rotated ? $$.circleY : $$.circleX).bind($$),
+ cy = (config.axis_rotated ? $$.circleX : $$.circleY).bind($$),
+ r = $$.pointSelectR.bind($$);
+ config.data_onselected.call($$.api, d, target.node());
+ // add selected-circle on low layer g
+ $$.main.select('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS.selectedCircle + '-' + i)
+ .data([d])
+ .enter().append('circle')
+ .attr("class", function () { return $$.generateClass(CLASS.selectedCircle, i); })
+ .attr("cx", cx)
+ .attr("cy", cy)
+ .attr("stroke", function () { return $$.color(d); })
+ .attr("r", function (d) { return $$.pointSelectR(d) * 1.4; })
+ .transition().duration(100)
+ .attr("r", r);
+ };
+ c3_chart_internal_fn.unselectPoint = function (target, d, i) {
+ var $$ = this;
+ $$.config.data_onunselected(d, target.node());
+ // remove selected-circle from low layer g
+ $$.main.select('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS.selectedCircle + '-' + i)
+ .transition().duration(100).attr('r', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.togglePoint = function (selected, target, d, i) {
+ selected ? this.selectPoint(target, d, i) : this.unselectPoint(target, d, i);
+ };
+ c3_chart_internal_fn.selectBar = function (target, d) {
+ var $$ = this;
+ $$.config.data_onselected.call($$, d, target.node());
+ target.transition().duration(100)
+ .style("fill", function () { return $$.d3.rgb($$.color(d)).brighter(0.75); });
+ };
+ c3_chart_internal_fn.unselectBar = function (target, d) {
+ var $$ = this;
+ $$.config.data_onunselected.call($$, d, target.node());
+ target.transition().duration(100)
+ .style("fill", function () { return $$.color(d); });
+ };
+ c3_chart_internal_fn.toggleBar = function (selected, target, d, i) {
+ selected ? this.selectBar(target, d, i) : this.unselectBar(target, d, i);
+ };
+ c3_chart_internal_fn.toggleArc = function (selected, target, d, i) {
+ this.toggleBar(selected, target, d.data, i);
+ };
+ c3_chart_internal_fn.getToggle = function (that) {
+ var $$ = this;
+ // path selection not supported yet
+ return that.nodeName === 'circle' ? $$.togglePoint : ($$.d3.select(that).classed(CLASS.bar) ? $$.toggleBar : $$.toggleArc);
+ };
+ c3_chart_internal_fn.toggleShape = function (that, d, i) {
+ var $$ = this, d3 = $$.d3, config = $$.config,
+ shape = d3.select(that), isSelected = shape.classed(CLASS.SELECTED), isWithin, toggle;
+ if (that.nodeName === 'circle') {
+ isWithin = $$.isWithinCircle(that, $$.pointSelectR(d) * 1.5);
+ toggle = $$.togglePoint;
+ }
+ else if (that.nodeName === 'path') {
+ if (shape.classed(CLASS.bar)) {
+ isWithin = $$.isWithinBar(that);
+ toggle = $$.toggleBar;
+ } else { // would be arc
+ isWithin = true;
+ toggle = $$.toggleArc;
+ }
+ }
+ if (config.data_selection_grouped || isWithin) {
+ if (config.data_selection_enabled && config.data_selection_isselectable(d)) {
+ if (!config.data_selection_multiple) {
+ $$.main.selectAll('.' + CLASS.shapes + (config.data_selection_grouped ? $$.getTargetSelectorSuffix(d.id) : "")).selectAll('.' + CLASS.shape).each(function (d, i) {
+ var shape = d3.select(this);
+ if (shape.classed(CLASS.SELECTED)) { toggle.call($$, false, shape.classed(CLASS.SELECTED, false), d, i); }
+ });
+ }
+ shape.classed(CLASS.SELECTED, !isSelected);
+ toggle.call($$, !isSelected, shape, d, i);
+ }
+ $$.config.data_onclick.call($$.api, d, that);
+ }
+ };
+
+ c3_chart_internal_fn.initBrush = function () {
+ var $$ = this, d3 = $$.d3;
+ $$.brush = d3.svg.brush().on("brush", function () { $$.redrawForBrush(); });
+ $$.brush.update = function () {
+ if ($$.context) { $$.context.select('.' + CLASS.brush).call(this); }
+ return this;
+ };
+ $$.brush.scale = function (scale) {
+ return $$.config.axis_rotated ? this.y(scale) : this.x(scale);
+ };
+ };
+ c3_chart_internal_fn.initSubchart = function () {
+ var $$ = this, config = $$.config,
+ context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context'));
+
+ if (!config.subchart_show) {
+ context.style('visibility', 'hidden');
+ }
+
+ // Define g for chart area
+ context.append('g')
+ .attr("clip-path", $$.clipPath)
+ .attr('class', CLASS.chart);
+
+ // Define g for bar chart area
+ context.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartBars);
+
+ // Define g for line chart area
+ context.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartLines);
+
+ // Add extent rect for Brush
+ context.append("g")
+ .attr("clip-path", $$.clipPath)
+ .attr("class", CLASS.brush)
+ .call($$.brush)
+ .selectAll("rect")
+ .attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? $$.width2 : $$.height2);
+
+ // ATTENTION: This must be called AFTER chart added
+ // Add Axis
+ $$.axes.subx = context.append("g")
+ .attr("class", CLASS.axisX)
+ .attr("transform", $$.getTranslate('subx'))
+ .attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis);
+ };
+ c3_chart_internal_fn.updateTargetsForSubchart = function (targets) {
+ var $$ = this, context = $$.context, config = $$.config,
+ contextLineEnter, contextLineUpdate, contextBarEnter, contextBarUpdate,
+ classChartBar = $$.classChartBar.bind($$),
+ classBars = $$.classBars.bind($$),
+ classChartLine = $$.classChartLine.bind($$),
+ classLines = $$.classLines.bind($$),
+ classAreas = $$.classAreas.bind($$);
+
+ if (config.subchart_show) {
+ contextBarUpdate = context.select('.' + CLASS.chartBars).selectAll('.' + CLASS.chartBar)
+ .data(targets)
+ .attr('class', classChartBar);
+ contextBarEnter = contextBarUpdate.enter().append('g')
+ .style('opacity', 0)
+ .attr('class', classChartBar);
+ // Bars for each data
+ contextBarEnter.append('g')
+ .attr("class", classBars);
+
+ //-- Line --//
+ contextLineUpdate = context.select('.' + CLASS.chartLines).selectAll('.' + CLASS.chartLine)
+ .data(targets)
+ .attr('class', classChartLine);
+ contextLineEnter = contextLineUpdate.enter().append('g')
+ .style('opacity', 0)
+ .attr('class', classChartLine);
+ // Lines for each data
+ contextLineEnter.append("g")
+ .attr("class", classLines);
+ // Area
+ contextLineEnter.append("g")
+ .attr("class", classAreas);
+ }
+ };
+ c3_chart_internal_fn.redrawSubchart = function (withSubchart, transitions, duration, durationForExit, areaIndices, barIndices, lineIndices) {
+ var $$ = this, d3 = $$.d3, context = $$.context, config = $$.config,
+ contextLine, contextArea, contextBar, drawAreaOnSub, drawBarOnSub, drawLineOnSub,
+ barData = $$.barData.bind($$),
+ lineData = $$.lineData.bind($$),
+ classBar = $$.classBar.bind($$),
+ classLine = $$.classLine.bind($$),
+ classArea = $$.classArea.bind($$),
+ initialOpacity = $$.initialOpacity.bind($$);
+
+ // subchart
+ if (config.subchart_show) {
+ // reflect main chart to extent on subchart if zoomed
+ if (d3.event && d3.event.type === 'zoom') {
+ $$.brush.extent($$.x.orgDomain()).update();
+ }
+ // update subchart elements if needed
+ if (withSubchart) {
+
+ // rotate tick text if needed
+ if (!config.axis_rotated && config.axis_x_tick_rotate) {
+ $$.rotateTickText($$.axes.subx, transitions.axisSubX, config.axis_x_tick_rotate);
+ }
+
+ // extent rect
+ if (!$$.brush.empty()) {
+ $$.brush.extent($$.x.orgDomain()).update();
+ }
+ // setup drawer - MEMO: this must be called after axis updated
+ drawAreaOnSub = $$.generateDrawArea(areaIndices, true);
+ drawBarOnSub = $$.generateDrawBar(barIndices, true);
+ drawLineOnSub = $$.generateDrawLine(lineIndices, true);
+ // bars
+ contextBar = context.selectAll('.' + CLASS.bars).selectAll('.' + CLASS.bar)
+ .data(barData);
+ contextBar.enter().append('path')
+ .attr("class", classBar)
+ .style("stroke", 'none')
+ .style("fill", $$.color);
+ contextBar
+ .style("opacity", initialOpacity)
+ .transition().duration(duration)
+ .attr('d', drawBarOnSub)
+ .style('opacity', 1);
+ contextBar.exit().transition().duration(duration)
+ .style('opacity', 0)
+ .remove();
+ // lines
+ contextLine = context.selectAll('.' + CLASS.lines).selectAll('.' + CLASS.line)
+ .data(lineData);
+ contextLine.enter().append('path')
+ .attr('class', classLine)
+ .style('stroke', $$.color);
+ contextLine
+ .style("opacity", initialOpacity)
+ .transition().duration(duration)
+ .attr("d", drawLineOnSub)
+ .style('opacity', 1);
+ contextLine.exit().transition().duration(duration)
+ .style('opacity', 0)
+ .remove();
+ // area
+ contextArea = context.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area)
+ .data(lineData);
+ contextArea.enter().append('path')
+ .attr("class", classArea)
+ .style("fill", $$.color)
+ .style("opacity", function () { $$.orgAreaOpacity = +d3.select(this).style('opacity'); return 0; });
+ contextArea
+ .style("opacity", 0)
+ .transition().duration(duration)
+ .attr("d", drawAreaOnSub)
+ .style("fill", $$.color)
+ .style("opacity", $$.orgAreaOpacity);
+ contextArea.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ }
+ }
+ };
+ c3_chart_internal_fn.redrawForBrush = function () {
+ var $$ = this, x = $$.x;
+ $$.redraw({
+ withTransition: false,
+ withY: false,
+ withSubchart: false,
+ withUpdateXDomain: true
+ });
+ $$.config.subchart_onbrush.call($$.api, x.orgDomain());
+ };
+ c3_chart_internal_fn.transformContext = function (withTransition, transitions) {
+ var $$ = this, subXAxis;
+ if (transitions && transitions.axisSubX) {
+ subXAxis = transitions.axisSubX;
+ } else {
+ subXAxis = $$.context.select('.' + CLASS.axisX);
+ if (withTransition) { subXAxis = subXAxis.transition(); }
+ }
+ $$.context.attr("transform", $$.getTranslate('context'));
+ subXAxis.attr("transform", $$.getTranslate('subx'));
+ };
+
+ c3_chart_internal_fn.initZoom = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ $$.zoom = d3.behavior.zoom()
+ .on("zoomstart", function () {
+ $$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null;
+ })
+ .on("zoom", function () { $$.redrawForZoom.call($$); });
+ $$.zoom.scale = function (scale) {
+ return config.axis_rotated ? this.y(scale) : this.x(scale);
+ };
+ $$.zoom.orgScaleExtent = function () {
+ var extent = config.zoom_extent ? config.zoom_extent : [1, 10];
+ return [extent[0], Math.max($$.getMaxDataCount() / extent[1], extent[1])];
+ };
+ $$.zoom.updateScaleExtent = function () {
+ var ratio = diffDomain($$.x.orgDomain()) / diffDomain($$.orgXDomain),
+ extent = this.orgScaleExtent();
+ this.scaleExtent([extent[0] * ratio, extent[1] * ratio]);
+ return this;
+ };
+ };
+ c3_chart_internal_fn.updateZoom = function () {
+ var $$ = this, z = $$.config.zoom_enabled ? $$.zoom : function () {};
+ $$.main.select('.' + CLASS.zoomRect).call(z);
+ $$.main.selectAll('.' + CLASS.eventRect).call(z);
+ };
+ c3_chart_internal_fn.redrawForZoom = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config, zoom = $$.zoom, x = $$.x, orgXDomain = $$.orgXDomain;
+ if (!config.zoom_enabled) {
+ return;
+ }
+ if ($$.filterTargetsToShow($$.data.targets).length === 0) {
+ return;
+ }
+ if (d3.event.sourceEvent.type === 'mousemove' && zoom.altDomain) {
+ x.domain(zoom.altDomain);
+ zoom.scale(x).updateScaleExtent();
+ return;
+ }
+ if ($$.isCategorized() && x.orgDomain()[0] === orgXDomain[0]) {
+ x.domain([orgXDomain[0] - 1e-10, x.orgDomain()[1]]);
+ }
+ $$.redraw({
+ withTransition: false,
+ withY: false,
+ withSubchart: false
+ });
+ if (d3.event.sourceEvent.type === 'mousemove') {
+ $$.cancelClick = true;
+ }
+ config.zoom_onzoom.call($$.api, x.orgDomain());
+ };
+
+ c3_chart_internal_fn.generateColor = function () {
+ var $$ = this, config = $$.config, d3 = $$.d3,
+ colors = config.data_colors,
+ pattern = notEmpty(config.color_pattern) ? config.color_pattern : d3.scale.category10().range(),
+ callback = config.data_color,
+ ids = [];
+
+ return function (d) {
+ var id = d.id || d, color;
+
+ // if callback function is provided
+ if (colors[id] instanceof Function) {
+ color = colors[id](d);
+ }
+ // if specified, choose that color
+ else if (colors[id]) {
+ color = colors[id];
+ }
+ // if not specified, choose from pattern
+ else {
+ if (ids.indexOf(id) < 0) { ids.push(id); }
+ color = pattern[ids.indexOf(id) % pattern.length];
+ colors[id] = color;
+ }
+ return callback instanceof Function ? callback(color, d) : color;
+ };
+ };
+ c3_chart_internal_fn.generateLevelColor = function () {
+ var $$ = this, config = $$.config,
+ colors = config.color_pattern,
+ threshold = config.color_threshold,
+ asValue = threshold.unit === 'value',
+ values = threshold.values && threshold.values.length ? threshold.values : [],
+ max = threshold.max || 100;
+ return notEmpty(config.color_threshold) ? function (value) {
+ var i, v, color = colors[colors.length - 1];
+ for (i = 0; i < values.length; i++) {
+ v = asValue ? value : (value * 100 / max);
+ if (v < values[i]) {
+ color = colors[i];
+ break;
+ }
+ }
+ return color;
+ } : null;
+ };
+
+ c3_chart_internal_fn.getYFormat = function (forArc) {
+ var $$ = this,
+ formatForY = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.yFormat,
+ formatForY2 = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.y2Format;
+ return function (v, ratio, id) {
+ var format = $$.getAxisId(id) === 'y2' ? formatForY2 : formatForY;
+ return format.call($$, v, ratio);
+ };
+ };
+ c3_chart_internal_fn.yFormat = function (v) {
+ var $$ = this, config = $$.config,
+ format = config.axis_y_tick_format ? config.axis_y_tick_format : $$.defaultValueFormat;
+ return format(v);
+ };
+ c3_chart_internal_fn.y2Format = function (v) {
+ var $$ = this, config = $$.config,
+ format = config.axis_y2_tick_format ? config.axis_y2_tick_format : $$.defaultValueFormat;
+ return format(v);
+ };
+ c3_chart_internal_fn.defaultValueFormat = function (v) {
+ return isValue(v) ? +v : "";
+ };
+ c3_chart_internal_fn.defaultArcValueFormat = function (v, ratio) {
+ return (ratio * 100).toFixed(1) + '%';
+ };
+ c3_chart_internal_fn.formatByAxisId = function (axisId) {
+ var $$ = this, data_labels = $$.config.data_labels,
+ format = function (v) { return isValue(v) ? +v : ""; };
+ // find format according to axis id
+ if (typeof data_labels.format === 'function') {
+ format = data_labels.format;
+ } else if (typeof data_labels.format === 'object') {
+ if (data_labels.format[axisId]) {
+ format = data_labels.format[axisId];
+ }
+ }
+ return format;
+ };
+
+ c3_chart_internal_fn.hasCaches = function (ids) {
+ for (var i = 0; i < ids.length; i++) {
+ if (! (ids[i] in this.cache)) { return false; }
+ }
+ return true;
+ };
+ c3_chart_internal_fn.addCache = function (id, target) {
+ this.cache[id] = this.cloneTarget(target);
+ };
+ c3_chart_internal_fn.getCaches = function (ids) {
+ var targets = [], i;
+ for (i = 0; i < ids.length; i++) {
+ if (ids[i] in this.cache) { targets.push(this.cloneTarget(this.cache[ids[i]])); }
+ }
+ return targets;
+ };
+
+ var CLASS = c3_chart_internal_fn.CLASS = {
+ target: 'c3-target',
+ chart: 'c3-chart',
+ chartLine: 'c3-chart-line',
+ chartLines: 'c3-chart-lines',
+ chartBar: 'c3-chart-bar',
+ chartBars: 'c3-chart-bars',
+ chartText: 'c3-chart-text',
+ chartTexts: 'c3-chart-texts',
+ chartArc: 'c3-chart-arc',
+ chartArcs: 'c3-chart-arcs',
+ chartArcsTitle: 'c3-chart-arcs-title',
+ chartArcsBackground: 'c3-chart-arcs-background',
+ chartArcsGaugeUnit: 'c3-chart-arcs-gauge-unit',
+ chartArcsGaugeMax: 'c3-chart-arcs-gauge-max',
+ chartArcsGaugeMin: 'c3-chart-arcs-gauge-min',
+ selectedCircle: 'c3-selected-circle',
+ selectedCircles: 'c3-selected-circles',
+ eventRect: 'c3-event-rect',
+ eventRects: 'c3-event-rects',
+ eventRectsSingle: 'c3-event-rects-single',
+ eventRectsMultiple: 'c3-event-rects-multiple',
+ zoomRect: 'c3-zoom-rect',
+ brush: 'c3-brush',
+ focused: 'c3-focused',
+ region: 'c3-region',
+ regions: 'c3-regions',
+ tooltip: 'c3-tooltip',
+ tooltipName: 'c3-tooltip-name',
+ shape: 'c3-shape',
+ shapes: 'c3-shapes',
+ line: 'c3-line',
+ lines: 'c3-lines',
+ bar: 'c3-bar',
+ bars: 'c3-bars',
+ circle: 'c3-circle',
+ circles: 'c3-circles',
+ arc: 'c3-arc',
+ arcs: 'c3-arcs',
+ area: 'c3-area',
+ areas: 'c3-areas',
+ empty: 'c3-empty',
+ text: 'c3-text',
+ texts: 'c3-texts',
+ gaugeValue: 'c3-gauge-value',
+ grid: 'c3-grid',
+ xgrid: 'c3-xgrid',
+ xgrids: 'c3-xgrids',
+ xgridLine: 'c3-xgrid-line',
+ xgridLines: 'c3-xgrid-lines',
+ xgridFocus: 'c3-xgrid-focus',
+ ygrid: 'c3-ygrid',
+ ygrids: 'c3-ygrids',
+ ygridLine: 'c3-ygrid-line',
+ ygridLines: 'c3-ygrid-lines',
+ axis: 'c3-axis',
+ axisX: 'c3-axis-x',
+ axisXLabel: 'c3-axis-x-label',
+ axisY: 'c3-axis-y',
+ axisYLabel: 'c3-axis-y-label',
+ axisY2: 'c3-axis-y2',
+ axisY2Label: 'c3-axis-y2-label',
+ legendBackground: 'c3-legend-background',
+ legendItem: 'c3-legend-item',
+ legendItemEvent: 'c3-legend-item-event',
+ legendItemTile: 'c3-legend-item-tile',
+ legendItemHidden: 'c3-legend-item-hidden',
+ legendItemFocused: 'c3-legend-item-focused',
+ dragarea: 'c3-dragarea',
+ EXPANDED: '_expanded_',
+ SELECTED: '_selected_',
+ INCLUDED: '_included_'
+ };
+ c3_chart_internal_fn.generateClass = function (prefix, targetId) {
+ return " " + prefix + " " + prefix + this.getTargetSelectorSuffix(targetId);
+ };
+ c3_chart_internal_fn.classText = function (d) {
+ return this.generateClass(CLASS.text, d.index);
+ };
+ c3_chart_internal_fn.classTexts = function (d) {
+ return this.generateClass(CLASS.texts, d.id);
+ };
+ c3_chart_internal_fn.classShape = function (d) {
+ return this.generateClass(CLASS.shape, d.index);
+ };
+ c3_chart_internal_fn.classShapes = function (d) {
+ return this.generateClass(CLASS.shapes, d.id);
+ };
+ c3_chart_internal_fn.classLine = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.line, d.id);
+ };
+ c3_chart_internal_fn.classLines = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.lines, d.id);
+ };
+ c3_chart_internal_fn.classCircle = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.circle, d.index);
+ };
+ c3_chart_internal_fn.classCircles = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.circles, d.id);
+ };
+ c3_chart_internal_fn.classBar = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.bar, d.index);
+ };
+ c3_chart_internal_fn.classBars = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.bars, d.id);
+ };
+ c3_chart_internal_fn.classArc = function (d) {
+ return this.classShape(d.data) + this.generateClass(CLASS.arc, d.data.id);
+ };
+ c3_chart_internal_fn.classArcs = function (d) {
+ return this.classShapes(d.data) + this.generateClass(CLASS.arcs, d.data.id);
+ };
+ c3_chart_internal_fn.classArea = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.area, d.id);
+ };
+ c3_chart_internal_fn.classAreas = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.areas, d.id);
+ };
+ c3_chart_internal_fn.classRegion = function (d, i) {
+ return this.generateClass(CLASS.region, i) + ' ' + ('class' in d ? d.class : '');
+ };
+ c3_chart_internal_fn.classEvent = function (d) {
+ return this.generateClass(CLASS.eventRect, d.index);
+ };
+ c3_chart_internal_fn.classTarget = function (id) {
+ var $$ = this;
+ var additionalClassSuffix = $$.config.data_classes[id], additionalClass = '';
+ if (additionalClassSuffix) {
+ additionalClass = ' ' + CLASS.target + '-' + additionalClassSuffix;
+ }
+ return $$.generateClass(CLASS.target, id) + additionalClass;
+ };
+ c3_chart_internal_fn.classChartText = function (d) {
+ return CLASS.chartText + this.classTarget(d.id);
+ };
+ c3_chart_internal_fn.classChartLine = function (d) {
+ return CLASS.chartLine + this.classTarget(d.id);
+ };
+ c3_chart_internal_fn.classChartBar = function (d) {
+ return CLASS.chartBar + this.classTarget(d.id);
+ };
+ c3_chart_internal_fn.classChartArc = function (d) {
+ return CLASS.chartArc + this.classTarget(d.data.id);
+ };
+ c3_chart_internal_fn.getTargetSelectorSuffix = function (targetId) {
+ return targetId || targetId === 0 ? '-' + (targetId.replace ? targetId.replace(/([^a-zA-Z0-9-_])/g, '-') : targetId) : '';
+ };
+ c3_chart_internal_fn.selectorTarget = function (id) {
+ return '.' + CLASS.target + this.getTargetSelectorSuffix(id);
+ };
+ c3_chart_internal_fn.selectorTargets = function (ids) {
+ var $$ = this;
+ return ids.length ? ids.map(function (id) { return $$.selectorTarget(id); }) : null;
+ };
+ c3_chart_internal_fn.selectorLegend = function (id) {
+ return '.' + CLASS.legendItem + this.getTargetSelectorSuffix(id);
+ };
+ c3_chart_internal_fn.selectorLegends = function (ids) {
+ var $$ = this;
+ return ids.length ? ids.map(function (id) { return $$.selectorLegend(id); }) : null;
+ };
+
+ var isValue = c3_chart_internal_fn.isValue = function (v) {
+ return v || v === 0;
+ },
+ isFunction = c3_chart_internal_fn.isFunction = function (o) {
+ return typeof o === 'function';
+ },
+ isString = c3_chart_internal_fn.isString = function (o) {
+ return typeof o === 'string';
+ },
+ isUndefined = c3_chart_internal_fn.isUndefined = function (v) {
+ return typeof v === 'undefined';
+ },
+ isDefined = c3_chart_internal_fn.isDefined = function (v) {
+ return typeof v !== 'undefined';
+ },
+ ceil10 = c3_chart_internal_fn.ceil10 = function (v) {
+ return Math.ceil(v / 10) * 10;
+ },
+ asHalfPixel = c3_chart_internal_fn.asHalfPixel = function (n) {
+ return Math.ceil(n) + 0.5;
+ },
+ diffDomain = c3_chart_internal_fn.diffDomain = function (d) {
+ return d[1] - d[0];
+ },
+ isEmpty = c3_chart_internal_fn.isEmpty = function (o) {
+ return !o || (isString(o) && o.length === 0) || (typeof o === 'object' && Object.keys(o).length === 0);
+ },
+ notEmpty = c3_chart_internal_fn.notEmpty = function (o) {
+ return Object.keys(o).length > 0;
+ },
+ getOption = c3_chart_internal_fn.getOption = function (options, key, defaultValue) {
+ return isDefined(options[key]) ? options[key] : defaultValue;
+ },
+ hasValue = c3_chart_internal_fn.hasValue = function (dict, value) {
+ var found = false;
+ Object.keys(dict).forEach(function (key) {
+ if (dict[key] === value) { found = true; }
+ });
+ return found;
+ },
+ getPathBox = c3_chart_internal_fn.getPathBox = function (path) {
+ var box = path.getBoundingClientRect(),
+ items = [path.pathSegList.getItem(0), path.pathSegList.getItem(1)],
+ minX = items[0].x, minY = Math.min(items[0].y, items[1].y);
+ return {x: minX, y: minY, width: box.width, height: box.height};
+ };
+
+ c3_chart_fn.focus = function (targetId) {
+ var $$ = this.internal,
+ candidates = $$.svg.selectAll($$.selectorTarget(targetId)),
+ candidatesForNoneArc = candidates.filter($$.isNoneArc.bind($$)),
+ candidatesForArc = candidates.filter($$.isArc.bind($$));
+ function focus(targets) {
+ $$.filterTargetsToShow(targets).transition().duration(100).style('opacity', 1);
+ }
+ this.revert();
+ this.defocus();
+ focus(candidatesForNoneArc.classed(CLASS.focused, true));
+ focus(candidatesForArc);
+ if ($$.hasArcType()) {
+ $$.expandArc(targetId, true);
+ }
+ $$.toggleFocusLegend(targetId, true);
+ };
+
+ c3_chart_fn.defocus = function (targetId) {
+ var $$ = this.internal,
+ candidates = $$.svg.selectAll($$.selectorTarget(targetId)),
+ candidatesForNoneArc = candidates.filter($$.isNoneArc.bind($$)),
+ candidatesForArc = candidates.filter($$.isArc.bind($$));
+ function defocus(targets) {
+ $$.filterTargetsToShow(targets).transition().duration(100).style('opacity', 0.3);
+ }
+ this.revert();
+ defocus(candidatesForNoneArc.classed(CLASS.focused, false));
+ defocus(candidatesForArc);
+ if ($$.hasArcType()) {
+ $$.unexpandArc(targetId);
+ }
+ $$.toggleFocusLegend(targetId, false);
+ };
+
+ c3_chart_fn.revert = function (targetId) {
+ var $$ = this.internal,
+ candidates = $$.svg.selectAll($$.selectorTarget(targetId)),
+ candidatesForNoneArc = candidates.filter($$.isNoneArc.bind($$)),
+ candidatesForArc = candidates.filter($$.isArc.bind($$));
+ function revert(targets) {
+ $$.filterTargetsToShow(targets).transition().duration(100).style('opacity', 1);
+ }
+ revert(candidatesForNoneArc.classed(CLASS.focused, false));
+ revert(candidatesForArc);
+ if ($$.hasArcType()) {
+ $$.unexpandArc(targetId);
+ }
+ $$.revertLegend();
+ };
+
+ c3_chart_fn.show = function (targetIds, options) {
+ var $$ = this.internal;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ options = options || {};
+
+ $$.removeHiddenTargetIds(targetIds);
+ $$.svg.selectAll($$.selectorTargets(targetIds))
+ .transition()
+ .style('opacity', 1);
+
+ if (options.withLegend) {
+ $$.showLegend(targetIds);
+ }
+
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+ };
+
+ c3_chart_fn.hide = function (targetIds, options) {
+ var $$ = this.internal;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ options = options || {};
+
+ $$.addHiddenTargetIds(targetIds);
+ $$.svg.selectAll($$.selectorTargets(targetIds))
+ .transition()
+ .style('opacity', 0);
+
+ if (options.withLegend) {
+ $$.hideLegend(targetIds);
+ }
+
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+ };
+
+ c3_chart_fn.toggle = function (targetId) {
+ var $$ = this.internal;
+ $$.isTargetToShow(targetId) ? this.hide(targetId) : this.show(targetId);
+ };
+
+ c3_chart_fn.zoom = function () {
+ };
+ c3_chart_fn.zoom.enable = function (enabled) {
+ var $$ = this.internal;
+ $$.config.zoom_enabled = enabled;
+ $$.updateAndRedraw();
+ };
+ c3_chart_fn.unzoom = function () {
+ var $$ = this.internal;
+ $$.brush.clear().update();
+ $$.redraw({withUpdateXDomain: true});
+ };
+
+ c3_chart_fn.load = function (args) {
+ var $$ = this.internal, config = $$.config;
+ // update xs if specified
+ if (args.xs) {
+ $$.addXs(args.xs);
+ }
+ // update classes if exists
+ if ('classes' in args) {
+ Object.keys(args.classes).forEach(function (id) {
+ config.data_classes[id] = args.classes[id];
+ });
+ }
+ // update categories if exists
+ if ('categories' in args && $$.isCategorized()) {
+ config.axis_x_categories = args.categories;
+ }
+ // use cache if exists
+ if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) {
+ $$.load($$.getCaches(args.cacheIds), args.done);
+ return;
+ }
+ // unload if needed
+ if ('unload' in args) {
+ // TODO: do not unload if target will load (included in url/rows/columns)
+ $$.unload($$.mapToTargetIds((typeof args.unload === 'boolean' && args.unload) ? null : args.unload), function () {
+ $$.loadFromArgs(args);
+ });
+ } else {
+ $$.loadFromArgs(args);
+ }
+ };
+
+ c3_chart_fn.unload = function (args) {
+ var $$ = this.internal;
+ args = args || {};
+ $$.unload($$.mapToTargetIds(args.ids), function () {
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+ if (args.done) { args.done(); }
+ });
+ };
+
+ c3_chart_fn.flow = function (args) {
+ var $$ = this.internal,
+ targets, data, notfoundIds = [], orgDataCount = $$.getMaxDataCount(),
+ dataCount, domain, baseTarget, baseValue, length = 0, tail = 0, diff, to;
+
+ if (args.json) {
+ data = $$.convertJsonToData(args.json, args.keys);
+ }
+ else if (args.rows) {
+ data = $$.convertRowsToData(args.rows);
+ }
+ else if (args.columns) {
+ data = $$.convertColumnsToData(args.columns);
+ }
+ else {
+ return;
+ }
+ targets = $$.convertDataToTargets(data, true);
+
+ // Update/Add data
+ $$.data.targets.forEach(function (t) {
+ var found = false, i, j;
+ for (i = 0; i < targets.length; i++) {
+ if (t.id === targets[i].id) {
+ found = true;
+
+ if (t.values[t.values.length - 1]) {
+ tail = t.values[t.values.length - 1].index + 1;
+ }
+ length = targets[i].values.length;
+
+ for (j = 0; j < length; j++) {
+ targets[i].values[j].index = tail + j;
+ if (!$$.isTimeSeries()) {
+ targets[i].values[j].x = tail + j;
+ }
+ }
+ t.values = t.values.concat(targets[i].values);
+
+ targets.splice(i, 1);
+ break;
+ }
+ }
+ if (!found) { notfoundIds.push(t.id); }
+ });
+
+ // Append null for not found targets
+ $$.data.targets.forEach(function (t) {
+ var i, j;
+ for (i = 0; i < notfoundIds.length; i++) {
+ if (t.id === notfoundIds[i]) {
+ tail = t.values[t.values.length - 1].index + 1;
+ for (j = 0; j < length; j++) {
+ t.values.push({
+ id: t.id,
+ index: tail + j,
+ x: $$.isTimeSeries() ? $$.getOtherTargetX(tail + j) : tail + j,
+ value: null
+ });
+ }
+ }
+ }
+ });
+
+ // Generate null values for new target
+ if ($$.data.targets.length) {
+ targets.forEach(function (t) {
+ var i, missing = [];
+ for (i = $$.data.targets[0].values[0].index; i < tail; i++) {
+ missing.push({
+ id: t.id,
+ index: i,
+ x: $$.isTimeSeries() ? $$.getOtherTargetX(i) : i,
+ value: null
+ });
+ }
+ t.values.forEach(function (v) {
+ v.index += tail;
+ if (!$$.isTimeSeries()) {
+ v.x += tail;
+ }
+ });
+ t.values = missing.concat(t.values);
+ });
+ }
+ $$.data.targets = $$.data.targets.concat(targets); // add remained
+
+ // check data count because behavior needs to change when it's only one
+ dataCount = $$.getMaxDataCount();
+ baseTarget = $$.data.targets[0];
+ baseValue = baseTarget.values[0];
+
+ // Update length to flow if needed
+ if (isDefined(args.to)) {
+ length = 0;
+ to = $$.isTimeSeries() ? $$.parseDate(args.to) : args.to;
+ baseTarget.values.forEach(function (v) {
+ if (v.x < to) { length++; }
+ });
+ } else if (isDefined(args.length)) {
+ length = args.length;
+ }
+
+ // If only one data, update the domain to flow from left edge of the chart
+ if (!orgDataCount) {
+ if ($$.isTimeSeries()) {
+ if (baseTarget.values.length > 1) {
+ diff = baseTarget.values[baseTarget.values.length - 1].x - baseValue.x;
+ } else {
+ diff = baseValue.x - $$.getXDomain($$.data.targets)[0];
+ }
+ } else {
+ diff = 1;
+ }
+ domain = [baseValue.x - diff, baseValue.x];
+ $$.updateXDomain(null, true, true, domain);
+ } else if (orgDataCount === 1) {
+ if ($$.isTimeSeries()) {
+ diff = (baseTarget.values[baseTarget.values.length - 1].x - baseValue.x) / 2;
+ domain = [new Date(+baseValue.x - diff), new Date(+baseValue.x + diff)];
+ $$.updateXDomain(null, true, true, domain);
+ }
+ }
+
+ // Set targets
+ $$.updateTargets($$.data.targets);
+
+ // Redraw with new targets
+ $$.redraw({
+ flow: {
+ index: baseValue.index,
+ length: length,
+ duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
+ done: args.done,
+ orgDataCount: orgDataCount,
+ },
+ withLegend: true,
+ withTransition: orgDataCount > 1,
+ });
+ };
+
+ c3_chart_internal_fn.generateFlow = function (args) {
+ var $$ = this, config = $$.config, d3 = $$.d3;
+
+ return function () {
+ var targets = args.targets,
+ flow = args.flow,
+ drawBar = args.drawBar,
+ drawLine = args.drawLine,
+ drawArea = args.drawArea,
+ cx = args.cx,
+ cy = args.cy,
+ xv = args.xv,
+ xForText = args.xForText,
+ yForText = args.yForText,
+ duration = args.duration;
+
+ var translateX, scaleX = 1, transform,
+ flowIndex = flow.index,
+ flowLength = flow.length,
+ flowStart = $$.getValueOnIndex($$.data.targets[0].values, flowIndex),
+ flowEnd = $$.getValueOnIndex($$.data.targets[0].values, flowIndex + flowLength),
+ orgDomain = $$.x.domain(), domain,
+ durationForFlow = flow.duration || duration,
+ done = flow.done || function () {},
+ wait = $$.generateWait();
+
+ var xgrid = $$.xgrid || d3.selectAll([]),
+ xgridLines = $$.xgridLines || d3.selectAll([]),
+ mainRegion = $$.mainRegion || d3.selectAll([]),
+ mainText = $$.mainText || d3.selectAll([]),
+ mainBar = $$.mainBar || d3.selectAll([]),
+ mainLine = $$.mainLine || d3.selectAll([]),
+ mainArea = $$.mainArea || d3.selectAll([]),
+ mainCircle = $$.mainCircle || d3.selectAll([]);
+
+ // remove head data after rendered
+ $$.data.targets.forEach(function (d) {
+ d.values.splice(0, flowLength);
+ });
+
+ // update x domain to generate axis elements for flow
+ domain = $$.updateXDomain(targets, true, true);
+ // update elements related to x scale
+ if ($$.updateXGrid) { $$.updateXGrid(true); }
+
+ // generate transform to flow
+ if (!flow.orgDataCount) { // if empty
+ if ($$.data.targets[0].values.length !== 1) {
+ translateX = $$.x(orgDomain[0]) - $$.x(domain[0]);
+ } else {
+ if ($$.isTimeSeries()) {
+ flowStart = $$.getValueOnIndex($$.data.targets[0].values, 0);
+ flowEnd = $$.getValueOnIndex($$.data.targets[0].values, $$.data.targets[0].values.length - 1);
+ translateX = $$.x(flowStart.x) - $$.x(flowEnd.x);
+ } else {
+ translateX = diffDomain(domain) / 2;
+ }
+ }
+ } else if (flow.orgDataCount === 1 || flowStart.x === flowEnd.x) {
+ translateX = $$.x(orgDomain[0]) - $$.x(domain[0]);
+ } else {
+ if ($$.isTimeSeries()) {
+ translateX = ($$.x(orgDomain[0]) - $$.x(domain[0]));
+ } else {
+ translateX = ($$.x(flowStart.x) - $$.x(flowEnd.x));
+ }
+ }
+ scaleX = (diffDomain(orgDomain) / diffDomain(domain));
+ transform = 'translate(' + translateX + ',0) scale(' + scaleX + ',1)';
+
+ d3.transition().ease('linear').duration(durationForFlow).each(function () {
+ wait.add($$.axes.x.transition().call($$.xAxis));
+ wait.add(mainBar.transition().attr('transform', transform));
+ wait.add(mainLine.transition().attr('transform', transform));
+ wait.add(mainArea.transition().attr('transform', transform));
+ wait.add(mainCircle.transition().attr('transform', transform));
+ wait.add(mainText.transition().attr('transform', transform));
+ wait.add(mainRegion.filter($$.isRegionOnX).transition().attr('transform', transform));
+ wait.add(xgrid.transition().attr('transform', transform));
+ wait.add(xgridLines.transition().attr('transform', transform));
+ })
+ .call(wait, function () {
+ var i, shapes = [], texts = [], eventRects = [];
+
+ // remove flowed elements
+ if (flowLength) {
+ for (i = 0; i < flowLength; i++) {
+ shapes.push('.' + CLASS.shape + '-' + (flowIndex + i));
+ texts.push('.' + CLASS.text + '-' + (flowIndex + i));
+ eventRects.push('.' + CLASS.eventRect + '-' + (flowIndex + i));
+ }
+ $$.svg.selectAll('.' + CLASS.shapes).selectAll(shapes).remove();
+ $$.svg.selectAll('.' + CLASS.texts).selectAll(texts).remove();
+ $$.svg.selectAll('.' + CLASS.eventRects).selectAll(eventRects).remove();
+ $$.svg.select('.' + CLASS.xgrid).remove();
+ }
+
+ // draw again for removing flowed elements and reverting attr
+ xgrid
+ .attr('transform', null)
+ .attr($$.xgridAttr);
+ xgridLines
+ .attr('transform', null);
+ xgridLines.select('line')
+ .attr("x1", config.axis_rotated ? 0 : xv)
+ .attr("x2", config.axis_rotated ? $$.width : xv);
+ xgridLines.select('text')
+ .attr("x", config.axis_rotated ? $$.width : 0)
+ .attr("y", xv);
+ mainBar
+ .attr('transform', null)
+ .attr("d", drawBar);
+ mainLine
+ .attr('transform', null)
+ .attr("d", drawLine);
+ mainArea
+ .attr('transform', null)
+ .attr("d", drawArea);
+ mainCircle
+ .attr('transform', null)
+ .attr("cx", cx)
+ .attr("cy", cy);
+ mainText
+ .attr('transform', null)
+ .attr('x', xForText)
+ .attr('y', yForText)
+ .style('fill-opacity', $$.opacityForText.bind($$));
+ mainRegion
+ .attr('transform', null);
+ mainRegion.select('rect').filter($$.isRegionOnX)
+ .attr("x", $$.regionX.bind($$))
+ .attr("width", $$.regionWidth.bind($$));
+ $$.updateEventRect();
+
+ // callback for end of flow
+ done();
+ });
+ };
+ };
+
+ c3_chart_fn.selected = function (targetId) {
+ var $$ = this.internal, d3 = $$.d3;
+ return d3.merge(
+ $$.main.selectAll('.' + CLASS.shapes + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS.shape)
+ .filter(function () { return d3.select(this).classed(CLASS.SELECTED); })
+ .map(function (d) { return d.map(function (d) { var data = d.__data__; return data.data ? data.data : data; }); })
+ );
+ };
+ c3_chart_fn.select = function (ids, indices, resetOther) {
+ var $$ = this.internal, d3 = $$.d3, config = $$.config;
+ if (! config.data_selection_enabled) { return; }
+ $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
+ var shape = d3.select(this), id = d.data ? d.data.id : d.id,
+ toggle = $$.getToggle(this).bind($$),
+ isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
+ isTargetIndex = !indices || indices.indexOf(i) >= 0,
+ isSelected = shape.classed(CLASS.SELECTED);
+ // line/area selection not supported yet
+ if (shape.classed(CLASS.line) || shape.classed(CLASS.area)) {
+ return;
+ }
+ if (isTargetId && isTargetIndex) {
+ if (config.data_selection_isselectable(d) && !isSelected) {
+ toggle(true, shape.classed(CLASS.SELECTED, true), d, i);
+ }
+ } else if (isDefined(resetOther) && resetOther) {
+ if (isSelected) {
+ toggle(false, shape.classed(CLASS.SELECTED, false), d, i);
+ }
+ }
+ });
+ };
+ c3_chart_fn.unselect = function (ids, indices) {
+ var $$ = this.internal, d3 = $$.d3, config = $$.config;
+ if (! config.data_selection_enabled) { return; }
+ $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
+ var shape = d3.select(this), id = d.data ? d.data.id : d.id,
+ toggle = $$.getToggle(this).bind($$),
+ isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
+ isTargetIndex = !indices || indices.indexOf(i) >= 0,
+ isSelected = shape.classed(CLASS.SELECTED);
+ // line/area selection not supported yet
+ if (shape.classed(CLASS.line) || shape.classed(CLASS.area)) {
+ return;
+ }
+ if (isTargetId && isTargetIndex) {
+ if (config.data_selection_isselectable(d)) {
+ if (isSelected) {
+ toggle(false, shape.classed(CLASS.SELECTED, false), d, i);
+ }
+ }
+ }
+ });
+ };
+
+ c3_chart_fn.transform = function (type, targetIds) {
+ var $$ = this.internal,
+ options = ['pie', 'donut'].indexOf(type) >= 0 ? {withTransform: true} : null;
+ $$.transformTo(targetIds, type, options);
+ };
+
+ c3_chart_internal_fn.transformTo = function (targetIds, type, optionsForRedraw) {
+ var $$ = this,
+ withTransitionForAxis = !$$.hasArcType(),
+ options = optionsForRedraw || {withTransitionForAxis: withTransitionForAxis};
+ options.withTransitionForTransform = false;
+ $$.transiting = false;
+ $$.setTargetType(targetIds, type);
+ $$.updateAndRedraw(options);
+ };
+
+ c3_chart_fn.groups = function (groups) {
+ var $$ = this.internal, config = $$.config;
+ if (isUndefined(groups)) { return config.data_groups; }
+ config.data_groups = groups;
+ $$.redraw();
+ return config.data_groups;
+ };
+
+ c3_chart_fn.xgrids = function (grids) {
+ var $$ = this.internal, config = $$.config;
+ if (! grids) { return config.grid_x_lines; }
+ config.grid_x_lines = grids;
+ $$.redraw();
+ return config.grid_x_lines;
+ };
+ c3_chart_fn.xgrids.add = function (grids) {
+ var $$ = this.internal;
+ return this.xgrids($$.config.grid_x_lines.concat(grids ? grids : []));
+ };
+ c3_chart_fn.xgrids.remove = function (params) { // TODO: multiple
+ var $$ = this.internal;
+ $$.removeGridLines(params, true);
+ };
+
+ c3_chart_fn.ygrids = function (grids) {
+ var $$ = this.internal, config = $$.config;
+ if (! grids) { return config.grid_y_lines; }
+ config.grid_y_lines = grids;
+ $$.redraw();
+ return config.grid_y_lines;
+ };
+ c3_chart_fn.ygrids.add = function (grids) {
+ var $$ = this.internal;
+ return this.ygrids($$.config.grid_y_lines.concat(grids ? grids : []));
+ };
+ c3_chart_fn.ygrids.remove = function (params) { // TODO: multiple
+ var $$ = this.internal;
+ $$.removeGridLines(params, false);
+ };
+
+ c3_chart_fn.regions = function (regions) {
+ var $$ = this.internal, config = $$.config;
+ if (!regions) { return config.regions; }
+ config.regions = regions;
+ $$.redraw();
+ return config.regions;
+ };
+ c3_chart_fn.regions.add = function (regions) {
+ var $$ = this.internal, config = $$.config;
+ if (!regions) { return config.regions; }
+ config.regions = config.regions.concat(regions);
+ $$.redraw();
+ return config.regions;
+ };
+ c3_chart_fn.regions.remove = function (options) {
+ var $$ = this.internal, config = $$.config,
+ duration, classes, regions;
+
+ options = options || {};
+ duration = $$.getOption(options, "duration", config.transition_duration);
+ classes = $$.getOption(options, "classes", [CLASS.region]);
+
+ regions = $$.main.select('.' + CLASS.regions).selectAll(classes.map(function (c) { return '.' + c; }));
+ (duration ? regions.transition().duration(duration) : regions)
+ .style('opacity', 0)
+ .remove();
+
+ config.regions = config.regions.filter(function (region) {
+ var found = false;
+ if (!region.class) {
+ return true;
+ }
+ region.class.split(' ').forEach(function (c) {
+ if (classes.indexOf(c) >= 0) { found = true; }
+ });
+ return !found;
+ });
+
+ return config.regions;
+ };
+
+ c3_chart_fn.data = function () {};
+ c3_chart_fn.data.get = function (targetId) {
+ var target = this.data.getAsTarget(targetId);
+ return isDefined(target) ? target.values.map(function (d) { return d.value; }) : undefined;
+ };
+ c3_chart_fn.data.getAsTarget = function (targetId) {
+ var targets = this.data.targets.filter(function (t) { return t.id === targetId; });
+ return targets.length > 0 ? targets[0] : undefined;
+ };
+ c3_chart_fn.data.names = function (names) {
+ var $$ = this.internal, config = $$.config;
+ if (!arguments.length) { return config.data_names; }
+ Object.keys(names).forEach(function (id) {
+ config.data_names[id] = names[id];
+ });
+ $$.redraw({withLegend: true});
+ return config.data_names;
+ };
+ c3_chart_fn.data.colors = function (colors) {
+ var $$ = this.internal, config = $$.config;
+ if (!arguments.length) { return config.data_colors; }
+ Object.keys(colors).forEach(function (id) {
+ config.data_colors[id] = colors[id];
+ });
+ $$.redraw({withLegend: true});
+ return config.data_colors;
+ };
+
+ c3_chart_fn.category = function (i, category) {
+ var $$ = this.internal, config = $$.config;
+ if (arguments.length > 1) {
+ config.axis_x_categories[i] = category;
+ $$.redraw();
+ }
+ return config.axis_x_categories[i];
+ };
+ c3_chart_fn.categories = function (categories) {
+ var $$ = this.internal, config = $$.config;
+ if (!arguments.length) { return config.axis_x_categories; }
+ config.axis_x_categories = categories;
+ $$.redraw();
+ return config.axis_x_categories;
+ };
+
+ // TODO: fix
+ c3_chart_fn.color = function (id) {
+ var $$ = this.internal;
+ return $$.color(id); // more patterns
+ };
+
+ c3_chart_fn.x = function (x) {
+ var $$ = this.internal;
+ if (arguments.length) {
+ $$.updateTargetX($$.data.targets, x);
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ }
+ return $$.data.xs;
+ };
+ c3_chart_fn.xs = function (xs) {
+ var $$ = this.internal;
+ if (arguments.length) {
+ $$.updateTargetXs($$.data.targets, xs);
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ }
+ return $$.data.xs;
+ };
+
+ c3_chart_fn.axis = function () {};
+ c3_chart_fn.axis.labels = function (labels) {
+ var $$ = this.internal;
+ if (arguments.length) {
+ Object.keys(labels).forEach(function (axisId) {
+ $$.setAxisLabelText(axisId, labels[axisId]);
+ });
+ $$.updateAxisLabels();
+ }
+ // TODO: return some values?
+ };
+ c3_chart_fn.axis.max = function (max) {
+ var $$ = this.internal, config = $$.config;
+ if (arguments.length) {
+ if (typeof max === 'object') {
+ if (isValue(max.x)) { config.axis_x_max = max.x; }
+ if (isValue(max.y)) { config.axis_y_max = max.y; }
+ if (isValue(max.y2)) { config.axis_y2_max = max.y2; }
+ } else {
+ config.axis_y_max = config.axis_y2_max = max;
+ }
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ }
+ };
+ c3_chart_fn.axis.min = function (min) {
+ var $$ = this.internal, config = $$.config;
+ if (arguments.length) {
+ if (typeof min === 'object') {
+ if (isValue(min.x)) { config.axis_x_min = min.x; }
+ if (isValue(min.y)) { config.axis_y_min = min.y; }
+ if (isValue(min.y2)) { config.axis_y2_min = min.y2; }
+ } else {
+ config.axis_y_min = config.axis_y2_min = min;
+ }
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ }
+ };
+ c3_chart_fn.axis.range = function (range) {
+ if (arguments.length) {
+ if (isDefined(range.max)) { this.axis.max(range.max); }
+ if (isDefined(range.min)) { this.axis.min(range.min); }
+ }
+ };
+
+ c3_chart_fn.legend = function () {};
+ c3_chart_fn.legend.show = function (targetIds) {
+ var $$ = this.internal;
+ $$.showLegend($$.mapToTargetIds(targetIds));
+ $$.updateAndRedraw({withLegend: true});
+ };
+ c3_chart_fn.legend.hide = function (targetIds) {
+ var $$ = this.internal;
+ $$.hideLegend($$.mapToTargetIds(targetIds));
+ $$.updateAndRedraw({withLegend: true});
+ };
+
+ c3_chart_fn.resize = function (size) {
+ var $$ = this.internal, config = $$.config;
+ config.size_width = size ? size.width : null;
+ config.size_height = size ? size.height : null;
+ this.flush();
+ };
+
+ c3_chart_fn.flush = function () {
+ var $$ = this.internal;
+ $$.updateAndRedraw({withLegend: true, withTransition: false, withTransitionForTransform: false});
+ };
+
+ c3_chart_fn.destroy = function () {
+ var $$ = this.internal;
+ $$.data.targets = undefined;
+ $$.data.xs = {};
+ $$.selectChart.classed('c3', false).html("");
+ window.onresize = null;
+ };
+
+ // Features:
+ // 1. category axis
+ // 2. ceil values of translate/x/y to int for half pixel antialiasing
+ function c3_axis(d3, isCategory) {
+ var scale = d3.scale.linear(), orient = "bottom", innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickValues = null, tickFormat, tickArguments;
+
+ var tickOffset = 0, tickCulling = true, tickCentered;
+
+ function axisX(selection, x) {
+ selection.attr("transform", function (d) {
+ return "translate(" + Math.ceil(x(d) + tickOffset) + ", 0)";
+ });
+ }
+ function axisY(selection, y) {
+ selection.attr("transform", function (d) {
+ return "translate(0," + Math.ceil(y(d)) + ")";
+ });
+ }
+ function scaleExtent(domain) {
+ var start = domain[0], stop = domain[domain.length - 1];
+ return start < stop ? [ start, stop ] : [ stop, start ];
+ }
+ function generateTicks(scale) {
+ var i, domain, ticks = [];
+ if (scale.ticks) {
+ return scale.ticks.apply(scale, tickArguments);
+ }
+ domain = scale.domain();
+ for (i = Math.ceil(domain[0]); i < domain[1]; i++) {
+ ticks.push(i);
+ }
+ if (ticks.length > 0 && ticks[0] > 0) {
+ ticks.unshift(ticks[0] - (ticks[1] - ticks[0]));
+ }
+ return ticks;
+ }
+ function copyScale() {
+ var newScale = scale.copy(), domain;
+ if (isCategory) {
+ domain = scale.domain();
+ newScale.domain([domain[0], domain[1] - 1]);
+ }
+ return newScale;
+ }
+ function textFormatted(v) {
+ return tickFormat ? tickFormat(v) : v;
+ }
+ function axis(g) {
+ g.each(function () {
+ var g = d3.select(this);
+ var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = copyScale();
+
+ var ticks = tickValues ? tickValues : generateTicks(scale1),
+ tick = g.selectAll(".tick").data(ticks, scale1),
+ tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", 1e-6),
+ // MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.
+ tickExit = tick.exit().remove(),
+ tickUpdate = d3.transition(tick).style("opacity", 1),
+ tickTransform, tickX;
+
+ var range = scale.rangeExtent ? scale.rangeExtent() : scaleExtent(scale.range()),
+ path = g.selectAll(".domain").data([ 0 ]),
+ pathUpdate = (path.enter().append("path").attr("class", "domain"), d3.transition(path));
+ tickEnter.append("line");
+ tickEnter.append("text");
+
+ var lineEnter = tickEnter.select("line"),
+ lineUpdate = tickUpdate.select("line"),
+ text = tick.select("text").text(textFormatted),
+ textEnter = tickEnter.select("text"),
+ textUpdate = tickUpdate.select("text");
+
+ if (isCategory) {
+ tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2);
+ tickX = tickCentered ? 0 : tickOffset;
+ } else {
+ tickOffset = tickX = 0;
+ }
+
+ function tickSize(d) {
+ var tickPosition = scale(d) + tickOffset;
+ return range[0] < tickPosition && tickPosition < range[1] ? innerTickSize : 0;
+ }
+
+ switch (orient) {
+ case "bottom":
+ {
+ tickTransform = axisX;
+ lineEnter.attr("y2", innerTickSize);
+ textEnter.attr("y", Math.max(innerTickSize, 0) + tickPadding);
+ lineUpdate.attr("x1", tickX).attr("x2", tickX).attr("y2", tickSize);
+ textUpdate.attr("x", 0).attr("y", Math.max(innerTickSize, 0) + tickPadding);
+ text.attr("dy", ".71em").style("text-anchor", "middle");
+ pathUpdate.attr("d", "M" + range[0] + "," + outerTickSize + "V0H" + range[1] + "V" + outerTickSize);
+ break;
+ }
+ case "top":
+ {
+ tickTransform = axisX;
+ lineEnter.attr("y2", -innerTickSize);
+ textEnter.attr("y", -(Math.max(innerTickSize, 0) + tickPadding));
+ lineUpdate.attr("x2", 0).attr("y2", -innerTickSize);
+ textUpdate.attr("x", 0).attr("y", -(Math.max(innerTickSize, 0) + tickPadding));
+ text.attr("dy", "0em").style("text-anchor", "middle");
+ pathUpdate.attr("d", "M" + range[0] + "," + -outerTickSize + "V0H" + range[1] + "V" + -outerTickSize);
+ break;
+ }
+ case "left":
+ {
+ tickTransform = axisY;
+ lineEnter.attr("x2", -innerTickSize);
+ textEnter.attr("x", -(Math.max(innerTickSize, 0) + tickPadding));
+ lineUpdate.attr("x2", -innerTickSize).attr("y2", 0);
+ textUpdate.attr("x", -(Math.max(innerTickSize, 0) + tickPadding)).attr("y", tickOffset);
+ text.attr("dy", ".32em").style("text-anchor", "end");
+ pathUpdate.attr("d", "M" + -outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + -outerTickSize);
+ break;
+ }
+ case "right":
+ {
+ tickTransform = axisY;
+ lineEnter.attr("x2", innerTickSize);
+ textEnter.attr("x", Math.max(innerTickSize, 0) + tickPadding);
+ lineUpdate.attr("x2", innerTickSize).attr("y2", 0);
+ textUpdate.attr("x", Math.max(innerTickSize, 0) + tickPadding).attr("y", 0);
+ text.attr("dy", ".32em").style("text-anchor", "start");
+ pathUpdate.attr("d", "M" + outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + outerTickSize);
+ break;
+ }
+ }
+ if (scale1.rangeBand) {
+ var x = scale1, dx = x.rangeBand() / 2;
+ scale0 = scale1 = function (d) {
+ return x(d) + dx;
+ };
+ } else if (scale0.rangeBand) {
+ scale0 = scale1;
+ } else {
+ tickExit.call(tickTransform, scale1);
+ }
+ tickEnter.call(tickTransform, scale0);
+ tickUpdate.call(tickTransform, scale1);
+ });
+ }
+ axis.scale = function (x) {
+ if (!arguments.length) { return scale; }
+ scale = x;
+ return axis;
+ };
+ axis.orient = function (x) {
+ if (!arguments.length) { return orient; }
+ orient = x in {top: 1, right: 1, bottom: 1, left: 1} ? x + "" : "bottom";
+ return axis;
+ };
+ axis.tickFormat = function (format) {
+ if (!arguments.length) { return tickFormat; }
+ tickFormat = format;
+ return axis;
+ };
+ axis.tickCentered = function (isCentered) {
+ if (!arguments.length) { return tickCentered; }
+ tickCentered = isCentered;
+ return axis;
+ };
+ axis.tickOffset = function () { // This will be overwritten when normal x axis
+ return tickOffset;
+ };
+ axis.ticks = function () {
+ if (!arguments.length) { return tickArguments; }
+ tickArguments = arguments;
+ return axis;
+ };
+ axis.tickCulling = function (culling) {
+ if (!arguments.length) { return tickCulling; }
+ tickCulling = culling;
+ return axis;
+ };
+ axis.tickValues = function (x) {
+ if (typeof x === 'function') {
+ tickValues = function () {
+ return x(scale.domain());
+ };
+ }
+ else {
+ if (!arguments.length) { return tickValues; }
+ tickValues = x;
+ }
+ return axis;
+ };
+ return axis;
+ }
+
+ if (typeof define === 'function' && define.amd) {
+ define("c3", ["d3"], c3);
+ } else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
+ module.exports = c3;
+ } else {
+ window.c3 = c3;
+ }
+
+})(window);
diff --git a/shrine-webclient/src/main/html/js-ext/c3code/c3.js.new b/shrine-webclient/src/main/html/js-ext/c3code/c3.js.new
new file mode 100644
index 000000000..233d1b536
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/c3code/c3.js.new
@@ -0,0 +1,7049 @@
+(function (window) {
+ 'use strict';
+
+ /*global define, module, exports, require */
+
+ var c3 = { version: "0.4.10" };
+
+ var c3_chart_fn,
+ c3_chart_internal_fn,
+ c3_chart_internal_axis_fn;
+
+ function API(owner) {
+ this.owner = owner;
+ }
+
+ function inherit(base, derived) {
+
+ if (Object.create) {
+ derived.prototype = Object.create(base.prototype);
+ } else {
+ var f = function f() {};
+ f.prototype = base.prototype;
+ derived.prototype = new f();
+ }
+
+ derived.prototype.constructor = derived;
+
+ return derived;
+ }
+
+ function Chart(config) {
+ var $$ = this.internal = new ChartInternal(this);
+ $$.loadConfig(config);
+ $$.init();
+
+ // bind "this" to nested API
+ (function bindThis(fn, target, argThis) {
+ Object.keys(fn).forEach(function (key) {
+ target[key] = fn[key].bind(argThis);
+ if (Object.keys(fn[key]).length > 0) {
+ bindThis(fn[key], target[key], argThis);
+ }
+ });
+ })(c3_chart_fn, this, this);
+ }
+
+ function ChartInternal(api) {
+ var $$ = this;
+ $$.d3 = window.d3 ? window.d3 : typeof require !== 'undefined' ? require("d3") : undefined;
+ $$.api = api;
+ $$.config = $$.getDefaultConfig();
+ $$.data = {};
+ $$.cache = {};
+ $$.axes = {};
+ }
+
+ c3.generate = function (config) {
+ return new Chart(config);
+ };
+
+ c3.chart = {
+ fn: Chart.prototype,
+ internal: {
+ fn: ChartInternal.prototype,
+ axis: {
+ fn: Axis.prototype
+ }
+ }
+ };
+ c3_chart_fn = c3.chart.fn;
+ c3_chart_internal_fn = c3.chart.internal.fn;
+ c3_chart_internal_axis_fn = c3.chart.internal.axis.fn;
+
+ c3_chart_internal_fn.init = function () {
+ var $$ = this, config = $$.config;
+
+ $$.initParams();
+
+ if (config.data_url) {
+ $$.convertUrlToData(config.data_url, config.data_mimeType, config.data_keys, $$.initWithData);
+ }
+ else if (config.data_json) {
+ $$.initWithData($$.convertJsonToData(config.data_json, config.data_keys));
+ }
+ else if (config.data_rows) {
+ $$.initWithData($$.convertRowsToData(config.data_rows));
+ }
+ else if (config.data_columns) {
+ $$.initWithData($$.convertColumnsToData(config.data_columns));
+ }
+ else {
+ throw Error('url or json or rows or columns is required.');
+ }
+ };
+
+ c3_chart_internal_fn.initParams = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+
+ // MEMO: clipId needs to be unique because it conflicts when multiple charts exist
+ $$.clipId = "c3-" + (+new Date()) + '-clip',
+ $$.clipIdForXAxis = $$.clipId + '-xaxis',
+ $$.clipIdForYAxis = $$.clipId + '-yaxis',
+ $$.clipIdForGrid = $$.clipId + '-grid',
+ $$.clipIdForSubchart = $$.clipId + '-subchart',
+ $$.clipPath = $$.getClipPath($$.clipId),
+ $$.clipPathForXAxis = $$.getClipPath($$.clipIdForXAxis),
+ $$.clipPathForYAxis = $$.getClipPath($$.clipIdForYAxis);
+ $$.clipPathForGrid = $$.getClipPath($$.clipIdForGrid),
+ $$.clipPathForSubchart = $$.getClipPath($$.clipIdForSubchart),
+
+ $$.dragStart = null;
+ $$.dragging = false;
+ $$.flowing = false;
+ $$.cancelClick = false;
+ $$.mouseover = false;
+ $$.transiting = false;
+
+ $$.color = $$.generateColor();
+ $$.levelColor = $$.generateLevelColor();
+
+ $$.dataTimeFormat = config.data_xLocaltime ? d3.time.format : d3.time.format.utc;
+ $$.axisTimeFormat = config.axis_x_localtime ? d3.time.format : d3.time.format.utc;
+ $$.defaultAxisTimeFormat = $$.axisTimeFormat.multi([
+ [".%L", function (d) { return d.getMilliseconds(); }],
+ [":%S", function (d) { return d.getSeconds(); }],
+ ["%I:%M", function (d) { return d.getMinutes(); }],
+ ["%I %p", function (d) { return d.getHours(); }],
+ ["%-m/%-d", function (d) { return d.getDay() && d.getDate() !== 1; }],
+ ["%-m/%-d", function (d) { return d.getDate() !== 1; }],
+ ["%-m/%-d", function (d) { return d.getMonth(); }],
+ ["%Y/%-m/%-d", function () { return true; }]
+ ]);
+
+ $$.hiddenTargetIds = [];
+ $$.hiddenLegendIds = [];
+ $$.focusedTargetIds = [];
+ $$.defocusedTargetIds = [];
+
+ $$.xOrient = config.axis_rotated ? "left" : "bottom";
+ $$.yOrient = config.axis_rotated ? (config.axis_y_inner ? "top" : "bottom") : (config.axis_y_inner ? "right" : "left");
+ $$.y2Orient = config.axis_rotated ? (config.axis_y2_inner ? "bottom" : "top") : (config.axis_y2_inner ? "left" : "right");
+ $$.subXOrient = config.axis_rotated ? "left" : "bottom";
+
+ $$.isLegendRight = config.legend_position === 'right';
+ $$.isLegendInset = config.legend_position === 'inset';
+ $$.isLegendTop = config.legend_inset_anchor === 'top-left' || config.legend_inset_anchor === 'top-right';
+ $$.isLegendLeft = config.legend_inset_anchor === 'top-left' || config.legend_inset_anchor === 'bottom-left';
+ $$.legendStep = 0;
+ $$.legendItemWidth = 0;
+ $$.legendItemHeight = 0;
+
+ $$.currentMaxTickWidths = {
+ x: 0,
+ y: 0,
+ y2: 0
+ };
+
+ $$.rotated_padding_left = 30;
+ $$.rotated_padding_right = config.axis_rotated && !config.axis_x_show ? 0 : 30;
+ $$.rotated_padding_top = 5;
+
+ $$.withoutFadeIn = {};
+
+ $$.intervalForObserveInserted = undefined;
+
+ $$.axes.subx = d3.selectAll([]); // needs when excluding subchart.js
+ };
+
+ c3_chart_internal_fn.initChartElements = function () {
+ if (this.initBar) { this.initBar(); }
+ if (this.initLine) { this.initLine(); }
+ if (this.initArc) { this.initArc(); }
+ if (this.initGauge) { this.initGauge(); }
+ if (this.initText) { this.initText(); }
+ };
+
+ c3_chart_internal_fn.initWithData = function (data) {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ var defs, main, binding = true;
+
+ $$.axis = new Axis($$);
+
+ if ($$.initPie) { $$.initPie(); }
+ if ($$.initBrush) { $$.initBrush(); }
+ if ($$.initZoom) { $$.initZoom(); }
+
+ if (!config.bindto) {
+ $$.selectChart = d3.selectAll([]);
+ }
+ else if (typeof config.bindto.node === 'function') {
+ $$.selectChart = config.bindto;
+ }
+ else {
+ $$.selectChart = d3.select(config.bindto);
+ }
+ if ($$.selectChart.empty()) {
+ $$.selectChart = d3.select(document.createElement('div')).style('opacity', 0);
+ $$.observeInserted($$.selectChart);
+ binding = false;
+ }
+ $$.selectChart.html("").classed("c3", true);
+
+ // Init data as targets
+ $$.data.xs = {};
+ $$.data.targets = $$.convertDataToTargets(data);
+
+ if (config.data_filter) {
+ $$.data.targets = $$.data.targets.filter(config.data_filter);
+ }
+
+ // Set targets to hide if needed
+ if (config.data_hide) {
+ $$.addHiddenTargetIds(config.data_hide === true ? $$.mapToIds($$.data.targets) : config.data_hide);
+ }
+ if (config.legend_hide) {
+ $$.addHiddenLegendIds(config.legend_hide === true ? $$.mapToIds($$.data.targets) : config.legend_hide);
+ }
+
+ // when gauge, hide legend // TODO: fix
+ if ($$.hasType('gauge')) {
+ config.legend_show = false;
+ }
+
+ // Init sizes and scales
+ $$.updateSizes();
+ $$.updateScales();
+
+ // Set domains for each scale
+ $$.x.domain(d3.extent($$.getXDomain($$.data.targets)));
+ $$.y.domain($$.getYDomain($$.data.targets, 'y'));
+ $$.y2.domain($$.getYDomain($$.data.targets, 'y2'));
+ $$.subX.domain($$.x.domain());
+ $$.subY.domain($$.y.domain());
+ $$.subY2.domain($$.y2.domain());
+
+ // Save original x domain for zoom update
+ $$.orgXDomain = $$.x.domain();
+
+ // Set initialized scales to brush and zoom
+ if ($$.brush) { $$.brush.scale($$.subX); }
+ if (config.zoom_enabled) { $$.zoom.scale($$.x); }
+
+ /*-- Basic Elements --*/
+
+ // Define svgs
+ $$.svg = $$.selectChart.append("svg")
+ .style("overflow", "hidden")
+ .on('mouseenter', function () { return config.onmouseover.call($$); })
+ .on('mouseleave', function () { return config.onmouseout.call($$); });
+
+ // Define defs
+ defs = $$.svg.append("defs");
+ $$.clipChart = $$.appendClip(defs, $$.clipId);
+ $$.clipXAxis = $$.appendClip(defs, $$.clipIdForXAxis);
+ $$.clipYAxis = $$.appendClip(defs, $$.clipIdForYAxis);
+ $$.clipGrid = $$.appendClip(defs, $$.clipIdForGrid);
+ $$.clipSubchart = $$.appendClip(defs, $$.clipIdForSubchart);
+ $$.updateSvgSize();
+
+ // Define regions
+ main = $$.main = $$.svg.append("g").attr("transform", $$.getTranslate('main'));
+
+ if ($$.initSubchart) { $$.initSubchart(); }
+ if ($$.initTooltip) { $$.initTooltip(); }
+ if ($$.initLegend) { $$.initLegend(); }
+
+ /*-- Main Region --*/
+
+ // text when empty
+ main.append("text")
+ .attr("class", CLASS.text + ' ' + CLASS.empty)
+ .attr("text-anchor", "middle") // horizontal centering of text at x position in all browsers.
+ .attr("dominant-baseline", "middle"); // vertical centering of text at y position in all browsers, except IE.
+
+ // Regions
+ $$.initRegion();
+
+ // Grids
+ $$.initGrid();
+
+ // Define g for chart area
+ main.append('g')
+ .attr("clip-path", $$.clipPath)
+ .attr('class', CLASS.chart);
+
+ // Grid lines
+ if (config.grid_lines_front) { $$.initGridLines(); }
+
+ // Cover whole with rects for events
+ $$.initEventRect();
+
+ // Define g for chart
+ $$.initChartElements();
+
+ // if zoom privileged, insert rect to forefront
+ // TODO: is this needed?
+ main.insert('rect', config.zoom_privileged ? null : 'g.' + CLASS.regions)
+ .attr('class', CLASS.zoomRect)
+ .attr('width', $$.width)
+ .attr('height', $$.height)
+ .style('opacity', 0)
+ .on("dblclick.zoom", null);
+
+ // Set default extent if defined
+ if (config.axis_x_extent) { $$.brush.extent($$.getDefaultExtent()); }
+
+ // Add Axis
+ $$.axis.init();
+
+ // Set targets
+ $$.updateTargets($$.data.targets);
+
+ // Draw with targets
+ if (binding) {
+ $$.updateDimension();
+ $$.config.oninit.call($$);
+ $$.redraw({
+ withTransition: false,
+ withTransform: true,
+ withUpdateXDomain: true,
+ withUpdateOrgXDomain: true,
+ withTransitionForAxis: false
+ });
+ }
+
+ // Bind resize event
+ if (window.onresize == null) {
+ window.onresize = $$.generateResize();
+ }
+ if (window.onresize.add) {
+ window.onresize.add(function () {
+ config.onresize.call($$);
+ });
+ window.onresize.add(function () {
+ $$.api.flush();
+ });
+ window.onresize.add(function () {
+ config.onresized.call($$);
+ });
+ }
+
+ // export element of the chart
+ $$.api.element = $$.selectChart.node();
+ };
+
+ c3_chart_internal_fn.smoothLines = function (el, type) {
+ var $$ = this;
+ if (type === 'grid') {
+ el.each(function () {
+ var g = $$.d3.select(this),
+ x1 = g.attr('x1'),
+ x2 = g.attr('x2'),
+ y1 = g.attr('y1'),
+ y2 = g.attr('y2');
+ g.attr({
+ 'x1': Math.ceil(x1),
+ 'x2': Math.ceil(x2),
+ 'y1': Math.ceil(y1),
+ 'y2': Math.ceil(y2)
+ });
+ });
+ }
+ };
+
+
+ c3_chart_internal_fn.updateSizes = function () {
+ var $$ = this, config = $$.config;
+ var legendHeight = $$.legend ? $$.getLegendHeight() : 0,
+ legendWidth = $$.legend ? $$.getLegendWidth() : 0,
+ legendHeightForBottom = $$.isLegendRight || $$.isLegendInset ? 0 : legendHeight,
+ hasArc = $$.hasArcType(),
+ xAxisHeight = config.axis_rotated || hasArc ? 0 : $$.getHorizontalAxisHeight('x'),
+ subchartHeight = config.subchart_show && !hasArc ? (config.subchart_size_height + xAxisHeight) : 0;
+
+ $$.currentWidth = $$.getCurrentWidth();
+ $$.currentHeight = $$.getCurrentHeight();
+
+ // for main
+ $$.margin = config.axis_rotated ? {
+ top: $$.getHorizontalAxisHeight('y2') + $$.getCurrentPaddingTop(),
+ right: hasArc ? 0 : $$.getCurrentPaddingRight(),
+ bottom: $$.getHorizontalAxisHeight('y') + legendHeightForBottom + $$.getCurrentPaddingBottom(),
+ left: subchartHeight + (hasArc ? 0 : $$.getCurrentPaddingLeft())
+ } : {
+ top: 4 + $$.getCurrentPaddingTop(), // for top tick text
+ right: hasArc ? 0 : $$.getCurrentPaddingRight(),
+ bottom: xAxisHeight + subchartHeight + legendHeightForBottom + $$.getCurrentPaddingBottom(),
+ left: hasArc ? 0 : $$.getCurrentPaddingLeft()
+ };
+
+ // for subchart
+ $$.margin2 = config.axis_rotated ? {
+ top: $$.margin.top,
+ right: NaN,
+ bottom: 20 + legendHeightForBottom,
+ left: $$.rotated_padding_left
+ } : {
+ top: $$.currentHeight - subchartHeight - legendHeightForBottom,
+ right: NaN,
+ bottom: xAxisHeight + legendHeightForBottom,
+ left: $$.margin.left
+ };
+
+ // for legend
+ $$.margin3 = {
+ top: 0,
+ right: NaN,
+ bottom: 0,
+ left: 0
+ };
+ if ($$.updateSizeForLegend) { $$.updateSizeForLegend(legendHeight, legendWidth); }
+
+ $$.width = $$.currentWidth - $$.margin.left - $$.margin.right;
+ $$.height = $$.currentHeight - $$.margin.top - $$.margin.bottom;
+ if ($$.width < 0) { $$.width = 0; }
+ if ($$.height < 0) { $$.height = 0; }
+
+ $$.width2 = config.axis_rotated ? $$.margin.left - $$.rotated_padding_left - $$.rotated_padding_right : $$.width;
+ $$.height2 = config.axis_rotated ? $$.height : $$.currentHeight - $$.margin2.top - $$.margin2.bottom;
+ if ($$.width2 < 0) { $$.width2 = 0; }
+ if ($$.height2 < 0) { $$.height2 = 0; }
+
+ // for arc
+ $$.arcWidth = $$.width - ($$.isLegendRight ? legendWidth + 10 : 0);
+ $$.arcHeight = $$.height - ($$.isLegendRight ? 0 : 10);
+ if ($$.hasType('gauge')) {
+ $$.arcHeight += $$.height - $$.getGaugeLabelHeight();
+ }
+ if ($$.updateRadius) { $$.updateRadius(); }
+
+ if ($$.isLegendRight && hasArc) {
+ $$.margin3.left = $$.arcWidth / 2 + $$.radiusExpanded * 1.1;
+ }
+ };
+
+ c3_chart_internal_fn.updateTargets = function (targets) {
+ var $$ = this;
+
+ /*-- Main --*/
+
+ //-- Text --//
+ $$.updateTargetsForText(targets);
+
+ //-- Bar --//
+ $$.updateTargetsForBar(targets);
+
+ //-- Line --//
+ $$.updateTargetsForLine(targets);
+
+ //-- Arc --//
+ if ($$.hasArcType() && $$.updateTargetsForArc) { $$.updateTargetsForArc(targets); }
+
+ /*-- Sub --*/
+
+ if ($$.updateTargetsForSubchart) { $$.updateTargetsForSubchart(targets); }
+
+ // Fade-in each chart
+ $$.showTargets();
+ };
+ c3_chart_internal_fn.showTargets = function () {
+ var $$ = this;
+ $$.svg.selectAll('.' + CLASS.target).filter(function (d) { return $$.isTargetToShow(d.id); })
+ .transition().duration($$.config.transition_duration)
+ .style("opacity", 1);
+ };
+
+ c3_chart_internal_fn.redraw = function (options, transitions) {
+ var $$ = this, main = $$.main, d3 = $$.d3, config = $$.config;
+ var areaIndices = $$.getShapeIndices($$.isAreaType), barIndices = $$.getShapeIndices($$.isBarType), lineIndices = $$.getShapeIndices($$.isLineType);
+ var withY, withSubchart, withTransition, withTransitionForExit, withTransitionForAxis,
+ withTransform, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain, withLegend,
+ withEventRect, withDimension, withUpdateXAxis;
+ var hideAxis = $$.hasArcType();
+ var drawArea, drawBar, drawLine, xForText, yForText;
+ var duration, durationForExit, durationForAxis;
+ var waitForDraw, flow;
+ var targetsToShow = $$.filterTargetsToShow($$.data.targets), tickValues, i, intervalForCulling, xDomainForZoom;
+ var xv = $$.xv.bind($$), cx, cy;
+
+ options = options || {};
+ withY = getOption(options, "withY", true);
+ withSubchart = getOption(options, "withSubchart", true);
+ withTransition = getOption(options, "withTransition", true);
+ withTransform = getOption(options, "withTransform", false);
+ withUpdateXDomain = getOption(options, "withUpdateXDomain", false);
+ withUpdateOrgXDomain = getOption(options, "withUpdateOrgXDomain", false);
+ withTrimXDomain = getOption(options, "withTrimXDomain", true);
+ withUpdateXAxis = getOption(options, "withUpdateXAxis", withUpdateXDomain);
+ withLegend = getOption(options, "withLegend", false);
+ withEventRect = getOption(options, "withEventRect", true);
+ withDimension = getOption(options, "withDimension", true);
+ withTransitionForExit = getOption(options, "withTransitionForExit", withTransition);
+ withTransitionForAxis = getOption(options, "withTransitionForAxis", withTransition);
+
+ duration = withTransition ? config.transition_duration : 0;
+ durationForExit = withTransitionForExit ? duration : 0;
+ durationForAxis = withTransitionForAxis ? duration : 0;
+
+ transitions = transitions || $$.axis.generateTransitions(durationForAxis);
+
+ // update legend and transform each g
+ if (withLegend && config.legend_show) {
+ $$.updateLegend($$.mapToIds($$.data.targets), options, transitions);
+ } else if (withDimension) {
+ // need to update dimension (e.g. axis.y.tick.values) because y tick values should change
+ // no need to update axis in it because they will be updated in redraw()
+ $$.updateDimension(true);
+ }
+
+ // MEMO: needed for grids calculation
+ if ($$.isCategorized() && targetsToShow.length === 0) {
+ $$.x.domain([0, $$.axes.x.selectAll('.tick').size()]);
+ }
+
+ if (targetsToShow.length) {
+ $$.updateXDomain(targetsToShow, withUpdateXDomain, withUpdateOrgXDomain, withTrimXDomain);
+ if (!config.axis_x_tick_values) {
+ tickValues = $$.axis.updateXAxisTickValues(targetsToShow);
+ }
+ } else {
+ $$.xAxis.tickValues([]);
+ $$.subXAxis.tickValues([]);
+ }
+
+ if (config.zoom_rescale && !options.flow) {
+ xDomainForZoom = $$.x.orgDomain();
+ }
+
+ $$.y.domain($$.getYDomain(targetsToShow, 'y', xDomainForZoom));
+ $$.y2.domain($$.getYDomain(targetsToShow, 'y2', xDomainForZoom));
+
+ if (!config.axis_y_tick_values && config.axis_y_tick_count) {
+ $$.yAxis.tickValues($$.axis.generateTickValues($$.y.domain(), config.axis_y_tick_count));
+ }
+ if (!config.axis_y2_tick_values && config.axis_y2_tick_count) {
+ $$.y2Axis.tickValues($$.axis.generateTickValues($$.y2.domain(), config.axis_y2_tick_count));
+ }
+
+ // axes
+ $$.axis.redraw(transitions, hideAxis);
+
+ // Update axis label
+ $$.axis.updateLabels(withTransition);
+
+ // show/hide if manual culling needed
+ if ((withUpdateXDomain || withUpdateXAxis) && targetsToShow.length) {
+ if (config.axis_x_tick_culling && tickValues) {
+ for (i = 1; i < tickValues.length; i++) {
+ if (tickValues.length / i < config.axis_x_tick_culling_max) {
+ intervalForCulling = i;
+ break;
+ }
+ }
+ $$.svg.selectAll('.' + CLASS.axisX + ' .tick text').each(function (e) {
+ var index = tickValues.indexOf(e);
+ if (index >= 0) {
+ d3.select(this).style('display', index % intervalForCulling ? 'none' : 'block');
+ }
+ });
+ } else {
+ $$.svg.selectAll('.' + CLASS.axisX + ' .tick text').style('display', 'block');
+ }
+ }
+
+ // setup drawer - MEMO: these must be called after axis updated
+ drawArea = $$.generateDrawArea ? $$.generateDrawArea(areaIndices, false) : undefined;
+ drawBar = $$.generateDrawBar ? $$.generateDrawBar(barIndices) : undefined;
+ drawLine = $$.generateDrawLine ? $$.generateDrawLine(lineIndices, false) : undefined;
+ xForText = $$.generateXYForText(areaIndices, barIndices, lineIndices, true);
+ yForText = $$.generateXYForText(areaIndices, barIndices, lineIndices, false);
+
+ // Update sub domain
+ if (withY) {
+ $$.subY.domain($$.getYDomain(targetsToShow, 'y'));
+ $$.subY2.domain($$.getYDomain(targetsToShow, 'y2'));
+ }
+
+ // tooltip
+ $$.tooltip.style("display", "none");
+
+ // xgrid focus
+ $$.updateXgridFocus();
+
+ // Data empty label positioning and text.
+ main.select("text." + CLASS.text + '.' + CLASS.empty)
+ .attr("x", $$.width / 2)
+ .attr("y", $$.height / 2)
+ .text(config.data_empty_label_text)
+ .transition()
+ .style('opacity', targetsToShow.length ? 0 : 1);
+
+ // grid
+ $$.updateGrid(duration);
+
+ // rect for regions
+ $$.updateRegion(duration);
+
+ // bars
+ $$.updateBar(durationForExit);
+
+ // lines, areas and cricles
+ $$.updateLine(durationForExit);
+ $$.updateArea(durationForExit);
+ $$.updateCircle();
+
+ // text
+ if ($$.hasDataLabel()) {
+ $$.updateText(durationForExit);
+ }
+
+ // arc
+ if ($$.redrawArc) { $$.redrawArc(duration, durationForExit, withTransform); }
+
+ // subchart
+ if ($$.redrawSubchart) {
+ $$.redrawSubchart(withSubchart, transitions, duration, durationForExit, areaIndices, barIndices, lineIndices);
+ }
+
+ // circles for select
+ main.selectAll('.' + CLASS.selectedCircles)
+ .filter($$.isBarType.bind($$))
+ .selectAll('circle')
+ .remove();
+
+ // event rects will redrawn when flow called
+ if (config.interaction_enabled && !options.flow && withEventRect) {
+ $$.redrawEventRect();
+ if ($$.updateZoom) { $$.updateZoom(); }
+ }
+
+ // update circleY based on updated parameters
+ $$.updateCircleY();
+
+ // generate circle x/y functions depending on updated params
+ cx = ($$.config.axis_rotated ? $$.circleY : $$.circleX).bind($$);
+ cy = ($$.config.axis_rotated ? $$.circleX : $$.circleY).bind($$);
+
+ if (options.flow) {
+ flow = $$.generateFlow({
+ targets: targetsToShow,
+ flow: options.flow,
+ duration: options.flow.duration,
+ drawBar: drawBar,
+ drawLine: drawLine,
+ drawArea: drawArea,
+ cx: cx,
+ cy: cy,
+ xv: xv,
+ xForText: xForText,
+ yForText: yForText
+ });
+ }
+
+ if ((duration || flow) && $$.isTabVisible()) { // Only use transition if tab visible. See #938.
+ // transition should be derived from one transition
+ d3.transition().duration(duration).each(function () {
+ var transitionsToWait = [];
+
+ // redraw and gather transitions
+ [
+ $$.redrawBar(drawBar, true),
+ $$.redrawLine(drawLine, true),
+ $$.redrawArea(drawArea, true),
+ $$.redrawCircle(cx, cy, true),
+ $$.redrawText(xForText, yForText, options.flow, true),
+ $$.redrawRegion(true),
+ $$.redrawGrid(true),
+ ].forEach(function (transitions) {
+ transitions.forEach(function (transition) {
+ transitionsToWait.push(transition);
+ });
+ });
+
+ // Wait for end of transitions to call flow and onrendered callback
+ waitForDraw = $$.generateWait();
+ transitionsToWait.forEach(function (t) {
+ waitForDraw.add(t);
+ });
+ })
+ .call(waitForDraw, function () {
+ if (flow) {
+ flow();
+ }
+ if (config.onrendered) {
+ config.onrendered.call($$);
+ }
+ });
+ }
+ else {
+ $$.redrawBar(drawBar);
+ $$.redrawLine(drawLine);
+ $$.redrawArea(drawArea);
+ $$.redrawCircle(cx, cy);
+ $$.redrawText(xForText, yForText, options.flow);
+ $$.redrawRegion();
+ $$.redrawGrid();
+ if (config.onrendered) {
+ config.onrendered.call($$);
+ }
+ }
+
+ // update fadein condition
+ $$.mapToIds($$.data.targets).forEach(function (id) {
+ $$.withoutFadeIn[id] = true;
+ });
+ };
+
+ c3_chart_internal_fn.updateAndRedraw = function (options) {
+ var $$ = this, config = $$.config, transitions;
+ options = options || {};
+ // same with redraw
+ options.withTransition = getOption(options, "withTransition", true);
+ options.withTransform = getOption(options, "withTransform", false);
+ options.withLegend = getOption(options, "withLegend", false);
+ // NOT same with redraw
+ options.withUpdateXDomain = true;
+ options.withUpdateOrgXDomain = true;
+ options.withTransitionForExit = false;
+ options.withTransitionForTransform = getOption(options, "withTransitionForTransform", options.withTransition);
+ // MEMO: this needs to be called before updateLegend and it means this ALWAYS needs to be called)
+ $$.updateSizes();
+ // MEMO: called in updateLegend in redraw if withLegend
+ if (!(options.withLegend && config.legend_show)) {
+ transitions = $$.axis.generateTransitions(options.withTransitionForAxis ? config.transition_duration : 0);
+ // Update scales
+ $$.updateScales();
+ $$.updateSvgSize();
+ // Update g positions
+ $$.transformAll(options.withTransitionForTransform, transitions);
+ }
+ // Draw with new sizes & scales
+ $$.redraw(options, transitions);
+ };
+ c3_chart_internal_fn.redrawWithoutRescale = function () {
+ this.redraw({
+ withY: false,
+ withSubchart: false,
+ withEventRect: false,
+ withTransitionForAxis: false
+ });
+ };
+
+ c3_chart_internal_fn.isTimeSeries = function () {
+ return this.config.axis_x_type === 'timeseries';
+ };
+ c3_chart_internal_fn.isCategorized = function () {
+ return this.config.axis_x_type.indexOf('categor') >= 0;
+ };
+ c3_chart_internal_fn.isCustomX = function () {
+ var $$ = this, config = $$.config;
+ return !$$.isTimeSeries() && (config.data_x || notEmpty(config.data_xs));
+ };
+
+ c3_chart_internal_fn.isTimeSeriesY = function () {
+ return this.config.axis_y_type === 'timeseries';
+ };
+
+ c3_chart_internal_fn.getTranslate = function (target) {
+ var $$ = this, config = $$.config, x, y;
+ if (target === 'main') {
+ x = asHalfPixel($$.margin.left);
+ y = asHalfPixel($$.margin.top);
+ } else if (target === 'context') {
+ x = asHalfPixel($$.margin2.left);
+ y = asHalfPixel($$.margin2.top);
+ } else if (target === 'legend') {
+ x = $$.margin3.left;
+ y = $$.margin3.top;
+ } else if (target === 'x') {
+ x = 0;
+ y = config.axis_rotated ? 0 : $$.height;
+ } else if (target === 'y') {
+ x = 0;
+ y = config.axis_rotated ? $$.height : 0;
+ } else if (target === 'y2') {
+ x = config.axis_rotated ? 0 : $$.width;
+ y = config.axis_rotated ? 1 : 0;
+ } else if (target === 'subx') {
+ x = 0;
+ y = config.axis_rotated ? 0 : $$.height2;
+ } else if (target === 'arc') {
+ x = $$.arcWidth / 2;
+ y = $$.arcHeight / 2;
+ }
+ return "translate(" + x + "," + y + ")";
+ };
+ c3_chart_internal_fn.initialOpacity = function (d) {
+ return d.value !== null && this.withoutFadeIn[d.id] ? 1 : 0;
+ };
+ c3_chart_internal_fn.initialOpacityForCircle = function (d) {
+ return d.value !== null && this.withoutFadeIn[d.id] ? this.opacityForCircle(d) : 0;
+ };
+ c3_chart_internal_fn.opacityForCircle = function (d) {
+ var opacity = this.config.point_show ? 1 : 0;
+ return isValue(d.value) ? (this.isScatterType(d) ? 0.5 : opacity) : 0;
+ };
+ c3_chart_internal_fn.opacityForText = function () {
+ return this.hasDataLabel() ? 1 : 0;
+ };
+ c3_chart_internal_fn.xx = function (d) {
+ return d ? this.x(d.x) : null;
+ };
+ c3_chart_internal_fn.xv = function (d) {
+ var $$ = this, value = d.value;
+ if ($$.isTimeSeries()) {
+ value = $$.parseDate(d.value);
+ }
+ else if ($$.isCategorized() && typeof d.value === 'string') {
+ value = $$.config.axis_x_categories.indexOf(d.value);
+ }
+ return Math.ceil($$.x(value));
+ };
+ c3_chart_internal_fn.yv = function (d) {
+ var $$ = this,
+ yScale = d.axis && d.axis === 'y2' ? $$.y2 : $$.y;
+ return Math.ceil(yScale(d.value));
+ };
+ c3_chart_internal_fn.subxx = function (d) {
+ return d ? this.subX(d.x) : null;
+ };
+
+ c3_chart_internal_fn.transformMain = function (withTransition, transitions) {
+ var $$ = this,
+ xAxis, yAxis, y2Axis;
+ if (transitions && transitions.axisX) {
+ xAxis = transitions.axisX;
+ } else {
+ xAxis = $$.main.select('.' + CLASS.axisX);
+ if (withTransition) { xAxis = xAxis.transition(); }
+ }
+ if (transitions && transitions.axisY) {
+ yAxis = transitions.axisY;
+ } else {
+ yAxis = $$.main.select('.' + CLASS.axisY);
+ if (withTransition) { yAxis = yAxis.transition(); }
+ }
+ if (transitions && transitions.axisY2) {
+ y2Axis = transitions.axisY2;
+ } else {
+ y2Axis = $$.main.select('.' + CLASS.axisY2);
+ if (withTransition) { y2Axis = y2Axis.transition(); }
+ }
+ (withTransition ? $$.main.transition() : $$.main).attr("transform", $$.getTranslate('main'));
+ xAxis.attr("transform", $$.getTranslate('x'));
+ yAxis.attr("transform", $$.getTranslate('y'));
+ y2Axis.attr("transform", $$.getTranslate('y2'));
+ $$.main.select('.' + CLASS.chartArcs).attr("transform", $$.getTranslate('arc'));
+ };
+ c3_chart_internal_fn.transformAll = function (withTransition, transitions) {
+ var $$ = this;
+ $$.transformMain(withTransition, transitions);
+ if ($$.config.subchart_show) { $$.transformContext(withTransition, transitions); }
+ if ($$.legend) { $$.transformLegend(withTransition); }
+ };
+
+ c3_chart_internal_fn.updateSvgSize = function () {
+ var $$ = this,
+ brush = $$.svg.select(".c3-brush .background");
+ $$.svg.attr('width', $$.currentWidth).attr('height', $$.currentHeight);
+ $$.svg.selectAll(['#' + $$.clipId, '#' + $$.clipIdForGrid]).select('rect')
+ .attr('width', $$.width)
+ .attr('height', $$.height);
+ $$.svg.select('#' + $$.clipIdForXAxis).select('rect')
+ .attr('x', $$.getXAxisClipX.bind($$))
+ .attr('y', $$.getXAxisClipY.bind($$))
+ .attr('width', $$.getXAxisClipWidth.bind($$))
+ .attr('height', $$.getXAxisClipHeight.bind($$));
+ $$.svg.select('#' + $$.clipIdForYAxis).select('rect')
+ .attr('x', $$.getYAxisClipX.bind($$))
+ .attr('y', $$.getYAxisClipY.bind($$))
+ .attr('width', $$.getYAxisClipWidth.bind($$))
+ .attr('height', $$.getYAxisClipHeight.bind($$));
+ $$.svg.select('#' + $$.clipIdForSubchart).select('rect')
+ .attr('width', $$.width)
+ .attr('height', brush.size() ? brush.attr('height') : 0);
+ $$.svg.select('.' + CLASS.zoomRect)
+ .attr('width', $$.width)
+ .attr('height', $$.height);
+ // MEMO: parent div's height will be bigger than svg when <!DOCTYPE html>
+ $$.selectChart.style('max-height', $$.currentHeight + "px");
+ };
+
+
+ c3_chart_internal_fn.updateDimension = function (withoutAxis) {
+ var $$ = this;
+ if (!withoutAxis) {
+ if ($$.config.axis_rotated) {
+ $$.axes.x.call($$.xAxis);
+ $$.axes.subx.call($$.subXAxis);
+ } else {
+ $$.axes.y.call($$.yAxis);
+ $$.axes.y2.call($$.y2Axis);
+ }
+ }
+ $$.updateSizes();
+ $$.updateScales();
+ $$.updateSvgSize();
+ $$.transformAll(false);
+ };
+
+ c3_chart_internal_fn.observeInserted = function (selection) {
+ var $$ = this, observer;
+ if (typeof MutationObserver === 'undefined') {
+ window.console.error("MutationObserver not defined.");
+ return;
+ }
+ observer= new MutationObserver(function (mutations) {
+ mutations.forEach(function (mutation) {
+ if (mutation.type === 'childList' && mutation.previousSibling) {
+ observer.disconnect();
+ // need to wait for completion of load because size calculation requires the actual sizes determined after that completion
+ $$.intervalForObserveInserted = window.setInterval(function () {
+ // parentNode will NOT be null when completed
+ if (selection.node().parentNode) {
+ window.clearInterval($$.intervalForObserveInserted);
+ $$.updateDimension();
+ $$.config.oninit.call($$);
+ $$.redraw({
+ withTransform: true,
+ withUpdateXDomain: true,
+ withUpdateOrgXDomain: true,
+ withTransition: false,
+ withTransitionForTransform: false,
+ withLegend: true
+ });
+ selection.transition().style('opacity', 1);
+ }
+ }, 10);
+ }
+ });
+ });
+ observer.observe(selection.node(), {attributes: true, childList: true, characterData: true});
+ };
+
+
+ c3_chart_internal_fn.generateResize = function () {
+ var resizeFunctions = [];
+ function callResizeFunctions() {
+ resizeFunctions.forEach(function (f) {
+ f();
+ });
+ }
+ callResizeFunctions.add = function (f) {
+ resizeFunctions.push(f);
+ };
+ return callResizeFunctions;
+ };
+
+ c3_chart_internal_fn.endall = function (transition, callback) {
+ var n = 0;
+ transition
+ .each(function () { ++n; })
+ .each("end", function () {
+ if (!--n) { callback.apply(this, arguments); }
+ });
+ };
+ c3_chart_internal_fn.generateWait = function () {
+ var transitionsToWait = [],
+ f = function (transition, callback) {
+ var timer = setInterval(function () {
+ var done = 0;
+ transitionsToWait.forEach(function (t) {
+ if (t.empty()) {
+ done += 1;
+ return;
+ }
+ try {
+ t.transition();
+ } catch (e) {
+ done += 1;
+ }
+ });
+ if (done === transitionsToWait.length) {
+ clearInterval(timer);
+ if (callback) { callback(); }
+ }
+ }, 10);
+ };
+ f.add = function (transition) {
+ transitionsToWait.push(transition);
+ };
+ return f;
+ };
+
+ c3_chart_internal_fn.parseDate = function (date) {
+ var $$ = this, parsedDate;
+ if (date instanceof Date) {
+ parsedDate = date;
+ } else if (typeof date === 'string') {
+ parsedDate = $$.dataTimeFormat($$.config.data_xFormat).parse(date);
+ } else if (typeof date === 'number' || !isNaN(date)) {
+ parsedDate = new Date(+date);
+ }
+ if (!parsedDate || isNaN(+parsedDate)) {
+ window.console.error("Failed to parse x '" + date + "' to Date object");
+ }
+ return parsedDate;
+ };
+
+ c3_chart_internal_fn.isTabVisible = function () {
+ var hidden;
+ if (typeof document.hidden !== "undefined") { // Opera 12.10 and Firefox 18 and later support
+ hidden = "hidden";
+ } else if (typeof document.mozHidden !== "undefined") {
+ hidden = "mozHidden";
+ } else if (typeof document.msHidden !== "undefined") {
+ hidden = "msHidden";
+ } else if (typeof document.webkitHidden !== "undefined") {
+ hidden = "webkitHidden";
+ }
+
+ return document[hidden] ? false : true;
+ };
+
+ c3_chart_internal_fn.getDefaultConfig = function () {
+ var config = {
+ bindto: '#chart',
+ size_width: undefined,
+ size_height: undefined,
+ padding_left: undefined,
+ padding_right: undefined,
+ padding_top: undefined,
+ padding_bottom: undefined,
+ zoom_enabled: false,
+ zoom_extent: undefined,
+ zoom_privileged: false,
+ zoom_rescale: false,
+ zoom_onzoom: function () {},
+ zoom_onzoomstart: function () {},
+ zoom_onzoomend: function () {},
+ interaction_enabled: true,
+ onmouseover: function () {},
+ onmouseout: function () {},
+ onresize: function () {},
+ onresized: function () {},
+ oninit: function () {},
+ onrendered: function () {},
+ transition_duration: 350,
+ data_x: undefined,
+ data_xs: {},
+ data_xFormat: '%Y-%m-%d',
+ data_xLocaltime: true,
+ data_xSort: true,
+ data_idConverter: function (id) { return id; },
+ data_names: {},
+ data_classes: {},
+ data_groups: [],
+ data_axes: {},
+ data_type: undefined,
+ data_types: {},
+ data_labels: {},
+ data_order: 'desc',
+ data_regions: {},
+ data_color: undefined,
+ data_colors: {},
+ data_hide: false,
+ data_filter: undefined,
+ data_selection_enabled: false,
+ data_selection_grouped: false,
+ data_selection_isselectable: function () { return true; },
+ data_selection_multiple: true,
+ data_selection_draggable: false,
+ data_onclick: function () {},
+ data_onmouseover: function () {},
+ data_onmouseout: function () {},
+ data_onselected: function () {},
+ data_onunselected: function () {},
+ data_url: undefined,
+ data_json: undefined,
+ data_rows: undefined,
+ data_columns: undefined,
+ data_mimeType: undefined,
+ data_keys: undefined,
+ // configuration for no plot-able data supplied.
+ data_empty_label_text: "",
+ // subchart
+ subchart_show: false,
+ subchart_size_height: 60,
+ subchart_onbrush: function () {},
+ // color
+ color_pattern: [],
+ color_threshold: {},
+ // legend
+ legend_show: true,
+ legend_hide: false,
+ legend_position: 'bottom',
+ legend_inset_anchor: 'top-left',
+ legend_inset_x: 10,
+ legend_inset_y: 0,
+ legend_inset_step: undefined,
+ legend_item_onclick: undefined,
+ legend_item_onmouseover: undefined,
+ legend_item_onmouseout: undefined,
+ legend_equally: false,
+ // axis
+ axis_rotated: false,
+ axis_x_show: true,
+ axis_x_type: 'indexed',
+ axis_x_localtime: true,
+ axis_x_categories: [],
+ axis_x_tick_centered: false,
+ axis_x_tick_format: undefined,
+ axis_x_tick_culling: {},
+ axis_x_tick_culling_max: 10,
+ axis_x_tick_count: undefined,
+ axis_x_tick_fit: true,
+ axis_x_tick_values: null,
+ axis_x_tick_rotate: 0,
+ axis_x_tick_outer: true,
+ axis_x_tick_multiline: true,
+ axis_x_tick_width: null,
+ axis_x_max: undefined,
+ axis_x_min: undefined,
+ axis_x_padding: {},
+ axis_x_height: undefined,
+ axis_x_extent: undefined,
+ axis_x_label: {},
+ axis_y_show: true,
+ axis_y_type: undefined,
+ axis_y_max: undefined,
+ axis_y_min: undefined,
+ axis_y_inverted: false,
+ axis_y_center: undefined,
+ axis_y_inner: undefined,
+ axis_y_label: {},
+ axis_y_tick_format: undefined,
+ axis_y_tick_outer: true,
+ axis_y_tick_values: null,
+ axis_y_tick_count: undefined,
+ axis_y_tick_time_value: undefined,
+ axis_y_tick_time_interval: undefined,
+ axis_y_padding: {},
+ axis_y_default: undefined,
+ axis_y2_show: false,
+ axis_y2_max: undefined,
+ axis_y2_min: undefined,
+ axis_y2_inverted: false,
+ axis_y2_center: undefined,
+ axis_y2_inner: undefined,
+ axis_y2_label: {},
+ axis_y2_tick_format: undefined,
+ axis_y2_tick_outer: true,
+ axis_y2_tick_values: null,
+ axis_y2_tick_count: undefined,
+ axis_y2_padding: {},
+ axis_y2_default: undefined,
+ // grid
+ grid_x_show: false,
+ grid_x_type: 'tick',
+ grid_x_lines: [],
+ grid_y_show: false,
+ // not used
+ // grid_y_type: 'tick',
+ grid_y_lines: [],
+ grid_y_ticks: 10,
+ grid_focus_show: true,
+ grid_lines_front: true,
+ // point - point of each data
+ point_show: true,
+ point_r: 2.5,
+ point_focus_expand_enabled: true,
+ point_focus_expand_r: undefined,
+ point_select_r: undefined,
+ // line
+ line_connectNull: false,
+ line_step_type: 'step',
+ // bar
+ bar_width: undefined,
+ bar_width_ratio: 0.6,
+ bar_width_max: undefined,
+ bar_zerobased: true,
+ // area
+ area_zerobased: true,
+ // pie
+ pie_label_show: true,
+ pie_label_format: undefined,
+ pie_label_threshold: 0.05,
+ pie_expand: true,
+ // gauge
+ gauge_label_show: true,
+ gauge_label_format: undefined,
+ gauge_expand: true,
+ gauge_min: 0,
+ gauge_max: 100,
+ gauge_units: undefined,
+ gauge_width: undefined,
+ // donut
+ donut_label_show: true,
+ donut_label_format: undefined,
+ donut_label_threshold: 0.05,
+ donut_width: undefined,
+ donut_expand: true,
+ donut_title: "",
+ // region - region to change style
+ regions: [],
+ // tooltip - show when mouseover on each data
+ tooltip_show: true,
+ tooltip_grouped: true,
+ tooltip_format_title: undefined,
+ tooltip_format_name: undefined,
+ tooltip_format_value: undefined,
+ tooltip_position: undefined,
+ tooltip_contents: function (d, defaultTitleFormat, defaultValueFormat, color) {
+ return this.getTooltipContent ? this.getTooltipContent(d, defaultTitleFormat, defaultValueFormat, color) : '';
+ },
+ tooltip_init_show: false,
+ tooltip_init_x: 0,
+ tooltip_init_position: {top: '0px', left: '50px'}
+ };
+
+ Object.keys(this.additionalConfig).forEach(function (key) {
+ config[key] = this.additionalConfig[key];
+ }, this);
+
+ return config;
+ };
+ c3_chart_internal_fn.additionalConfig = {};
+
+ c3_chart_internal_fn.loadConfig = function (config) {
+ var this_config = this.config, target, keys, read;
+ function find() {
+ var key = keys.shift();
+ // console.log("key =>", key, ", target =>", target);
+ if (key && target && typeof target === 'object' && key in target) {
+ target = target[key];
+ return find();
+ }
+ else if (!key) {
+ return target;
+ }
+ else {
+ return undefined;
+ }
+ }
+ Object.keys(this_config).forEach(function (key) {
+ target = config;
+ keys = key.split('_');
+ read = find();
+ // console.log("CONFIG : ", key, read);
+ if (isDefined(read)) {
+ this_config[key] = read;
+ }
+ });
+ };
+
+ c3_chart_internal_fn.getScale = function (min, max, forTimeseries) {
+ return (forTimeseries ? this.d3.time.scale() : this.d3.scale.linear()).range([min, max]);
+ };
+ c3_chart_internal_fn.getX = function (min, max, domain, offset) {
+ var $$ = this,
+ scale = $$.getScale(min, max, $$.isTimeSeries()),
+ _scale = domain ? scale.domain(domain) : scale, key;
+ // Define customized scale if categorized axis
+ if ($$.isCategorized()) {
+ offset = offset || function () { return 0; };
+ scale = function (d, raw) {
+ var v = _scale(d) + offset(d);
+ return raw ? v : Math.ceil(v);
+ };
+ } else {
+ scale = function (d, raw) {
+ var v = _scale(d);
+ return raw ? v : Math.ceil(v);
+ };
+ }
+ // define functions
+ for (key in _scale) {
+ scale[key] = _scale[key];
+ }
+ scale.orgDomain = function () {
+ return _scale.domain();
+ };
+ // define custom domain() for categorized axis
+ if ($$.isCategorized()) {
+ scale.domain = function (domain) {
+ if (!arguments.length) {
+ domain = this.orgDomain();
+ return [domain[0], domain[1] + 1];
+ }
+ _scale.domain(domain);
+ return scale;
+ };
+ }
+ return scale;
+ };
+ c3_chart_internal_fn.getY = function (min, max, domain) {
+ var scale = this.getScale(min, max, this.isTimeSeriesY());
+ if (domain) { scale.domain(domain); }
+ return scale;
+ };
+ c3_chart_internal_fn.getYScale = function (id) {
+ return this.axis.getId(id) === 'y2' ? this.y2 : this.y;
+ };
+ c3_chart_internal_fn.getSubYScale = function (id) {
+ return this.axis.getId(id) === 'y2' ? this.subY2 : this.subY;
+ };
+ c3_chart_internal_fn.updateScales = function () {
+ var $$ = this, config = $$.config,
+ forInit = !$$.x;
+ // update edges
+ $$.xMin = config.axis_rotated ? 1 : 0;
+ $$.xMax = config.axis_rotated ? $$.height : $$.width;
+ $$.yMin = config.axis_rotated ? 0 : $$.height;
+ $$.yMax = config.axis_rotated ? $$.width : 1;
+ $$.subXMin = $$.xMin;
+ $$.subXMax = $$.xMax;
+ $$.subYMin = config.axis_rotated ? 0 : $$.height2;
+ $$.subYMax = config.axis_rotated ? $$.width2 : 1;
+ // update scales
+ $$.x = $$.getX($$.xMin, $$.xMax, forInit ? undefined : $$.x.orgDomain(), function () { return $$.xAxis.tickOffset(); });
+ $$.y = $$.getY($$.yMin, $$.yMax, forInit ? config.axis_y_default : $$.y.domain());
+ $$.y2 = $$.getY($$.yMin, $$.yMax, forInit ? config.axis_y2_default : $$.y2.domain());
+ $$.subX = $$.getX($$.xMin, $$.xMax, $$.orgXDomain, function (d) { return d % 1 ? 0 : $$.subXAxis.tickOffset(); });
+ $$.subY = $$.getY($$.subYMin, $$.subYMax, forInit ? config.axis_y_default : $$.subY.domain());
+ $$.subY2 = $$.getY($$.subYMin, $$.subYMax, forInit ? config.axis_y2_default : $$.subY2.domain());
+ // update axes
+ $$.xAxisTickFormat = $$.axis.getXAxisTickFormat();
+ $$.xAxisTickValues = $$.axis.getXAxisTickValues();
+ $$.yAxisTickValues = $$.axis.getYAxisTickValues();
+ $$.y2AxisTickValues = $$.axis.getY2AxisTickValues();
+
+ $$.xAxis = $$.axis.getXAxis($$.x, $$.xOrient, $$.xAxisTickFormat, $$.xAxisTickValues, config.axis_x_tick_outer);
+ $$.subXAxis = $$.axis.getXAxis($$.subX, $$.subXOrient, $$.xAxisTickFormat, $$.xAxisTickValues, config.axis_x_tick_outer);
+ $$.yAxis = $$.axis.getYAxis($$.y, $$.yOrient, config.axis_y_tick_format, $$.yAxisTickValues, config.axis_y_tick_outer);
+ $$.y2Axis = $$.axis.getYAxis($$.y2, $$.y2Orient, config.axis_y2_tick_format, $$.y2AxisTickValues, config.axis_y2_tick_outer);
+
+ // Set initialized scales to brush and zoom
+ if (!forInit) {
+ if ($$.brush) { $$.brush.scale($$.subX); }
+ if (config.zoom_enabled) { $$.zoom.scale($$.x); }
+ }
+ // update for arc
+ if ($$.updateArc) { $$.updateArc(); }
+ };
+
+ c3_chart_internal_fn.getYDomainMin = function (targets) {
+ var $$ = this, config = $$.config,
+ ids = $$.mapToIds(targets), ys = $$.getValuesAsIdKeyed(targets),
+ j, k, baseId, idsInGroup, id, hasNegativeValue;
+ if (config.data_groups.length > 0) {
+ hasNegativeValue = $$.hasNegativeValueInTargets(targets);
+ for (j = 0; j < config.data_groups.length; j++) {
+ // Determine baseId
+ idsInGroup = config.data_groups[j].filter(function (id) { return ids.indexOf(id) >= 0; });
+ if (idsInGroup.length === 0) { continue; }
+ baseId = idsInGroup[0];
+ // Consider negative values
+ if (hasNegativeValue && ys[baseId]) {
+ ys[baseId].forEach(function (v, i) {
+ ys[baseId][i] = v < 0 ? v : 0;
+ });
+ }
+ // Compute min
+ for (k = 1; k < idsInGroup.length; k++) {
+ id = idsInGroup[k];
+ if (! ys[id]) { continue; }
+ ys[id].forEach(function (v, i) {
+ if ($$.axis.getId(id) === $$.axis.getId(baseId) && ys[baseId] && !(hasNegativeValue && +v > 0)) {
+ ys[baseId][i] += +v;
+ }
+ });
+ }
+ }
+ }
+ return $$.d3.min(Object.keys(ys).map(function (key) { return $$.d3.min(ys[key]); }));
+ };
+ c3_chart_internal_fn.getYDomainMax = function (targets) {
+ var $$ = this, config = $$.config,
+ ids = $$.mapToIds(targets), ys = $$.getValuesAsIdKeyed(targets),
+ j, k, baseId, idsInGroup, id, hasPositiveValue;
+ if (config.data_groups.length > 0) {
+ hasPositiveValue = $$.hasPositiveValueInTargets(targets);
+ for (j = 0; j < config.data_groups.length; j++) {
+ // Determine baseId
+ idsInGroup = config.data_groups[j].filter(function (id) { return ids.indexOf(id) >= 0; });
+ if (idsInGroup.length === 0) { continue; }
+ baseId = idsInGroup[0];
+ // Consider positive values
+ if (hasPositiveValue && ys[baseId]) {
+ ys[baseId].forEach(function (v, i) {
+ ys[baseId][i] = v > 0 ? v : 0;
+ });
+ }
+ // Compute max
+ for (k = 1; k < idsInGroup.length; k++) {
+ id = idsInGroup[k];
+ if (! ys[id]) { continue; }
+ ys[id].forEach(function (v, i) {
+ if ($$.axis.getId(id) === $$.axis.getId(baseId) && ys[baseId] && !(hasPositiveValue && +v < 0)) {
+ ys[baseId][i] += +v;
+ }
+ });
+ }
+ }
+ }
+ return $$.d3.max(Object.keys(ys).map(function (key) { return $$.d3.max(ys[key]); }));
+ };
+ c3_chart_internal_fn.getYDomain = function (targets, axisId, xDomain) {
+ var $$ = this, config = $$.config,
+ targetsByAxisId = targets.filter(function (t) { return $$.axis.getId(t.id) === axisId; }),
+ yTargets = xDomain ? $$.filterByXDomain(targetsByAxisId, xDomain) : targetsByAxisId,
+ yMin = axisId === 'y2' ? config.axis_y2_min : config.axis_y_min,
+ yMax = axisId === 'y2' ? config.axis_y2_max : config.axis_y_max,
+ yDomainMin = $$.getYDomainMin(yTargets),
+ yDomainMax = $$.getYDomainMax(yTargets),
+ domain, domainLength, padding, padding_top, padding_bottom,
+ center = axisId === 'y2' ? config.axis_y2_center : config.axis_y_center,
+ yDomainAbs, lengths, diff, ratio, isAllPositive, isAllNegative,
+ isZeroBased = ($$.hasType('bar', yTargets) && config.bar_zerobased) || ($$.hasType('area', yTargets) && config.area_zerobased),
+ isInverted = axisId === 'y2' ? config.axis_y2_inverted : config.axis_y_inverted,
+ showHorizontalDataLabel = $$.hasDataLabel() && config.axis_rotated,
+ showVerticalDataLabel = $$.hasDataLabel() && !config.axis_rotated;
+
+ // MEMO: avoid inverting domain unexpectedly
+ yDomainMin = isValue(yMin) ? yMin : isValue(yMax) ? (yDomainMin < yMax ? yDomainMin : yMax - 10) : yDomainMin;
+ yDomainMax = isValue(yMax) ? yMax : isValue(yMin) ? (yMin < yDomainMax ? yDomainMax : yMin + 10) : yDomainMax;
+
+ if (yTargets.length === 0) { // use current domain if target of axisId is none
+ return axisId === 'y2' ? $$.y2.domain() : $$.y.domain();
+ }
+ if (isNaN(yDomainMin)) { // set minimum to zero when not number
+ yDomainMin = 0;
+ }
+ if (isNaN(yDomainMax)) { // set maximum to have same value as yDomainMin
+ yDomainMax = yDomainMin;
+ }
+ if (yDomainMin === yDomainMax) {
+ yDomainMin < 0 ? yDomainMax = 0 : yDomainMin = 0;
+ }
+ isAllPositive = yDomainMin >= 0 && yDomainMax >= 0;
+ isAllNegative = yDomainMin <= 0 && yDomainMax <= 0;
+
+ // Cancel zerobased if axis_*_min / axis_*_max specified
+ if ((isValue(yMin) && isAllPositive) || (isValue(yMax) && isAllNegative)) {
+ isZeroBased = false;
+ }
+
+ // Bar/Area chart should be 0-based if all positive|negative
+ if (isZeroBased) {
+ if (isAllPositive) { yDomainMin = 0; }
+ if (isAllNegative) { yDomainMax = 0; }
+ }
+
+ domainLength = Math.abs(yDomainMax - yDomainMin);
+ padding = padding_top = padding_bottom = domainLength * 0.1;
+
+ if (typeof center !== 'undefined') {
+ yDomainAbs = Math.max(Math.abs(yDomainMin), Math.abs(yDomainMax));
+ yDomainMax = center + yDomainAbs;
+ yDomainMin = center - yDomainAbs;
+ }
+ // add padding for data label
+ if (showHorizontalDataLabel) {
+ lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, 'width');
+ diff = diffDomain($$.y.range());
+ ratio = [lengths[0] / diff, lengths[1] / diff];
+ padding_top += domainLength * (ratio[1] / (1 - ratio[0] - ratio[1]));
+ padding_bottom += domainLength * (ratio[0] / (1 - ratio[0] - ratio[1]));
+ } else if (showVerticalDataLabel) {
+ lengths = $$.getDataLabelLength(yDomainMin, yDomainMax, 'height');
+ padding_top += $$.axis.convertPixelsToAxisPadding(lengths[1], domainLength);
+ padding_bottom += $$.axis.convertPixelsToAxisPadding(lengths[0], domainLength);
+ }
+ if (axisId === 'y' && notEmpty(config.axis_y_padding)) {
+ padding_top = $$.axis.getPadding(config.axis_y_padding, 'top', padding_top, domainLength);
+ padding_bottom = $$.axis.getPadding(config.axis_y_padding, 'bottom', padding_bottom, domainLength);
+ }
+ if (axisId === 'y2' && notEmpty(config.axis_y2_padding)) {
+ padding_top = $$.axis.getPadding(config.axis_y2_padding, 'top', padding_top, domainLength);
+ padding_bottom = $$.axis.getPadding(config.axis_y2_padding, 'bottom', padding_bottom, domainLength);
+ }
+ // Bar/Area chart should be 0-based if all positive|negative
+ if (isZeroBased) {
+ if (isAllPositive) { padding_bottom = yDomainMin; }
+ if (isAllNegative) { padding_top = -yDomainMax; }
+ }
+ domain = [yDomainMin - padding_bottom, yDomainMax + padding_top];
+ return isInverted ? domain.reverse() : domain;
+ };
+ c3_chart_internal_fn.getXDomainMin = function (targets) {
+ var $$ = this, config = $$.config;
+ return isDefined(config.axis_x_min) ?
+ ($$.isTimeSeries() ? this.parseDate(config.axis_x_min) : config.axis_x_min) :
+ $$.d3.min(targets, function (t) { return $$.d3.min(t.values, function (v) { return v.x; }); });
+ };
+ c3_chart_internal_fn.getXDomainMax = function (targets) {
+ var $$ = this, config = $$.config;
+ return isDefined(config.axis_x_max) ?
+ ($$.isTimeSeries() ? this.parseDate(config.axis_x_max) : config.axis_x_max) :
+ $$.d3.max(targets, function (t) { return $$.d3.max(t.values, function (v) { return v.x; }); });
+ };
+ c3_chart_internal_fn.getXDomainPadding = function (domain) {
+ var $$ = this, config = $$.config,
+ diff = domain[1] - domain[0],
+ maxDataCount, padding, paddingLeft, paddingRight;
+ if ($$.isCategorized()) {
+ padding = 0;
+ } else if ($$.hasType('bar')) {
+ maxDataCount = $$.getMaxDataCount();
+ padding = maxDataCount > 1 ? (diff / (maxDataCount - 1)) / 2 : 0.5;
+ } else {
+ padding = diff * 0.01;
+ }
+ if (typeof config.axis_x_padding === 'object' && notEmpty(config.axis_x_padding)) {
+ paddingLeft = isValue(config.axis_x_padding.left) ? config.axis_x_padding.left : padding;
+ paddingRight = isValue(config.axis_x_padding.right) ? config.axis_x_padding.right : padding;
+ } else if (typeof config.axis_x_padding === 'number') {
+ paddingLeft = paddingRight = config.axis_x_padding;
+ } else {
+ paddingLeft = paddingRight = padding;
+ }
+ return {left: paddingLeft, right: paddingRight};
+ };
+ c3_chart_internal_fn.getXDomain = function (targets) {
+ var $$ = this,
+ xDomain = [$$.getXDomainMin(targets), $$.getXDomainMax(targets)],
+ firstX = xDomain[0], lastX = xDomain[1],
+ padding = $$.getXDomainPadding(xDomain),
+ min = 0, max = 0;
+ // show center of x domain if min and max are the same
+ if ((firstX - lastX) === 0 && !$$.isCategorized()) {
+ if ($$.isTimeSeries()) {
+ firstX = new Date(firstX.getTime() * 0.5);
+ lastX = new Date(lastX.getTime() * 1.5);
+ } else {
+ firstX = firstX === 0 ? 1 : (firstX * 0.5);
+ lastX = lastX === 0 ? -1 : (lastX * 1.5);
+ }
+ }
+ if (firstX || firstX === 0) {
+ min = $$.isTimeSeries() ? new Date(firstX.getTime() - padding.left) : firstX - padding.left;
+ }
+ if (lastX || lastX === 0) {
+ max = $$.isTimeSeries() ? new Date(lastX.getTime() + padding.right) : lastX + padding.right;
+ }
+ return [min, max];
+ };
+ c3_chart_internal_fn.updateXDomain = function (targets, withUpdateXDomain, withUpdateOrgXDomain, withTrim, domain) {
+ var $$ = this, config = $$.config;
+
+ if (withUpdateOrgXDomain) {
+ $$.x.domain(domain ? domain : $$.d3.extent($$.getXDomain(targets)));
+ $$.orgXDomain = $$.x.domain();
+ if (config.zoom_enabled) { $$.zoom.scale($$.x).updateScaleExtent(); }
+ $$.subX.domain($$.x.domain());
+ if ($$.brush) { $$.brush.scale($$.subX); }
+ }
+ if (withUpdateXDomain) {
+ $$.x.domain(domain ? domain : (!$$.brush || $$.brush.empty()) ? $$.orgXDomain : $$.brush.extent());
+ if (config.zoom_enabled) { $$.zoom.scale($$.x).updateScaleExtent(); }
+ }
+
+ // Trim domain when too big by zoom mousemove event
+ if (withTrim) { $$.x.domain($$.trimXDomain($$.x.orgDomain())); }
+
+ return $$.x.domain();
+ };
+ c3_chart_internal_fn.trimXDomain = function (domain) {
+ var $$ = this;
+ if (domain[0] <= $$.orgXDomain[0]) {
+ domain[1] = +domain[1] + ($$.orgXDomain[0] - domain[0]);
+ domain[0] = $$.orgXDomain[0];
+ }
+ if ($$.orgXDomain[1] <= domain[1]) {
+ domain[0] = +domain[0] - (domain[1] - $$.orgXDomain[1]);
+ domain[1] = $$.orgXDomain[1];
+ }
+ return domain;
+ };
+
+ c3_chart_internal_fn.isX = function (key) {
+ var $$ = this, config = $$.config;
+ return (config.data_x && key === config.data_x) || (notEmpty(config.data_xs) && hasValue(config.data_xs, key));
+ };
+ c3_chart_internal_fn.isNotX = function (key) {
+ return !this.isX(key);
+ };
+ c3_chart_internal_fn.getXKey = function (id) {
+ var $$ = this, config = $$.config;
+ return config.data_x ? config.data_x : notEmpty(config.data_xs) ? config.data_xs[id] : null;
+ };
+ c3_chart_internal_fn.getXValuesOfXKey = function (key, targets) {
+ var $$ = this,
+ xValues, ids = targets && notEmpty(targets) ? $$.mapToIds(targets) : [];
+ ids.forEach(function (id) {
+ if ($$.getXKey(id) === key) {
+ xValues = $$.data.xs[id];
+ }
+ });
+ return xValues;
+ };
+ c3_chart_internal_fn.getIndexByX = function (x) {
+ var $$ = this,
+ data = $$.filterByX($$.data.targets, x);
+ return data.length ? data[0].index : null;
+ };
+ c3_chart_internal_fn.getXValue = function (id, i) {
+ var $$ = this;
+ return id in $$.data.xs && $$.data.xs[id] && isValue($$.data.xs[id][i]) ? $$.data.xs[id][i] : i;
+ };
+ c3_chart_internal_fn.getOtherTargetXs = function () {
+ var $$ = this,
+ idsForX = Object.keys($$.data.xs);
+ return idsForX.length ? $$.data.xs[idsForX[0]] : null;
+ };
+ c3_chart_internal_fn.getOtherTargetX = function (index) {
+ var xs = this.getOtherTargetXs();
+ return xs && index < xs.length ? xs[index] : null;
+ };
+ c3_chart_internal_fn.addXs = function (xs) {
+ var $$ = this;
+ Object.keys(xs).forEach(function (id) {
+ $$.config.data_xs[id] = xs[id];
+ });
+ };
+ c3_chart_internal_fn.hasMultipleX = function (xs) {
+ return this.d3.set(Object.keys(xs).map(function (id) { return xs[id]; })).size() > 1;
+ };
+ c3_chart_internal_fn.isMultipleX = function () {
+ return notEmpty(this.config.data_xs) || !this.config.data_xSort || this.hasType('scatter');
+ };
+ c3_chart_internal_fn.addName = function (data) {
+ var $$ = this, name;
+ if (data) {
+ name = $$.config.data_names[data.id];
+ data.name = name ? name : data.id;
+ }
+ return data;
+ };
+ c3_chart_internal_fn.getValueOnIndex = function (values, index) {
+ var valueOnIndex = values.filter(function (v) { return v.index === index; });
+ return valueOnIndex.length ? valueOnIndex[0] : null;
+ };
+ c3_chart_internal_fn.updateTargetX = function (targets, x) {
+ var $$ = this;
+ targets.forEach(function (t) {
+ t.values.forEach(function (v, i) {
+ v.x = $$.generateTargetX(x[i], t.id, i);
+ });
+ $$.data.xs[t.id] = x;
+ });
+ };
+ c3_chart_internal_fn.updateTargetXs = function (targets, xs) {
+ var $$ = this;
+ targets.forEach(function (t) {
+ if (xs[t.id]) {
+ $$.updateTargetX([t], xs[t.id]);
+ }
+ });
+ };
+ c3_chart_internal_fn.generateTargetX = function (rawX, id, index) {
+ var $$ = this, x;
+ if ($$.isTimeSeries()) {
+ x = rawX ? $$.parseDate(rawX) : $$.parseDate($$.getXValue(id, index));
+ }
+ else if ($$.isCustomX() && !$$.isCategorized()) {
+ x = isValue(rawX) ? +rawX : $$.getXValue(id, index);
+ }
+ else {
+ x = index;
+ }
+ return x;
+ };
+ c3_chart_internal_fn.cloneTarget = function (target) {
+ return {
+ id : target.id,
+ id_org : target.id_org,
+ values : target.values.map(function (d) {
+ return {x: d.x, value: d.value, id: d.id};
+ })
+ };
+ };
+ c3_chart_internal_fn.updateXs = function () {
+ var $$ = this;
+ if ($$.data.targets.length) {
+ $$.xs = [];
+ $$.data.targets[0].values.forEach(function (v) {
+ $$.xs[v.index] = v.x;
+ });
+ }
+ };
+ c3_chart_internal_fn.getPrevX = function (i) {
+ var x = this.xs[i - 1];
+ return typeof x !== 'undefined' ? x : null;
+ };
+ c3_chart_internal_fn.getNextX = function (i) {
+ var x = this.xs[i + 1];
+ return typeof x !== 'undefined' ? x : null;
+ };
+ c3_chart_internal_fn.getMaxDataCount = function () {
+ var $$ = this;
+ return $$.d3.max($$.data.targets, function (t) { return t.values.length; });
+ };
+ c3_chart_internal_fn.getMaxDataCountTarget = function (targets) {
+ var length = targets.length, max = 0, maxTarget;
+ if (length > 1) {
+ targets.forEach(function (t) {
+ if (t.values.length > max) {
+ maxTarget = t;
+ max = t.values.length;
+ }
+ });
+ } else {
+ maxTarget = length ? targets[0] : null;
+ }
+ return maxTarget;
+ };
+ c3_chart_internal_fn.getEdgeX = function (targets) {
+ var $$ = this;
+ return !targets.length ? [0, 0] : [
+ $$.d3.min(targets, function (t) { return t.values[0].x; }),
+ $$.d3.max(targets, function (t) { return t.values[t.values.length - 1].x; })
+ ];
+ };
+ c3_chart_internal_fn.mapToIds = function (targets) {
+ return targets.map(function (d) { return d.id; });
+ };
+ c3_chart_internal_fn.mapToTargetIds = function (ids) {
+ var $$ = this;
+ return ids ? (isString(ids) ? [ids] : ids) : $$.mapToIds($$.data.targets);
+ };
+ c3_chart_internal_fn.hasTarget = function (targets, id) {
+ var ids = this.mapToIds(targets), i;
+ for (i = 0; i < ids.length; i++) {
+ if (ids[i] === id) {
+ return true;
+ }
+ }
+ return false;
+ };
+ c3_chart_internal_fn.isTargetToShow = function (targetId) {
+ return this.hiddenTargetIds.indexOf(targetId) < 0;
+ };
+ c3_chart_internal_fn.isLegendToShow = function (targetId) {
+ return this.hiddenLegendIds.indexOf(targetId) < 0;
+ };
+ c3_chart_internal_fn.filterTargetsToShow = function (targets) {
+ var $$ = this;
+ return targets.filter(function (t) { return $$.isTargetToShow(t.id); });
+ };
+ c3_chart_internal_fn.mapTargetsToUniqueXs = function (targets) {
+ var $$ = this;
+ var xs = $$.d3.set($$.d3.merge(targets.map(function (t) { return t.values.map(function (v) { return +v.x; }); }))).values();
+ return $$.isTimeSeries() ? xs.map(function (x) { return new Date(+x); }) : xs.map(function (x) { return +x; });
+ };
+ c3_chart_internal_fn.addHiddenTargetIds = function (targetIds) {
+ this.hiddenTargetIds = this.hiddenTargetIds.concat(targetIds);
+ };
+ c3_chart_internal_fn.removeHiddenTargetIds = function (targetIds) {
+ this.hiddenTargetIds = this.hiddenTargetIds.filter(function (id) { return targetIds.indexOf(id) < 0; });
+ };
+ c3_chart_internal_fn.addHiddenLegendIds = function (targetIds) {
+ this.hiddenLegendIds = this.hiddenLegendIds.concat(targetIds);
+ };
+ c3_chart_internal_fn.removeHiddenLegendIds = function (targetIds) {
+ this.hiddenLegendIds = this.hiddenLegendIds.filter(function (id) { return targetIds.indexOf(id) < 0; });
+ };
+ c3_chart_internal_fn.getValuesAsIdKeyed = function (targets) {
+ var ys = {};
+ targets.forEach(function (t) {
+ ys[t.id] = [];
+ t.values.forEach(function (v) {
+ ys[t.id].push(v.value);
+ });
+ });
+ return ys;
+ };
+ c3_chart_internal_fn.checkValueInTargets = function (targets, checker) {
+ var ids = Object.keys(targets), i, j, values;
+ for (i = 0; i < ids.length; i++) {
+ values = targets[ids[i]].values;
+ for (j = 0; j < values.length; j++) {
+ if (checker(values[j].value)) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+ c3_chart_internal_fn.hasNegativeValueInTargets = function (targets) {
+ return this.checkValueInTargets(targets, function (v) { return v < 0; });
+ };
+ c3_chart_internal_fn.hasPositiveValueInTargets = function (targets) {
+ return this.checkValueInTargets(targets, function (v) { return v > 0; });
+ };
+ c3_chart_internal_fn.isOrderDesc = function () {
+ var config = this.config;
+ return typeof(config.data_order) === 'string' && config.data_order.toLowerCase() === 'desc';
+ };
+ c3_chart_internal_fn.isOrderAsc = function () {
+ var config = this.config;
+ return typeof(config.data_order) === 'string' && config.data_order.toLowerCase() === 'asc';
+ };
+ c3_chart_internal_fn.orderTargets = function (targets) {
+ var $$ = this, config = $$.config, orderAsc = $$.isOrderAsc(), orderDesc = $$.isOrderDesc();
+ if (orderAsc || orderDesc) {
+ targets.sort(function (t1, t2) {
+ var reducer = function (p, c) { return p + Math.abs(c.value); };
+ var t1Sum = t1.values.reduce(reducer, 0),
+ t2Sum = t2.values.reduce(reducer, 0);
+ return orderAsc ? t2Sum - t1Sum : t1Sum - t2Sum;
+ });
+ } else if (isFunction(config.data_order)) {
+ targets.sort(config.data_order);
+ } // TODO: accept name array for order
+ return targets;
+ };
+ c3_chart_internal_fn.filterByX = function (targets, x) {
+ return this.d3.merge(targets.map(function (t) { return t.values; })).filter(function (v) { return v.x - x === 0; });
+ };
+ c3_chart_internal_fn.filterRemoveNull = function (data) {
+ return data.filter(function (d) { return isValue(d.value); });
+ };
+ c3_chart_internal_fn.filterByXDomain = function (targets, xDomain) {
+ return targets.map(function (t) {
+ return {
+ id: t.id,
+ id_org: t.id_org,
+ values: t.values.filter(function (v) {
+ return xDomain[0] <= v.x && v.x <= xDomain[1];
+ })
+ };
+ });
+ };
+ c3_chart_internal_fn.hasDataLabel = function () {
+ var config = this.config;
+ if (typeof config.data_labels === 'boolean' && config.data_labels) {
+ return true;
+ } else if (typeof config.data_labels === 'object' && notEmpty(config.data_labels)) {
+ return true;
+ }
+ return false;
+ };
+ c3_chart_internal_fn.getDataLabelLength = function (min, max, key) {
+ var $$ = this,
+ lengths = [0, 0], paddingCoef = 1.3;
+ $$.selectChart.select('svg').selectAll('.dummy')
+ .data([min, max])
+ .enter().append('text')
+ .text(function (d) { return $$.dataLabelFormat(d.id)(d); })
+ .each(function (d, i) {
+ lengths[i] = this.getBoundingClientRect()[key] * paddingCoef;
+ })
+ .remove();
+ return lengths;
+ };
+ c3_chart_internal_fn.isNoneArc = function (d) {
+ return this.hasTarget(this.data.targets, d.id);
+ },
+ c3_chart_internal_fn.isArc = function (d) {
+ return 'data' in d && this.hasTarget(this.data.targets, d.data.id);
+ };
+ c3_chart_internal_fn.findSameXOfValues = function (values, index) {
+ var i, targetX = values[index].x, sames = [];
+ for (i = index - 1; i >= 0; i--) {
+ if (targetX !== values[i].x) { break; }
+ sames.push(values[i]);
+ }
+ for (i = index; i < values.length; i++) {
+ if (targetX !== values[i].x) { break; }
+ sames.push(values[i]);
+ }
+ return sames;
+ };
+
+ c3_chart_internal_fn.findClosestFromTargets = function (targets, pos) {
+ var $$ = this, candidates;
+
+ // map to array of closest points of each target
+ candidates = targets.map(function (target) {
+ return $$.findClosest(target.values, pos);
+ });
+
+ // decide closest point and return
+ return $$.findClosest(candidates, pos);
+ };
+ c3_chart_internal_fn.findClosest = function (values, pos) {
+ var $$ = this, minDist = 100, closest;
+
+ // find mouseovering bar
+ values.filter(function (v) { return v && $$.isBarType(v.id); }).forEach(function (v) {
+ var shape = $$.main.select('.' + CLASS.bars + $$.getTargetSelectorSuffix(v.id) + ' .' + CLASS.bar + '-' + v.index).node();
+ if (!closest && $$.isWithinBar(shape)) {
+ closest = v;
+ }
+ });
+
+ // find closest point from non-bar
+ values.filter(function (v) { return v && !$$.isBarType(v.id); }).forEach(function (v) {
+ var d = $$.dist(v, pos);
+ if (d < minDist) {
+ minDist = d;
+ closest = v;
+ }
+ });
+
+ return closest;
+ };
+ c3_chart_internal_fn.dist = function (data, pos) {
+ var $$ = this, config = $$.config,
+ xIndex = config.axis_rotated ? 1 : 0,
+ yIndex = config.axis_rotated ? 0 : 1,
+ y = $$.circleY(data, data.index),
+ x = $$.x(data.x);
+ return Math.pow(x - pos[xIndex], 2) + Math.pow(y - pos[yIndex], 2);
+ };
+ c3_chart_internal_fn.convertValuesToStep = function (values) {
+ var converted = [].concat(values), i;
+
+ if (!this.isCategorized()) {
+ return values;
+ }
+
+ for (i = values.length + 1; 0 < i; i--) {
+ converted[i] = converted[i - 1];
+ }
+
+ converted[0] = {
+ x: converted[0].x - 1,
+ value: converted[0].value,
+ id: converted[0].id
+ };
+ converted[values.length + 1] = {
+ x: converted[values.length].x + 1,
+ value: converted[values.length].value,
+ id: converted[values.length].id
+ };
+
+ return converted;
+ };
+ c3_chart_internal_fn.updateDataAttributes = function (name, attrs) {
+ var $$ = this, config = $$.config, current = config['data_' + name];
+ if (typeof attrs === 'undefined') { return current; }
+ Object.keys(attrs).forEach(function (id) {
+ current[id] = attrs[id];
+ });
+ $$.redraw({withLegend: true});
+ return current;
+ };
+
+ c3_chart_internal_fn.convertUrlToData = function (url, mimeType, keys, done) {
+ var $$ = this, type = mimeType ? mimeType : 'csv';
+ $$.d3.xhr(url, function (error, data) {
+ var d;
+ if (!data) {
+ throw new Error(error.responseURL + ' ' + error.status + ' (' + error.statusText + ')');
+ }
+ if (type === 'json') {
+ d = $$.convertJsonToData(JSON.parse(data.response), keys);
+ } else if (type === 'tsv') {
+ d = $$.convertTsvToData(data.response);
+ } else {
+ d = $$.convertCsvToData(data.response);
+ }
+ done.call($$, d);
+ });
+ };
+ c3_chart_internal_fn.convertXsvToData = function (xsv, parser) {
+ var rows = parser.parseRows(xsv), d;
+ if (rows.length === 1) {
+ d = [{}];
+ rows[0].forEach(function (id) {
+ d[0][id] = null;
+ });
+ } else {
+ d = parser.parse(xsv);
+ }
+ return d;
+ };
+ c3_chart_internal_fn.convertCsvToData = function (csv) {
+ return this.convertXsvToData(csv, this.d3.csv);
+ };
+ c3_chart_internal_fn.convertTsvToData = function (tsv) {
+ return this.convertXsvToData(tsv, this.d3.tsv);
+ };
+ c3_chart_internal_fn.convertJsonToData = function (json, keys) {
+ var $$ = this,
+ new_rows = [], targetKeys, data;
+ if (keys) { // when keys specified, json would be an array that includes objects
+ if (keys.x) {
+ targetKeys = keys.value.concat(keys.x);
+ $$.config.data_x = keys.x;
+ } else {
+ targetKeys = keys.value;
+ }
+ new_rows.push(targetKeys);
+ json.forEach(function (o) {
+ var new_row = [];
+ targetKeys.forEach(function (key) {
+ // convert undefined to null because undefined data will be removed in convertDataToTargets()
+ var v = isUndefined(o[key]) ? null : o[key];
+ new_row.push(v);
+ });
+ new_rows.push(new_row);
+ });
+ data = $$.convertRowsToData(new_rows);
+ } else {
+ Object.keys(json).forEach(function (key) {
+ new_rows.push([key].concat(json[key]));
+ });
+ data = $$.convertColumnsToData(new_rows);
+ }
+ return data;
+ };
+ c3_chart_internal_fn.convertRowsToData = function (rows) {
+ var keys = rows[0], new_row = {}, new_rows = [], i, j;
+ for (i = 1; i < rows.length; i++) {
+ new_row = {};
+ for (j = 0; j < rows[i].length; j++) {
+ if (isUndefined(rows[i][j])) {
+ throw new Error("Source data is missing a component at (" + i + "," + j + ")!");
+ }
+ new_row[keys[j]] = rows[i][j];
+ }
+ new_rows.push(new_row);
+ }
+ return new_rows;
+ };
+ c3_chart_internal_fn.convertColumnsToData = function (columns) {
+ var new_rows = [], i, j, key;
+ for (i = 0; i < columns.length; i++) {
+ key = columns[i][0];
+ for (j = 1; j < columns[i].length; j++) {
+ if (isUndefined(new_rows[j - 1])) {
+ new_rows[j - 1] = {};
+ }
+ if (isUndefined(columns[i][j])) {
+ throw new Error("Source data is missing a component at (" + i + "," + j + ")!");
+ }
+ new_rows[j - 1][key] = columns[i][j];
+ }
+ }
+ return new_rows;
+ };
+ c3_chart_internal_fn.convertDataToTargets = function (data, appendXs) {
+ var $$ = this, config = $$.config,
+ ids = $$.d3.keys(data[0]).filter($$.isNotX, $$),
+ xs = $$.d3.keys(data[0]).filter($$.isX, $$),
+ targets;
+
+ // save x for update data by load when custom x and c3.x API
+ ids.forEach(function (id) {
+ var xKey = $$.getXKey(id);
+
+ if ($$.isCustomX() || $$.isTimeSeries()) {
+ // if included in input data
+ if (xs.indexOf(xKey) >= 0) {
+ $$.data.xs[id] = (appendXs && $$.data.xs[id] ? $$.data.xs[id] : []).concat(
+ data.map(function (d) { return d[xKey]; })
+ .filter(isValue)
+ .map(function (rawX, i) { return $$.generateTargetX(rawX, id, i); })
+ );
+ }
+ // if not included in input data, find from preloaded data of other id's x
+ else if (config.data_x) {
+ $$.data.xs[id] = $$.getOtherTargetXs();
+ }
+ // if not included in input data, find from preloaded data
+ else if (notEmpty(config.data_xs)) {
+ $$.data.xs[id] = $$.getXValuesOfXKey(xKey, $$.data.targets);
+ }
+ // MEMO: if no x included, use same x of current will be used
+ } else {
+ $$.data.xs[id] = data.map(function (d, i) { return i; });
+ }
+ });
+
+
+ // check x is defined
+ ids.forEach(function (id) {
+ if (!$$.data.xs[id]) {
+ throw new Error('x is not defined for id = "' + id + '".');
+ }
+ });
+
+ // convert to target
+ targets = ids.map(function (id, index) {
+ var convertedId = config.data_idConverter(id);
+ return {
+ id: convertedId,
+ id_org: id,
+ values: data.map(function (d, i) {
+ var xKey = $$.getXKey(id), rawX = d[xKey], x = $$.generateTargetX(rawX, id, i);
+ // use x as categories if custom x and categorized
+ if ($$.isCustomX() && $$.isCategorized() && index === 0 && rawX) {
+ if (i === 0) { config.axis_x_categories = []; }
+ config.axis_x_categories.push(rawX);
+ }
+ // mark as x = undefined if value is undefined and filter to remove after mapped
+ if (isUndefined(d[id]) || $$.data.xs[id].length <= i) {
+ x = undefined;
+ }
+ return {x: x, value: d[id] !== null && !isNaN(d[id]) ? +d[id] : null, id: convertedId};
+ }).filter(function (v) { return isDefined(v.x); })
+ };
+ });
+
+ // finish targets
+ targets.forEach(function (t) {
+ var i;
+ // sort values by its x
+ if (config.data_xSort) {
+ t.values = t.values.sort(function (v1, v2) {
+ var x1 = v1.x || v1.x === 0 ? v1.x : Infinity,
+ x2 = v2.x || v2.x === 0 ? v2.x : Infinity;
+ return x1 - x2;
+ });
+ }
+ // indexing each value
+ i = 0;
+ t.values.forEach(function (v) {
+ v.index = i++;
+ });
+ // this needs to be sorted because its index and value.index is identical
+ $$.data.xs[t.id].sort(function (v1, v2) {
+ return v1 - v2;
+ });
+ });
+
+ // set target types
+ if (config.data_type) {
+ $$.setTargetType($$.mapToIds(targets).filter(function (id) { return ! (id in config.data_types); }), config.data_type);
+ }
+
+ // cache as original id keyed
+ targets.forEach(function (d) {
+ $$.addCache(d.id_org, d);
+ });
+
+ return targets;
+ };
+
+ c3_chart_internal_fn.load = function (targets, args) {
+ var $$ = this;
+ if (targets) {
+ // filter loading targets if needed
+ if (args.filter) {
+ targets = targets.filter(args.filter);
+ }
+ // set type if args.types || args.type specified
+ if (args.type || args.types) {
+ targets.forEach(function (t) {
+ var type = args.types && args.types[t.id] ? args.types[t.id] : args.type;
+ $$.setTargetType(t.id, type);
+ });
+ }
+ // Update/Add data
+ $$.data.targets.forEach(function (d) {
+ for (var i = 0; i < targets.length; i++) {
+ if (d.id === targets[i].id) {
+ d.values = targets[i].values;
+ targets.splice(i, 1);
+ break;
+ }
+ }
+ });
+ $$.data.targets = $$.data.targets.concat(targets); // add remained
+ }
+
+ // Set targets
+ $$.updateTargets($$.data.targets);
+
+ // Redraw with new targets
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+
+ if (args.done) { args.done(); }
+ };
+ c3_chart_internal_fn.loadFromArgs = function (args) {
+ var $$ = this;
+ if (args.data) {
+ $$.load($$.convertDataToTargets(args.data), args);
+ }
+ else if (args.url) {
+ $$.convertUrlToData(args.url, args.mimeType, args.keys, function (data) {
+ $$.load($$.convertDataToTargets(data), args);
+ });
+ }
+ else if (args.json) {
+ $$.load($$.convertDataToTargets($$.convertJsonToData(args.json, args.keys)), args);
+ }
+ else if (args.rows) {
+ $$.load($$.convertDataToTargets($$.convertRowsToData(args.rows)), args);
+ }
+ else if (args.columns) {
+ $$.load($$.convertDataToTargets($$.convertColumnsToData(args.columns)), args);
+ }
+ else {
+ $$.load(null, args);
+ }
+ };
+ c3_chart_internal_fn.unload = function (targetIds, done) {
+ var $$ = this;
+ if (!done) {
+ done = function () {};
+ }
+ // filter existing target
+ targetIds = targetIds.filter(function (id) { return $$.hasTarget($$.data.targets, id); });
+ // If no target, call done and return
+ if (!targetIds || targetIds.length === 0) {
+ done();
+ return;
+ }
+ $$.svg.selectAll(targetIds.map(function (id) { return $$.selectorTarget(id); }))
+ .transition()
+ .style('opacity', 0)
+ .remove()
+ .call($$.endall, done);
+ targetIds.forEach(function (id) {
+ // Reset fadein for future load
+ $$.withoutFadeIn[id] = false;
+ // Remove target's elements
+ if ($$.legend) {
+ $$.legend.selectAll('.' + CLASS.legendItem + $$.getTargetSelectorSuffix(id)).remove();
+ }
+ // Remove target
+ $$.data.targets = $$.data.targets.filter(function (t) {
+ return t.id !== id;
+ });
+ });
+ };
+
+ c3_chart_internal_fn.categoryName = function (i) {
+ var config = this.config;
+ return i < config.axis_x_categories.length ? config.axis_x_categories[i] : i;
+ };
+
+ c3_chart_internal_fn.initEventRect = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.eventRects)
+ .style('fill-opacity', 0);
+ };
+ c3_chart_internal_fn.redrawEventRect = function () {
+ var $$ = this, config = $$.config,
+ eventRectUpdate, maxDataCountTarget,
+ isMultipleX = $$.isMultipleX();
+
+ // rects for mouseover
+ var eventRects = $$.main.select('.' + CLASS.eventRects)
+ .style('cursor', config.zoom_enabled ? config.axis_rotated ? 'ns-resize' : 'ew-resize' : null)
+ .classed(CLASS.eventRectsMultiple, isMultipleX)
+ .classed(CLASS.eventRectsSingle, !isMultipleX);
+
+ // clear old rects
+ eventRects.selectAll('.' + CLASS.eventRect).remove();
+
+ // open as public variable
+ $$.eventRect = eventRects.selectAll('.' + CLASS.eventRect);
+
+ if (isMultipleX) {
+ eventRectUpdate = $$.eventRect.data([0]);
+ // enter : only one rect will be added
+ $$.generateEventRectsForMultipleXs(eventRectUpdate.enter());
+ // update
+ $$.updateEventRect(eventRectUpdate);
+ // exit : not needed because always only one rect exists
+ }
+ else {
+ // Set data and update $$.eventRect
+ maxDataCountTarget = $$.getMaxDataCountTarget($$.data.targets);
+ eventRects.datum(maxDataCountTarget ? maxDataCountTarget.values : []);
+ $$.eventRect = eventRects.selectAll('.' + CLASS.eventRect);
+ eventRectUpdate = $$.eventRect.data(function (d) { return d; });
+ // enter
+ $$.generateEventRectsForSingleX(eventRectUpdate.enter());
+ // update
+ $$.updateEventRect(eventRectUpdate);
+ // exit
+ eventRectUpdate.exit().remove();
+ }
+ };
+ c3_chart_internal_fn.updateEventRect = function (eventRectUpdate) {
+ var $$ = this, config = $$.config,
+ x, y, w, h, rectW, rectX;
+
+ // set update selection if null
+ eventRectUpdate = eventRectUpdate || $$.eventRect.data(function (d) { return d; });
+
+ if ($$.isMultipleX()) {
+ // TODO: rotated not supported yet
+ x = 0;
+ y = 0;
+ w = $$.width;
+ h = $$.height;
+ }
+ else {
+ if (($$.isCustomX() || $$.isTimeSeries()) && !$$.isCategorized()) {
+
+ // update index for x that is used by prevX and nextX
+ $$.updateXs();
+
+ rectW = function (d) {
+ var prevX = $$.getPrevX(d.index), nextX = $$.getNextX(d.index);
+
+ // if there this is a single data point make the eventRect full width (or height)
+ if (prevX === null && nextX === null) {
+ return config.axis_rotated ? $$.height : $$.width;
+ }
+
+ if (prevX === null) { prevX = $$.x.domain()[0]; }
+ if (nextX === null) { nextX = $$.x.domain()[1]; }
+
+ return Math.max(0, ($$.x(nextX) - $$.x(prevX)) / 2);
+ };
+ rectX = function (d) {
+ var prevX = $$.getPrevX(d.index), nextX = $$.getNextX(d.index),
+ thisX = $$.data.xs[d.id][d.index];
+
+ // if there this is a single data point position the eventRect at 0
+ if (prevX === null && nextX === null) {
+ return 0;
+ }
+
+ if (prevX === null) { prevX = $$.x.domain()[0]; }
+
+ return ($$.x(thisX) + $$.x(prevX)) / 2;
+ };
+ } else {
+ rectW = $$.getEventRectWidth();
+ rectX = function (d) {
+ return $$.x(d.x) - (rectW / 2);
+ };
+ }
+ x = config.axis_rotated ? 0 : rectX;
+ y = config.axis_rotated ? rectX : 0;
+ w = config.axis_rotated ? $$.width : rectW;
+ h = config.axis_rotated ? rectW : $$.height;
+ }
+
+ eventRectUpdate
+ .attr('class', $$.classEvent.bind($$))
+ .attr("x", x)
+ .attr("y", y)
+ .attr("width", w)
+ .attr("height", h);
+ };
+ c3_chart_internal_fn.generateEventRectsForSingleX = function (eventRectEnter) {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ eventRectEnter.append("rect")
+ .attr("class", $$.classEvent.bind($$))
+ .style("cursor", config.data_selection_enabled && config.data_selection_grouped ? "pointer" : null)
+ .on('mouseover', function (d) {
+ var index = d.index;
+
+ if ($$.dragging || $$.flowing) { return; } // do nothing while dragging/flowing
+ if ($$.hasArcType()) { return; }
+
+ // Expand shapes for selection
+ if (config.point_focus_expand_enabled) { $$.expandCircles(index, null, true); }
+ $$.expandBars(index, null, true);
+
+ // Call event handler
+ $$.main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
+ config.data_onmouseover.call($$.api, d);
+ });
+ })
+ .on('mouseout', function (d) {
+ var index = d.index;
+ if (!$$.config) { return; } // chart is destroyed
+ if ($$.hasArcType()) { return; }
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+ // Undo expanded shapes
+ $$.unexpandCircles();
+ $$.unexpandBars();
+ // Call event handler
+ $$.main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
+ config.data_onmouseout.call($$.api, d);
+ });
+ })
+ .on('mousemove', function (d) {
+ var selectedData, index = d.index,
+ eventRect = $$.svg.select('.' + CLASS.eventRect + '-' + index);
+
+ if ($$.dragging || $$.flowing) { return; } // do nothing while dragging/flowing
+ if ($$.hasArcType()) { return; }
+
+ if ($$.isStepType(d) && $$.config.line_step_type === 'step-after' && d3.mouse(this)[0] < $$.x($$.getXValue(d.id, index))) {
+ index -= 1;
+ }
+
+ // Show tooltip
+ selectedData = $$.filterTargetsToShow($$.data.targets).map(function (t) {
+ return $$.addName($$.getValueOnIndex(t.values, index));
+ });
+
+ if (config.tooltip_grouped) {
+ $$.showTooltip(selectedData, this);
+ $$.showXGridFocus(selectedData);
+ }
+
+ if (config.tooltip_grouped && (!config.data_selection_enabled || config.data_selection_grouped)) {
+ return;
+ }
+
+ $$.main.selectAll('.' + CLASS.shape + '-' + index)
+ .each(function () {
+ d3.select(this).classed(CLASS.EXPANDED, true);
+ if (config.data_selection_enabled) {
+ eventRect.style('cursor', config.data_selection_grouped ? 'pointer' : null);
+ }
+ if (!config.tooltip_grouped) {
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+ if (!config.data_selection_grouped) {
+ $$.unexpandCircles(index);
+ $$.unexpandBars(index);
+ }
+ }
+ })
+ .filter(function (d) {
+ return $$.isWithinShape(this, d);
+ })
+ .each(function (d) {
+ if (config.data_selection_enabled && (config.data_selection_grouped || config.data_selection_isselectable(d))) {
+ eventRect.style('cursor', 'pointer');
+ }
+ if (!config.tooltip_grouped) {
+ $$.showTooltip([d], this);
+ $$.showXGridFocus([d]);
+ if (config.point_focus_expand_enabled) { $$.expandCircles(index, d.id, true); }
+ $$.expandBars(index, d.id, true);
+ }
+ });
+ })
+ .on('click', function (d) {
+ var index = d.index;
+ if ($$.hasArcType() || !$$.toggleShape) { return; }
+ if ($$.cancelClick) {
+ $$.cancelClick = false;
+ return;
+ }
+ if ($$.isStepType(d) && config.line_step_type === 'step-after' && d3.mouse(this)[0] < $$.x($$.getXValue(d.id, index))) {
+ index -= 1;
+ }
+ $$.main.selectAll('.' + CLASS.shape + '-' + index).each(function (d) {
+ if (config.data_selection_grouped || $$.isWithinShape(this, d)) {
+ $$.toggleShape(this, d, index);
+ $$.config.data_onclick.call($$.api, d, this);
+ }
+ });
+ })
+ .call(
+ config.data_selection_draggable && $$.drag ? (
+ d3.behavior.drag().origin(Object)
+ .on('drag', function () { $$.drag(d3.mouse(this)); })
+ .on('dragstart', function () { $$.dragstart(d3.mouse(this)); })
+ .on('dragend', function () { $$.dragend(); })
+ ) : function () {}
+ );
+ };
+
+ c3_chart_internal_fn.generateEventRectsForMultipleXs = function (eventRectEnter) {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+
+ function mouseout() {
+ $$.svg.select('.' + CLASS.eventRect).style('cursor', null);
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+ $$.unexpandCircles();
+ $$.unexpandBars();
+ }
+
+ eventRectEnter.append('rect')
+ .attr('x', 0)
+ .attr('y', 0)
+ .attr('width', $$.width)
+ .attr('height', $$.height)
+ .attr('class', CLASS.eventRect)
+ .on('mouseout', function () {
+ if (!$$.config) { return; } // chart is destroyed
+ if ($$.hasArcType()) { return; }
+ mouseout();
+ })
+ .on('mousemove', function () {
+ var targetsToShow = $$.filterTargetsToShow($$.data.targets);
+ var mouse, closest, sameXData, selectedData;
+
+ if ($$.dragging) { return; } // do nothing when dragging
+ if ($$.hasArcType(targetsToShow)) { return; }
+
+ mouse = d3.mouse(this);
+ closest = $$.findClosestFromTargets(targetsToShow, mouse);
+
+ if ($$.mouseover && (!closest || closest.id !== $$.mouseover.id)) {
+ config.data_onmouseout.call($$.api, $$.mouseover);
+ $$.mouseover = undefined;
+ }
+
+ if (! closest) {
+ mouseout();
+ return;
+ }
+
+ if ($$.isScatterType(closest) || !config.tooltip_grouped) {
+ sameXData = [closest];
+ } else {
+ sameXData = $$.filterByX(targetsToShow, closest.x);
+ }
+
+ // show tooltip when cursor is close to some point
+ selectedData = sameXData.map(function (d) {
+ return $$.addName(d);
+ });
+ $$.showTooltip(selectedData, this);
+
+ // expand points
+ if (config.point_focus_expand_enabled) {
+ $$.expandCircles(closest.index, closest.id, true);
+ }
+ $$.expandBars(closest.index, closest.id, true);
+
+ // Show xgrid focus line
+ $$.showXGridFocus(selectedData);
+
+ // Show cursor as pointer if point is close to mouse position
+ if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < 100) {
+ $$.svg.select('.' + CLASS.eventRect).style('cursor', 'pointer');
+ if (!$$.mouseover) {
+ config.data_onmouseover.call($$.api, closest);
+ $$.mouseover = closest;
+ }
+ }
+ })
+ .on('click', function () {
+ var targetsToShow = $$.filterTargetsToShow($$.data.targets);
+ var mouse, closest;
+
+ if ($$.hasArcType(targetsToShow)) { return; }
+
+ mouse = d3.mouse(this);
+ closest = $$.findClosestFromTargets(targetsToShow, mouse);
+
+ if (! closest) { return; }
+
+ // select if selection enabled
+ if ($$.isBarType(closest.id) || $$.dist(closest, mouse) < 100) {
+ $$.main.selectAll('.' + CLASS.shapes + $$.getTargetSelectorSuffix(closest.id)).selectAll('.' + CLASS.shape + '-' + closest.index).each(function () {
+ if (config.data_selection_grouped || $$.isWithinShape(this, closest)) {
+ $$.toggleShape(this, closest, closest.index);
+ $$.config.data_onclick.call($$.api, closest, this);
+ }
+ });
+ }
+ })
+ .call(
+ config.data_selection_draggable && $$.drag ? (
+ d3.behavior.drag().origin(Object)
+ .on('drag', function () { $$.drag(d3.mouse(this)); })
+ .on('dragstart', function () { $$.dragstart(d3.mouse(this)); })
+ .on('dragend', function () { $$.dragend(); })
+ ) : function () {}
+ );
+ };
+ c3_chart_internal_fn.dispatchEvent = function (type, index, mouse) {
+ var $$ = this,
+ selector = '.' + CLASS.eventRect + (!$$.isMultipleX() ? '-' + index : ''),
+ eventRect = $$.main.select(selector).node(),
+ box = eventRect.getBoundingClientRect(),
+ x = box.left + (mouse ? mouse[0] : 0),
+ y = box.top + (mouse ? mouse[1] : 0),
+ event = document.createEvent("MouseEvents");
+
+ event.initMouseEvent(type, true, true, window, 0, x, y, x, y,
+ false, false, false, false, 0, null);
+ eventRect.dispatchEvent(event);
+ };
+
+ c3_chart_internal_fn.getCurrentWidth = function () {
+ var $$ = this, config = $$.config;
+ return config.size_width ? config.size_width : $$.getParentWidth();
+ };
+ c3_chart_internal_fn.getCurrentHeight = function () {
+ var $$ = this, config = $$.config,
+ h = config.size_height ? config.size_height : $$.getParentHeight();
+ return h > 0 ? h : 320 / ($$.hasType('gauge') ? 2 : 1);
+ };
+ c3_chart_internal_fn.getCurrentPaddingTop = function () {
+ var config = this.config;
+ return isValue(config.padding_top) ? config.padding_top : 0;
+ };
+ c3_chart_internal_fn.getCurrentPaddingBottom = function () {
+ var config = this.config;
+ return isValue(config.padding_bottom) ? config.padding_bottom : 0;
+ };
+ c3_chart_internal_fn.getCurrentPaddingLeft = function (withoutRecompute) {
+ var $$ = this, config = $$.config;
+ if (isValue(config.padding_left)) {
+ return config.padding_left;
+ } else if (config.axis_rotated) {
+ return !config.axis_x_show ? 1 : Math.max(ceil10($$.getAxisWidthByAxisId('x', withoutRecompute)), 40);
+ } else if (!config.axis_y_show || config.axis_y_inner) { // && !config.axis_rotated
+ return $$.axis.getYAxisLabelPosition().isOuter ? 30 : 1;
+ } else {
+ return ceil10($$.getAxisWidthByAxisId('y', withoutRecompute));
+ }
+ };
+ c3_chart_internal_fn.getCurrentPaddingRight = function () {
+ var $$ = this, config = $$.config,
+ defaultPadding = 10, legendWidthOnRight = $$.isLegendRight ? $$.getLegendWidth() + 20 : 0;
+ if (isValue(config.padding_right)) {
+ return config.padding_right + 1; // 1 is needed not to hide tick line
+ } else if (config.axis_rotated) {
+ return defaultPadding + legendWidthOnRight;
+ } else if (!config.axis_y2_show || config.axis_y2_inner) { // && !config.axis_rotated
+ return 2 + legendWidthOnRight + ($$.axis.getY2AxisLabelPosition().isOuter ? 20 : 0);
+ } else {
+ return ceil10($$.getAxisWidthByAxisId('y2')) + legendWidthOnRight;
+ }
+ };
+
+ c3_chart_internal_fn.getParentRectValue = function (key) {
+ var parent = this.selectChart.node(), v;
+ while (parent && parent.tagName !== 'BODY') {
+ try {
+ v = parent.getBoundingClientRect()[key];
+ } catch(e) {
+ if (key === 'width') {
+ // In IE in certain cases getBoundingClientRect
+ // will cause an "unspecified error"
+ v = parent.offsetWidth;
+ }
+ }
+ if (v) {
+ break;
+ }
+ parent = parent.parentNode;
+ }
+ return v;
+ };
+ c3_chart_internal_fn.getParentWidth = function () {
+ return this.getParentRectValue('width');
+ };
+ c3_chart_internal_fn.getParentHeight = function () {
+ var h = this.selectChart.style('height');
+ return h.indexOf('px') > 0 ? +h.replace('px', '') : 0;
+ };
+
+
+ c3_chart_internal_fn.getSvgLeft = function (withoutRecompute) {
+ var $$ = this, config = $$.config,
+ hasLeftAxisRect = config.axis_rotated || (!config.axis_rotated && !config.axis_y_inner),
+ leftAxisClass = config.axis_rotated ? CLASS.axisX : CLASS.axisY,
+ leftAxis = $$.main.select('.' + leftAxisClass).node(),
+ svgRect = leftAxis && hasLeftAxisRect ? leftAxis.getBoundingClientRect() : {right: 0},
+ chartRect = $$.selectChart.node().getBoundingClientRect(),
+ hasArc = $$.hasArcType(),
+ svgLeft = svgRect.right - chartRect.left - (hasArc ? 0 : $$.getCurrentPaddingLeft(withoutRecompute));
+ return svgLeft > 0 ? svgLeft : 0;
+ };
+
+
+ c3_chart_internal_fn.getAxisWidthByAxisId = function (id, withoutRecompute) {
+ var $$ = this, position = $$.axis.getLabelPositionById(id);
+ return $$.axis.getMaxTickWidth(id, withoutRecompute) + (position.isInner ? 20 : 40);
+ };
+ c3_chart_internal_fn.getHorizontalAxisHeight = function (axisId) {
+ var $$ = this, config = $$.config, h = 30;
+ if (axisId === 'x' && !config.axis_x_show) { return 8; }
+ if (axisId === 'x' && config.axis_x_height) { return config.axis_x_height; }
+ if (axisId === 'y' && !config.axis_y_show) { return config.legend_show && !$$.isLegendRight && !$$.isLegendInset ? 10 : 1; }
+ if (axisId === 'y2' && !config.axis_y2_show) { return $$.rotated_padding_top; }
+ // Calculate x axis height when tick rotated
+ if (axisId === 'x' && !config.axis_rotated && config.axis_x_tick_rotate) {
+ h = 30 + $$.axis.getMaxTickWidth(axisId) * Math.cos(Math.PI * (90 - config.axis_x_tick_rotate) / 180);
+ }
+ return h + ($$.axis.getLabelPositionById(axisId).isInner ? 0 : 10) + (axisId === 'y2' ? -10 : 0);
+ };
+
+ c3_chart_internal_fn.getEventRectWidth = function () {
+ return Math.max(0, this.xAxis.tickInterval());
+ };
+
+ c3_chart_internal_fn.getShapeIndices = function (typeFilter) {
+ var $$ = this, config = $$.config,
+ indices = {}, i = 0, j, k;
+ $$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$)).forEach(function (d) {
+ for (j = 0; j < config.data_groups.length; j++) {
+ if (config.data_groups[j].indexOf(d.id) < 0) { continue; }
+ for (k = 0; k < config.data_groups[j].length; k++) {
+ if (config.data_groups[j][k] in indices) {
+ indices[d.id] = indices[config.data_groups[j][k]];
+ break;
+ }
+ }
+ }
+ if (isUndefined(indices[d.id])) { indices[d.id] = i++; }
+ });
+ indices.__max__ = i - 1;
+ return indices;
+ };
+ c3_chart_internal_fn.getShapeX = function (offset, targetsNum, indices, isSub) {
+ var $$ = this, scale = isSub ? $$.subX : $$.x;
+ return function (d) {
+ var index = d.id in indices ? indices[d.id] : 0;
+ return d.x || d.x === 0 ? scale(d.x) - offset * (targetsNum / 2 - index) : 0;
+ };
+ };
+ c3_chart_internal_fn.getShapeY = function (isSub) {
+ var $$ = this;
+ return function (d) {
+ var scale = isSub ? $$.getSubYScale(d.id) : $$.getYScale(d.id);
+ return scale(d.value);
+ };
+ };
+ c3_chart_internal_fn.getShapeOffset = function (typeFilter, indices, isSub) {
+ var $$ = this,
+ targets = $$.orderTargets($$.filterTargetsToShow($$.data.targets.filter(typeFilter, $$))),
+ targetIds = targets.map(function (t) { return t.id; });
+ return function (d, i) {
+ var scale = isSub ? $$.getSubYScale(d.id) : $$.getYScale(d.id),
+ y0 = scale(0), offset = y0;
+ targets.forEach(function (t) {
+ var values = $$.isStepType(d) ? $$.convertValuesToStep(t.values) : t.values;
+ if (t.id === d.id || indices[t.id] !== indices[d.id]) { return; }
+ if (targetIds.indexOf(t.id) < targetIds.indexOf(d.id)) {
+ if (values[i].value * d.value >= 0) {
+ offset += scale(values[i].value) - y0;
+ }
+ }
+ });
+ return offset;
+ };
+ };
+ c3_chart_internal_fn.isWithinShape = function (that, d) {
+ var $$ = this,
+ shape = $$.d3.select(that), isWithin;
+ if (!$$.isTargetToShow(d.id)) {
+ isWithin = false;
+ }
+ else if (that.nodeName === 'circle') {
+ isWithin = $$.isStepType(d) ? $$.isWithinStep(that, $$.getYScale(d.id)(d.value)) : $$.isWithinCircle(that, $$.pointSelectR(d) * 1.5);
+ }
+ else if (that.nodeName === 'path') {
+ isWithin = shape.classed(CLASS.bar) ? $$.isWithinBar(that) : true;
+ }
+ return isWithin;
+ };
+
+
+ c3_chart_internal_fn.getInterpolate = function (d) {
+ var $$ = this;
+ return $$.isSplineType(d) ? "cardinal" : $$.isStepType(d) ? $$.config.line_step_type : "linear";
+ };
+
+ c3_chart_internal_fn.initLine = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartLines);
+ };
+ c3_chart_internal_fn.updateTargetsForLine = function (targets) {
+ var $$ = this, config = $$.config,
+ mainLineUpdate, mainLineEnter,
+ classChartLine = $$.classChartLine.bind($$),
+ classLines = $$.classLines.bind($$),
+ classAreas = $$.classAreas.bind($$),
+ classCircles = $$.classCircles.bind($$),
+ classFocus = $$.classFocus.bind($$);
+ mainLineUpdate = $$.main.select('.' + CLASS.chartLines).selectAll('.' + CLASS.chartLine)
+ .data(targets)
+ .attr('class', function (d) { return classChartLine(d) + classFocus(d); });
+ mainLineEnter = mainLineUpdate.enter().append('g')
+ .attr('class', classChartLine)
+ .style('opacity', 0)
+ .style("pointer-events", "none");
+ // Lines for each data
+ mainLineEnter.append('g')
+ .attr("class", classLines);
+ // Areas
+ mainLineEnter.append('g')
+ .attr('class', classAreas);
+ // Circles for each data point on lines
+ mainLineEnter.append('g')
+ .attr("class", function (d) { return $$.generateClass(CLASS.selectedCircles, d.id); });
+ mainLineEnter.append('g')
+ .attr("class", classCircles)
+ .style("cursor", function (d) { return config.data_selection_isselectable(d) ? "pointer" : null; });
+ // Update date for selected circles
+ targets.forEach(function (t) {
+ $$.main.selectAll('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(t.id)).selectAll('.' + CLASS.selectedCircle).each(function (d) {
+ d.value = t.values[d.index].value;
+ });
+ });
+ // MEMO: can not keep same color...
+ //mainLineUpdate.exit().remove();
+ };
+ c3_chart_internal_fn.updateLine = function (durationForExit) {
+ var $$ = this;
+ $$.mainLine = $$.main.selectAll('.' + CLASS.lines).selectAll('.' + CLASS.line)
+ .data($$.lineData.bind($$));
+ $$.mainLine.enter().append('path')
+ .attr('class', $$.classLine.bind($$))
+ .style("stroke", $$.color);
+ $$.mainLine
+ .style("opacity", $$.initialOpacity.bind($$))
+ .style('shape-rendering', function (d) { return $$.isStepType(d) ? 'crispEdges' : ''; })
+ .attr('transform', null);
+ $$.mainLine.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawLine = function (drawLine, withTransition) {
+ return [
+ (withTransition ? this.mainLine.transition() : this.mainLine)
+ .attr("d", drawLine)
+ .style("stroke", this.color)
+ .style("opacity", 1)
+ ];
+ };
+ c3_chart_internal_fn.generateDrawLine = function (lineIndices, isSub) {
+ var $$ = this, config = $$.config,
+ line = $$.d3.svg.line(),
+ getPoints = $$.generateGetLinePoints(lineIndices, isSub),
+ yScaleGetter = isSub ? $$.getSubYScale : $$.getYScale,
+ xValue = function (d) { return (isSub ? $$.subxx : $$.xx).call($$, d); },
+ yValue = function (d, i) {
+ return config.data_groups.length > 0 ? getPoints(d, i)[0][1] : yScaleGetter.call($$, d.id)(d.value);
+ };
+
+ line = config.axis_rotated ? line.x(yValue).y(xValue) : line.x(xValue).y(yValue);
+ if (!config.line_connectNull) { line = line.defined(function (d) { return d.value != null; }); }
+ return function (d) {
+ var values = config.line_connectNull ? $$.filterRemoveNull(d.values) : d.values,
+ x = isSub ? $$.x : $$.subX, y = yScaleGetter.call($$, d.id), x0 = 0, y0 = 0, path;
+ if ($$.isLineType(d)) {
+ if (config.data_regions[d.id]) {
+ path = $$.lineWithRegions(values, x, y, config.data_regions[d.id]);
+ } else {
+ if ($$.isStepType(d)) { values = $$.convertValuesToStep(values); }
+ path = line.interpolate($$.getInterpolate(d))(values);
+ }
+ } else {
+ if (values[0]) {
+ x0 = x(values[0].x);
+ y0 = y(values[0].value);
+ }
+ path = config.axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
+ }
+ return path ? path : "M 0 0";
+ };
+ };
+ c3_chart_internal_fn.generateGetLinePoints = function (lineIndices, isSub) { // partial duplication of generateGetBarPoints
+ var $$ = this, config = $$.config,
+ lineTargetsNum = lineIndices.__max__ + 1,
+ x = $$.getShapeX(0, lineTargetsNum, lineIndices, !!isSub),
+ y = $$.getShapeY(!!isSub),
+ lineOffset = $$.getShapeOffset($$.isLineType, lineIndices, !!isSub),
+ yScale = isSub ? $$.getSubYScale : $$.getYScale;
+ return function (d, i) {
+ var y0 = yScale.call($$, d.id)(0),
+ offset = lineOffset(d, i) || y0, // offset is for stacked area chart
+ posX = x(d), posY = y(d);
+ // fix posY not to overflow opposite quadrant
+ if (config.axis_rotated) {
+ if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; }
+ }
+ // 1 point that marks the line position
+ return [
+ [posX, posY - (y0 - offset)],
+ [posX, posY - (y0 - offset)], // needed for compatibility
+ [posX, posY - (y0 - offset)], // needed for compatibility
+ [posX, posY - (y0 - offset)] // needed for compatibility
+ ];
+ };
+ };
+
+
+ c3_chart_internal_fn.lineWithRegions = function (d, x, y, _regions) {
+ var $$ = this, config = $$.config,
+ prev = -1, i, j,
+ s = "M", sWithRegion,
+ xp, yp, dx, dy, dd, diff, diffx2,
+ xOffset = $$.isCategorized() ? 0.5 : 0,
+ xValue, yValue,
+ regions = [];
+
+ function isWithinRegions(x, regions) {
+ var i;
+ for (i = 0; i < regions.length; i++) {
+ if (regions[i].start < x && x <= regions[i].end) { return true; }
+ }
+ return false;
+ }
+
+ // Check start/end of regions
+ if (isDefined(_regions)) {
+ for (i = 0; i < _regions.length; i++) {
+ regions[i] = {};
+ if (isUndefined(_regions[i].start)) {
+ regions[i].start = d[0].x;
+ } else {
+ regions[i].start = $$.isTimeSeries() ? $$.parseDate(_regions[i].start) : _regions[i].start;
+ }
+ if (isUndefined(_regions[i].end)) {
+ regions[i].end = d[d.length - 1].x;
+ } else {
+ regions[i].end = $$.isTimeSeries() ? $$.parseDate(_regions[i].end) : _regions[i].end;
+ }
+ }
+ }
+
+ // Set scales
+ xValue = config.axis_rotated ? function (d) { return y(d.value); } : function (d) { return x(d.x); };
+ yValue = config.axis_rotated ? function (d) { return x(d.x); } : function (d) { return y(d.value); };
+
+ // Define svg generator function for region
+ function generateM(points) {
+ return 'M' + points[0][0] + ' ' + points[0][1] + ' ' + points[1][0] + ' ' + points[1][1];
+ }
+ if ($$.isTimeSeries()) {
+ sWithRegion = function (d0, d1, j, diff) {
+ var x0 = d0.x.getTime(), x_diff = d1.x - d0.x,
+ xv0 = new Date(x0 + x_diff * j),
+ xv1 = new Date(x0 + x_diff * (j + diff)),
+ points;
+ if (config.axis_rotated) {
+ points = [[y(yp(j)), x(xv0)], [y(yp(j + diff)), x(xv1)]];
+ } else {
+ points = [[x(xv0), y(yp(j))], [x(xv1), y(yp(j + diff))]];
+ }
+ return generateM(points);
+ };
+ } else {
+ sWithRegion = function (d0, d1, j, diff) {
+ var points;
+ if (config.axis_rotated) {
+ points = [[y(yp(j), true), x(xp(j))], [y(yp(j + diff), true), x(xp(j + diff))]];
+ } else {
+ points = [[x(xp(j), true), y(yp(j))], [x(xp(j + diff), true), y(yp(j + diff))]];
+ }
+ return generateM(points);
+ };
+ }
+
+ // Generate
+ for (i = 0; i < d.length; i++) {
+
+ // Draw as normal
+ if (isUndefined(regions) || ! isWithinRegions(d[i].x, regions)) {
+ s += " " + xValue(d[i]) + " " + yValue(d[i]);
+ }
+ // Draw with region // TODO: Fix for horizotal charts
+ else {
+ xp = $$.getScale(d[i - 1].x + xOffset, d[i].x + xOffset, $$.isTimeSeries());
+ yp = $$.getScale(d[i - 1].value, d[i].value);
+
+ dx = x(d[i].x) - x(d[i - 1].x);
+ dy = y(d[i].value) - y(d[i - 1].value);
+ dd = Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2));
+ diff = 2 / dd;
+ diffx2 = diff * 2;
+
+ for (j = diff; j <= 1; j += diffx2) {
+ s += sWithRegion(d[i - 1], d[i], j, diff);
+ }
+ }
+ prev = d[i].x;
+ }
+
+ return s;
+ };
+
+
+ c3_chart_internal_fn.updateArea = function (durationForExit) {
+ var $$ = this, d3 = $$.d3;
+ $$.mainArea = $$.main.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area)
+ .data($$.lineData.bind($$));
+ $$.mainArea.enter().append('path')
+ .attr("class", $$.classArea.bind($$))
+ .style("fill", $$.color)
+ .style("opacity", function () { $$.orgAreaOpacity = +d3.select(this).style('opacity'); return 0; });
+ $$.mainArea
+ .style("opacity", $$.orgAreaOpacity);
+ $$.mainArea.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawArea = function (drawArea, withTransition) {
+ return [
+ (withTransition ? this.mainArea.transition() : this.mainArea)
+ .attr("d", drawArea)
+ .style("fill", this.color)
+ .style("opacity", this.orgAreaOpacity)
+ ];
+ };
+ c3_chart_internal_fn.generateDrawArea = function (areaIndices, isSub) {
+ var $$ = this, config = $$.config, area = $$.d3.svg.area(),
+ getPoints = $$.generateGetAreaPoints(areaIndices, isSub),
+ yScaleGetter = isSub ? $$.getSubYScale : $$.getYScale,
+ xValue = function (d) { return (isSub ? $$.subxx : $$.xx).call($$, d); },
+ value0 = function (d, i) {
+ return config.data_groups.length > 0 ? getPoints(d, i)[0][1] : yScaleGetter.call($$, d.id)($$.getAreaBaseValue(d.id));
+ },
+ value1 = function (d, i) {
+ return config.data_groups.length > 0 ? getPoints(d, i)[1][1] : yScaleGetter.call($$, d.id)(d.value);
+ };
+
+ area = config.axis_rotated ? area.x0(value0).x1(value1).y(xValue) : area.x(xValue).y0(value0).y1(value1);
+ if (!config.line_connectNull) {
+ area = area.defined(function (d) { return d.value !== null; });
+ }
+
+ return function (d) {
+ var values = config.line_connectNull ? $$.filterRemoveNull(d.values) : d.values,
+ x0 = 0, y0 = 0, path;
+ if ($$.isAreaType(d)) {
+ if ($$.isStepType(d)) { values = $$.convertValuesToStep(values); }
+ path = area.interpolate($$.getInterpolate(d))(values);
+ } else {
+ if (values[0]) {
+ x0 = $$.x(values[0].x);
+ y0 = $$.getYScale(d.id)(values[0].value);
+ }
+ path = config.axis_rotated ? "M " + y0 + " " + x0 : "M " + x0 + " " + y0;
+ }
+ return path ? path : "M 0 0";
+ };
+ };
+ c3_chart_internal_fn.getAreaBaseValue = function () {
+ return 0;
+ };
+ c3_chart_internal_fn.generateGetAreaPoints = function (areaIndices, isSub) { // partial duplication of generateGetBarPoints
+ var $$ = this, config = $$.config,
+ areaTargetsNum = areaIndices.__max__ + 1,
+ x = $$.getShapeX(0, areaTargetsNum, areaIndices, !!isSub),
+ y = $$.getShapeY(!!isSub),
+ areaOffset = $$.getShapeOffset($$.isAreaType, areaIndices, !!isSub),
+ yScale = isSub ? $$.getSubYScale : $$.getYScale;
+ return function (d, i) {
+ var y0 = yScale.call($$, d.id)(0),
+ offset = areaOffset(d, i) || y0, // offset is for stacked area chart
+ posX = x(d), posY = y(d);
+ // fix posY not to overflow opposite quadrant
+ if (config.axis_rotated) {
+ if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; }
+ }
+ // 1 point that marks the area position
+ return [
+ [posX, offset],
+ [posX, posY - (y0 - offset)],
+ [posX, posY - (y0 - offset)], // needed for compatibility
+ [posX, offset] // needed for compatibility
+ ];
+ };
+ };
+
+
+ c3_chart_internal_fn.updateCircle = function () {
+ var $$ = this;
+ $$.mainCircle = $$.main.selectAll('.' + CLASS.circles).selectAll('.' + CLASS.circle)
+ .data($$.lineOrScatterData.bind($$));
+ $$.mainCircle.enter().append("circle")
+ .attr("class", $$.classCircle.bind($$))
+ .attr("r", $$.pointR.bind($$))
+ .style("fill", $$.color);
+ $$.mainCircle
+ .style("opacity", $$.initialOpacityForCircle.bind($$));
+ $$.mainCircle.exit().remove();
+ };
+ c3_chart_internal_fn.redrawCircle = function (cx, cy, withTransition) {
+ var selectedCircles = this.main.selectAll('.' + CLASS.selectedCircle);
+ return [
+ (withTransition ? this.mainCircle.transition() : this.mainCircle)
+ .style('opacity', this.opacityForCircle.bind(this))
+ .style("fill", this.color)
+ .attr("cx", cx)
+ .attr("cy", cy),
+ (withTransition ? selectedCircles.transition() : selectedCircles)
+ .attr("cx", cx)
+ .attr("cy", cy)
+ ];
+ };
+ c3_chart_internal_fn.circleX = function (d) {
+ return d.x || d.x === 0 ? this.x(d.x) : null;
+ };
+ c3_chart_internal_fn.updateCircleY = function () {
+ var $$ = this, lineIndices, getPoints;
+ if ($$.config.data_groups.length > 0) {
+ lineIndices = $$.getShapeIndices($$.isLineType),
+ getPoints = $$.generateGetLinePoints(lineIndices);
+ $$.circleY = function (d, i) {
+ return getPoints(d, i)[0][1];
+ };
+ } else {
+ $$.circleY = function (d) {
+ return $$.getYScale(d.id)(d.value);
+ };
+ }
+ };
+ c3_chart_internal_fn.getCircles = function (i, id) {
+ var $$ = this;
+ return (id ? $$.main.selectAll('.' + CLASS.circles + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS.circle + (isValue(i) ? '-' + i : ''));
+ };
+ c3_chart_internal_fn.expandCircles = function (i, id, reset) {
+ var $$ = this,
+ r = $$.pointExpandedR.bind($$);
+ if (reset) { $$.unexpandCircles(); }
+ $$.getCircles(i, id)
+ .classed(CLASS.EXPANDED, true)
+ .attr('r', r);
+ };
+ c3_chart_internal_fn.unexpandCircles = function (i) {
+ var $$ = this,
+ r = $$.pointR.bind($$);
+ $$.getCircles(i)
+ .filter(function () { return $$.d3.select(this).classed(CLASS.EXPANDED); })
+ .classed(CLASS.EXPANDED, false)
+ .attr('r', r);
+ };
+ c3_chart_internal_fn.pointR = function (d) {
+ var $$ = this, config = $$.config;
+ return $$.isStepType(d) ? 0 : (isFunction(config.point_r) ? config.point_r(d) : config.point_r);
+ };
+ c3_chart_internal_fn.pointExpandedR = function (d) {
+ var $$ = this, config = $$.config;
+ return config.point_focus_expand_enabled ? (config.point_focus_expand_r ? config.point_focus_expand_r : $$.pointR(d) * 1.75) : $$.pointR(d);
+ };
+ c3_chart_internal_fn.pointSelectR = function (d) {
+ var $$ = this, config = $$.config;
+ return config.point_select_r ? config.point_select_r : $$.pointR(d) * 4;
+ };
+ c3_chart_internal_fn.isWithinCircle = function (that, r) {
+ var d3 = this.d3,
+ mouse = d3.mouse(that), d3_this = d3.select(that),
+ cx = +d3_this.attr("cx"), cy = +d3_this.attr("cy");
+ return Math.sqrt(Math.pow(cx - mouse[0], 2) + Math.pow(cy - mouse[1], 2)) < r;
+ };
+ c3_chart_internal_fn.isWithinStep = function (that, y) {
+ return Math.abs(y - this.d3.mouse(that)[1]) < 30;
+ };
+
+ c3_chart_internal_fn.initBar = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartBars);
+ };
+ c3_chart_internal_fn.updateTargetsForBar = function (targets) {
+ var $$ = this, config = $$.config,
+ mainBarUpdate, mainBarEnter,
+ classChartBar = $$.classChartBar.bind($$),
+ classBars = $$.classBars.bind($$),
+ classFocus = $$.classFocus.bind($$);
+ mainBarUpdate = $$.main.select('.' + CLASS.chartBars).selectAll('.' + CLASS.chartBar)
+ .data(targets)
+ .attr('class', function (d) { return classChartBar(d) + classFocus(d); });
+ mainBarEnter = mainBarUpdate.enter().append('g')
+ .attr('class', classChartBar)
+ .style('opacity', 0)
+ .style("pointer-events", "none");
+ // Bars for each data
+ mainBarEnter.append('g')
+ .attr("class", classBars)
+ .style("cursor", function (d) { return config.data_selection_isselectable(d) ? "pointer" : null; });
+
+ };
+ c3_chart_internal_fn.updateBar = function (durationForExit) {
+ var $$ = this,
+ barData = $$.barData.bind($$),
+ classBar = $$.classBar.bind($$),
+ initialOpacity = $$.initialOpacity.bind($$),
+ color = function (d) { return $$.color(d.id); };
+ $$.mainBar = $$.main.selectAll('.' + CLASS.bars).selectAll('.' + CLASS.bar)
+ .data(barData);
+ $$.mainBar.enter().append('path')
+ .attr("class", classBar)
+ .style("stroke", color)
+ .style("fill", color);
+ $$.mainBar
+ .style("opacity", initialOpacity);
+ $$.mainBar.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawBar = function (drawBar, withTransition) {
+ return [
+ (withTransition ? this.mainBar.transition() : this.mainBar)
+ .attr('d', drawBar)
+ .style("fill", this.color)
+ .style("opacity", 1)
+ ];
+ };
+ c3_chart_internal_fn.getBarW = function (axis, barTargetsNum) {
+ var $$ = this, config = $$.config,
+ w = typeof config.bar_width === 'number' ? config.bar_width : barTargetsNum ? (axis.tickInterval() * config.bar_width_ratio) / barTargetsNum : 0;
+ return config.bar_width_max && w > config.bar_width_max ? config.bar_width_max : w;
+ };
+ c3_chart_internal_fn.getBars = function (i, id) {
+ var $$ = this;
+ return (id ? $$.main.selectAll('.' + CLASS.bars + $$.getTargetSelectorSuffix(id)) : $$.main).selectAll('.' + CLASS.bar + (isValue(i) ? '-' + i : ''));
+ };
+ c3_chart_internal_fn.expandBars = function (i, id, reset) {
+ var $$ = this;
+ if (reset) { $$.unexpandBars(); }
+ $$.getBars(i, id).classed(CLASS.EXPANDED, true);
+ };
+ c3_chart_internal_fn.unexpandBars = function (i) {
+ var $$ = this;
+ $$.getBars(i).classed(CLASS.EXPANDED, false);
+ };
+ c3_chart_internal_fn.generateDrawBar = function (barIndices, isSub) {
+ var $$ = this, config = $$.config,
+ getPoints = $$.generateGetBarPoints(barIndices, isSub);
+ return function (d, i) {
+ // 4 points that make a bar
+ var points = getPoints(d, i);
+
+ // switch points if axis is rotated, not applicable for sub chart
+ var indexX = config.axis_rotated ? 1 : 0;
+ var indexY = config.axis_rotated ? 0 : 1;
+
+ var path = 'M ' + points[0][indexX] + ',' + points[0][indexY] + ' ' +
+ 'L' + points[1][indexX] + ',' + points[1][indexY] + ' ' +
+ 'L' + points[2][indexX] + ',' + points[2][indexY] + ' ' +
+ 'L' + points[3][indexX] + ',' + points[3][indexY] + ' ' +
+ 'z';
+
+ return path;
+ };
+ };
+ c3_chart_internal_fn.generateGetBarPoints = function (barIndices, isSub) {
+ var $$ = this,
+ axis = isSub ? $$.subXAxis : $$.xAxis,
+ barTargetsNum = barIndices.__max__ + 1,
+ barW = $$.getBarW(axis, barTargetsNum),
+ barX = $$.getShapeX(barW, barTargetsNum, barIndices, !!isSub),
+ barY = $$.getShapeY(!!isSub),
+ barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub),
+ yScale = isSub ? $$.getSubYScale : $$.getYScale;
+ return function (d, i) {
+ var y0 = yScale.call($$, d.id)(0),
+ offset = barOffset(d, i) || y0, // offset is for stacked bar chart
+ posX = barX(d), posY = barY(d);
+ // fix posY not to overflow opposite quadrant
+ if ($$.config.axis_rotated) {
+ if ((0 < d.value && posY < y0) || (d.value < 0 && y0 < posY)) { posY = y0; }
+ }
+ // 4 points that make a bar
+ return [
+ [posX, offset],
+ [posX, posY - (y0 - offset)],
+ [posX + barW, posY - (y0 - offset)],
+ [posX + barW, offset]
+ ];
+ };
+ };
+ c3_chart_internal_fn.isWithinBar = function (that) {
+ var mouse = this.d3.mouse(that), box = that.getBoundingClientRect(),
+ seg0 = that.pathSegList.getItem(0), seg1 = that.pathSegList.getItem(1),
+ x = Math.min(seg0.x, seg1.x), y = Math.min(seg0.y, seg1.y),
+ w = box.width, h = box.height, offset = 2,
+ sx = x - offset, ex = x + w + offset, sy = y + h + offset, ey = y - offset;
+ return sx < mouse[0] && mouse[0] < ex && ey < mouse[1] && mouse[1] < sy;
+ };
+
+ c3_chart_internal_fn.initText = function () {
+ var $$ = this;
+ $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartTexts);
+ $$.mainText = $$.d3.selectAll([]);
+ };
+ c3_chart_internal_fn.updateTargetsForText = function (targets) {
+ var $$ = this, mainTextUpdate, mainTextEnter,
+ classChartText = $$.classChartText.bind($$),
+ classTexts = $$.classTexts.bind($$),
+ classFocus = $$.classFocus.bind($$);
+ mainTextUpdate = $$.main.select('.' + CLASS.chartTexts).selectAll('.' + CLASS.chartText)
+ .data(targets)
+ .attr('class', function (d) { return classChartText(d) + classFocus(d); });
+ mainTextEnter = mainTextUpdate.enter().append('g')
+ .attr('class', classChartText)
+ .style('opacity', 0)
+ .style("pointer-events", "none");
+ mainTextEnter.append('g')
+ .attr('class', classTexts);
+ };
+ c3_chart_internal_fn.updateText = function (durationForExit) {
+ var $$ = this, config = $$.config,
+ barOrLineData = $$.barOrLineData.bind($$),
+ classText = $$.classText.bind($$);
+ $$.mainText = $$.main.selectAll('.' + CLASS.texts).selectAll('.' + CLASS.text)
+ .data(barOrLineData);
+ $$.mainText.enter().append('text')
+ .attr("class", classText)
+ .attr('text-anchor', function (d) { return config.axis_rotated ? (d.value < 0 ? 'end' : 'start') : 'middle'; })
+ .style("stroke", 'none')
+ .style("fill", function (d) { return $$.color(d); })
+ .style("fill-opacity", 0);
+ $$.mainText
+ .text(function (d, i, j) { return $$.dataLabelFormat(d.id)(d.value, d.id, i, j); });
+ $$.mainText.exit()
+ .transition().duration(durationForExit)
+ .style('fill-opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawText = function (xForText, yForText, forFlow, withTransition) {
+ return [
+ (withTransition ? this.mainText.transition() : this.mainText)
+ .attr('x', xForText)
+ .attr('y', yForText)
+ .style("fill", this.color)
+ .style("fill-opacity", forFlow ? 0 : this.opacityForText.bind(this))
+ ];
+ };
+ c3_chart_internal_fn.getTextRect = function (text, cls) {
+ var dummy = this.d3.select('body').append('div').classed('c3', true),
+ svg = dummy.append("svg").style('visibility', 'hidden').style('position', 'fixed').style('top', 0).style('left', 0),
+ rect;
+ svg.selectAll('.dummy')
+ .data([text])
+ .enter().append('text')
+ .classed(cls ? cls : "", true)
+ .text(text)
+ .each(function () { rect = this.getBoundingClientRect(); });
+ dummy.remove();
+ return rect;
+ };
+ c3_chart_internal_fn.generateXYForText = function (areaIndices, barIndices, lineIndices, forX) {
+ var $$ = this,
+ getAreaPoints = $$.generateGetAreaPoints(areaIndices, false),
+ getBarPoints = $$.generateGetBarPoints(barIndices, false),
+ getLinePoints = $$.generateGetLinePoints(lineIndices, false),
+ getter = forX ? $$.getXForText : $$.getYForText;
+ return function (d, i) {
+ var getPoints = $$.isAreaType(d) ? getAreaPoints : $$.isBarType(d) ? getBarPoints : getLinePoints;
+ return getter.call($$, getPoints(d, i), d, this);
+ };
+ };
+ c3_chart_internal_fn.getXForText = function (points, d, textElement) {
+ var $$ = this,
+ box = textElement.getBoundingClientRect(), xPos, padding;
+ if ($$.config.axis_rotated) {
+ padding = $$.isBarType(d) ? 4 : 6;
+ xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
+ } else {
+ xPos = $$.hasType('bar') ? (points[2][0] + points[0][0]) / 2 : points[0][0];
+ }
+ // show labels regardless of the domain if value is null
+ if (d.value === null) {
+ if (xPos > $$.width) {
+ xPos = $$.width - box.width;
+ } else if (xPos < 0) {
+ xPos = 4;
+ }
+ }
+ return xPos;
+ };
+ c3_chart_internal_fn.getYForText = function (points, d, textElement) {
+ var $$ = this,
+ box = textElement.getBoundingClientRect(),
+ yPos;
+ if ($$.config.axis_rotated) {
+ yPos = (points[0][0] + points[2][0] + box.height * 0.6) / 2;
+ } else {
+ yPos = points[2][1];
+ if (d.value < 0) {
+ yPos += box.height;
+ if ($$.isBarType(d) && $$.isSafari()) {
+ yPos -= 3;
+ }
+ else if (!$$.isBarType(d) && $$.isChrome()) {
+ yPos += 3;
+ }
+ } else {
+ yPos += $$.isBarType(d) ? -3 : -6;
+ }
+ }
+ // show labels regardless of the domain if value is null
+ if (d.value === null && !$$.config.axis_rotated) {
+ if (yPos < box.height) {
+ yPos = box.height;
+ } else if (yPos > this.height) {
+ yPos = this.height - 4;
+ }
+ }
+ return yPos;
+ };
+
+ c3_chart_internal_fn.setTargetType = function (targetIds, type) {
+ var $$ = this, config = $$.config;
+ $$.mapToTargetIds(targetIds).forEach(function (id) {
+ $$.withoutFadeIn[id] = (type === config.data_types[id]);
+ config.data_types[id] = type;
+ });
+ if (!targetIds) {
+ config.data_type = type;
+ }
+ };
+ c3_chart_internal_fn.hasType = function (type, targets) {
+ var $$ = this, types = $$.config.data_types, has = false;
+ targets = targets || $$.data.targets;
+ if (targets && targets.length) {
+ targets.forEach(function (target) {
+ var t = types[target.id];
+ if ((t && t.indexOf(type) >= 0) || (!t && type === 'line')) {
+ has = true;
+ }
+ });
+ } else if (Object.keys(types).length) {
+ Object.keys(types).forEach(function (id) {
+ if (types[id] === type) { has = true; }
+ });
+ } else {
+ has = $$.config.data_type === type;
+ }
+ return has;
+ };
+ c3_chart_internal_fn.hasArcType = function (targets) {
+ return this.hasType('pie', targets) || this.hasType('donut', targets) || this.hasType('gauge', targets);
+ };
+ c3_chart_internal_fn.isLineType = function (d) {
+ var config = this.config, id = isString(d) ? d : d.id;
+ return !config.data_types[id] || ['line', 'spline', 'area', 'area-spline', 'step', 'area-step'].indexOf(config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isStepType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return ['step', 'area-step'].indexOf(this.config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isSplineType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return ['spline', 'area-spline'].indexOf(this.config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isAreaType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return ['area', 'area-spline', 'area-step'].indexOf(this.config.data_types[id]) >= 0;
+ };
+ c3_chart_internal_fn.isBarType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'bar';
+ };
+ c3_chart_internal_fn.isScatterType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'scatter';
+ };
+ c3_chart_internal_fn.isPieType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'pie';
+ };
+ c3_chart_internal_fn.isGaugeType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'gauge';
+ };
+ c3_chart_internal_fn.isDonutType = function (d) {
+ var id = isString(d) ? d : d.id;
+ return this.config.data_types[id] === 'donut';
+ };
+ c3_chart_internal_fn.isArcType = function (d) {
+ return this.isPieType(d) || this.isDonutType(d) || this.isGaugeType(d);
+ };
+ c3_chart_internal_fn.lineData = function (d) {
+ return this.isLineType(d) ? [d] : [];
+ };
+ c3_chart_internal_fn.arcData = function (d) {
+ return this.isArcType(d.data) ? [d] : [];
+ };
+ /* not used
+ function scatterData(d) {
+ return isScatterType(d) ? d.values : [];
+ }
+ */
+ c3_chart_internal_fn.barData = function (d) {
+ return this.isBarType(d) ? d.values : [];
+ };
+ c3_chart_internal_fn.lineOrScatterData = function (d) {
+ return this.isLineType(d) || this.isScatterType(d) ? d.values : [];
+ };
+ c3_chart_internal_fn.barOrLineData = function (d) {
+ return this.isBarType(d) || this.isLineType(d) ? d.values : [];
+ };
+
+ c3_chart_internal_fn.initGrid = function () {
+ var $$ = this, config = $$.config, d3 = $$.d3;
+ $$.grid = $$.main.append('g')
+ .attr("clip-path", $$.clipPathForGrid)
+ .attr('class', CLASS.grid);
+ if (config.grid_x_show) {
+ $$.grid.append("g").attr("class", CLASS.xgrids);
+ }
+ if (config.grid_y_show) {
+ $$.grid.append('g').attr('class', CLASS.ygrids);
+ }
+ if (config.grid_focus_show) {
+ $$.grid.append('g')
+ .attr("class", CLASS.xgridFocus)
+ .append('line')
+ .attr('class', CLASS.xgridFocus);
+ }
+ $$.xgrid = d3.selectAll([]);
+ if (!config.grid_lines_front) { $$.initGridLines(); }
+ };
+ c3_chart_internal_fn.initGridLines = function () {
+ var $$ = this, d3 = $$.d3;
+ $$.gridLines = $$.main.append('g')
+ .attr("clip-path", $$.clipPathForGrid)
+ .attr('class', CLASS.grid + ' ' + CLASS.gridLines);
+ $$.gridLines.append('g').attr("class", CLASS.xgridLines);
+ $$.gridLines.append('g').attr('class', CLASS.ygridLines);
+ $$.xgridLines = d3.selectAll([]);
+ };
+ c3_chart_internal_fn.updateXGrid = function (withoutUpdate) {
+ var $$ = this, config = $$.config, d3 = $$.d3,
+ xgridData = $$.generateGridData(config.grid_x_type, $$.x),
+ tickOffset = $$.isCategorized() ? $$.xAxis.tickOffset() : 0;
+
+ $$.xgridAttr = config.axis_rotated ? {
+ 'x1': 0,
+ 'x2': $$.width,
+ 'y1': function (d) { return $$.x(d) - tickOffset; },
+ 'y2': function (d) { return $$.x(d) - tickOffset; }
+ } : {
+ 'x1': function (d) { return $$.x(d) + tickOffset; },
+ 'x2': function (d) { return $$.x(d) + tickOffset; },
+ 'y1': 0,
+ 'y2': $$.height
+ };
+
+ $$.xgrid = $$.main.select('.' + CLASS.xgrids).selectAll('.' + CLASS.xgrid)
+ .data(xgridData);
+ $$.xgrid.enter().append('line').attr("class", CLASS.xgrid);
+ if (!withoutUpdate) {
+ $$.xgrid.attr($$.xgridAttr)
+ .style("opacity", function () { return +d3.select(this).attr(config.axis_rotated ? 'y1' : 'x1') === (config.axis_rotated ? $$.height : 0) ? 0 : 1; });
+ }
+ $$.xgrid.exit().remove();
+ };
+
+ c3_chart_internal_fn.updateYGrid = function () {
+ var $$ = this, config = $$.config,
+ gridValues = $$.yAxis.tickValues() || $$.y.ticks(config.grid_y_ticks);
+ $$.ygrid = $$.main.select('.' + CLASS.ygrids).selectAll('.' + CLASS.ygrid)
+ .data(gridValues);
+ $$.ygrid.enter().append('line')
+ .attr('class', CLASS.ygrid);
+ $$.ygrid.attr("x1", config.axis_rotated ? $$.y : 0)
+ .attr("x2", config.axis_rotated ? $$.y : $$.width)
+ .attr("y1", config.axis_rotated ? 0 : $$.y)
+ .attr("y2", config.axis_rotated ? $$.height : $$.y);
+ $$.ygrid.exit().remove();
+ $$.smoothLines($$.ygrid, 'grid');
+ };
+
+ c3_chart_internal_fn.gridTextAnchor = function (d) {
+ return d.position ? d.position : "end";
+ };
+ c3_chart_internal_fn.gridTextDx = function (d) {
+ return d.position === 'start' ? 4 : d.position === 'middle' ? 0 : -4;
+ };
+ c3_chart_internal_fn.xGridTextX = function (d) {
+ return d.position === 'start' ? -this.height : d.position === 'middle' ? -this.height / 2 : 0;
+ };
+ c3_chart_internal_fn.yGridTextX = function (d) {
+ return d.position === 'start' ? 0 : d.position === 'middle' ? this.width / 2 : this.width;
+ };
+ c3_chart_internal_fn.updateGrid = function (duration) {
+ var $$ = this, main = $$.main, config = $$.config,
+ xgridLine, ygridLine, yv;
+
+ // hide if arc type
+ $$.grid.style('visibility', $$.hasArcType() ? 'hidden' : 'visible');
+
+ main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
+ if (config.grid_x_show) {
+ $$.updateXGrid();
+ }
+ $$.xgridLines = main.select('.' + CLASS.xgridLines).selectAll('.' + CLASS.xgridLine)
+ .data(config.grid_x_lines);
+ // enter
+ xgridLine = $$.xgridLines.enter().append('g')
+ .attr("class", function (d) { return CLASS.xgridLine + (d['class'] ? ' ' + d['class'] : ''); });
+ xgridLine.append('line')
+ .style("opacity", 0);
+ xgridLine.append('text')
+ .attr("text-anchor", $$.gridTextAnchor)
+ .attr("transform", config.axis_rotated ? "" : "rotate(-90)")
+ .attr('dx', $$.gridTextDx)
+ .attr('dy', -5)
+ .style("opacity", 0);
+ // udpate
+ // done in d3.transition() of the end of this function
+ // exit
+ $$.xgridLines.exit().transition().duration(duration)
+ .style("opacity", 0)
+ .remove();
+
+ // Y-Grid
+ if (config.grid_y_show) {
+ $$.updateYGrid();
+ }
+ $$.ygridLines = main.select('.' + CLASS.ygridLines).selectAll('.' + CLASS.ygridLine)
+ .data(config.grid_y_lines);
+ // enter
+ ygridLine = $$.ygridLines.enter().append('g')
+ .attr("class", function (d) { return CLASS.ygridLine + (d['class'] ? ' ' + d['class'] : ''); });
+ ygridLine.append('line')
+ .style("opacity", 0);
+ ygridLine.append('text')
+ .attr("text-anchor", $$.gridTextAnchor)
+ .attr("transform", config.axis_rotated ? "rotate(-90)" : "")
+ .attr('dx', $$.gridTextDx)
+ .attr('dy', -5)
+ .style("opacity", 0);
+ // update
+ yv = $$.yv.bind($$);
+ $$.ygridLines.select('line')
+ .transition().duration(duration)
+ .attr("x1", config.axis_rotated ? yv : 0)
+ .attr("x2", config.axis_rotated ? yv : $$.width)
+ .attr("y1", config.axis_rotated ? 0 : yv)
+ .attr("y2", config.axis_rotated ? $$.height : yv)
+ .style("opacity", 1);
+ $$.ygridLines.select('text')
+ .transition().duration(duration)
+ .attr("x", config.axis_rotated ? $$.xGridTextX.bind($$) : $$.yGridTextX.bind($$))
+ .attr("y", yv)
+ .text(function (d) { return d.text; })
+ .style("opacity", 1);
+ // exit
+ $$.ygridLines.exit().transition().duration(duration)
+ .style("opacity", 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawGrid = function (withTransition) {
+ var $$ = this, config = $$.config, xv = $$.xv.bind($$),
+ lines = $$.xgridLines.select('line'),
+ texts = $$.xgridLines.select('text');
+ return [
+ (withTransition ? lines.transition() : lines)
+ .attr("x1", config.axis_rotated ? 0 : xv)
+ .attr("x2", config.axis_rotated ? $$.width : xv)
+ .attr("y1", config.axis_rotated ? xv : 0)
+ .attr("y2", config.axis_rotated ? xv : $$.height)
+ .style("opacity", 1),
+ (withTransition ? texts.transition() : texts)
+ .attr("x", config.axis_rotated ? $$.yGridTextX.bind($$) : $$.xGridTextX.bind($$))
+ .attr("y", xv)
+ .text(function (d) { return d.text; })
+ .style("opacity", 1)
+ ];
+ };
+ c3_chart_internal_fn.showXGridFocus = function (selectedData) {
+ var $$ = this, config = $$.config,
+ dataToShow = selectedData.filter(function (d) { return d && isValue(d.value); }),
+ focusEl = $$.main.selectAll('line.' + CLASS.xgridFocus),
+ xx = $$.xx.bind($$);
+ if (! config.tooltip_show) { return; }
+ // Hide when scatter plot exists
+ if ($$.hasType('scatter') || $$.hasArcType()) { return; }
+ focusEl
+ .style("visibility", "visible")
+ .data([dataToShow[0]])
+ .attr(config.axis_rotated ? 'y1' : 'x1', xx)
+ .attr(config.axis_rotated ? 'y2' : 'x2', xx);
+ $$.smoothLines(focusEl, 'grid');
+ };
+ c3_chart_internal_fn.hideXGridFocus = function () {
+ this.main.select('line.' + CLASS.xgridFocus).style("visibility", "hidden");
+ };
+ c3_chart_internal_fn.updateXgridFocus = function () {
+ var $$ = this, config = $$.config;
+ $$.main.select('line.' + CLASS.xgridFocus)
+ .attr("x1", config.axis_rotated ? 0 : -10)
+ .attr("x2", config.axis_rotated ? $$.width : -10)
+ .attr("y1", config.axis_rotated ? -10 : 0)
+ .attr("y2", config.axis_rotated ? -10 : $$.height);
+ };
+ c3_chart_internal_fn.generateGridData = function (type, scale) {
+ var $$ = this,
+ gridData = [], xDomain, firstYear, lastYear, i,
+ tickNum = $$.main.select("." + CLASS.axisX).selectAll('.tick').size();
+ if (type === 'year') {
+ xDomain = $$.getXDomain();
+ firstYear = xDomain[0].getFullYear();
+ lastYear = xDomain[1].getFullYear();
+ for (i = firstYear; i <= lastYear; i++) {
+ gridData.push(new Date(i + '-01-01 00:00:00'));
+ }
+ } else {
+ gridData = scale.ticks(10);
+ if (gridData.length > tickNum) { // use only int
+ gridData = gridData.filter(function (d) { return ("" + d).indexOf('.') < 0; });
+ }
+ }
+ return gridData;
+ };
+ c3_chart_internal_fn.getGridFilterToRemove = function (params) {
+ return params ? function (line) {
+ var found = false;
+ [].concat(params).forEach(function (param) {
+ if ((('value' in param && line.value === param.value) || ('class' in param && line['class'] === param['class']))) {
+ found = true;
+ }
+ });
+ return found;
+ } : function () { return true; };
+ };
+ c3_chart_internal_fn.removeGridLines = function (params, forX) {
+ var $$ = this, config = $$.config,
+ toRemove = $$.getGridFilterToRemove(params),
+ toShow = function (line) { return !toRemove(line); },
+ classLines = forX ? CLASS.xgridLines : CLASS.ygridLines,
+ classLine = forX ? CLASS.xgridLine : CLASS.ygridLine;
+ $$.main.select('.' + classLines).selectAll('.' + classLine).filter(toRemove)
+ .transition().duration(config.transition_duration)
+ .style('opacity', 0).remove();
+ if (forX) {
+ config.grid_x_lines = config.grid_x_lines.filter(toShow);
+ } else {
+ config.grid_y_lines = config.grid_y_lines.filter(toShow);
+ }
+ };
+
+ c3_chart_internal_fn.initTooltip = function () {
+ var $$ = this, config = $$.config, i;
+ $$.tooltip = $$.selectChart
+ .style("position", "relative")
+ .append("div")
+ .attr('class', CLASS.tooltipContainer)
+ .style("position", "absolute")
+ .style("pointer-events", "none")
+ .style("display", "none");
+ // Show tooltip if needed
+ if (config.tooltip_init_show) {
+ if ($$.isTimeSeries() && isString(config.tooltip_init_x)) {
+ config.tooltip_init_x = $$.parseDate(config.tooltip_init_x);
+ for (i = 0; i < $$.data.targets[0].values.length; i++) {
+ if (($$.data.targets[0].values[i].x - config.tooltip_init_x) === 0) { break; }
+ }
+ config.tooltip_init_x = i;
+ }
+ $$.tooltip.html(config.tooltip_contents.call($$, $$.data.targets.map(function (d) {
+ return $$.addName(d.values[config.tooltip_init_x]);
+ }), $$.axis.getXAxisTickFormat(), $$.getYFormat($$.hasArcType()), $$.color));
+ $$.tooltip.style("top", config.tooltip_init_position.top)
+ .style("left", config.tooltip_init_position.left)
+ .style("display", "block");
+ }
+ };
+ c3_chart_internal_fn.getTooltipContent = function (d, defaultTitleFormat, defaultValueFormat, color) {
+ var $$ = this, config = $$.config,
+ titleFormat = config.tooltip_format_title || defaultTitleFormat,
+ nameFormat = config.tooltip_format_name || function (name) { return name; },
+ valueFormat = config.tooltip_format_value || defaultValueFormat,
+ text, i, title, value, name, bgcolor;
+ for (i = 0; i < d.length; i++) {
+ if (! (d[i] && (d[i].value || d[i].value === 0))) { continue; }
+
+ if (! text) {
+ title = titleFormat ? titleFormat(d[i].x) : d[i].x;
+ text = "<table class='" + CLASS.tooltip + "'>" + (title || title === 0 ? "<tr><th colspan='2'>" + title + "</th></tr>" : "");
+ }
+
+ value = valueFormat(d[i].value, d[i].ratio, d[i].id, d[i].index);
+ if (value !== undefined) {
+ name = nameFormat(d[i].name, d[i].ratio, d[i].id, d[i].index);
+ bgcolor = $$.levelColor ? $$.levelColor(d[i].value) : color(d[i].id);
+
+ text += "<tr class='" + CLASS.tooltipName + "-" + d[i].id + "'>";
+ text += "<td class='name'><span style='background-color:" + bgcolor + "'></span>" + name + "</td>";
+ text += "<td class='value'>" + value + "</td>";
+ text += "</tr>";
+ }
+ }
+ return text + "</table>";
+ };
+ c3_chart_internal_fn.tooltipPosition = function (dataToShow, tWidth, tHeight, element) {
+ var $$ = this, config = $$.config, d3 = $$.d3;
+ var svgLeft, tooltipLeft, tooltipRight, tooltipTop, chartRight;
+ var forArc = $$.hasArcType(),
+ mouse = d3.mouse(element);
+ // Determin tooltip position
+ if (forArc) {
+ tooltipLeft = (($$.width - ($$.isLegendRight ? $$.getLegendWidth() : 0)) / 2) + mouse[0];
+ tooltipTop = ($$.height / 2) + mouse[1] + 20;
+ } else {
+ svgLeft = $$.getSvgLeft(true);
+ if (config.axis_rotated) {
+ tooltipLeft = svgLeft + mouse[0] + 100;
+ tooltipRight = tooltipLeft + tWidth;
+ chartRight = $$.currentWidth - $$.getCurrentPaddingRight();
+ tooltipTop = $$.x(dataToShow[0].x) + 20;
+ } else {
+ tooltipLeft = svgLeft + $$.getCurrentPaddingLeft(true) + $$.x(dataToShow[0].x) + 20;
+ tooltipRight = tooltipLeft + tWidth;
+ chartRight = svgLeft + $$.currentWidth - $$.getCurrentPaddingRight();
+ tooltipTop = mouse[1] + 15;
+ }
+
+ if (tooltipRight > chartRight) {
+ // 20 is needed for Firefox to keep tooletip width
+ tooltipLeft -= tooltipRight - chartRight + 20;
+ }
+ if (tooltipTop + tHeight > $$.currentHeight) {
+ tooltipTop -= tHeight + 30;
+ }
+ }
+ if (tooltipTop < 0) {
+ tooltipTop = 0;
+ }
+ return {top: tooltipTop, left: tooltipLeft};
+ };
+ c3_chart_internal_fn.showTooltip = function (selectedData, element) {
+ var $$ = this, config = $$.config;
+ var tWidth, tHeight, position;
+ var forArc = $$.hasArcType(),
+ dataToShow = selectedData.filter(function (d) { return d && isValue(d.value); }),
+ positionFunction = config.tooltip_position || c3_chart_internal_fn.tooltipPosition;
+ if (dataToShow.length === 0 || !config.tooltip_show) {
+ return;
+ }
+ $$.tooltip.html(config.tooltip_contents.call($$, selectedData, $$.axis.getXAxisTickFormat(), $$.getYFormat(forArc), $$.color)).style("display", "block");
+
+ // Get tooltip dimensions
+ tWidth = $$.tooltip.property('offsetWidth');
+ tHeight = $$.tooltip.property('offsetHeight');
+
+ position = positionFunction.call(this, dataToShow, tWidth, tHeight, element);
+ // Set tooltip
+ $$.tooltip
+ .style("top", position.top + "px")
+ .style("left", position.left + 'px');
+ };
+ c3_chart_internal_fn.hideTooltip = function () {
+ this.tooltip.style("display", "none");
+ };
+
+ c3_chart_internal_fn.initLegend = function () {
+ var $$ = this;
+ $$.legendItemTextBox = {};
+ $$.legendHasRendered = false;
+ $$.legend = $$.svg.append("g").attr("transform", $$.getTranslate('legend'));
+ if (!$$.config.legend_show) {
+ $$.legend.style('visibility', 'hidden');
+ $$.hiddenLegendIds = $$.mapToIds($$.data.targets);
+ return;
+ }
+ // MEMO: call here to update legend box and tranlate for all
+ // MEMO: translate will be upated by this, so transform not needed in updateLegend()
+ $$.updateLegendWithDefaults();
+ };
+ c3_chart_internal_fn.updateLegendWithDefaults = function () {
+ var $$ = this;
+ $$.updateLegend($$.mapToIds($$.data.targets), {withTransform: false, withTransitionForTransform: false, withTransition: false});
+ };
+ c3_chart_internal_fn.updateSizeForLegend = function (legendHeight, legendWidth) {
+ var $$ = this, config = $$.config, insetLegendPosition = {
+ top: $$.isLegendTop ? $$.getCurrentPaddingTop() + config.legend_inset_y + 5.5 : $$.currentHeight - legendHeight - $$.getCurrentPaddingBottom() - config.legend_inset_y,
+ left: $$.isLegendLeft ? $$.getCurrentPaddingLeft() + config.legend_inset_x + 0.5 : $$.currentWidth - legendWidth - $$.getCurrentPaddingRight() - config.legend_inset_x + 0.5
+ };
+
+ $$.margin3 = {
+ top: $$.isLegendRight ? 0 : $$.isLegendInset ? insetLegendPosition.top : $$.currentHeight - legendHeight,
+ right: NaN,
+ bottom: 0,
+ left: $$.isLegendRight ? $$.currentWidth - legendWidth : $$.isLegendInset ? insetLegendPosition.left : 0
+ };
+ };
+ c3_chart_internal_fn.transformLegend = function (withTransition) {
+ var $$ = this;
+ (withTransition ? $$.legend.transition() : $$.legend).attr("transform", $$.getTranslate('legend'));
+ };
+ c3_chart_internal_fn.updateLegendStep = function (step) {
+ this.legendStep = step;
+ };
+ c3_chart_internal_fn.updateLegendItemWidth = function (w) {
+ this.legendItemWidth = w;
+ };
+ c3_chart_internal_fn.updateLegendItemHeight = function (h) {
+ this.legendItemHeight = h;
+ };
+ c3_chart_internal_fn.getLegendWidth = function () {
+ var $$ = this;
+ return $$.config.legend_show ? $$.isLegendRight || $$.isLegendInset ? $$.legendItemWidth * ($$.legendStep + 1) : $$.currentWidth : 0;
+ };
+ c3_chart_internal_fn.getLegendHeight = function () {
+ var $$ = this, h = 0;
+ if ($$.config.legend_show) {
+ if ($$.isLegendRight) {
+ h = $$.currentHeight;
+ } else {
+ h = Math.max(20, $$.legendItemHeight) * ($$.legendStep + 1);
+ }
+ }
+ return h;
+ };
+ c3_chart_internal_fn.opacityForLegend = function (legendItem) {
+ return legendItem.classed(CLASS.legendItemHidden) ? null : 1;
+ };
+ c3_chart_internal_fn.opacityForUnfocusedLegend = function (legendItem) {
+ return legendItem.classed(CLASS.legendItemHidden) ? null : 0.3;
+ };
+ c3_chart_internal_fn.toggleFocusLegend = function (targetIds, focus) {
+ var $$ = this;
+ targetIds = $$.mapToTargetIds(targetIds);
+ $$.legend.selectAll('.' + CLASS.legendItem)
+ .filter(function (id) { return targetIds.indexOf(id) >= 0; })
+ .classed(CLASS.legendItemFocused, focus)
+ .transition().duration(100)
+ .style('opacity', function () {
+ var opacity = focus ? $$.opacityForLegend : $$.opacityForUnfocusedLegend;
+ return opacity.call($$, $$.d3.select(this));
+ });
+ };
+ c3_chart_internal_fn.revertLegend = function () {
+ var $$ = this, d3 = $$.d3;
+ $$.legend.selectAll('.' + CLASS.legendItem)
+ .classed(CLASS.legendItemFocused, false)
+ .transition().duration(100)
+ .style('opacity', function () { return $$.opacityForLegend(d3.select(this)); });
+ };
+ c3_chart_internal_fn.showLegend = function (targetIds) {
+ var $$ = this, config = $$.config;
+ if (!config.legend_show) {
+ config.legend_show = true;
+ $$.legend.style('visibility', 'visible');
+ if (!$$.legendHasRendered) {
+ $$.updateLegendWithDefaults();
+ }
+ }
+ $$.removeHiddenLegendIds(targetIds);
+ $$.legend.selectAll($$.selectorLegends(targetIds))
+ .style('visibility', 'visible')
+ .transition()
+ .style('opacity', function () { return $$.opacityForLegend($$.d3.select(this)); });
+ };
+ c3_chart_internal_fn.hideLegend = function (targetIds) {
+ var $$ = this, config = $$.config;
+ if (config.legend_show && isEmpty(targetIds)) {
+ config.legend_show = false;
+ $$.legend.style('visibility', 'hidden');
+ }
+ $$.addHiddenLegendIds(targetIds);
+ $$.legend.selectAll($$.selectorLegends(targetIds))
+ .style('opacity', 0)
+ .style('visibility', 'hidden');
+ };
+ c3_chart_internal_fn.clearLegendItemTextBoxCache = function () {
+ this.legendItemTextBox = {};
+ };
+ c3_chart_internal_fn.updateLegend = function (targetIds, options, transitions) {
+ var $$ = this, config = $$.config;
+ var xForLegend, xForLegendText, xForLegendRect, yForLegend, yForLegendText, yForLegendRect;
+ var paddingTop = 4, paddingRight = 10, maxWidth = 0, maxHeight = 0, posMin = 10, tileWidth = 15;
+ var l, totalLength = 0, offsets = {}, widths = {}, heights = {}, margins = [0], steps = {}, step = 0;
+ var withTransition, withTransitionForTransform;
+ var texts, rects, tiles, background;
+
+ options = options || {};
+ withTransition = getOption(options, "withTransition", true);
+ withTransitionForTransform = getOption(options, "withTransitionForTransform", true);
+
+ function getTextBox(textElement, id) {
+ if (!$$.legendItemTextBox[id]) {
+ $$.legendItemTextBox[id] = $$.getTextRect(textElement.textContent, CLASS.legendItem);
+ }
+ return $$.legendItemTextBox[id];
+ }
+
+ function updatePositions(textElement, id, index) {
+ var reset = index === 0, isLast = index === targetIds.length - 1,
+ box = getTextBox(textElement, id),
+ itemWidth = box.width + tileWidth + (isLast && !($$.isLegendRight || $$.isLegendInset) ? 0 : paddingRight),
+ itemHeight = box.height + paddingTop,
+ itemLength = $$.isLegendRight || $$.isLegendInset ? itemHeight : itemWidth,
+ areaLength = $$.isLegendRight || $$.isLegendInset ? $$.getLegendHeight() : $$.getLegendWidth(),
+ margin, maxLength;
+
+ // MEMO: care about condifion of step, totalLength
+ function updateValues(id, withoutStep) {
+ if (!withoutStep) {
+ margin = (areaLength - totalLength - itemLength) / 2;
+ if (margin < posMin) {
+ margin = (areaLength - itemLength) / 2;
+ totalLength = 0;
+ step++;
+ }
+ }
+ steps[id] = step;
+ margins[step] = $$.isLegendInset ? 10 : margin;
+ offsets[id] = totalLength;
+ totalLength += itemLength;
+ }
+
+ if (reset) {
+ totalLength = 0;
+ step = 0;
+ maxWidth = 0;
+ maxHeight = 0;
+ }
+
+ if (config.legend_show && !$$.isLegendToShow(id)) {
+ widths[id] = heights[id] = steps[id] = offsets[id] = 0;
+ return;
+ }
+
+ widths[id] = itemWidth;
+ heights[id] = itemHeight;
+
+ if (!maxWidth || itemWidth >= maxWidth) { maxWidth = itemWidth; }
+ if (!maxHeight || itemHeight >= maxHeight) { maxHeight = itemHeight; }
+ maxLength = $$.isLegendRight || $$.isLegendInset ? maxHeight : maxWidth;
+
+ if (config.legend_equally) {
+ Object.keys(widths).forEach(function (id) { widths[id] = maxWidth; });
+ Object.keys(heights).forEach(function (id) { heights[id] = maxHeight; });
+ margin = (areaLength - maxLength * targetIds.length) / 2;
+ if (margin < posMin) {
+ totalLength = 0;
+ step = 0;
+ targetIds.forEach(function (id) { updateValues(id); });
+ }
+ else {
+ updateValues(id, true);
+ }
+ } else {
+ updateValues(id);
+ }
+ }
+
+ if ($$.isLegendInset) {
+ step = config.legend_inset_step ? config.legend_inset_step : targetIds.length;
+ $$.updateLegendStep(step);
+ }
+
+ if ($$.isLegendRight) {
+ xForLegend = function (id) { return maxWidth * steps[id]; };
+ yForLegend = function (id) { return margins[steps[id]] + offsets[id]; };
+ } else if ($$.isLegendInset) {
+ xForLegend = function (id) { return maxWidth * steps[id] + 10; };
+ yForLegend = function (id) { return margins[steps[id]] + offsets[id]; };
+ } else {
+ xForLegend = function (id) { return margins[steps[id]] + offsets[id]; };
+ yForLegend = function (id) { return maxHeight * steps[id]; };
+ }
+ xForLegendText = function (id, i) { return xForLegend(id, i) + 14; };
+ yForLegendText = function (id, i) { return yForLegend(id, i) + 9; };
+ xForLegendRect = function (id, i) { return xForLegend(id, i); };
+ yForLegendRect = function (id, i) { return yForLegend(id, i) - 5; };
+
+ // Define g for legend area
+ l = $$.legend.selectAll('.' + CLASS.legendItem)
+ .data(targetIds)
+ .enter().append('g')
+ .attr('class', function (id) { return $$.generateClass(CLASS.legendItem, id); })
+ .style('visibility', function (id) { return $$.isLegendToShow(id) ? 'visible' : 'hidden'; })
+ .style('cursor', 'pointer')
+ .on('click', function (id) {
+ if (config.legend_item_onclick) {
+ config.legend_item_onclick.call($$, id);
+ } else {
+ if ($$.d3.event.altKey) {
+ $$.api.hide();
+ $$.api.show(id);
+ } else {
+ $$.api.toggle(id);
+ $$.isTargetToShow(id) ? $$.api.focus(id) : $$.api.revert();
+ }
+ }
+ })
+ .on('mouseover', function (id) {
+ $$.d3.select(this).classed(CLASS.legendItemFocused, true);
+ if (!$$.transiting && $$.isTargetToShow(id)) {
+ $$.api.focus(id);
+ }
+ if (config.legend_item_onmouseover) {
+ config.legend_item_onmouseover.call($$, id);
+ }
+ })
+ .on('mouseout', function (id) {
+ $$.d3.select(this).classed(CLASS.legendItemFocused, false);
+ $$.api.revert();
+ if (config.legend_item_onmouseout) {
+ config.legend_item_onmouseout.call($$, id);
+ }
+ });
+ l.append('text')
+ .text(function (id) { return isDefined(config.data_names[id]) ? config.data_names[id] : id; })
+ .each(function (id, i) { updatePositions(this, id, i); })
+ .style("pointer-events", "none")
+ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200)
+ .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegendText);
+ l.append('rect')
+ .attr("class", CLASS.legendItemEvent)
+ .style('fill-opacity', 0)
+ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendRect : -200)
+ .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegendRect);
+ l.append('rect')
+ .attr("class", CLASS.legendItemTile)
+ .style("pointer-events", "none")
+ .style('fill', $$.color)
+ .attr('x', $$.isLegendRight || $$.isLegendInset ? xForLegendText : -200)
+ .attr('y', $$.isLegendRight || $$.isLegendInset ? -200 : yForLegend)
+ .attr('width', 10)
+ .attr('height', 10);
+
+ // Set background for inset legend
+ background = $$.legend.select('.' + CLASS.legendBackground + ' rect');
+ if ($$.isLegendInset && maxWidth > 0 && background.size() === 0) {
+ background = $$.legend.insert('g', '.' + CLASS.legendItem)
+ .attr("class", CLASS.legendBackground)
+ .append('rect');
+ }
+
+ texts = $$.legend.selectAll('text')
+ .data(targetIds)
+ .text(function (id) { return isDefined(config.data_names[id]) ? config.data_names[id] : id; }) // MEMO: needed for update
+ .each(function (id, i) { updatePositions(this, id, i); });
+ (withTransition ? texts.transition() : texts)
+ .attr('x', xForLegendText)
+ .attr('y', yForLegendText);
+
+ rects = $$.legend.selectAll('rect.' + CLASS.legendItemEvent)
+ .data(targetIds);
+ (withTransition ? rects.transition() : rects)
+ .attr('width', function (id) { return widths[id]; })
+ .attr('height', function (id) { return heights[id]; })
+ .attr('x', xForLegendRect)
+ .attr('y', yForLegendRect);
+
+ tiles = $$.legend.selectAll('rect.' + CLASS.legendItemTile)
+ .data(targetIds);
+ (withTransition ? tiles.transition() : tiles)
+ .style('fill', $$.color)
+ .attr('x', xForLegend)
+ .attr('y', yForLegend);
+
+ if (background) {
+ (withTransition ? background.transition() : background)
+ .attr('height', $$.getLegendHeight() - 12)
+ .attr('width', maxWidth * (step + 1) + 10);
+ }
+
+ // toggle legend state
+ $$.legend.selectAll('.' + CLASS.legendItem)
+ .classed(CLASS.legendItemHidden, function (id) { return !$$.isTargetToShow(id); });
+
+ // Update all to reflect change of legend
+ $$.updateLegendItemWidth(maxWidth);
+ $$.updateLegendItemHeight(maxHeight);
+ $$.updateLegendStep(step);
+ // Update size and scale
+ $$.updateSizes();
+ $$.updateScales();
+ $$.updateSvgSize();
+ // Update g positions
+ $$.transformAll(withTransitionForTransform, transitions);
+ $$.legendHasRendered = true;
+ };
+
+ function Axis(owner) {
+ API.call(this, owner);
+ }
+
+ inherit(API, Axis);
+
+ Axis.prototype.init = function init() {
+
+ var $$ = this.owner, config = $$.config, main = $$.main;
+ $$.axes.x = main.append("g")
+ .attr("class", CLASS.axis + ' ' + CLASS.axisX)
+ .attr("clip-path", $$.clipPathForXAxis)
+ .attr("transform", $$.getTranslate('x'))
+ .style("visibility", config.axis_x_show ? 'visible' : 'hidden');
+ $$.axes.x.append("text")
+ .attr("class", CLASS.axisXLabel)
+ .attr("transform", config.axis_rotated ? "rotate(-90)" : "")
+ .style("text-anchor", this.textAnchorForXAxisLabel.bind(this));
+ $$.axes.y = main.append("g")
+ .attr("class", CLASS.axis + ' ' + CLASS.axisY)
+ .attr("clip-path", config.axis_y_inner ? "" : $$.clipPathForYAxis)
+ .attr("transform", $$.getTranslate('y'))
+ .style("visibility", config.axis_y_show ? 'visible' : 'hidden');
+ $$.axes.y.append("text")
+ .attr("class", CLASS.axisYLabel)
+ .attr("transform", config.axis_rotated ? "" : "rotate(-90)")
+ .style("text-anchor", this.textAnchorForYAxisLabel.bind(this));
+
+ $$.axes.y2 = main.append("g")
+ .attr("class", CLASS.axis + ' ' + CLASS.axisY2)
+ // clip-path?
+ .attr("transform", $$.getTranslate('y2'))
+ .style("visibility", config.axis_y2_show ? 'visible' : 'hidden');
+ $$.axes.y2.append("text")
+ .attr("class", CLASS.axisY2Label)
+ .attr("transform", config.axis_rotated ? "" : "rotate(-90)")
+ .style("text-anchor", this.textAnchorForY2AxisLabel.bind(this));
+ };
+ Axis.prototype.getXAxis = function getXAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition, withoutRotateTickText) {
+ var $$ = this.owner, config = $$.config,
+ axisParams = {
+ isCategory: $$.isCategorized(),
+ withOuterTick: withOuterTick,
+ tickMultiline: config.axis_x_tick_multiline,
+ tickWidth: config.axis_x_tick_width,
+ tickTextRotate: withoutRotateTickText ? 0 : config.axis_x_tick_rotate,
+ withoutTransition: withoutTransition,
+ },
+ axis = c3_axis($$.d3, axisParams).scale(scale).orient(orient);
+
+ if ($$.isTimeSeries() && tickValues) {
+ tickValues = tickValues.map(function (v) { return $$.parseDate(v); });
+ }
+
+ // Set tick
+ axis.tickFormat(tickFormat).tickValues(tickValues);
+ if ($$.isCategorized()) {
+ axis.tickCentered(config.axis_x_tick_centered);
+ if (isEmpty(config.axis_x_tick_culling)) {
+ config.axis_x_tick_culling = false;
+ }
+ }
+
+ return axis;
+ };
+ Axis.prototype.updateXAxisTickValues = function updateXAxisTickValues(targets, axis) {
+ var $$ = this.owner, config = $$.config, tickValues;
+ if (config.axis_x_tick_fit || config.axis_x_tick_count) {
+ tickValues = this.generateTickValues($$.mapTargetsToUniqueXs(targets), config.axis_x_tick_count, $$.isTimeSeries());
+ }
+ if (axis) {
+ axis.tickValues(tickValues);
+ } else {
+ $$.xAxis.tickValues(tickValues);
+ $$.subXAxis.tickValues(tickValues);
+ }
+ return tickValues;
+ };
+ Axis.prototype.getYAxis = function getYAxis(scale, orient, tickFormat, tickValues, withOuterTick, withoutTransition) {
+ var axisParams = {
+ withOuterTick: withOuterTick,
+ withoutTransition: withoutTransition,
+ },
+ $$ = this.owner,
+ d3 = $$.d3,
+ config = $$.config,
+ axis = c3_axis(d3, axisParams).scale(scale).orient(orient).tickFormat(tickFormat);
+ if ($$.isTimeSeriesY()) {
+ axis.ticks(d3.time[config.axis_y_tick_time_value], config.axis_y_tick_time_interval);
+ } else {
+ axis.tickValues(tickValues);
+ }
+ return axis;
+ };
+ Axis.prototype.getId = function getId(id) {
+ var config = this.owner.config;
+ return id in config.data_axes ? config.data_axes[id] : 'y';
+ };
+ Axis.prototype.getXAxisTickFormat = function getXAxisTickFormat() {
+ var $$ = this.owner, config = $$.config,
+ format = $$.isTimeSeries() ? $$.defaultAxisTimeFormat : $$.isCategorized() ? $$.categoryName : function (v) { return v < 0 ? v.toFixed(0) : v; };
+ if (config.axis_x_tick_format) {
+ if (isFunction(config.axis_x_tick_format)) {
+ format = config.axis_x_tick_format;
+ } else if ($$.isTimeSeries()) {
+ format = function (date) {
+ return date ? $$.axisTimeFormat(config.axis_x_tick_format)(date) : "";
+ };
+ }
+ }
+ return isFunction(format) ? function (v) { return format.call($$, v); } : format;
+ };
+ Axis.prototype.getTickValues = function getTickValues(tickValues, axis) {
+ return tickValues ? tickValues : axis ? axis.tickValues() : undefined;
+ };
+ Axis.prototype.getXAxisTickValues = function getXAxisTickValues() {
+ return this.getTickValues(this.owner.config.axis_x_tick_values, this.owner.xAxis);
+ };
+ Axis.prototype.getYAxisTickValues = function getYAxisTickValues() {
+ return this.getTickValues(this.owner.config.axis_y_tick_values, this.owner.yAxis);
+ };
+ Axis.prototype.getY2AxisTickValues = function getY2AxisTickValues() {
+ return this.getTickValues(this.owner.config.axis_y2_tick_values, this.owner.y2Axis);
+ };
+ Axis.prototype.getLabelOptionByAxisId = function getLabelOptionByAxisId(axisId) {
+ var $$ = this.owner, config = $$.config, option;
+ if (axisId === 'y') {
+ option = config.axis_y_label;
+ } else if (axisId === 'y2') {
+ option = config.axis_y2_label;
+ } else if (axisId === 'x') {
+ option = config.axis_x_label;
+ }
+ return option;
+ };
+ Axis.prototype.getLabelText = function getLabelText(axisId) {
+ var option = this.getLabelOptionByAxisId(axisId);
+ return isString(option) ? option : option ? option.text : null;
+ };
+ Axis.prototype.setLabelText = function setLabelText(axisId, text) {
+ var $$ = this.owner, config = $$.config,
+ option = this.getLabelOptionByAxisId(axisId);
+ if (isString(option)) {
+ if (axisId === 'y') {
+ config.axis_y_label = text;
+ } else if (axisId === 'y2') {
+ config.axis_y2_label = text;
+ } else if (axisId === 'x') {
+ config.axis_x_label = text;
+ }
+ } else if (option) {
+ option.text = text;
+ }
+ };
+ Axis.prototype.getLabelPosition = function getLabelPosition(axisId, defaultPosition) {
+ var option = this.getLabelOptionByAxisId(axisId),
+ position = (option && typeof option === 'object' && option.position) ? option.position : defaultPosition;
+ return {
+ isInner: position.indexOf('inner') >= 0,
+ isOuter: position.indexOf('outer') >= 0,
+ isLeft: position.indexOf('left') >= 0,
+ isCenter: position.indexOf('center') >= 0,
+ isRight: position.indexOf('right') >= 0,
+ isTop: position.indexOf('top') >= 0,
+ isMiddle: position.indexOf('middle') >= 0,
+ isBottom: position.indexOf('bottom') >= 0
+ };
+ };
+ Axis.prototype.getXAxisLabelPosition = function getXAxisLabelPosition() {
+ return this.getLabelPosition('x', this.owner.config.axis_rotated ? 'inner-top' : 'inner-right');
+ };
+ Axis.prototype.getYAxisLabelPosition = function getYAxisLabelPosition() {
+ return this.getLabelPosition('y', this.owner.config.axis_rotated ? 'inner-right' : 'inner-top');
+ };
+ Axis.prototype.getY2AxisLabelPosition = function getY2AxisLabelPosition() {
+ return this.getLabelPosition('y2', this.owner.config.axis_rotated ? 'inner-right' : 'inner-top');
+ };
+ Axis.prototype.getLabelPositionById = function getLabelPositionById(id) {
+ return id === 'y2' ? this.getY2AxisLabelPosition() : id === 'y' ? this.getYAxisLabelPosition() : this.getXAxisLabelPosition();
+ };
+ Axis.prototype.textForXAxisLabel = function textForXAxisLabel() {
+ return this.getLabelText('x');
+ };
+ Axis.prototype.textForYAxisLabel = function textForYAxisLabel() {
+ return this.getLabelText('y');
+ };
+ Axis.prototype.textForY2AxisLabel = function textForY2AxisLabel() {
+ return this.getLabelText('y2');
+ };
+ Axis.prototype.xForAxisLabel = function xForAxisLabel(forHorizontal, position) {
+ var $$ = this.owner;
+ if (forHorizontal) {
+ return position.isLeft ? 0 : position.isCenter ? $$.width / 2 : $$.width;
+ } else {
+ return position.isBottom ? -$$.height : position.isMiddle ? -$$.height / 2 : 0;
+ }
+ };
+ Axis.prototype.dxForAxisLabel = function dxForAxisLabel(forHorizontal, position) {
+ if (forHorizontal) {
+ return position.isLeft ? "0.5em" : position.isRight ? "-0.5em" : "0";
+ } else {
+ return position.isTop ? "-0.5em" : position.isBottom ? "0.5em" : "0";
+ }
+ };
+ Axis.prototype.textAnchorForAxisLabel = function textAnchorForAxisLabel(forHorizontal, position) {
+ if (forHorizontal) {
+ return position.isLeft ? 'start' : position.isCenter ? 'middle' : 'end';
+ } else {
+ return position.isBottom ? 'start' : position.isMiddle ? 'middle' : 'end';
+ }
+ };
+ Axis.prototype.xForXAxisLabel = function xForXAxisLabel() {
+ return this.xForAxisLabel(!this.owner.config.axis_rotated, this.getXAxisLabelPosition());
+ };
+ Axis.prototype.xForYAxisLabel = function xForYAxisLabel() {
+ return this.xForAxisLabel(this.owner.config.axis_rotated, this.getYAxisLabelPosition());
+ };
+ Axis.prototype.xForY2AxisLabel = function xForY2AxisLabel() {
+ return this.xForAxisLabel(this.owner.config.axis_rotated, this.getY2AxisLabelPosition());
+ };
+ Axis.prototype.dxForXAxisLabel = function dxForXAxisLabel() {
+ return this.dxForAxisLabel(!this.owner.config.axis_rotated, this.getXAxisLabelPosition());
+ };
+ Axis.prototype.dxForYAxisLabel = function dxForYAxisLabel() {
+ return this.dxForAxisLabel(this.owner.config.axis_rotated, this.getYAxisLabelPosition());
+ };
+ Axis.prototype.dxForY2AxisLabel = function dxForY2AxisLabel() {
+ return this.dxForAxisLabel(this.owner.config.axis_rotated, this.getY2AxisLabelPosition());
+ };
+ Axis.prototype.dyForXAxisLabel = function dyForXAxisLabel() {
+ var $$ = this.owner, config = $$.config,
+ position = this.getXAxisLabelPosition();
+ if (config.axis_rotated) {
+ return position.isInner ? "1.2em" : -25 - this.getMaxTickWidth('x');
+ } else {
+ return position.isInner ? "-0.5em" : config.axis_x_height ? config.axis_x_height - 10 : "3em";
+ }
+ };
+ Axis.prototype.dyForYAxisLabel = function dyForYAxisLabel() {
+ var $$ = this.owner,
+ position = this.getYAxisLabelPosition();
+ if ($$.config.axis_rotated) {
+ return position.isInner ? "-0.5em" : "3em";
+ } else {
+ return position.isInner ? "1.2em" : -10 - ($$.config.axis_y_inner ? 0 : (this.getMaxTickWidth('y') + 10));
+ }
+ };
+ Axis.prototype.dyForY2AxisLabel = function dyForY2AxisLabel() {
+ var $$ = this.owner,
+ position = this.getY2AxisLabelPosition();
+ if ($$.config.axis_rotated) {
+ return position.isInner ? "1.2em" : "-2.2em";
+ } else {
+ return position.isInner ? "-0.5em" : 15 + ($$.config.axis_y2_inner ? 0 : (this.getMaxTickWidth('y2') + 15));
+ }
+ };
+ Axis.prototype.textAnchorForXAxisLabel = function textAnchorForXAxisLabel() {
+ var $$ = this.owner;
+ return this.textAnchorForAxisLabel(!$$.config.axis_rotated, this.getXAxisLabelPosition());
+ };
+ Axis.prototype.textAnchorForYAxisLabel = function textAnchorForYAxisLabel() {
+ var $$ = this.owner;
+ return this.textAnchorForAxisLabel($$.config.axis_rotated, this.getYAxisLabelPosition());
+ };
+ Axis.prototype.textAnchorForY2AxisLabel = function textAnchorForY2AxisLabel() {
+ var $$ = this.owner;
+ return this.textAnchorForAxisLabel($$.config.axis_rotated, this.getY2AxisLabelPosition());
+ };
+ Axis.prototype.getMaxTickWidth = function getMaxTickWidth(id, withoutRecompute) {
+ var $$ = this.owner, config = $$.config,
+ maxWidth = 0, targetsToShow, scale, axis, dummy, svg;
+ if (withoutRecompute && $$.currentMaxTickWidths[id]) {
+ return $$.currentMaxTickWidths[id];
+ }
+ if ($$.svg) {
+ targetsToShow = $$.filterTargetsToShow($$.data.targets);
+ if (id === 'y') {
+ scale = $$.y.copy().domain($$.getYDomain(targetsToShow, 'y'));
+ axis = this.getYAxis(scale, $$.yOrient, config.axis_y_tick_format, $$.yAxisTickValues, false, true);
+ } else if (id === 'y2') {
+ scale = $$.y2.copy().domain($$.getYDomain(targetsToShow, 'y2'));
+ axis = this.getYAxis(scale, $$.y2Orient, config.axis_y2_tick_format, $$.y2AxisTickValues, false, true);
+ } else {
+ scale = $$.x.copy().domain($$.getXDomain(targetsToShow));
+ axis = this.getXAxis(scale, $$.xOrient, $$.xAxisTickFormat, $$.xAxisTickValues, false, true, true);
+ this.updateXAxisTickValues(targetsToShow, axis);
+ }
+ dummy = $$.d3.select('body').append('div').classed('c3', true);
+ svg = dummy.append("svg").style('visibility', 'hidden').style('position', 'fixed').style('top', 0).style('left', 0),
+ svg.append('g').call(axis).each(function () {
+ $$.d3.select(this).selectAll('text').each(function () {
+ var box = this.getBoundingClientRect();
+ if (maxWidth < box.width) { maxWidth = box.width; }
+ });
+ dummy.remove();
+ });
+ }
+ $$.currentMaxTickWidths[id] = maxWidth <= 0 ? $$.currentMaxTickWidths[id] : maxWidth;
+ return $$.currentMaxTickWidths[id];
+ };
+
+ Axis.prototype.updateLabels = function updateLabels(withTransition) {
+ var $$ = this.owner;
+ var axisXLabel = $$.main.select('.' + CLASS.axisX + ' .' + CLASS.axisXLabel),
+ axisYLabel = $$.main.select('.' + CLASS.axisY + ' .' + CLASS.axisYLabel),
+ axisY2Label = $$.main.select('.' + CLASS.axisY2 + ' .' + CLASS.axisY2Label);
+ (withTransition ? axisXLabel.transition() : axisXLabel)
+ .attr("x", this.xForXAxisLabel.bind(this))
+ .attr("dx", this.dxForXAxisLabel.bind(this))
+ .attr("dy", this.dyForXAxisLabel.bind(this))
+ .text(this.textForXAxisLabel.bind(this));
+ (withTransition ? axisYLabel.transition() : axisYLabel)
+ .attr("x", this.xForYAxisLabel.bind(this))
+ .attr("dx", this.dxForYAxisLabel.bind(this))
+ .attr("dy", this.dyForYAxisLabel.bind(this))
+ .text(this.textForYAxisLabel.bind(this));
+ (withTransition ? axisY2Label.transition() : axisY2Label)
+ .attr("x", this.xForY2AxisLabel.bind(this))
+ .attr("dx", this.dxForY2AxisLabel.bind(this))
+ .attr("dy", this.dyForY2AxisLabel.bind(this))
+ .text(this.textForY2AxisLabel.bind(this));
+ };
+ Axis.prototype.getPadding = function getPadding(padding, key, defaultValue, domainLength) {
+ if (!isValue(padding[key])) {
+ return defaultValue;
+ }
+ if (padding.unit === 'ratio') {
+ return padding[key] * domainLength;
+ }
+ // assume padding is pixels if unit is not specified
+ return this.convertPixelsToAxisPadding(padding[key], domainLength);
+ };
+ Axis.prototype.convertPixelsToAxisPadding = function convertPixelsToAxisPadding(pixels, domainLength) {
+ var $$ = this.owner,
+ length = $$.config.axis_rotated ? $$.width : $$.height;
+ return domainLength * (pixels / length);
+ };
+ Axis.prototype.generateTickValues = function generateTickValues(values, tickCount, forTimeSeries) {
+ var tickValues = values, targetCount, start, end, count, interval, i, tickValue;
+ if (tickCount) {
+ targetCount = isFunction(tickCount) ? tickCount() : tickCount;
+ // compute ticks according to tickCount
+ if (targetCount === 1) {
+ tickValues = [values[0]];
+ } else if (targetCount === 2) {
+ tickValues = [values[0], values[values.length - 1]];
+ } else if (targetCount > 2) {
+ count = targetCount - 2;
+ start = values[0];
+ end = values[values.length - 1];
+ interval = (end - start) / (count + 1);
+ // re-construct unique values
+ tickValues = [start];
+ for (i = 0; i < count; i++) {
+ tickValue = +start + interval * (i + 1);
+ tickValues.push(forTimeSeries ? new Date(tickValue) : tickValue);
+ }
+ tickValues.push(end);
+ }
+ }
+ if (!forTimeSeries) { tickValues = tickValues.sort(function (a, b) { return a - b; }); }
+ return tickValues;
+ };
+ Axis.prototype.generateTransitions = function generateTransitions(duration) {
+ var $$ = this.owner, axes = $$.axes;
+ return {
+ axisX: duration ? axes.x.transition().duration(duration) : axes.x,
+ axisY: duration ? axes.y.transition().duration(duration) : axes.y,
+ axisY2: duration ? axes.y2.transition().duration(duration) : axes.y2,
+ axisSubX: duration ? axes.subx.transition().duration(duration) : axes.subx
+ };
+ };
+ Axis.prototype.redraw = function redraw(transitions, isHidden) {
+ var $$ = this.owner;
+ $$.axes.x.style("opacity", isHidden ? 0 : 1);
+ $$.axes.y.style("opacity", isHidden ? 0 : 1);
+ $$.axes.y2.style("opacity", isHidden ? 0 : 1);
+ $$.axes.subx.style("opacity", isHidden ? 0 : 1);
+ transitions.axisX.call($$.xAxis);
+ transitions.axisY.call($$.yAxis);
+ transitions.axisY2.call($$.y2Axis);
+ transitions.axisSubX.call($$.subXAxis);
+ };
+
+ c3_chart_internal_fn.getClipPath = function (id) {
+ var isIE9 = window.navigator.appVersion.toLowerCase().indexOf("msie 9.") >= 0;
+ return "url(" + (isIE9 ? "" : document.URL.split('#')[0]) + "#" + id + ")";
+ };
+ c3_chart_internal_fn.appendClip = function (parent, id) {
+ return parent.append("clipPath").attr("id", id).append("rect");
+ };
+ c3_chart_internal_fn.getAxisClipX = function (forHorizontal) {
+ // axis line width + padding for left
+ var left = Math.max(30, this.margin.left);
+ return forHorizontal ? -(1 + left) : -(left - 1);
+ };
+ c3_chart_internal_fn.getAxisClipY = function (forHorizontal) {
+ return forHorizontal ? -20 : -this.margin.top;
+ };
+ c3_chart_internal_fn.getXAxisClipX = function () {
+ var $$ = this;
+ return $$.getAxisClipX(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getXAxisClipY = function () {
+ var $$ = this;
+ return $$.getAxisClipY(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipX = function () {
+ var $$ = this;
+ return $$.config.axis_y_inner ? -1 : $$.getAxisClipX($$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipY = function () {
+ var $$ = this;
+ return $$.getAxisClipY($$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getAxisClipWidth = function (forHorizontal) {
+ var $$ = this,
+ left = Math.max(30, $$.margin.left),
+ right = Math.max(30, $$.margin.right);
+ // width + axis line width + padding for left/right
+ return forHorizontal ? $$.width + 2 + left + right : $$.margin.left + 20;
+ };
+ c3_chart_internal_fn.getAxisClipHeight = function (forHorizontal) {
+ // less than 20 is not enough to show the axis label 'outer' without legend
+ return (forHorizontal ? this.margin.bottom : (this.margin.top + this.height)) + 20;
+ };
+ c3_chart_internal_fn.getXAxisClipWidth = function () {
+ var $$ = this;
+ return $$.getAxisClipWidth(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getXAxisClipHeight = function () {
+ var $$ = this;
+ return $$.getAxisClipHeight(!$$.config.axis_rotated);
+ };
+ c3_chart_internal_fn.getYAxisClipWidth = function () {
+ var $$ = this;
+ return $$.getAxisClipWidth($$.config.axis_rotated) + ($$.config.axis_y_inner ? 20 : 0);
+ };
+ c3_chart_internal_fn.getYAxisClipHeight = function () {
+ var $$ = this;
+ return $$.getAxisClipHeight($$.config.axis_rotated);
+ };
+
+ c3_chart_internal_fn.initPie = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config;
+ $$.pie = d3.layout.pie().value(function (d) {
+ return d.values.reduce(function (a, b) { return a + b.value; }, 0);
+ });
+ if (!config.data_order) {
+ $$.pie.sort(null);
+ }
+ };
+
+ c3_chart_internal_fn.updateRadius = function () {
+ var $$ = this, config = $$.config,
+ w = config.gauge_width || config.donut_width;
+ $$.radiusExpanded = Math.min($$.arcWidth, $$.arcHeight) / 2;
+ $$.radius = $$.radiusExpanded * 0.95;
+ $$.innerRadiusRatio = w ? ($$.radius - w) / $$.radius : 0.6;
+ $$.innerRadius = $$.hasType('donut') || $$.hasType('gauge') ? $$.radius * $$.innerRadiusRatio : 0;
+ };
+
+ c3_chart_internal_fn.updateArc = function () {
+ var $$ = this;
+ $$.svgArc = $$.getSvgArc();
+ $$.svgArcExpanded = $$.getSvgArcExpanded();
+ $$.svgArcExpandedSub = $$.getSvgArcExpanded(0.98);
+ };
+
+ c3_chart_internal_fn.updateAngle = function (d) {
+ var $$ = this, config = $$.config,
+ found = false, index = 0,
+ gMin = config.gauge_min, gMax = config.gauge_max, gTic, gValue;
+ $$.pie($$.filterTargetsToShow($$.data.targets)).forEach(function (t) {
+ if (! found && t.data.id === d.data.id) {
+ found = true;
+ d = t;
+ d.index = index;
+ }
+ index++;
+ });
+ if (isNaN(d.startAngle)) {
+ d.startAngle = 0;
+ }
+ if (isNaN(d.endAngle)) {
+ d.endAngle = d.startAngle;
+ }
+ if ($$.isGaugeType(d.data)) {
+ gTic = (Math.PI) / (gMax - gMin);
+ gValue = d.value < gMin ? 0 : d.value < gMax ? d.value - gMin : (gMax - gMin);
+ d.startAngle = -1 * (Math.PI / 2);
+ d.endAngle = d.startAngle + gTic * gValue;
+ }
+ return found ? d : null;
+ };
+
+ c3_chart_internal_fn.getSvgArc = function () {
+ var $$ = this,
+ arc = $$.d3.svg.arc().outerRadius($$.radius).innerRadius($$.innerRadius),
+ newArc = function (d, withoutUpdate) {
+ var updated;
+ if (withoutUpdate) { return arc(d); } // for interpolate
+ updated = $$.updateAngle(d);
+ return updated ? arc(updated) : "M 0 0";
+ };
+ // TODO: extends all function
+ newArc.centroid = arc.centroid;
+ return newArc;
+ };
+
+ c3_chart_internal_fn.getSvgArcExpanded = function (rate) {
+ var $$ = this,
+ arc = $$.d3.svg.arc().outerRadius($$.radiusExpanded * (rate ? rate : 1)).innerRadius($$.innerRadius);
+ return function (d) {
+ var updated = $$.updateAngle(d);
+ return updated ? arc(updated) : "M 0 0";
+ };
+ };
+
+ c3_chart_internal_fn.getArc = function (d, withoutUpdate, force) {
+ return force || this.isArcType(d.data) ? this.svgArc(d, withoutUpdate) : "M 0 0";
+ };
+
+
+ c3_chart_internal_fn.transformForArcLabel = function (d) {
+ var $$ = this,
+ updated = $$.updateAngle(d), c, x, y, h, ratio, translate = "";
+ if (updated && !$$.hasType('gauge')) {
+ c = this.svgArc.centroid(updated);
+ x = isNaN(c[0]) ? 0 : c[0];
+ y = isNaN(c[1]) ? 0 : c[1];
+ h = Math.sqrt(x * x + y * y);
+ // TODO: ratio should be an option?
+ ratio = $$.radius && h ? (36 / $$.radius > 0.375 ? 1.175 - 36 / $$.radius : 0.8) * $$.radius / h : 0;
+ translate = "translate(" + (x * ratio) + ',' + (y * ratio) + ")";
+ }
+ return translate;
+ };
+
+ c3_chart_internal_fn.getArcRatio = function (d) {
+ var $$ = this,
+ whole = $$.hasType('gauge') ? Math.PI : (Math.PI * 2);
+ return d ? (d.endAngle - d.startAngle) / whole : null;
+ };
+
+ c3_chart_internal_fn.convertToArcData = function (d) {
+ return this.addName({
+ id: d.data.id,
+ value: d.value,
+ ratio: this.getArcRatio(d),
+ index: d.index
+ });
+ };
+
+ c3_chart_internal_fn.textForArcLabel = function (d) {
+ var $$ = this,
+ updated, value, ratio, id, format;
+ if (! $$.shouldShowArcLabel()) { return ""; }
+ updated = $$.updateAngle(d);
+ value = updated ? updated.value : null;
+ ratio = $$.getArcRatio(updated);
+ id = d.data.id;
+ if (! $$.hasType('gauge') && ! $$.meetsArcLabelThreshold(ratio)) { return ""; }
+ format = $$.getArcLabelFormat();
+ return format ? format(value, ratio, id) : $$.defaultArcValueFormat(value, ratio);
+ };
+
+ c3_chart_internal_fn.expandArc = function (targetIds) {
+ var $$ = this, interval;
+
+ // MEMO: avoid to cancel transition
+ if ($$.transiting) {
+ interval = window.setInterval(function () {
+ if (!$$.transiting) {
+ window.clearInterval(interval);
+ if ($$.legend.selectAll('.c3-legend-item-focused').size() > 0) {
+ $$.expandArc(targetIds);
+ }
+ }
+ }, 10);
+ return;
+ }
+
+ targetIds = $$.mapToTargetIds(targetIds);
+
+ $$.svg.selectAll($$.selectorTargets(targetIds, '.' + CLASS.chartArc)).each(function (d) {
+ if (! $$.shouldExpand(d.data.id)) { return; }
+ $$.d3.select(this).selectAll('path')
+ .transition().duration(50)
+ .attr("d", $$.svgArcExpanded)
+ .transition().duration(100)
+ .attr("d", $$.svgArcExpandedSub)
+ .each(function (d) {
+ if ($$.isDonutType(d.data)) {
+ // callback here
+ }
+ });
+ });
+ };
+
+ c3_chart_internal_fn.unexpandArc = function (targetIds) {
+ var $$ = this;
+
+ if ($$.transiting) { return; }
+
+ targetIds = $$.mapToTargetIds(targetIds);
+
+ $$.svg.selectAll($$.selectorTargets(targetIds, '.' + CLASS.chartArc)).selectAll('path')
+ .transition().duration(50)
+ .attr("d", $$.svgArc);
+ $$.svg.selectAll('.' + CLASS.arc)
+ .style("opacity", 1);
+ };
+
+ c3_chart_internal_fn.shouldExpand = function (id) {
+ var $$ = this, config = $$.config;
+ return ($$.isDonutType(id) && config.donut_expand) || ($$.isGaugeType(id) && config.gauge_expand) || ($$.isPieType(id) && config.pie_expand);
+ };
+
+ c3_chart_internal_fn.shouldShowArcLabel = function () {
+ var $$ = this, config = $$.config, shouldShow = true;
+ if ($$.hasType('donut')) {
+ shouldShow = config.donut_label_show;
+ } else if ($$.hasType('pie')) {
+ shouldShow = config.pie_label_show;
+ }
+ // when gauge, always true
+ return shouldShow;
+ };
+
+ c3_chart_internal_fn.meetsArcLabelThreshold = function (ratio) {
+ var $$ = this, config = $$.config,
+ threshold = $$.hasType('donut') ? config.donut_label_threshold : config.pie_label_threshold;
+ return ratio >= threshold;
+ };
+
+ c3_chart_internal_fn.getArcLabelFormat = function () {
+ var $$ = this, config = $$.config,
+ format = config.pie_label_format;
+ if ($$.hasType('gauge')) {
+ format = config.gauge_label_format;
+ } else if ($$.hasType('donut')) {
+ format = config.donut_label_format;
+ }
+ return format;
+ };
+
+ c3_chart_internal_fn.getArcTitle = function () {
+ var $$ = this;
+ return $$.hasType('donut') ? $$.config.donut_title : "";
+ };
+
+ c3_chart_internal_fn.updateTargetsForArc = function (targets) {
+ var $$ = this, main = $$.main,
+ mainPieUpdate, mainPieEnter,
+ classChartArc = $$.classChartArc.bind($$),
+ classArcs = $$.classArcs.bind($$),
+ classFocus = $$.classFocus.bind($$);
+ mainPieUpdate = main.select('.' + CLASS.chartArcs).selectAll('.' + CLASS.chartArc)
+ .data($$.pie(targets))
+ .attr("class", function (d) { return classChartArc(d) + classFocus(d.data); });
+ mainPieEnter = mainPieUpdate.enter().append("g")
+ .attr("class", classChartArc);
+ mainPieEnter.append('g')
+ .attr('class', classArcs);
+ mainPieEnter.append("text")
+ .attr("dy", $$.hasType('gauge') ? "-.1em" : ".35em")
+ .style("opacity", 0)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none");
+ // MEMO: can not keep same color..., but not bad to update color in redraw
+ //mainPieUpdate.exit().remove();
+ };
+
+ c3_chart_internal_fn.initArc = function () {
+ var $$ = this;
+ $$.arcs = $$.main.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartArcs)
+ .attr("transform", $$.getTranslate('arc'));
+ $$.arcs.append('text')
+ .attr('class', CLASS.chartArcsTitle)
+ .style("text-anchor", "middle")
+ .text($$.getArcTitle());
+ };
+
+ c3_chart_internal_fn.redrawArc = function (duration, durationForExit, withTransform) {
+ var $$ = this, d3 = $$.d3, config = $$.config, main = $$.main,
+ mainArc;
+ mainArc = main.selectAll('.' + CLASS.arcs).selectAll('.' + CLASS.arc)
+ .data($$.arcData.bind($$));
+ mainArc.enter().append('path')
+ .attr("class", $$.classArc.bind($$))
+ .style("fill", function (d) { return $$.color(d.data); })
+ .style("cursor", function (d) { return config.interaction_enabled && config.data_selection_isselectable(d) ? "pointer" : null; })
+ .style("opacity", 0)
+ .each(function (d) {
+ if ($$.isGaugeType(d.data)) {
+ d.startAngle = d.endAngle = -1 * (Math.PI / 2);
+ }
+ this._current = d;
+ });
+ mainArc
+ .attr("transform", function (d) { return !$$.isGaugeType(d.data) && withTransform ? "scale(0)" : ""; })
+ .style("opacity", function (d) { return d === this._current ? 0 : 1; })
+ .on('mouseover', config.interaction_enabled ? function (d) {
+ var updated, arcData;
+ if ($$.transiting) { // skip while transiting
+ return;
+ }
+ updated = $$.updateAngle(d);
+ arcData = $$.convertToArcData(updated);
+ // transitions
+ $$.expandArc(updated.data.id);
+ $$.api.focus(updated.data.id);
+ $$.toggleFocusLegend(updated.data.id, true);
+ $$.config.data_onmouseover(arcData, this);
+ } : null)
+ .on('mousemove', config.interaction_enabled ? function (d) {
+ var updated = $$.updateAngle(d),
+ arcData = $$.convertToArcData(updated),
+ selectedData = [arcData];
+ $$.showTooltip(selectedData, this);
+ } : null)
+ .on('mouseout', config.interaction_enabled ? function (d) {
+ var updated, arcData;
+ if ($$.transiting) { // skip while transiting
+ return;
+ }
+ updated = $$.updateAngle(d);
+ arcData = $$.convertToArcData(updated);
+ // transitions
+ $$.unexpandArc(updated.data.id);
+ $$.api.revert();
+ $$.revertLegend();
+ $$.hideTooltip();
+ $$.config.data_onmouseout(arcData, this);
+ } : null)
+ .on('click', config.interaction_enabled ? function (d, i) {
+ var updated = $$.updateAngle(d),
+ arcData = $$.convertToArcData(updated);
+ if ($$.toggleShape) { $$.toggleShape(this, arcData, i); }
+ $$.config.data_onclick.call($$.api, arcData, this);
+ } : null)
+ .each(function () { $$.transiting = true; })
+ .transition().duration(duration)
+ .attrTween("d", function (d) {
+ var updated = $$.updateAngle(d), interpolate;
+ if (! updated) {
+ return function () { return "M 0 0"; };
+ }
+ // if (this._current === d) {
+ // this._current = {
+ // startAngle: Math.PI*2,
+ // endAngle: Math.PI*2,
+ // };
+ // }
+ if (isNaN(this._current.startAngle)) {
+ this._current.startAngle = 0;
+ }
+ if (isNaN(this._current.endAngle)) {
+ this._current.endAngle = this._current.startAngle;
+ }
+ interpolate = d3.interpolate(this._current, updated);
+ this._current = interpolate(0);
+ return function (t) {
+ var interpolated = interpolate(t);
+ interpolated.data = d.data; // data.id will be updated by interporator
+ return $$.getArc(interpolated, true);
+ };
+ })
+ .attr("transform", withTransform ? "scale(1)" : "")
+ .style("fill", function (d) {
+ return $$.levelColor ? $$.levelColor(d.data.values[0].value) : $$.color(d.data.id);
+ }) // Where gauge reading color would receive customization.
+ .style("opacity", 1)
+ .call($$.endall, function () {
+ $$.transiting = false;
+ });
+ mainArc.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ main.selectAll('.' + CLASS.chartArc).select('text')
+ .style("opacity", 0)
+ .attr('class', function (d) { return $$.isGaugeType(d.data) ? CLASS.gaugeValue : ''; })
+ .text($$.textForArcLabel.bind($$))
+ .attr("transform", $$.transformForArcLabel.bind($$))
+ .style('font-size', function (d) { return $$.isGaugeType(d.data) ? Math.round($$.radius / 5) + 'px' : ''; })
+ .transition().duration(duration)
+ .style("opacity", function (d) { return $$.isTargetToShow(d.data.id) && $$.isArcType(d.data) ? 1 : 0; });
+ main.select('.' + CLASS.chartArcsTitle)
+ .style("opacity", $$.hasType('donut') || $$.hasType('gauge') ? 1 : 0);
+
+ if ($$.hasType('gauge')) {
+ $$.arcs.select('.' + CLASS.chartArcsBackground)
+ .attr("d", function () {
+ var d = {
+ data: [{value: config.gauge_max}],
+ startAngle: -1 * (Math.PI / 2),
+ endAngle: Math.PI / 2
+ };
+ return $$.getArc(d, true, true);
+ });
+ $$.arcs.select('.' + CLASS.chartArcsGaugeUnit)
+ .attr("dy", ".75em")
+ .text(config.gauge_label_show ? config.gauge_units : '');
+ $$.arcs.select('.' + CLASS.chartArcsGaugeMin)
+ .attr("dx", -1 * ($$.innerRadius + (($$.radius - $$.innerRadius) / 2)) + "px")
+ .attr("dy", "1.2em")
+ .text(config.gauge_label_show ? config.gauge_min : '');
+ $$.arcs.select('.' + CLASS.chartArcsGaugeMax)
+ .attr("dx", $$.innerRadius + (($$.radius - $$.innerRadius) / 2) + "px")
+ .attr("dy", "1.2em")
+ .text(config.gauge_label_show ? config.gauge_max : '');
+ }
+ };
+ c3_chart_internal_fn.initGauge = function () {
+ var arcs = this.arcs;
+ if (this.hasType('gauge')) {
+ arcs.append('path')
+ .attr("class", CLASS.chartArcsBackground);
+ arcs.append("text")
+ .attr("class", CLASS.chartArcsGaugeUnit)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none");
+ arcs.append("text")
+ .attr("class", CLASS.chartArcsGaugeMin)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none");
+ arcs.append("text")
+ .attr("class", CLASS.chartArcsGaugeMax)
+ .style("text-anchor", "middle")
+ .style("pointer-events", "none");
+ }
+ };
+ c3_chart_internal_fn.getGaugeLabelHeight = function () {
+ return this.config.gauge_label_show ? 20 : 0;
+ };
+
+ c3_chart_internal_fn.initRegion = function () {
+ var $$ = this;
+ $$.region = $$.main.append('g')
+ .attr("clip-path", $$.clipPath)
+ .attr("class", CLASS.regions);
+ };
+ c3_chart_internal_fn.updateRegion = function (duration) {
+ var $$ = this, config = $$.config;
+
+ // hide if arc type
+ $$.region.style('visibility', $$.hasArcType() ? 'hidden' : 'visible');
+
+ $$.mainRegion = $$.main.select('.' + CLASS.regions).selectAll('.' + CLASS.region)
+ .data(config.regions);
+ $$.mainRegion.enter().append('g')
+ .attr('class', $$.classRegion.bind($$))
+ .append('rect')
+ .style("fill-opacity", 0);
+ $$.mainRegion.exit().transition().duration(duration)
+ .style("opacity", 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawRegion = function (withTransition) {
+ var $$ = this,
+ regions = $$.mainRegion.selectAll('rect'),
+ x = $$.regionX.bind($$),
+ y = $$.regionY.bind($$),
+ w = $$.regionWidth.bind($$),
+ h = $$.regionHeight.bind($$);
+ return [
+ (withTransition ? regions.transition() : regions)
+ .attr("x", x)
+ .attr("y", y)
+ .attr("width", w)
+ .attr("height", h)
+ .style("fill-opacity", function (d) { return isValue(d.opacity) ? d.opacity : 0.1; })
+ ];
+ };
+ c3_chart_internal_fn.regionX = function (d) {
+ var $$ = this, config = $$.config,
+ xPos, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ xPos = config.axis_rotated ? ('start' in d ? yScale(d.start) : 0) : 0;
+ } else {
+ xPos = config.axis_rotated ? 0 : ('start' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.start) : d.start) : 0);
+ }
+ return xPos;
+ };
+ c3_chart_internal_fn.regionY = function (d) {
+ var $$ = this, config = $$.config,
+ yPos, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ yPos = config.axis_rotated ? 0 : ('end' in d ? yScale(d.end) : 0);
+ } else {
+ yPos = config.axis_rotated ? ('start' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.start) : d.start) : 0) : 0;
+ }
+ return yPos;
+ };
+ c3_chart_internal_fn.regionWidth = function (d) {
+ var $$ = this, config = $$.config,
+ start = $$.regionX(d), end, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ end = config.axis_rotated ? ('end' in d ? yScale(d.end) : $$.width) : $$.width;
+ } else {
+ end = config.axis_rotated ? $$.width : ('end' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.end) : d.end) : $$.width);
+ }
+ return end < start ? 0 : end - start;
+ };
+ c3_chart_internal_fn.regionHeight = function (d) {
+ var $$ = this, config = $$.config,
+ start = this.regionY(d), end, yScale = d.axis === 'y' ? $$.y : $$.y2;
+ if (d.axis === 'y' || d.axis === 'y2') {
+ end = config.axis_rotated ? $$.height : ('start' in d ? yScale(d.start) : $$.height);
+ } else {
+ end = config.axis_rotated ? ('end' in d ? $$.x($$.isTimeSeries() ? $$.parseDate(d.end) : d.end) : $$.height) : $$.height;
+ }
+ return end < start ? 0 : end - start;
+ };
+ c3_chart_internal_fn.isRegionOnX = function (d) {
+ return !d.axis || d.axis === 'x';
+ };
+
+ c3_chart_internal_fn.drag = function (mouse) {
+ var $$ = this, config = $$.config, main = $$.main, d3 = $$.d3;
+ var sx, sy, mx, my, minX, maxX, minY, maxY;
+
+ if ($$.hasArcType()) { return; }
+ if (! config.data_selection_enabled) { return; } // do nothing if not selectable
+ if (config.zoom_enabled && ! $$.zoom.altDomain) { return; } // skip if zoomable because of conflict drag dehavior
+ if (!config.data_selection_multiple) { return; } // skip when single selection because drag is used for multiple selection
+
+ sx = $$.dragStart[0];
+ sy = $$.dragStart[1];
+ mx = mouse[0];
+ my = mouse[1];
+ minX = Math.min(sx, mx);
+ maxX = Math.max(sx, mx);
+ minY = (config.data_selection_grouped) ? $$.margin.top : Math.min(sy, my);
+ maxY = (config.data_selection_grouped) ? $$.height : Math.max(sy, my);
+
+ main.select('.' + CLASS.dragarea)
+ .attr('x', minX)
+ .attr('y', minY)
+ .attr('width', maxX - minX)
+ .attr('height', maxY - minY);
+ // TODO: binary search when multiple xs
+ main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape)
+ .filter(function (d) { return config.data_selection_isselectable(d); })
+ .each(function (d, i) {
+ var shape = d3.select(this),
+ isSelected = shape.classed(CLASS.SELECTED),
+ isIncluded = shape.classed(CLASS.INCLUDED),
+ _x, _y, _w, _h, toggle, isWithin = false, box;
+ if (shape.classed(CLASS.circle)) {
+ _x = shape.attr("cx") * 1;
+ _y = shape.attr("cy") * 1;
+ toggle = $$.togglePoint;
+ isWithin = minX < _x && _x < maxX && minY < _y && _y < maxY;
+ }
+ else if (shape.classed(CLASS.bar)) {
+ box = getPathBox(this);
+ _x = box.x;
+ _y = box.y;
+ _w = box.width;
+ _h = box.height;
+ toggle = $$.togglePath;
+ isWithin = !(maxX < _x || _x + _w < minX) && !(maxY < _y || _y + _h < minY);
+ } else {
+ // line/area selection not supported yet
+ return;
+ }
+ if (isWithin ^ isIncluded) {
+ shape.classed(CLASS.INCLUDED, !isIncluded);
+ // TODO: included/unincluded callback here
+ shape.classed(CLASS.SELECTED, !isSelected);
+ toggle.call($$, !isSelected, shape, d, i);
+ }
+ });
+ };
+
+ c3_chart_internal_fn.dragstart = function (mouse) {
+ var $$ = this, config = $$.config;
+ if ($$.hasArcType()) { return; }
+ if (! config.data_selection_enabled) { return; } // do nothing if not selectable
+ $$.dragStart = mouse;
+ $$.main.select('.' + CLASS.chart).append('rect')
+ .attr('class', CLASS.dragarea)
+ .style('opacity', 0.1);
+ $$.dragging = true;
+ };
+
+ c3_chart_internal_fn.dragend = function () {
+ var $$ = this, config = $$.config;
+ if ($$.hasArcType()) { return; }
+ if (! config.data_selection_enabled) { return; } // do nothing if not selectable
+ $$.main.select('.' + CLASS.dragarea)
+ .transition().duration(100)
+ .style('opacity', 0)
+ .remove();
+ $$.main.selectAll('.' + CLASS.shape)
+ .classed(CLASS.INCLUDED, false);
+ $$.dragging = false;
+ };
+
+ c3_chart_internal_fn.selectPoint = function (target, d, i) {
+ var $$ = this, config = $$.config,
+ cx = (config.axis_rotated ? $$.circleY : $$.circleX).bind($$),
+ cy = (config.axis_rotated ? $$.circleX : $$.circleY).bind($$),
+ r = $$.pointSelectR.bind($$);
+ config.data_onselected.call($$.api, d, target.node());
+ // add selected-circle on low layer g
+ $$.main.select('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS.selectedCircle + '-' + i)
+ .data([d])
+ .enter().append('circle')
+ .attr("class", function () { return $$.generateClass(CLASS.selectedCircle, i); })
+ .attr("cx", cx)
+ .attr("cy", cy)
+ .attr("stroke", function () { return $$.color(d); })
+ .attr("r", function (d) { return $$.pointSelectR(d) * 1.4; })
+ .transition().duration(100)
+ .attr("r", r);
+ };
+ c3_chart_internal_fn.unselectPoint = function (target, d, i) {
+ var $$ = this;
+ $$.config.data_onunselected(d, target.node());
+ // remove selected-circle from low layer g
+ $$.main.select('.' + CLASS.selectedCircles + $$.getTargetSelectorSuffix(d.id)).selectAll('.' + CLASS.selectedCircle + '-' + i)
+ .transition().duration(100).attr('r', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.togglePoint = function (selected, target, d, i) {
+ selected ? this.selectPoint(target, d, i) : this.unselectPoint(target, d, i);
+ };
+ c3_chart_internal_fn.selectPath = function (target, d) {
+ var $$ = this;
+ $$.config.data_onselected.call($$, d, target.node());
+ target.transition().duration(100)
+ .style("fill", function () { return $$.d3.rgb($$.color(d)).brighter(0.75); });
+ };
+ c3_chart_internal_fn.unselectPath = function (target, d) {
+ var $$ = this;
+ $$.config.data_onunselected.call($$, d, target.node());
+ target.transition().duration(100)
+ .style("fill", function () { return $$.color(d); });
+ };
+ c3_chart_internal_fn.togglePath = function (selected, target, d, i) {
+ selected ? this.selectPath(target, d, i) : this.unselectPath(target, d, i);
+ };
+ c3_chart_internal_fn.getToggle = function (that, d) {
+ var $$ = this, toggle;
+ if (that.nodeName === 'circle') {
+ if ($$.isStepType(d)) {
+ // circle is hidden in step chart, so treat as within the click area
+ toggle = function () {}; // TODO: how to select step chart?
+ } else {
+ toggle = $$.togglePoint;
+ }
+ }
+ else if (that.nodeName === 'path') {
+ toggle = $$.togglePath;
+ }
+ return toggle;
+ };
+ c3_chart_internal_fn.toggleShape = function (that, d, i) {
+ var $$ = this, d3 = $$.d3, config = $$.config,
+ shape = d3.select(that), isSelected = shape.classed(CLASS.SELECTED),
+ toggle = $$.getToggle(that, d).bind($$);
+
+ if (config.data_selection_enabled && config.data_selection_isselectable(d)) {
+ if (!config.data_selection_multiple) {
+ $$.main.selectAll('.' + CLASS.shapes + (config.data_selection_grouped ? $$.getTargetSelectorSuffix(d.id) : "")).selectAll('.' + CLASS.shape).each(function (d, i) {
+ var shape = d3.select(this);
+ if (shape.classed(CLASS.SELECTED)) { toggle(false, shape.classed(CLASS.SELECTED, false), d, i); }
+ });
+ }
+ shape.classed(CLASS.SELECTED, !isSelected);
+ toggle(!isSelected, shape, d, i);
+ }
+ };
+
+ c3_chart_internal_fn.initBrush = function () {
+ var $$ = this, d3 = $$.d3;
+ $$.brush = d3.svg.brush().on("brush", function () { $$.redrawForBrush(); });
+ $$.brush.update = function () {
+ if ($$.context) { $$.context.select('.' + CLASS.brush).call(this); }
+ return this;
+ };
+ $$.brush.scale = function (scale) {
+ return $$.config.axis_rotated ? this.y(scale) : this.x(scale);
+ };
+ };
+ c3_chart_internal_fn.initSubchart = function () {
+ var $$ = this, config = $$.config,
+ context = $$.context = $$.svg.append("g").attr("transform", $$.getTranslate('context'));
+
+ context.style('visibility', config.subchart_show ? 'visible' : 'hidden');
+
+ // Define g for chart area
+ context.append('g')
+ .attr("clip-path", $$.clipPathForSubchart)
+ .attr('class', CLASS.chart);
+
+ // Define g for bar chart area
+ context.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartBars);
+
+ // Define g for line chart area
+ context.select('.' + CLASS.chart).append("g")
+ .attr("class", CLASS.chartLines);
+
+ // Add extent rect for Brush
+ context.append("g")
+ .attr("clip-path", $$.clipPath)
+ .attr("class", CLASS.brush)
+ .call($$.brush);
+
+ // ATTENTION: This must be called AFTER chart added
+ // Add Axis
+ $$.axes.subx = context.append("g")
+ .attr("class", CLASS.axisX)
+ .attr("transform", $$.getTranslate('subx'))
+ .attr("clip-path", config.axis_rotated ? "" : $$.clipPathForXAxis);
+ };
+ c3_chart_internal_fn.updateTargetsForSubchart = function (targets) {
+ var $$ = this, context = $$.context, config = $$.config,
+ contextLineEnter, contextLineUpdate, contextBarEnter, contextBarUpdate,
+ classChartBar = $$.classChartBar.bind($$),
+ classBars = $$.classBars.bind($$),
+ classChartLine = $$.classChartLine.bind($$),
+ classLines = $$.classLines.bind($$),
+ classAreas = $$.classAreas.bind($$);
+
+ if (config.subchart_show) {
+ //-- Bar --//
+ contextBarUpdate = context.select('.' + CLASS.chartBars).selectAll('.' + CLASS.chartBar)
+ .data(targets)
+ .attr('class', classChartBar);
+ contextBarEnter = contextBarUpdate.enter().append('g')
+ .style('opacity', 0)
+ .attr('class', classChartBar);
+ // Bars for each data
+ contextBarEnter.append('g')
+ .attr("class", classBars);
+
+ //-- Line --//
+ contextLineUpdate = context.select('.' + CLASS.chartLines).selectAll('.' + CLASS.chartLine)
+ .data(targets)
+ .attr('class', classChartLine);
+ contextLineEnter = contextLineUpdate.enter().append('g')
+ .style('opacity', 0)
+ .attr('class', classChartLine);
+ // Lines for each data
+ contextLineEnter.append("g")
+ .attr("class", classLines);
+ // Area
+ contextLineEnter.append("g")
+ .attr("class", classAreas);
+
+ //-- Brush --//
+ context.selectAll('.' + CLASS.brush + ' rect')
+ .attr(config.axis_rotated ? "width" : "height", config.axis_rotated ? $$.width2 : $$.height2);
+ }
+ };
+ c3_chart_internal_fn.updateBarForSubchart = function (durationForExit) {
+ var $$ = this;
+ $$.contextBar = $$.context.selectAll('.' + CLASS.bars).selectAll('.' + CLASS.bar)
+ .data($$.barData.bind($$));
+ $$.contextBar.enter().append('path')
+ .attr("class", $$.classBar.bind($$))
+ .style("stroke", 'none')
+ .style("fill", $$.color);
+ $$.contextBar
+ .style("opacity", $$.initialOpacity.bind($$));
+ $$.contextBar.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawBarForSubchart = function (drawBarOnSub, withTransition, duration) {
+ (withTransition ? this.contextBar.transition().duration(duration) : this.contextBar)
+ .attr('d', drawBarOnSub)
+ .style('opacity', 1);
+ };
+ c3_chart_internal_fn.updateLineForSubchart = function (durationForExit) {
+ var $$ = this;
+ $$.contextLine = $$.context.selectAll('.' + CLASS.lines).selectAll('.' + CLASS.line)
+ .data($$.lineData.bind($$));
+ $$.contextLine.enter().append('path')
+ .attr('class', $$.classLine.bind($$))
+ .style('stroke', $$.color);
+ $$.contextLine
+ .style("opacity", $$.initialOpacity.bind($$));
+ $$.contextLine.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawLineForSubchart = function (drawLineOnSub, withTransition, duration) {
+ (withTransition ? this.contextLine.transition().duration(duration) : this.contextLine)
+ .attr("d", drawLineOnSub)
+ .style('opacity', 1);
+ };
+ c3_chart_internal_fn.updateAreaForSubchart = function (durationForExit) {
+ var $$ = this, d3 = $$.d3;
+ $$.contextArea = $$.context.selectAll('.' + CLASS.areas).selectAll('.' + CLASS.area)
+ .data($$.lineData.bind($$));
+ $$.contextArea.enter().append('path')
+ .attr("class", $$.classArea.bind($$))
+ .style("fill", $$.color)
+ .style("opacity", function () { $$.orgAreaOpacity = +d3.select(this).style('opacity'); return 0; });
+ $$.contextArea
+ .style("opacity", 0);
+ $$.contextArea.exit().transition().duration(durationForExit)
+ .style('opacity', 0)
+ .remove();
+ };
+ c3_chart_internal_fn.redrawAreaForSubchart = function (drawAreaOnSub, withTransition, duration) {
+ (withTransition ? this.contextArea.transition().duration(duration) : this.contextArea)
+ .attr("d", drawAreaOnSub)
+ .style("fill", this.color)
+ .style("opacity", this.orgAreaOpacity);
+ };
+ c3_chart_internal_fn.redrawSubchart = function (withSubchart, transitions, duration, durationForExit, areaIndices, barIndices, lineIndices) {
+ var $$ = this, d3 = $$.d3, config = $$.config,
+ drawAreaOnSub, drawBarOnSub, drawLineOnSub;
+
+ $$.context.style('visibility', config.subchart_show ? 'visible' : 'hidden');
+
+ // subchart
+ if (config.subchart_show) {
+ // reflect main chart to extent on subchart if zoomed
+ if (d3.event && d3.event.type === 'zoom') {
+ $$.brush.extent($$.x.orgDomain()).update();
+ }
+ // update subchart elements if needed
+ if (withSubchart) {
+
+ // extent rect
+ if (!$$.brush.empty()) {
+ $$.brush.extent($$.x.orgDomain()).update();
+ }
+ // setup drawer - MEMO: this must be called after axis updated
+ drawAreaOnSub = $$.generateDrawArea(areaIndices, true);
+ drawBarOnSub = $$.generateDrawBar(barIndices, true);
+ drawLineOnSub = $$.generateDrawLine(lineIndices, true);
+
+ $$.updateBarForSubchart(duration);
+ $$.updateLineForSubchart(duration);
+ $$.updateAreaForSubchart(duration);
+
+ $$.redrawBarForSubchart(drawBarOnSub, duration, duration);
+ $$.redrawLineForSubchart(drawLineOnSub, duration, duration);
+ $$.redrawAreaForSubchart(drawAreaOnSub, duration, duration);
+ }
+ }
+ };
+ c3_chart_internal_fn.redrawForBrush = function () {
+ var $$ = this, x = $$.x;
+ $$.redraw({
+ withTransition: false,
+ withY: $$.config.zoom_rescale,
+ withSubchart: false,
+ withUpdateXDomain: true,
+ withDimension: false
+ });
+ $$.config.subchart_onbrush.call($$.api, x.orgDomain());
+ };
+ c3_chart_internal_fn.transformContext = function (withTransition, transitions) {
+ var $$ = this, subXAxis;
+ if (transitions && transitions.axisSubX) {
+ subXAxis = transitions.axisSubX;
+ } else {
+ subXAxis = $$.context.select('.' + CLASS.axisX);
+ if (withTransition) { subXAxis = subXAxis.transition(); }
+ }
+ $$.context.attr("transform", $$.getTranslate('context'));
+ subXAxis.attr("transform", $$.getTranslate('subx'));
+ };
+ c3_chart_internal_fn.getDefaultExtent = function () {
+ var $$ = this, config = $$.config,
+ extent = isFunction(config.axis_x_extent) ? config.axis_x_extent($$.getXDomain($$.data.targets)) : config.axis_x_extent;
+ if ($$.isTimeSeries()) {
+ extent = [$$.parseDate(extent[0]), $$.parseDate(extent[1])];
+ }
+ return extent;
+ };
+
+ c3_chart_internal_fn.initZoom = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config, startEvent;
+
+ $$.zoom = d3.behavior.zoom()
+ .on("zoomstart", function () {
+ startEvent = d3.event.sourceEvent;
+ $$.zoom.altDomain = d3.event.sourceEvent.altKey ? $$.x.orgDomain() : null;
+ config.zoom_onzoomstart.call($$.api, d3.event.sourceEvent);
+ })
+ .on("zoom", function () {
+ $$.redrawForZoom.call($$);
+ })
+ .on('zoomend', function () {
+ var event = d3.event.sourceEvent;
+ // if click, do nothing. otherwise, click interaction will be canceled.
+ if (event && startEvent.clientX === event.clientX && startEvent.clientY === event.clientY) {
+ return;
+ }
+ $$.redrawEventRect();
+ $$.updateZoom();
+ config.zoom_onzoomend.call($$.api, $$.x.orgDomain());
+ });
+ $$.zoom.scale = function (scale) {
+ return config.axis_rotated ? this.y(scale) : this.x(scale);
+ };
+ $$.zoom.orgScaleExtent = function () {
+ var extent = config.zoom_extent ? config.zoom_extent : [1, 10];
+ return [extent[0], Math.max($$.getMaxDataCount() / extent[1], extent[1])];
+ };
+ $$.zoom.updateScaleExtent = function () {
+ var ratio = diffDomain($$.x.orgDomain()) / diffDomain($$.orgXDomain),
+ extent = this.orgScaleExtent();
+ this.scaleExtent([extent[0] * ratio, extent[1] * ratio]);
+ return this;
+ };
+ };
+ c3_chart_internal_fn.updateZoom = function () {
+ var $$ = this, z = $$.config.zoom_enabled ? $$.zoom : function () {};
+ $$.main.select('.' + CLASS.zoomRect).call(z).on("dblclick.zoom", null);
+ $$.main.selectAll('.' + CLASS.eventRect).call(z).on("dblclick.zoom", null);
+ };
+ c3_chart_internal_fn.redrawForZoom = function () {
+ var $$ = this, d3 = $$.d3, config = $$.config, zoom = $$.zoom, x = $$.x;
+ if (!config.zoom_enabled) {
+ return;
+ }
+ if ($$.filterTargetsToShow($$.data.targets).length === 0) {
+ return;
+ }
+ if (d3.event.sourceEvent.type === 'mousemove' && zoom.altDomain) {
+ x.domain(zoom.altDomain);
+ zoom.scale(x).updateScaleExtent();
+ return;
+ }
+ if ($$.isCategorized() && x.orgDomain()[0] === $$.orgXDomain[0]) {
+ x.domain([$$.orgXDomain[0] - 1e-10, x.orgDomain()[1]]);
+ }
+ $$.redraw({
+ withTransition: false,
+ withY: config.zoom_rescale,
+ withSubchart: false,
+ withEventRect: false,
+ withDimension: false
+ });
+ if (d3.event.sourceEvent.type === 'mousemove') {
+ $$.cancelClick = true;
+ }
+ config.zoom_onzoom.call($$.api, x.orgDomain());
+ };
+
+ c3_chart_internal_fn.generateColor = function () {
+ var $$ = this, config = $$.config, d3 = $$.d3,
+ colors = config.data_colors,
+ pattern = notEmpty(config.color_pattern) ? config.color_pattern : d3.scale.category10().range(),
+ callback = config.data_color,
+ ids = [];
+
+ return function (d) {
+ var id = d.id || (d.data && d.data.id) || d, color;
+
+ // if callback function is provided
+ if (colors[id] instanceof Function) {
+ color = colors[id](d);
+ }
+ // if specified, choose that color
+ else if (colors[id]) {
+ color = colors[id];
+ }
+ // if not specified, choose from pattern
+ else {
+ if (ids.indexOf(id) < 0) { ids.push(id); }
+ color = pattern[ids.indexOf(id) % pattern.length];
+ colors[id] = color;
+ }
+ return callback instanceof Function ? callback(color, d) : color;
+ };
+ };
+ c3_chart_internal_fn.generateLevelColor = function () {
+ var $$ = this, config = $$.config,
+ colors = config.color_pattern,
+ threshold = config.color_threshold,
+ asValue = threshold.unit === 'value',
+ values = threshold.values && threshold.values.length ? threshold.values : [],
+ max = threshold.max || 100;
+ return notEmpty(config.color_threshold) ? function (value) {
+ var i, v, color = colors[colors.length - 1];
+ for (i = 0; i < values.length; i++) {
+ v = asValue ? value : (value * 100 / max);
+ if (v < values[i]) {
+ color = colors[i];
+ break;
+ }
+ }
+ return color;
+ } : null;
+ };
+
+ c3_chart_internal_fn.getYFormat = function (forArc) {
+ var $$ = this,
+ formatForY = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.yFormat,
+ formatForY2 = forArc && !$$.hasType('gauge') ? $$.defaultArcValueFormat : $$.y2Format;
+ return function (v, ratio, id) {
+ var format = $$.axis.getId(id) === 'y2' ? formatForY2 : formatForY;
+ return format.call($$, v, ratio);
+ };
+ };
+ c3_chart_internal_fn.yFormat = function (v) {
+ var $$ = this, config = $$.config,
+ format = config.axis_y_tick_format ? config.axis_y_tick_format : $$.defaultValueFormat;
+ return format(v);
+ };
+ c3_chart_internal_fn.y2Format = function (v) {
+ var $$ = this, config = $$.config,
+ format = config.axis_y2_tick_format ? config.axis_y2_tick_format : $$.defaultValueFormat;
+ return format(v);
+ };
+ c3_chart_internal_fn.defaultValueFormat = function (v) {
+ return isValue(v) ? +v : "";
+ };
+ c3_chart_internal_fn.defaultArcValueFormat = function (v, ratio) {
+ return (ratio * 100).toFixed(1) + '%';
+ };
+ c3_chart_internal_fn.dataLabelFormat = function (targetId) {
+ var $$ = this, data_labels = $$.config.data_labels,
+ format, defaultFormat = function (v) { return isValue(v) ? +v : ""; };
+ // find format according to axis id
+ if (typeof data_labels.format === 'function') {
+ format = data_labels.format;
+ } else if (typeof data_labels.format === 'object') {
+ if (data_labels.format[targetId]) {
+ format = data_labels.format[targetId] === true ? defaultFormat : data_labels.format[targetId];
+ } else {
+ format = function () { return ''; };
+ }
+ } else {
+ format = defaultFormat;
+ }
+ return format;
+ };
+
+ c3_chart_internal_fn.hasCaches = function (ids) {
+ for (var i = 0; i < ids.length; i++) {
+ if (! (ids[i] in this.cache)) { return false; }
+ }
+ return true;
+ };
+ c3_chart_internal_fn.addCache = function (id, target) {
+ this.cache[id] = this.cloneTarget(target);
+ };
+ c3_chart_internal_fn.getCaches = function (ids) {
+ var targets = [], i;
+ for (i = 0; i < ids.length; i++) {
+ if (ids[i] in this.cache) { targets.push(this.cloneTarget(this.cache[ids[i]])); }
+ }
+ return targets;
+ };
+
+ var CLASS = c3_chart_internal_fn.CLASS = {
+ target: 'c3-target',
+ chart: 'c3-chart',
+ chartLine: 'c3-chart-line',
+ chartLines: 'c3-chart-lines',
+ chartBar: 'c3-chart-bar',
+ chartBars: 'c3-chart-bars',
+ chartText: 'c3-chart-text',
+ chartTexts: 'c3-chart-texts',
+ chartArc: 'c3-chart-arc',
+ chartArcs: 'c3-chart-arcs',
+ chartArcsTitle: 'c3-chart-arcs-title',
+ chartArcsBackground: 'c3-chart-arcs-background',
+ chartArcsGaugeUnit: 'c3-chart-arcs-gauge-unit',
+ chartArcsGaugeMax: 'c3-chart-arcs-gauge-max',
+ chartArcsGaugeMin: 'c3-chart-arcs-gauge-min',
+ selectedCircle: 'c3-selected-circle',
+ selectedCircles: 'c3-selected-circles',
+ eventRect: 'c3-event-rect',
+ eventRects: 'c3-event-rects',
+ eventRectsSingle: 'c3-event-rects-single',
+ eventRectsMultiple: 'c3-event-rects-multiple',
+ zoomRect: 'c3-zoom-rect',
+ brush: 'c3-brush',
+ focused: 'c3-focused',
+ defocused: 'c3-defocused',
+ region: 'c3-region',
+ regions: 'c3-regions',
+ tooltipContainer: 'c3-tooltip-container',
+ tooltip: 'c3-tooltip',
+ tooltipName: 'c3-tooltip-name',
+ shape: 'c3-shape',
+ shapes: 'c3-shapes',
+ line: 'c3-line',
+ lines: 'c3-lines',
+ bar: 'c3-bar',
+ bars: 'c3-bars',
+ circle: 'c3-circle',
+ circles: 'c3-circles',
+ arc: 'c3-arc',
+ arcs: 'c3-arcs',
+ area: 'c3-area',
+ areas: 'c3-areas',
+ empty: 'c3-empty',
+ text: 'c3-text',
+ texts: 'c3-texts',
+ gaugeValue: 'c3-gauge-value',
+ grid: 'c3-grid',
+ gridLines: 'c3-grid-lines',
+ xgrid: 'c3-xgrid',
+ xgrids: 'c3-xgrids',
+ xgridLine: 'c3-xgrid-line',
+ xgridLines: 'c3-xgrid-lines',
+ xgridFocus: 'c3-xgrid-focus',
+ ygrid: 'c3-ygrid',
+ ygrids: 'c3-ygrids',
+ ygridLine: 'c3-ygrid-line',
+ ygridLines: 'c3-ygrid-lines',
+ axis: 'c3-axis',
+ axisX: 'c3-axis-x',
+ axisXLabel: 'c3-axis-x-label',
+ axisY: 'c3-axis-y',
+ axisYLabel: 'c3-axis-y-label',
+ axisY2: 'c3-axis-y2',
+ axisY2Label: 'c3-axis-y2-label',
+ legendBackground: 'c3-legend-background',
+ legendItem: 'c3-legend-item',
+ legendItemEvent: 'c3-legend-item-event',
+ legendItemTile: 'c3-legend-item-tile',
+ legendItemHidden: 'c3-legend-item-hidden',
+ legendItemFocused: 'c3-legend-item-focused',
+ dragarea: 'c3-dragarea',
+ EXPANDED: '_expanded_',
+ SELECTED: '_selected_',
+ INCLUDED: '_included_'
+ };
+ c3_chart_internal_fn.generateClass = function (prefix, targetId) {
+ return " " + prefix + " " + prefix + this.getTargetSelectorSuffix(targetId);
+ };
+ c3_chart_internal_fn.classText = function (d) {
+ return this.generateClass(CLASS.text, d.index);
+ };
+ c3_chart_internal_fn.classTexts = function (d) {
+ return this.generateClass(CLASS.texts, d.id);
+ };
+ c3_chart_internal_fn.classShape = function (d) {
+ return this.generateClass(CLASS.shape, d.index);
+ };
+ c3_chart_internal_fn.classShapes = function (d) {
+ return this.generateClass(CLASS.shapes, d.id);
+ };
+ c3_chart_internal_fn.classLine = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.line, d.id);
+ };
+ c3_chart_internal_fn.classLines = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.lines, d.id);
+ };
+ c3_chart_internal_fn.classCircle = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.circle, d.index);
+ };
+ c3_chart_internal_fn.classCircles = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.circles, d.id);
+ };
+ c3_chart_internal_fn.classBar = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.bar, d.index);
+ };
+ c3_chart_internal_fn.classBars = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.bars, d.id);
+ };
+ c3_chart_internal_fn.classArc = function (d) {
+ return this.classShape(d.data) + this.generateClass(CLASS.arc, d.data.id);
+ };
+ c3_chart_internal_fn.classArcs = function (d) {
+ return this.classShapes(d.data) + this.generateClass(CLASS.arcs, d.data.id);
+ };
+ c3_chart_internal_fn.classArea = function (d) {
+ return this.classShape(d) + this.generateClass(CLASS.area, d.id);
+ };
+ c3_chart_internal_fn.classAreas = function (d) {
+ return this.classShapes(d) + this.generateClass(CLASS.areas, d.id);
+ };
+ c3_chart_internal_fn.classRegion = function (d, i) {
+ return this.generateClass(CLASS.region, i) + ' ' + ('class' in d ? d['class'] : '');
+ };
+ c3_chart_internal_fn.classEvent = function (d) {
+ return this.generateClass(CLASS.eventRect, d.index);
+ };
+ c3_chart_internal_fn.classTarget = function (id) {
+ var $$ = this;
+ var additionalClassSuffix = $$.config.data_classes[id], additionalClass = '';
+ if (additionalClassSuffix) {
+ additionalClass = ' ' + CLASS.target + '-' + additionalClassSuffix;
+ }
+ return $$.generateClass(CLASS.target, id) + additionalClass;
+ };
+ c3_chart_internal_fn.classFocus = function (d) {
+ return this.classFocused(d) + this.classDefocused(d);
+ };
+ c3_chart_internal_fn.classFocused = function (d) {
+ return ' ' + (this.focusedTargetIds.indexOf(d.id) >= 0 ? CLASS.focused : '');
+ };
+ c3_chart_internal_fn.classDefocused = function (d) {
+ return ' ' + (this.defocusedTargetIds.indexOf(d.id) >= 0 ? CLASS.defocused : '');
+ };
+ c3_chart_internal_fn.classChartText = function (d) {
+ return CLASS.chartText + this.classTarget(d.id);
+ };
+ c3_chart_internal_fn.classChartLine = function (d) {
+ return CLASS.chartLine + this.classTarget(d.id);
+ };
+ c3_chart_internal_fn.classChartBar = function (d) {
+ return CLASS.chartBar + this.classTarget(d.id);
+ };
+ c3_chart_internal_fn.classChartArc = function (d) {
+ return CLASS.chartArc + this.classTarget(d.data.id);
+ };
+ c3_chart_internal_fn.getTargetSelectorSuffix = function (targetId) {
+ return targetId || targetId === 0 ? ('-' + targetId).replace(/[\s?!@#$%^&*()_=+,.<>'":;\[\]\/|~`{}\\]/g, '-') : '';
+ };
+ c3_chart_internal_fn.selectorTarget = function (id, prefix) {
+ return (prefix || '') + '.' + CLASS.target + this.getTargetSelectorSuffix(id);
+ };
+ c3_chart_internal_fn.selectorTargets = function (ids, prefix) {
+ var $$ = this;
+ ids = ids || [];
+ return ids.length ? ids.map(function (id) { return $$.selectorTarget(id, prefix); }) : null;
+ };
+ c3_chart_internal_fn.selectorLegend = function (id) {
+ return '.' + CLASS.legendItem + this.getTargetSelectorSuffix(id);
+ };
+ c3_chart_internal_fn.selectorLegends = function (ids) {
+ var $$ = this;
+ return ids && ids.length ? ids.map(function (id) { return $$.selectorLegend(id); }) : null;
+ };
+
+ var isValue = c3_chart_internal_fn.isValue = function (v) {
+ return v || v === 0;
+ },
+ isFunction = c3_chart_internal_fn.isFunction = function (o) {
+ return typeof o === 'function';
+ },
+ isString = c3_chart_internal_fn.isString = function (o) {
+ return typeof o === 'string';
+ },
+ isUndefined = c3_chart_internal_fn.isUndefined = function (v) {
+ return typeof v === 'undefined';
+ },
+ isDefined = c3_chart_internal_fn.isDefined = function (v) {
+ return typeof v !== 'undefined';
+ },
+ ceil10 = c3_chart_internal_fn.ceil10 = function (v) {
+ return Math.ceil(v / 10) * 10;
+ },
+ asHalfPixel = c3_chart_internal_fn.asHalfPixel = function (n) {
+ return Math.ceil(n) + 0.5;
+ },
+ diffDomain = c3_chart_internal_fn.diffDomain = function (d) {
+ return d[1] - d[0];
+ },
+ isEmpty = c3_chart_internal_fn.isEmpty = function (o) {
+ return !o || (isString(o) && o.length === 0) || (typeof o === 'object' && Object.keys(o).length === 0);
+ },
+ notEmpty = c3_chart_internal_fn.notEmpty = function (o) {
+ return Object.keys(o).length > 0;
+ },
+ getOption = c3_chart_internal_fn.getOption = function (options, key, defaultValue) {
+ return isDefined(options[key]) ? options[key] : defaultValue;
+ },
+ hasValue = c3_chart_internal_fn.hasValue = function (dict, value) {
+ var found = false;
+ Object.keys(dict).forEach(function (key) {
+ if (dict[key] === value) { found = true; }
+ });
+ return found;
+ },
+ getPathBox = c3_chart_internal_fn.getPathBox = function (path) {
+ var box = path.getBoundingClientRect(),
+ items = [path.pathSegList.getItem(0), path.pathSegList.getItem(1)],
+ minX = items[0].x, minY = Math.min(items[0].y, items[1].y);
+ return {x: minX, y: minY, width: box.width, height: box.height};
+ };
+
+ c3_chart_fn.focus = function (targetIds) {
+ var $$ = this.internal, candidates;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ candidates = $$.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$))),
+
+ this.revert();
+ this.defocus();
+ candidates.classed(CLASS.focused, true).classed(CLASS.defocused, false);
+ if ($$.hasArcType()) {
+ $$.expandArc(targetIds);
+ }
+ $$.toggleFocusLegend(targetIds, true);
+
+ $$.focusedTargetIds = targetIds;
+ $$.defocusedTargetIds = $$.defocusedTargetIds.filter(function (id) {
+ return targetIds.indexOf(id) < 0;
+ });
+ };
+
+ c3_chart_fn.defocus = function (targetIds) {
+ var $$ = this.internal, candidates;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ candidates = $$.svg.selectAll($$.selectorTargets(targetIds.filter($$.isTargetToShow, $$))),
+
+ candidates.classed(CLASS.focused, false).classed(CLASS.defocused, true);
+ if ($$.hasArcType()) {
+ $$.unexpandArc(targetIds);
+ }
+ $$.toggleFocusLegend(targetIds, false);
+
+ $$.focusedTargetIds = $$.focusedTargetIds.filter(function (id) {
+ return targetIds.indexOf(id) < 0;
+ });
+ $$.defocusedTargetIds = targetIds;
+ };
+
+ c3_chart_fn.revert = function (targetIds) {
+ var $$ = this.internal, candidates;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ candidates = $$.svg.selectAll($$.selectorTargets(targetIds)); // should be for all targets
+
+ candidates.classed(CLASS.focused, false).classed(CLASS.defocused, false);
+ if ($$.hasArcType()) {
+ $$.unexpandArc(targetIds);
+ }
+ if ($$.config.legend_show) {
+ $$.showLegend(targetIds.filter($$.isLegendToShow.bind($$)));
+ $$.legend.selectAll($$.selectorLegends(targetIds))
+ .filter(function () {
+ return $$.d3.select(this).classed(CLASS.legendItemFocused);
+ })
+ .classed(CLASS.legendItemFocused, false);
+ }
+
+ $$.focusedTargetIds = [];
+ $$.defocusedTargetIds = [];
+ };
+
+ c3_chart_fn.show = function (targetIds, options) {
+ var $$ = this.internal, targets;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ options = options || {};
+
+ $$.removeHiddenTargetIds(targetIds);
+ targets = $$.svg.selectAll($$.selectorTargets(targetIds));
+
+ targets.transition()
+ .style('opacity', 1, 'important')
+ .call($$.endall, function () {
+ targets.style('opacity', null).style('opacity', 1);
+ });
+
+ if (options.withLegend) {
+ $$.showLegend(targetIds);
+ }
+
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+ };
+
+ c3_chart_fn.hide = function (targetIds, options) {
+ var $$ = this.internal, targets;
+
+ targetIds = $$.mapToTargetIds(targetIds);
+ options = options || {};
+
+ $$.addHiddenTargetIds(targetIds);
+ targets = $$.svg.selectAll($$.selectorTargets(targetIds));
+
+ targets.transition()
+ .style('opacity', 0, 'important')
+ .call($$.endall, function () {
+ targets.style('opacity', null).style('opacity', 0);
+ });
+
+ if (options.withLegend) {
+ $$.hideLegend(targetIds);
+ }
+
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+ };
+
+ c3_chart_fn.toggle = function (targetIds, options) {
+ var that = this, $$ = this.internal;
+ $$.mapToTargetIds(targetIds).forEach(function (targetId) {
+ $$.isTargetToShow(targetId) ? that.hide(targetId, options) : that.show(targetId, options);
+ });
+ };
+
+ c3_chart_fn.zoom = function (domain) {
+ var $$ = this.internal;
+ if (domain) {
+ if ($$.isTimeSeries()) {
+ domain = domain.map(function (x) { return $$.parseDate(x); });
+ }
+ $$.brush.extent(domain);
+ $$.redraw({withUpdateXDomain: true, withY: $$.config.zoom_rescale});
+ $$.config.zoom_onzoom.call(this, $$.x.orgDomain());
+ }
+ return $$.brush.extent();
+ };
+ c3_chart_fn.zoom.enable = function (enabled) {
+ var $$ = this.internal;
+ $$.config.zoom_enabled = enabled;
+ $$.updateAndRedraw();
+ };
+ c3_chart_fn.unzoom = function () {
+ var $$ = this.internal;
+ $$.brush.clear().update();
+ $$.redraw({withUpdateXDomain: true});
+ };
+
+ c3_chart_fn.load = function (args) {
+ var $$ = this.internal, config = $$.config;
+ // update xs if specified
+ if (args.xs) {
+ $$.addXs(args.xs);
+ }
+ // update classes if exists
+ if ('classes' in args) {
+ Object.keys(args.classes).forEach(function (id) {
+ config.data_classes[id] = args.classes[id];
+ });
+ }
+ // update categories if exists
+ if ('categories' in args && $$.isCategorized()) {
+ config.axis_x_categories = args.categories;
+ }
+ // update axes if exists
+ if ('axes' in args) {
+ Object.keys(args.axes).forEach(function (id) {
+ config.data_axes[id] = args.axes[id];
+ });
+ }
+ // update colors if exists
+ if ('colors' in args) {
+ Object.keys(args.colors).forEach(function (id) {
+ config.data_colors[id] = args.colors[id];
+ });
+ }
+ // use cache if exists
+ if ('cacheIds' in args && $$.hasCaches(args.cacheIds)) {
+ $$.load($$.getCaches(args.cacheIds), args.done);
+ return;
+ }
+ // unload if needed
+ if ('unload' in args) {
+ // TODO: do not unload if target will load (included in url/rows/columns)
+ $$.unload($$.mapToTargetIds((typeof args.unload === 'boolean' && args.unload) ? null : args.unload), function () {
+ $$.loadFromArgs(args);
+ });
+ } else {
+ $$.loadFromArgs(args);
+ }
+ };
+
+ c3_chart_fn.unload = function (args) {
+ var $$ = this.internal;
+ args = args || {};
+ if (args instanceof Array) {
+ args = {ids: args};
+ } else if (typeof args === 'string') {
+ args = {ids: [args]};
+ }
+ $$.unload($$.mapToTargetIds(args.ids), function () {
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true, withLegend: true});
+ if (args.done) { args.done(); }
+ });
+ };
+
+ c3_chart_fn.flow = function (args) {
+ var $$ = this.internal,
+ targets, data, notfoundIds = [], orgDataCount = $$.getMaxDataCount(),
+ dataCount, domain, baseTarget, baseValue, length = 0, tail = 0, diff, to;
+
+ if (args.json) {
+ data = $$.convertJsonToData(args.json, args.keys);
+ }
+ else if (args.rows) {
+ data = $$.convertRowsToData(args.rows);
+ }
+ else if (args.columns) {
+ data = $$.convertColumnsToData(args.columns);
+ }
+ else {
+ return;
+ }
+ targets = $$.convertDataToTargets(data, true);
+
+ // Update/Add data
+ $$.data.targets.forEach(function (t) {
+ var found = false, i, j;
+ for (i = 0; i < targets.length; i++) {
+ if (t.id === targets[i].id) {
+ found = true;
+
+ if (t.values[t.values.length - 1]) {
+ tail = t.values[t.values.length - 1].index + 1;
+ }
+ length = targets[i].values.length;
+
+ for (j = 0; j < length; j++) {
+ targets[i].values[j].index = tail + j;
+ if (!$$.isTimeSeries()) {
+ targets[i].values[j].x = tail + j;
+ }
+ }
+ t.values = t.values.concat(targets[i].values);
+
+ targets.splice(i, 1);
+ break;
+ }
+ }
+ if (!found) { notfoundIds.push(t.id); }
+ });
+
+ // Append null for not found targets
+ $$.data.targets.forEach(function (t) {
+ var i, j;
+ for (i = 0; i < notfoundIds.length; i++) {
+ if (t.id === notfoundIds[i]) {
+ tail = t.values[t.values.length - 1].index + 1;
+ for (j = 0; j < length; j++) {
+ t.values.push({
+ id: t.id,
+ index: tail + j,
+ x: $$.isTimeSeries() ? $$.getOtherTargetX(tail + j) : tail + j,
+ value: null
+ });
+ }
+ }
+ }
+ });
+
+ // Generate null values for new target
+ if ($$.data.targets.length) {
+ targets.forEach(function (t) {
+ var i, missing = [];
+ for (i = $$.data.targets[0].values[0].index; i < tail; i++) {
+ missing.push({
+ id: t.id,
+ index: i,
+ x: $$.isTimeSeries() ? $$.getOtherTargetX(i) : i,
+ value: null
+ });
+ }
+ t.values.forEach(function (v) {
+ v.index += tail;
+ if (!$$.isTimeSeries()) {
+ v.x += tail;
+ }
+ });
+ t.values = missing.concat(t.values);
+ });
+ }
+ $$.data.targets = $$.data.targets.concat(targets); // add remained
+
+ // check data count because behavior needs to change when it's only one
+ dataCount = $$.getMaxDataCount();
+ baseTarget = $$.data.targets[0];
+ baseValue = baseTarget.values[0];
+
+ // Update length to flow if needed
+ if (isDefined(args.to)) {
+ length = 0;
+ to = $$.isTimeSeries() ? $$.parseDate(args.to) : args.to;
+ baseTarget.values.forEach(function (v) {
+ if (v.x < to) { length++; }
+ });
+ } else if (isDefined(args.length)) {
+ length = args.length;
+ }
+
+ // If only one data, update the domain to flow from left edge of the chart
+ if (!orgDataCount) {
+ if ($$.isTimeSeries()) {
+ if (baseTarget.values.length > 1) {
+ diff = baseTarget.values[baseTarget.values.length - 1].x - baseValue.x;
+ } else {
+ diff = baseValue.x - $$.getXDomain($$.data.targets)[0];
+ }
+ } else {
+ diff = 1;
+ }
+ domain = [baseValue.x - diff, baseValue.x];
+ $$.updateXDomain(null, true, true, false, domain);
+ } else if (orgDataCount === 1) {
+ if ($$.isTimeSeries()) {
+ diff = (baseTarget.values[baseTarget.values.length - 1].x - baseValue.x) / 2;
+ domain = [new Date(+baseValue.x - diff), new Date(+baseValue.x + diff)];
+ $$.updateXDomain(null, true, true, false, domain);
+ }
+ }
+
+ // Set targets
+ $$.updateTargets($$.data.targets);
+
+ // Redraw with new targets
+ $$.redraw({
+ flow: {
+ index: baseValue.index,
+ length: length,
+ duration: isValue(args.duration) ? args.duration : $$.config.transition_duration,
+ done: args.done,
+ orgDataCount: orgDataCount,
+ },
+ withLegend: true,
+ withTransition: orgDataCount > 1,
+ withTrimXDomain: false,
+ withUpdateXAxis: true,
+ });
+ };
+
+ c3_chart_internal_fn.generateFlow = function (args) {
+ var $$ = this, config = $$.config, d3 = $$.d3;
+
+ return function () {
+ var targets = args.targets,
+ flow = args.flow,
+ drawBar = args.drawBar,
+ drawLine = args.drawLine,
+ drawArea = args.drawArea,
+ cx = args.cx,
+ cy = args.cy,
+ xv = args.xv,
+ xForText = args.xForText,
+ yForText = args.yForText,
+ duration = args.duration;
+
+ var translateX, scaleX = 1, transform,
+ flowIndex = flow.index,
+ flowLength = flow.length,
+ flowStart = $$.getValueOnIndex($$.data.targets[0].values, flowIndex),
+ flowEnd = $$.getValueOnIndex($$.data.targets[0].values, flowIndex + flowLength),
+ orgDomain = $$.x.domain(), domain,
+ durationForFlow = flow.duration || duration,
+ done = flow.done || function () {},
+ wait = $$.generateWait();
+
+ var xgrid = $$.xgrid || d3.selectAll([]),
+ xgridLines = $$.xgridLines || d3.selectAll([]),
+ mainRegion = $$.mainRegion || d3.selectAll([]),
+ mainText = $$.mainText || d3.selectAll([]),
+ mainBar = $$.mainBar || d3.selectAll([]),
+ mainLine = $$.mainLine || d3.selectAll([]),
+ mainArea = $$.mainArea || d3.selectAll([]),
+ mainCircle = $$.mainCircle || d3.selectAll([]);
+
+ // set flag
+ $$.flowing = true;
+
+ // remove head data after rendered
+ $$.data.targets.forEach(function (d) {
+ d.values.splice(0, flowLength);
+ });
+
+ // update x domain to generate axis elements for flow
+ domain = $$.updateXDomain(targets, true, true);
+ // update elements related to x scale
+ if ($$.updateXGrid) { $$.updateXGrid(true); }
+
+ // generate transform to flow
+ if (!flow.orgDataCount) { // if empty
+ if ($$.data.targets[0].values.length !== 1) {
+ translateX = $$.x(orgDomain[0]) - $$.x(domain[0]);
+ } else {
+ if ($$.isTimeSeries()) {
+ flowStart = $$.getValueOnIndex($$.data.targets[0].values, 0);
+ flowEnd = $$.getValueOnIndex($$.data.targets[0].values, $$.data.targets[0].values.length - 1);
+ translateX = $$.x(flowStart.x) - $$.x(flowEnd.x);
+ } else {
+ translateX = diffDomain(domain) / 2;
+ }
+ }
+ } else if (flow.orgDataCount === 1 || flowStart.x === flowEnd.x) {
+ translateX = $$.x(orgDomain[0]) - $$.x(domain[0]);
+ } else {
+ if ($$.isTimeSeries()) {
+ translateX = ($$.x(orgDomain[0]) - $$.x(domain[0]));
+ } else {
+ translateX = ($$.x(flowStart.x) - $$.x(flowEnd.x));
+ }
+ }
+ scaleX = (diffDomain(orgDomain) / diffDomain(domain));
+ transform = 'translate(' + translateX + ',0) scale(' + scaleX + ',1)';
+
+ // hide tooltip
+ $$.hideXGridFocus();
+ $$.hideTooltip();
+
+ d3.transition().ease('linear').duration(durationForFlow).each(function () {
+ wait.add($$.axes.x.transition().call($$.xAxis));
+ wait.add(mainBar.transition().attr('transform', transform));
+ wait.add(mainLine.transition().attr('transform', transform));
+ wait.add(mainArea.transition().attr('transform', transform));
+ wait.add(mainCircle.transition().attr('transform', transform));
+ wait.add(mainText.transition().attr('transform', transform));
+ wait.add(mainRegion.filter($$.isRegionOnX).transition().attr('transform', transform));
+ wait.add(xgrid.transition().attr('transform', transform));
+ wait.add(xgridLines.transition().attr('transform', transform));
+ })
+ .call(wait, function () {
+ var i, shapes = [], texts = [], eventRects = [];
+
+ // remove flowed elements
+ if (flowLength) {
+ for (i = 0; i < flowLength; i++) {
+ shapes.push('.' + CLASS.shape + '-' + (flowIndex + i));
+ texts.push('.' + CLASS.text + '-' + (flowIndex + i));
+ eventRects.push('.' + CLASS.eventRect + '-' + (flowIndex + i));
+ }
+ $$.svg.selectAll('.' + CLASS.shapes).selectAll(shapes).remove();
+ $$.svg.selectAll('.' + CLASS.texts).selectAll(texts).remove();
+ $$.svg.selectAll('.' + CLASS.eventRects).selectAll(eventRects).remove();
+ $$.svg.select('.' + CLASS.xgrid).remove();
+ }
+
+ // draw again for removing flowed elements and reverting attr
+ xgrid
+ .attr('transform', null)
+ .attr($$.xgridAttr);
+ xgridLines
+ .attr('transform', null);
+ xgridLines.select('line')
+ .attr("x1", config.axis_rotated ? 0 : xv)
+ .attr("x2", config.axis_rotated ? $$.width : xv);
+ xgridLines.select('text')
+ .attr("x", config.axis_rotated ? $$.width : 0)
+ .attr("y", xv);
+ mainBar
+ .attr('transform', null)
+ .attr("d", drawBar);
+ mainLine
+ .attr('transform', null)
+ .attr("d", drawLine);
+ mainArea
+ .attr('transform', null)
+ .attr("d", drawArea);
+ mainCircle
+ .attr('transform', null)
+ .attr("cx", cx)
+ .attr("cy", cy);
+ mainText
+ .attr('transform', null)
+ .attr('x', xForText)
+ .attr('y', yForText)
+ .style('fill-opacity', $$.opacityForText.bind($$));
+ mainRegion
+ .attr('transform', null);
+ mainRegion.select('rect').filter($$.isRegionOnX)
+ .attr("x", $$.regionX.bind($$))
+ .attr("width", $$.regionWidth.bind($$));
+
+ if (config.interaction_enabled) {
+ $$.redrawEventRect();
+ }
+
+ // callback for end of flow
+ done();
+
+ $$.flowing = false;
+ });
+ };
+ };
+
+ c3_chart_fn.selected = function (targetId) {
+ var $$ = this.internal, d3 = $$.d3;
+ return d3.merge(
+ $$.main.selectAll('.' + CLASS.shapes + $$.getTargetSelectorSuffix(targetId)).selectAll('.' + CLASS.shape)
+ .filter(function () { return d3.select(this).classed(CLASS.SELECTED); })
+ .map(function (d) { return d.map(function (d) { var data = d.__data__; return data.data ? data.data : data; }); })
+ );
+ };
+ c3_chart_fn.select = function (ids, indices, resetOther) {
+ var $$ = this.internal, d3 = $$.d3, config = $$.config;
+ if (! config.data_selection_enabled) { return; }
+ $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
+ var shape = d3.select(this), id = d.data ? d.data.id : d.id,
+ toggle = $$.getToggle(this, d).bind($$),
+ isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
+ isTargetIndex = !indices || indices.indexOf(i) >= 0,
+ isSelected = shape.classed(CLASS.SELECTED);
+ // line/area selection not supported yet
+ if (shape.classed(CLASS.line) || shape.classed(CLASS.area)) {
+ return;
+ }
+ if (isTargetId && isTargetIndex) {
+ if (config.data_selection_isselectable(d) && !isSelected) {
+ toggle(true, shape.classed(CLASS.SELECTED, true), d, i);
+ }
+ } else if (isDefined(resetOther) && resetOther) {
+ if (isSelected) {
+ toggle(false, shape.classed(CLASS.SELECTED, false), d, i);
+ }
+ }
+ });
+ };
+ c3_chart_fn.unselect = function (ids, indices) {
+ var $$ = this.internal, d3 = $$.d3, config = $$.config;
+ if (! config.data_selection_enabled) { return; }
+ $$.main.selectAll('.' + CLASS.shapes).selectAll('.' + CLASS.shape).each(function (d, i) {
+ var shape = d3.select(this), id = d.data ? d.data.id : d.id,
+ toggle = $$.getToggle(this, d).bind($$),
+ isTargetId = config.data_selection_grouped || !ids || ids.indexOf(id) >= 0,
+ isTargetIndex = !indices || indices.indexOf(i) >= 0,
+ isSelected = shape.classed(CLASS.SELECTED);
+ // line/area selection not supported yet
+ if (shape.classed(CLASS.line) || shape.classed(CLASS.area)) {
+ return;
+ }
+ if (isTargetId && isTargetIndex) {
+ if (config.data_selection_isselectable(d)) {
+ if (isSelected) {
+ toggle(false, shape.classed(CLASS.SELECTED, false), d, i);
+ }
+ }
+ }
+ });
+ };
+
+ c3_chart_fn.transform = function (type, targetIds) {
+ var $$ = this.internal,
+ options = ['pie', 'donut'].indexOf(type) >= 0 ? {withTransform: true} : null;
+ $$.transformTo(targetIds, type, options);
+ };
+
+ c3_chart_internal_fn.transformTo = function (targetIds, type, optionsForRedraw) {
+ var $$ = this,
+ withTransitionForAxis = !$$.hasArcType(),
+ options = optionsForRedraw || {withTransitionForAxis: withTransitionForAxis};
+ options.withTransitionForTransform = false;
+ $$.transiting = false;
+ $$.setTargetType(targetIds, type);
+ $$.updateTargets($$.data.targets); // this is needed when transforming to arc
+ $$.updateAndRedraw(options);
+ };
+
+ c3_chart_fn.groups = function (groups) {
+ var $$ = this.internal, config = $$.config;
+ if (isUndefined(groups)) { return config.data_groups; }
+ config.data_groups = groups;
+ $$.redraw();
+ return config.data_groups;
+ };
+
+ c3_chart_fn.xgrids = function (grids) {
+ var $$ = this.internal, config = $$.config;
+ if (! grids) { return config.grid_x_lines; }
+ config.grid_x_lines = grids;
+ $$.redrawWithoutRescale();
+ return config.grid_x_lines;
+ };
+ c3_chart_fn.xgrids.add = function (grids) {
+ var $$ = this.internal;
+ return this.xgrids($$.config.grid_x_lines.concat(grids ? grids : []));
+ };
+ c3_chart_fn.xgrids.remove = function (params) { // TODO: multiple
+ var $$ = this.internal;
+ $$.removeGridLines(params, true);
+ };
+
+ c3_chart_fn.ygrids = function (grids) {
+ var $$ = this.internal, config = $$.config;
+ if (! grids) { return config.grid_y_lines; }
+ config.grid_y_lines = grids;
+ $$.redrawWithoutRescale();
+ return config.grid_y_lines;
+ };
+ c3_chart_fn.ygrids.add = function (grids) {
+ var $$ = this.internal;
+ return this.ygrids($$.config.grid_y_lines.concat(grids ? grids : []));
+ };
+ c3_chart_fn.ygrids.remove = function (params) { // TODO: multiple
+ var $$ = this.internal;
+ $$.removeGridLines(params, false);
+ };
+
+ c3_chart_fn.regions = function (regions) {
+ var $$ = this.internal, config = $$.config;
+ if (!regions) { return config.regions; }
+ config.regions = regions;
+ $$.redrawWithoutRescale();
+ return config.regions;
+ };
+ c3_chart_fn.regions.add = function (regions) {
+ var $$ = this.internal, config = $$.config;
+ if (!regions) { return config.regions; }
+ config.regions = config.regions.concat(regions);
+ $$.redrawWithoutRescale();
+ return config.regions;
+ };
+ c3_chart_fn.regions.remove = function (options) {
+ var $$ = this.internal, config = $$.config,
+ duration, classes, regions;
+
+ options = options || {};
+ duration = $$.getOption(options, "duration", config.transition_duration);
+ classes = $$.getOption(options, "classes", [CLASS.region]);
+
+ regions = $$.main.select('.' + CLASS.regions).selectAll(classes.map(function (c) { return '.' + c; }));
+ (duration ? regions.transition().duration(duration) : regions)
+ .style('opacity', 0)
+ .remove();
+
+ config.regions = config.regions.filter(function (region) {
+ var found = false;
+ if (!region['class']) {
+ return true;
+ }
+ region['class'].split(' ').forEach(function (c) {
+ if (classes.indexOf(c) >= 0) { found = true; }
+ });
+ return !found;
+ });
+
+ return config.regions;
+ };
+
+ c3_chart_fn.data = function (targetIds) {
+ var targets = this.internal.data.targets;
+ return typeof targetIds === 'undefined' ? targets : targets.filter(function (t) {
+ return [].concat(targetIds).indexOf(t.id) >= 0;
+ });
+ };
+ c3_chart_fn.data.shown = function (targetIds) {
+ return this.internal.filterTargetsToShow(this.data(targetIds));
+ };
+ c3_chart_fn.data.values = function (targetId) {
+ var targets, values = null;
+ if (targetId) {
+ targets = this.data(targetId);
+ values = targets[0] ? targets[0].values.map(function (d) { return d.value; }) : null;
+ }
+ return values;
+ };
+ c3_chart_fn.data.names = function (names) {
+ this.internal.clearLegendItemTextBoxCache();
+ return this.internal.updateDataAttributes('names', names);
+ };
+ c3_chart_fn.data.colors = function (colors) {
+ return this.internal.updateDataAttributes('colors', colors);
+ };
+ c3_chart_fn.data.axes = function (axes) {
+ return this.internal.updateDataAttributes('axes', axes);
+ };
+
+ c3_chart_fn.category = function (i, category) {
+ var $$ = this.internal, config = $$.config;
+ if (arguments.length > 1) {
+ config.axis_x_categories[i] = category;
+ $$.redraw();
+ }
+ return config.axis_x_categories[i];
+ };
+ c3_chart_fn.categories = function (categories) {
+ var $$ = this.internal, config = $$.config;
+ if (!arguments.length) { return config.axis_x_categories; }
+ config.axis_x_categories = categories;
+ $$.redraw();
+ return config.axis_x_categories;
+ };
+
+ // TODO: fix
+ c3_chart_fn.color = function (id) {
+ var $$ = this.internal;
+ return $$.color(id); // more patterns
+ };
+
+ c3_chart_fn.x = function (x) {
+ var $$ = this.internal;
+ if (arguments.length) {
+ $$.updateTargetX($$.data.targets, x);
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ }
+ return $$.data.xs;
+ };
+ c3_chart_fn.xs = function (xs) {
+ var $$ = this.internal;
+ if (arguments.length) {
+ $$.updateTargetXs($$.data.targets, xs);
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ }
+ return $$.data.xs;
+ };
+
+ c3_chart_fn.axis = function () {};
+ c3_chart_fn.axis.labels = function (labels) {
+ var $$ = this.internal;
+ if (arguments.length) {
+ Object.keys(labels).forEach(function (axisId) {
+ $$.axis.setLabelText(axisId, labels[axisId]);
+ });
+ $$.axis.updateLabels();
+ }
+ // TODO: return some values?
+ };
+ c3_chart_fn.axis.max = function (max) {
+ var $$ = this.internal, config = $$.config;
+ if (arguments.length) {
+ if (typeof max === 'object') {
+ if (isValue(max.x)) { config.axis_x_max = max.x; }
+ if (isValue(max.y)) { config.axis_y_max = max.y; }
+ if (isValue(max.y2)) { config.axis_y2_max = max.y2; }
+ } else {
+ config.axis_y_max = config.axis_y2_max = max;
+ }
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ } else {
+ return {
+ x: config.axis_x_max,
+ y: config.axis_y_max,
+ y2: config.axis_y2_max
+ };
+ }
+ };
+ c3_chart_fn.axis.min = function (min) {
+ var $$ = this.internal, config = $$.config;
+ if (arguments.length) {
+ if (typeof min === 'object') {
+ if (isValue(min.x)) { config.axis_x_min = min.x; }
+ if (isValue(min.y)) { config.axis_y_min = min.y; }
+ if (isValue(min.y2)) { config.axis_y2_min = min.y2; }
+ } else {
+ config.axis_y_min = config.axis_y2_min = min;
+ }
+ $$.redraw({withUpdateOrgXDomain: true, withUpdateXDomain: true});
+ } else {
+ return {
+ x: config.axis_x_min,
+ y: config.axis_y_min,
+ y2: config.axis_y2_min
+ };
+ }
+ };
+ c3_chart_fn.axis.range = function (range) {
+ if (arguments.length) {
+ if (isDefined(range.max)) { this.axis.max(range.max); }
+ if (isDefined(range.min)) { this.axis.min(range.min); }
+ } else {
+ return {
+ max: this.axis.max(),
+ min: this.axis.min()
+ };
+ }
+ };
+
+ c3_chart_fn.legend = function () {};
+ c3_chart_fn.legend.show = function (targetIds) {
+ var $$ = this.internal;
+ $$.showLegend($$.mapToTargetIds(targetIds));
+ $$.updateAndRedraw({withLegend: true});
+ };
+ c3_chart_fn.legend.hide = function (targetIds) {
+ var $$ = this.internal;
+ $$.hideLegend($$.mapToTargetIds(targetIds));
+ $$.updateAndRedraw({withLegend: true});
+ };
+
+ c3_chart_fn.resize = function (size) {
+ var $$ = this.internal, config = $$.config;
+ config.size_width = size ? size.width : null;
+ config.size_height = size ? size.height : null;
+ this.flush();
+ };
+
+ c3_chart_fn.flush = function () {
+ var $$ = this.internal;
+ $$.updateAndRedraw({withLegend: true, withTransition: false, withTransitionForTransform: false});
+ };
+
+ c3_chart_fn.destroy = function () {
+ var $$ = this.internal;
+
+ window.clearInterval($$.intervalForObserveInserted);
+ window.onresize = null;
+
+ $$.selectChart.classed('c3', false).html("");
+
+ // MEMO: this is needed because the reference of some elements will not be released, then memory leak will happen.
+ Object.keys($$).forEach(function (key) {
+ $$[key] = null;
+ });
+
+ return null;
+ };
+
+ c3_chart_fn.tooltip = function () {};
+ c3_chart_fn.tooltip.show = function (args) {
+ var $$ = this.internal, index, mouse;
+
+ // determine mouse position on the chart
+ if (args.mouse) {
+ mouse = args.mouse;
+ }
+
+ // determine focus data
+ if (args.data) {
+ if ($$.isMultipleX()) {
+ // if multiple xs, target point will be determined by mouse
+ mouse = [$$.x(args.data.x), $$.getYScale(args.data.id)(args.data.value)];
+ index = null;
+ } else {
+ // TODO: when tooltip_grouped = false
+ index = isValue(args.data.index) ? args.data.index : $$.getIndexByX(args.data.x);
+ }
+ }
+ else if (typeof args.x !== 'undefined') {
+ index = $$.getIndexByX(args.x);
+ }
+ else if (typeof args.index !== 'undefined') {
+ index = args.index;
+ }
+
+ // emulate mouse events to show
+ $$.dispatchEvent('mouseover', index, mouse);
+ $$.dispatchEvent('mousemove', index, mouse);
+ };
+ c3_chart_fn.tooltip.hide = function () {
+ // TODO: get target data by checking the state of focus
+ this.internal.dispatchEvent('mouseout', 0);
+ };
+
+ // Features:
+ // 1. category axis
+ // 2. ceil values of translate/x/y to int for half pixel antialiasing
+ // 3. multiline tick text
+ var tickTextCharSize;
+ function c3_axis(d3, params) {
+ var scale = d3.scale.linear(), orient = "bottom", innerTickSize = 6, outerTickSize, tickPadding = 3, tickValues = null, tickFormat, tickArguments;
+
+ var tickOffset = 0, tickCulling = true, tickCentered;
+
+ params = params || {};
+ outerTickSize = params.withOuterTick ? 6 : 0;
+
+ function axisX(selection, x) {
+ selection.attr("transform", function (d) {
+ return "translate(" + Math.ceil(x(d) + tickOffset) + ", 0)";
+ });
+ }
+ function axisY(selection, y) {
+ selection.attr("transform", function (d) {
+ return "translate(0," + Math.ceil(y(d)) + ")";
+ });
+ }
+ function scaleExtent(domain) {
+ var start = domain[0], stop = domain[domain.length - 1];
+ return start < stop ? [ start, stop ] : [ stop, start ];
+ }
+ function generateTicks(scale) {
+ var i, domain, ticks = [];
+ if (scale.ticks) {
+ return scale.ticks.apply(scale, tickArguments);
+ }
+ domain = scale.domain();
+ for (i = Math.ceil(domain[0]); i < domain[1]; i++) {
+ ticks.push(i);
+ }
+ if (ticks.length > 0 && ticks[0] > 0) {
+ ticks.unshift(ticks[0] - (ticks[1] - ticks[0]));
+ }
+ return ticks;
+ }
+ function copyScale() {
+ var newScale = scale.copy(), domain;
+ if (params.isCategory) {
+ domain = scale.domain();
+ newScale.domain([domain[0], domain[1] - 1]);
+ }
+ return newScale;
+ }
+ function textFormatted(v) {
+ var formatted = tickFormat ? tickFormat(v) : v;
+ return typeof formatted !== 'undefined' ? formatted : '';
+ }
+ function getSizeFor1Char(tick) {
+ if (tickTextCharSize) {
+ return tickTextCharSize;
+ }
+ var size = {
+ h: 11.5,
+ w: 5.5
+ };
+ tick.select('text').text(textFormatted).each(function (d) {
+ var box = this.getBoundingClientRect(),
+ text = textFormatted(d),
+ h = box.height,
+ w = text ? (box.width / text.length) : undefined;
+ if (h && w) {
+ size.h = h;
+ size.w = w;
+ }
+ }).text('');
+ tickTextCharSize = size;
+ return size;
+ }
+ function transitionise(selection) {
+ return params.withoutTransition ? selection : d3.transition(selection);
+ }
+ function axis(g) {
+ g.each(function () {
+ var g = axis.g = d3.select(this);
+
+ var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = copyScale();
+
+ var ticks = tickValues ? tickValues : generateTicks(scale1),
+ tick = g.selectAll(".tick").data(ticks, scale1),
+ tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", 1e-6),
+ // MEMO: No exit transition. The reason is this transition affects max tick width calculation because old tick will be included in the ticks.
+ tickExit = tick.exit().remove(),
+ tickUpdate = transitionise(tick).style("opacity", 1),
+ tickTransform, tickX, tickY;
+
+ var range = scale.rangeExtent ? scale.rangeExtent() : scaleExtent(scale.range()),
+ path = g.selectAll(".domain").data([ 0 ]),
+ pathUpdate = (path.enter().append("path").attr("class", "domain"), transitionise(path));
+ tickEnter.append("line");
+ tickEnter.append("text");
+
+ var lineEnter = tickEnter.select("line"),
+ lineUpdate = tickUpdate.select("line"),
+ textEnter = tickEnter.select("text"),
+ textUpdate = tickUpdate.select("text");
+
+ if (params.isCategory) {
+ tickOffset = Math.ceil((scale1(1) - scale1(0)) / 2);
+ tickX = tickCentered ? 0 : tickOffset;
+ tickY = tickCentered ? tickOffset : 0;
+ } else {
+ tickOffset = tickX = 0;
+ }
+
+ var text, tspan, sizeFor1Char = getSizeFor1Char(g.select('.tick')), counts = [];
+ var tickLength = Math.max(innerTickSize, 0) + tickPadding,
+ isVertical = orient === 'left' || orient === 'right';
+
+ // this should be called only when category axis
+ function splitTickText(d, maxWidth) {
+ var tickText = textFormatted(d),
+ subtext, spaceIndex, textWidth, splitted = [];
+
+ if (Object.prototype.toString.call(tickText) === "[object Array]") {
+ return tickText;
+ }
+
+ if (!maxWidth || maxWidth <= 0) {
+ maxWidth = isVertical ? 95 : params.isCategory ? (Math.ceil(scale1(ticks[1]) - scale1(ticks[0])) - 12) : 110;
+ }
+
+ function split(splitted, text) {
+ spaceIndex = undefined;
+ for (var i = 1; i < text.length; i++) {
+ if (text.charAt(i) === ' ') {
+ spaceIndex = i;
+ }
+ subtext = text.substr(0, i + 1);
+ textWidth = sizeFor1Char.w * subtext.length;
+ // if text width gets over tick width, split by space index or crrent index
+ if (maxWidth < textWidth) {
+ return split(
+ splitted.concat(text.substr(0, spaceIndex ? spaceIndex : i)),
+ text.slice(spaceIndex ? spaceIndex + 1 : i)
+ );
+ }
+ }
+ return splitted.concat(text);
+ }
+
+ return split(splitted, tickText + "");
+ }
+
+ function tspanDy(d, i) {
+ var dy = sizeFor1Char.h;
+ if (i === 0) {
+ if (orient === 'left' || orient === 'right') {
+ dy = -((counts[d.index] - 1) * (sizeFor1Char.h / 2) - 3);
+ } else {
+ dy = ".71em";
+ }
+ }
+ return dy;
+ }
+
+ function tickSize(d) {
+ var tickPosition = scale(d) + (tickCentered ? 0 : tickOffset);
+ return range[0] < tickPosition && tickPosition < range[1] ? innerTickSize : 0;
+ }
+
+ text = tick.select("text");
+ tspan = text.selectAll('tspan')
+ .data(function (d, i) {
+ var splitted = params.tickMultiline ? splitTickText(d, params.tickWidth) : [].concat(textFormatted(d));
+ counts[i] = splitted.length;
+ return splitted.map(function (s) {
+ return { index: i, splitted: s };
+ });
+ });
+ tspan.enter().append('tspan');
+ tspan.exit().remove();
+ tspan.text(function (d) { return d.splitted; });
+
+ var rotate = params.tickTextRotate;
+
+ function textAnchorForText(rotate) {
+ if (!rotate) {
+ return 'middle';
+ }
+ return rotate > 0 ? "start" : "end";
+ }
+ function textTransform(rotate) {
+ if (!rotate) {
+ return '';
+ }
+ return "rotate(" + rotate + ")";
+ }
+ function dxForText(rotate) {
+ if (!rotate) {
+ return 0;
+ }
+ return 8 * Math.sin(Math.PI * (rotate / 180));
+ }
+ function yForText(rotate) {
+ if (!rotate) {
+ return tickLength;
+ }
+ return 11.5 - 2.5 * (rotate / 15) * (rotate > 0 ? 1 : -1);
+ }
+
+ switch (orient) {
+ case "bottom":
+ {
+ tickTransform = axisX;
+ lineEnter.attr("y2", innerTickSize);
+ textEnter.attr("y", tickLength);
+ lineUpdate.attr("x1", tickX).attr("x2", tickX).attr("y2", tickSize);
+ textUpdate.attr("x", 0).attr("y", yForText(rotate))
+ .style("text-anchor", textAnchorForText(rotate))
+ .attr("transform", textTransform(rotate));
+ tspan.attr('x', 0).attr("dy", tspanDy).attr('dx', dxForText(rotate));
+ pathUpdate.attr("d", "M" + range[0] + "," + outerTickSize + "V0H" + range[1] + "V" + outerTickSize);
+ break;
+ }
+ case "top":
+ {
+ // TODO: rotated tick text
+ tickTransform = axisX;
+ lineEnter.attr("y2", -innerTickSize);
+ textEnter.attr("y", -tickLength);
+ lineUpdate.attr("x2", 0).attr("y2", -innerTickSize);
+ textUpdate.attr("x", 0).attr("y", -tickLength);
+ text.style("text-anchor", "middle");
+ tspan.attr('x', 0).attr("dy", "0em");
+ pathUpdate.attr("d", "M" + range[0] + "," + -outerTickSize + "V0H" + range[1] + "V" + -outerTickSize);
+ break;
+ }
+ case "left":
+ {
+ tickTransform = axisY;
+ lineEnter.attr("x2", -innerTickSize);
+ textEnter.attr("x", -tickLength);
+ lineUpdate.attr("x2", -innerTickSize).attr("y1", tickY).attr("y2", tickY);
+ textUpdate.attr("x", -tickLength).attr("y", tickOffset);
+ text.style("text-anchor", "end");
+ tspan.attr('x', -tickLength).attr("dy", tspanDy);
+ pathUpdate.attr("d", "M" + -outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + -outerTickSize);
+ break;
+ }
+ case "right":
+ {
+ tickTransform = axisY;
+ lineEnter.attr("x2", innerTickSize);
+ textEnter.attr("x", tickLength);
+ lineUpdate.attr("x2", innerTickSize).attr("y2", 0);
+ textUpdate.attr("x", tickLength).attr("y", 0);
+ text.style("text-anchor", "start");
+ tspan.attr('x', tickLength).attr("dy", tspanDy);
+ pathUpdate.attr("d", "M" + outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + outerTickSize);
+ break;
+ }
+ }
+ if (scale1.rangeBand) {
+ var x = scale1, dx = x.rangeBand() / 2;
+ scale0 = scale1 = function (d) {
+ return x(d) + dx;
+ };
+ } else if (scale0.rangeBand) {
+ scale0 = scale1;
+ } else {
+ tickExit.call(tickTransform, scale1);
+ }
+ tickEnter.call(tickTransform, scale0);
+ tickUpdate.call(tickTransform, scale1);
+ });
+ }
+ axis.scale = function (x) {
+ if (!arguments.length) { return scale; }
+ scale = x;
+ return axis;
+ };
+ axis.orient = function (x) {
+ if (!arguments.length) { return orient; }
+ orient = x in {top: 1, right: 1, bottom: 1, left: 1} ? x + "" : "bottom";
+ return axis;
+ };
+ axis.tickFormat = function (format) {
+ if (!arguments.length) { return tickFormat; }
+ tickFormat = format;
+ return axis;
+ };
+ axis.tickCentered = function (isCentered) {
+ if (!arguments.length) { return tickCentered; }
+ tickCentered = isCentered;
+ return axis;
+ };
+ axis.tickOffset = function () {
+ return tickOffset;
+ };
+ axis.tickInterval = function () {
+ var interval, length;
+ if (params.isCategory) {
+ interval = tickOffset * 2;
+ }
+ else {
+ length = axis.g.select('path.domain').node().getTotalLength() - outerTickSize * 2;
+ interval = length / axis.g.selectAll('line').size();
+ }
+ return interval === Infinity ? 0 : interval;
+ };
+ axis.ticks = function () {
+ if (!arguments.length) { return tickArguments; }
+ tickArguments = arguments;
+ return axis;
+ };
+ axis.tickCulling = function (culling) {
+ if (!arguments.length) { return tickCulling; }
+ tickCulling = culling;
+ return axis;
+ };
+ axis.tickValues = function (x) {
+ if (typeof x === 'function') {
+ tickValues = function () {
+ return x(scale.domain());
+ };
+ }
+ else {
+ if (!arguments.length) { return tickValues; }
+ tickValues = x;
+ }
+ return axis;
+ };
+ return axis;
+ }
+
+ c3_chart_internal_fn.isSafari = function () {
+ var ua = window.navigator.userAgent;
+ return ua.indexOf('Safari') >= 0 && ua.indexOf('Chrome') < 0;
+ };
+ c3_chart_internal_fn.isChrome = function () {
+ var ua = window.navigator.userAgent;
+ return ua.indexOf('Chrome') >= 0;
+ };
+
+ // PhantomJS doesn't have support for Function.prototype.bind, which has caused confusion. Use
+ // this polyfill to avoid the confusion.
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind#Polyfill
+
+ if (!Function.prototype.bind) {
+ Function.prototype.bind = function(oThis) {
+ if (typeof this !== 'function') {
+ // closest thing possible to the ECMAScript 5
+ // internal IsCallable function
+ throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
+ }
+
+ var aArgs = Array.prototype.slice.call(arguments, 1),
+ fToBind = this,
+ fNOP = function() {},
+ fBound = function() {
+ return fToBind.apply(this instanceof fNOP ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
+ };
+
+ fNOP.prototype = this.prototype;
+ fBound.prototype = new fNOP();
+
+ return fBound;
+ };
+ }
+
+ if (typeof define === 'function' && define.amd) {
+ define("c3", ["d3"], c3);
+ } else if ('undefined' !== typeof exports && 'undefined' !== typeof module) {
+ module.exports = c3;
+ } else {
+ window.c3 = c3;
+ }
+
+})(window);
diff --git a/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js b/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js
new file mode 100644
index 000000000..34d5513eb
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js
@@ -0,0 +1,5 @@
+!function(){function n(n){return n&&(n.ownerDocument||n.document||n).documentElement}function t(n){return n&&(n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView)}function e(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function r(n){return null===n?0/0:+n}function u(n){return!isNaN(n)}function i(n){return{left:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)<0?r=i+1:u=i}return r},right:function(t,e,r,u){for(arguments.length<3&&(r=0),arguments.length<4&&(u=t.length);u>r;){var i=r+u>>>1;n(t[i],e)>0?u=i:r=i+1}return r}}}function o(n){return n.length}function a(n){for(var t=1;n*t%1;)t*=10;return t}function c(n,t){for(var e in t)Object.defineProperty(n.prototype,e,{value:t[e],enumerable:!1})}function l(){this._=Object.create(null)}function s(n){return(n+="")===pa||n[0]===va?va+n:n}function f(n){return(n+="")[0]===va?n.slice(1):n}function h(n){return s(n)in this._}function g(n){return(n=s(n))in this._&&delete this._[n]}function p(){var n=[];for(var t in this._)n.push(f(t));return n}function v(){var n=0;for(var t in this._)++n;return n}function d(){for(var n in this._)return!1;return!0}function m(){this._=Object.create(null)}function y(n){return n}function M(n,t,e){return function(){var r=e.apply(t,arguments);return r===t?n:r}}function x(n,t){if(t in n)return t;t=t.charAt(0).toUpperCase()+t.slice(1);for(var e=0,r=da.length;r>e;++e){var u=da[e]+t;if(u in n)return u}}function b(){}function _(){}function w(n){function t(){for(var t,r=e,u=-1,i=r.length;++u<i;)(t=r[u].on)&&t.apply(this,arguments);return n}var e=[],r=new l;return t.on=function(t,u){var i,o=r.get(t);return arguments.length<2?o&&o.on:(o&&(o.on=null,e=e.slice(0,i=e.indexOf(o)).concat(e.slice(i+1)),r.remove(t)),u&&e.push(r.set(t,{on:u})),n)},t}function S(){ta.event.preventDefault()}function k(){for(var n,t=ta.event;n=t.sourceEvent;)t=n;return t}function E(n){for(var t=new _,e=0,r=arguments.length;++e<r;)t[arguments[e]]=w(t);return t.of=function(e,r){return function(u){try{var i=u.sourceEvent=ta.event;u.target=n,ta.event=u,t[u.type].apply(e,r)}finally{ta.event=i}}},t}function A(n){return ya(n,_a),n}function N(n){return"function"==typeof n?n:function(){return Ma(n,this)}}function C(n){return"function"==typeof n?n:function(){return xa(n,this)}}function z(n,t){function e(){this.removeAttribute(n)}function r(){this.removeAttributeNS(n.space,n.local)}function u(){this.setAttribute(n,t)}function i(){this.setAttributeNS(n.space,n.local,t)}function o(){var e=t.apply(this,arguments);null==e?this.removeAttribute(n):this.setAttribute(n,e)}function a(){var e=t.apply(this,arguments);null==e?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,e)}return n=ta.ns.qualify(n),null==t?n.local?r:e:"function"==typeof t?n.local?a:o:n.local?i:u}function q(n){return n.trim().replace(/\s+/g," ")}function L(n){return new RegExp("(?:^|\\s+)"+ta.requote(n)+"(?:\\s+|$)","g")}function T(n){return(n+"").trim().split(/^|\s+/)}function R(n,t){function e(){for(var e=-1;++e<u;)n[e](this,t)}function r(){for(var e=-1,r=t.apply(this,arguments);++e<u;)n[e](this,r)}n=T(n).map(D);var u=n.length;return"function"==typeof t?r:e}function D(n){var t=L(n);return function(e,r){if(u=e.classList)return r?u.add(n):u.remove(n);var u=e.getAttribute("class")||"";r?(t.lastIndex=0,t.test(u)||e.setAttribute("class",q(u+" "+n))):e.setAttribute("class",q(u.replace(t," ")))}}function P(n,t,e){function r(){this.style.removeProperty(n)}function u(){this.style.setProperty(n,t,e)}function i(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(n):this.style.setProperty(n,r,e)}return null==t?r:"function"==typeof t?i:u}function U(n,t){function e(){delete this[n]}function r(){this[n]=t}function u(){var e=t.apply(this,arguments);null==e?delete this[n]:this[n]=e}return null==t?e:"function"==typeof t?u:r}function j(n){function t(){var t=this.ownerDocument,e=this.namespaceURI;return e?t.createElementNS(e,n):t.createElement(n)}function e(){return this.ownerDocument.createElementNS(n.space,n.local)}return"function"==typeof n?n:(n=ta.ns.qualify(n)).local?e:t}function F(){var n=this.parentNode;n&&n.removeChild(this)}function H(n){return{__data__:n}}function O(n){return function(){return ba(this,n)}}function I(n){return arguments.length||(n=e),function(t,e){return t&&e?n(t.__data__,e.__data__):!t-!e}}function Y(n,t){for(var e=0,r=n.length;r>e;e++)for(var u,i=n[e],o=0,a=i.length;a>o;o++)(u=i[o])&&t(u,o,e);return n}function Z(n){return ya(n,Sa),n}function V(n){var t,e;return function(r,u,i){var o,a=n[i].update,c=a.length;for(i!=e&&(e=i,t=0),u>=t&&(t=u+1);!(o=a[t])&&++t<c;);return o}}function X(n,t,e){function r(){var t=this[o];t&&(this.removeEventListener(n,t,t.$),delete this[o])}function u(){var u=c(t,ra(arguments));r.call(this),this.addEventListener(n,this[o]=u,u.$=e),u._=t}function i(){var t,e=new RegExp("^__on([^.]+)"+ta.requote(n)+"$");for(var r in this)if(t=r.match(e)){var u=this[r];this.removeEventListener(t[1],u,u.$),delete this[r]}}var o="__on"+n,a=n.indexOf("."),c=$;a>0&&(n=n.slice(0,a));var l=ka.get(n);return l&&(n=l,c=B),a?t?u:r:t?b:i}function $(n,t){return function(e){var r=ta.event;ta.event=e,t[0]=this.__data__;try{n.apply(this,t)}finally{ta.event=r}}}function B(n,t){var e=$(n,t);return function(n){var t=this,r=n.relatedTarget;r&&(r===t||8&r.compareDocumentPosition(t))||e.call(t,n)}}function W(e){var r=".dragsuppress-"+ ++Aa,u="click"+r,i=ta.select(t(e)).on("touchmove"+r,S).on("dragstart"+r,S).on("selectstart"+r,S);if(null==Ea&&(Ea="onselectstart"in e?!1:x(e.style,"userSelect")),Ea){var o=n(e).style,a=o[Ea];o[Ea]="none"}return function(n){if(i.on(r,null),Ea&&(o[Ea]=a),n){var t=function(){i.on(u,null)};i.on(u,function(){S(),t()},!0),setTimeout(t,0)}}}function J(n,e){e.changedTouches&&(e=e.changedTouches[0]);var r=n.ownerSVGElement||n;if(r.createSVGPoint){var u=r.createSVGPoint();if(0>Na){var i=t(n);if(i.scrollX||i.scrollY){r=ta.select("body").append("svg").style({position:"absolute",top:0,left:0,margin:0,padding:0,border:"none"},"important");var o=r[0][0].getScreenCTM();Na=!(o.f||o.e),r.remove()}}return Na?(u.x=e.pageX,u.y=e.pageY):(u.x=e.clientX,u.y=e.clientY),u=u.matrixTransform(n.getScreenCTM().inverse()),[u.x,u.y]}var a=n.getBoundingClientRect();return[e.clientX-a.left-n.clientLeft,e.clientY-a.top-n.clientTop]}function G(){return ta.event.changedTouches[0].identifier}function K(n){return n>0?1:0>n?-1:0}function Q(n,t,e){return(t[0]-n[0])*(e[1]-n[1])-(t[1]-n[1])*(e[0]-n[0])}function nt(n){return n>1?0:-1>n?qa:Math.acos(n)}function tt(n){return n>1?Ra:-1>n?-Ra:Math.asin(n)}function et(n){return((n=Math.exp(n))-1/n)/2}function rt(n){return((n=Math.exp(n))+1/n)/2}function ut(n){return((n=Math.exp(2*n))-1)/(n+1)}function it(n){return(n=Math.sin(n/2))*n}function ot(){}function at(n,t,e){return this instanceof at?(this.h=+n,this.s=+t,void(this.l=+e)):arguments.length<2?n instanceof at?new at(n.h,n.s,n.l):bt(""+n,_t,at):new at(n,t,e)}function ct(n,t,e){function r(n){return n>360?n-=360:0>n&&(n+=360),60>n?i+(o-i)*n/60:180>n?o:240>n?i+(o-i)*(240-n)/60:i}function u(n){return Math.round(255*r(n))}var i,o;return n=isNaN(n)?0:(n%=360)<0?n+360:n,t=isNaN(t)?0:0>t?0:t>1?1:t,e=0>e?0:e>1?1:e,o=.5>=e?e*(1+t):e+t-e*t,i=2*e-o,new mt(u(n+120),u(n),u(n-120))}function lt(n,t,e){return this instanceof lt?(this.h=+n,this.c=+t,void(this.l=+e)):arguments.length<2?n instanceof lt?new lt(n.h,n.c,n.l):n instanceof ft?gt(n.l,n.a,n.b):gt((n=wt((n=ta.rgb(n)).r,n.g,n.b)).l,n.a,n.b):new lt(n,t,e)}function st(n,t,e){return isNaN(n)&&(n=0),isNaN(t)&&(t=0),new ft(e,Math.cos(n*=Da)*t,Math.sin(n)*t)}function ft(n,t,e){return this instanceof ft?(this.l=+n,this.a=+t,void(this.b=+e)):arguments.length<2?n instanceof ft?new ft(n.l,n.a,n.b):n instanceof lt?st(n.h,n.c,n.l):wt((n=mt(n)).r,n.g,n.b):new ft(n,t,e)}function ht(n,t,e){var r=(n+16)/116,u=r+t/500,i=r-e/200;return u=pt(u)*Xa,r=pt(r)*$a,i=pt(i)*Ba,new mt(dt(3.2404542*u-1.5371385*r-.4985314*i),dt(-.969266*u+1.8760108*r+.041556*i),dt(.0556434*u-.2040259*r+1.0572252*i))}function gt(n,t,e){return n>0?new lt(Math.atan2(e,t)*Pa,Math.sqrt(t*t+e*e),n):new lt(0/0,0/0,n)}function pt(n){return n>.206893034?n*n*n:(n-4/29)/7.787037}function vt(n){return n>.008856?Math.pow(n,1/3):7.787037*n+4/29}function dt(n){return Math.round(255*(.00304>=n?12.92*n:1.055*Math.pow(n,1/2.4)-.055))}function mt(n,t,e){return this instanceof mt?(this.r=~~n,this.g=~~t,void(this.b=~~e)):arguments.length<2?n instanceof mt?new mt(n.r,n.g,n.b):bt(""+n,mt,ct):new mt(n,t,e)}function yt(n){return new mt(n>>16,n>>8&255,255&n)}function Mt(n){return yt(n)+""}function xt(n){return 16>n?"0"+Math.max(0,n).toString(16):Math.min(255,n).toString(16)}function bt(n,t,e){var r,u,i,o=0,a=0,c=0;if(r=/([a-z]+)\((.*)\)/i.exec(n))switch(u=r[2].split(","),r[1]){case"hsl":return e(parseFloat(u[0]),parseFloat(u[1])/100,parseFloat(u[2])/100);case"rgb":return t(kt(u[0]),kt(u[1]),kt(u[2]))}return(i=Ga.get(n.toLowerCase()))?t(i.r,i.g,i.b):(null==n||"#"!==n.charAt(0)||isNaN(i=parseInt(n.slice(1),16))||(4===n.length?(o=(3840&i)>>4,o=o>>4|o,a=240&i,a=a>>4|a,c=15&i,c=c<<4|c):7===n.length&&(o=(16711680&i)>>16,a=(65280&i)>>8,c=255&i)),t(o,a,c))}function _t(n,t,e){var r,u,i=Math.min(n/=255,t/=255,e/=255),o=Math.max(n,t,e),a=o-i,c=(o+i)/2;return a?(u=.5>c?a/(o+i):a/(2-o-i),r=n==o?(t-e)/a+(e>t?6:0):t==o?(e-n)/a+2:(n-t)/a+4,r*=60):(r=0/0,u=c>0&&1>c?0:r),new at(r,u,c)}function wt(n,t,e){n=St(n),t=St(t),e=St(e);var r=vt((.4124564*n+.3575761*t+.1804375*e)/Xa),u=vt((.2126729*n+.7151522*t+.072175*e)/$a),i=vt((.0193339*n+.119192*t+.9503041*e)/Ba);return ft(116*u-16,500*(r-u),200*(u-i))}function St(n){return(n/=255)<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4)}function kt(n){var t=parseFloat(n);return"%"===n.charAt(n.length-1)?Math.round(2.55*t):t}function Et(n){return"function"==typeof n?n:function(){return n}}function At(n){return function(t,e,r){return 2===arguments.length&&"function"==typeof e&&(r=e,e=null),Nt(t,e,n,r)}}function Nt(n,t,e,r){function u(){var n,t=c.status;if(!t&&zt(c)||t>=200&&300>t||304===t){try{n=e.call(i,c)}catch(r){return void o.error.call(i,r)}o.load.call(i,n)}else o.error.call(i,c)}var i={},o=ta.dispatch("beforesend","progress","load","error"),a={},c=new XMLHttpRequest,l=null;return!this.XDomainRequest||"withCredentials"in c||!/^(http(s)?:)?\/\//.test(n)||(c=new XDomainRequest),"onload"in c?c.onload=c.onerror=u:c.onreadystatechange=function(){c.readyState>3&&u()},c.onprogress=function(n){var t=ta.event;ta.event=n;try{o.progress.call(i,c)}finally{ta.event=t}},i.header=function(n,t){return n=(n+"").toLowerCase(),arguments.length<2?a[n]:(null==t?delete a[n]:a[n]=t+"",i)},i.mimeType=function(n){return arguments.length?(t=null==n?null:n+"",i):t},i.responseType=function(n){return arguments.length?(l=n,i):l},i.response=function(n){return e=n,i},["get","post"].forEach(function(n){i[n]=function(){return i.send.apply(i,[n].concat(ra(arguments)))}}),i.send=function(e,r,u){if(2===arguments.length&&"function"==typeof r&&(u=r,r=null),c.open(e,n,!0),null==t||"accept"in a||(a.accept=t+",*/*"),c.setRequestHeader)for(var s in a)c.setRequestHeader(s,a[s]);return null!=t&&c.overrideMimeType&&c.overrideMimeType(t),null!=l&&(c.responseType=l),null!=u&&i.on("error",u).on("load",function(n){u(null,n)}),o.beforesend.call(i,c),c.send(null==r?null:r),i},i.abort=function(){return c.abort(),i},ta.rebind(i,o,"on"),null==r?i:i.get(Ct(r))}function Ct(n){return 1===n.length?function(t,e){n(null==t?e:null)}:n}function zt(n){var t=n.responseType;return t&&"text"!==t?n.response:n.responseText}function qt(){var n=Lt(),t=Tt()-n;t>24?(isFinite(t)&&(clearTimeout(tc),tc=setTimeout(qt,t)),nc=0):(nc=1,rc(qt))}function Lt(){var n=Date.now();for(ec=Ka;ec;)n>=ec.t&&(ec.f=ec.c(n-ec.t)),ec=ec.n;return n}function Tt(){for(var n,t=Ka,e=1/0;t;)t.f?t=n?n.n=t.n:Ka=t.n:(t.t<e&&(e=t.t),t=(n=t).n);return Qa=n,e}function Rt(n,t){return t-(n?Math.ceil(Math.log(n)/Math.LN10):1)}function Dt(n,t){var e=Math.pow(10,3*ga(8-t));return{scale:t>8?function(n){return n/e}:function(n){return n*e},symbol:n}}function Pt(n){var t=n.decimal,e=n.thousands,r=n.grouping,u=n.currency,i=r&&e?function(n,t){for(var u=n.length,i=[],o=0,a=r[0],c=0;u>0&&a>0&&(c+a+1>t&&(a=Math.max(1,t-c)),i.push(n.substring(u-=a,u+a)),!((c+=a+1)>t));)a=r[o=(o+1)%r.length];return i.reverse().join(e)}:y;return function(n){var e=ic.exec(n),r=e[1]||" ",o=e[2]||">",a=e[3]||"-",c=e[4]||"",l=e[5],s=+e[6],f=e[7],h=e[8],g=e[9],p=1,v="",d="",m=!1,y=!0;switch(h&&(h=+h.substring(1)),(l||"0"===r&&"="===o)&&(l=r="0",o="="),g){case"n":f=!0,g="g";break;case"%":p=100,d="%",g="f";break;case"p":p=100,d="%",g="r";break;case"b":case"o":case"x":case"X":"#"===c&&(v="0"+g.toLowerCase());case"c":y=!1;case"d":m=!0,h=0;break;case"s":p=-1,g="r"}"$"===c&&(v=u[0],d=u[1]),"r"!=g||h||(g="g"),null!=h&&("g"==g?h=Math.max(1,Math.min(21,h)):("e"==g||"f"==g)&&(h=Math.max(0,Math.min(20,h)))),g=oc.get(g)||Ut;var M=l&&f;return function(n){var e=d;if(m&&n%1)return"";var u=0>n||0===n&&0>1/n?(n=-n,"-"):"-"===a?"":a;if(0>p){var c=ta.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x,b,_=n.lastIndexOf(".");if(0>_){var w=y?n.lastIndexOf("e"):-1;0>w?(x=n,b=""):(x=n.substring(0,w),b=n.substring(w))}else x=n.substring(0,_),b=t+n.substring(_+1);!l&&f&&(x=i(x,1/0));var S=v.length+x.length+b.length+(M?0:u.length),k=s>S?new Array(S=s-S+1).join(r):"";return M&&(x=i(k+x,k.length?s-b.length:1/0)),u+=v,n=x+b,("<"===o?u+n+k:">"===o?k+u+n:"^"===o?k.substring(0,S>>=1)+u+n+k.substring(S):u+(M?n:k+n))+e}}}function Ut(n){return n+""}function jt(){this._=new Date(arguments.length>1?Date.UTC.apply(this,arguments):arguments[0])}function Ft(n,t,e){function r(t){var e=n(t),r=i(e,1);return r-t>t-e?e:r}function u(e){return t(e=n(new cc(e-1)),1),e}function i(n,e){return t(n=new cc(+n),e),n}function o(n,r,i){var o=u(n),a=[];if(i>1)for(;r>o;)e(o)%i||a.push(new Date(+o)),t(o,1);else for(;r>o;)a.push(new Date(+o)),t(o,1);return a}function a(n,t,e){try{cc=jt;var r=new jt;return r._=n,o(r,t,e)}finally{cc=Date}}n.floor=n,n.round=r,n.ceil=u,n.offset=i,n.range=o;var c=n.utc=Ht(n);return c.floor=c,c.round=Ht(r),c.ceil=Ht(u),c.offset=Ht(i),c.range=a,n}function Ht(n){return function(t,e){try{cc=jt;var r=new jt;return r._=t,n(r,e)._}finally{cc=Date}}}function Ot(n){function t(n){function t(t){for(var e,u,i,o=[],a=-1,c=0;++a<r;)37===n.charCodeAt(a)&&(o.push(n.slice(c,a)),null!=(u=sc[e=n.charAt(++a)])&&(e=n.charAt(++a)),(i=N[e])&&(e=i(t,null==u?"e"===e?" ":"0":u)),o.push(e),c=a+1);return o.push(n.slice(c,a)),o.join("")}var r=n.length;return t.parse=function(t){var r={y:1900,m:0,d:1,H:0,M:0,S:0,L:0,Z:null},u=e(r,n,t,0);if(u!=t.length)return null;"p"in r&&(r.H=r.H%12+12*r.p);var i=null!=r.Z&&cc!==jt,o=new(i?jt:cc);return"j"in r?o.setFullYear(r.y,0,r.j):"w"in r&&("W"in r||"U"in r)?(o.setFullYear(r.y,0,1),o.setFullYear(r.y,0,"W"in r?(r.w+6)%7+7*r.W-(o.getDay()+5)%7:r.w+7*r.U-(o.getDay()+6)%7)):o.setFullYear(r.y,r.m,r.d),o.setHours(r.H+(r.Z/100|0),r.M+r.Z%100,r.S,r.L),i?o._:o},t.toString=function(){return n},t}function e(n,t,e,r){for(var u,i,o,a=0,c=t.length,l=e.length;c>a;){if(r>=l)return-1;if(u=t.charCodeAt(a++),37===u){if(o=t.charAt(a++),i=C[o in sc?t.charAt(a++):o],!i||(r=i(n,e,r))<0)return-1}else if(u!=e.charCodeAt(r++))return-1}return r}function r(n,t,e){_.lastIndex=0;var r=_.exec(t.slice(e));return r?(n.w=w.get(r[0].toLowerCase()),e+r[0].length):-1}function u(n,t,e){x.lastIndex=0;var r=x.exec(t.slice(e));return r?(n.w=b.get(r[0].toLowerCase()),e+r[0].length):-1}function i(n,t,e){E.lastIndex=0;var r=E.exec(t.slice(e));return r?(n.m=A.get(r[0].toLowerCase()),e+r[0].length):-1}function o(n,t,e){S.lastIndex=0;var r=S.exec(t.slice(e));return r?(n.m=k.get(r[0].toLowerCase()),e+r[0].length):-1}function a(n,t,r){return e(n,N.c.toString(),t,r)}function c(n,t,r){return e(n,N.x.toString(),t,r)}function l(n,t,r){return e(n,N.X.toString(),t,r)}function s(n,t,e){var r=M.get(t.slice(e,e+=2).toLowerCase());return null==r?-1:(n.p=r,e)}var f=n.dateTime,h=n.date,g=n.time,p=n.periods,v=n.days,d=n.shortDays,m=n.months,y=n.shortMonths;t.utc=function(n){function e(n){try{cc=jt;var t=new cc;return t._=n,r(t)}finally{cc=Date}}var r=t(n);return e.parse=function(n){try{cc=jt;var t=r.parse(n);return t&&t._}finally{cc=Date}},e.toString=r.toString,e},t.multi=t.utc.multi=ae;var M=ta.map(),x=Yt(v),b=Zt(v),_=Yt(d),w=Zt(d),S=Yt(m),k=Zt(m),E=Yt(y),A=Zt(y);p.forEach(function(n,t){M.set(n.toLowerCase(),t)});var N={a:function(n){return d[n.getDay()]},A:function(n){return v[n.getDay()]},b:function(n){return y[n.getMonth()]},B:function(n){return m[n.getMonth()]},c:t(f),d:function(n,t){return It(n.getDate(),t,2)},e:function(n,t){return It(n.getDate(),t,2)},H:function(n,t){return It(n.getHours(),t,2)},I:function(n,t){return It(n.getHours()%12||12,t,2)},j:function(n,t){return It(1+ac.dayOfYear(n),t,3)},L:function(n,t){return It(n.getMilliseconds(),t,3)},m:function(n,t){return It(n.getMonth()+1,t,2)},M:function(n,t){return It(n.getMinutes(),t,2)},p:function(n){return p[+(n.getHours()>=12)]},S:function(n,t){return It(n.getSeconds(),t,2)},U:function(n,t){return It(ac.sundayOfYear(n),t,2)},w:function(n){return n.getDay()},W:function(n,t){return It(ac.mondayOfYear(n),t,2)},x:t(h),X:t(g),y:function(n,t){return It(n.getFullYear()%100,t,2)},Y:function(n,t){return It(n.getFullYear()%1e4,t,4)},Z:ie,"%":function(){return"%"}},C={a:r,A:u,b:i,B:o,c:a,d:Qt,e:Qt,H:te,I:te,j:ne,L:ue,m:Kt,M:ee,p:s,S:re,U:Xt,w:Vt,W:$t,x:c,X:l,y:Wt,Y:Bt,Z:Jt,"%":oe};return t}function It(n,t,e){var r=0>n?"-":"",u=(r?-n:n)+"",i=u.length;return r+(e>i?new Array(e-i+1).join(t)+u:u)}function Yt(n){return new RegExp("^(?:"+n.map(ta.requote).join("|")+")","i")}function Zt(n){for(var t=new l,e=-1,r=n.length;++e<r;)t.set(n[e].toLowerCase(),e);return t}function Vt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+1));return r?(n.w=+r[0],e+r[0].length):-1}function Xt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.U=+r[0],e+r[0].length):-1}function $t(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e));return r?(n.W=+r[0],e+r[0].length):-1}function Bt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+4));return r?(n.y=+r[0],e+r[0].length):-1}function Wt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.y=Gt(+r[0]),e+r[0].length):-1}function Jt(n,t,e){return/^[+-]\d{4}$/.test(t=t.slice(e,e+5))?(n.Z=-t,e+5):-1}function Gt(n){return n+(n>68?1900:2e3)}function Kt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.m=r[0]-1,e+r[0].length):-1}function Qt(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.d=+r[0],e+r[0].length):-1}function ne(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.j=+r[0],e+r[0].length):-1}function te(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.H=+r[0],e+r[0].length):-1}function ee(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.M=+r[0],e+r[0].length):-1}function re(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+2));return r?(n.S=+r[0],e+r[0].length):-1}function ue(n,t,e){fc.lastIndex=0;var r=fc.exec(t.slice(e,e+3));return r?(n.L=+r[0],e+r[0].length):-1}function ie(n){var t=n.getTimezoneOffset(),e=t>0?"-":"+",r=ga(t)/60|0,u=ga(t)%60;return e+It(r,"0",2)+It(u,"0",2)}function oe(n,t,e){hc.lastIndex=0;var r=hc.exec(t.slice(e,e+1));return r?e+r[0].length:-1}function ae(n){for(var t=n.length,e=-1;++e<t;)n[e][0]=this(n[e][0]);return function(t){for(var e=0,r=n[e];!r[1](t);)r=n[++e];return r[0](t)}}function ce(){}function le(n,t,e){var r=e.s=n+t,u=r-n,i=r-u;e.t=n-i+(t-u)}function se(n,t){n&&dc.hasOwnProperty(n.type)&&dc[n.type](n,t)}function fe(n,t,e){var r,u=-1,i=n.length-e;for(t.lineStart();++u<i;)r=n[u],t.point(r[0],r[1],r[2]);t.lineEnd()}function he(n,t){var e=-1,r=n.length;for(t.polygonStart();++e<r;)fe(n[e],t,1);t.polygonEnd()}function ge(){function n(n,t){n*=Da,t=t*Da/2+qa/4;var e=n-r,o=e>=0?1:-1,a=o*e,c=Math.cos(t),l=Math.sin(t),s=i*l,f=u*c+s*Math.cos(a),h=s*o*Math.sin(a);yc.add(Math.atan2(h,f)),r=n,u=c,i=l}var t,e,r,u,i;Mc.point=function(o,a){Mc.point=n,r=(t=o)*Da,u=Math.cos(a=(e=a)*Da/2+qa/4),i=Math.sin(a)},Mc.lineEnd=function(){n(t,e)}}function pe(n){var t=n[0],e=n[1],r=Math.cos(e);return[r*Math.cos(t),r*Math.sin(t),Math.sin(e)]}function ve(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]}function de(n,t){return[n[1]*t[2]-n[2]*t[1],n[2]*t[0]-n[0]*t[2],n[0]*t[1]-n[1]*t[0]]}function me(n,t){n[0]+=t[0],n[1]+=t[1],n[2]+=t[2]}function ye(n,t){return[n[0]*t,n[1]*t,n[2]*t]}function Me(n){var t=Math.sqrt(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]);n[0]/=t,n[1]/=t,n[2]/=t}function xe(n){return[Math.atan2(n[1],n[0]),tt(n[2])]}function be(n,t){return ga(n[0]-t[0])<Ca&&ga(n[1]-t[1])<Ca}function _e(n,t){n*=Da;var e=Math.cos(t*=Da);we(e*Math.cos(n),e*Math.sin(n),Math.sin(t))}function we(n,t,e){++xc,_c+=(n-_c)/xc,wc+=(t-wc)/xc,Sc+=(e-Sc)/xc}function Se(){function n(n,u){n*=Da;var i=Math.cos(u*=Da),o=i*Math.cos(n),a=i*Math.sin(n),c=Math.sin(u),l=Math.atan2(Math.sqrt((l=e*c-r*a)*l+(l=r*o-t*c)*l+(l=t*a-e*o)*l),t*o+e*a+r*c);bc+=l,kc+=l*(t+(t=o)),Ec+=l*(e+(e=a)),Ac+=l*(r+(r=c)),we(t,e,r)}var t,e,r;qc.point=function(u,i){u*=Da;var o=Math.cos(i*=Da);t=o*Math.cos(u),e=o*Math.sin(u),r=Math.sin(i),qc.point=n,we(t,e,r)}}function ke(){qc.point=_e}function Ee(){function n(n,t){n*=Da;var e=Math.cos(t*=Da),o=e*Math.cos(n),a=e*Math.sin(n),c=Math.sin(t),l=u*c-i*a,s=i*o-r*c,f=r*a-u*o,h=Math.sqrt(l*l+s*s+f*f),g=r*o+u*a+i*c,p=h&&-nt(g)/h,v=Math.atan2(h,g);Nc+=p*l,Cc+=p*s,zc+=p*f,bc+=v,kc+=v*(r+(r=o)),Ec+=v*(u+(u=a)),Ac+=v*(i+(i=c)),we(r,u,i)}var t,e,r,u,i;qc.point=function(o,a){t=o,e=a,qc.point=n,o*=Da;var c=Math.cos(a*=Da);r=c*Math.cos(o),u=c*Math.sin(o),i=Math.sin(a),we(r,u,i)},qc.lineEnd=function(){n(t,e),qc.lineEnd=ke,qc.point=_e}}function Ae(n,t){function e(e,r){return e=n(e,r),t(e[0],e[1])}return n.invert&&t.invert&&(e.invert=function(e,r){return e=t.invert(e,r),e&&n.invert(e[0],e[1])}),e}function Ne(){return!0}function Ce(n,t,e,r,u){var i=[],o=[];if(n.forEach(function(n){if(!((t=n.length-1)<=0)){var t,e=n[0],r=n[t];if(be(e,r)){u.lineStart();for(var a=0;t>a;++a)u.point((e=n[a])[0],e[1]);return void u.lineEnd()}var c=new qe(e,n,null,!0),l=new qe(e,null,c,!1);c.o=l,i.push(c),o.push(l),c=new qe(r,n,null,!1),l=new qe(r,null,c,!0),c.o=l,i.push(c),o.push(l)}}),o.sort(t),ze(i),ze(o),i.length){for(var a=0,c=e,l=o.length;l>a;++a)o[a].e=c=!c;for(var s,f,h=i[0];;){for(var g=h,p=!0;g.v;)if((g=g.n)===h)return;s=g.z,u.lineStart();do{if(g.v=g.o.v=!0,g.e){if(p)for(var a=0,l=s.length;l>a;++a)u.point((f=s[a])[0],f[1]);else r(g.x,g.n.x,1,u);g=g.n}else{if(p){s=g.p.z;for(var a=s.length-1;a>=0;--a)u.point((f=s[a])[0],f[1])}else r(g.x,g.p.x,-1,u);g=g.p}g=g.o,s=g.z,p=!p}while(!g.v);u.lineEnd()}}}function ze(n){if(t=n.length){for(var t,e,r=0,u=n[0];++r<t;)u.n=e=n[r],e.p=u,u=e;u.n=e=n[0],e.p=u}}function qe(n,t,e,r){this.x=n,this.z=t,this.o=e,this.e=r,this.v=!1,this.n=this.p=null}function Le(n,t,e,r){return function(u,i){function o(t,e){var r=u(t,e);n(t=r[0],e=r[1])&&i.point(t,e)}function a(n,t){var e=u(n,t);d.point(e[0],e[1])}function c(){y.point=a,d.lineStart()}function l(){y.point=o,d.lineEnd()}function s(n,t){v.push([n,t]);var e=u(n,t);x.point(e[0],e[1])}function f(){x.lineStart(),v=[]}function h(){s(v[0][0],v[0][1]),x.lineEnd();var n,t=x.clean(),e=M.buffer(),r=e.length;if(v.pop(),p.push(v),v=null,r)if(1&t){n=e[0];var u,r=n.length-1,o=-1;if(r>0){for(b||(i.polygonStart(),b=!0),i.lineStart();++o<r;)i.point((u=n[o])[0],u[1]);i.lineEnd()}}else r>1&&2&t&&e.push(e.pop().concat(e.shift())),g.push(e.filter(Te))}var g,p,v,d=t(i),m=u.invert(r[0],r[1]),y={point:o,lineStart:c,lineEnd:l,polygonStart:function(){y.point=s,y.lineStart=f,y.lineEnd=h,g=[],p=[]},polygonEnd:function(){y.point=o,y.lineStart=c,y.lineEnd=l,g=ta.merge(g);var n=Fe(m,p);g.length?(b||(i.polygonStart(),b=!0),Ce(g,De,n,e,i)):n&&(b||(i.polygonStart(),b=!0),i.lineStart(),e(null,null,1,i),i.lineEnd()),b&&(i.polygonEnd(),b=!1),g=p=null},sphere:function(){i.polygonStart(),i.lineStart(),e(null,null,1,i),i.lineEnd(),i.polygonEnd()}},M=Re(),x=t(M),b=!1;return y}}function Te(n){return n.length>1}function Re(){var n,t=[];return{lineStart:function(){t.push(n=[])},point:function(t,e){n.push([t,e])},lineEnd:b,buffer:function(){var e=t;return t=[],n=null,e},rejoin:function(){t.length>1&&t.push(t.pop().concat(t.shift()))}}}function De(n,t){return((n=n.x)[0]<0?n[1]-Ra-Ca:Ra-n[1])-((t=t.x)[0]<0?t[1]-Ra-Ca:Ra-t[1])}function Pe(n){var t,e=0/0,r=0/0,u=0/0;return{lineStart:function(){n.lineStart(),t=1},point:function(i,o){var a=i>0?qa:-qa,c=ga(i-e);ga(c-qa)<Ca?(n.point(e,r=(r+o)/2>0?Ra:-Ra),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),n.point(i,r),t=0):u!==a&&c>=qa&&(ga(e-u)<Ca&&(e-=u*Ca),ga(i-a)<Ca&&(i-=a*Ca),r=Ue(e,r,i,o),n.point(u,r),n.lineEnd(),n.lineStart(),n.point(a,r),t=0),n.point(e=i,r=o),u=a},lineEnd:function(){n.lineEnd(),e=r=0/0},clean:function(){return 2-t}}}function Ue(n,t,e,r){var u,i,o=Math.sin(n-e);return ga(o)>Ca?Math.atan((Math.sin(t)*(i=Math.cos(r))*Math.sin(e)-Math.sin(r)*(u=Math.cos(t))*Math.sin(n))/(u*i*o)):(t+r)/2}function je(n,t,e,r){var u;if(null==n)u=e*Ra,r.point(-qa,u),r.point(0,u),r.point(qa,u),r.point(qa,0),r.point(qa,-u),r.point(0,-u),r.point(-qa,-u),r.point(-qa,0),r.point(-qa,u);else if(ga(n[0]-t[0])>Ca){var i=n[0]<t[0]?qa:-qa;u=e*i/2,r.point(-i,u),r.point(0,u),r.point(i,u)}else r.point(t[0],t[1])}function Fe(n,t){var e=n[0],r=n[1],u=[Math.sin(e),-Math.cos(e),0],i=0,o=0;yc.reset();for(var a=0,c=t.length;c>a;++a){var l=t[a],s=l.length;if(s)for(var f=l[0],h=f[0],g=f[1]/2+qa/4,p=Math.sin(g),v=Math.cos(g),d=1;;){d===s&&(d=0),n=l[d];var m=n[0],y=n[1]/2+qa/4,M=Math.sin(y),x=Math.cos(y),b=m-h,_=b>=0?1:-1,w=_*b,S=w>qa,k=p*M;if(yc.add(Math.atan2(k*_*Math.sin(w),v*x+k*Math.cos(w))),i+=S?b+_*La:b,S^h>=e^m>=e){var E=de(pe(f),pe(n));Me(E);var A=de(u,E);Me(A);var N=(S^b>=0?-1:1)*tt(A[2]);(r>N||r===N&&(E[0]||E[1]))&&(o+=S^b>=0?1:-1)}if(!d++)break;h=m,p=M,v=x,f=n}}return(-Ca>i||Ca>i&&0>yc)^1&o}function He(n){function t(n,t){return Math.cos(n)*Math.cos(t)>i}function e(n){var e,i,c,l,s;return{lineStart:function(){l=c=!1,s=1},point:function(f,h){var g,p=[f,h],v=t(f,h),d=o?v?0:u(f,h):v?u(f+(0>f?qa:-qa),h):0;if(!e&&(l=c=v)&&n.lineStart(),v!==c&&(g=r(e,p),(be(e,g)||be(p,g))&&(p[0]+=Ca,p[1]+=Ca,v=t(p[0],p[1]))),v!==c)s=0,v?(n.lineStart(),g=r(p,e),n.point(g[0],g[1])):(g=r(e,p),n.point(g[0],g[1]),n.lineEnd()),e=g;else if(a&&e&&o^v){var m;d&i||!(m=r(p,e,!0))||(s=0,o?(n.lineStart(),n.point(m[0][0],m[0][1]),n.point(m[1][0],m[1][1]),n.lineEnd()):(n.point(m[1][0],m[1][1]),n.lineEnd(),n.lineStart(),n.point(m[0][0],m[0][1])))}!v||e&&be(e,p)||n.point(p[0],p[1]),e=p,c=v,i=d},lineEnd:function(){c&&n.lineEnd(),e=null},clean:function(){return s|(l&&c)<<1}}}function r(n,t,e){var r=pe(n),u=pe(t),o=[1,0,0],a=de(r,u),c=ve(a,a),l=a[0],s=c-l*l;if(!s)return!e&&n;var f=i*c/s,h=-i*l/s,g=de(o,a),p=ye(o,f),v=ye(a,h);me(p,v);var d=g,m=ve(p,d),y=ve(d,d),M=m*m-y*(ve(p,p)-1);if(!(0>M)){var x=Math.sqrt(M),b=ye(d,(-m-x)/y);if(me(b,p),b=xe(b),!e)return b;var _,w=n[0],S=t[0],k=n[1],E=t[1];w>S&&(_=w,w=S,S=_);var A=S-w,N=ga(A-qa)<Ca,C=N||Ca>A;if(!N&&k>E&&(_=k,k=E,E=_),C?N?k+E>0^b[1]<(ga(b[0]-w)<Ca?k:E):k<=b[1]&&b[1]<=E:A>qa^(w<=b[0]&&b[0]<=S)){var z=ye(d,(-m+x)/y);return me(z,p),[b,xe(z)]}}}function u(t,e){var r=o?n:qa-n,u=0;return-r>t?u|=1:t>r&&(u|=2),-r>e?u|=4:e>r&&(u|=8),u}var i=Math.cos(n),o=i>0,a=ga(i)>Ca,c=gr(n,6*Da);return Le(t,e,c,o?[0,-n]:[-qa,n-qa])}function Oe(n,t,e,r){return function(u){var i,o=u.a,a=u.b,c=o.x,l=o.y,s=a.x,f=a.y,h=0,g=1,p=s-c,v=f-l;if(i=n-c,p||!(i>0)){if(i/=p,0>p){if(h>i)return;g>i&&(g=i)}else if(p>0){if(i>g)return;i>h&&(h=i)}if(i=e-c,p||!(0>i)){if(i/=p,0>p){if(i>g)return;i>h&&(h=i)}else if(p>0){if(h>i)return;g>i&&(g=i)}if(i=t-l,v||!(i>0)){if(i/=v,0>v){if(h>i)return;g>i&&(g=i)}else if(v>0){if(i>g)return;i>h&&(h=i)}if(i=r-l,v||!(0>i)){if(i/=v,0>v){if(i>g)return;i>h&&(h=i)}else if(v>0){if(h>i)return;g>i&&(g=i)}return h>0&&(u.a={x:c+h*p,y:l+h*v}),1>g&&(u.b={x:c+g*p,y:l+g*v}),u}}}}}}function Ie(n,t,e,r){function u(r,u){return ga(r[0]-n)<Ca?u>0?0:3:ga(r[0]-e)<Ca?u>0?2:1:ga(r[1]-t)<Ca?u>0?1:0:u>0?3:2}function i(n,t){return o(n.x,t.x)}function o(n,t){var e=u(n,1),r=u(t,1);return e!==r?e-r:0===e?t[1]-n[1]:1===e?n[0]-t[0]:2===e?n[1]-t[1]:t[0]-n[0]}return function(a){function c(n){for(var t=0,e=d.length,r=n[1],u=0;e>u;++u)for(var i,o=1,a=d[u],c=a.length,l=a[0];c>o;++o)i=a[o],l[1]<=r?i[1]>r&&Q(l,i,n)>0&&++t:i[1]<=r&&Q(l,i,n)<0&&--t,l=i;return 0!==t}function l(i,a,c,l){var s=0,f=0;if(null==i||(s=u(i,c))!==(f=u(a,c))||o(i,a)<0^c>0){do l.point(0===s||3===s?n:e,s>1?r:t);while((s=(s+c+4)%4)!==f)}else l.point(a[0],a[1])}function s(u,i){return u>=n&&e>=u&&i>=t&&r>=i}function f(n,t){s(n,t)&&a.point(n,t)}function h(){C.point=p,d&&d.push(m=[]),S=!0,w=!1,b=_=0/0}function g(){v&&(p(y,M),x&&w&&A.rejoin(),v.push(A.buffer())),C.point=f,w&&a.lineEnd()}function p(n,t){n=Math.max(-Tc,Math.min(Tc,n)),t=Math.max(-Tc,Math.min(Tc,t));var e=s(n,t);if(d&&m.push([n,t]),S)y=n,M=t,x=e,S=!1,e&&(a.lineStart(),a.point(n,t));else if(e&&w)a.point(n,t);else{var r={a:{x:b,y:_},b:{x:n,y:t}};N(r)?(w||(a.lineStart(),a.point(r.a.x,r.a.y)),a.point(r.b.x,r.b.y),e||a.lineEnd(),k=!1):e&&(a.lineStart(),a.point(n,t),k=!1)}b=n,_=t,w=e}var v,d,m,y,M,x,b,_,w,S,k,E=a,A=Re(),N=Oe(n,t,e,r),C={point:f,lineStart:h,lineEnd:g,polygonStart:function(){a=A,v=[],d=[],k=!0},polygonEnd:function(){a=E,v=ta.merge(v);var t=c([n,r]),e=k&&t,u=v.length;(e||u)&&(a.polygonStart(),e&&(a.lineStart(),l(null,null,1,a),a.lineEnd()),u&&Ce(v,i,t,l,a),a.polygonEnd()),v=d=m=null}};return C}}function Ye(n){var t=0,e=qa/3,r=ir(n),u=r(t,e);return u.parallels=function(n){return arguments.length?r(t=n[0]*qa/180,e=n[1]*qa/180):[t/qa*180,e/qa*180]},u}function Ze(n,t){function e(n,t){var e=Math.sqrt(i-2*u*Math.sin(t))/u;return[e*Math.sin(n*=u),o-e*Math.cos(n)]}var r=Math.sin(n),u=(r+Math.sin(t))/2,i=1+r*(2*u-r),o=Math.sqrt(i)/u;return e.invert=function(n,t){var e=o-t;return[Math.atan2(n,e)/u,tt((i-(n*n+e*e)*u*u)/(2*u))]},e}function Ve(){function n(n,t){Dc+=u*n-r*t,r=n,u=t}var t,e,r,u;Hc.point=function(i,o){Hc.point=n,t=r=i,e=u=o},Hc.lineEnd=function(){n(t,e)}}function Xe(n,t){Pc>n&&(Pc=n),n>jc&&(jc=n),Uc>t&&(Uc=t),t>Fc&&(Fc=t)}function $e(){function n(n,t){o.push("M",n,",",t,i)}function t(n,t){o.push("M",n,",",t),a.point=e}function e(n,t){o.push("L",n,",",t)}function r(){a.point=n}function u(){o.push("Z")}var i=Be(4.5),o=[],a={point:n,lineStart:function(){a.point=t},lineEnd:r,polygonStart:function(){a.lineEnd=u},polygonEnd:function(){a.lineEnd=r,a.point=n},pointRadius:function(n){return i=Be(n),a},result:function(){if(o.length){var n=o.join("");return o=[],n}}};return a}function Be(n){return"m0,"+n+"a"+n+","+n+" 0 1,1 0,"+-2*n+"a"+n+","+n+" 0 1,1 0,"+2*n+"z"}function We(n,t){_c+=n,wc+=t,++Sc}function Je(){function n(n,r){var u=n-t,i=r-e,o=Math.sqrt(u*u+i*i);kc+=o*(t+n)/2,Ec+=o*(e+r)/2,Ac+=o,We(t=n,e=r)}var t,e;Ic.point=function(r,u){Ic.point=n,We(t=r,e=u)}}function Ge(){Ic.point=We}function Ke(){function n(n,t){var e=n-r,i=t-u,o=Math.sqrt(e*e+i*i);kc+=o*(r+n)/2,Ec+=o*(u+t)/2,Ac+=o,o=u*n-r*t,Nc+=o*(r+n),Cc+=o*(u+t),zc+=3*o,We(r=n,u=t)}var t,e,r,u;Ic.point=function(i,o){Ic.point=n,We(t=r=i,e=u=o)},Ic.lineEnd=function(){n(t,e)}}function Qe(n){function t(t,e){n.moveTo(t+o,e),n.arc(t,e,o,0,La)}function e(t,e){n.moveTo(t,e),a.point=r}function r(t,e){n.lineTo(t,e)}function u(){a.point=t}function i(){n.closePath()}var o=4.5,a={point:t,lineStart:function(){a.point=e},lineEnd:u,polygonStart:function(){a.lineEnd=i},polygonEnd:function(){a.lineEnd=u,a.point=t},pointRadius:function(n){return o=n,a},result:b};return a}function nr(n){function t(n){return(a?r:e)(n)}function e(t){return rr(t,function(e,r){e=n(e,r),t.point(e[0],e[1])})}function r(t){function e(e,r){e=n(e,r),t.point(e[0],e[1])}function r(){M=0/0,S.point=i,t.lineStart()}function i(e,r){var i=pe([e,r]),o=n(e,r);u(M,x,y,b,_,w,M=o[0],x=o[1],y=e,b=i[0],_=i[1],w=i[2],a,t),t.point(M,x)}function o(){S.point=e,t.lineEnd()}function c(){r(),S.point=l,S.lineEnd=s}function l(n,t){i(f=n,h=t),g=M,p=x,v=b,d=_,m=w,S.point=i}function s(){u(M,x,y,b,_,w,g,p,f,v,d,m,a,t),S.lineEnd=o,o()}var f,h,g,p,v,d,m,y,M,x,b,_,w,S={point:e,lineStart:r,lineEnd:o,polygonStart:function(){t.polygonStart(),S.lineStart=c
+},polygonEnd:function(){t.polygonEnd(),S.lineStart=r}};return S}function u(t,e,r,a,c,l,s,f,h,g,p,v,d,m){var y=s-t,M=f-e,x=y*y+M*M;if(x>4*i&&d--){var b=a+g,_=c+p,w=l+v,S=Math.sqrt(b*b+_*_+w*w),k=Math.asin(w/=S),E=ga(ga(w)-1)<Ca||ga(r-h)<Ca?(r+h)/2:Math.atan2(_,b),A=n(E,k),N=A[0],C=A[1],z=N-t,q=C-e,L=M*z-y*q;(L*L/x>i||ga((y*z+M*q)/x-.5)>.3||o>a*g+c*p+l*v)&&(u(t,e,r,a,c,l,N,C,E,b/=S,_/=S,w,d,m),m.point(N,C),u(N,C,E,b,_,w,s,f,h,g,p,v,d,m))}}var i=.5,o=Math.cos(30*Da),a=16;return t.precision=function(n){return arguments.length?(a=(i=n*n)>0&&16,t):Math.sqrt(i)},t}function tr(n){var t=nr(function(t,e){return n([t*Pa,e*Pa])});return function(n){return or(t(n))}}function er(n){this.stream=n}function rr(n,t){return{point:t,sphere:function(){n.sphere()},lineStart:function(){n.lineStart()},lineEnd:function(){n.lineEnd()},polygonStart:function(){n.polygonStart()},polygonEnd:function(){n.polygonEnd()}}}function ur(n){return ir(function(){return n})()}function ir(n){function t(n){return n=a(n[0]*Da,n[1]*Da),[n[0]*h+c,l-n[1]*h]}function e(n){return n=a.invert((n[0]-c)/h,(l-n[1])/h),n&&[n[0]*Pa,n[1]*Pa]}function r(){a=Ae(o=lr(m,M,x),i);var n=i(v,d);return c=g-n[0]*h,l=p+n[1]*h,u()}function u(){return s&&(s.valid=!1,s=null),t}var i,o,a,c,l,s,f=nr(function(n,t){return n=i(n,t),[n[0]*h+c,l-n[1]*h]}),h=150,g=480,p=250,v=0,d=0,m=0,M=0,x=0,b=Lc,_=y,w=null,S=null;return t.stream=function(n){return s&&(s.valid=!1),s=or(b(o,f(_(n)))),s.valid=!0,s},t.clipAngle=function(n){return arguments.length?(b=null==n?(w=n,Lc):He((w=+n)*Da),u()):w},t.clipExtent=function(n){return arguments.length?(S=n,_=n?Ie(n[0][0],n[0][1],n[1][0],n[1][1]):y,u()):S},t.scale=function(n){return arguments.length?(h=+n,r()):h},t.translate=function(n){return arguments.length?(g=+n[0],p=+n[1],r()):[g,p]},t.center=function(n){return arguments.length?(v=n[0]%360*Da,d=n[1]%360*Da,r()):[v*Pa,d*Pa]},t.rotate=function(n){return arguments.length?(m=n[0]%360*Da,M=n[1]%360*Da,x=n.length>2?n[2]%360*Da:0,r()):[m*Pa,M*Pa,x*Pa]},ta.rebind(t,f,"precision"),function(){return i=n.apply(this,arguments),t.invert=i.invert&&e,r()}}function or(n){return rr(n,function(t,e){n.point(t*Da,e*Da)})}function ar(n,t){return[n,t]}function cr(n,t){return[n>qa?n-La:-qa>n?n+La:n,t]}function lr(n,t,e){return n?t||e?Ae(fr(n),hr(t,e)):fr(n):t||e?hr(t,e):cr}function sr(n){return function(t,e){return t+=n,[t>qa?t-La:-qa>t?t+La:t,e]}}function fr(n){var t=sr(n);return t.invert=sr(-n),t}function hr(n,t){function e(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*r+a*u;return[Math.atan2(c*i-s*o,a*r-l*u),tt(s*i+c*o)]}var r=Math.cos(n),u=Math.sin(n),i=Math.cos(t),o=Math.sin(t);return e.invert=function(n,t){var e=Math.cos(t),a=Math.cos(n)*e,c=Math.sin(n)*e,l=Math.sin(t),s=l*i-c*o;return[Math.atan2(c*i+l*o,a*r+s*u),tt(s*r-a*u)]},e}function gr(n,t){var e=Math.cos(n),r=Math.sin(n);return function(u,i,o,a){var c=o*t;null!=u?(u=pr(e,u),i=pr(e,i),(o>0?i>u:u>i)&&(u+=o*La)):(u=n+o*La,i=n-.5*c);for(var l,s=u;o>0?s>i:i>s;s-=c)a.point((l=xe([e,-r*Math.cos(s),-r*Math.sin(s)]))[0],l[1])}}function pr(n,t){var e=pe(t);e[0]-=n,Me(e);var r=nt(-e[1]);return((-e[2]<0?-r:r)+2*Math.PI-Ca)%(2*Math.PI)}function vr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[n,t]})}}function dr(n,t,e){var r=ta.range(n,t-Ca,e).concat(t);return function(n){return r.map(function(t){return[t,n]})}}function mr(n){return n.source}function yr(n){return n.target}function Mr(n,t,e,r){var u=Math.cos(t),i=Math.sin(t),o=Math.cos(r),a=Math.sin(r),c=u*Math.cos(n),l=u*Math.sin(n),s=o*Math.cos(e),f=o*Math.sin(e),h=2*Math.asin(Math.sqrt(it(r-t)+u*o*it(e-n))),g=1/Math.sin(h),p=h?function(n){var t=Math.sin(n*=h)*g,e=Math.sin(h-n)*g,r=e*c+t*s,u=e*l+t*f,o=e*i+t*a;return[Math.atan2(u,r)*Pa,Math.atan2(o,Math.sqrt(r*r+u*u))*Pa]}:function(){return[n*Pa,t*Pa]};return p.distance=h,p}function xr(){function n(n,u){var i=Math.sin(u*=Da),o=Math.cos(u),a=ga((n*=Da)-t),c=Math.cos(a);Yc+=Math.atan2(Math.sqrt((a=o*Math.sin(a))*a+(a=r*i-e*o*c)*a),e*i+r*o*c),t=n,e=i,r=o}var t,e,r;Zc.point=function(u,i){t=u*Da,e=Math.sin(i*=Da),r=Math.cos(i),Zc.point=n},Zc.lineEnd=function(){Zc.point=Zc.lineEnd=b}}function br(n,t){function e(t,e){var r=Math.cos(t),u=Math.cos(e),i=n(r*u);return[i*u*Math.sin(t),i*Math.sin(e)]}return e.invert=function(n,e){var r=Math.sqrt(n*n+e*e),u=t(r),i=Math.sin(u),o=Math.cos(u);return[Math.atan2(n*i,r*o),Math.asin(r&&e*i/r)]},e}function _r(n,t){function e(n,t){o>0?-Ra+Ca>t&&(t=-Ra+Ca):t>Ra-Ca&&(t=Ra-Ca);var e=o/Math.pow(u(t),i);return[e*Math.sin(i*n),o-e*Math.cos(i*n)]}var r=Math.cos(n),u=function(n){return Math.tan(qa/4+n/2)},i=n===t?Math.sin(n):Math.log(r/Math.cos(t))/Math.log(u(t)/u(n)),o=r*Math.pow(u(n),i)/i;return i?(e.invert=function(n,t){var e=o-t,r=K(i)*Math.sqrt(n*n+e*e);return[Math.atan2(n,e)/i,2*Math.atan(Math.pow(o/r,1/i))-Ra]},e):Sr}function wr(n,t){function e(n,t){var e=i-t;return[e*Math.sin(u*n),i-e*Math.cos(u*n)]}var r=Math.cos(n),u=n===t?Math.sin(n):(r-Math.cos(t))/(t-n),i=r/u+n;return ga(u)<Ca?ar:(e.invert=function(n,t){var e=i-t;return[Math.atan2(n,e)/u,i-K(u)*Math.sqrt(n*n+e*e)]},e)}function Sr(n,t){return[n,Math.log(Math.tan(qa/4+t/2))]}function kr(n){var t,e=ur(n),r=e.scale,u=e.translate,i=e.clipExtent;return e.scale=function(){var n=r.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.translate=function(){var n=u.apply(e,arguments);return n===e?t?e.clipExtent(null):e:n},e.clipExtent=function(n){var o=i.apply(e,arguments);if(o===e){if(t=null==n){var a=qa*r(),c=u();i([[c[0]-a,c[1]-a],[c[0]+a,c[1]+a]])}}else t&&(o=null);return o},e.clipExtent(null)}function Er(n,t){return[Math.log(Math.tan(qa/4+t/2)),-n]}function Ar(n){return n[0]}function Nr(n){return n[1]}function Cr(n){for(var t=n.length,e=[0,1],r=2,u=2;t>u;u++){for(;r>1&&Q(n[e[r-2]],n[e[r-1]],n[u])<=0;)--r;e[r++]=u}return e.slice(0,r)}function zr(n,t){return n[0]-t[0]||n[1]-t[1]}function qr(n,t,e){return(e[0]-t[0])*(n[1]-t[1])<(e[1]-t[1])*(n[0]-t[0])}function Lr(n,t,e,r){var u=n[0],i=e[0],o=t[0]-u,a=r[0]-i,c=n[1],l=e[1],s=t[1]-c,f=r[1]-l,h=(a*(c-l)-f*(u-i))/(f*o-a*s);return[u+h*o,c+h*s]}function Tr(n){var t=n[0],e=n[n.length-1];return!(t[0]-e[0]||t[1]-e[1])}function Rr(){tu(this),this.edge=this.site=this.circle=null}function Dr(n){var t=el.pop()||new Rr;return t.site=n,t}function Pr(n){Xr(n),Qc.remove(n),el.push(n),tu(n)}function Ur(n){var t=n.circle,e=t.x,r=t.cy,u={x:e,y:r},i=n.P,o=n.N,a=[n];Pr(n);for(var c=i;c.circle&&ga(e-c.circle.x)<Ca&&ga(r-c.circle.cy)<Ca;)i=c.P,a.unshift(c),Pr(c),c=i;a.unshift(c),Xr(c);for(var l=o;l.circle&&ga(e-l.circle.x)<Ca&&ga(r-l.circle.cy)<Ca;)o=l.N,a.push(l),Pr(l),l=o;a.push(l),Xr(l);var s,f=a.length;for(s=1;f>s;++s)l=a[s],c=a[s-1],Kr(l.edge,c.site,l.site,u);c=a[0],l=a[f-1],l.edge=Jr(c.site,l.site,null,u),Vr(c),Vr(l)}function jr(n){for(var t,e,r,u,i=n.x,o=n.y,a=Qc._;a;)if(r=Fr(a,o)-i,r>Ca)a=a.L;else{if(u=i-Hr(a,o),!(u>Ca)){r>-Ca?(t=a.P,e=a):u>-Ca?(t=a,e=a.N):t=e=a;break}if(!a.R){t=a;break}a=a.R}var c=Dr(n);if(Qc.insert(t,c),t||e){if(t===e)return Xr(t),e=Dr(t.site),Qc.insert(c,e),c.edge=e.edge=Jr(t.site,c.site),Vr(t),void Vr(e);if(!e)return void(c.edge=Jr(t.site,c.site));Xr(t),Xr(e);var l=t.site,s=l.x,f=l.y,h=n.x-s,g=n.y-f,p=e.site,v=p.x-s,d=p.y-f,m=2*(h*d-g*v),y=h*h+g*g,M=v*v+d*d,x={x:(d*y-g*M)/m+s,y:(h*M-v*y)/m+f};Kr(e.edge,l,p,x),c.edge=Jr(l,n,null,x),e.edge=Jr(n,p,null,x),Vr(t),Vr(e)}}function Fr(n,t){var e=n.site,r=e.x,u=e.y,i=u-t;if(!i)return r;var o=n.P;if(!o)return-1/0;e=o.site;var a=e.x,c=e.y,l=c-t;if(!l)return a;var s=a-r,f=1/i-1/l,h=s/l;return f?(-h+Math.sqrt(h*h-2*f*(s*s/(-2*l)-c+l/2+u-i/2)))/f+r:(r+a)/2}function Hr(n,t){var e=n.N;if(e)return Fr(e,t);var r=n.site;return r.y===t?r.x:1/0}function Or(n){this.site=n,this.edges=[]}function Ir(n){for(var t,e,r,u,i,o,a,c,l,s,f=n[0][0],h=n[1][0],g=n[0][1],p=n[1][1],v=Kc,d=v.length;d--;)if(i=v[d],i&&i.prepare())for(a=i.edges,c=a.length,o=0;c>o;)s=a[o].end(),r=s.x,u=s.y,l=a[++o%c].start(),t=l.x,e=l.y,(ga(r-t)>Ca||ga(u-e)>Ca)&&(a.splice(o,0,new Qr(Gr(i.site,s,ga(r-f)<Ca&&p-u>Ca?{x:f,y:ga(t-f)<Ca?e:p}:ga(u-p)<Ca&&h-r>Ca?{x:ga(e-p)<Ca?t:h,y:p}:ga(r-h)<Ca&&u-g>Ca?{x:h,y:ga(t-h)<Ca?e:g}:ga(u-g)<Ca&&r-f>Ca?{x:ga(e-g)<Ca?t:f,y:g}:null),i.site,null)),++c)}function Yr(n,t){return t.angle-n.angle}function Zr(){tu(this),this.x=this.y=this.arc=this.site=this.cy=null}function Vr(n){var t=n.P,e=n.N;if(t&&e){var r=t.site,u=n.site,i=e.site;if(r!==i){var o=u.x,a=u.y,c=r.x-o,l=r.y-a,s=i.x-o,f=i.y-a,h=2*(c*f-l*s);if(!(h>=-za)){var g=c*c+l*l,p=s*s+f*f,v=(f*g-l*p)/h,d=(c*p-s*g)/h,f=d+a,m=rl.pop()||new Zr;m.arc=n,m.site=u,m.x=v+o,m.y=f+Math.sqrt(v*v+d*d),m.cy=f,n.circle=m;for(var y=null,M=tl._;M;)if(m.y<M.y||m.y===M.y&&m.x<=M.x){if(!M.L){y=M.P;break}M=M.L}else{if(!M.R){y=M;break}M=M.R}tl.insert(y,m),y||(nl=m)}}}}function Xr(n){var t=n.circle;t&&(t.P||(nl=t.N),tl.remove(t),rl.push(t),tu(t),n.circle=null)}function $r(n){for(var t,e=Gc,r=Oe(n[0][0],n[0][1],n[1][0],n[1][1]),u=e.length;u--;)t=e[u],(!Br(t,n)||!r(t)||ga(t.a.x-t.b.x)<Ca&&ga(t.a.y-t.b.y)<Ca)&&(t.a=t.b=null,e.splice(u,1))}function Br(n,t){var e=n.b;if(e)return!0;var r,u,i=n.a,o=t[0][0],a=t[1][0],c=t[0][1],l=t[1][1],s=n.l,f=n.r,h=s.x,g=s.y,p=f.x,v=f.y,d=(h+p)/2,m=(g+v)/2;if(v===g){if(o>d||d>=a)return;if(h>p){if(i){if(i.y>=l)return}else i={x:d,y:c};e={x:d,y:l}}else{if(i){if(i.y<c)return}else i={x:d,y:l};e={x:d,y:c}}}else if(r=(h-p)/(v-g),u=m-r*d,-1>r||r>1)if(h>p){if(i){if(i.y>=l)return}else i={x:(c-u)/r,y:c};e={x:(l-u)/r,y:l}}else{if(i){if(i.y<c)return}else i={x:(l-u)/r,y:l};e={x:(c-u)/r,y:c}}else if(v>g){if(i){if(i.x>=a)return}else i={x:o,y:r*o+u};e={x:a,y:r*a+u}}else{if(i){if(i.x<o)return}else i={x:a,y:r*a+u};e={x:o,y:r*o+u}}return n.a=i,n.b=e,!0}function Wr(n,t){this.l=n,this.r=t,this.a=this.b=null}function Jr(n,t,e,r){var u=new Wr(n,t);return Gc.push(u),e&&Kr(u,n,t,e),r&&Kr(u,t,n,r),Kc[n.i].edges.push(new Qr(u,n,t)),Kc[t.i].edges.push(new Qr(u,t,n)),u}function Gr(n,t,e){var r=new Wr(n,null);return r.a=t,r.b=e,Gc.push(r),r}function Kr(n,t,e,r){n.a||n.b?n.l===e?n.b=r:n.a=r:(n.a=r,n.l=t,n.r=e)}function Qr(n,t,e){var r=n.a,u=n.b;this.edge=n,this.site=t,this.angle=e?Math.atan2(e.y-t.y,e.x-t.x):n.l===t?Math.atan2(u.x-r.x,r.y-u.y):Math.atan2(r.x-u.x,u.y-r.y)}function nu(){this._=null}function tu(n){n.U=n.C=n.L=n.R=n.P=n.N=null}function eu(n,t){var e=t,r=t.R,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.R=r.L,e.R&&(e.R.U=e),r.L=e}function ru(n,t){var e=t,r=t.L,u=e.U;u?u.L===e?u.L=r:u.R=r:n._=r,r.U=u,e.U=r,e.L=r.R,e.L&&(e.L.U=e),r.R=e}function uu(n){for(;n.L;)n=n.L;return n}function iu(n,t){var e,r,u,i=n.sort(ou).pop();for(Gc=[],Kc=new Array(n.length),Qc=new nu,tl=new nu;;)if(u=nl,i&&(!u||i.y<u.y||i.y===u.y&&i.x<u.x))(i.x!==e||i.y!==r)&&(Kc[i.i]=new Or(i),jr(i),e=i.x,r=i.y),i=n.pop();else{if(!u)break;Ur(u.arc)}t&&($r(t),Ir(t));var o={cells:Kc,edges:Gc};return Qc=tl=Gc=Kc=null,o}function ou(n,t){return t.y-n.y||t.x-n.x}function au(n,t,e){return(n.x-e.x)*(t.y-n.y)-(n.x-t.x)*(e.y-n.y)}function cu(n){return n.x}function lu(n){return n.y}function su(){return{leaf:!0,nodes:[],point:null,x:null,y:null}}function fu(n,t,e,r,u,i){if(!n(t,e,r,u,i)){var o=.5*(e+u),a=.5*(r+i),c=t.nodes;c[0]&&fu(n,c[0],e,r,o,a),c[1]&&fu(n,c[1],o,r,u,a),c[2]&&fu(n,c[2],e,a,o,i),c[3]&&fu(n,c[3],o,a,u,i)}}function hu(n,t,e,r,u,i,o){var a,c=1/0;return function l(n,s,f,h,g){if(!(s>i||f>o||r>h||u>g)){if(p=n.point){var p,v=t-n.x,d=e-n.y,m=v*v+d*d;if(c>m){var y=Math.sqrt(c=m);r=t-y,u=e-y,i=t+y,o=e+y,a=p}}for(var M=n.nodes,x=.5*(s+h),b=.5*(f+g),_=t>=x,w=e>=b,S=w<<1|_,k=S+4;k>S;++S)if(n=M[3&S])switch(3&S){case 0:l(n,s,f,x,b);break;case 1:l(n,x,f,h,b);break;case 2:l(n,s,b,x,g);break;case 3:l(n,x,b,h,g)}}}(n,r,u,i,o),a}function gu(n,t){n=ta.rgb(n),t=ta.rgb(t);var e=n.r,r=n.g,u=n.b,i=t.r-e,o=t.g-r,a=t.b-u;return function(n){return"#"+xt(Math.round(e+i*n))+xt(Math.round(r+o*n))+xt(Math.round(u+a*n))}}function pu(n,t){var e,r={},u={};for(e in n)e in t?r[e]=mu(n[e],t[e]):u[e]=n[e];for(e in t)e in n||(u[e]=t[e]);return function(n){for(e in r)u[e]=r[e](n);return u}}function vu(n,t){return n=+n,t=+t,function(e){return n*(1-e)+t*e}}function du(n,t){var e,r,u,i=il.lastIndex=ol.lastIndex=0,o=-1,a=[],c=[];for(n+="",t+="";(e=il.exec(n))&&(r=ol.exec(t));)(u=r.index)>i&&(u=t.slice(i,u),a[o]?a[o]+=u:a[++o]=u),(e=e[0])===(r=r[0])?a[o]?a[o]+=r:a[++o]=r:(a[++o]=null,c.push({i:o,x:vu(e,r)})),i=ol.lastIndex;return i<t.length&&(u=t.slice(i),a[o]?a[o]+=u:a[++o]=u),a.length<2?c[0]?(t=c[0].x,function(n){return t(n)+""}):function(){return t}:(t=c.length,function(n){for(var e,r=0;t>r;++r)a[(e=c[r]).i]=e.x(n);return a.join("")})}function mu(n,t){for(var e,r=ta.interpolators.length;--r>=0&&!(e=ta.interpolators[r](n,t)););return e}function yu(n,t){var e,r=[],u=[],i=n.length,o=t.length,a=Math.min(n.length,t.length);for(e=0;a>e;++e)r.push(mu(n[e],t[e]));for(;i>e;++e)u[e]=n[e];for(;o>e;++e)u[e]=t[e];return function(n){for(e=0;a>e;++e)u[e]=r[e](n);return u}}function Mu(n){return function(t){return 0>=t?0:t>=1?1:n(t)}}function xu(n){return function(t){return 1-n(1-t)}}function bu(n){return function(t){return.5*(.5>t?n(2*t):2-n(2-2*t))}}function _u(n){return n*n}function wu(n){return n*n*n}function Su(n){if(0>=n)return 0;if(n>=1)return 1;var t=n*n,e=t*n;return 4*(.5>n?e:3*(n-t)+e-.75)}function ku(n){return function(t){return Math.pow(t,n)}}function Eu(n){return 1-Math.cos(n*Ra)}function Au(n){return Math.pow(2,10*(n-1))}function Nu(n){return 1-Math.sqrt(1-n*n)}function Cu(n,t){var e;return arguments.length<2&&(t=.45),arguments.length?e=t/La*Math.asin(1/n):(n=1,e=t/4),function(r){return 1+n*Math.pow(2,-10*r)*Math.sin((r-e)*La/t)}}function zu(n){return n||(n=1.70158),function(t){return t*t*((n+1)*t-n)}}function qu(n){return 1/2.75>n?7.5625*n*n:2/2.75>n?7.5625*(n-=1.5/2.75)*n+.75:2.5/2.75>n?7.5625*(n-=2.25/2.75)*n+.9375:7.5625*(n-=2.625/2.75)*n+.984375}function Lu(n,t){n=ta.hcl(n),t=ta.hcl(t);var e=n.h,r=n.c,u=n.l,i=t.h-e,o=t.c-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.c:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return st(e+i*n,r+o*n,u+a*n)+""}}function Tu(n,t){n=ta.hsl(n),t=ta.hsl(t);var e=n.h,r=n.s,u=n.l,i=t.h-e,o=t.s-r,a=t.l-u;return isNaN(o)&&(o=0,r=isNaN(r)?t.s:r),isNaN(i)?(i=0,e=isNaN(e)?t.h:e):i>180?i-=360:-180>i&&(i+=360),function(n){return ct(e+i*n,r+o*n,u+a*n)+""}}function Ru(n,t){n=ta.lab(n),t=ta.lab(t);var e=n.l,r=n.a,u=n.b,i=t.l-e,o=t.a-r,a=t.b-u;return function(n){return ht(e+i*n,r+o*n,u+a*n)+""}}function Du(n,t){return t-=n,function(e){return Math.round(n+t*e)}}function Pu(n){var t=[n.a,n.b],e=[n.c,n.d],r=ju(t),u=Uu(t,e),i=ju(Fu(e,t,-u))||0;t[0]*e[1]<e[0]*t[1]&&(t[0]*=-1,t[1]*=-1,r*=-1,u*=-1),this.rotate=(r?Math.atan2(t[1],t[0]):Math.atan2(-e[0],e[1]))*Pa,this.translate=[n.e,n.f],this.scale=[r,i],this.skew=i?Math.atan2(u,i)*Pa:0}function Uu(n,t){return n[0]*t[0]+n[1]*t[1]}function ju(n){var t=Math.sqrt(Uu(n,n));return t&&(n[0]/=t,n[1]/=t),t}function Fu(n,t,e){return n[0]+=e*t[0],n[1]+=e*t[1],n}function Hu(n,t){var e,r=[],u=[],i=ta.transform(n),o=ta.transform(t),a=i.translate,c=o.translate,l=i.rotate,s=o.rotate,f=i.skew,h=o.skew,g=i.scale,p=o.scale;return a[0]!=c[0]||a[1]!=c[1]?(r.push("translate(",null,",",null,")"),u.push({i:1,x:vu(a[0],c[0])},{i:3,x:vu(a[1],c[1])})):r.push(c[0]||c[1]?"translate("+c+")":""),l!=s?(l-s>180?s+=360:s-l>180&&(l+=360),u.push({i:r.push(r.pop()+"rotate(",null,")")-2,x:vu(l,s)})):s&&r.push(r.pop()+"rotate("+s+")"),f!=h?u.push({i:r.push(r.pop()+"skewX(",null,")")-2,x:vu(f,h)}):h&&r.push(r.pop()+"skewX("+h+")"),g[0]!=p[0]||g[1]!=p[1]?(e=r.push(r.pop()+"scale(",null,",",null,")"),u.push({i:e-4,x:vu(g[0],p[0])},{i:e-2,x:vu(g[1],p[1])})):(1!=p[0]||1!=p[1])&&r.push(r.pop()+"scale("+p+")"),e=u.length,function(n){for(var t,i=-1;++i<e;)r[(t=u[i]).i]=t.x(n);return r.join("")}}function Ou(n,t){return t=(t-=n=+n)||1/t,function(e){return(e-n)/t}}function Iu(n,t){return t=(t-=n=+n)||1/t,function(e){return Math.max(0,Math.min(1,(e-n)/t))}}function Yu(n){for(var t=n.source,e=n.target,r=Vu(t,e),u=[t];t!==r;)t=t.parent,u.push(t);for(var i=u.length;e!==r;)u.splice(i,0,e),e=e.parent;return u}function Zu(n){for(var t=[],e=n.parent;null!=e;)t.push(n),n=e,e=e.parent;return t.push(n),t}function Vu(n,t){if(n===t)return n;for(var e=Zu(n),r=Zu(t),u=e.pop(),i=r.pop(),o=null;u===i;)o=u,u=e.pop(),i=r.pop();return o}function Xu(n){n.fixed|=2}function $u(n){n.fixed&=-7}function Bu(n){n.fixed|=4,n.px=n.x,n.py=n.y}function Wu(n){n.fixed&=-5}function Ju(n,t,e){var r=0,u=0;if(n.charge=0,!n.leaf)for(var i,o=n.nodes,a=o.length,c=-1;++c<a;)i=o[c],null!=i&&(Ju(i,t,e),n.charge+=i.charge,r+=i.charge*i.cx,u+=i.charge*i.cy);if(n.point){n.leaf||(n.point.x+=Math.random()-.5,n.point.y+=Math.random()-.5);var l=t*e[n.point.index];n.charge+=n.pointCharge=l,r+=l*n.point.x,u+=l*n.point.y}n.cx=r/n.charge,n.cy=u/n.charge}function Gu(n,t){return ta.rebind(n,t,"sort","children","value"),n.nodes=n,n.links=ri,n}function Ku(n,t){for(var e=[n];null!=(n=e.pop());)if(t(n),(u=n.children)&&(r=u.length))for(var r,u;--r>=0;)e.push(u[r])}function Qu(n,t){for(var e=[n],r=[];null!=(n=e.pop());)if(r.push(n),(i=n.children)&&(u=i.length))for(var u,i,o=-1;++o<u;)e.push(i[o]);for(;null!=(n=r.pop());)t(n)}function ni(n){return n.children}function ti(n){return n.value}function ei(n,t){return t.value-n.value}function ri(n){return ta.merge(n.map(function(n){return(n.children||[]).map(function(t){return{source:n,target:t}})}))}function ui(n){return n.x}function ii(n){return n.y}function oi(n,t,e){n.y0=t,n.y=e}function ai(n){return ta.range(n.length)}function ci(n){for(var t=-1,e=n[0].length,r=[];++t<e;)r[t]=0;return r}function li(n){for(var t,e=1,r=0,u=n[0][1],i=n.length;i>e;++e)(t=n[e][1])>u&&(r=e,u=t);return r}function si(n){return n.reduce(fi,0)}function fi(n,t){return n+t[1]}function hi(n,t){return gi(n,Math.ceil(Math.log(t.length)/Math.LN2+1))}function gi(n,t){for(var e=-1,r=+n[0],u=(n[1]-r)/t,i=[];++e<=t;)i[e]=u*e+r;return i}function pi(n){return[ta.min(n),ta.max(n)]}function vi(n,t){return n.value-t.value}function di(n,t){var e=n._pack_next;n._pack_next=t,t._pack_prev=n,t._pack_next=e,e._pack_prev=t}function mi(n,t){n._pack_next=t,t._pack_prev=n}function yi(n,t){var e=t.x-n.x,r=t.y-n.y,u=n.r+t.r;return.999*u*u>e*e+r*r}function Mi(n){function t(n){s=Math.min(n.x-n.r,s),f=Math.max(n.x+n.r,f),h=Math.min(n.y-n.r,h),g=Math.max(n.y+n.r,g)}if((e=n.children)&&(l=e.length)){var e,r,u,i,o,a,c,l,s=1/0,f=-1/0,h=1/0,g=-1/0;if(e.forEach(xi),r=e[0],r.x=-r.r,r.y=0,t(r),l>1&&(u=e[1],u.x=u.r,u.y=0,t(u),l>2))for(i=e[2],wi(r,u,i),t(i),di(r,i),r._pack_prev=i,di(i,u),u=r._pack_next,o=3;l>o;o++){wi(r,u,i=e[o]);var p=0,v=1,d=1;for(a=u._pack_next;a!==u;a=a._pack_next,v++)if(yi(a,i)){p=1;break}if(1==p)for(c=r._pack_prev;c!==a._pack_prev&&!yi(c,i);c=c._pack_prev,d++);p?(d>v||v==d&&u.r<r.r?mi(r,u=a):mi(r=c,u),o--):(di(r,i),u=i,t(i))}var m=(s+f)/2,y=(h+g)/2,M=0;for(o=0;l>o;o++)i=e[o],i.x-=m,i.y-=y,M=Math.max(M,i.r+Math.sqrt(i.x*i.x+i.y*i.y));n.r=M,e.forEach(bi)}}function xi(n){n._pack_next=n._pack_prev=n}function bi(n){delete n._pack_next,delete n._pack_prev}function _i(n,t,e,r){var u=n.children;if(n.x=t+=r*n.x,n.y=e+=r*n.y,n.r*=r,u)for(var i=-1,o=u.length;++i<o;)_i(u[i],t,e,r)}function wi(n,t,e){var r=n.r+e.r,u=t.x-n.x,i=t.y-n.y;if(r&&(u||i)){var o=t.r+e.r,a=u*u+i*i;o*=o,r*=r;var c=.5+(r-o)/(2*a),l=Math.sqrt(Math.max(0,2*o*(r+a)-(r-=a)*r-o*o))/(2*a);e.x=n.x+c*u+l*i,e.y=n.y+c*i-l*u}else e.x=n.x+r,e.y=n.y}function Si(n,t){return n.parent==t.parent?1:2}function ki(n){var t=n.children;return t.length?t[0]:n.t}function Ei(n){var t,e=n.children;return(t=e.length)?e[t-1]:n.t}function Ai(n,t,e){var r=e/(t.i-n.i);t.c-=r,t.s+=e,n.c+=r,t.z+=e,t.m+=e}function Ni(n){for(var t,e=0,r=0,u=n.children,i=u.length;--i>=0;)t=u[i],t.z+=e,t.m+=e,e+=t.s+(r+=t.c)}function Ci(n,t,e){return n.a.parent===t.parent?n.a:e}function zi(n){return 1+ta.max(n,function(n){return n.y})}function qi(n){return n.reduce(function(n,t){return n+t.x},0)/n.length}function Li(n){var t=n.children;return t&&t.length?Li(t[0]):n}function Ti(n){var t,e=n.children;return e&&(t=e.length)?Ti(e[t-1]):n}function Ri(n){return{x:n.x,y:n.y,dx:n.dx,dy:n.dy}}function Di(n,t){var e=n.x+t[3],r=n.y+t[0],u=n.dx-t[1]-t[3],i=n.dy-t[0]-t[2];return 0>u&&(e+=u/2,u=0),0>i&&(r+=i/2,i=0),{x:e,y:r,dx:u,dy:i}}function Pi(n){var t=n[0],e=n[n.length-1];return e>t?[t,e]:[e,t]}function Ui(n){return n.rangeExtent?n.rangeExtent():Pi(n.range())}function ji(n,t,e,r){var u=e(n[0],n[1]),i=r(t[0],t[1]);return function(n){return i(u(n))}}function Fi(n,t){var e,r=0,u=n.length-1,i=n[r],o=n[u];return i>o&&(e=r,r=u,u=e,e=i,i=o,o=e),n[r]=t.floor(i),n[u]=t.ceil(o),n}function Hi(n){return n?{floor:function(t){return Math.floor(t/n)*n},ceil:function(t){return Math.ceil(t/n)*n}}:ml}function Oi(n,t,e,r){var u=[],i=[],o=0,a=Math.min(n.length,t.length)-1;for(n[a]<n[0]&&(n=n.slice().reverse(),t=t.slice().reverse());++o<=a;)u.push(e(n[o-1],n[o])),i.push(r(t[o-1],t[o]));return function(t){var e=ta.bisect(n,t,1,a)-1;return i[e](u[e](t))}}function Ii(n,t,e,r){function u(){var u=Math.min(n.length,t.length)>2?Oi:ji,c=r?Iu:Ou;return o=u(n,t,c,e),a=u(t,n,c,mu),i}function i(n){return o(n)}var o,a;return i.invert=function(n){return a(n)},i.domain=function(t){return arguments.length?(n=t.map(Number),u()):n},i.range=function(n){return arguments.length?(t=n,u()):t},i.rangeRound=function(n){return i.range(n).interpolate(Du)},i.clamp=function(n){return arguments.length?(r=n,u()):r},i.interpolate=function(n){return arguments.length?(e=n,u()):e},i.ticks=function(t){return Xi(n,t)},i.tickFormat=function(t,e){return $i(n,t,e)},i.nice=function(t){return Zi(n,t),u()},i.copy=function(){return Ii(n,t,e,r)},u()}function Yi(n,t){return ta.rebind(n,t,"range","rangeRound","interpolate","clamp")}function Zi(n,t){return Fi(n,Hi(Vi(n,t)[2]))}function Vi(n,t){null==t&&(t=10);var e=Pi(n),r=e[1]-e[0],u=Math.pow(10,Math.floor(Math.log(r/t)/Math.LN10)),i=t/r*u;return.15>=i?u*=10:.35>=i?u*=5:.75>=i&&(u*=2),e[0]=Math.ceil(e[0]/u)*u,e[1]=Math.floor(e[1]/u)*u+.5*u,e[2]=u,e}function Xi(n,t){return ta.range.apply(ta,Vi(n,t))}function $i(n,t,e){var r=Vi(n,t);if(e){var u=ic.exec(e);if(u.shift(),"s"===u[8]){var i=ta.formatPrefix(Math.max(ga(r[0]),ga(r[1])));return u[7]||(u[7]="."+Bi(i.scale(r[2]))),u[8]="f",e=ta.format(u.join("")),function(n){return e(i.scale(n))+i.symbol}}u[7]||(u[7]="."+Wi(u[8],r)),e=u.join("")}else e=",."+Bi(r[2])+"f";return ta.format(e)}function Bi(n){return-Math.floor(Math.log(n)/Math.LN10+.01)}function Wi(n,t){var e=Bi(t[2]);return n in yl?Math.abs(e-Bi(Math.max(ga(t[0]),ga(t[1]))))+ +("e"!==n):e-2*("%"===n)}function Ji(n,t,e,r){function u(n){return(e?Math.log(0>n?0:n):-Math.log(n>0?0:-n))/Math.log(t)}function i(n){return e?Math.pow(t,n):-Math.pow(t,-n)}function o(t){return n(u(t))}return o.invert=function(t){return i(n.invert(t))},o.domain=function(t){return arguments.length?(e=t[0]>=0,n.domain((r=t.map(Number)).map(u)),o):r},o.base=function(e){return arguments.length?(t=+e,n.domain(r.map(u)),o):t},o.nice=function(){var t=Fi(r.map(u),e?Math:xl);return n.domain(t),r=t.map(i),o},o.ticks=function(){var n=Pi(r),o=[],a=n[0],c=n[1],l=Math.floor(u(a)),s=Math.ceil(u(c)),f=t%1?2:t;if(isFinite(s-l)){if(e){for(;s>l;l++)for(var h=1;f>h;h++)o.push(i(l)*h);o.push(i(l))}else for(o.push(i(l));l++<s;)for(var h=f-1;h>0;h--)o.push(i(l)*h);for(l=0;o[l]<a;l++);for(s=o.length;o[s-1]>c;s--);o=o.slice(l,s)}return o},o.tickFormat=function(n,t){if(!arguments.length)return Ml;arguments.length<2?t=Ml:"function"!=typeof t&&(t=ta.format(t));var r,a=Math.max(.1,n/o.ticks().length),c=e?(r=1e-12,Math.ceil):(r=-1e-12,Math.floor);return function(n){return n/i(c(u(n)+r))<=a?t(n):""}},o.copy=function(){return Ji(n.copy(),t,e,r)},Yi(o,n)}function Gi(n,t,e){function r(t){return n(u(t))}var u=Ki(t),i=Ki(1/t);return r.invert=function(t){return i(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain((e=t.map(Number)).map(u)),r):e},r.ticks=function(n){return Xi(e,n)},r.tickFormat=function(n,t){return $i(e,n,t)},r.nice=function(n){return r.domain(Zi(e,n))},r.exponent=function(o){return arguments.length?(u=Ki(t=o),i=Ki(1/t),n.domain(e.map(u)),r):t},r.copy=function(){return Gi(n.copy(),t,e)},Yi(r,n)}function Ki(n){return function(t){return 0>t?-Math.pow(-t,n):Math.pow(t,n)}}function Qi(n,t){function e(e){return i[((u.get(e)||("range"===t.t?u.set(e,n.push(e)):0/0))-1)%i.length]}function r(t,e){return ta.range(n.length).map(function(n){return t+e*n})}var u,i,o;return e.domain=function(r){if(!arguments.length)return n;n=[],u=new l;for(var i,o=-1,a=r.length;++o<a;)u.has(i=r[o])||u.set(i,n.push(i));return e[t.t].apply(e,t.a)},e.range=function(n){return arguments.length?(i=n,o=0,t={t:"range",a:arguments},e):i},e.rangePoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=(c+l)/2,0):(l-c)/(n.length-1+a);return i=r(c+s*a/2,s),o=0,t={t:"rangePoints",a:arguments},e},e.rangeRoundPoints=function(u,a){arguments.length<2&&(a=0);var c=u[0],l=u[1],s=n.length<2?(c=l=Math.round((c+l)/2),0):(l-c)/(n.length-1+a)|0;return i=r(c+Math.round(s*a/2+(l-c-(n.length-1+a)*s)/2),s),o=0,t={t:"rangeRoundPoints",a:arguments},e},e.rangeBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=(f-s)/(n.length-a+2*c);return i=r(s+h*c,h),l&&i.reverse(),o=h*(1-a),t={t:"rangeBands",a:arguments},e},e.rangeRoundBands=function(u,a,c){arguments.length<2&&(a=0),arguments.length<3&&(c=a);var l=u[1]<u[0],s=u[l-0],f=u[1-l],h=Math.floor((f-s)/(n.length-a+2*c));return i=r(s+Math.round((f-s-(n.length-a)*h)/2),h),l&&i.reverse(),o=Math.round(h*(1-a)),t={t:"rangeRoundBands",a:arguments},e},e.rangeBand=function(){return o},e.rangeExtent=function(){return Pi(t.a[0])},e.copy=function(){return Qi(n,t)},e.domain(n)}function no(n,t){function i(){var e=0,r=t.length;for(a=[];++e<r;)a[e-1]=ta.quantile(n,e/r);return o}function o(n){return isNaN(n=+n)?void 0:t[ta.bisect(a,n)]}var a;return o.domain=function(t){return arguments.length?(n=t.map(r).filter(u).sort(e),i()):n},o.range=function(n){return arguments.length?(t=n,i()):t},o.quantiles=function(){return a},o.invertExtent=function(e){return e=t.indexOf(e),0>e?[0/0,0/0]:[e>0?a[e-1]:n[0],e<a.length?a[e]:n[n.length-1]]},o.copy=function(){return no(n,t)},i()}function to(n,t,e){function r(t){return e[Math.max(0,Math.min(o,Math.floor(i*(t-n))))]}function u(){return i=e.length/(t-n),o=e.length-1,r}var i,o;return r.domain=function(e){return arguments.length?(n=+e[0],t=+e[e.length-1],u()):[n,t]},r.range=function(n){return arguments.length?(e=n,u()):e},r.invertExtent=function(t){return t=e.indexOf(t),t=0>t?0/0:t/i+n,[t,t+1/i]},r.copy=function(){return to(n,t,e)},u()}function eo(n,t){function e(e){return e>=e?t[ta.bisect(n,e)]:void 0}return e.domain=function(t){return arguments.length?(n=t,e):n},e.range=function(n){return arguments.length?(t=n,e):t},e.invertExtent=function(e){return e=t.indexOf(e),[n[e-1],n[e]]},e.copy=function(){return eo(n,t)},e}function ro(n){function t(n){return+n}return t.invert=t,t.domain=t.range=function(e){return arguments.length?(n=e.map(t),t):n},t.ticks=function(t){return Xi(n,t)},t.tickFormat=function(t,e){return $i(n,t,e)},t.copy=function(){return ro(n)},t}function uo(){return 0}function io(n){return n.innerRadius}function oo(n){return n.outerRadius}function ao(n){return n.startAngle}function co(n){return n.endAngle}function lo(n){return n&&n.padAngle}function so(n,t,e,r){return(n-e)*t-(t-r)*n>0?0:1}function fo(n,t,e,r,u){var i=n[0]-t[0],o=n[1]-t[1],a=(u?r:-r)/Math.sqrt(i*i+o*o),c=a*o,l=-a*i,s=n[0]+c,f=n[1]+l,h=t[0]+c,g=t[1]+l,p=(s+h)/2,v=(f+g)/2,d=h-s,m=g-f,y=d*d+m*m,M=e-r,x=s*g-h*f,b=(0>m?-1:1)*Math.sqrt(M*M*y-x*x),_=(x*m-d*b)/y,w=(-x*d-m*b)/y,S=(x*m+d*b)/y,k=(-x*d+m*b)/y,E=_-p,A=w-v,N=S-p,C=k-v;return E*E+A*A>N*N+C*C&&(_=S,w=k),[[_-c,w-l],[_*e/M,w*e/M]]}function ho(n){function t(t){function o(){l.push("M",i(n(s),a))}for(var c,l=[],s=[],f=-1,h=t.length,g=Et(e),p=Et(r);++f<h;)u.call(this,c=t[f],f)?s.push([+g.call(this,c,f),+p.call(this,c,f)]):s.length&&(o(),s=[]);return s.length&&o(),l.length?l.join(""):null}var e=Ar,r=Nr,u=Ne,i=go,o=i.key,a=.7;return t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t.defined=function(n){return arguments.length?(u=n,t):u},t.interpolate=function(n){return arguments.length?(o="function"==typeof n?i=n:(i=El.get(n)||go).key,t):o},t.tension=function(n){return arguments.length?(a=n,t):a},t}function go(n){return n.join("L")}function po(n){return go(n)+"Z"}function vo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r[0]+(r=n[t])[0])/2,"V",r[1]);return e>1&&u.push("H",r[0]),u.join("")}function mo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("V",(r=n[t])[1],"H",r[0]);return u.join("")}function yo(n){for(var t=0,e=n.length,r=n[0],u=[r[0],",",r[1]];++t<e;)u.push("H",(r=n[t])[0],"V",r[1]);return u.join("")}function Mo(n,t){return n.length<4?go(n):n[1]+_o(n.slice(1,-1),wo(n,t))}function xo(n,t){return n.length<3?go(n):n[0]+_o((n.push(n[0]),n),wo([n[n.length-2]].concat(n,[n[1]]),t))}function bo(n,t){return n.length<3?go(n):n[0]+_o(n,wo(n,t))}function _o(n,t){if(t.length<1||n.length!=t.length&&n.length!=t.length+2)return go(n);var e=n.length!=t.length,r="",u=n[0],i=n[1],o=t[0],a=o,c=1;if(e&&(r+="Q"+(i[0]-2*o[0]/3)+","+(i[1]-2*o[1]/3)+","+i[0]+","+i[1],u=n[1],c=2),t.length>1){a=t[1],i=n[c],c++,r+="C"+(u[0]+o[0])+","+(u[1]+o[1])+","+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1];for(var l=2;l<t.length;l++,c++)i=n[c],a=t[l],r+="S"+(i[0]-a[0])+","+(i[1]-a[1])+","+i[0]+","+i[1]}if(e){var s=n[c];r+="Q"+(i[0]+2*a[0]/3)+","+(i[1]+2*a[1]/3)+","+s[0]+","+s[1]}return r}function wo(n,t){for(var e,r=[],u=(1-t)/2,i=n[0],o=n[1],a=1,c=n.length;++a<c;)e=i,i=o,o=n[a],r.push([u*(o[0]-e[0]),u*(o[1]-e[1])]);return r}function So(n){if(n.length<3)return go(n);var t=1,e=n.length,r=n[0],u=r[0],i=r[1],o=[u,u,u,(r=n[1])[0]],a=[i,i,i,r[1]],c=[u,",",i,"L",No(Cl,o),",",No(Cl,a)];for(n.push(n[e-1]);++t<=e;)r=n[t],o.shift(),o.push(r[0]),a.shift(),a.push(r[1]),Co(c,o,a);return n.pop(),c.push("L",r),c.join("")}function ko(n){if(n.length<4)return go(n);for(var t,e=[],r=-1,u=n.length,i=[0],o=[0];++r<3;)t=n[r],i.push(t[0]),o.push(t[1]);for(e.push(No(Cl,i)+","+No(Cl,o)),--r;++r<u;)t=n[r],i.shift(),i.push(t[0]),o.shift(),o.push(t[1]),Co(e,i,o);return e.join("")}function Eo(n){for(var t,e,r=-1,u=n.length,i=u+4,o=[],a=[];++r<4;)e=n[r%u],o.push(e[0]),a.push(e[1]);for(t=[No(Cl,o),",",No(Cl,a)],--r;++r<i;)e=n[r%u],o.shift(),o.push(e[0]),a.shift(),a.push(e[1]),Co(t,o,a);return t.join("")}function Ao(n,t){var e=n.length-1;if(e)for(var r,u,i=n[0][0],o=n[0][1],a=n[e][0]-i,c=n[e][1]-o,l=-1;++l<=e;)r=n[l],u=l/e,r[0]=t*r[0]+(1-t)*(i+u*a),r[1]=t*r[1]+(1-t)*(o+u*c);return So(n)}function No(n,t){return n[0]*t[0]+n[1]*t[1]+n[2]*t[2]+n[3]*t[3]}function Co(n,t,e){n.push("C",No(Al,t),",",No(Al,e),",",No(Nl,t),",",No(Nl,e),",",No(Cl,t),",",No(Cl,e))}function zo(n,t){return(t[1]-n[1])/(t[0]-n[0])}function qo(n){for(var t=0,e=n.length-1,r=[],u=n[0],i=n[1],o=r[0]=zo(u,i);++t<e;)r[t]=(o+(o=zo(u=i,i=n[t+1])))/2;return r[t]=o,r}function Lo(n){for(var t,e,r,u,i=[],o=qo(n),a=-1,c=n.length-1;++a<c;)t=zo(n[a],n[a+1]),ga(t)<Ca?o[a]=o[a+1]=0:(e=o[a]/t,r=o[a+1]/t,u=e*e+r*r,u>9&&(u=3*t/Math.sqrt(u),o[a]=u*e,o[a+1]=u*r));for(a=-1;++a<=c;)u=(n[Math.min(c,a+1)][0]-n[Math.max(0,a-1)][0])/(6*(1+o[a]*o[a])),i.push([u||0,o[a]*u||0]);return i}function To(n){return n.length<3?go(n):n[0]+_o(n,Lo(n))}function Ro(n){for(var t,e,r,u=-1,i=n.length;++u<i;)t=n[u],e=t[0],r=t[1]-Ra,t[0]=e*Math.cos(r),t[1]=e*Math.sin(r);return n}function Do(n){function t(t){function c(){v.push("M",a(n(m),f),s,l(n(d.reverse()),f),"Z")}for(var h,g,p,v=[],d=[],m=[],y=-1,M=t.length,x=Et(e),b=Et(u),_=e===r?function(){return g}:Et(r),w=u===i?function(){return p}:Et(i);++y<M;)o.call(this,h=t[y],y)?(d.push([g=+x.call(this,h,y),p=+b.call(this,h,y)]),m.push([+_.call(this,h,y),+w.call(this,h,y)])):d.length&&(c(),d=[],m=[]);return d.length&&c(),v.length?v.join(""):null}var e=Ar,r=Ar,u=0,i=Nr,o=Ne,a=go,c=a.key,l=a,s="L",f=.7;return t.x=function(n){return arguments.length?(e=r=n,t):r},t.x0=function(n){return arguments.length?(e=n,t):e},t.x1=function(n){return arguments.length?(r=n,t):r
+},t.y=function(n){return arguments.length?(u=i=n,t):i},t.y0=function(n){return arguments.length?(u=n,t):u},t.y1=function(n){return arguments.length?(i=n,t):i},t.defined=function(n){return arguments.length?(o=n,t):o},t.interpolate=function(n){return arguments.length?(c="function"==typeof n?a=n:(a=El.get(n)||go).key,l=a.reverse||a,s=a.closed?"M":"L",t):c},t.tension=function(n){return arguments.length?(f=n,t):f},t}function Po(n){return n.radius}function Uo(n){return[n.x,n.y]}function jo(n){return function(){var t=n.apply(this,arguments),e=t[0],r=t[1]-Ra;return[e*Math.cos(r),e*Math.sin(r)]}}function Fo(){return 64}function Ho(){return"circle"}function Oo(n){var t=Math.sqrt(n/qa);return"M0,"+t+"A"+t+","+t+" 0 1,1 0,"+-t+"A"+t+","+t+" 0 1,1 0,"+t+"Z"}function Io(n){return function(){var t,e;(t=this[n])&&(e=t[t.active])&&(--t.count?delete t[t.active]:delete this[n],t.active+=.5,e.event&&e.event.interrupt.call(this,this.__data__,e.index))}}function Yo(n,t,e){return ya(n,Pl),n.namespace=t,n.id=e,n}function Zo(n,t,e,r){var u=n.id,i=n.namespace;return Y(n,"function"==typeof e?function(n,o,a){n[i][u].tween.set(t,r(e.call(n,n.__data__,o,a)))}:(e=r(e),function(n){n[i][u].tween.set(t,e)}))}function Vo(n){return null==n&&(n=""),function(){this.textContent=n}}function Xo(n){return null==n?"__transition__":"__transition_"+n+"__"}function $o(n,t,e,r,u){var i=n[e]||(n[e]={active:0,count:0}),o=i[r];if(!o){var a=u.time;o=i[r]={tween:new l,time:a,delay:u.delay,duration:u.duration,ease:u.ease,index:t},u=null,++i.count,ta.timer(function(u){function c(e){if(i.active>r)return s();var u=i[i.active];u&&(--i.count,delete i[i.active],u.event&&u.event.interrupt.call(n,n.__data__,u.index)),i.active=r,o.event&&o.event.start.call(n,n.__data__,t),o.tween.forEach(function(e,r){(r=r.call(n,n.__data__,t))&&v.push(r)}),h=o.ease,f=o.duration,ta.timer(function(){return p.c=l(e||1)?Ne:l,1},0,a)}function l(e){if(i.active!==r)return 1;for(var u=e/f,a=h(u),c=v.length;c>0;)v[--c].call(n,a);return u>=1?(o.event&&o.event.end.call(n,n.__data__,t),s()):void 0}function s(){return--i.count?delete i[r]:delete n[e],1}var f,h,g=o.delay,p=ec,v=[];return p.t=g+a,u>=g?c(u-g):void(p.c=c)},0,a)}}function Bo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate("+(isFinite(r)?r:e(n))+",0)"})}function Wo(n,t,e){n.attr("transform",function(n){var r=t(n);return"translate(0,"+(isFinite(r)?r:e(n))+")"})}function Jo(n){return n.toISOString()}function Go(n,t,e){function r(t){return n(t)}function u(n,e){var r=n[1]-n[0],u=r/e,i=ta.bisect(Vl,u);return i==Vl.length?[t.year,Vi(n.map(function(n){return n/31536e6}),e)[2]]:i?t[u/Vl[i-1]<Vl[i]/u?i-1:i]:[Bl,Vi(n,e)[2]]}return r.invert=function(t){return Ko(n.invert(t))},r.domain=function(t){return arguments.length?(n.domain(t),r):n.domain().map(Ko)},r.nice=function(n,t){function e(e){return!isNaN(e)&&!n.range(e,Ko(+e+1),t).length}var i=r.domain(),o=Pi(i),a=null==n?u(o,10):"number"==typeof n&&u(o,n);return a&&(n=a[0],t=a[1]),r.domain(Fi(i,t>1?{floor:function(t){for(;e(t=n.floor(t));)t=Ko(t-1);return t},ceil:function(t){for(;e(t=n.ceil(t));)t=Ko(+t+1);return t}}:n))},r.ticks=function(n,t){var e=Pi(r.domain()),i=null==n?u(e,10):"number"==typeof n?u(e,n):!n.range&&[{range:n},t];return i&&(n=i[0],t=i[1]),n.range(e[0],Ko(+e[1]+1),1>t?1:t)},r.tickFormat=function(){return e},r.copy=function(){return Go(n.copy(),t,e)},Yi(r,n)}function Ko(n){return new Date(n)}function Qo(n){return JSON.parse(n.responseText)}function na(n){var t=ua.createRange();return t.selectNode(ua.body),t.createContextualFragment(n.responseText)}var ta={version:"3.5.5"},ea=[].slice,ra=function(n){return ea.call(n)},ua=this.document;if(ua)try{ra(ua.documentElement.childNodes)[0].nodeType}catch(ia){ra=function(n){for(var t=n.length,e=new Array(t);t--;)e[t]=n[t];return e}}if(Date.now||(Date.now=function(){return+new Date}),ua)try{ua.createElement("DIV").style.setProperty("opacity",0,"")}catch(oa){var aa=this.Element.prototype,ca=aa.setAttribute,la=aa.setAttributeNS,sa=this.CSSStyleDeclaration.prototype,fa=sa.setProperty;aa.setAttribute=function(n,t){ca.call(this,n,t+"")},aa.setAttributeNS=function(n,t,e){la.call(this,n,t,e+"")},sa.setProperty=function(n,t,e){fa.call(this,n,t+"",e)}}ta.ascending=e,ta.descending=function(n,t){return n>t?-1:t>n?1:t>=n?0:0/0},ta.min=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&e>r&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&e>r&&(e=r)}return e},ta.max=function(n,t){var e,r,u=-1,i=n.length;if(1===arguments.length){for(;++u<i;)if(null!=(r=n[u])&&r>=r){e=r;break}for(;++u<i;)null!=(r=n[u])&&r>e&&(e=r)}else{for(;++u<i;)if(null!=(r=t.call(n,n[u],u))&&r>=r){e=r;break}for(;++u<i;)null!=(r=t.call(n,n[u],u))&&r>e&&(e=r)}return e},ta.extent=function(n,t){var e,r,u,i=-1,o=n.length;if(1===arguments.length){for(;++i<o;)if(null!=(r=n[i])&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=n[i])&&(e>r&&(e=r),r>u&&(u=r))}else{for(;++i<o;)if(null!=(r=t.call(n,n[i],i))&&r>=r){e=u=r;break}for(;++i<o;)null!=(r=t.call(n,n[i],i))&&(e>r&&(e=r),r>u&&(u=r))}return[e,u]},ta.sum=function(n,t){var e,r=0,i=n.length,o=-1;if(1===arguments.length)for(;++o<i;)u(e=+n[o])&&(r+=e);else for(;++o<i;)u(e=+t.call(n,n[o],o))&&(r+=e);return r},ta.mean=function(n,t){var e,i=0,o=n.length,a=-1,c=o;if(1===arguments.length)for(;++a<o;)u(e=r(n[a]))?i+=e:--c;else for(;++a<o;)u(e=r(t.call(n,n[a],a)))?i+=e:--c;return c?i/c:void 0},ta.quantile=function(n,t){var e=(n.length-1)*t+1,r=Math.floor(e),u=+n[r-1],i=e-r;return i?u+i*(n[r]-u):u},ta.median=function(n,t){var i,o=[],a=n.length,c=-1;if(1===arguments.length)for(;++c<a;)u(i=r(n[c]))&&o.push(i);else for(;++c<a;)u(i=r(t.call(n,n[c],c)))&&o.push(i);return o.length?ta.quantile(o.sort(e),.5):void 0},ta.variance=function(n,t){var e,i,o=n.length,a=0,c=0,l=-1,s=0;if(1===arguments.length)for(;++l<o;)u(e=r(n[l]))&&(i=e-a,a+=i/++s,c+=i*(e-a));else for(;++l<o;)u(e=r(t.call(n,n[l],l)))&&(i=e-a,a+=i/++s,c+=i*(e-a));return s>1?c/(s-1):void 0},ta.deviation=function(){var n=ta.variance.apply(this,arguments);return n?Math.sqrt(n):n};var ha=i(e);ta.bisectLeft=ha.left,ta.bisect=ta.bisectRight=ha.right,ta.bisector=function(n){return i(1===n.length?function(t,r){return e(n(t),r)}:n)},ta.shuffle=function(n,t,e){(i=arguments.length)<3&&(e=n.length,2>i&&(t=0));for(var r,u,i=e-t;i;)u=Math.random()*i--|0,r=n[i+t],n[i+t]=n[u+t],n[u+t]=r;return n},ta.permute=function(n,t){for(var e=t.length,r=new Array(e);e--;)r[e]=n[t[e]];return r},ta.pairs=function(n){for(var t,e=0,r=n.length-1,u=n[0],i=new Array(0>r?0:r);r>e;)i[e]=[t=u,u=n[++e]];return i},ta.zip=function(){if(!(r=arguments.length))return[];for(var n=-1,t=ta.min(arguments,o),e=new Array(t);++n<t;)for(var r,u=-1,i=e[n]=new Array(r);++u<r;)i[u]=arguments[u][n];return e},ta.transpose=function(n){return ta.zip.apply(ta,n)},ta.keys=function(n){var t=[];for(var e in n)t.push(e);return t},ta.values=function(n){var t=[];for(var e in n)t.push(n[e]);return t},ta.entries=function(n){var t=[];for(var e in n)t.push({key:e,value:n[e]});return t},ta.merge=function(n){for(var t,e,r,u=n.length,i=-1,o=0;++i<u;)o+=n[i].length;for(e=new Array(o);--u>=0;)for(r=n[u],t=r.length;--t>=0;)e[--o]=r[t];return e};var ga=Math.abs;ta.range=function(n,t,e){if(arguments.length<3&&(e=1,arguments.length<2&&(t=n,n=0)),(t-n)/e===1/0)throw new Error("infinite range");var r,u=[],i=a(ga(e)),o=-1;if(n*=i,t*=i,e*=i,0>e)for(;(r=n+e*++o)>t;)u.push(r/i);else for(;(r=n+e*++o)<t;)u.push(r/i);return u},ta.map=function(n,t){var e=new l;if(n instanceof l)n.forEach(function(n,t){e.set(n,t)});else if(Array.isArray(n)){var r,u=-1,i=n.length;if(1===arguments.length)for(;++u<i;)e.set(u,n[u]);else for(;++u<i;)e.set(t.call(n,r=n[u],u),r)}else for(var o in n)e.set(o,n[o]);return e};var pa="__proto__",va="\x00";c(l,{has:h,get:function(n){return this._[s(n)]},set:function(n,t){return this._[s(n)]=t},remove:g,keys:p,values:function(){var n=[];for(var t in this._)n.push(this._[t]);return n},entries:function(){var n=[];for(var t in this._)n.push({key:f(t),value:this._[t]});return n},size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t),this._[t])}}),ta.nest=function(){function n(t,o,a){if(a>=i.length)return r?r.call(u,o):e?o.sort(e):o;for(var c,s,f,h,g=-1,p=o.length,v=i[a++],d=new l;++g<p;)(h=d.get(c=v(s=o[g])))?h.push(s):d.set(c,[s]);return t?(s=t(),f=function(e,r){s.set(e,n(t,r,a))}):(s={},f=function(e,r){s[e]=n(t,r,a)}),d.forEach(f),s}function t(n,e){if(e>=i.length)return n;var r=[],u=o[e++];return n.forEach(function(n,u){r.push({key:n,values:t(u,e)})}),u?r.sort(function(n,t){return u(n.key,t.key)}):r}var e,r,u={},i=[],o=[];return u.map=function(t,e){return n(e,t,0)},u.entries=function(e){return t(n(ta.map,e,0),0)},u.key=function(n){return i.push(n),u},u.sortKeys=function(n){return o[i.length-1]=n,u},u.sortValues=function(n){return e=n,u},u.rollup=function(n){return r=n,u},u},ta.set=function(n){var t=new m;if(n)for(var e=0,r=n.length;r>e;++e)t.add(n[e]);return t},c(m,{has:h,add:function(n){return this._[s(n+="")]=!0,n},remove:g,values:p,size:v,empty:d,forEach:function(n){for(var t in this._)n.call(this,f(t))}}),ta.behavior={},ta.rebind=function(n,t){for(var e,r=1,u=arguments.length;++r<u;)n[e=arguments[r]]=M(n,t,t[e]);return n};var da=["webkit","ms","moz","Moz","o","O"];ta.dispatch=function(){for(var n=new _,t=-1,e=arguments.length;++t<e;)n[arguments[t]]=w(n);return n},_.prototype.on=function(n,t){var e=n.indexOf("."),r="";if(e>=0&&(r=n.slice(e+1),n=n.slice(0,e)),n)return arguments.length<2?this[n].on(r):this[n].on(r,t);if(2===arguments.length){if(null==t)for(n in this)this.hasOwnProperty(n)&&this[n].on(r,null);return this}},ta.event=null,ta.requote=function(n){return n.replace(ma,"\\$&")};var ma=/[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g,ya={}.__proto__?function(n,t){n.__proto__=t}:function(n,t){for(var e in t)n[e]=t[e]},Ma=function(n,t){return t.querySelector(n)},xa=function(n,t){return t.querySelectorAll(n)},ba=function(n,t){var e=n.matches||n[x(n,"matchesSelector")];return(ba=function(n,t){return e.call(n,t)})(n,t)};"function"==typeof Sizzle&&(Ma=function(n,t){return Sizzle(n,t)[0]||null},xa=Sizzle,ba=Sizzle.matchesSelector),ta.selection=function(){return ta.select(ua.documentElement)};var _a=ta.selection.prototype=[];_a.select=function(n){var t,e,r,u,i=[];n=N(n);for(var o=-1,a=this.length;++o<a;){i.push(t=[]),t.parentNode=(r=this[o]).parentNode;for(var c=-1,l=r.length;++c<l;)(u=r[c])?(t.push(e=n.call(u,u.__data__,c,o)),e&&"__data__"in u&&(e.__data__=u.__data__)):t.push(null)}return A(i)},_a.selectAll=function(n){var t,e,r=[];n=C(n);for(var u=-1,i=this.length;++u<i;)for(var o=this[u],a=-1,c=o.length;++a<c;)(e=o[a])&&(r.push(t=ra(n.call(e,e.__data__,a,u))),t.parentNode=e);return A(r)};var wa={svg:"http://www.w3.org/2000/svg",xhtml:"http://www.w3.org/1999/xhtml",xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};ta.ns={prefix:wa,qualify:function(n){var t=n.indexOf(":"),e=n;return t>=0&&(e=n.slice(0,t),n=n.slice(t+1)),wa.hasOwnProperty(e)?{space:wa[e],local:n}:n}},_a.attr=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node();return n=ta.ns.qualify(n),n.local?e.getAttributeNS(n.space,n.local):e.getAttribute(n)}for(t in n)this.each(z(t,n[t]));return this}return this.each(z(n,t))},_a.classed=function(n,t){if(arguments.length<2){if("string"==typeof n){var e=this.node(),r=(n=T(n)).length,u=-1;if(t=e.classList){for(;++u<r;)if(!t.contains(n[u]))return!1}else for(t=e.getAttribute("class");++u<r;)if(!L(n[u]).test(t))return!1;return!0}for(t in n)this.each(R(t,n[t]));return this}return this.each(R(n,t))},_a.style=function(n,e,r){var u=arguments.length;if(3>u){if("string"!=typeof n){2>u&&(e="");for(r in n)this.each(P(r,n[r],e));return this}if(2>u){var i=this.node();return t(i).getComputedStyle(i,null).getPropertyValue(n)}r=""}return this.each(P(n,e,r))},_a.property=function(n,t){if(arguments.length<2){if("string"==typeof n)return this.node()[n];for(t in n)this.each(U(t,n[t]));return this}return this.each(U(n,t))},_a.text=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.textContent=null==t?"":t}:null==n?function(){this.textContent=""}:function(){this.textContent=n}):this.node().textContent},_a.html=function(n){return arguments.length?this.each("function"==typeof n?function(){var t=n.apply(this,arguments);this.innerHTML=null==t?"":t}:null==n?function(){this.innerHTML=""}:function(){this.innerHTML=n}):this.node().innerHTML},_a.append=function(n){return n=j(n),this.select(function(){return this.appendChild(n.apply(this,arguments))})},_a.insert=function(n,t){return n=j(n),t=N(t),this.select(function(){return this.insertBefore(n.apply(this,arguments),t.apply(this,arguments)||null)})},_a.remove=function(){return this.each(F)},_a.data=function(n,t){function e(n,e){var r,u,i,o=n.length,f=e.length,h=Math.min(o,f),g=new Array(f),p=new Array(f),v=new Array(o);if(t){var d,m=new l,y=new Array(o);for(r=-1;++r<o;)m.has(d=t.call(u=n[r],u.__data__,r))?v[r]=u:m.set(d,u),y[r]=d;for(r=-1;++r<f;)(u=m.get(d=t.call(e,i=e[r],r)))?u!==!0&&(g[r]=u,u.__data__=i):p[r]=H(i),m.set(d,!0);for(r=-1;++r<o;)m.get(y[r])!==!0&&(v[r]=n[r])}else{for(r=-1;++r<h;)u=n[r],i=e[r],u?(u.__data__=i,g[r]=u):p[r]=H(i);for(;f>r;++r)p[r]=H(e[r]);for(;o>r;++r)v[r]=n[r]}p.update=g,p.parentNode=g.parentNode=v.parentNode=n.parentNode,a.push(p),c.push(g),s.push(v)}var r,u,i=-1,o=this.length;if(!arguments.length){for(n=new Array(o=(r=this[0]).length);++i<o;)(u=r[i])&&(n[i]=u.__data__);return n}var a=Z([]),c=A([]),s=A([]);if("function"==typeof n)for(;++i<o;)e(r=this[i],n.call(r,r.parentNode.__data__,i));else for(;++i<o;)e(r=this[i],n);return c.enter=function(){return a},c.exit=function(){return s},c},_a.datum=function(n){return arguments.length?this.property("__data__",n):this.property("__data__")},_a.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]),t.parentNode=(e=this[i]).parentNode;for(var a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return A(u)},_a.order=function(){for(var n=-1,t=this.length;++n<t;)for(var e,r=this[n],u=r.length-1,i=r[u];--u>=0;)(e=r[u])&&(i&&i!==e.nextSibling&&i.parentNode.insertBefore(e,i),i=e);return this},_a.sort=function(n){n=I.apply(this,arguments);for(var t=-1,e=this.length;++t<e;)this[t].sort(n);return this.order()},_a.each=function(n){return Y(this,function(t,e,r){n.call(t,t.__data__,e,r)})},_a.call=function(n){var t=ra(arguments);return n.apply(t[0]=this,t),this},_a.empty=function(){return!this.node()},_a.node=function(){for(var n=0,t=this.length;t>n;n++)for(var e=this[n],r=0,u=e.length;u>r;r++){var i=e[r];if(i)return i}return null},_a.size=function(){var n=0;return Y(this,function(){++n}),n};var Sa=[];ta.selection.enter=Z,ta.selection.enter.prototype=Sa,Sa.append=_a.append,Sa.empty=_a.empty,Sa.node=_a.node,Sa.call=_a.call,Sa.size=_a.size,Sa.select=function(n){for(var t,e,r,u,i,o=[],a=-1,c=this.length;++a<c;){r=(u=this[a]).update,o.push(t=[]),t.parentNode=u.parentNode;for(var l=-1,s=u.length;++l<s;)(i=u[l])?(t.push(r[l]=e=n.call(u.parentNode,i.__data__,l,a)),e.__data__=i.__data__):t.push(null)}return A(o)},Sa.insert=function(n,t){return arguments.length<2&&(t=V(this)),_a.insert.call(this,n,t)},ta.select=function(t){var e;return"string"==typeof t?(e=[Ma(t,ua)],e.parentNode=ua.documentElement):(e=[t],e.parentNode=n(t)),A([e])},ta.selectAll=function(n){var t;return"string"==typeof n?(t=ra(xa(n,ua)),t.parentNode=ua.documentElement):(t=n,t.parentNode=null),A([t])},_a.on=function(n,t,e){var r=arguments.length;if(3>r){if("string"!=typeof n){2>r&&(t=!1);for(e in n)this.each(X(e,n[e],t));return this}if(2>r)return(r=this.node()["__on"+n])&&r._;e=!1}return this.each(X(n,t,e))};var ka=ta.map({mouseenter:"mouseover",mouseleave:"mouseout"});ua&&ka.forEach(function(n){"on"+n in ua&&ka.remove(n)});var Ea,Aa=0;ta.mouse=function(n){return J(n,k())};var Na=this.navigator&&/WebKit/.test(this.navigator.userAgent)?-1:0;ta.touch=function(n,t,e){if(arguments.length<3&&(e=t,t=k().changedTouches),t)for(var r,u=0,i=t.length;i>u;++u)if((r=t[u]).identifier===e)return J(n,r)},ta.behavior.drag=function(){function n(){this.on("mousedown.drag",i).on("touchstart.drag",o)}function e(n,t,e,i,o){return function(){function a(){var n,e,r=t(h,v);r&&(n=r[0]-M[0],e=r[1]-M[1],p|=n|e,M=r,g({type:"drag",x:r[0]+l[0],y:r[1]+l[1],dx:n,dy:e}))}function c(){t(h,v)&&(m.on(i+d,null).on(o+d,null),y(p&&ta.event.target===f),g({type:"dragend"}))}var l,s=this,f=ta.event.target,h=s.parentNode,g=r.of(s,arguments),p=0,v=n(),d=".drag"+(null==v?"":"-"+v),m=ta.select(e(f)).on(i+d,a).on(o+d,c),y=W(f),M=t(h,v);u?(l=u.apply(s,arguments),l=[l.x-M[0],l.y-M[1]]):l=[0,0],g({type:"dragstart"})}}var r=E(n,"drag","dragstart","dragend"),u=null,i=e(b,ta.mouse,t,"mousemove","mouseup"),o=e(G,ta.touch,y,"touchmove","touchend");return n.origin=function(t){return arguments.length?(u=t,n):u},ta.rebind(n,r,"on")},ta.touches=function(n,t){return arguments.length<2&&(t=k().touches),t?ra(t).map(function(t){var e=J(n,t);return e.identifier=t.identifier,e}):[]};var Ca=1e-6,za=Ca*Ca,qa=Math.PI,La=2*qa,Ta=La-Ca,Ra=qa/2,Da=qa/180,Pa=180/qa,Ua=Math.SQRT2,ja=2,Fa=4;ta.interpolateZoom=function(n,t){function e(n){var t=n*y;if(m){var e=rt(v),o=i/(ja*h)*(e*ut(Ua*t+v)-et(v));return[r+o*l,u+o*s,i*e/rt(Ua*t+v)]}return[r+n*l,u+n*s,i*Math.exp(Ua*t)]}var r=n[0],u=n[1],i=n[2],o=t[0],a=t[1],c=t[2],l=o-r,s=a-u,f=l*l+s*s,h=Math.sqrt(f),g=(c*c-i*i+Fa*f)/(2*i*ja*h),p=(c*c-i*i-Fa*f)/(2*c*ja*h),v=Math.log(Math.sqrt(g*g+1)-g),d=Math.log(Math.sqrt(p*p+1)-p),m=d-v,y=(m||Math.log(c/i))/Ua;return e.duration=1e3*y,e},ta.behavior.zoom=function(){function n(n){n.on(q,f).on(Oa+".zoom",g).on("dblclick.zoom",p).on(R,h)}function e(n){return[(n[0]-k.x)/k.k,(n[1]-k.y)/k.k]}function r(n){return[n[0]*k.k+k.x,n[1]*k.k+k.y]}function u(n){k.k=Math.max(N[0],Math.min(N[1],n))}function i(n,t){t=r(t),k.x+=n[0]-t[0],k.y+=n[1]-t[1]}function o(t,e,r,o){t.__chart__={x:k.x,y:k.y,k:k.k},u(Math.pow(2,o)),i(d=e,r),t=ta.select(t),C>0&&(t=t.transition().duration(C)),t.call(n.event)}function a(){b&&b.domain(x.range().map(function(n){return(n-k.x)/k.k}).map(x.invert)),w&&w.domain(_.range().map(function(n){return(n-k.y)/k.k}).map(_.invert))}function c(n){z++||n({type:"zoomstart"})}function l(n){a(),n({type:"zoom",scale:k.k,translate:[k.x,k.y]})}function s(n){--z||n({type:"zoomend"}),d=null}function f(){function n(){f=1,i(ta.mouse(u),g),l(a)}function r(){h.on(L,null).on(T,null),p(f&&ta.event.target===o),s(a)}var u=this,o=ta.event.target,a=D.of(u,arguments),f=0,h=ta.select(t(u)).on(L,n).on(T,r),g=e(ta.mouse(u)),p=W(u);Dl.call(u),c(a)}function h(){function n(){var n=ta.touches(p);return g=k.k,n.forEach(function(n){n.identifier in d&&(d[n.identifier]=e(n))}),n}function t(){var t=ta.event.target;ta.select(t).on(x,r).on(b,a),_.push(t);for(var e=ta.event.changedTouches,u=0,i=e.length;i>u;++u)d[e[u].identifier]=null;var c=n(),l=Date.now();if(1===c.length){if(500>l-M){var s=c[0];o(p,s,d[s.identifier],Math.floor(Math.log(k.k)/Math.LN2)+1),S()}M=l}else if(c.length>1){var s=c[0],f=c[1],h=s[0]-f[0],g=s[1]-f[1];m=h*h+g*g}}function r(){var n,t,e,r,o=ta.touches(p);Dl.call(p);for(var a=0,c=o.length;c>a;++a,r=null)if(e=o[a],r=d[e.identifier]){if(t)break;n=e,t=r}if(r){var s=(s=e[0]-n[0])*s+(s=e[1]-n[1])*s,f=m&&Math.sqrt(s/m);n=[(n[0]+e[0])/2,(n[1]+e[1])/2],t=[(t[0]+r[0])/2,(t[1]+r[1])/2],u(f*g)}M=null,i(n,t),l(v)}function a(){if(ta.event.touches.length){for(var t=ta.event.changedTouches,e=0,r=t.length;r>e;++e)delete d[t[e].identifier];for(var u in d)return void n()}ta.selectAll(_).on(y,null),w.on(q,f).on(R,h),E(),s(v)}var g,p=this,v=D.of(p,arguments),d={},m=0,y=".zoom-"+ta.event.changedTouches[0].identifier,x="touchmove"+y,b="touchend"+y,_=[],w=ta.select(p),E=W(p);t(),c(v),w.on(q,null).on(R,t)}function g(){var n=D.of(this,arguments);y?clearTimeout(y):(v=e(d=m||ta.mouse(this)),Dl.call(this),c(n)),y=setTimeout(function(){y=null,s(n)},50),S(),u(Math.pow(2,.002*Ha())*k.k),i(d,v),l(n)}function p(){var n=ta.mouse(this),t=Math.log(k.k)/Math.LN2;o(this,n,e(n),ta.event.shiftKey?Math.ceil(t)-1:Math.floor(t)+1)}var v,d,m,y,M,x,b,_,w,k={x:0,y:0,k:1},A=[960,500],N=Ia,C=250,z=0,q="mousedown.zoom",L="mousemove.zoom",T="mouseup.zoom",R="touchstart.zoom",D=E(n,"zoomstart","zoom","zoomend");return Oa||(Oa="onwheel"in ua?(Ha=function(){return-ta.event.deltaY*(ta.event.deltaMode?120:1)},"wheel"):"onmousewheel"in ua?(Ha=function(){return ta.event.wheelDelta},"mousewheel"):(Ha=function(){return-ta.event.detail},"MozMousePixelScroll")),n.event=function(n){n.each(function(){var n=D.of(this,arguments),t=k;Tl?ta.select(this).transition().each("start.zoom",function(){k=this.__chart__||{x:0,y:0,k:1},c(n)}).tween("zoom:zoom",function(){var e=A[0],r=A[1],u=d?d[0]:e/2,i=d?d[1]:r/2,o=ta.interpolateZoom([(u-k.x)/k.k,(i-k.y)/k.k,e/k.k],[(u-t.x)/t.k,(i-t.y)/t.k,e/t.k]);return function(t){var r=o(t),a=e/r[2];this.__chart__=k={x:u-r[0]*a,y:i-r[1]*a,k:a},l(n)}}).each("interrupt.zoom",function(){s(n)}).each("end.zoom",function(){s(n)}):(this.__chart__=k,c(n),l(n),s(n))})},n.translate=function(t){return arguments.length?(k={x:+t[0],y:+t[1],k:k.k},a(),n):[k.x,k.y]},n.scale=function(t){return arguments.length?(k={x:k.x,y:k.y,k:+t},a(),n):k.k},n.scaleExtent=function(t){return arguments.length?(N=null==t?Ia:[+t[0],+t[1]],n):N},n.center=function(t){return arguments.length?(m=t&&[+t[0],+t[1]],n):m},n.size=function(t){return arguments.length?(A=t&&[+t[0],+t[1]],n):A},n.duration=function(t){return arguments.length?(C=+t,n):C},n.x=function(t){return arguments.length?(b=t,x=t.copy(),k={x:0,y:0,k:1},n):b},n.y=function(t){return arguments.length?(w=t,_=t.copy(),k={x:0,y:0,k:1},n):w},ta.rebind(n,D,"on")};var Ha,Oa,Ia=[0,1/0];ta.color=ot,ot.prototype.toString=function(){return this.rgb()+""},ta.hsl=at;var Ya=at.prototype=new ot;Ya.brighter=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,this.l/n)},Ya.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new at(this.h,this.s,n*this.l)},Ya.rgb=function(){return ct(this.h,this.s,this.l)},ta.hcl=lt;var Za=lt.prototype=new ot;Za.brighter=function(n){return new lt(this.h,this.c,Math.min(100,this.l+Va*(arguments.length?n:1)))},Za.darker=function(n){return new lt(this.h,this.c,Math.max(0,this.l-Va*(arguments.length?n:1)))},Za.rgb=function(){return st(this.h,this.c,this.l).rgb()},ta.lab=ft;var Va=18,Xa=.95047,$a=1,Ba=1.08883,Wa=ft.prototype=new ot;Wa.brighter=function(n){return new ft(Math.min(100,this.l+Va*(arguments.length?n:1)),this.a,this.b)},Wa.darker=function(n){return new ft(Math.max(0,this.l-Va*(arguments.length?n:1)),this.a,this.b)},Wa.rgb=function(){return ht(this.l,this.a,this.b)},ta.rgb=mt;var Ja=mt.prototype=new ot;Ja.brighter=function(n){n=Math.pow(.7,arguments.length?n:1);var t=this.r,e=this.g,r=this.b,u=30;return t||e||r?(t&&u>t&&(t=u),e&&u>e&&(e=u),r&&u>r&&(r=u),new mt(Math.min(255,t/n),Math.min(255,e/n),Math.min(255,r/n))):new mt(u,u,u)},Ja.darker=function(n){return n=Math.pow(.7,arguments.length?n:1),new mt(n*this.r,n*this.g,n*this.b)},Ja.hsl=function(){return _t(this.r,this.g,this.b)},Ja.toString=function(){return"#"+xt(this.r)+xt(this.g)+xt(this.b)};var Ga=ta.map({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074});Ga.forEach(function(n,t){Ga.set(n,yt(t))}),ta.functor=Et,ta.xhr=At(y),ta.dsv=function(n,t){function e(n,e,i){arguments.length<3&&(i=e,e=null);var o=Nt(n,t,null==e?r:u(e),i);return o.row=function(n){return arguments.length?o.response(null==(e=n)?r:u(n)):e},o}function r(n){return e.parse(n.responseText)}function u(n){return function(t){return e.parse(t.responseText,n)}}function i(t){return t.map(o).join(n)}function o(n){return a.test(n)?'"'+n.replace(/\"/g,'""')+'"':n}var a=new RegExp('["'+n+"\n]"),c=n.charCodeAt(0);return e.parse=function(n,t){var r;return e.parseRows(n,function(n,e){if(r)return r(n,e-1);var u=new Function("d","return {"+n.map(function(n,t){return JSON.stringify(n)+": d["+t+"]"}).join(",")+"}");r=t?function(n,e){return t(u(n),e)}:u})},e.parseRows=function(n,t){function e(){if(s>=l)return o;if(u)return u=!1,i;var t=s;if(34===n.charCodeAt(t)){for(var e=t;e++<l;)if(34===n.charCodeAt(e)){if(34!==n.charCodeAt(e+1))break;++e}s=e+2;var r=n.charCodeAt(e+1);return 13===r?(u=!0,10===n.charCodeAt(e+2)&&++s):10===r&&(u=!0),n.slice(t+1,e).replace(/""/g,'"')}for(;l>s;){var r=n.charCodeAt(s++),a=1;if(10===r)u=!0;else if(13===r)u=!0,10===n.charCodeAt(s)&&(++s,++a);else if(r!==c)continue;return n.slice(t,s-a)}return n.slice(t)}for(var r,u,i={},o={},a=[],l=n.length,s=0,f=0;(r=e())!==o;){for(var h=[];r!==i&&r!==o;)h.push(r),r=e();t&&null==(h=t(h,f++))||a.push(h)}return a},e.format=function(t){if(Array.isArray(t[0]))return e.formatRows(t);var r=new m,u=[];return t.forEach(function(n){for(var t in n)r.has(t)||u.push(r.add(t))}),[u.map(o).join(n)].concat(t.map(function(t){return u.map(function(n){return o(t[n])}).join(n)})).join("\n")},e.formatRows=function(n){return n.map(i).join("\n")},e},ta.csv=ta.dsv(",","text/csv"),ta.tsv=ta.dsv(" ","text/tab-separated-values");var Ka,Qa,nc,tc,ec,rc=this[x(this,"requestAnimationFrame")]||function(n){setTimeout(n,17)};ta.timer=function(n,t,e){var r=arguments.length;2>r&&(t=0),3>r&&(e=Date.now());var u=e+t,i={c:n,t:u,f:!1,n:null};Qa?Qa.n=i:Ka=i,Qa=i,nc||(tc=clearTimeout(tc),nc=1,rc(qt))},ta.timer.flush=function(){Lt(),Tt()},ta.round=function(n,t){return t?Math.round(n*(t=Math.pow(10,t)))/t:Math.round(n)};var uc=["y","z","a","f","p","n","\xb5","m","","k","M","G","T","P","E","Z","Y"].map(Dt);ta.formatPrefix=function(n,t){var e=0;return n&&(0>n&&(n*=-1),t&&(n=ta.round(n,Rt(n,t))),e=1+Math.floor(1e-12+Math.log(n)/Math.LN10),e=Math.max(-24,Math.min(24,3*Math.floor((e-1)/3)))),uc[8+e/3]};var ic=/(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i,oc=ta.map({b:function(n){return n.toString(2)},c:function(n){return String.fromCharCode(n)},o:function(n){return n.toString(8)},x:function(n){return n.toString(16)},X:function(n){return n.toString(16).toUpperCase()},g:function(n,t){return n.toPrecision(t)},e:function(n,t){return n.toExponential(t)},f:function(n,t){return n.toFixed(t)},r:function(n,t){return(n=ta.round(n,Rt(n,t))).toFixed(Math.max(0,Math.min(20,Rt(n*(1+1e-15),t))))}}),ac=ta.time={},cc=Date;jt.prototype={getDate:function(){return this._.getUTCDate()},getDay:function(){return this._.getUTCDay()},getFullYear:function(){return this._.getUTCFullYear()},getHours:function(){return this._.getUTCHours()},getMilliseconds:function(){return this._.getUTCMilliseconds()},getMinutes:function(){return this._.getUTCMinutes()},getMonth:function(){return this._.getUTCMonth()},getSeconds:function(){return this._.getUTCSeconds()},getTime:function(){return this._.getTime()},getTimezoneOffset:function(){return 0},valueOf:function(){return this._.valueOf()},setDate:function(){lc.setUTCDate.apply(this._,arguments)},setDay:function(){lc.setUTCDay.apply(this._,arguments)},setFullYear:function(){lc.setUTCFullYear.apply(this._,arguments)},setHours:function(){lc.setUTCHours.apply(this._,arguments)},setMilliseconds:function(){lc.setUTCMilliseconds.apply(this._,arguments)},setMinutes:function(){lc.setUTCMinutes.apply(this._,arguments)},setMonth:function(){lc.setUTCMonth.apply(this._,arguments)},setSeconds:function(){lc.setUTCSeconds.apply(this._,arguments)},setTime:function(){lc.setTime.apply(this._,arguments)}};var lc=Date.prototype;ac.year=Ft(function(n){return n=ac.day(n),n.setMonth(0,1),n},function(n,t){n.setFullYear(n.getFullYear()+t)},function(n){return n.getFullYear()}),ac.years=ac.year.range,ac.years.utc=ac.year.utc.range,ac.day=Ft(function(n){var t=new cc(2e3,0);return t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),t},function(n,t){n.setDate(n.getDate()+t)},function(n){return n.getDate()-1}),ac.days=ac.day.range,ac.days.utc=ac.day.utc.range,ac.dayOfYear=function(n){var t=ac.year(n);return Math.floor((n-t-6e4*(n.getTimezoneOffset()-t.getTimezoneOffset()))/864e5)},["sunday","monday","tuesday","wednesday","thursday","friday","saturday"].forEach(function(n,t){t=7-t;var e=ac[n]=Ft(function(n){return(n=ac.day(n)).setDate(n.getDate()-(n.getDay()+t)%7),n},function(n,t){n.setDate(n.getDate()+7*Math.floor(t))},function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)-(e!==t)});ac[n+"s"]=e.range,ac[n+"s"].utc=e.utc.range,ac[n+"OfYear"]=function(n){var e=ac.year(n).getDay();return Math.floor((ac.dayOfYear(n)+(e+t)%7)/7)}}),ac.week=ac.sunday,ac.weeks=ac.sunday.range,ac.weeks.utc=ac.sunday.utc.range,ac.weekOfYear=ac.sundayOfYear;var sc={"-":"",_:" ",0:"0"},fc=/^\s*\d+/,hc=/^%/;ta.locale=function(n){return{numberFormat:Pt(n),timeFormat:Ot(n)}};var gc=ta.locale({decimal:".",thousands:",",grouping:[3],currency:["$",""],dateTime:"%a %b %e %X %Y",date:"%m/%d/%Y",time:"%H:%M:%S",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});ta.format=gc.numberFormat,ta.geo={},ce.prototype={s:0,t:0,add:function(n){le(n,this.t,pc),le(pc.s,this.s,this),this.s?this.t+=pc.t:this.s=pc.t
+},reset:function(){this.s=this.t=0},valueOf:function(){return this.s}};var pc=new ce;ta.geo.stream=function(n,t){n&&vc.hasOwnProperty(n.type)?vc[n.type](n,t):se(n,t)};var vc={Feature:function(n,t){se(n.geometry,t)},FeatureCollection:function(n,t){for(var e=n.features,r=-1,u=e.length;++r<u;)se(e[r].geometry,t)}},dc={Sphere:function(n,t){t.sphere()},Point:function(n,t){n=n.coordinates,t.point(n[0],n[1],n[2])},MultiPoint:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)n=e[r],t.point(n[0],n[1],n[2])},LineString:function(n,t){fe(n.coordinates,t,0)},MultiLineString:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)fe(e[r],t,0)},Polygon:function(n,t){he(n.coordinates,t)},MultiPolygon:function(n,t){for(var e=n.coordinates,r=-1,u=e.length;++r<u;)he(e[r],t)},GeometryCollection:function(n,t){for(var e=n.geometries,r=-1,u=e.length;++r<u;)se(e[r],t)}};ta.geo.area=function(n){return mc=0,ta.geo.stream(n,Mc),mc};var mc,yc=new ce,Mc={sphere:function(){mc+=4*qa},point:b,lineStart:b,lineEnd:b,polygonStart:function(){yc.reset(),Mc.lineStart=ge},polygonEnd:function(){var n=2*yc;mc+=0>n?4*qa+n:n,Mc.lineStart=Mc.lineEnd=Mc.point=b}};ta.geo.bounds=function(){function n(n,t){M.push(x=[s=n,h=n]),f>t&&(f=t),t>g&&(g=t)}function t(t,e){var r=pe([t*Da,e*Da]);if(m){var u=de(m,r),i=[u[1],-u[0],0],o=de(i,u);Me(o),o=xe(o);var c=t-p,l=c>0?1:-1,v=o[0]*Pa*l,d=ga(c)>180;if(d^(v>l*p&&l*t>v)){var y=o[1]*Pa;y>g&&(g=y)}else if(v=(v+360)%360-180,d^(v>l*p&&l*t>v)){var y=-o[1]*Pa;f>y&&(f=y)}else f>e&&(f=e),e>g&&(g=e);d?p>t?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t):h>=s?(s>t&&(s=t),t>h&&(h=t)):t>p?a(s,t)>a(s,h)&&(h=t):a(t,h)>a(s,h)&&(s=t)}else n(t,e);m=r,p=t}function e(){b.point=t}function r(){x[0]=s,x[1]=h,b.point=n,m=null}function u(n,e){if(m){var r=n-p;y+=ga(r)>180?r+(r>0?360:-360):r}else v=n,d=e;Mc.point(n,e),t(n,e)}function i(){Mc.lineStart()}function o(){u(v,d),Mc.lineEnd(),ga(y)>Ca&&(s=-(h=180)),x[0]=s,x[1]=h,m=null}function a(n,t){return(t-=n)<0?t+360:t}function c(n,t){return n[0]-t[0]}function l(n,t){return t[0]<=t[1]?t[0]<=n&&n<=t[1]:n<t[0]||t[1]<n}var s,f,h,g,p,v,d,m,y,M,x,b={point:n,lineStart:e,lineEnd:r,polygonStart:function(){b.point=u,b.lineStart=i,b.lineEnd=o,y=0,Mc.polygonStart()},polygonEnd:function(){Mc.polygonEnd(),b.point=n,b.lineStart=e,b.lineEnd=r,0>yc?(s=-(h=180),f=-(g=90)):y>Ca?g=90:-Ca>y&&(f=-90),x[0]=s,x[1]=h}};return function(n){g=h=-(s=f=1/0),M=[],ta.geo.stream(n,b);var t=M.length;if(t){M.sort(c);for(var e,r=1,u=M[0],i=[u];t>r;++r)e=M[r],l(e[0],u)||l(e[1],u)?(a(u[0],e[1])>a(u[0],u[1])&&(u[1]=e[1]),a(e[0],u[1])>a(u[0],u[1])&&(u[0]=e[0])):i.push(u=e);for(var o,e,p=-1/0,t=i.length-1,r=0,u=i[t];t>=r;u=e,++r)e=i[r],(o=a(u[1],e[0]))>p&&(p=o,s=e[0],h=u[1])}return M=x=null,1/0===s||1/0===f?[[0/0,0/0],[0/0,0/0]]:[[s,f],[h,g]]}}(),ta.geo.centroid=function(n){xc=bc=_c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,qc);var t=Nc,e=Cc,r=zc,u=t*t+e*e+r*r;return za>u&&(t=kc,e=Ec,r=Ac,Ca>bc&&(t=_c,e=wc,r=Sc),u=t*t+e*e+r*r,za>u)?[0/0,0/0]:[Math.atan2(e,t)*Pa,tt(r/Math.sqrt(u))*Pa]};var xc,bc,_c,wc,Sc,kc,Ec,Ac,Nc,Cc,zc,qc={sphere:b,point:_e,lineStart:Se,lineEnd:ke,polygonStart:function(){qc.lineStart=Ee},polygonEnd:function(){qc.lineStart=Se}},Lc=Le(Ne,Pe,je,[-qa,-qa/2]),Tc=1e9;ta.geo.clipExtent=function(){var n,t,e,r,u,i,o={stream:function(n){return u&&(u.valid=!1),u=i(n),u.valid=!0,u},extent:function(a){return arguments.length?(i=Ie(n=+a[0][0],t=+a[0][1],e=+a[1][0],r=+a[1][1]),u&&(u.valid=!1,u=null),o):[[n,t],[e,r]]}};return o.extent([[0,0],[960,500]])},(ta.geo.conicEqualArea=function(){return Ye(Ze)}).raw=Ze,ta.geo.albers=function(){return ta.geo.conicEqualArea().rotate([96,0]).center([-.6,38.7]).parallels([29.5,45.5]).scale(1070)},ta.geo.albersUsa=function(){function n(n){var i=n[0],o=n[1];return t=null,e(i,o),t||(r(i,o),t)||u(i,o),t}var t,e,r,u,i=ta.geo.albers(),o=ta.geo.conicEqualArea().rotate([154,0]).center([-2,58.5]).parallels([55,65]),a=ta.geo.conicEqualArea().rotate([157,0]).center([-3,19.9]).parallels([8,18]),c={point:function(n,e){t=[n,e]}};return n.invert=function(n){var t=i.scale(),e=i.translate(),r=(n[0]-e[0])/t,u=(n[1]-e[1])/t;return(u>=.12&&.234>u&&r>=-.425&&-.214>r?o:u>=.166&&.234>u&&r>=-.214&&-.115>r?a:i).invert(n)},n.stream=function(n){var t=i.stream(n),e=o.stream(n),r=a.stream(n);return{point:function(n,u){t.point(n,u),e.point(n,u),r.point(n,u)},sphere:function(){t.sphere(),e.sphere(),r.sphere()},lineStart:function(){t.lineStart(),e.lineStart(),r.lineStart()},lineEnd:function(){t.lineEnd(),e.lineEnd(),r.lineEnd()},polygonStart:function(){t.polygonStart(),e.polygonStart(),r.polygonStart()},polygonEnd:function(){t.polygonEnd(),e.polygonEnd(),r.polygonEnd()}}},n.precision=function(t){return arguments.length?(i.precision(t),o.precision(t),a.precision(t),n):i.precision()},n.scale=function(t){return arguments.length?(i.scale(t),o.scale(.35*t),a.scale(t),n.translate(i.translate())):i.scale()},n.translate=function(t){if(!arguments.length)return i.translate();var l=i.scale(),s=+t[0],f=+t[1];return e=i.translate(t).clipExtent([[s-.455*l,f-.238*l],[s+.455*l,f+.238*l]]).stream(c).point,r=o.translate([s-.307*l,f+.201*l]).clipExtent([[s-.425*l+Ca,f+.12*l+Ca],[s-.214*l-Ca,f+.234*l-Ca]]).stream(c).point,u=a.translate([s-.205*l,f+.212*l]).clipExtent([[s-.214*l+Ca,f+.166*l+Ca],[s-.115*l-Ca,f+.234*l-Ca]]).stream(c).point,n},n.scale(1070)};var Rc,Dc,Pc,Uc,jc,Fc,Hc={point:b,lineStart:b,lineEnd:b,polygonStart:function(){Dc=0,Hc.lineStart=Ve},polygonEnd:function(){Hc.lineStart=Hc.lineEnd=Hc.point=b,Rc+=ga(Dc/2)}},Oc={point:Xe,lineStart:b,lineEnd:b,polygonStart:b,polygonEnd:b},Ic={point:We,lineStart:Je,lineEnd:Ge,polygonStart:function(){Ic.lineStart=Ke},polygonEnd:function(){Ic.point=We,Ic.lineStart=Je,Ic.lineEnd=Ge}};ta.geo.path=function(){function n(n){return n&&("function"==typeof a&&i.pointRadius(+a.apply(this,arguments)),o&&o.valid||(o=u(i)),ta.geo.stream(n,o)),i.result()}function t(){return o=null,n}var e,r,u,i,o,a=4.5;return n.area=function(n){return Rc=0,ta.geo.stream(n,u(Hc)),Rc},n.centroid=function(n){return _c=wc=Sc=kc=Ec=Ac=Nc=Cc=zc=0,ta.geo.stream(n,u(Ic)),zc?[Nc/zc,Cc/zc]:Ac?[kc/Ac,Ec/Ac]:Sc?[_c/Sc,wc/Sc]:[0/0,0/0]},n.bounds=function(n){return jc=Fc=-(Pc=Uc=1/0),ta.geo.stream(n,u(Oc)),[[Pc,Uc],[jc,Fc]]},n.projection=function(n){return arguments.length?(u=(e=n)?n.stream||tr(n):y,t()):e},n.context=function(n){return arguments.length?(i=null==(r=n)?new $e:new Qe(n),"function"!=typeof a&&i.pointRadius(a),t()):r},n.pointRadius=function(t){return arguments.length?(a="function"==typeof t?t:(i.pointRadius(+t),+t),n):a},n.projection(ta.geo.albersUsa()).context(null)},ta.geo.transform=function(n){return{stream:function(t){var e=new er(t);for(var r in n)e[r]=n[r];return e}}},er.prototype={point:function(n,t){this.stream.point(n,t)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}},ta.geo.projection=ur,ta.geo.projectionMutator=ir,(ta.geo.equirectangular=function(){return ur(ar)}).raw=ar.invert=ar,ta.geo.rotation=function(n){function t(t){return t=n(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t}return n=lr(n[0]%360*Da,n[1]*Da,n.length>2?n[2]*Da:0),t.invert=function(t){return t=n.invert(t[0]*Da,t[1]*Da),t[0]*=Pa,t[1]*=Pa,t},t},cr.invert=ar,ta.geo.circle=function(){function n(){var n="function"==typeof r?r.apply(this,arguments):r,t=lr(-n[0]*Da,-n[1]*Da,0).invert,u=[];return e(null,null,1,{point:function(n,e){u.push(n=t(n,e)),n[0]*=Pa,n[1]*=Pa}}),{type:"Polygon",coordinates:[u]}}var t,e,r=[0,0],u=6;return n.origin=function(t){return arguments.length?(r=t,n):r},n.angle=function(r){return arguments.length?(e=gr((t=+r)*Da,u*Da),n):t},n.precision=function(r){return arguments.length?(e=gr(t*Da,(u=+r)*Da),n):u},n.angle(90)},ta.geo.distance=function(n,t){var e,r=(t[0]-n[0])*Da,u=n[1]*Da,i=t[1]*Da,o=Math.sin(r),a=Math.cos(r),c=Math.sin(u),l=Math.cos(u),s=Math.sin(i),f=Math.cos(i);return Math.atan2(Math.sqrt((e=f*o)*e+(e=l*s-c*f*a)*e),c*s+l*f*a)},ta.geo.graticule=function(){function n(){return{type:"MultiLineString",coordinates:t()}}function t(){return ta.range(Math.ceil(i/d)*d,u,d).map(h).concat(ta.range(Math.ceil(l/m)*m,c,m).map(g)).concat(ta.range(Math.ceil(r/p)*p,e,p).filter(function(n){return ga(n%d)>Ca}).map(s)).concat(ta.range(Math.ceil(a/v)*v,o,v).filter(function(n){return ga(n%m)>Ca}).map(f))}var e,r,u,i,o,a,c,l,s,f,h,g,p=10,v=p,d=90,m=360,y=2.5;return n.lines=function(){return t().map(function(n){return{type:"LineString",coordinates:n}})},n.outline=function(){return{type:"Polygon",coordinates:[h(i).concat(g(c).slice(1),h(u).reverse().slice(1),g(l).reverse().slice(1))]}},n.extent=function(t){return arguments.length?n.majorExtent(t).minorExtent(t):n.minorExtent()},n.majorExtent=function(t){return arguments.length?(i=+t[0][0],u=+t[1][0],l=+t[0][1],c=+t[1][1],i>u&&(t=i,i=u,u=t),l>c&&(t=l,l=c,c=t),n.precision(y)):[[i,l],[u,c]]},n.minorExtent=function(t){return arguments.length?(r=+t[0][0],e=+t[1][0],a=+t[0][1],o=+t[1][1],r>e&&(t=r,r=e,e=t),a>o&&(t=a,a=o,o=t),n.precision(y)):[[r,a],[e,o]]},n.step=function(t){return arguments.length?n.majorStep(t).minorStep(t):n.minorStep()},n.majorStep=function(t){return arguments.length?(d=+t[0],m=+t[1],n):[d,m]},n.minorStep=function(t){return arguments.length?(p=+t[0],v=+t[1],n):[p,v]},n.precision=function(t){return arguments.length?(y=+t,s=vr(a,o,90),f=dr(r,e,y),h=vr(l,c,90),g=dr(i,u,y),n):y},n.majorExtent([[-180,-90+Ca],[180,90-Ca]]).minorExtent([[-180,-80-Ca],[180,80+Ca]])},ta.geo.greatArc=function(){function n(){return{type:"LineString",coordinates:[t||r.apply(this,arguments),e||u.apply(this,arguments)]}}var t,e,r=mr,u=yr;return n.distance=function(){return ta.geo.distance(t||r.apply(this,arguments),e||u.apply(this,arguments))},n.source=function(e){return arguments.length?(r=e,t="function"==typeof e?null:e,n):r},n.target=function(t){return arguments.length?(u=t,e="function"==typeof t?null:t,n):u},n.precision=function(){return arguments.length?n:0},n},ta.geo.interpolate=function(n,t){return Mr(n[0]*Da,n[1]*Da,t[0]*Da,t[1]*Da)},ta.geo.length=function(n){return Yc=0,ta.geo.stream(n,Zc),Yc};var Yc,Zc={sphere:b,point:b,lineStart:xr,lineEnd:b,polygonStart:b,polygonEnd:b},Vc=br(function(n){return Math.sqrt(2/(1+n))},function(n){return 2*Math.asin(n/2)});(ta.geo.azimuthalEqualArea=function(){return ur(Vc)}).raw=Vc;var Xc=br(function(n){var t=Math.acos(n);return t&&t/Math.sin(t)},y);(ta.geo.azimuthalEquidistant=function(){return ur(Xc)}).raw=Xc,(ta.geo.conicConformal=function(){return Ye(_r)}).raw=_r,(ta.geo.conicEquidistant=function(){return Ye(wr)}).raw=wr;var $c=br(function(n){return 1/n},Math.atan);(ta.geo.gnomonic=function(){return ur($c)}).raw=$c,Sr.invert=function(n,t){return[n,2*Math.atan(Math.exp(t))-Ra]},(ta.geo.mercator=function(){return kr(Sr)}).raw=Sr;var Bc=br(function(){return 1},Math.asin);(ta.geo.orthographic=function(){return ur(Bc)}).raw=Bc;var Wc=br(function(n){return 1/(1+n)},function(n){return 2*Math.atan(n)});(ta.geo.stereographic=function(){return ur(Wc)}).raw=Wc,Er.invert=function(n,t){return[-t,2*Math.atan(Math.exp(n))-Ra]},(ta.geo.transverseMercator=function(){var n=kr(Er),t=n.center,e=n.rotate;return n.center=function(n){return n?t([-n[1],n[0]]):(n=t(),[n[1],-n[0]])},n.rotate=function(n){return n?e([n[0],n[1],n.length>2?n[2]+90:90]):(n=e(),[n[0],n[1],n[2]-90])},e([0,0,90])}).raw=Er,ta.geom={},ta.geom.hull=function(n){function t(n){if(n.length<3)return[];var t,u=Et(e),i=Et(r),o=n.length,a=[],c=[];for(t=0;o>t;t++)a.push([+u.call(this,n[t],t),+i.call(this,n[t],t),t]);for(a.sort(zr),t=0;o>t;t++)c.push([a[t][0],-a[t][1]]);var l=Cr(a),s=Cr(c),f=s[0]===l[0],h=s[s.length-1]===l[l.length-1],g=[];for(t=l.length-1;t>=0;--t)g.push(n[a[l[t]][2]]);for(t=+f;t<s.length-h;++t)g.push(n[a[s[t]][2]]);return g}var e=Ar,r=Nr;return arguments.length?t(n):(t.x=function(n){return arguments.length?(e=n,t):e},t.y=function(n){return arguments.length?(r=n,t):r},t)},ta.geom.polygon=function(n){return ya(n,Jc),n};var Jc=ta.geom.polygon.prototype=[];Jc.area=function(){for(var n,t=-1,e=this.length,r=this[e-1],u=0;++t<e;)n=r,r=this[t],u+=n[1]*r[0]-n[0]*r[1];return.5*u},Jc.centroid=function(n){var t,e,r=-1,u=this.length,i=0,o=0,a=this[u-1];for(arguments.length||(n=-1/(6*this.area()));++r<u;)t=a,a=this[r],e=t[0]*a[1]-a[0]*t[1],i+=(t[0]+a[0])*e,o+=(t[1]+a[1])*e;return[i*n,o*n]},Jc.clip=function(n){for(var t,e,r,u,i,o,a=Tr(n),c=-1,l=this.length-Tr(this),s=this[l-1];++c<l;){for(t=n.slice(),n.length=0,u=this[c],i=t[(r=t.length-a)-1],e=-1;++e<r;)o=t[e],qr(o,s,u)?(qr(i,s,u)||n.push(Lr(i,o,s,u)),n.push(o)):qr(i,s,u)&&n.push(Lr(i,o,s,u)),i=o;a&&n.push(n[0]),s=u}return n};var Gc,Kc,Qc,nl,tl,el=[],rl=[];Or.prototype.prepare=function(){for(var n,t=this.edges,e=t.length;e--;)n=t[e].edge,n.b&&n.a||t.splice(e,1);return t.sort(Yr),t.length},Qr.prototype={start:function(){return this.edge.l===this.site?this.edge.a:this.edge.b},end:function(){return this.edge.l===this.site?this.edge.b:this.edge.a}},nu.prototype={insert:function(n,t){var e,r,u;if(n){if(t.P=n,t.N=n.N,n.N&&(n.N.P=t),n.N=t,n.R){for(n=n.R;n.L;)n=n.L;n.L=t}else n.R=t;e=n}else this._?(n=uu(this._),t.P=null,t.N=n,n.P=n.L=t,e=n):(t.P=t.N=null,this._=t,e=null);for(t.L=t.R=null,t.U=e,t.C=!0,n=t;e&&e.C;)r=e.U,e===r.L?(u=r.R,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.R&&(eu(this,e),n=e,e=n.U),e.C=!1,r.C=!0,ru(this,r))):(u=r.L,u&&u.C?(e.C=u.C=!1,r.C=!0,n=r):(n===e.L&&(ru(this,e),n=e,e=n.U),e.C=!1,r.C=!0,eu(this,r))),e=n.U;this._.C=!1},remove:function(n){n.N&&(n.N.P=n.P),n.P&&(n.P.N=n.N),n.N=n.P=null;var t,e,r,u=n.U,i=n.L,o=n.R;if(e=i?o?uu(o):i:o,u?u.L===n?u.L=e:u.R=e:this._=e,i&&o?(r=e.C,e.C=n.C,e.L=i,i.U=e,e!==o?(u=e.U,e.U=n.U,n=e.R,u.L=n,e.R=o,o.U=e):(e.U=u,u=e,n=e.R)):(r=n.C,n=e),n&&(n.U=u),!r){if(n&&n.C)return void(n.C=!1);do{if(n===this._)break;if(n===u.L){if(t=u.R,t.C&&(t.C=!1,u.C=!0,eu(this,u),t=u.R),t.L&&t.L.C||t.R&&t.R.C){t.R&&t.R.C||(t.L.C=!1,t.C=!0,ru(this,t),t=u.R),t.C=u.C,u.C=t.R.C=!1,eu(this,u),n=this._;break}}else if(t=u.L,t.C&&(t.C=!1,u.C=!0,ru(this,u),t=u.L),t.L&&t.L.C||t.R&&t.R.C){t.L&&t.L.C||(t.R.C=!1,t.C=!0,eu(this,t),t=u.L),t.C=u.C,u.C=t.L.C=!1,ru(this,u),n=this._;break}t.C=!0,n=u,u=u.U}while(!n.C);n&&(n.C=!1)}}},ta.geom.voronoi=function(n){function t(n){var t=new Array(n.length),r=a[0][0],u=a[0][1],i=a[1][0],o=a[1][1];return iu(e(n),a).cells.forEach(function(e,a){var c=e.edges,l=e.site,s=t[a]=c.length?c.map(function(n){var t=n.start();return[t.x,t.y]}):l.x>=r&&l.x<=i&&l.y>=u&&l.y<=o?[[r,o],[i,o],[i,u],[r,u]]:[];s.point=n[a]}),t}function e(n){return n.map(function(n,t){return{x:Math.round(i(n,t)/Ca)*Ca,y:Math.round(o(n,t)/Ca)*Ca,i:t}})}var r=Ar,u=Nr,i=r,o=u,a=ul;return n?t(n):(t.links=function(n){return iu(e(n)).edges.filter(function(n){return n.l&&n.r}).map(function(t){return{source:n[t.l.i],target:n[t.r.i]}})},t.triangles=function(n){var t=[];return iu(e(n)).cells.forEach(function(e,r){for(var u,i,o=e.site,a=e.edges.sort(Yr),c=-1,l=a.length,s=a[l-1].edge,f=s.l===o?s.r:s.l;++c<l;)u=s,i=f,s=a[c].edge,f=s.l===o?s.r:s.l,r<i.i&&r<f.i&&au(o,i,f)<0&&t.push([n[r],n[i.i],n[f.i]])}),t},t.x=function(n){return arguments.length?(i=Et(r=n),t):r},t.y=function(n){return arguments.length?(o=Et(u=n),t):u},t.clipExtent=function(n){return arguments.length?(a=null==n?ul:n,t):a===ul?null:a},t.size=function(n){return arguments.length?t.clipExtent(n&&[[0,0],n]):a===ul?null:a&&a[1]},t)};var ul=[[-1e6,-1e6],[1e6,1e6]];ta.geom.delaunay=function(n){return ta.geom.voronoi().triangles(n)},ta.geom.quadtree=function(n,t,e,r,u){function i(n){function i(n,t,e,r,u,i,o,a){if(!isNaN(e)&&!isNaN(r))if(n.leaf){var c=n.x,s=n.y;if(null!=c)if(ga(c-e)+ga(s-r)<.01)l(n,t,e,r,u,i,o,a);else{var f=n.point;n.x=n.y=n.point=null,l(n,f,c,s,u,i,o,a),l(n,t,e,r,u,i,o,a)}else n.x=e,n.y=r,n.point=t}else l(n,t,e,r,u,i,o,a)}function l(n,t,e,r,u,o,a,c){var l=.5*(u+a),s=.5*(o+c),f=e>=l,h=r>=s,g=h<<1|f;n.leaf=!1,n=n.nodes[g]||(n.nodes[g]=su()),f?u=l:a=l,h?o=s:c=s,i(n,t,e,r,u,o,a,c)}var s,f,h,g,p,v,d,m,y,M=Et(a),x=Et(c);if(null!=t)v=t,d=e,m=r,y=u;else if(m=y=-(v=d=1/0),f=[],h=[],p=n.length,o)for(g=0;p>g;++g)s=n[g],s.x<v&&(v=s.x),s.y<d&&(d=s.y),s.x>m&&(m=s.x),s.y>y&&(y=s.y),f.push(s.x),h.push(s.y);else for(g=0;p>g;++g){var b=+M(s=n[g],g),_=+x(s,g);v>b&&(v=b),d>_&&(d=_),b>m&&(m=b),_>y&&(y=_),f.push(b),h.push(_)}var w=m-v,S=y-d;w>S?y=d+w:m=v+S;var k=su();if(k.add=function(n){i(k,n,+M(n,++g),+x(n,g),v,d,m,y)},k.visit=function(n){fu(n,k,v,d,m,y)},k.find=function(n){return hu(k,n[0],n[1],v,d,m,y)},g=-1,null==t){for(;++g<p;)i(k,n[g],f[g],h[g],v,d,m,y);--g}else n.forEach(k.add);return f=h=n=s=null,k}var o,a=Ar,c=Nr;return(o=arguments.length)?(a=cu,c=lu,3===o&&(u=e,r=t,e=t=0),i(n)):(i.x=function(n){return arguments.length?(a=n,i):a},i.y=function(n){return arguments.length?(c=n,i):c},i.extent=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=+n[0][0],e=+n[0][1],r=+n[1][0],u=+n[1][1]),i):null==t?null:[[t,e],[r,u]]},i.size=function(n){return arguments.length?(null==n?t=e=r=u=null:(t=e=0,r=+n[0],u=+n[1]),i):null==t?null:[r-t,u-e]},i)},ta.interpolateRgb=gu,ta.interpolateObject=pu,ta.interpolateNumber=vu,ta.interpolateString=du;var il=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ol=new RegExp(il.source,"g");ta.interpolate=mu,ta.interpolators=[function(n,t){var e=typeof t;return("string"===e?Ga.has(t)||/^(#|rgb\(|hsl\()/.test(t)?gu:du:t instanceof ot?gu:Array.isArray(t)?yu:"object"===e&&isNaN(t)?pu:vu)(n,t)}],ta.interpolateArray=yu;var al=function(){return y},cl=ta.map({linear:al,poly:ku,quad:function(){return _u},cubic:function(){return wu},sin:function(){return Eu},exp:function(){return Au},circle:function(){return Nu},elastic:Cu,back:zu,bounce:function(){return qu}}),ll=ta.map({"in":y,out:xu,"in-out":bu,"out-in":function(n){return bu(xu(n))}});ta.ease=function(n){var t=n.indexOf("-"),e=t>=0?n.slice(0,t):n,r=t>=0?n.slice(t+1):"in";return e=cl.get(e)||al,r=ll.get(r)||y,Mu(r(e.apply(null,ea.call(arguments,1))))},ta.interpolateHcl=Lu,ta.interpolateHsl=Tu,ta.interpolateLab=Ru,ta.interpolateRound=Du,ta.transform=function(n){var t=ua.createElementNS(ta.ns.prefix.svg,"g");return(ta.transform=function(n){if(null!=n){t.setAttribute("transform",n);var e=t.transform.baseVal.consolidate()}return new Pu(e?e.matrix:sl)})(n)},Pu.prototype.toString=function(){return"translate("+this.translate+")rotate("+this.rotate+")skewX("+this.skew+")scale("+this.scale+")"};var sl={a:1,b:0,c:0,d:1,e:0,f:0};ta.interpolateTransform=Hu,ta.layout={},ta.layout.bundle=function(){return function(n){for(var t=[],e=-1,r=n.length;++e<r;)t.push(Yu(n[e]));return t}},ta.layout.chord=function(){function n(){var n,l,f,h,g,p={},v=[],d=ta.range(i),m=[];for(e=[],r=[],n=0,h=-1;++h<i;){for(l=0,g=-1;++g<i;)l+=u[h][g];v.push(l),m.push(ta.range(i)),n+=l}for(o&&d.sort(function(n,t){return o(v[n],v[t])}),a&&m.forEach(function(n,t){n.sort(function(n,e){return a(u[t][n],u[t][e])})}),n=(La-s*i)/n,l=0,h=-1;++h<i;){for(f=l,g=-1;++g<i;){var y=d[h],M=m[y][g],x=u[y][M],b=l,_=l+=x*n;p[y+"-"+M]={index:y,subindex:M,startAngle:b,endAngle:_,value:x}}r[y]={index:y,startAngle:f,endAngle:l,value:(l-f)/n},l+=s}for(h=-1;++h<i;)for(g=h-1;++g<i;){var w=p[h+"-"+g],S=p[g+"-"+h];(w.value||S.value)&&e.push(w.value<S.value?{source:S,target:w}:{source:w,target:S})}c&&t()}function t(){e.sort(function(n,t){return c((n.source.value+n.target.value)/2,(t.source.value+t.target.value)/2)})}var e,r,u,i,o,a,c,l={},s=0;return l.matrix=function(n){return arguments.length?(i=(u=n)&&u.length,e=r=null,l):u},l.padding=function(n){return arguments.length?(s=n,e=r=null,l):s},l.sortGroups=function(n){return arguments.length?(o=n,e=r=null,l):o},l.sortSubgroups=function(n){return arguments.length?(a=n,e=null,l):a},l.sortChords=function(n){return arguments.length?(c=n,e&&t(),l):c},l.chords=function(){return e||n(),e},l.groups=function(){return r||n(),r},l},ta.layout.force=function(){function n(n){return function(t,e,r,u){if(t.point!==n){var i=t.cx-n.x,o=t.cy-n.y,a=u-e,c=i*i+o*o;if(c>a*a/d){if(p>c){var l=t.charge/c;n.px-=i*l,n.py-=o*l}return!0}if(t.point&&c&&p>c){var l=t.pointCharge/c;n.px-=i*l,n.py-=o*l}}return!t.charge}}function t(n){n.px=ta.event.x,n.py=ta.event.y,a.resume()}var e,r,u,i,o,a={},c=ta.dispatch("start","tick","end"),l=[1,1],s=.9,f=fl,h=hl,g=-30,p=gl,v=.1,d=.64,m=[],M=[];return a.tick=function(){if((r*=.99)<.005)return c.end({type:"end",alpha:r=0}),!0;var t,e,a,f,h,p,d,y,x,b=m.length,_=M.length;for(e=0;_>e;++e)a=M[e],f=a.source,h=a.target,y=h.x-f.x,x=h.y-f.y,(p=y*y+x*x)&&(p=r*i[e]*((p=Math.sqrt(p))-u[e])/p,y*=p,x*=p,h.x-=y*(d=f.weight/(h.weight+f.weight)),h.y-=x*d,f.x+=y*(d=1-d),f.y+=x*d);if((d=r*v)&&(y=l[0]/2,x=l[1]/2,e=-1,d))for(;++e<b;)a=m[e],a.x+=(y-a.x)*d,a.y+=(x-a.y)*d;if(g)for(Ju(t=ta.geom.quadtree(m),r,o),e=-1;++e<b;)(a=m[e]).fixed||t.visit(n(a));for(e=-1;++e<b;)a=m[e],a.fixed?(a.x=a.px,a.y=a.py):(a.x-=(a.px-(a.px=a.x))*s,a.y-=(a.py-(a.py=a.y))*s);c.tick({type:"tick",alpha:r})},a.nodes=function(n){return arguments.length?(m=n,a):m},a.links=function(n){return arguments.length?(M=n,a):M},a.size=function(n){return arguments.length?(l=n,a):l},a.linkDistance=function(n){return arguments.length?(f="function"==typeof n?n:+n,a):f},a.distance=a.linkDistance,a.linkStrength=function(n){return arguments.length?(h="function"==typeof n?n:+n,a):h},a.friction=function(n){return arguments.length?(s=+n,a):s},a.charge=function(n){return arguments.length?(g="function"==typeof n?n:+n,a):g},a.chargeDistance=function(n){return arguments.length?(p=n*n,a):Math.sqrt(p)},a.gravity=function(n){return arguments.length?(v=+n,a):v},a.theta=function(n){return arguments.length?(d=n*n,a):Math.sqrt(d)},a.alpha=function(n){return arguments.length?(n=+n,r?r=n>0?n:0:n>0&&(c.start({type:"start",alpha:r=n}),ta.timer(a.tick)),a):r},a.start=function(){function n(n,r){if(!e){for(e=new Array(c),a=0;c>a;++a)e[a]=[];for(a=0;s>a;++a){var u=M[a];e[u.source.index].push(u.target),e[u.target.index].push(u.source)}}for(var i,o=e[t],a=-1,l=o.length;++a<l;)if(!isNaN(i=o[a][n]))return i;return Math.random()*r}var t,e,r,c=m.length,s=M.length,p=l[0],v=l[1];for(t=0;c>t;++t)(r=m[t]).index=t,r.weight=0;for(t=0;s>t;++t)r=M[t],"number"==typeof r.source&&(r.source=m[r.source]),"number"==typeof r.target&&(r.target=m[r.target]),++r.source.weight,++r.target.weight;for(t=0;c>t;++t)r=m[t],isNaN(r.x)&&(r.x=n("x",p)),isNaN(r.y)&&(r.y=n("y",v)),isNaN(r.px)&&(r.px=r.x),isNaN(r.py)&&(r.py=r.y);if(u=[],"function"==typeof f)for(t=0;s>t;++t)u[t]=+f.call(this,M[t],t);else for(t=0;s>t;++t)u[t]=f;if(i=[],"function"==typeof h)for(t=0;s>t;++t)i[t]=+h.call(this,M[t],t);else for(t=0;s>t;++t)i[t]=h;if(o=[],"function"==typeof g)for(t=0;c>t;++t)o[t]=+g.call(this,m[t],t);else for(t=0;c>t;++t)o[t]=g;return a.resume()},a.resume=function(){return a.alpha(.1)},a.stop=function(){return a.alpha(0)},a.drag=function(){return e||(e=ta.behavior.drag().origin(y).on("dragstart.force",Xu).on("drag.force",t).on("dragend.force",$u)),arguments.length?void this.on("mouseover.force",Bu).on("mouseout.force",Wu).call(e):e},ta.rebind(a,c,"on")};var fl=20,hl=1,gl=1/0;ta.layout.hierarchy=function(){function n(u){var i,o=[u],a=[];for(u.depth=0;null!=(i=o.pop());)if(a.push(i),(l=e.call(n,i,i.depth))&&(c=l.length)){for(var c,l,s;--c>=0;)o.push(s=l[c]),s.parent=i,s.depth=i.depth+1;r&&(i.value=0),i.children=l}else r&&(i.value=+r.call(n,i,i.depth)||0),delete i.children;return Qu(u,function(n){var e,u;t&&(e=n.children)&&e.sort(t),r&&(u=n.parent)&&(u.value+=n.value)}),a}var t=ei,e=ni,r=ti;return n.sort=function(e){return arguments.length?(t=e,n):t},n.children=function(t){return arguments.length?(e=t,n):e},n.value=function(t){return arguments.length?(r=t,n):r},n.revalue=function(t){return r&&(Ku(t,function(n){n.children&&(n.value=0)}),Qu(t,function(t){var e;t.children||(t.value=+r.call(n,t,t.depth)||0),(e=t.parent)&&(e.value+=t.value)})),t},n},ta.layout.partition=function(){function n(t,e,r,u){var i=t.children;if(t.x=e,t.y=t.depth*u,t.dx=r,t.dy=u,i&&(o=i.length)){var o,a,c,l=-1;for(r=t.value?r/t.value:0;++l<o;)n(a=i[l],e,c=a.value*r,u),e+=c}}function t(n){var e=n.children,r=0;if(e&&(u=e.length))for(var u,i=-1;++i<u;)r=Math.max(r,t(e[i]));return 1+r}function e(e,i){var o=r.call(this,e,i);return n(o[0],0,u[0],u[1]/t(o[0])),o}var r=ta.layout.hierarchy(),u=[1,1];return e.size=function(n){return arguments.length?(u=n,e):u},Gu(e,r)},ta.layout.pie=function(){function n(o){var a,c=o.length,l=o.map(function(e,r){return+t.call(n,e,r)}),s=+("function"==typeof r?r.apply(this,arguments):r),f=("function"==typeof u?u.apply(this,arguments):u)-s,h=Math.min(Math.abs(f)/c,+("function"==typeof i?i.apply(this,arguments):i)),g=h*(0>f?-1:1),p=(f-c*g)/ta.sum(l),v=ta.range(c),d=[];return null!=e&&v.sort(e===pl?function(n,t){return l[t]-l[n]}:function(n,t){return e(o[n],o[t])}),v.forEach(function(n){d[n]={data:o[n],value:a=l[n],startAngle:s,endAngle:s+=a*p+g,padAngle:h}}),d}var t=Number,e=pl,r=0,u=La,i=0;return n.value=function(e){return arguments.length?(t=e,n):t},n.sort=function(t){return arguments.length?(e=t,n):e},n.startAngle=function(t){return arguments.length?(r=t,n):r},n.endAngle=function(t){return arguments.length?(u=t,n):u},n.padAngle=function(t){return arguments.length?(i=t,n):i},n};var pl={};ta.layout.stack=function(){function n(a,c){if(!(h=a.length))return a;var l=a.map(function(e,r){return t.call(n,e,r)}),s=l.map(function(t){return t.map(function(t,e){return[i.call(n,t,e),o.call(n,t,e)]})}),f=e.call(n,s,c);l=ta.permute(l,f),s=ta.permute(s,f);var h,g,p,v,d=r.call(n,s,c),m=l[0].length;for(p=0;m>p;++p)for(u.call(n,l[0][p],v=d[p],s[0][p][1]),g=1;h>g;++g)u.call(n,l[g][p],v+=s[g-1][p][1],s[g][p][1]);return a}var t=y,e=ai,r=ci,u=oi,i=ui,o=ii;return n.values=function(e){return arguments.length?(t=e,n):t},n.order=function(t){return arguments.length?(e="function"==typeof t?t:vl.get(t)||ai,n):e},n.offset=function(t){return arguments.length?(r="function"==typeof t?t:dl.get(t)||ci,n):r},n.x=function(t){return arguments.length?(i=t,n):i},n.y=function(t){return arguments.length?(o=t,n):o},n.out=function(t){return arguments.length?(u=t,n):u},n};var vl=ta.map({"inside-out":function(n){var t,e,r=n.length,u=n.map(li),i=n.map(si),o=ta.range(r).sort(function(n,t){return u[n]-u[t]}),a=0,c=0,l=[],s=[];for(t=0;r>t;++t)e=o[t],c>a?(a+=i[e],l.push(e)):(c+=i[e],s.push(e));return s.reverse().concat(l)},reverse:function(n){return ta.range(n.length).reverse()},"default":ai}),dl=ta.map({silhouette:function(n){var t,e,r,u=n.length,i=n[0].length,o=[],a=0,c=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];r>a&&(a=r),o.push(r)}for(e=0;i>e;++e)c[e]=(a-o[e])/2;return c},wiggle:function(n){var t,e,r,u,i,o,a,c,l,s=n.length,f=n[0],h=f.length,g=[];for(g[0]=c=l=0,e=1;h>e;++e){for(t=0,u=0;s>t;++t)u+=n[t][e][1];for(t=0,i=0,a=f[e][0]-f[e-1][0];s>t;++t){for(r=0,o=(n[t][e][1]-n[t][e-1][1])/(2*a);t>r;++r)o+=(n[r][e][1]-n[r][e-1][1])/a;i+=o*n[t][e][1]}g[e]=c-=u?i/u*a:0,l>c&&(l=c)}for(e=0;h>e;++e)g[e]-=l;return g},expand:function(n){var t,e,r,u=n.length,i=n[0].length,o=1/u,a=[];for(e=0;i>e;++e){for(t=0,r=0;u>t;t++)r+=n[t][e][1];if(r)for(t=0;u>t;t++)n[t][e][1]/=r;else for(t=0;u>t;t++)n[t][e][1]=o}for(e=0;i>e;++e)a[e]=0;return a},zero:ci});ta.layout.histogram=function(){function n(n,i){for(var o,a,c=[],l=n.map(e,this),s=r.call(this,l,i),f=u.call(this,s,l,i),i=-1,h=l.length,g=f.length-1,p=t?1:1/h;++i<g;)o=c[i]=[],o.dx=f[i+1]-(o.x=f[i]),o.y=0;if(g>0)for(i=-1;++i<h;)a=l[i],a>=s[0]&&a<=s[1]&&(o=c[ta.bisect(f,a,1,g)-1],o.y+=p,o.push(n[i]));return c}var t=!0,e=Number,r=pi,u=hi;return n.value=function(t){return arguments.length?(e=t,n):e},n.range=function(t){return arguments.length?(r=Et(t),n):r},n.bins=function(t){return arguments.length?(u="number"==typeof t?function(n){return gi(n,t)}:Et(t),n):u},n.frequency=function(e){return arguments.length?(t=!!e,n):t},n},ta.layout.pack=function(){function n(n,i){var o=e.call(this,n,i),a=o[0],c=u[0],l=u[1],s=null==t?Math.sqrt:"function"==typeof t?t:function(){return t};if(a.x=a.y=0,Qu(a,function(n){n.r=+s(n.value)}),Qu(a,Mi),r){var f=r*(t?1:Math.max(2*a.r/c,2*a.r/l))/2;Qu(a,function(n){n.r+=f}),Qu(a,Mi),Qu(a,function(n){n.r-=f})}return _i(a,c/2,l/2,t?1:1/Math.max(2*a.r/c,2*a.r/l)),o}var t,e=ta.layout.hierarchy().sort(vi),r=0,u=[1,1];return n.size=function(t){return arguments.length?(u=t,n):u},n.radius=function(e){return arguments.length?(t=null==e||"function"==typeof e?e:+e,n):t},n.padding=function(t){return arguments.length?(r=+t,n):r},Gu(n,e)},ta.layout.tree=function(){function n(n,u){var s=o.call(this,n,u),f=s[0],h=t(f);if(Qu(h,e),h.parent.m=-h.z,Ku(h,r),l)Ku(f,i);else{var g=f,p=f,v=f;Ku(f,function(n){n.x<g.x&&(g=n),n.x>p.x&&(p=n),n.depth>v.depth&&(v=n)});var d=a(g,p)/2-g.x,m=c[0]/(p.x+a(p,g)/2+d),y=c[1]/(v.depth||1);Ku(f,function(n){n.x=(n.x+d)*m,n.y=n.depth*y})}return s}function t(n){for(var t,e={A:null,children:[n]},r=[e];null!=(t=r.pop());)for(var u,i=t.children,o=0,a=i.length;a>o;++o)r.push((i[o]=u={_:i[o],parent:t,children:(u=i[o].children)&&u.slice()||[],A:null,a:null,z:0,m:0,c:0,s:0,t:null,i:o}).a=u);return e.children[0]}function e(n){var t=n.children,e=n.parent.children,r=n.i?e[n.i-1]:null;if(t.length){Ni(n);var i=(t[0].z+t[t.length-1].z)/2;r?(n.z=r.z+a(n._,r._),n.m=n.z-i):n.z=i}else r&&(n.z=r.z+a(n._,r._));n.parent.A=u(n,r,n.parent.A||e[0])}function r(n){n._.x=n.z+n.parent.m,n.m+=n.parent.m}function u(n,t,e){if(t){for(var r,u=n,i=n,o=t,c=u.parent.children[0],l=u.m,s=i.m,f=o.m,h=c.m;o=Ei(o),u=ki(u),o&&u;)c=ki(c),i=Ei(i),i.a=n,r=o.z+f-u.z-l+a(o._,u._),r>0&&(Ai(Ci(o,n,e),n,r),l+=r,s+=r),f+=o.m,l+=u.m,h+=c.m,s+=i.m;o&&!Ei(i)&&(i.t=o,i.m+=f-s),u&&!ki(c)&&(c.t=u,c.m+=l-h,e=n)}return e}function i(n){n.x*=c[0],n.y=n.depth*c[1]}var o=ta.layout.hierarchy().sort(null).value(null),a=Si,c=[1,1],l=null;return n.separation=function(t){return arguments.length?(a=t,n):a},n.size=function(t){return arguments.length?(l=null==(c=t)?i:null,n):l?null:c},n.nodeSize=function(t){return arguments.length?(l=null==(c=t)?null:i,n):l?c:null},Gu(n,o)},ta.layout.cluster=function(){function n(n,i){var o,a=t.call(this,n,i),c=a[0],l=0;Qu(c,function(n){var t=n.children;t&&t.length?(n.x=qi(t),n.y=zi(t)):(n.x=o?l+=e(n,o):0,n.y=0,o=n)});var s=Li(c),f=Ti(c),h=s.x-e(s,f)/2,g=f.x+e(f,s)/2;return Qu(c,u?function(n){n.x=(n.x-c.x)*r[0],n.y=(c.y-n.y)*r[1]}:function(n){n.x=(n.x-h)/(g-h)*r[0],n.y=(1-(c.y?n.y/c.y:1))*r[1]}),a}var t=ta.layout.hierarchy().sort(null).value(null),e=Si,r=[1,1],u=!1;return n.separation=function(t){return arguments.length?(e=t,n):e},n.size=function(t){return arguments.length?(u=null==(r=t),n):u?null:r},n.nodeSize=function(t){return arguments.length?(u=null!=(r=t),n):u?r:null},Gu(n,t)},ta.layout.treemap=function(){function n(n,t){for(var e,r,u=-1,i=n.length;++u<i;)r=(e=n[u]).value*(0>t?0:t),e.area=isNaN(r)||0>=r?0:r}function t(e){var i=e.children;if(i&&i.length){var o,a,c,l=f(e),s=[],h=i.slice(),p=1/0,v="slice"===g?l.dx:"dice"===g?l.dy:"slice-dice"===g?1&e.depth?l.dy:l.dx:Math.min(l.dx,l.dy);for(n(h,l.dx*l.dy/e.value),s.area=0;(c=h.length)>0;)s.push(o=h[c-1]),s.area+=o.area,"squarify"!==g||(a=r(s,v))<=p?(h.pop(),p=a):(s.area-=s.pop().area,u(s,v,l,!1),v=Math.min(l.dx,l.dy),s.length=s.area=0,p=1/0);s.length&&(u(s,v,l,!0),s.length=s.area=0),i.forEach(t)}}function e(t){var r=t.children;if(r&&r.length){var i,o=f(t),a=r.slice(),c=[];for(n(a,o.dx*o.dy/t.value),c.area=0;i=a.pop();)c.push(i),c.area+=i.area,null!=i.z&&(u(c,i.z?o.dx:o.dy,o,!a.length),c.length=c.area=0);r.forEach(e)}}function r(n,t){for(var e,r=n.area,u=0,i=1/0,o=-1,a=n.length;++o<a;)(e=n[o].area)&&(i>e&&(i=e),e>u&&(u=e));return r*=r,t*=t,r?Math.max(t*u*p/r,r/(t*i*p)):1/0}function u(n,t,e,r){var u,i=-1,o=n.length,a=e.x,l=e.y,s=t?c(n.area/t):0;if(t==e.dx){for((r||s>e.dy)&&(s=e.dy);++i<o;)u=n[i],u.x=a,u.y=l,u.dy=s,a+=u.dx=Math.min(e.x+e.dx-a,s?c(u.area/s):0);u.z=!0,u.dx+=e.x+e.dx-a,e.y+=s,e.dy-=s}else{for((r||s>e.dx)&&(s=e.dx);++i<o;)u=n[i],u.x=a,u.y=l,u.dx=s,l+=u.dy=Math.min(e.y+e.dy-l,s?c(u.area/s):0);u.z=!1,u.dy+=e.y+e.dy-l,e.x+=s,e.dx-=s}}function i(r){var u=o||a(r),i=u[0];return i.x=0,i.y=0,i.dx=l[0],i.dy=l[1],o&&a.revalue(i),n([i],i.dx*i.dy/i.value),(o?e:t)(i),h&&(o=u),u}var o,a=ta.layout.hierarchy(),c=Math.round,l=[1,1],s=null,f=Ri,h=!1,g="squarify",p=.5*(1+Math.sqrt(5));
+return i.size=function(n){return arguments.length?(l=n,i):l},i.padding=function(n){function t(t){var e=n.call(i,t,t.depth);return null==e?Ri(t):Di(t,"number"==typeof e?[e,e,e,e]:e)}function e(t){return Di(t,n)}if(!arguments.length)return s;var r;return f=null==(s=n)?Ri:"function"==(r=typeof n)?t:"number"===r?(n=[n,n,n,n],e):e,i},i.round=function(n){return arguments.length?(c=n?Math.round:Number,i):c!=Number},i.sticky=function(n){return arguments.length?(h=n,o=null,i):h},i.ratio=function(n){return arguments.length?(p=n,i):p},i.mode=function(n){return arguments.length?(g=n+"",i):g},Gu(i,a)},ta.random={normal:function(n,t){var e=arguments.length;return 2>e&&(t=1),1>e&&(n=0),function(){var e,r,u;do e=2*Math.random()-1,r=2*Math.random()-1,u=e*e+r*r;while(!u||u>1);return n+t*e*Math.sqrt(-2*Math.log(u)/u)}},logNormal:function(){var n=ta.random.normal.apply(ta,arguments);return function(){return Math.exp(n())}},bates:function(n){var t=ta.random.irwinHall(n);return function(){return t()/n}},irwinHall:function(n){return function(){for(var t=0,e=0;n>e;e++)t+=Math.random();return t}}},ta.scale={};var ml={floor:y,ceil:y};ta.scale.linear=function(){return Ii([0,1],[0,1],mu,!1)};var yl={s:1,g:1,p:1,r:1,e:1};ta.scale.log=function(){return Ji(ta.scale.linear().domain([0,1]),10,!0,[1,10])};var Ml=ta.format(".0e"),xl={floor:function(n){return-Math.ceil(-n)},ceil:function(n){return-Math.floor(-n)}};ta.scale.pow=function(){return Gi(ta.scale.linear(),1,[0,1])},ta.scale.sqrt=function(){return ta.scale.pow().exponent(.5)},ta.scale.ordinal=function(){return Qi([],{t:"range",a:[[]]})},ta.scale.category10=function(){return ta.scale.ordinal().range(bl)},ta.scale.category20=function(){return ta.scale.ordinal().range(_l)},ta.scale.category20b=function(){return ta.scale.ordinal().range(wl)},ta.scale.category20c=function(){return ta.scale.ordinal().range(Sl)};var bl=[2062260,16744206,2924588,14034728,9725885,9197131,14907330,8355711,12369186,1556175].map(Mt),_l=[2062260,11454440,16744206,16759672,2924588,10018698,14034728,16750742,9725885,12955861,9197131,12885140,14907330,16234194,8355711,13092807,12369186,14408589,1556175,10410725].map(Mt),wl=[3750777,5395619,7040719,10264286,6519097,9216594,11915115,13556636,9202993,12426809,15186514,15190932,8666169,11356490,14049643,15177372,8077683,10834324,13528509,14589654].map(Mt),Sl=[3244733,7057110,10406625,13032431,15095053,16616764,16625259,16634018,3253076,7652470,10607003,13101504,7695281,10394312,12369372,14342891,6513507,9868950,12434877,14277081].map(Mt);ta.scale.quantile=function(){return no([],[])},ta.scale.quantize=function(){return to(0,1,[0,1])},ta.scale.threshold=function(){return eo([.5],[0,1])},ta.scale.identity=function(){return ro([0,1])},ta.svg={},ta.svg.arc=function(){function n(){var n=Math.max(0,+e.apply(this,arguments)),l=Math.max(0,+r.apply(this,arguments)),s=o.apply(this,arguments)-Ra,f=a.apply(this,arguments)-Ra,h=Math.abs(f-s),g=s>f?0:1;if(n>l&&(p=l,l=n,n=p),h>=Ta)return t(l,g)+(n?t(n,1-g):"")+"Z";var p,v,d,m,y,M,x,b,_,w,S,k,E=0,A=0,N=[];if((m=(+c.apply(this,arguments)||0)/2)&&(d=i===kl?Math.sqrt(n*n+l*l):+i.apply(this,arguments),g||(A*=-1),l&&(A=tt(d/l*Math.sin(m))),n&&(E=tt(d/n*Math.sin(m)))),l){y=l*Math.cos(s+A),M=l*Math.sin(s+A),x=l*Math.cos(f-A),b=l*Math.sin(f-A);var C=Math.abs(f-s-2*A)<=qa?0:1;if(A&&so(y,M,x,b)===g^C){var z=(s+f)/2;y=l*Math.cos(z),M=l*Math.sin(z),x=b=null}}else y=M=0;if(n){_=n*Math.cos(f-E),w=n*Math.sin(f-E),S=n*Math.cos(s+E),k=n*Math.sin(s+E);var q=Math.abs(s-f+2*E)<=qa?0:1;if(E&&so(_,w,S,k)===1-g^q){var L=(s+f)/2;_=n*Math.cos(L),w=n*Math.sin(L),S=k=null}}else _=w=0;if((p=Math.min(Math.abs(l-n)/2,+u.apply(this,arguments)))>.001){v=l>n^g?0:1;var T=null==S?[_,w]:null==x?[y,M]:Lr([y,M],[S,k],[x,b],[_,w]),R=y-T[0],D=M-T[1],P=x-T[0],U=b-T[1],j=1/Math.sin(Math.acos((R*P+D*U)/(Math.sqrt(R*R+D*D)*Math.sqrt(P*P+U*U)))/2),F=Math.sqrt(T[0]*T[0]+T[1]*T[1]);if(null!=x){var H=Math.min(p,(l-F)/(j+1)),O=fo(null==S?[_,w]:[S,k],[y,M],l,H,g),I=fo([x,b],[_,w],l,H,g);p===H?N.push("M",O[0],"A",H,",",H," 0 0,",v," ",O[1],"A",l,",",l," 0 ",1-g^so(O[1][0],O[1][1],I[1][0],I[1][1]),",",g," ",I[1],"A",H,",",H," 0 0,",v," ",I[0]):N.push("M",O[0],"A",H,",",H," 0 1,",v," ",I[0])}else N.push("M",y,",",M);if(null!=S){var Y=Math.min(p,(n-F)/(j-1)),Z=fo([y,M],[S,k],n,-Y,g),V=fo([_,w],null==x?[y,M]:[x,b],n,-Y,g);p===Y?N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",V[1],"A",n,",",n," 0 ",g^so(V[1][0],V[1][1],Z[1][0],Z[1][1]),",",1-g," ",Z[1],"A",Y,",",Y," 0 0,",v," ",Z[0]):N.push("L",V[0],"A",Y,",",Y," 0 0,",v," ",Z[0])}else N.push("L",_,",",w)}else N.push("M",y,",",M),null!=x&&N.push("A",l,",",l," 0 ",C,",",g," ",x,",",b),N.push("L",_,",",w),null!=S&&N.push("A",n,",",n," 0 ",q,",",1-g," ",S,",",k);return N.push("Z"),N.join("")}function t(n,t){return"M0,"+n+"A"+n+","+n+" 0 1,"+t+" 0,"+-n+"A"+n+","+n+" 0 1,"+t+" 0,"+n}var e=io,r=oo,u=uo,i=kl,o=ao,a=co,c=lo;return n.innerRadius=function(t){return arguments.length?(e=Et(t),n):e},n.outerRadius=function(t){return arguments.length?(r=Et(t),n):r},n.cornerRadius=function(t){return arguments.length?(u=Et(t),n):u},n.padRadius=function(t){return arguments.length?(i=t==kl?kl:Et(t),n):i},n.startAngle=function(t){return arguments.length?(o=Et(t),n):o},n.endAngle=function(t){return arguments.length?(a=Et(t),n):a},n.padAngle=function(t){return arguments.length?(c=Et(t),n):c},n.centroid=function(){var n=(+e.apply(this,arguments)+ +r.apply(this,arguments))/2,t=(+o.apply(this,arguments)+ +a.apply(this,arguments))/2-Ra;return[Math.cos(t)*n,Math.sin(t)*n]},n};var kl="auto";ta.svg.line=function(){return ho(y)};var El=ta.map({linear:go,"linear-closed":po,step:vo,"step-before":mo,"step-after":yo,basis:So,"basis-open":ko,"basis-closed":Eo,bundle:Ao,cardinal:bo,"cardinal-open":Mo,"cardinal-closed":xo,monotone:To});El.forEach(function(n,t){t.key=n,t.closed=/-closed$/.test(n)});var Al=[0,2/3,1/3,0],Nl=[0,1/3,2/3,0],Cl=[0,1/6,2/3,1/6];ta.svg.line.radial=function(){var n=ho(Ro);return n.radius=n.x,delete n.x,n.angle=n.y,delete n.y,n},mo.reverse=yo,yo.reverse=mo,ta.svg.area=function(){return Do(y)},ta.svg.area.radial=function(){var n=Do(Ro);return n.radius=n.x,delete n.x,n.innerRadius=n.x0,delete n.x0,n.outerRadius=n.x1,delete n.x1,n.angle=n.y,delete n.y,n.startAngle=n.y0,delete n.y0,n.endAngle=n.y1,delete n.y1,n},ta.svg.chord=function(){function n(n,a){var c=t(this,i,n,a),l=t(this,o,n,a);return"M"+c.p0+r(c.r,c.p1,c.a1-c.a0)+(e(c,l)?u(c.r,c.p1,c.r,c.p0):u(c.r,c.p1,l.r,l.p0)+r(l.r,l.p1,l.a1-l.a0)+u(l.r,l.p1,c.r,c.p0))+"Z"}function t(n,t,e,r){var u=t.call(n,e,r),i=a.call(n,u,r),o=c.call(n,u,r)-Ra,s=l.call(n,u,r)-Ra;return{r:i,a0:o,a1:s,p0:[i*Math.cos(o),i*Math.sin(o)],p1:[i*Math.cos(s),i*Math.sin(s)]}}function e(n,t){return n.a0==t.a0&&n.a1==t.a1}function r(n,t,e){return"A"+n+","+n+" 0 "+ +(e>qa)+",1 "+t}function u(n,t,e,r){return"Q 0,0 "+r}var i=mr,o=yr,a=Po,c=ao,l=co;return n.radius=function(t){return arguments.length?(a=Et(t),n):a},n.source=function(t){return arguments.length?(i=Et(t),n):i},n.target=function(t){return arguments.length?(o=Et(t),n):o},n.startAngle=function(t){return arguments.length?(c=Et(t),n):c},n.endAngle=function(t){return arguments.length?(l=Et(t),n):l},n},ta.svg.diagonal=function(){function n(n,u){var i=t.call(this,n,u),o=e.call(this,n,u),a=(i.y+o.y)/2,c=[i,{x:i.x,y:a},{x:o.x,y:a},o];return c=c.map(r),"M"+c[0]+"C"+c[1]+" "+c[2]+" "+c[3]}var t=mr,e=yr,r=Uo;return n.source=function(e){return arguments.length?(t=Et(e),n):t},n.target=function(t){return arguments.length?(e=Et(t),n):e},n.projection=function(t){return arguments.length?(r=t,n):r},n},ta.svg.diagonal.radial=function(){var n=ta.svg.diagonal(),t=Uo,e=n.projection;return n.projection=function(n){return arguments.length?e(jo(t=n)):t},n},ta.svg.symbol=function(){function n(n,r){return(zl.get(t.call(this,n,r))||Oo)(e.call(this,n,r))}var t=Ho,e=Fo;return n.type=function(e){return arguments.length?(t=Et(e),n):t},n.size=function(t){return arguments.length?(e=Et(t),n):e},n};var zl=ta.map({circle:Oo,cross:function(n){var t=Math.sqrt(n/5)/2;return"M"+-3*t+","+-t+"H"+-t+"V"+-3*t+"H"+t+"V"+-t+"H"+3*t+"V"+t+"H"+t+"V"+3*t+"H"+-t+"V"+t+"H"+-3*t+"Z"},diamond:function(n){var t=Math.sqrt(n/(2*Ll)),e=t*Ll;return"M0,"+-t+"L"+e+",0 0,"+t+" "+-e+",0Z"},square:function(n){var t=Math.sqrt(n)/2;return"M"+-t+","+-t+"L"+t+","+-t+" "+t+","+t+" "+-t+","+t+"Z"},"triangle-down":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+e+"L"+t+","+-e+" "+-t+","+-e+"Z"},"triangle-up":function(n){var t=Math.sqrt(n/ql),e=t*ql/2;return"M0,"+-e+"L"+t+","+e+" "+-t+","+e+"Z"}});ta.svg.symbolTypes=zl.keys();var ql=Math.sqrt(3),Ll=Math.tan(30*Da);_a.transition=function(n){for(var t,e,r=Tl||++Ul,u=Xo(n),i=[],o=Rl||{time:Date.now(),ease:Su,delay:0,duration:250},a=-1,c=this.length;++a<c;){i.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(e=l[s])&&$o(e,s,u,r,o),t.push(e)}return Yo(i,u,r)},_a.interrupt=function(n){return this.each(null==n?Dl:Io(Xo(n)))};var Tl,Rl,Dl=Io(Xo()),Pl=[],Ul=0;Pl.call=_a.call,Pl.empty=_a.empty,Pl.node=_a.node,Pl.size=_a.size,ta.transition=function(n,t){return n&&n.transition?Tl?n.transition(t):n:ta.selection().transition(n)},ta.transition.prototype=Pl,Pl.select=function(n){var t,e,r,u=this.id,i=this.namespace,o=[];n=N(n);for(var a=-1,c=this.length;++a<c;){o.push(t=[]);for(var l=this[a],s=-1,f=l.length;++s<f;)(r=l[s])&&(e=n.call(r,r.__data__,s,a))?("__data__"in r&&(e.__data__=r.__data__),$o(e,s,i,u,r[i][u]),t.push(e)):t.push(null)}return Yo(o,i,u)},Pl.selectAll=function(n){var t,e,r,u,i,o=this.id,a=this.namespace,c=[];n=C(n);for(var l=-1,s=this.length;++l<s;)for(var f=this[l],h=-1,g=f.length;++h<g;)if(r=f[h]){i=r[a][o],e=n.call(r,r.__data__,h,l),c.push(t=[]);for(var p=-1,v=e.length;++p<v;)(u=e[p])&&$o(u,p,a,o,i),t.push(u)}return Yo(c,a,o)},Pl.filter=function(n){var t,e,r,u=[];"function"!=typeof n&&(n=O(n));for(var i=0,o=this.length;o>i;i++){u.push(t=[]);for(var e=this[i],a=0,c=e.length;c>a;a++)(r=e[a])&&n.call(r,r.__data__,a,i)&&t.push(r)}return Yo(u,this.namespace,this.id)},Pl.tween=function(n,t){var e=this.id,r=this.namespace;return arguments.length<2?this.node()[r][e].tween.get(n):Y(this,null==t?function(t){t[r][e].tween.remove(n)}:function(u){u[r][e].tween.set(n,t)})},Pl.attr=function(n,t){function e(){this.removeAttribute(a)}function r(){this.removeAttributeNS(a.space,a.local)}function u(n){return null==n?e:(n+="",function(){var t,e=this.getAttribute(a);return e!==n&&(t=o(e,n),function(n){this.setAttribute(a,t(n))})})}function i(n){return null==n?r:(n+="",function(){var t,e=this.getAttributeNS(a.space,a.local);return e!==n&&(t=o(e,n),function(n){this.setAttributeNS(a.space,a.local,t(n))})})}if(arguments.length<2){for(t in n)this.attr(t,n[t]);return this}var o="transform"==n?Hu:mu,a=ta.ns.qualify(n);return Zo(this,"attr."+n,t,a.local?i:u)},Pl.attrTween=function(n,t){function e(n,e){var r=t.call(this,n,e,this.getAttribute(u));return r&&function(n){this.setAttribute(u,r(n))}}function r(n,e){var r=t.call(this,n,e,this.getAttributeNS(u.space,u.local));return r&&function(n){this.setAttributeNS(u.space,u.local,r(n))}}var u=ta.ns.qualify(n);return this.tween("attr."+n,u.local?r:e)},Pl.style=function(n,e,r){function u(){this.style.removeProperty(n)}function i(e){return null==e?u:(e+="",function(){var u,i=t(this).getComputedStyle(this,null).getPropertyValue(n);return i!==e&&(u=mu(i,e),function(t){this.style.setProperty(n,u(t),r)})})}var o=arguments.length;if(3>o){if("string"!=typeof n){2>o&&(e="");for(r in n)this.style(r,n[r],e);return this}r=""}return Zo(this,"style."+n,e,i)},Pl.styleTween=function(n,e,r){function u(u,i){var o=e.call(this,u,i,t(this).getComputedStyle(this,null).getPropertyValue(n));return o&&function(t){this.style.setProperty(n,o(t),r)}}return arguments.length<3&&(r=""),this.tween("style."+n,u)},Pl.text=function(n){return Zo(this,"text",n,Vo)},Pl.remove=function(){var n=this.namespace;return this.each("end.transition",function(){var t;this[n].count<2&&(t=this.parentNode)&&t.removeChild(this)})},Pl.ease=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].ease:("function"!=typeof n&&(n=ta.ease.apply(ta,arguments)),Y(this,function(r){r[e][t].ease=n}))},Pl.delay=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].delay:Y(this,"function"==typeof n?function(r,u,i){r[e][t].delay=+n.call(r,r.__data__,u,i)}:(n=+n,function(r){r[e][t].delay=n}))},Pl.duration=function(n){var t=this.id,e=this.namespace;return arguments.length<1?this.node()[e][t].duration:Y(this,"function"==typeof n?function(r,u,i){r[e][t].duration=Math.max(1,n.call(r,r.__data__,u,i))}:(n=Math.max(1,n),function(r){r[e][t].duration=n}))},Pl.each=function(n,t){var e=this.id,r=this.namespace;if(arguments.length<2){var u=Rl,i=Tl;try{Tl=e,Y(this,function(t,u,i){Rl=t[r][e],n.call(t,t.__data__,u,i)})}finally{Rl=u,Tl=i}}else Y(this,function(u){var i=u[r][e];(i.event||(i.event=ta.dispatch("start","end","interrupt"))).on(n,t)});return this},Pl.transition=function(){for(var n,t,e,r,u=this.id,i=++Ul,o=this.namespace,a=[],c=0,l=this.length;l>c;c++){a.push(n=[]);for(var t=this[c],s=0,f=t.length;f>s;s++)(e=t[s])&&(r=e[o][u],$o(e,s,o,i,{time:r.time,ease:r.ease,delay:r.delay+r.duration,duration:r.duration})),n.push(e)}return Yo(a,o,i)},ta.svg.axis=function(){function n(n){n.each(function(){var n,l=ta.select(this),s=this.__chart__||e,f=this.__chart__=e.copy(),h=null==c?f.ticks?f.ticks.apply(f,a):f.domain():c,g=null==t?f.tickFormat?f.tickFormat.apply(f,a):y:t,p=l.selectAll(".tick").data(h,f),v=p.enter().insert("g",".domain").attr("class","tick").style("opacity",Ca),d=ta.transition(p.exit()).style("opacity",Ca).remove(),m=ta.transition(p.order()).style("opacity",1),M=Math.max(u,0)+o,x=Ui(f),b=l.selectAll(".domain").data([0]),_=(b.enter().append("path").attr("class","domain"),ta.transition(b));v.append("line"),v.append("text");var w,S,k,E,A=v.select("line"),N=m.select("line"),C=p.select("text").text(g),z=v.select("text"),q=m.select("text"),L="top"===r||"left"===r?-1:1;if("bottom"===r||"top"===r?(n=Bo,w="x",k="y",S="x2",E="y2",C.attr("dy",0>L?"0em":".71em").style("text-anchor","middle"),_.attr("d","M"+x[0]+","+L*i+"V0H"+x[1]+"V"+L*i)):(n=Wo,w="y",k="x",S="y2",E="x2",C.attr("dy",".32em").style("text-anchor",0>L?"end":"start"),_.attr("d","M"+L*i+","+x[0]+"H0V"+x[1]+"H"+L*i)),A.attr(E,L*u),z.attr(k,L*M),N.attr(S,0).attr(E,L*u),q.attr(w,0).attr(k,L*M),f.rangeBand){var T=f,R=T.rangeBand()/2;s=f=function(n){return T(n)+R}}else s.rangeBand?s=f:d.call(n,f,s);v.call(n,s,f),m.call(n,f,f)})}var t,e=ta.scale.linear(),r=jl,u=6,i=6,o=3,a=[10],c=null;return n.scale=function(t){return arguments.length?(e=t,n):e},n.orient=function(t){return arguments.length?(r=t in Fl?t+"":jl,n):r},n.ticks=function(){return arguments.length?(a=arguments,n):a},n.tickValues=function(t){return arguments.length?(c=t,n):c},n.tickFormat=function(e){return arguments.length?(t=e,n):t},n.tickSize=function(t){var e=arguments.length;return e?(u=+t,i=+arguments[e-1],n):u},n.innerTickSize=function(t){return arguments.length?(u=+t,n):u},n.outerTickSize=function(t){return arguments.length?(i=+t,n):i},n.tickPadding=function(t){return arguments.length?(o=+t,n):o},n.tickSubdivide=function(){return arguments.length&&n},n};var jl="bottom",Fl={top:1,right:1,bottom:1,left:1};ta.svg.brush=function(){function n(t){t.each(function(){var t=ta.select(this).style("pointer-events","all").style("-webkit-tap-highlight-color","rgba(0,0,0,0)").on("mousedown.brush",i).on("touchstart.brush",i),o=t.selectAll(".background").data([0]);o.enter().append("rect").attr("class","background").style("visibility","hidden").style("cursor","crosshair"),t.selectAll(".extent").data([0]).enter().append("rect").attr("class","extent").style("cursor","move");var a=t.selectAll(".resize").data(v,y);a.exit().remove(),a.enter().append("g").attr("class",function(n){return"resize "+n}).style("cursor",function(n){return Hl[n]}).append("rect").attr("x",function(n){return/[ew]$/.test(n)?-3:null}).attr("y",function(n){return/^[ns]/.test(n)?-3:null}).attr("width",6).attr("height",6).style("visibility","hidden"),a.style("display",n.empty()?"none":null);var c,f=ta.transition(t),h=ta.transition(o);l&&(c=Ui(l),h.attr("x",c[0]).attr("width",c[1]-c[0]),r(f)),s&&(c=Ui(s),h.attr("y",c[0]).attr("height",c[1]-c[0]),u(f)),e(f)})}function e(n){n.selectAll(".resize").attr("transform",function(n){return"translate("+f[+/e$/.test(n)]+","+h[+/^s/.test(n)]+")"})}function r(n){n.select(".extent").attr("x",f[0]),n.selectAll(".extent,.n>rect,.s>rect").attr("width",f[1]-f[0])}function u(n){n.select(".extent").attr("y",h[0]),n.selectAll(".extent,.e>rect,.w>rect").attr("height",h[1]-h[0])}function i(){function i(){32==ta.event.keyCode&&(C||(M=null,q[0]-=f[1],q[1]-=h[1],C=2),S())}function v(){32==ta.event.keyCode&&2==C&&(q[0]+=f[1],q[1]+=h[1],C=0,S())}function d(){var n=ta.mouse(b),t=!1;x&&(n[0]+=x[0],n[1]+=x[1]),C||(ta.event.altKey?(M||(M=[(f[0]+f[1])/2,(h[0]+h[1])/2]),q[0]=f[+(n[0]<M[0])],q[1]=h[+(n[1]<M[1])]):M=null),A&&m(n,l,0)&&(r(k),t=!0),N&&m(n,s,1)&&(u(k),t=!0),t&&(e(k),w({type:"brush",mode:C?"move":"resize"}))}function m(n,t,e){var r,u,i=Ui(t),c=i[0],l=i[1],s=q[e],v=e?h:f,d=v[1]-v[0];return C&&(c-=s,l-=d+s),r=(e?p:g)?Math.max(c,Math.min(l,n[e])):n[e],C?u=(r+=s)+d:(M&&(s=Math.max(c,Math.min(l,2*M[e]-r))),r>s?(u=r,r=s):u=s),v[0]!=r||v[1]!=u?(e?a=null:o=null,v[0]=r,v[1]=u,!0):void 0}function y(){d(),k.style("pointer-events","all").selectAll(".resize").style("display",n.empty()?"none":null),ta.select("body").style("cursor",null),L.on("mousemove.brush",null).on("mouseup.brush",null).on("touchmove.brush",null).on("touchend.brush",null).on("keydown.brush",null).on("keyup.brush",null),z(),w({type:"brushend"})}var M,x,b=this,_=ta.select(ta.event.target),w=c.of(b,arguments),k=ta.select(b),E=_.datum(),A=!/^(n|s)$/.test(E)&&l,N=!/^(e|w)$/.test(E)&&s,C=_.classed("extent"),z=W(b),q=ta.mouse(b),L=ta.select(t(b)).on("keydown.brush",i).on("keyup.brush",v);if(ta.event.changedTouches?L.on("touchmove.brush",d).on("touchend.brush",y):L.on("mousemove.brush",d).on("mouseup.brush",y),k.interrupt().selectAll("*").interrupt(),C)q[0]=f[0]-q[0],q[1]=h[0]-q[1];else if(E){var T=+/w$/.test(E),R=+/^n/.test(E);x=[f[1-T]-q[0],h[1-R]-q[1]],q[0]=f[T],q[1]=h[R]}else ta.event.altKey&&(M=q.slice());k.style("pointer-events","none").selectAll(".resize").style("display",null),ta.select("body").style("cursor",_.style("cursor")),w({type:"brushstart"}),d()}var o,a,c=E(n,"brushstart","brush","brushend"),l=null,s=null,f=[0,0],h=[0,0],g=!0,p=!0,v=Ol[0];return n.event=function(n){n.each(function(){var n=c.of(this,arguments),t={x:f,y:h,i:o,j:a},e=this.__chart__||t;this.__chart__=t,Tl?ta.select(this).transition().each("start.brush",function(){o=e.i,a=e.j,f=e.x,h=e.y,n({type:"brushstart"})}).tween("brush:brush",function(){var e=yu(f,t.x),r=yu(h,t.y);return o=a=null,function(u){f=t.x=e(u),h=t.y=r(u),n({type:"brush",mode:"resize"})}}).each("end.brush",function(){o=t.i,a=t.j,n({type:"brush",mode:"resize"}),n({type:"brushend"})}):(n({type:"brushstart"}),n({type:"brush",mode:"resize"}),n({type:"brushend"}))})},n.x=function(t){return arguments.length?(l=t,v=Ol[!l<<1|!s],n):l},n.y=function(t){return arguments.length?(s=t,v=Ol[!l<<1|!s],n):s},n.clamp=function(t){return arguments.length?(l&&s?(g=!!t[0],p=!!t[1]):l?g=!!t:s&&(p=!!t),n):l&&s?[g,p]:l?g:s?p:null},n.extent=function(t){var e,r,u,i,c;return arguments.length?(l&&(e=t[0],r=t[1],s&&(e=e[0],r=r[0]),o=[e,r],l.invert&&(e=l(e),r=l(r)),e>r&&(c=e,e=r,r=c),(e!=f[0]||r!=f[1])&&(f=[e,r])),s&&(u=t[0],i=t[1],l&&(u=u[1],i=i[1]),a=[u,i],s.invert&&(u=s(u),i=s(i)),u>i&&(c=u,u=i,i=c),(u!=h[0]||i!=h[1])&&(h=[u,i])),n):(l&&(o?(e=o[0],r=o[1]):(e=f[0],r=f[1],l.invert&&(e=l.invert(e),r=l.invert(r)),e>r&&(c=e,e=r,r=c))),s&&(a?(u=a[0],i=a[1]):(u=h[0],i=h[1],s.invert&&(u=s.invert(u),i=s.invert(i)),u>i&&(c=u,u=i,i=c))),l&&s?[[e,u],[r,i]]:l?[e,r]:s&&[u,i])},n.clear=function(){return n.empty()||(f=[0,0],h=[0,0],o=a=null),n},n.empty=function(){return!!l&&f[0]==f[1]||!!s&&h[0]==h[1]},ta.rebind(n,c,"on")};var Hl={n:"ns-resize",e:"ew-resize",s:"ns-resize",w:"ew-resize",nw:"nwse-resize",ne:"nesw-resize",se:"nwse-resize",sw:"nesw-resize"},Ol=[["n","e","s","w","nw","ne","se","sw"],["e","w"],["n","s"],[]],Il=ac.format=gc.timeFormat,Yl=Il.utc,Zl=Yl("%Y-%m-%dT%H:%M:%S.%LZ");Il.iso=Date.prototype.toISOString&&+new Date("2000-01-01T00:00:00.000Z")?Jo:Zl,Jo.parse=function(n){var t=new Date(n);return isNaN(t)?null:t},Jo.toString=Zl.toString,ac.second=Ft(function(n){return new cc(1e3*Math.floor(n/1e3))},function(n,t){n.setTime(n.getTime()+1e3*Math.floor(t))},function(n){return n.getSeconds()}),ac.seconds=ac.second.range,ac.seconds.utc=ac.second.utc.range,ac.minute=Ft(function(n){return new cc(6e4*Math.floor(n/6e4))},function(n,t){n.setTime(n.getTime()+6e4*Math.floor(t))},function(n){return n.getMinutes()}),ac.minutes=ac.minute.range,ac.minutes.utc=ac.minute.utc.range,ac.hour=Ft(function(n){var t=n.getTimezoneOffset()/60;return new cc(36e5*(Math.floor(n/36e5-t)+t))},function(n,t){n.setTime(n.getTime()+36e5*Math.floor(t))},function(n){return n.getHours()}),ac.hours=ac.hour.range,ac.hours.utc=ac.hour.utc.range,ac.month=Ft(function(n){return n=ac.day(n),n.setDate(1),n},function(n,t){n.setMonth(n.getMonth()+t)},function(n){return n.getMonth()}),ac.months=ac.month.range,ac.months.utc=ac.month.utc.range;var Vl=[1e3,5e3,15e3,3e4,6e4,3e5,9e5,18e5,36e5,108e5,216e5,432e5,864e5,1728e5,6048e5,2592e6,7776e6,31536e6],Xl=[[ac.second,1],[ac.second,5],[ac.second,15],[ac.second,30],[ac.minute,1],[ac.minute,5],[ac.minute,15],[ac.minute,30],[ac.hour,1],[ac.hour,3],[ac.hour,6],[ac.hour,12],[ac.day,1],[ac.day,2],[ac.week,1],[ac.month,1],[ac.month,3],[ac.year,1]],$l=Il.multi([[".%L",function(n){return n.getMilliseconds()}],[":%S",function(n){return n.getSeconds()}],["%I:%M",function(n){return n.getMinutes()}],["%I %p",function(n){return n.getHours()}],["%a %d",function(n){return n.getDay()&&1!=n.getDate()}],["%b %d",function(n){return 1!=n.getDate()}],["%B",function(n){return n.getMonth()}],["%Y",Ne]]),Bl={range:function(n,t,e){return ta.range(Math.ceil(n/e)*e,+t,e).map(Ko)},floor:y,ceil:y};Xl.year=ac.year,ac.scale=function(){return Go(ta.scale.linear(),Xl,$l)};var Wl=Xl.map(function(n){return[n[0].utc,n[1]]}),Jl=Yl.multi([[".%L",function(n){return n.getUTCMilliseconds()}],[":%S",function(n){return n.getUTCSeconds()}],["%I:%M",function(n){return n.getUTCMinutes()}],["%I %p",function(n){return n.getUTCHours()}],["%a %d",function(n){return n.getUTCDay()&&1!=n.getUTCDate()}],["%b %d",function(n){return 1!=n.getUTCDate()}],["%B",function(n){return n.getUTCMonth()}],["%Y",Ne]]);Wl.year=ac.year.utc,ac.scale.utc=function(){return Go(ta.scale.linear(),Wl,Jl)},ta.text=At(function(n){return n.responseText}),ta.json=function(n,t){return Nt(n,"application/json",Qo,t)},ta.html=function(n,t){return Nt(n,"text/html",na,t)},ta.xml=At(function(n){return n.responseXML}),"function"==typeof define&&define.amd?define(ta):"object"==typeof module&&module.exports&&(module.exports=ta),this.d3=ta}();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js.new b/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js.new
new file mode 100644
index 000000000..8868e4250
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js.new
@@ -0,0 +1,9504 @@
+!function() {
+ var d3 = {
+ version: "3.5.5"
+ };
+ var d3_arraySlice = [].slice, d3_array = function(list) {
+ return d3_arraySlice.call(list);
+ };
+ var d3_document = this.document;
+ function d3_documentElement(node) {
+ return node && (node.ownerDocument || node.document || node).documentElement;
+ }
+ function d3_window(node) {
+ return node && (node.ownerDocument && node.ownerDocument.defaultView || node.document && node || node.defaultView);
+ }
+ if (d3_document) {
+ try {
+ d3_array(d3_document.documentElement.childNodes)[0].nodeType;
+ } catch (e) {
+ d3_array = function(list) {
+ var i = list.length, array = new Array(i);
+ while (i--) array[i] = list[i];
+ return array;
+ };
+ }
+ }
+ if (!Date.now) Date.now = function() {
+ return +new Date();
+ };
+ if (d3_document) {
+ try {
+ d3_document.createElement("DIV").style.setProperty("opacity", 0, "");
+ } catch (error) {
+ var d3_element_prototype = this.Element.prototype, d3_element_setAttribute = d3_element_prototype.setAttribute, d3_element_setAttributeNS = d3_element_prototype.setAttributeNS, d3_style_prototype = this.CSSStyleDeclaration.prototype, d3_style_setProperty = d3_style_prototype.setProperty;
+ d3_element_prototype.setAttribute = function(name, value) {
+ d3_element_setAttribute.call(this, name, value + "");
+ };
+ d3_element_prototype.setAttributeNS = function(space, local, value) {
+ d3_element_setAttributeNS.call(this, space, local, value + "");
+ };
+ d3_style_prototype.setProperty = function(name, value, priority) {
+ d3_style_setProperty.call(this, name, value + "", priority);
+ };
+ }
+ }
+ d3.ascending = d3_ascending;
+ function d3_ascending(a, b) {
+ return a < b ? -1 : a > b ? 1 : a >= b ? 0 : NaN;
+ }
+ d3.descending = function(a, b) {
+ return b < a ? -1 : b > a ? 1 : b >= a ? 0 : NaN;
+ };
+ d3.min = function(array, f) {
+ var i = -1, n = array.length, a, b;
+ if (arguments.length === 1) {
+ while (++i < n) if ((b = array[i]) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = array[i]) != null && a > b) a = b;
+ } else {
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && a > b) a = b;
+ }
+ return a;
+ };
+ d3.max = function(array, f) {
+ var i = -1, n = array.length, a, b;
+ if (arguments.length === 1) {
+ while (++i < n) if ((b = array[i]) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = array[i]) != null && b > a) a = b;
+ } else {
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
+ a = b;
+ break;
+ }
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b > a) a = b;
+ }
+ return a;
+ };
+ d3.extent = function(array, f) {
+ var i = -1, n = array.length, a, b, c;
+ if (arguments.length === 1) {
+ while (++i < n) if ((b = array[i]) != null && b >= b) {
+ a = c = b;
+ break;
+ }
+ while (++i < n) if ((b = array[i]) != null) {
+ if (a > b) a = b;
+ if (c < b) c = b;
+ }
+ } else {
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null && b >= b) {
+ a = c = b;
+ break;
+ }
+ while (++i < n) if ((b = f.call(array, array[i], i)) != null) {
+ if (a > b) a = b;
+ if (c < b) c = b;
+ }
+ }
+ return [ a, c ];
+ };
+ function d3_number(x) {
+ return x === null ? NaN : +x;
+ }
+ function d3_numeric(x) {
+ return !isNaN(x);
+ }
+ d3.sum = function(array, f) {
+ var s = 0, n = array.length, a, i = -1;
+ if (arguments.length === 1) {
+ while (++i < n) if (d3_numeric(a = +array[i])) s += a;
+ } else {
+ while (++i < n) if (d3_numeric(a = +f.call(array, array[i], i))) s += a;
+ }
+ return s;
+ };
+ d3.mean = function(array, f) {
+ var s = 0, n = array.length, a, i = -1, j = n;
+ if (arguments.length === 1) {
+ while (++i < n) if (d3_numeric(a = d3_number(array[i]))) s += a; else --j;
+ } else {
+ while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) s += a; else --j;
+ }
+ if (j) return s / j;
+ };
+ d3.quantile = function(values, p) {
+ var H = (values.length - 1) * p + 1, h = Math.floor(H), v = +values[h - 1], e = H - h;
+ return e ? v + e * (values[h] - v) : v;
+ };
+ d3.median = function(array, f) {
+ var numbers = [], n = array.length, a, i = -1;
+ if (arguments.length === 1) {
+ while (++i < n) if (d3_numeric(a = d3_number(array[i]))) numbers.push(a);
+ } else {
+ while (++i < n) if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) numbers.push(a);
+ }
+ if (numbers.length) return d3.quantile(numbers.sort(d3_ascending), .5);
+ };
+ d3.variance = function(array, f) {
+ var n = array.length, m = 0, a, d, s = 0, i = -1, j = 0;
+ if (arguments.length === 1) {
+ while (++i < n) {
+ if (d3_numeric(a = d3_number(array[i]))) {
+ d = a - m;
+ m += d / ++j;
+ s += d * (a - m);
+ }
+ }
+ } else {
+ while (++i < n) {
+ if (d3_numeric(a = d3_number(f.call(array, array[i], i)))) {
+ d = a - m;
+ m += d / ++j;
+ s += d * (a - m);
+ }
+ }
+ }
+ if (j > 1) return s / (j - 1);
+ };
+ d3.deviation = function() {
+ var v = d3.variance.apply(this, arguments);
+ return v ? Math.sqrt(v) : v;
+ };
+ function d3_bisector(compare) {
+ return {
+ left: function(a, x, lo, hi) {
+ if (arguments.length < 3) lo = 0;
+ if (arguments.length < 4) hi = a.length;
+ while (lo < hi) {
+ var mid = lo + hi >>> 1;
+ if (compare(a[mid], x) < 0) lo = mid + 1; else hi = mid;
+ }
+ return lo;
+ },
+ right: function(a, x, lo, hi) {
+ if (arguments.length < 3) lo = 0;
+ if (arguments.length < 4) hi = a.length;
+ while (lo < hi) {
+ var mid = lo + hi >>> 1;
+ if (compare(a[mid], x) > 0) hi = mid; else lo = mid + 1;
+ }
+ return lo;
+ }
+ };
+ }
+ var d3_bisect = d3_bisector(d3_ascending);
+ d3.bisectLeft = d3_bisect.left;
+ d3.bisect = d3.bisectRight = d3_bisect.right;
+ d3.bisector = function(f) {
+ return d3_bisector(f.length === 1 ? function(d, x) {
+ return d3_ascending(f(d), x);
+ } : f);
+ };
+ d3.shuffle = function(array, i0, i1) {
+ if ((m = arguments.length) < 3) {
+ i1 = array.length;
+ if (m < 2) i0 = 0;
+ }
+ var m = i1 - i0, t, i;
+ while (m) {
+ i = Math.random() * m-- | 0;
+ t = array[m + i0], array[m + i0] = array[i + i0], array[i + i0] = t;
+ }
+ return array;
+ };
+ d3.permute = function(array, indexes) {
+ var i = indexes.length, permutes = new Array(i);
+ while (i--) permutes[i] = array[indexes[i]];
+ return permutes;
+ };
+ d3.pairs = function(array) {
+ var i = 0, n = array.length - 1, p0, p1 = array[0], pairs = new Array(n < 0 ? 0 : n);
+ while (i < n) pairs[i] = [ p0 = p1, p1 = array[++i] ];
+ return pairs;
+ };
+ d3.zip = function() {
+ if (!(n = arguments.length)) return [];
+ for (var i = -1, m = d3.min(arguments, d3_zipLength), zips = new Array(m); ++i < m; ) {
+ for (var j = -1, n, zip = zips[i] = new Array(n); ++j < n; ) {
+ zip[j] = arguments[j][i];
+ }
+ }
+ return zips;
+ };
+ function d3_zipLength(d) {
+ return d.length;
+ }
+ d3.transpose = function(matrix) {
+ return d3.zip.apply(d3, matrix);
+ };
+ d3.keys = function(map) {
+ var keys = [];
+ for (var key in map) keys.push(key);
+ return keys;
+ };
+ d3.values = function(map) {
+ var values = [];
+ for (var key in map) values.push(map[key]);
+ return values;
+ };
+ d3.entries = function(map) {
+ var entries = [];
+ for (var key in map) entries.push({
+ key: key,
+ value: map[key]
+ });
+ return entries;
+ };
+ d3.merge = function(arrays) {
+ var n = arrays.length, m, i = -1, j = 0, merged, array;
+ while (++i < n) j += arrays[i].length;
+ merged = new Array(j);
+ while (--n >= 0) {
+ array = arrays[n];
+ m = array.length;
+ while (--m >= 0) {
+ merged[--j] = array[m];
+ }
+ }
+ return merged;
+ };
+ var abs = Math.abs;
+ d3.range = function(start, stop, step) {
+ if (arguments.length < 3) {
+ step = 1;
+ if (arguments.length < 2) {
+ stop = start;
+ start = 0;
+ }
+ }
+ if ((stop - start) / step === Infinity) throw new Error("infinite range");
+ var range = [], k = d3_range_integerScale(abs(step)), i = -1, j;
+ start *= k, stop *= k, step *= k;
+ if (step < 0) while ((j = start + step * ++i) > stop) range.push(j / k); else while ((j = start + step * ++i) < stop) range.push(j / k);
+ return range;
+ };
+ function d3_range_integerScale(x) {
+ var k = 1;
+ while (x * k % 1) k *= 10;
+ return k;
+ }
+ function d3_class(ctor, properties) {
+ for (var key in properties) {
+ Object.defineProperty(ctor.prototype, key, {
+ value: properties[key],
+ enumerable: false
+ });
+ }
+ }
+ d3.map = function(object, f) {
+ var map = new d3_Map();
+ if (object instanceof d3_Map) {
+ object.forEach(function(key, value) {
+ map.set(key, value);
+ });
+ } else if (Array.isArray(object)) {
+ var i = -1, n = object.length, o;
+ if (arguments.length === 1) while (++i < n) map.set(i, object[i]); else while (++i < n) map.set(f.call(object, o = object[i], i), o);
+ } else {
+ for (var key in object) map.set(key, object[key]);
+ }
+ return map;
+ };
+ function d3_Map() {
+ this._ = Object.create(null);
+ }
+ var d3_map_proto = "__proto__", d3_map_zero = "\x00";
+ d3_class(d3_Map, {
+ has: d3_map_has,
+ get: function(key) {
+ return this._[d3_map_escape(key)];
+ },
+ set: function(key, value) {
+ return this._[d3_map_escape(key)] = value;
+ },
+ remove: d3_map_remove,
+ keys: d3_map_keys,
+ values: function() {
+ var values = [];
+ for (var key in this._) values.push(this._[key]);
+ return values;
+ },
+ entries: function() {
+ var entries = [];
+ for (var key in this._) entries.push({
+ key: d3_map_unescape(key),
+ value: this._[key]
+ });
+ return entries;
+ },
+ size: d3_map_size,
+ empty: d3_map_empty,
+ forEach: function(f) {
+ for (var key in this._) f.call(this, d3_map_unescape(key), this._[key]);
+ }
+ });
+ function d3_map_escape(key) {
+ return (key += "") === d3_map_proto || key[0] === d3_map_zero ? d3_map_zero + key : key;
+ }
+ function d3_map_unescape(key) {
+ return (key += "")[0] === d3_map_zero ? key.slice(1) : key;
+ }
+ function d3_map_has(key) {
+ return d3_map_escape(key) in this._;
+ }
+ function d3_map_remove(key) {
+ return (key = d3_map_escape(key)) in this._ && delete this._[key];
+ }
+ function d3_map_keys() {
+ var keys = [];
+ for (var key in this._) keys.push(d3_map_unescape(key));
+ return keys;
+ }
+ function d3_map_size() {
+ var size = 0;
+ for (var key in this._) ++size;
+ return size;
+ }
+ function d3_map_empty() {
+ for (var key in this._) return false;
+ return true;
+ }
+ d3.nest = function() {
+ var nest = {}, keys = [], sortKeys = [], sortValues, rollup;
+ function map(mapType, array, depth) {
+ if (depth >= keys.length) return rollup ? rollup.call(nest, array) : sortValues ? array.sort(sortValues) : array;
+ var i = -1, n = array.length, key = keys[depth++], keyValue, object, setter, valuesByKey = new d3_Map(), values;
+ while (++i < n) {
+ if (values = valuesByKey.get(keyValue = key(object = array[i]))) {
+ values.push(object);
+ } else {
+ valuesByKey.set(keyValue, [ object ]);
+ }
+ }
+ if (mapType) {
+ object = mapType();
+ setter = function(keyValue, values) {
+ object.set(keyValue, map(mapType, values, depth));
+ };
+ } else {
+ object = {};
+ setter = function(keyValue, values) {
+ object[keyValue] = map(mapType, values, depth);
+ };
+ }
+ valuesByKey.forEach(setter);
+ return object;
+ }
+ function entries(map, depth) {
+ if (depth >= keys.length) return map;
+ var array = [], sortKey = sortKeys[depth++];
+ map.forEach(function(key, keyMap) {
+ array.push({
+ key: key,
+ values: entries(keyMap, depth)
+ });
+ });
+ return sortKey ? array.sort(function(a, b) {
+ return sortKey(a.key, b.key);
+ }) : array;
+ }
+ nest.map = function(array, mapType) {
+ return map(mapType, array, 0);
+ };
+ nest.entries = function(array) {
+ return entries(map(d3.map, array, 0), 0);
+ };
+ nest.key = function(d) {
+ keys.push(d);
+ return nest;
+ };
+ nest.sortKeys = function(order) {
+ sortKeys[keys.length - 1] = order;
+ return nest;
+ };
+ nest.sortValues = function(order) {
+ sortValues = order;
+ return nest;
+ };
+ nest.rollup = function(f) {
+ rollup = f;
+ return nest;
+ };
+ return nest;
+ };
+ d3.set = function(array) {
+ var set = new d3_Set();
+ if (array) for (var i = 0, n = array.length; i < n; ++i) set.add(array[i]);
+ return set;
+ };
+ function d3_Set() {
+ this._ = Object.create(null);
+ }
+ d3_class(d3_Set, {
+ has: d3_map_has,
+ add: function(key) {
+ this._[d3_map_escape(key += "")] = true;
+ return key;
+ },
+ remove: d3_map_remove,
+ values: d3_map_keys,
+ size: d3_map_size,
+ empty: d3_map_empty,
+ forEach: function(f) {
+ for (var key in this._) f.call(this, d3_map_unescape(key));
+ }
+ });
+ d3.behavior = {};
+ function d3_identity(d) {
+ return d;
+ }
+ d3.rebind = function(target, source) {
+ var i = 1, n = arguments.length, method;
+ while (++i < n) target[method = arguments[i]] = d3_rebind(target, source, source[method]);
+ return target;
+ };
+ function d3_rebind(target, source, method) {
+ return function() {
+ var value = method.apply(source, arguments);
+ return value === source ? target : value;
+ };
+ }
+ function d3_vendorSymbol(object, name) {
+ if (name in object) return name;
+ name = name.charAt(0).toUpperCase() + name.slice(1);
+ for (var i = 0, n = d3_vendorPrefixes.length; i < n; ++i) {
+ var prefixName = d3_vendorPrefixes[i] + name;
+ if (prefixName in object) return prefixName;
+ }
+ }
+ var d3_vendorPrefixes = [ "webkit", "ms", "moz", "Moz", "o", "O" ];
+ function d3_noop() {}
+ d3.dispatch = function() {
+ var dispatch = new d3_dispatch(), i = -1, n = arguments.length;
+ while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
+ return dispatch;
+ };
+ function d3_dispatch() {}
+ d3_dispatch.prototype.on = function(type, listener) {
+ var i = type.indexOf("."), name = "";
+ if (i >= 0) {
+ name = type.slice(i + 1);
+ type = type.slice(0, i);
+ }
+ if (type) return arguments.length < 2 ? this[type].on(name) : this[type].on(name, listener);
+ if (arguments.length === 2) {
+ if (listener == null) for (type in this) {
+ if (this.hasOwnProperty(type)) this[type].on(name, null);
+ }
+ return this;
+ }
+ };
+ function d3_dispatch_event(dispatch) {
+ var listeners = [], listenerByName = new d3_Map();
+ function event() {
+ var z = listeners, i = -1, n = z.length, l;
+ while (++i < n) if (l = z[i].on) l.apply(this, arguments);
+ return dispatch;
+ }
+ event.on = function(name, listener) {
+ var l = listenerByName.get(name), i;
+ if (arguments.length < 2) return l && l.on;
+ if (l) {
+ l.on = null;
+ listeners = listeners.slice(0, i = listeners.indexOf(l)).concat(listeners.slice(i + 1));
+ listenerByName.remove(name);
+ }
+ if (listener) listeners.push(listenerByName.set(name, {
+ on: listener
+ }));
+ return dispatch;
+ };
+ return event;
+ }
+ d3.event = null;
+ function d3_eventPreventDefault() {
+ d3.event.preventDefault();
+ }
+ function d3_eventSource() {
+ var e = d3.event, s;
+ while (s = e.sourceEvent) e = s;
+ return e;
+ }
+ function d3_eventDispatch(target) {
+ var dispatch = new d3_dispatch(), i = 0, n = arguments.length;
+ while (++i < n) dispatch[arguments[i]] = d3_dispatch_event(dispatch);
+ dispatch.of = function(thiz, argumentz) {
+ return function(e1) {
+ try {
+ var e0 = e1.sourceEvent = d3.event;
+ e1.target = target;
+ d3.event = e1;
+ dispatch[e1.type].apply(thiz, argumentz);
+ } finally {
+ d3.event = e0;
+ }
+ };
+ };
+ return dispatch;
+ }
+ d3.requote = function(s) {
+ return s.replace(d3_requote_re, "\\$&");
+ };
+ var d3_requote_re = /[\\\^\$\*\+\?\|\[\]\(\)\.\{\}]/g;
+ var d3_subclass = {}.__proto__ ? function(object, prototype) {
+ object.__proto__ = prototype;
+ } : function(object, prototype) {
+ for (var property in prototype) object[property] = prototype[property];
+ };
+ function d3_selection(groups) {
+ d3_subclass(groups, d3_selectionPrototype);
+ return groups;
+ }
+ var d3_select = function(s, n) {
+ return n.querySelector(s);
+ }, d3_selectAll = function(s, n) {
+ return n.querySelectorAll(s);
+ }, d3_selectMatches = function(n, s) {
+ var d3_selectMatcher = n.matches || n[d3_vendorSymbol(n, "matchesSelector")];
+ d3_selectMatches = function(n, s) {
+ return d3_selectMatcher.call(n, s);
+ };
+ return d3_selectMatches(n, s);
+ };
+ if (typeof Sizzle === "function") {
+ d3_select = function(s, n) {
+ return Sizzle(s, n)[0] || null;
+ };
+ d3_selectAll = Sizzle;
+ d3_selectMatches = Sizzle.matchesSelector;
+ }
+ d3.selection = function() {
+ return d3.select(d3_document.documentElement);
+ };
+ var d3_selectionPrototype = d3.selection.prototype = [];
+ d3_selectionPrototype.select = function(selector) {
+ var subgroups = [], subgroup, subnode, group, node;
+ selector = d3_selection_selector(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ subgroups.push(subgroup = []);
+ subgroup.parentNode = (group = this[j]).parentNode;
+ for (var i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ subgroup.push(subnode = selector.call(node, node.__data__, i, j));
+ if (subnode && "__data__" in node) subnode.__data__ = node.__data__;
+ } else {
+ subgroup.push(null);
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ function d3_selection_selector(selector) {
+ return typeof selector === "function" ? selector : function() {
+ return d3_select(selector, this);
+ };
+ }
+ d3_selectionPrototype.selectAll = function(selector) {
+ var subgroups = [], subgroup, node;
+ selector = d3_selection_selectorAll(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ subgroups.push(subgroup = d3_array(selector.call(node, node.__data__, i, j)));
+ subgroup.parentNode = node;
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ function d3_selection_selectorAll(selector) {
+ return typeof selector === "function" ? selector : function() {
+ return d3_selectAll(selector, this);
+ };
+ }
+ var d3_nsPrefix = {
+ svg: "http://www.w3.org/2000/svg",
+ xhtml: "http://www.w3.org/1999/xhtml",
+ xlink: "http://www.w3.org/1999/xlink",
+ xml: "http://www.w3.org/XML/1998/namespace",
+ xmlns: "http://www.w3.org/2000/xmlns/"
+ };
+ d3.ns = {
+ prefix: d3_nsPrefix,
+ qualify: function(name) {
+ var i = name.indexOf(":"), prefix = name;
+ if (i >= 0) {
+ prefix = name.slice(0, i);
+ name = name.slice(i + 1);
+ }
+ return d3_nsPrefix.hasOwnProperty(prefix) ? {
+ space: d3_nsPrefix[prefix],
+ local: name
+ } : name;
+ }
+ };
+ d3_selectionPrototype.attr = function(name, value) {
+ if (arguments.length < 2) {
+ if (typeof name === "string") {
+ var node = this.node();
+ name = d3.ns.qualify(name);
+ return name.local ? node.getAttributeNS(name.space, name.local) : node.getAttribute(name);
+ }
+ for (value in name) this.each(d3_selection_attr(value, name[value]));
+ return this;
+ }
+ return this.each(d3_selection_attr(name, value));
+ };
+ function d3_selection_attr(name, value) {
+ name = d3.ns.qualify(name);
+ function attrNull() {
+ this.removeAttribute(name);
+ }
+ function attrNullNS() {
+ this.removeAttributeNS(name.space, name.local);
+ }
+ function attrConstant() {
+ this.setAttribute(name, value);
+ }
+ function attrConstantNS() {
+ this.setAttributeNS(name.space, name.local, value);
+ }
+ function attrFunction() {
+ var x = value.apply(this, arguments);
+ if (x == null) this.removeAttribute(name); else this.setAttribute(name, x);
+ }
+ function attrFunctionNS() {
+ var x = value.apply(this, arguments);
+ if (x == null) this.removeAttributeNS(name.space, name.local); else this.setAttributeNS(name.space, name.local, x);
+ }
+ return value == null ? name.local ? attrNullNS : attrNull : typeof value === "function" ? name.local ? attrFunctionNS : attrFunction : name.local ? attrConstantNS : attrConstant;
+ }
+ function d3_collapse(s) {
+ return s.trim().replace(/\s+/g, " ");
+ }
+ d3_selectionPrototype.classed = function(name, value) {
+ if (arguments.length < 2) {
+ if (typeof name === "string") {
+ var node = this.node(), n = (name = d3_selection_classes(name)).length, i = -1;
+ if (value = node.classList) {
+ while (++i < n) if (!value.contains(name[i])) return false;
+ } else {
+ value = node.getAttribute("class");
+ while (++i < n) if (!d3_selection_classedRe(name[i]).test(value)) return false;
+ }
+ return true;
+ }
+ for (value in name) this.each(d3_selection_classed(value, name[value]));
+ return this;
+ }
+ return this.each(d3_selection_classed(name, value));
+ };
+ function d3_selection_classedRe(name) {
+ return new RegExp("(?:^|\\s+)" + d3.requote(name) + "(?:\\s+|$)", "g");
+ }
+ function d3_selection_classes(name) {
+ return (name + "").trim().split(/^|\s+/);
+ }
+ function d3_selection_classed(name, value) {
+ name = d3_selection_classes(name).map(d3_selection_classedName);
+ var n = name.length;
+ function classedConstant() {
+ var i = -1;
+ while (++i < n) name[i](this, value);
+ }
+ function classedFunction() {
+ var i = -1, x = value.apply(this, arguments);
+ while (++i < n) name[i](this, x);
+ }
+ return typeof value === "function" ? classedFunction : classedConstant;
+ }
+ function d3_selection_classedName(name) {
+ var re = d3_selection_classedRe(name);
+ return function(node, value) {
+ if (c = node.classList) return value ? c.add(name) : c.remove(name);
+ var c = node.getAttribute("class") || "";
+ if (value) {
+ re.lastIndex = 0;
+ if (!re.test(c)) node.setAttribute("class", d3_collapse(c + " " + name));
+ } else {
+ node.setAttribute("class", d3_collapse(c.replace(re, " ")));
+ }
+ };
+ }
+ d3_selectionPrototype.style = function(name, value, priority) {
+ var n = arguments.length;
+ if (n < 3) {
+ if (typeof name !== "string") {
+ if (n < 2) value = "";
+ for (priority in name) this.each(d3_selection_style(priority, name[priority], value));
+ return this;
+ }
+ if (n < 2) {
+ var node = this.node();
+ return d3_window(node).getComputedStyle(node, null).getPropertyValue(name);
+ }
+ priority = "";
+ }
+ return this.each(d3_selection_style(name, value, priority));
+ };
+ function d3_selection_style(name, value, priority) {
+ function styleNull() {
+ this.style.removeProperty(name);
+ }
+ function styleConstant() {
+ this.style.setProperty(name, value, priority);
+ }
+ function styleFunction() {
+ var x = value.apply(this, arguments);
+ if (x == null) this.style.removeProperty(name); else this.style.setProperty(name, x, priority);
+ }
+ return value == null ? styleNull : typeof value === "function" ? styleFunction : styleConstant;
+ }
+ d3_selectionPrototype.property = function(name, value) {
+ if (arguments.length < 2) {
+ if (typeof name === "string") return this.node()[name];
+ for (value in name) this.each(d3_selection_property(value, name[value]));
+ return this;
+ }
+ return this.each(d3_selection_property(name, value));
+ };
+ function d3_selection_property(name, value) {
+ function propertyNull() {
+ delete this[name];
+ }
+ function propertyConstant() {
+ this[name] = value;
+ }
+ function propertyFunction() {
+ var x = value.apply(this, arguments);
+ if (x == null) delete this[name]; else this[name] = x;
+ }
+ return value == null ? propertyNull : typeof value === "function" ? propertyFunction : propertyConstant;
+ }
+ d3_selectionPrototype.text = function(value) {
+ return arguments.length ? this.each(typeof value === "function" ? function() {
+ var v = value.apply(this, arguments);
+ this.textContent = v == null ? "" : v;
+ } : value == null ? function() {
+ this.textContent = "";
+ } : function() {
+ this.textContent = value;
+ }) : this.node().textContent;
+ };
+ d3_selectionPrototype.html = function(value) {
+ return arguments.length ? this.each(typeof value === "function" ? function() {
+ var v = value.apply(this, arguments);
+ this.innerHTML = v == null ? "" : v;
+ } : value == null ? function() {
+ this.innerHTML = "";
+ } : function() {
+ this.innerHTML = value;
+ }) : this.node().innerHTML;
+ };
+ d3_selectionPrototype.append = function(name) {
+ name = d3_selection_creator(name);
+ return this.select(function() {
+ return this.appendChild(name.apply(this, arguments));
+ });
+ };
+ function d3_selection_creator(name) {
+ function create() {
+ var document = this.ownerDocument, namespace = this.namespaceURI;
+ return namespace ? document.createElementNS(namespace, name) : document.createElement(name);
+ }
+ function createNS() {
+ return this.ownerDocument.createElementNS(name.space, name.local);
+ }
+ return typeof name === "function" ? name : (name = d3.ns.qualify(name)).local ? createNS : create;
+ }
+ d3_selectionPrototype.insert = function(name, before) {
+ name = d3_selection_creator(name);
+ before = d3_selection_selector(before);
+ return this.select(function() {
+ return this.insertBefore(name.apply(this, arguments), before.apply(this, arguments) || null);
+ });
+ };
+ d3_selectionPrototype.remove = function() {
+ return this.each(d3_selectionRemove);
+ };
+ function d3_selectionRemove() {
+ var parent = this.parentNode;
+ if (parent) parent.removeChild(this);
+ }
+ d3_selectionPrototype.data = function(value, key) {
+ var i = -1, n = this.length, group, node;
+ if (!arguments.length) {
+ value = new Array(n = (group = this[0]).length);
+ while (++i < n) {
+ if (node = group[i]) {
+ value[i] = node.__data__;
+ }
+ }
+ return value;
+ }
+ function bind(group, groupData) {
+ var i, n = group.length, m = groupData.length, n0 = Math.min(n, m), updateNodes = new Array(m), enterNodes = new Array(m), exitNodes = new Array(n), node, nodeData;
+ if (key) {
+ var nodeByKeyValue = new d3_Map(), keyValues = new Array(n), keyValue;
+ for (i = -1; ++i < n; ) {
+ if (nodeByKeyValue.has(keyValue = key.call(node = group[i], node.__data__, i))) {
+ exitNodes[i] = node;
+ } else {
+ nodeByKeyValue.set(keyValue, node);
+ }
+ keyValues[i] = keyValue;
+ }
+ for (i = -1; ++i < m; ) {
+ if (!(node = nodeByKeyValue.get(keyValue = key.call(groupData, nodeData = groupData[i], i)))) {
+ enterNodes[i] = d3_selection_dataNode(nodeData);
+ } else if (node !== true) {
+ updateNodes[i] = node;
+ node.__data__ = nodeData;
+ }
+ nodeByKeyValue.set(keyValue, true);
+ }
+ for (i = -1; ++i < n; ) {
+ if (nodeByKeyValue.get(keyValues[i]) !== true) {
+ exitNodes[i] = group[i];
+ }
+ }
+ } else {
+ for (i = -1; ++i < n0; ) {
+ node = group[i];
+ nodeData = groupData[i];
+ if (node) {
+ node.__data__ = nodeData;
+ updateNodes[i] = node;
+ } else {
+ enterNodes[i] = d3_selection_dataNode(nodeData);
+ }
+ }
+ for (;i < m; ++i) {
+ enterNodes[i] = d3_selection_dataNode(groupData[i]);
+ }
+ for (;i < n; ++i) {
+ exitNodes[i] = group[i];
+ }
+ }
+ enterNodes.update = updateNodes;
+ enterNodes.parentNode = updateNodes.parentNode = exitNodes.parentNode = group.parentNode;
+ enter.push(enterNodes);
+ update.push(updateNodes);
+ exit.push(exitNodes);
+ }
+ var enter = d3_selection_enter([]), update = d3_selection([]), exit = d3_selection([]);
+ if (typeof value === "function") {
+ while (++i < n) {
+ bind(group = this[i], value.call(group, group.parentNode.__data__, i));
+ }
+ } else {
+ while (++i < n) {
+ bind(group = this[i], value);
+ }
+ }
+ update.enter = function() {
+ return enter;
+ };
+ update.exit = function() {
+ return exit;
+ };
+ return update;
+ };
+ function d3_selection_dataNode(data) {
+ return {
+ __data__: data
+ };
+ }
+ d3_selectionPrototype.datum = function(value) {
+ return arguments.length ? this.property("__data__", value) : this.property("__data__");
+ };
+ d3_selectionPrototype.filter = function(filter) {
+ var subgroups = [], subgroup, group, node;
+ if (typeof filter !== "function") filter = d3_selection_filter(filter);
+ for (var j = 0, m = this.length; j < m; j++) {
+ subgroups.push(subgroup = []);
+ subgroup.parentNode = (group = this[j]).parentNode;
+ for (var i = 0, n = group.length; i < n; i++) {
+ if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
+ subgroup.push(node);
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ function d3_selection_filter(selector) {
+ return function() {
+ return d3_selectMatches(this, selector);
+ };
+ }
+ d3_selectionPrototype.order = function() {
+ for (var j = -1, m = this.length; ++j < m; ) {
+ for (var group = this[j], i = group.length - 1, next = group[i], node; --i >= 0; ) {
+ if (node = group[i]) {
+ if (next && next !== node.nextSibling) next.parentNode.insertBefore(node, next);
+ next = node;
+ }
+ }
+ }
+ return this;
+ };
+ d3_selectionPrototype.sort = function(comparator) {
+ comparator = d3_selection_sortComparator.apply(this, arguments);
+ for (var j = -1, m = this.length; ++j < m; ) this[j].sort(comparator);
+ return this.order();
+ };
+ function d3_selection_sortComparator(comparator) {
+ if (!arguments.length) comparator = d3_ascending;
+ return function(a, b) {
+ return a && b ? comparator(a.__data__, b.__data__) : !a - !b;
+ };
+ }
+ d3_selectionPrototype.each = function(callback) {
+ return d3_selection_each(this, function(node, i, j) {
+ callback.call(node, node.__data__, i, j);
+ });
+ };
+ function d3_selection_each(groups, callback) {
+ for (var j = 0, m = groups.length; j < m; j++) {
+ for (var group = groups[j], i = 0, n = group.length, node; i < n; i++) {
+ if (node = group[i]) callback(node, i, j);
+ }
+ }
+ return groups;
+ }
+ d3_selectionPrototype.call = function(callback) {
+ var args = d3_array(arguments);
+ callback.apply(args[0] = this, args);
+ return this;
+ };
+ d3_selectionPrototype.empty = function() {
+ return !this.node();
+ };
+ d3_selectionPrototype.node = function() {
+ for (var j = 0, m = this.length; j < m; j++) {
+ for (var group = this[j], i = 0, n = group.length; i < n; i++) {
+ var node = group[i];
+ if (node) return node;
+ }
+ }
+ return null;
+ };
+ d3_selectionPrototype.size = function() {
+ var n = 0;
+ d3_selection_each(this, function() {
+ ++n;
+ });
+ return n;
+ };
+ function d3_selection_enter(selection) {
+ d3_subclass(selection, d3_selection_enterPrototype);
+ return selection;
+ }
+ var d3_selection_enterPrototype = [];
+ d3.selection.enter = d3_selection_enter;
+ d3.selection.enter.prototype = d3_selection_enterPrototype;
+ d3_selection_enterPrototype.append = d3_selectionPrototype.append;
+ d3_selection_enterPrototype.empty = d3_selectionPrototype.empty;
+ d3_selection_enterPrototype.node = d3_selectionPrototype.node;
+ d3_selection_enterPrototype.call = d3_selectionPrototype.call;
+ d3_selection_enterPrototype.size = d3_selectionPrototype.size;
+ d3_selection_enterPrototype.select = function(selector) {
+ var subgroups = [], subgroup, subnode, upgroup, group, node;
+ for (var j = -1, m = this.length; ++j < m; ) {
+ upgroup = (group = this[j]).update;
+ subgroups.push(subgroup = []);
+ subgroup.parentNode = group.parentNode;
+ for (var i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ subgroup.push(upgroup[i] = subnode = selector.call(group.parentNode, node.__data__, i, j));
+ subnode.__data__ = node.__data__;
+ } else {
+ subgroup.push(null);
+ }
+ }
+ }
+ return d3_selection(subgroups);
+ };
+ d3_selection_enterPrototype.insert = function(name, before) {
+ if (arguments.length < 2) before = d3_selection_enterInsertBefore(this);
+ return d3_selectionPrototype.insert.call(this, name, before);
+ };
+ function d3_selection_enterInsertBefore(enter) {
+ var i0, j0;
+ return function(d, i, j) {
+ var group = enter[j].update, n = group.length, node;
+ if (j != j0) j0 = j, i0 = 0;
+ if (i >= i0) i0 = i + 1;
+ while (!(node = group[i0]) && ++i0 < n) ;
+ return node;
+ };
+ }
+ d3.select = function(node) {
+ var group;
+ if (typeof node === "string") {
+ group = [ d3_select(node, d3_document) ];
+ group.parentNode = d3_document.documentElement;
+ } else {
+ group = [ node ];
+ group.parentNode = d3_documentElement(node);
+ }
+ return d3_selection([ group ]);
+ };
+ d3.selectAll = function(nodes) {
+ var group;
+ if (typeof nodes === "string") {
+ group = d3_array(d3_selectAll(nodes, d3_document));
+ group.parentNode = d3_document.documentElement;
+ } else {
+ group = nodes;
+ group.parentNode = null;
+ }
+ return d3_selection([ group ]);
+ };
+ d3_selectionPrototype.on = function(type, listener, capture) {
+ var n = arguments.length;
+ if (n < 3) {
+ if (typeof type !== "string") {
+ if (n < 2) listener = false;
+ for (capture in type) this.each(d3_selection_on(capture, type[capture], listener));
+ return this;
+ }
+ if (n < 2) return (n = this.node()["__on" + type]) && n._;
+ capture = false;
+ }
+ return this.each(d3_selection_on(type, listener, capture));
+ };
+ function d3_selection_on(type, listener, capture) {
+ var name = "__on" + type, i = type.indexOf("."), wrap = d3_selection_onListener;
+ if (i > 0) type = type.slice(0, i);
+ var filter = d3_selection_onFilters.get(type);
+ if (filter) type = filter, wrap = d3_selection_onFilter;
+ function onRemove() {
+ var l = this[name];
+ if (l) {
+ this.removeEventListener(type, l, l.$);
+ delete this[name];
+ }
+ }
+ function onAdd() {
+ var l = wrap(listener, d3_array(arguments));
+ onRemove.call(this);
+ this.addEventListener(type, this[name] = l, l.$ = capture);
+ l._ = listener;
+ }
+ function removeAll() {
+ var re = new RegExp("^__on([^.]+)" + d3.requote(type) + "$"), match;
+ for (var name in this) {
+ if (match = name.match(re)) {
+ var l = this[name];
+ this.removeEventListener(match[1], l, l.$);
+ delete this[name];
+ }
+ }
+ }
+ return i ? listener ? onAdd : onRemove : listener ? d3_noop : removeAll;
+ }
+ var d3_selection_onFilters = d3.map({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout"
+ });
+ if (d3_document) {
+ d3_selection_onFilters.forEach(function(k) {
+ if ("on" + k in d3_document) d3_selection_onFilters.remove(k);
+ });
+ }
+ function d3_selection_onListener(listener, argumentz) {
+ return function(e) {
+ var o = d3.event;
+ d3.event = e;
+ argumentz[0] = this.__data__;
+ try {
+ listener.apply(this, argumentz);
+ } finally {
+ d3.event = o;
+ }
+ };
+ }
+ function d3_selection_onFilter(listener, argumentz) {
+ var l = d3_selection_onListener(listener, argumentz);
+ return function(e) {
+ var target = this, related = e.relatedTarget;
+ if (!related || related !== target && !(related.compareDocumentPosition(target) & 8)) {
+ l.call(target, e);
+ }
+ };
+ }
+ var d3_event_dragSelect, d3_event_dragId = 0;
+ function d3_event_dragSuppress(node) {
+ var name = ".dragsuppress-" + ++d3_event_dragId, click = "click" + name, w = d3.select(d3_window(node)).on("touchmove" + name, d3_eventPreventDefault).on("dragstart" + name, d3_eventPreventDefault).on("selectstart" + name, d3_eventPreventDefault);
+ if (d3_event_dragSelect == null) {
+ d3_event_dragSelect = "onselectstart" in node ? false : d3_vendorSymbol(node.style, "userSelect");
+ }
+ if (d3_event_dragSelect) {
+ var style = d3_documentElement(node).style, select = style[d3_event_dragSelect];
+ style[d3_event_dragSelect] = "none";
+ }
+ return function(suppressClick) {
+ w.on(name, null);
+ if (d3_event_dragSelect) style[d3_event_dragSelect] = select;
+ if (suppressClick) {
+ var off = function() {
+ w.on(click, null);
+ };
+ w.on(click, function() {
+ d3_eventPreventDefault();
+ off();
+ }, true);
+ setTimeout(off, 0);
+ }
+ };
+ }
+ d3.mouse = function(container) {
+ return d3_mousePoint(container, d3_eventSource());
+ };
+ var d3_mouse_bug44083 = this.navigator && /WebKit/.test(this.navigator.userAgent) ? -1 : 0;
+ function d3_mousePoint(container, e) {
+ if (e.changedTouches) e = e.changedTouches[0];
+ var svg = container.ownerSVGElement || container;
+ if (svg.createSVGPoint) {
+ var point = svg.createSVGPoint();
+ if (d3_mouse_bug44083 < 0) {
+ var window = d3_window(container);
+ if (window.scrollX || window.scrollY) {
+ svg = d3.select("body").append("svg").style({
+ position: "absolute",
+ top: 0,
+ left: 0,
+ margin: 0,
+ padding: 0,
+ border: "none"
+ }, "important");
+ var ctm = svg[0][0].getScreenCTM();
+ d3_mouse_bug44083 = !(ctm.f || ctm.e);
+ svg.remove();
+ }
+ }
+ if (d3_mouse_bug44083) point.x = e.pageX, point.y = e.pageY; else point.x = e.clientX,
+ point.y = e.clientY;
+ point = point.matrixTransform(container.getScreenCTM().inverse());
+ return [ point.x, point.y ];
+ }
+ var rect = container.getBoundingClientRect();
+ return [ e.clientX - rect.left - container.clientLeft, e.clientY - rect.top - container.clientTop ];
+ }
+ d3.touch = function(container, touches, identifier) {
+ if (arguments.length < 3) identifier = touches, touches = d3_eventSource().changedTouches;
+ if (touches) for (var i = 0, n = touches.length, touch; i < n; ++i) {
+ if ((touch = touches[i]).identifier === identifier) {
+ return d3_mousePoint(container, touch);
+ }
+ }
+ };
+ d3.behavior.drag = function() {
+ var event = d3_eventDispatch(drag, "drag", "dragstart", "dragend"), origin = null, mousedown = dragstart(d3_noop, d3.mouse, d3_window, "mousemove", "mouseup"), touchstart = dragstart(d3_behavior_dragTouchId, d3.touch, d3_identity, "touchmove", "touchend");
+ function drag() {
+ this.on("mousedown.drag", mousedown).on("touchstart.drag", touchstart);
+ }
+ function dragstart(id, position, subject, move, end) {
+ return function() {
+ var that = this, target = d3.event.target, parent = that.parentNode, dispatch = event.of(that, arguments), dragged = 0, dragId = id(), dragName = ".drag" + (dragId == null ? "" : "-" + dragId), dragOffset, dragSubject = d3.select(subject(target)).on(move + dragName, moved).on(end + dragName, ended), dragRestore = d3_event_dragSuppress(target), position0 = position(parent, dragId);
+ if (origin) {
+ dragOffset = origin.apply(that, arguments);
+ dragOffset = [ dragOffset.x - position0[0], dragOffset.y - position0[1] ];
+ } else {
+ dragOffset = [ 0, 0 ];
+ }
+ dispatch({
+ type: "dragstart"
+ });
+ function moved() {
+ var position1 = position(parent, dragId), dx, dy;
+ if (!position1) return;
+ dx = position1[0] - position0[0];
+ dy = position1[1] - position0[1];
+ dragged |= dx | dy;
+ position0 = position1;
+ dispatch({
+ type: "drag",
+ x: position1[0] + dragOffset[0],
+ y: position1[1] + dragOffset[1],
+ dx: dx,
+ dy: dy
+ });
+ }
+ function ended() {
+ if (!position(parent, dragId)) return;
+ dragSubject.on(move + dragName, null).on(end + dragName, null);
+ dragRestore(dragged && d3.event.target === target);
+ dispatch({
+ type: "dragend"
+ });
+ }
+ };
+ }
+ drag.origin = function(x) {
+ if (!arguments.length) return origin;
+ origin = x;
+ return drag;
+ };
+ return d3.rebind(drag, event, "on");
+ };
+ function d3_behavior_dragTouchId() {
+ return d3.event.changedTouches[0].identifier;
+ }
+ d3.touches = function(container, touches) {
+ if (arguments.length < 2) touches = d3_eventSource().touches;
+ return touches ? d3_array(touches).map(function(touch) {
+ var point = d3_mousePoint(container, touch);
+ point.identifier = touch.identifier;
+ return point;
+ }) : [];
+ };
+ var ε = 1e-6, ε2 = ε * ε, π = Math.PI, τ = 2 * π, τε = τ - ε, halfπ = π / 2, d3_radians = π / 180, d3_degrees = 180 / π;
+ function d3_sgn(x) {
+ return x > 0 ? 1 : x < 0 ? -1 : 0;
+ }
+ function d3_cross2d(a, b, c) {
+ return (b[0] - a[0]) * (c[1] - a[1]) - (b[1] - a[1]) * (c[0] - a[0]);
+ }
+ function d3_acos(x) {
+ return x > 1 ? 0 : x < -1 ? π : Math.acos(x);
+ }
+ function d3_asin(x) {
+ return x > 1 ? halfπ : x < -1 ? -halfπ : Math.asin(x);
+ }
+ function d3_sinh(x) {
+ return ((x = Math.exp(x)) - 1 / x) / 2;
+ }
+ function d3_cosh(x) {
+ return ((x = Math.exp(x)) + 1 / x) / 2;
+ }
+ function d3_tanh(x) {
+ return ((x = Math.exp(2 * x)) - 1) / (x + 1);
+ }
+ function d3_haversin(x) {
+ return (x = Math.sin(x / 2)) * x;
+ }
+ var ρ = Math.SQRT2, ρ2 = 2, ρ4 = 4;
+ d3.interpolateZoom = function(p0, p1) {
+ var ux0 = p0[0], uy0 = p0[1], w0 = p0[2], ux1 = p1[0], uy1 = p1[1], w1 = p1[2];
+ var dx = ux1 - ux0, dy = uy1 - uy0, d2 = dx * dx + dy * dy, d1 = Math.sqrt(d2), b0 = (w1 * w1 - w0 * w0 + ρ4 * d2) / (2 * w0 * ρ2 * d1), b1 = (w1 * w1 - w0 * w0 - ρ4 * d2) / (2 * w1 * ρ2 * d1), r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0), r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1), dr = r1 - r0, S = (dr || Math.log(w1 / w0)) / ρ;
+ function interpolate(t) {
+ var s = t * S;
+ if (dr) {
+ var coshr0 = d3_cosh(r0), u = w0 / (ρ2 * d1) * (coshr0 * d3_tanh(ρ * s + r0) - d3_sinh(r0));
+ return [ ux0 + u * dx, uy0 + u * dy, w0 * coshr0 / d3_cosh(ρ * s + r0) ];
+ }
+ return [ ux0 + t * dx, uy0 + t * dy, w0 * Math.exp(ρ * s) ];
+ }
+ interpolate.duration = S * 1e3;
+ return interpolate;
+ };
+ d3.behavior.zoom = function() {
+ var view = {
+ x: 0,
+ y: 0,
+ k: 1
+ }, translate0, center0, center, size = [ 960, 500 ], scaleExtent = d3_behavior_zoomInfinity, duration = 250, zooming = 0, mousedown = "mousedown.zoom", mousemove = "mousemove.zoom", mouseup = "mouseup.zoom", mousewheelTimer, touchstart = "touchstart.zoom", touchtime, event = d3_eventDispatch(zoom, "zoomstart", "zoom", "zoomend"), x0, x1, y0, y1;
+ if (!d3_behavior_zoomWheel) {
+ d3_behavior_zoomWheel = "onwheel" in d3_document ? (d3_behavior_zoomDelta = function() {
+ return -d3.event.deltaY * (d3.event.deltaMode ? 120 : 1);
+ }, "wheel") : "onmousewheel" in d3_document ? (d3_behavior_zoomDelta = function() {
+ return d3.event.wheelDelta;
+ }, "mousewheel") : (d3_behavior_zoomDelta = function() {
+ return -d3.event.detail;
+ }, "MozMousePixelScroll");
+ }
+ function zoom(g) {
+ g.on(mousedown, mousedowned).on(d3_behavior_zoomWheel + ".zoom", mousewheeled).on("dblclick.zoom", dblclicked).on(touchstart, touchstarted);
+ }
+ zoom.event = function(g) {
+ g.each(function() {
+ var dispatch = event.of(this, arguments), view1 = view;
+ if (d3_transitionInheritId) {
+ d3.select(this).transition().each("start.zoom", function() {
+ view = this.__chart__ || {
+ x: 0,
+ y: 0,
+ k: 1
+ };
+ zoomstarted(dispatch);
+ }).tween("zoom:zoom", function() {
+ var dx = size[0], dy = size[1], cx = center0 ? center0[0] : dx / 2, cy = center0 ? center0[1] : dy / 2, i = d3.interpolateZoom([ (cx - view.x) / view.k, (cy - view.y) / view.k, dx / view.k ], [ (cx - view1.x) / view1.k, (cy - view1.y) / view1.k, dx / view1.k ]);
+ return function(t) {
+ var l = i(t), k = dx / l[2];
+ this.__chart__ = view = {
+ x: cx - l[0] * k,
+ y: cy - l[1] * k,
+ k: k
+ };
+ zoomed(dispatch);
+ };
+ }).each("interrupt.zoom", function() {
+ zoomended(dispatch);
+ }).each("end.zoom", function() {
+ zoomended(dispatch);
+ });
+ } else {
+ this.__chart__ = view;
+ zoomstarted(dispatch);
+ zoomed(dispatch);
+ zoomended(dispatch);
+ }
+ });
+ };
+ zoom.translate = function(_) {
+ if (!arguments.length) return [ view.x, view.y ];
+ view = {
+ x: +_[0],
+ y: +_[1],
+ k: view.k
+ };
+ rescale();
+ return zoom;
+ };
+ zoom.scale = function(_) {
+ if (!arguments.length) return view.k;
+ view = {
+ x: view.x,
+ y: view.y,
+ k: +_
+ };
+ rescale();
+ return zoom;
+ };
+ zoom.scaleExtent = function(_) {
+ if (!arguments.length) return scaleExtent;
+ scaleExtent = _ == null ? d3_behavior_zoomInfinity : [ +_[0], +_[1] ];
+ return zoom;
+ };
+ zoom.center = function(_) {
+ if (!arguments.length) return center;
+ center = _ && [ +_[0], +_[1] ];
+ return zoom;
+ };
+ zoom.size = function(_) {
+ if (!arguments.length) return size;
+ size = _ && [ +_[0], +_[1] ];
+ return zoom;
+ };
+ zoom.duration = function(_) {
+ if (!arguments.length) return duration;
+ duration = +_;
+ return zoom;
+ };
+ zoom.x = function(z) {
+ if (!arguments.length) return x1;
+ x1 = z;
+ x0 = z.copy();
+ view = {
+ x: 0,
+ y: 0,
+ k: 1
+ };
+ return zoom;
+ };
+ zoom.y = function(z) {
+ if (!arguments.length) return y1;
+ y1 = z;
+ y0 = z.copy();
+ view = {
+ x: 0,
+ y: 0,
+ k: 1
+ };
+ return zoom;
+ };
+ function location(p) {
+ return [ (p[0] - view.x) / view.k, (p[1] - view.y) / view.k ];
+ }
+ function point(l) {
+ return [ l[0] * view.k + view.x, l[1] * view.k + view.y ];
+ }
+ function scaleTo(s) {
+ view.k = Math.max(scaleExtent[0], Math.min(scaleExtent[1], s));
+ }
+ function translateTo(p, l) {
+ l = point(l);
+ view.x += p[0] - l[0];
+ view.y += p[1] - l[1];
+ }
+ function zoomTo(that, p, l, k) {
+ that.__chart__ = {
+ x: view.x,
+ y: view.y,
+ k: view.k
+ };
+ scaleTo(Math.pow(2, k));
+ translateTo(center0 = p, l);
+ that = d3.select(that);
+ if (duration > 0) that = that.transition().duration(duration);
+ that.call(zoom.event);
+ }
+ function rescale() {
+ if (x1) x1.domain(x0.range().map(function(x) {
+ return (x - view.x) / view.k;
+ }).map(x0.invert));
+ if (y1) y1.domain(y0.range().map(function(y) {
+ return (y - view.y) / view.k;
+ }).map(y0.invert));
+ }
+ function zoomstarted(dispatch) {
+ if (!zooming++) dispatch({
+ type: "zoomstart"
+ });
+ }
+ function zoomed(dispatch) {
+ rescale();
+ dispatch({
+ type: "zoom",
+ scale: view.k,
+ translate: [ view.x, view.y ]
+ });
+ }
+ function zoomended(dispatch) {
+ if (!--zooming) dispatch({
+ type: "zoomend"
+ });
+ center0 = null;
+ }
+ function mousedowned() {
+ var that = this, target = d3.event.target, dispatch = event.of(that, arguments), dragged = 0, subject = d3.select(d3_window(that)).on(mousemove, moved).on(mouseup, ended), location0 = location(d3.mouse(that)), dragRestore = d3_event_dragSuppress(that);
+ d3_selection_interrupt.call(that);
+ zoomstarted(dispatch);
+ function moved() {
+ dragged = 1;
+ translateTo(d3.mouse(that), location0);
+ zoomed(dispatch);
+ }
+ function ended() {
+ subject.on(mousemove, null).on(mouseup, null);
+ dragRestore(dragged && d3.event.target === target);
+ zoomended(dispatch);
+ }
+ }
+ function touchstarted() {
+ var that = this, dispatch = event.of(that, arguments), locations0 = {}, distance0 = 0, scale0, zoomName = ".zoom-" + d3.event.changedTouches[0].identifier, touchmove = "touchmove" + zoomName, touchend = "touchend" + zoomName, targets = [], subject = d3.select(that), dragRestore = d3_event_dragSuppress(that);
+ started();
+ zoomstarted(dispatch);
+ subject.on(mousedown, null).on(touchstart, started);
+ function relocate() {
+ var touches = d3.touches(that);
+ scale0 = view.k;
+ touches.forEach(function(t) {
+ if (t.identifier in locations0) locations0[t.identifier] = location(t);
+ });
+ return touches;
+ }
+ function started() {
+ var target = d3.event.target;
+ d3.select(target).on(touchmove, moved).on(touchend, ended);
+ targets.push(target);
+ var changed = d3.event.changedTouches;
+ for (var i = 0, n = changed.length; i < n; ++i) {
+ locations0[changed[i].identifier] = null;
+ }
+ var touches = relocate(), now = Date.now();
+ if (touches.length === 1) {
+ if (now - touchtime < 500) {
+ var p = touches[0];
+ zoomTo(that, p, locations0[p.identifier], Math.floor(Math.log(view.k) / Math.LN2) + 1);
+ d3_eventPreventDefault();
+ }
+ touchtime = now;
+ } else if (touches.length > 1) {
+ var p = touches[0], q = touches[1], dx = p[0] - q[0], dy = p[1] - q[1];
+ distance0 = dx * dx + dy * dy;
+ }
+ }
+ function moved() {
+ var touches = d3.touches(that), p0, l0, p1, l1;
+ d3_selection_interrupt.call(that);
+ for (var i = 0, n = touches.length; i < n; ++i, l1 = null) {
+ p1 = touches[i];
+ if (l1 = locations0[p1.identifier]) {
+ if (l0) break;
+ p0 = p1, l0 = l1;
+ }
+ }
+ if (l1) {
+ var distance1 = (distance1 = p1[0] - p0[0]) * distance1 + (distance1 = p1[1] - p0[1]) * distance1, scale1 = distance0 && Math.sqrt(distance1 / distance0);
+ p0 = [ (p0[0] + p1[0]) / 2, (p0[1] + p1[1]) / 2 ];
+ l0 = [ (l0[0] + l1[0]) / 2, (l0[1] + l1[1]) / 2 ];
+ scaleTo(scale1 * scale0);
+ }
+ touchtime = null;
+ translateTo(p0, l0);
+ zoomed(dispatch);
+ }
+ function ended() {
+ if (d3.event.touches.length) {
+ var changed = d3.event.changedTouches;
+ for (var i = 0, n = changed.length; i < n; ++i) {
+ delete locations0[changed[i].identifier];
+ }
+ for (var identifier in locations0) {
+ return void relocate();
+ }
+ }
+ d3.selectAll(targets).on(zoomName, null);
+ subject.on(mousedown, mousedowned).on(touchstart, touchstarted);
+ dragRestore();
+ zoomended(dispatch);
+ }
+ }
+ function mousewheeled() {
+ var dispatch = event.of(this, arguments);
+ if (mousewheelTimer) clearTimeout(mousewheelTimer); else translate0 = location(center0 = center || d3.mouse(this)),
+ d3_selection_interrupt.call(this), zoomstarted(dispatch);
+ mousewheelTimer = setTimeout(function() {
+ mousewheelTimer = null;
+ zoomended(dispatch);
+ }, 50);
+ d3_eventPreventDefault();
+ scaleTo(Math.pow(2, d3_behavior_zoomDelta() * .002) * view.k);
+ translateTo(center0, translate0);
+ zoomed(dispatch);
+ }
+ function dblclicked() {
+ var p = d3.mouse(this), k = Math.log(view.k) / Math.LN2;
+ zoomTo(this, p, location(p), d3.event.shiftKey ? Math.ceil(k) - 1 : Math.floor(k) + 1);
+ }
+ return d3.rebind(zoom, event, "on");
+ };
+ var d3_behavior_zoomInfinity = [ 0, Infinity ], d3_behavior_zoomDelta, d3_behavior_zoomWheel;
+ d3.color = d3_color;
+ function d3_color() {}
+ d3_color.prototype.toString = function() {
+ return this.rgb() + "";
+ };
+ d3.hsl = d3_hsl;
+ function d3_hsl(h, s, l) {
+ return this instanceof d3_hsl ? void (this.h = +h, this.s = +s, this.l = +l) : arguments.length < 2 ? h instanceof d3_hsl ? new d3_hsl(h.h, h.s, h.l) : d3_rgb_parse("" + h, d3_rgb_hsl, d3_hsl) : new d3_hsl(h, s, l);
+ }
+ var d3_hslPrototype = d3_hsl.prototype = new d3_color();
+ d3_hslPrototype.brighter = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ return new d3_hsl(this.h, this.s, this.l / k);
+ };
+ d3_hslPrototype.darker = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ return new d3_hsl(this.h, this.s, k * this.l);
+ };
+ d3_hslPrototype.rgb = function() {
+ return d3_hsl_rgb(this.h, this.s, this.l);
+ };
+ function d3_hsl_rgb(h, s, l) {
+ var m1, m2;
+ h = isNaN(h) ? 0 : (h %= 360) < 0 ? h + 360 : h;
+ s = isNaN(s) ? 0 : s < 0 ? 0 : s > 1 ? 1 : s;
+ l = l < 0 ? 0 : l > 1 ? 1 : l;
+ m2 = l <= .5 ? l * (1 + s) : l + s - l * s;
+ m1 = 2 * l - m2;
+ function v(h) {
+ if (h > 360) h -= 360; else if (h < 0) h += 360;
+ if (h < 60) return m1 + (m2 - m1) * h / 60;
+ if (h < 180) return m2;
+ if (h < 240) return m1 + (m2 - m1) * (240 - h) / 60;
+ return m1;
+ }
+ function vv(h) {
+ return Math.round(v(h) * 255);
+ }
+ return new d3_rgb(vv(h + 120), vv(h), vv(h - 120));
+ }
+ d3.hcl = d3_hcl;
+ function d3_hcl(h, c, l) {
+ return this instanceof d3_hcl ? void (this.h = +h, this.c = +c, this.l = +l) : arguments.length < 2 ? h instanceof d3_hcl ? new d3_hcl(h.h, h.c, h.l) : h instanceof d3_lab ? d3_lab_hcl(h.l, h.a, h.b) : d3_lab_hcl((h = d3_rgb_lab((h = d3.rgb(h)).r, h.g, h.b)).l, h.a, h.b) : new d3_hcl(h, c, l);
+ }
+ var d3_hclPrototype = d3_hcl.prototype = new d3_color();
+ d3_hclPrototype.brighter = function(k) {
+ return new d3_hcl(this.h, this.c, Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)));
+ };
+ d3_hclPrototype.darker = function(k) {
+ return new d3_hcl(this.h, this.c, Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)));
+ };
+ d3_hclPrototype.rgb = function() {
+ return d3_hcl_lab(this.h, this.c, this.l).rgb();
+ };
+ function d3_hcl_lab(h, c, l) {
+ if (isNaN(h)) h = 0;
+ if (isNaN(c)) c = 0;
+ return new d3_lab(l, Math.cos(h *= d3_radians) * c, Math.sin(h) * c);
+ }
+ d3.lab = d3_lab;
+ function d3_lab(l, a, b) {
+ return this instanceof d3_lab ? void (this.l = +l, this.a = +a, this.b = +b) : arguments.length < 2 ? l instanceof d3_lab ? new d3_lab(l.l, l.a, l.b) : l instanceof d3_hcl ? d3_hcl_lab(l.h, l.c, l.l) : d3_rgb_lab((l = d3_rgb(l)).r, l.g, l.b) : new d3_lab(l, a, b);
+ }
+ var d3_lab_K = 18;
+ var d3_lab_X = .95047, d3_lab_Y = 1, d3_lab_Z = 1.08883;
+ var d3_labPrototype = d3_lab.prototype = new d3_color();
+ d3_labPrototype.brighter = function(k) {
+ return new d3_lab(Math.min(100, this.l + d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
+ };
+ d3_labPrototype.darker = function(k) {
+ return new d3_lab(Math.max(0, this.l - d3_lab_K * (arguments.length ? k : 1)), this.a, this.b);
+ };
+ d3_labPrototype.rgb = function() {
+ return d3_lab_rgb(this.l, this.a, this.b);
+ };
+ function d3_lab_rgb(l, a, b) {
+ var y = (l + 16) / 116, x = y + a / 500, z = y - b / 200;
+ x = d3_lab_xyz(x) * d3_lab_X;
+ y = d3_lab_xyz(y) * d3_lab_Y;
+ z = d3_lab_xyz(z) * d3_lab_Z;
+ return new d3_rgb(d3_xyz_rgb(3.2404542 * x - 1.5371385 * y - .4985314 * z), d3_xyz_rgb(-.969266 * x + 1.8760108 * y + .041556 * z), d3_xyz_rgb(.0556434 * x - .2040259 * y + 1.0572252 * z));
+ }
+ function d3_lab_hcl(l, a, b) {
+ return l > 0 ? new d3_hcl(Math.atan2(b, a) * d3_degrees, Math.sqrt(a * a + b * b), l) : new d3_hcl(NaN, NaN, l);
+ }
+ function d3_lab_xyz(x) {
+ return x > .206893034 ? x * x * x : (x - 4 / 29) / 7.787037;
+ }
+ function d3_xyz_lab(x) {
+ return x > .008856 ? Math.pow(x, 1 / 3) : 7.787037 * x + 4 / 29;
+ }
+ function d3_xyz_rgb(r) {
+ return Math.round(255 * (r <= .00304 ? 12.92 * r : 1.055 * Math.pow(r, 1 / 2.4) - .055));
+ }
+ d3.rgb = d3_rgb;
+ function d3_rgb(r, g, b) {
+ return this instanceof d3_rgb ? void (this.r = ~~r, this.g = ~~g, this.b = ~~b) : arguments.length < 2 ? r instanceof d3_rgb ? new d3_rgb(r.r, r.g, r.b) : d3_rgb_parse("" + r, d3_rgb, d3_hsl_rgb) : new d3_rgb(r, g, b);
+ }
+ function d3_rgbNumber(value) {
+ return new d3_rgb(value >> 16, value >> 8 & 255, value & 255);
+ }
+ function d3_rgbString(value) {
+ return d3_rgbNumber(value) + "";
+ }
+ var d3_rgbPrototype = d3_rgb.prototype = new d3_color();
+ d3_rgbPrototype.brighter = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ var r = this.r, g = this.g, b = this.b, i = 30;
+ if (!r && !g && !b) return new d3_rgb(i, i, i);
+ if (r && r < i) r = i;
+ if (g && g < i) g = i;
+ if (b && b < i) b = i;
+ return new d3_rgb(Math.min(255, r / k), Math.min(255, g / k), Math.min(255, b / k));
+ };
+ d3_rgbPrototype.darker = function(k) {
+ k = Math.pow(.7, arguments.length ? k : 1);
+ return new d3_rgb(k * this.r, k * this.g, k * this.b);
+ };
+ d3_rgbPrototype.hsl = function() {
+ return d3_rgb_hsl(this.r, this.g, this.b);
+ };
+ d3_rgbPrototype.toString = function() {
+ return "#" + d3_rgb_hex(this.r) + d3_rgb_hex(this.g) + d3_rgb_hex(this.b);
+ };
+ function d3_rgb_hex(v) {
+ return v < 16 ? "0" + Math.max(0, v).toString(16) : Math.min(255, v).toString(16);
+ }
+ function d3_rgb_parse(format, rgb, hsl) {
+ var r = 0, g = 0, b = 0, m1, m2, color;
+ m1 = /([a-z]+)\((.*)\)/i.exec(format);
+ if (m1) {
+ m2 = m1[2].split(",");
+ switch (m1[1]) {
+ case "hsl":
+ {
+ return hsl(parseFloat(m2[0]), parseFloat(m2[1]) / 100, parseFloat(m2[2]) / 100);
+ }
+
+ case "rgb":
+ {
+ return rgb(d3_rgb_parseNumber(m2[0]), d3_rgb_parseNumber(m2[1]), d3_rgb_parseNumber(m2[2]));
+ }
+ }
+ }
+ if (color = d3_rgb_names.get(format.toLowerCase())) {
+ return rgb(color.r, color.g, color.b);
+ }
+ if (format != null && format.charAt(0) === "#" && !isNaN(color = parseInt(format.slice(1), 16))) {
+ if (format.length === 4) {
+ r = (color & 3840) >> 4;
+ r = r >> 4 | r;
+ g = color & 240;
+ g = g >> 4 | g;
+ b = color & 15;
+ b = b << 4 | b;
+ } else if (format.length === 7) {
+ r = (color & 16711680) >> 16;
+ g = (color & 65280) >> 8;
+ b = color & 255;
+ }
+ }
+ return rgb(r, g, b);
+ }
+ function d3_rgb_hsl(r, g, b) {
+ var min = Math.min(r /= 255, g /= 255, b /= 255), max = Math.max(r, g, b), d = max - min, h, s, l = (max + min) / 2;
+ if (d) {
+ s = l < .5 ? d / (max + min) : d / (2 - max - min);
+ if (r == max) h = (g - b) / d + (g < b ? 6 : 0); else if (g == max) h = (b - r) / d + 2; else h = (r - g) / d + 4;
+ h *= 60;
+ } else {
+ h = NaN;
+ s = l > 0 && l < 1 ? 0 : h;
+ }
+ return new d3_hsl(h, s, l);
+ }
+ function d3_rgb_lab(r, g, b) {
+ r = d3_rgb_xyz(r);
+ g = d3_rgb_xyz(g);
+ b = d3_rgb_xyz(b);
+ var x = d3_xyz_lab((.4124564 * r + .3575761 * g + .1804375 * b) / d3_lab_X), y = d3_xyz_lab((.2126729 * r + .7151522 * g + .072175 * b) / d3_lab_Y), z = d3_xyz_lab((.0193339 * r + .119192 * g + .9503041 * b) / d3_lab_Z);
+ return d3_lab(116 * y - 16, 500 * (x - y), 200 * (y - z));
+ }
+ function d3_rgb_xyz(r) {
+ return (r /= 255) <= .04045 ? r / 12.92 : Math.pow((r + .055) / 1.055, 2.4);
+ }
+ function d3_rgb_parseNumber(c) {
+ var f = parseFloat(c);
+ return c.charAt(c.length - 1) === "%" ? Math.round(f * 2.55) : f;
+ }
+ var d3_rgb_names = d3.map({
+ aliceblue: 15792383,
+ antiquewhite: 16444375,
+ aqua: 65535,
+ aquamarine: 8388564,
+ azure: 15794175,
+ beige: 16119260,
+ bisque: 16770244,
+ black: 0,
+ blanchedalmond: 16772045,
+ blue: 255,
+ blueviolet: 9055202,
+ brown: 10824234,
+ burlywood: 14596231,
+ cadetblue: 6266528,
+ chartreuse: 8388352,
+ chocolate: 13789470,
+ coral: 16744272,
+ cornflowerblue: 6591981,
+ cornsilk: 16775388,
+ crimson: 14423100,
+ cyan: 65535,
+ darkblue: 139,
+ darkcyan: 35723,
+ darkgoldenrod: 12092939,
+ darkgray: 11119017,
+ darkgreen: 25600,
+ darkgrey: 11119017,
+ darkkhaki: 12433259,
+ darkmagenta: 9109643,
+ darkolivegreen: 5597999,
+ darkorange: 16747520,
+ darkorchid: 10040012,
+ darkred: 9109504,
+ darksalmon: 15308410,
+ darkseagreen: 9419919,
+ darkslateblue: 4734347,
+ darkslategray: 3100495,
+ darkslategrey: 3100495,
+ darkturquoise: 52945,
+ darkviolet: 9699539,
+ deeppink: 16716947,
+ deepskyblue: 49151,
+ dimgray: 6908265,
+ dimgrey: 6908265,
+ dodgerblue: 2003199,
+ firebrick: 11674146,
+ floralwhite: 16775920,
+ forestgreen: 2263842,
+ fuchsia: 16711935,
+ gainsboro: 14474460,
+ ghostwhite: 16316671,
+ gold: 16766720,
+ goldenrod: 14329120,
+ gray: 8421504,
+ green: 32768,
+ greenyellow: 11403055,
+ grey: 8421504,
+ honeydew: 15794160,
+ hotpink: 16738740,
+ indianred: 13458524,
+ indigo: 4915330,
+ ivory: 16777200,
+ khaki: 15787660,
+ lavender: 15132410,
+ lavenderblush: 16773365,
+ lawngreen: 8190976,
+ lemonchiffon: 16775885,
+ lightblue: 11393254,
+ lightcoral: 15761536,
+ lightcyan: 14745599,
+ lightgoldenrodyellow: 16448210,
+ lightgray: 13882323,
+ lightgreen: 9498256,
+ lightgrey: 13882323,
+ lightpink: 16758465,
+ lightsalmon: 16752762,
+ lightseagreen: 2142890,
+ lightskyblue: 8900346,
+ lightslategray: 7833753,
+ lightslategrey: 7833753,
+ lightsteelblue: 11584734,
+ lightyellow: 16777184,
+ lime: 65280,
+ limegreen: 3329330,
+ linen: 16445670,
+ magenta: 16711935,
+ maroon: 8388608,
+ mediumaquamarine: 6737322,
+ mediumblue: 205,
+ mediumorchid: 12211667,
+ mediumpurple: 9662683,
+ mediumseagreen: 3978097,
+ mediumslateblue: 8087790,
+ mediumspringgreen: 64154,
+ mediumturquoise: 4772300,
+ mediumvioletred: 13047173,
+ midnightblue: 1644912,
+ mintcream: 16121850,
+ mistyrose: 16770273,
+ moccasin: 16770229,
+ navajowhite: 16768685,
+ navy: 128,
+ oldlace: 16643558,
+ olive: 8421376,
+ olivedrab: 7048739,
+ orange: 16753920,
+ orangered: 16729344,
+ orchid: 14315734,
+ palegoldenrod: 15657130,
+ palegreen: 10025880,
+ paleturquoise: 11529966,
+ palevioletred: 14381203,
+ papayawhip: 16773077,
+ peachpuff: 16767673,
+ peru: 13468991,
+ pink: 16761035,
+ plum: 14524637,
+ powderblue: 11591910,
+ purple: 8388736,
+ rebeccapurple: 6697881,
+ red: 16711680,
+ rosybrown: 12357519,
+ royalblue: 4286945,
+ saddlebrown: 9127187,
+ salmon: 16416882,
+ sandybrown: 16032864,
+ seagreen: 3050327,
+ seashell: 16774638,
+ sienna: 10506797,
+ silver: 12632256,
+ skyblue: 8900331,
+ slateblue: 6970061,
+ slategray: 7372944,
+ slategrey: 7372944,
+ snow: 16775930,
+ springgreen: 65407,
+ steelblue: 4620980,
+ tan: 13808780,
+ teal: 32896,
+ thistle: 14204888,
+ tomato: 16737095,
+ turquoise: 4251856,
+ violet: 15631086,
+ wheat: 16113331,
+ white: 16777215,
+ whitesmoke: 16119285,
+ yellow: 16776960,
+ yellowgreen: 10145074
+ });
+ d3_rgb_names.forEach(function(key, value) {
+ d3_rgb_names.set(key, d3_rgbNumber(value));
+ });
+ function d3_functor(v) {
+ return typeof v === "function" ? v : function() {
+ return v;
+ };
+ }
+ d3.functor = d3_functor;
+ d3.xhr = d3_xhrType(d3_identity);
+ function d3_xhrType(response) {
+ return function(url, mimeType, callback) {
+ if (arguments.length === 2 && typeof mimeType === "function") callback = mimeType,
+ mimeType = null;
+ return d3_xhr(url, mimeType, response, callback);
+ };
+ }
+ function d3_xhr(url, mimeType, response, callback) {
+ var xhr = {}, dispatch = d3.dispatch("beforesend", "progress", "load", "error"), headers = {}, request = new XMLHttpRequest(), responseType = null;
+ if (this.XDomainRequest && !("withCredentials" in request) && /^(http(s)?:)?\/\//.test(url)) request = new XDomainRequest();
+ "onload" in request ? request.onload = request.onerror = respond : request.onreadystatechange = function() {
+ request.readyState > 3 && respond();
+ };
+ function respond() {
+ var status = request.status, result;
+ if (!status && d3_xhrHasResponse(request) || status >= 200 && status < 300 || status === 304) {
+ try {
+ result = response.call(xhr, request);
+ } catch (e) {
+ dispatch.error.call(xhr, e);
+ return;
+ }
+ dispatch.load.call(xhr, result);
+ } else {
+ dispatch.error.call(xhr, request);
+ }
+ }
+ request.onprogress = function(event) {
+ var o = d3.event;
+ d3.event = event;
+ try {
+ dispatch.progress.call(xhr, request);
+ } finally {
+ d3.event = o;
+ }
+ };
+ xhr.header = function(name, value) {
+ name = (name + "").toLowerCase();
+ if (arguments.length < 2) return headers[name];
+ if (value == null) delete headers[name]; else headers[name] = value + "";
+ return xhr;
+ };
+ xhr.mimeType = function(value) {
+ if (!arguments.length) return mimeType;
+ mimeType = value == null ? null : value + "";
+ return xhr;
+ };
+ xhr.responseType = function(value) {
+ if (!arguments.length) return responseType;
+ responseType = value;
+ return xhr;
+ };
+ xhr.response = function(value) {
+ response = value;
+ return xhr;
+ };
+ [ "get", "post" ].forEach(function(method) {
+ xhr[method] = function() {
+ return xhr.send.apply(xhr, [ method ].concat(d3_array(arguments)));
+ };
+ });
+ xhr.send = function(method, data, callback) {
+ if (arguments.length === 2 && typeof data === "function") callback = data, data = null;
+ request.open(method, url, true);
+ if (mimeType != null && !("accept" in headers)) headers["accept"] = mimeType + ",*/*";
+ if (request.setRequestHeader) for (var name in headers) request.setRequestHeader(name, headers[name]);
+ if (mimeType != null && request.overrideMimeType) request.overrideMimeType(mimeType);
+ if (responseType != null) request.responseType = responseType;
+ if (callback != null) xhr.on("error", callback).on("load", function(request) {
+ callback(null, request);
+ });
+ dispatch.beforesend.call(xhr, request);
+ request.send(data == null ? null : data);
+ return xhr;
+ };
+ xhr.abort = function() {
+ request.abort();
+ return xhr;
+ };
+ d3.rebind(xhr, dispatch, "on");
+ return callback == null ? xhr : xhr.get(d3_xhr_fixCallback(callback));
+ }
+ function d3_xhr_fixCallback(callback) {
+ return callback.length === 1 ? function(error, request) {
+ callback(error == null ? request : null);
+ } : callback;
+ }
+ function d3_xhrHasResponse(request) {
+ var type = request.responseType;
+ return type && type !== "text" ? request.response : request.responseText;
+ }
+ d3.dsv = function(delimiter, mimeType) {
+ var reFormat = new RegExp('["' + delimiter + "\n]"), delimiterCode = delimiter.charCodeAt(0);
+ function dsv(url, row, callback) {
+ if (arguments.length < 3) callback = row, row = null;
+ var xhr = d3_xhr(url, mimeType, row == null ? response : typedResponse(row), callback);
+ xhr.row = function(_) {
+ return arguments.length ? xhr.response((row = _) == null ? response : typedResponse(_)) : row;
+ };
+ return xhr;
+ }
+ function response(request) {
+ return dsv.parse(request.responseText);
+ }
+ function typedResponse(f) {
+ return function(request) {
+ return dsv.parse(request.responseText, f);
+ };
+ }
+ dsv.parse = function(text, f) {
+ var o;
+ return dsv.parseRows(text, function(row, i) {
+ if (o) return o(row, i - 1);
+ var a = new Function("d", "return {" + row.map(function(name, i) {
+ return JSON.stringify(name) + ": d[" + i + "]";
+ }).join(",") + "}");
+ o = f ? function(row, i) {
+ return f(a(row), i);
+ } : a;
+ });
+ };
+ dsv.parseRows = function(text, f) {
+ var EOL = {}, EOF = {}, rows = [], N = text.length, I = 0, n = 0, t, eol;
+ function token() {
+ if (I >= N) return EOF;
+ if (eol) return eol = false, EOL;
+ var j = I;
+ if (text.charCodeAt(j) === 34) {
+ var i = j;
+ while (i++ < N) {
+ if (text.charCodeAt(i) === 34) {
+ if (text.charCodeAt(i + 1) !== 34) break;
+ ++i;
+ }
+ }
+ I = i + 2;
+ var c = text.charCodeAt(i + 1);
+ if (c === 13) {
+ eol = true;
+ if (text.charCodeAt(i + 2) === 10) ++I;
+ } else if (c === 10) {
+ eol = true;
+ }
+ return text.slice(j + 1, i).replace(/""/g, '"');
+ }
+ while (I < N) {
+ var c = text.charCodeAt(I++), k = 1;
+ if (c === 10) eol = true; else if (c === 13) {
+ eol = true;
+ if (text.charCodeAt(I) === 10) ++I, ++k;
+ } else if (c !== delimiterCode) continue;
+ return text.slice(j, I - k);
+ }
+ return text.slice(j);
+ }
+ while ((t = token()) !== EOF) {
+ var a = [];
+ while (t !== EOL && t !== EOF) {
+ a.push(t);
+ t = token();
+ }
+ if (f && (a = f(a, n++)) == null) continue;
+ rows.push(a);
+ }
+ return rows;
+ };
+ dsv.format = function(rows) {
+ if (Array.isArray(rows[0])) return dsv.formatRows(rows);
+ var fieldSet = new d3_Set(), fields = [];
+ rows.forEach(function(row) {
+ for (var field in row) {
+ if (!fieldSet.has(field)) {
+ fields.push(fieldSet.add(field));
+ }
+ }
+ });
+ return [ fields.map(formatValue).join(delimiter) ].concat(rows.map(function(row) {
+ return fields.map(function(field) {
+ return formatValue(row[field]);
+ }).join(delimiter);
+ })).join("\n");
+ };
+ dsv.formatRows = function(rows) {
+ return rows.map(formatRow).join("\n");
+ };
+ function formatRow(row) {
+ return row.map(formatValue).join(delimiter);
+ }
+ function formatValue(text) {
+ return reFormat.test(text) ? '"' + text.replace(/\"/g, '""') + '"' : text;
+ }
+ return dsv;
+ };
+ d3.csv = d3.dsv(",", "text/csv");
+ d3.tsv = d3.dsv(" ", "text/tab-separated-values");
+ var d3_timer_queueHead, d3_timer_queueTail, d3_timer_interval, d3_timer_timeout, d3_timer_active, d3_timer_frame = this[d3_vendorSymbol(this, "requestAnimationFrame")] || function(callback) {
+ setTimeout(callback, 17);
+ };
+ d3.timer = function(callback, delay, then) {
+ var n = arguments.length;
+ if (n < 2) delay = 0;
+ if (n < 3) then = Date.now();
+ var time = then + delay, timer = {
+ c: callback,
+ t: time,
+ f: false,
+ n: null
+ };
+ if (d3_timer_queueTail) d3_timer_queueTail.n = timer; else d3_timer_queueHead = timer;
+ d3_timer_queueTail = timer;
+ if (!d3_timer_interval) {
+ d3_timer_timeout = clearTimeout(d3_timer_timeout);
+ d3_timer_interval = 1;
+ d3_timer_frame(d3_timer_step);
+ }
+ };
+ function d3_timer_step() {
+ var now = d3_timer_mark(), delay = d3_timer_sweep() - now;
+ if (delay > 24) {
+ if (isFinite(delay)) {
+ clearTimeout(d3_timer_timeout);
+ d3_timer_timeout = setTimeout(d3_timer_step, delay);
+ }
+ d3_timer_interval = 0;
+ } else {
+ d3_timer_interval = 1;
+ d3_timer_frame(d3_timer_step);
+ }
+ }
+ d3.timer.flush = function() {
+ d3_timer_mark();
+ d3_timer_sweep();
+ };
+ function d3_timer_mark() {
+ var now = Date.now();
+ d3_timer_active = d3_timer_queueHead;
+ while (d3_timer_active) {
+ if (now >= d3_timer_active.t) d3_timer_active.f = d3_timer_active.c(now - d3_timer_active.t);
+ d3_timer_active = d3_timer_active.n;
+ }
+ return now;
+ }
+ function d3_timer_sweep() {
+ var t0, t1 = d3_timer_queueHead, time = Infinity;
+ while (t1) {
+ if (t1.f) {
+ t1 = t0 ? t0.n = t1.n : d3_timer_queueHead = t1.n;
+ } else {
+ if (t1.t < time) time = t1.t;
+ t1 = (t0 = t1).n;
+ }
+ }
+ d3_timer_queueTail = t0;
+ return time;
+ }
+ function d3_format_precision(x, p) {
+ return p - (x ? Math.ceil(Math.log(x) / Math.LN10) : 1);
+ }
+ d3.round = function(x, n) {
+ return n ? Math.round(x * (n = Math.pow(10, n))) / n : Math.round(x);
+ };
+ var d3_formatPrefixes = [ "y", "z", "a", "f", "p", "n", "µ", "m", "", "k", "M", "G", "T", "P", "E", "Z", "Y" ].map(d3_formatPrefix);
+ d3.formatPrefix = function(value, precision) {
+ var i = 0;
+ if (value) {
+ if (value < 0) value *= -1;
+ if (precision) value = d3.round(value, d3_format_precision(value, precision));
+ i = 1 + Math.floor(1e-12 + Math.log(value) / Math.LN10);
+ i = Math.max(-24, Math.min(24, Math.floor((i - 1) / 3) * 3));
+ }
+ return d3_formatPrefixes[8 + i / 3];
+ };
+ function d3_formatPrefix(d, i) {
+ var k = Math.pow(10, abs(8 - i) * 3);
+ return {
+ scale: i > 8 ? function(d) {
+ return d / k;
+ } : function(d) {
+ return d * k;
+ },
+ symbol: d
+ };
+ }
+ function d3_locale_numberFormat(locale) {
+ var locale_decimal = locale.decimal, locale_thousands = locale.thousands, locale_grouping = locale.grouping, locale_currency = locale.currency, formatGroup = locale_grouping && locale_thousands ? function(value, width) {
+ var i = value.length, t = [], j = 0, g = locale_grouping[0], length = 0;
+ while (i > 0 && g > 0) {
+ if (length + g + 1 > width) g = Math.max(1, width - length);
+ t.push(value.substring(i -= g, i + g));
+ if ((length += g + 1) > width) break;
+ g = locale_grouping[j = (j + 1) % locale_grouping.length];
+ }
+ return t.reverse().join(locale_thousands);
+ } : d3_identity;
+ return function(specifier) {
+ var match = d3_format_re.exec(specifier), fill = match[1] || " ", align = match[2] || ">", sign = match[3] || "-", symbol = match[4] || "", zfill = match[5], width = +match[6], comma = match[7], precision = match[8], type = match[9], scale = 1, prefix = "", suffix = "", integer = false, exponent = true;
+ if (precision) precision = +precision.substring(1);
+ if (zfill || fill === "0" && align === "=") {
+ zfill = fill = "0";
+ align = "=";
+ }
+ switch (type) {
+ case "n":
+ comma = true;
+ type = "g";
+ break;
+
+ case "%":
+ scale = 100;
+ suffix = "%";
+ type = "f";
+ break;
+
+ case "p":
+ scale = 100;
+ suffix = "%";
+ type = "r";
+ break;
+
+ case "b":
+ case "o":
+ case "x":
+ case "X":
+ if (symbol === "#") prefix = "0" + type.toLowerCase();
+
+ case "c":
+ exponent = false;
+
+ case "d":
+ integer = true;
+ precision = 0;
+ break;
+
+ case "s":
+ scale = -1;
+ type = "r";
+ break;
+ }
+ if (symbol === "$") prefix = locale_currency[0], suffix = locale_currency[1];
+ if (type == "r" && !precision) type = "g";
+ if (precision != null) {
+ if (type == "g") precision = Math.max(1, Math.min(21, precision)); else if (type == "e" || type == "f") precision = Math.max(0, Math.min(20, precision));
+ }
+ type = d3_format_types.get(type) || d3_format_typeDefault;
+ var zcomma = zfill && comma;
+ return function(value) {
+ var fullSuffix = suffix;
+ if (integer && value % 1) return "";
+ var negative = value < 0 || value === 0 && 1 / value < 0 ? (value = -value, "-") : sign === "-" ? "" : sign;
+ if (scale < 0) {
+ var unit = d3.formatPrefix(value, precision);
+ value = unit.scale(value);
+ fullSuffix = unit.symbol + suffix;
+ } else {
+ value *= scale;
+ }
+ value = type(value, precision);
+ var i = value.lastIndexOf("."), before, after;
+ if (i < 0) {
+ var j = exponent ? value.lastIndexOf("e") : -1;
+ if (j < 0) before = value, after = ""; else before = value.substring(0, j), after = value.substring(j);
+ } else {
+ before = value.substring(0, i);
+ after = locale_decimal + value.substring(i + 1);
+ }
+ if (!zfill && comma) before = formatGroup(before, Infinity);
+ var length = prefix.length + before.length + after.length + (zcomma ? 0 : negative.length), padding = length < width ? new Array(length = width - length + 1).join(fill) : "";
+ if (zcomma) before = formatGroup(padding + before, padding.length ? width - after.length : Infinity);
+ negative += prefix;
+ value = before + after;
+ return (align === "<" ? negative + value + padding : align === ">" ? padding + negative + value : align === "^" ? padding.substring(0, length >>= 1) + negative + value + padding.substring(length) : negative + (zcomma ? value : padding + value)) + fullSuffix;
+ };
+ };
+ }
+ var d3_format_re = /(?:([^{])?([<>=^]))?([+\- ])?([$#])?(0)?(\d+)?(,)?(\.-?\d+)?([a-z%])?/i;
+ var d3_format_types = d3.map({
+ b: function(x) {
+ return x.toString(2);
+ },
+ c: function(x) {
+ return String.fromCharCode(x);
+ },
+ o: function(x) {
+ return x.toString(8);
+ },
+ x: function(x) {
+ return x.toString(16);
+ },
+ X: function(x) {
+ return x.toString(16).toUpperCase();
+ },
+ g: function(x, p) {
+ return x.toPrecision(p);
+ },
+ e: function(x, p) {
+ return x.toExponential(p);
+ },
+ f: function(x, p) {
+ return x.toFixed(p);
+ },
+ r: function(x, p) {
+ return (x = d3.round(x, d3_format_precision(x, p))).toFixed(Math.max(0, Math.min(20, d3_format_precision(x * (1 + 1e-15), p))));
+ }
+ });
+ function d3_format_typeDefault(x) {
+ return x + "";
+ }
+ var d3_time = d3.time = {}, d3_date = Date;
+ function d3_date_utc() {
+ this._ = new Date(arguments.length > 1 ? Date.UTC.apply(this, arguments) : arguments[0]);
+ }
+ d3_date_utc.prototype = {
+ getDate: function() {
+ return this._.getUTCDate();
+ },
+ getDay: function() {
+ return this._.getUTCDay();
+ },
+ getFullYear: function() {
+ return this._.getUTCFullYear();
+ },
+ getHours: function() {
+ return this._.getUTCHours();
+ },
+ getMilliseconds: function() {
+ return this._.getUTCMilliseconds();
+ },
+ getMinutes: function() {
+ return this._.getUTCMinutes();
+ },
+ getMonth: function() {
+ return this._.getUTCMonth();
+ },
+ getSeconds: function() {
+ return this._.getUTCSeconds();
+ },
+ getTime: function() {
+ return this._.getTime();
+ },
+ getTimezoneOffset: function() {
+ return 0;
+ },
+ valueOf: function() {
+ return this._.valueOf();
+ },
+ setDate: function() {
+ d3_time_prototype.setUTCDate.apply(this._, arguments);
+ },
+ setDay: function() {
+ d3_time_prototype.setUTCDay.apply(this._, arguments);
+ },
+ setFullYear: function() {
+ d3_time_prototype.setUTCFullYear.apply(this._, arguments);
+ },
+ setHours: function() {
+ d3_time_prototype.setUTCHours.apply(this._, arguments);
+ },
+ setMilliseconds: function() {
+ d3_time_prototype.setUTCMilliseconds.apply(this._, arguments);
+ },
+ setMinutes: function() {
+ d3_time_prototype.setUTCMinutes.apply(this._, arguments);
+ },
+ setMonth: function() {
+ d3_time_prototype.setUTCMonth.apply(this._, arguments);
+ },
+ setSeconds: function() {
+ d3_time_prototype.setUTCSeconds.apply(this._, arguments);
+ },
+ setTime: function() {
+ d3_time_prototype.setTime.apply(this._, arguments);
+ }
+ };
+ var d3_time_prototype = Date.prototype;
+ function d3_time_interval(local, step, number) {
+ function round(date) {
+ var d0 = local(date), d1 = offset(d0, 1);
+ return date - d0 < d1 - date ? d0 : d1;
+ }
+ function ceil(date) {
+ step(date = local(new d3_date(date - 1)), 1);
+ return date;
+ }
+ function offset(date, k) {
+ step(date = new d3_date(+date), k);
+ return date;
+ }
+ function range(t0, t1, dt) {
+ var time = ceil(t0), times = [];
+ if (dt > 1) {
+ while (time < t1) {
+ if (!(number(time) % dt)) times.push(new Date(+time));
+ step(time, 1);
+ }
+ } else {
+ while (time < t1) times.push(new Date(+time)), step(time, 1);
+ }
+ return times;
+ }
+ function range_utc(t0, t1, dt) {
+ try {
+ d3_date = d3_date_utc;
+ var utc = new d3_date_utc();
+ utc._ = t0;
+ return range(utc, t1, dt);
+ } finally {
+ d3_date = Date;
+ }
+ }
+ local.floor = local;
+ local.round = round;
+ local.ceil = ceil;
+ local.offset = offset;
+ local.range = range;
+ var utc = local.utc = d3_time_interval_utc(local);
+ utc.floor = utc;
+ utc.round = d3_time_interval_utc(round);
+ utc.ceil = d3_time_interval_utc(ceil);
+ utc.offset = d3_time_interval_utc(offset);
+ utc.range = range_utc;
+ return local;
+ }
+ function d3_time_interval_utc(method) {
+ return function(date, k) {
+ try {
+ d3_date = d3_date_utc;
+ var utc = new d3_date_utc();
+ utc._ = date;
+ return method(utc, k)._;
+ } finally {
+ d3_date = Date;
+ }
+ };
+ }
+ d3_time.year = d3_time_interval(function(date) {
+ date = d3_time.day(date);
+ date.setMonth(0, 1);
+ return date;
+ }, function(date, offset) {
+ date.setFullYear(date.getFullYear() + offset);
+ }, function(date) {
+ return date.getFullYear();
+ });
+ d3_time.years = d3_time.year.range;
+ d3_time.years.utc = d3_time.year.utc.range;
+ d3_time.day = d3_time_interval(function(date) {
+ var day = new d3_date(2e3, 0);
+ day.setFullYear(date.getFullYear(), date.getMonth(), date.getDate());
+ return day;
+ }, function(date, offset) {
+ date.setDate(date.getDate() + offset);
+ }, function(date) {
+ return date.getDate() - 1;
+ });
+ d3_time.days = d3_time.day.range;
+ d3_time.days.utc = d3_time.day.utc.range;
+ d3_time.dayOfYear = function(date) {
+ var year = d3_time.year(date);
+ return Math.floor((date - year - (date.getTimezoneOffset() - year.getTimezoneOffset()) * 6e4) / 864e5);
+ };
+ [ "sunday", "monday", "tuesday", "wednesday", "thursday", "friday", "saturday" ].forEach(function(day, i) {
+ i = 7 - i;
+ var interval = d3_time[day] = d3_time_interval(function(date) {
+ (date = d3_time.day(date)).setDate(date.getDate() - (date.getDay() + i) % 7);
+ return date;
+ }, function(date, offset) {
+ date.setDate(date.getDate() + Math.floor(offset) * 7);
+ }, function(date) {
+ var day = d3_time.year(date).getDay();
+ return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7) - (day !== i);
+ });
+ d3_time[day + "s"] = interval.range;
+ d3_time[day + "s"].utc = interval.utc.range;
+ d3_time[day + "OfYear"] = function(date) {
+ var day = d3_time.year(date).getDay();
+ return Math.floor((d3_time.dayOfYear(date) + (day + i) % 7) / 7);
+ };
+ });
+ d3_time.week = d3_time.sunday;
+ d3_time.weeks = d3_time.sunday.range;
+ d3_time.weeks.utc = d3_time.sunday.utc.range;
+ d3_time.weekOfYear = d3_time.sundayOfYear;
+ function d3_locale_timeFormat(locale) {
+ var locale_dateTime = locale.dateTime, locale_date = locale.date, locale_time = locale.time, locale_periods = locale.periods, locale_days = locale.days, locale_shortDays = locale.shortDays, locale_months = locale.months, locale_shortMonths = locale.shortMonths;
+ function d3_time_format(template) {
+ var n = template.length;
+ function format(date) {
+ var string = [], i = -1, j = 0, c, p, f;
+ while (++i < n) {
+ if (template.charCodeAt(i) === 37) {
+ string.push(template.slice(j, i));
+ if ((p = d3_time_formatPads[c = template.charAt(++i)]) != null) c = template.charAt(++i);
+ if (f = d3_time_formats[c]) c = f(date, p == null ? c === "e" ? " " : "0" : p);
+ string.push(c);
+ j = i + 1;
+ }
+ }
+ string.push(template.slice(j, i));
+ return string.join("");
+ }
+ format.parse = function(string) {
+ var d = {
+ y: 1900,
+ m: 0,
+ d: 1,
+ H: 0,
+ M: 0,
+ S: 0,
+ L: 0,
+ Z: null
+ }, i = d3_time_parse(d, template, string, 0);
+ if (i != string.length) return null;
+ if ("p" in d) d.H = d.H % 12 + d.p * 12;
+ var localZ = d.Z != null && d3_date !== d3_date_utc, date = new (localZ ? d3_date_utc : d3_date)();
+ if ("j" in d) date.setFullYear(d.y, 0, d.j); else if ("w" in d && ("W" in d || "U" in d)) {
+ date.setFullYear(d.y, 0, 1);
+ date.setFullYear(d.y, 0, "W" in d ? (d.w + 6) % 7 + d.W * 7 - (date.getDay() + 5) % 7 : d.w + d.U * 7 - (date.getDay() + 6) % 7);
+ } else date.setFullYear(d.y, d.m, d.d);
+ date.setHours(d.H + (d.Z / 100 | 0), d.M + d.Z % 100, d.S, d.L);
+ return localZ ? date._ : date;
+ };
+ format.toString = function() {
+ return template;
+ };
+ return format;
+ }
+ function d3_time_parse(date, template, string, j) {
+ var c, p, t, i = 0, n = template.length, m = string.length;
+ while (i < n) {
+ if (j >= m) return -1;
+ c = template.charCodeAt(i++);
+ if (c === 37) {
+ t = template.charAt(i++);
+ p = d3_time_parsers[t in d3_time_formatPads ? template.charAt(i++) : t];
+ if (!p || (j = p(date, string, j)) < 0) return -1;
+ } else if (c != string.charCodeAt(j++)) {
+ return -1;
+ }
+ }
+ return j;
+ }
+ d3_time_format.utc = function(template) {
+ var local = d3_time_format(template);
+ function format(date) {
+ try {
+ d3_date = d3_date_utc;
+ var utc = new d3_date();
+ utc._ = date;
+ return local(utc);
+ } finally {
+ d3_date = Date;
+ }
+ }
+ format.parse = function(string) {
+ try {
+ d3_date = d3_date_utc;
+ var date = local.parse(string);
+ return date && date._;
+ } finally {
+ d3_date = Date;
+ }
+ };
+ format.toString = local.toString;
+ return format;
+ };
+ d3_time_format.multi = d3_time_format.utc.multi = d3_time_formatMulti;
+ var d3_time_periodLookup = d3.map(), d3_time_dayRe = d3_time_formatRe(locale_days), d3_time_dayLookup = d3_time_formatLookup(locale_days), d3_time_dayAbbrevRe = d3_time_formatRe(locale_shortDays), d3_time_dayAbbrevLookup = d3_time_formatLookup(locale_shortDays), d3_time_monthRe = d3_time_formatRe(locale_months), d3_time_monthLookup = d3_time_formatLookup(locale_months), d3_time_monthAbbrevRe = d3_time_formatRe(locale_shortMonths), d3_time_monthAbbrevLookup = d3_time_formatLookup(locale_shortMonths);
+ locale_periods.forEach(function(p, i) {
+ d3_time_periodLookup.set(p.toLowerCase(), i);
+ });
+ var d3_time_formats = {
+ a: function(d) {
+ return locale_shortDays[d.getDay()];
+ },
+ A: function(d) {
+ return locale_days[d.getDay()];
+ },
+ b: function(d) {
+ return locale_shortMonths[d.getMonth()];
+ },
+ B: function(d) {
+ return locale_months[d.getMonth()];
+ },
+ c: d3_time_format(locale_dateTime),
+ d: function(d, p) {
+ return d3_time_formatPad(d.getDate(), p, 2);
+ },
+ e: function(d, p) {
+ return d3_time_formatPad(d.getDate(), p, 2);
+ },
+ H: function(d, p) {
+ return d3_time_formatPad(d.getHours(), p, 2);
+ },
+ I: function(d, p) {
+ return d3_time_formatPad(d.getHours() % 12 || 12, p, 2);
+ },
+ j: function(d, p) {
+ return d3_time_formatPad(1 + d3_time.dayOfYear(d), p, 3);
+ },
+ L: function(d, p) {
+ return d3_time_formatPad(d.getMilliseconds(), p, 3);
+ },
+ m: function(d, p) {
+ return d3_time_formatPad(d.getMonth() + 1, p, 2);
+ },
+ M: function(d, p) {
+ return d3_time_formatPad(d.getMinutes(), p, 2);
+ },
+ p: function(d) {
+ return locale_periods[+(d.getHours() >= 12)];
+ },
+ S: function(d, p) {
+ return d3_time_formatPad(d.getSeconds(), p, 2);
+ },
+ U: function(d, p) {
+ return d3_time_formatPad(d3_time.sundayOfYear(d), p, 2);
+ },
+ w: function(d) {
+ return d.getDay();
+ },
+ W: function(d, p) {
+ return d3_time_formatPad(d3_time.mondayOfYear(d), p, 2);
+ },
+ x: d3_time_format(locale_date),
+ X: d3_time_format(locale_time),
+ y: function(d, p) {
+ return d3_time_formatPad(d.getFullYear() % 100, p, 2);
+ },
+ Y: function(d, p) {
+ return d3_time_formatPad(d.getFullYear() % 1e4, p, 4);
+ },
+ Z: d3_time_zone,
+ "%": function() {
+ return "%";
+ }
+ };
+ var d3_time_parsers = {
+ a: d3_time_parseWeekdayAbbrev,
+ A: d3_time_parseWeekday,
+ b: d3_time_parseMonthAbbrev,
+ B: d3_time_parseMonth,
+ c: d3_time_parseLocaleFull,
+ d: d3_time_parseDay,
+ e: d3_time_parseDay,
+ H: d3_time_parseHour24,
+ I: d3_time_parseHour24,
+ j: d3_time_parseDayOfYear,
+ L: d3_time_parseMilliseconds,
+ m: d3_time_parseMonthNumber,
+ M: d3_time_parseMinutes,
+ p: d3_time_parseAmPm,
+ S: d3_time_parseSeconds,
+ U: d3_time_parseWeekNumberSunday,
+ w: d3_time_parseWeekdayNumber,
+ W: d3_time_parseWeekNumberMonday,
+ x: d3_time_parseLocaleDate,
+ X: d3_time_parseLocaleTime,
+ y: d3_time_parseYear,
+ Y: d3_time_parseFullYear,
+ Z: d3_time_parseZone,
+ "%": d3_time_parseLiteralPercent
+ };
+ function d3_time_parseWeekdayAbbrev(date, string, i) {
+ d3_time_dayAbbrevRe.lastIndex = 0;
+ var n = d3_time_dayAbbrevRe.exec(string.slice(i));
+ return n ? (date.w = d3_time_dayAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseWeekday(date, string, i) {
+ d3_time_dayRe.lastIndex = 0;
+ var n = d3_time_dayRe.exec(string.slice(i));
+ return n ? (date.w = d3_time_dayLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseMonthAbbrev(date, string, i) {
+ d3_time_monthAbbrevRe.lastIndex = 0;
+ var n = d3_time_monthAbbrevRe.exec(string.slice(i));
+ return n ? (date.m = d3_time_monthAbbrevLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseMonth(date, string, i) {
+ d3_time_monthRe.lastIndex = 0;
+ var n = d3_time_monthRe.exec(string.slice(i));
+ return n ? (date.m = d3_time_monthLookup.get(n[0].toLowerCase()), i + n[0].length) : -1;
+ }
+ function d3_time_parseLocaleFull(date, string, i) {
+ return d3_time_parse(date, d3_time_formats.c.toString(), string, i);
+ }
+ function d3_time_parseLocaleDate(date, string, i) {
+ return d3_time_parse(date, d3_time_formats.x.toString(), string, i);
+ }
+ function d3_time_parseLocaleTime(date, string, i) {
+ return d3_time_parse(date, d3_time_formats.X.toString(), string, i);
+ }
+ function d3_time_parseAmPm(date, string, i) {
+ var n = d3_time_periodLookup.get(string.slice(i, i += 2).toLowerCase());
+ return n == null ? -1 : (date.p = n, i);
+ }
+ return d3_time_format;
+ }
+ var d3_time_formatPads = {
+ "-": "",
+ _: " ",
+ "0": "0"
+ }, d3_time_numberRe = /^\s*\d+/, d3_time_percentRe = /^%/;
+ function d3_time_formatPad(value, fill, width) {
+ var sign = value < 0 ? "-" : "", string = (sign ? -value : value) + "", length = string.length;
+ return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);
+ }
+ function d3_time_formatRe(names) {
+ return new RegExp("^(?:" + names.map(d3.requote).join("|") + ")", "i");
+ }
+ function d3_time_formatLookup(names) {
+ var map = new d3_Map(), i = -1, n = names.length;
+ while (++i < n) map.set(names[i].toLowerCase(), i);
+ return map;
+ }
+ function d3_time_parseWeekdayNumber(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 1));
+ return n ? (date.w = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseWeekNumberSunday(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i));
+ return n ? (date.U = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseWeekNumberMonday(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i));
+ return n ? (date.W = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseFullYear(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 4));
+ return n ? (date.y = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseYear(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.y = d3_time_expandYear(+n[0]), i + n[0].length) : -1;
+ }
+ function d3_time_parseZone(date, string, i) {
+ return /^[+-]\d{4}$/.test(string = string.slice(i, i + 5)) ? (date.Z = -string,
+ i + 5) : -1;
+ }
+ function d3_time_expandYear(d) {
+ return d + (d > 68 ? 1900 : 2e3);
+ }
+ function d3_time_parseMonthNumber(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.m = n[0] - 1, i + n[0].length) : -1;
+ }
+ function d3_time_parseDay(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.d = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseDayOfYear(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 3));
+ return n ? (date.j = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseHour24(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.H = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseMinutes(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.M = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseSeconds(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 2));
+ return n ? (date.S = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_parseMilliseconds(date, string, i) {
+ d3_time_numberRe.lastIndex = 0;
+ var n = d3_time_numberRe.exec(string.slice(i, i + 3));
+ return n ? (date.L = +n[0], i + n[0].length) : -1;
+ }
+ function d3_time_zone(d) {
+ var z = d.getTimezoneOffset(), zs = z > 0 ? "-" : "+", zh = abs(z) / 60 | 0, zm = abs(z) % 60;
+ return zs + d3_time_formatPad(zh, "0", 2) + d3_time_formatPad(zm, "0", 2);
+ }
+ function d3_time_parseLiteralPercent(date, string, i) {
+ d3_time_percentRe.lastIndex = 0;
+ var n = d3_time_percentRe.exec(string.slice(i, i + 1));
+ return n ? i + n[0].length : -1;
+ }
+ function d3_time_formatMulti(formats) {
+ var n = formats.length, i = -1;
+ while (++i < n) formats[i][0] = this(formats[i][0]);
+ return function(date) {
+ var i = 0, f = formats[i];
+ while (!f[1](date)) f = formats[++i];
+ return f[0](date);
+ };
+ }
+ d3.locale = function(locale) {
+ return {
+ numberFormat: d3_locale_numberFormat(locale),
+ timeFormat: d3_locale_timeFormat(locale)
+ };
+ };
+ var d3_locale_enUS = d3.locale({
+ decimal: ".",
+ thousands: ",",
+ grouping: [ 3 ],
+ currency: [ "$", "" ],
+ dateTime: "%a %b %e %X %Y",
+ date: "%m/%d/%Y",
+ time: "%H:%M:%S",
+ periods: [ "AM", "PM" ],
+ days: [ "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" ],
+ shortDays: [ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" ],
+ months: [ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" ],
+ shortMonths: [ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" ]
+ });
+ d3.format = d3_locale_enUS.numberFormat;
+ d3.geo = {};
+ function d3_adder() {}
+ d3_adder.prototype = {
+ s: 0,
+ t: 0,
+ add: function(y) {
+ d3_adderSum(y, this.t, d3_adderTemp);
+ d3_adderSum(d3_adderTemp.s, this.s, this);
+ if (this.s) this.t += d3_adderTemp.t; else this.s = d3_adderTemp.t;
+ },
+ reset: function() {
+ this.s = this.t = 0;
+ },
+ valueOf: function() {
+ return this.s;
+ }
+ };
+ var d3_adderTemp = new d3_adder();
+ function d3_adderSum(a, b, o) {
+ var x = o.s = a + b, bv = x - a, av = x - bv;
+ o.t = a - av + (b - bv);
+ }
+ d3.geo.stream = function(object, listener) {
+ if (object && d3_geo_streamObjectType.hasOwnProperty(object.type)) {
+ d3_geo_streamObjectType[object.type](object, listener);
+ } else {
+ d3_geo_streamGeometry(object, listener);
+ }
+ };
+ function d3_geo_streamGeometry(geometry, listener) {
+ if (geometry && d3_geo_streamGeometryType.hasOwnProperty(geometry.type)) {
+ d3_geo_streamGeometryType[geometry.type](geometry, listener);
+ }
+ }
+ var d3_geo_streamObjectType = {
+ Feature: function(feature, listener) {
+ d3_geo_streamGeometry(feature.geometry, listener);
+ },
+ FeatureCollection: function(object, listener) {
+ var features = object.features, i = -1, n = features.length;
+ while (++i < n) d3_geo_streamGeometry(features[i].geometry, listener);
+ }
+ };
+ var d3_geo_streamGeometryType = {
+ Sphere: function(object, listener) {
+ listener.sphere();
+ },
+ Point: function(object, listener) {
+ object = object.coordinates;
+ listener.point(object[0], object[1], object[2]);
+ },
+ MultiPoint: function(object, listener) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) object = coordinates[i], listener.point(object[0], object[1], object[2]);
+ },
+ LineString: function(object, listener) {
+ d3_geo_streamLine(object.coordinates, listener, 0);
+ },
+ MultiLineString: function(object, listener) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) d3_geo_streamLine(coordinates[i], listener, 0);
+ },
+ Polygon: function(object, listener) {
+ d3_geo_streamPolygon(object.coordinates, listener);
+ },
+ MultiPolygon: function(object, listener) {
+ var coordinates = object.coordinates, i = -1, n = coordinates.length;
+ while (++i < n) d3_geo_streamPolygon(coordinates[i], listener);
+ },
+ GeometryCollection: function(object, listener) {
+ var geometries = object.geometries, i = -1, n = geometries.length;
+ while (++i < n) d3_geo_streamGeometry(geometries[i], listener);
+ }
+ };
+ function d3_geo_streamLine(coordinates, listener, closed) {
+ var i = -1, n = coordinates.length - closed, coordinate;
+ listener.lineStart();
+ while (++i < n) coordinate = coordinates[i], listener.point(coordinate[0], coordinate[1], coordinate[2]);
+ listener.lineEnd();
+ }
+ function d3_geo_streamPolygon(coordinates, listener) {
+ var i = -1, n = coordinates.length;
+ listener.polygonStart();
+ while (++i < n) d3_geo_streamLine(coordinates[i], listener, 1);
+ listener.polygonEnd();
+ }
+ d3.geo.area = function(object) {
+ d3_geo_areaSum = 0;
+ d3.geo.stream(object, d3_geo_area);
+ return d3_geo_areaSum;
+ };
+ var d3_geo_areaSum, d3_geo_areaRingSum = new d3_adder();
+ var d3_geo_area = {
+ sphere: function() {
+ d3_geo_areaSum += 4 * π;
+ },
+ point: d3_noop,
+ lineStart: d3_noop,
+ lineEnd: d3_noop,
+ polygonStart: function() {
+ d3_geo_areaRingSum.reset();
+ d3_geo_area.lineStart = d3_geo_areaRingStart;
+ },
+ polygonEnd: function() {
+ var area = 2 * d3_geo_areaRingSum;
+ d3_geo_areaSum += area < 0 ? 4 * π + area : area;
+ d3_geo_area.lineStart = d3_geo_area.lineEnd = d3_geo_area.point = d3_noop;
+ }
+ };
+ function d3_geo_areaRingStart() {
+ var λ00, φ00, λ0, cosφ0, sinφ0;
+ d3_geo_area.point = function(λ, φ) {
+ d3_geo_area.point = nextPoint;
+ λ0 = (λ00 = λ) * d3_radians, cosφ0 = Math.cos(φ = (φ00 = φ) * d3_radians / 2 + π / 4),
+ sinφ0 = Math.sin(φ);
+ };
+ function nextPoint(λ, φ) {
+ λ *= d3_radians;
+ φ = φ * d3_radians / 2 + π / 4;
+ var dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, cosφ = Math.cos(φ), sinφ = Math.sin(φ), k = sinφ0 * sinφ, u = cosφ0 * cosφ + k * Math.cos(adλ), v = k * sdλ * Math.sin(adλ);
+ d3_geo_areaRingSum.add(Math.atan2(v, u));
+ λ0 = λ, cosφ0 = cosφ, sinφ0 = sinφ;
+ }
+ d3_geo_area.lineEnd = function() {
+ nextPoint(λ00, φ00);
+ };
+ }
+ function d3_geo_cartesian(spherical) {
+ var λ = spherical[0], φ = spherical[1], cosφ = Math.cos(φ);
+ return [ cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ) ];
+ }
+ function d3_geo_cartesianDot(a, b) {
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
+ }
+ function d3_geo_cartesianCross(a, b) {
+ return [ a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0] ];
+ }
+ function d3_geo_cartesianAdd(a, b) {
+ a[0] += b[0];
+ a[1] += b[1];
+ a[2] += b[2];
+ }
+ function d3_geo_cartesianScale(vector, k) {
+ return [ vector[0] * k, vector[1] * k, vector[2] * k ];
+ }
+ function d3_geo_cartesianNormalize(d) {
+ var l = Math.sqrt(d[0] * d[0] + d[1] * d[1] + d[2] * d[2]);
+ d[0] /= l;
+ d[1] /= l;
+ d[2] /= l;
+ }
+ function d3_geo_spherical(cartesian) {
+ return [ Math.atan2(cartesian[1], cartesian[0]), d3_asin(cartesian[2]) ];
+ }
+ function d3_geo_sphericalEqual(a, b) {
+ return abs(a[0] - b[0]) < ε && abs(a[1] - b[1]) < ε;
+ }
+ d3.geo.bounds = function() {
+ var λ0, φ0, λ1, φ1, λ_, λ__, φ__, p0, dλSum, ranges, range;
+ var bound = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ bound.point = ringPoint;
+ bound.lineStart = ringStart;
+ bound.lineEnd = ringEnd;
+ dλSum = 0;
+ d3_geo_area.polygonStart();
+ },
+ polygonEnd: function() {
+ d3_geo_area.polygonEnd();
+ bound.point = point;
+ bound.lineStart = lineStart;
+ bound.lineEnd = lineEnd;
+ if (d3_geo_areaRingSum < 0) λ0 = -(λ1 = 180), φ0 = -(φ1 = 90); else if (dλSum > ε) φ1 = 90; else if (dλSum < -ε) φ0 = -90;
+ range[0] = λ0, range[1] = λ1;
+ }
+ };
+ function point(λ, φ) {
+ ranges.push(range = [ λ0 = λ, λ1 = λ ]);
+ if (φ < φ0) φ0 = φ;
+ if (φ > φ1) φ1 = φ;
+ }
+ function linePoint(λ, φ) {
+ var p = d3_geo_cartesian([ λ * d3_radians, φ * d3_radians ]);
+ if (p0) {
+ var normal = d3_geo_cartesianCross(p0, p), equatorial = [ normal[1], -normal[0], 0 ], inflection = d3_geo_cartesianCross(equatorial, normal);
+ d3_geo_cartesianNormalize(inflection);
+ inflection = d3_geo_spherical(inflection);
+ var dλ = λ - λ_, s = dλ > 0 ? 1 : -1, λi = inflection[0] * d3_degrees * s, antimeridian = abs(dλ) > 180;
+ if (antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
+ var φi = inflection[1] * d3_degrees;
+ if (φi > φ1) φ1 = φi;
+ } else if (λi = (λi + 360) % 360 - 180, antimeridian ^ (s * λ_ < λi && λi < s * λ)) {
+ var φi = -inflection[1] * d3_degrees;
+ if (φi < φ0) φ0 = φi;
+ } else {
+ if (φ < φ0) φ0 = φ;
+ if (φ > φ1) φ1 = φ;
+ }
+ if (antimeridian) {
+ if (λ < λ_) {
+ if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
+ } else {
+ if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
+ }
+ } else {
+ if (λ1 >= λ0) {
+ if (λ < λ0) λ0 = λ;
+ if (λ > λ1) λ1 = λ;
+ } else {
+ if (λ > λ_) {
+ if (angle(λ0, λ) > angle(λ0, λ1)) λ1 = λ;
+ } else {
+ if (angle(λ, λ1) > angle(λ0, λ1)) λ0 = λ;
+ }
+ }
+ }
+ } else {
+ point(λ, φ);
+ }
+ p0 = p, λ_ = λ;
+ }
+ function lineStart() {
+ bound.point = linePoint;
+ }
+ function lineEnd() {
+ range[0] = λ0, range[1] = λ1;
+ bound.point = point;
+ p0 = null;
+ }
+ function ringPoint(λ, φ) {
+ if (p0) {
+ var dλ = λ - λ_;
+ dλSum += abs(dλ) > 180 ? dλ + (dλ > 0 ? 360 : -360) : dλ;
+ } else λ__ = λ, φ__ = φ;
+ d3_geo_area.point(λ, φ);
+ linePoint(λ, φ);
+ }
+ function ringStart() {
+ d3_geo_area.lineStart();
+ }
+ function ringEnd() {
+ ringPoint(λ__, φ__);
+ d3_geo_area.lineEnd();
+ if (abs(dλSum) > ε) λ0 = -(λ1 = 180);
+ range[0] = λ0, range[1] = λ1;
+ p0 = null;
+ }
+ function angle(λ0, λ1) {
+ return (λ1 -= λ0) < 0 ? λ1 + 360 : λ1;
+ }
+ function compareRanges(a, b) {
+ return a[0] - b[0];
+ }
+ function withinRange(x, range) {
+ return range[0] <= range[1] ? range[0] <= x && x <= range[1] : x < range[0] || range[1] < x;
+ }
+ return function(feature) {
+ φ1 = λ1 = -(λ0 = φ0 = Infinity);
+ ranges = [];
+ d3.geo.stream(feature, bound);
+ var n = ranges.length;
+ if (n) {
+ ranges.sort(compareRanges);
+ for (var i = 1, a = ranges[0], b, merged = [ a ]; i < n; ++i) {
+ b = ranges[i];
+ if (withinRange(b[0], a) || withinRange(b[1], a)) {
+ if (angle(a[0], b[1]) > angle(a[0], a[1])) a[1] = b[1];
+ if (angle(b[0], a[1]) > angle(a[0], a[1])) a[0] = b[0];
+ } else {
+ merged.push(a = b);
+ }
+ }
+ var best = -Infinity, dλ;
+ for (var n = merged.length - 1, i = 0, a = merged[n], b; i <= n; a = b, ++i) {
+ b = merged[i];
+ if ((dλ = angle(a[1], b[0])) > best) best = dλ, λ0 = b[0], λ1 = a[1];
+ }
+ }
+ ranges = range = null;
+ return λ0 === Infinity || φ0 === Infinity ? [ [ NaN, NaN ], [ NaN, NaN ] ] : [ [ λ0, φ0 ], [ λ1, φ1 ] ];
+ };
+ }();
+ d3.geo.centroid = function(object) {
+ d3_geo_centroidW0 = d3_geo_centroidW1 = d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
+ d3.geo.stream(object, d3_geo_centroid);
+ var x = d3_geo_centroidX2, y = d3_geo_centroidY2, z = d3_geo_centroidZ2, m = x * x + y * y + z * z;
+ if (m < ε2) {
+ x = d3_geo_centroidX1, y = d3_geo_centroidY1, z = d3_geo_centroidZ1;
+ if (d3_geo_centroidW1 < ε) x = d3_geo_centroidX0, y = d3_geo_centroidY0, z = d3_geo_centroidZ0;
+ m = x * x + y * y + z * z;
+ if (m < ε2) return [ NaN, NaN ];
+ }
+ return [ Math.atan2(y, x) * d3_degrees, d3_asin(z / Math.sqrt(m)) * d3_degrees ];
+ };
+ var d3_geo_centroidW0, d3_geo_centroidW1, d3_geo_centroidX0, d3_geo_centroidY0, d3_geo_centroidZ0, d3_geo_centroidX1, d3_geo_centroidY1, d3_geo_centroidZ1, d3_geo_centroidX2, d3_geo_centroidY2, d3_geo_centroidZ2;
+ var d3_geo_centroid = {
+ sphere: d3_noop,
+ point: d3_geo_centroidPoint,
+ lineStart: d3_geo_centroidLineStart,
+ lineEnd: d3_geo_centroidLineEnd,
+ polygonStart: function() {
+ d3_geo_centroid.lineStart = d3_geo_centroidRingStart;
+ },
+ polygonEnd: function() {
+ d3_geo_centroid.lineStart = d3_geo_centroidLineStart;
+ }
+ };
+ function d3_geo_centroidPoint(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians);
+ d3_geo_centroidPointXYZ(cosφ * Math.cos(λ), cosφ * Math.sin(λ), Math.sin(φ));
+ }
+ function d3_geo_centroidPointXYZ(x, y, z) {
+ ++d3_geo_centroidW0;
+ d3_geo_centroidX0 += (x - d3_geo_centroidX0) / d3_geo_centroidW0;
+ d3_geo_centroidY0 += (y - d3_geo_centroidY0) / d3_geo_centroidW0;
+ d3_geo_centroidZ0 += (z - d3_geo_centroidZ0) / d3_geo_centroidW0;
+ }
+ function d3_geo_centroidLineStart() {
+ var x0, y0, z0;
+ d3_geo_centroid.point = function(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians);
+ x0 = cosφ * Math.cos(λ);
+ y0 = cosφ * Math.sin(λ);
+ z0 = Math.sin(φ);
+ d3_geo_centroid.point = nextPoint;
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ };
+ function nextPoint(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), w = Math.atan2(Math.sqrt((w = y0 * z - z0 * y) * w + (w = z0 * x - x0 * z) * w + (w = x0 * y - y0 * x) * w), x0 * x + y0 * y + z0 * z);
+ d3_geo_centroidW1 += w;
+ d3_geo_centroidX1 += w * (x0 + (x0 = x));
+ d3_geo_centroidY1 += w * (y0 + (y0 = y));
+ d3_geo_centroidZ1 += w * (z0 + (z0 = z));
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ }
+ }
+ function d3_geo_centroidLineEnd() {
+ d3_geo_centroid.point = d3_geo_centroidPoint;
+ }
+ function d3_geo_centroidRingStart() {
+ var λ00, φ00, x0, y0, z0;
+ d3_geo_centroid.point = function(λ, φ) {
+ λ00 = λ, φ00 = φ;
+ d3_geo_centroid.point = nextPoint;
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians);
+ x0 = cosφ * Math.cos(λ);
+ y0 = cosφ * Math.sin(λ);
+ z0 = Math.sin(φ);
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ };
+ d3_geo_centroid.lineEnd = function() {
+ nextPoint(λ00, φ00);
+ d3_geo_centroid.lineEnd = d3_geo_centroidLineEnd;
+ d3_geo_centroid.point = d3_geo_centroidPoint;
+ };
+ function nextPoint(λ, φ) {
+ λ *= d3_radians;
+ var cosφ = Math.cos(φ *= d3_radians), x = cosφ * Math.cos(λ), y = cosφ * Math.sin(λ), z = Math.sin(φ), cx = y0 * z - z0 * y, cy = z0 * x - x0 * z, cz = x0 * y - y0 * x, m = Math.sqrt(cx * cx + cy * cy + cz * cz), u = x0 * x + y0 * y + z0 * z, v = m && -d3_acos(u) / m, w = Math.atan2(m, u);
+ d3_geo_centroidX2 += v * cx;
+ d3_geo_centroidY2 += v * cy;
+ d3_geo_centroidZ2 += v * cz;
+ d3_geo_centroidW1 += w;
+ d3_geo_centroidX1 += w * (x0 + (x0 = x));
+ d3_geo_centroidY1 += w * (y0 + (y0 = y));
+ d3_geo_centroidZ1 += w * (z0 + (z0 = z));
+ d3_geo_centroidPointXYZ(x0, y0, z0);
+ }
+ }
+ function d3_geo_compose(a, b) {
+ function compose(x, y) {
+ return x = a(x, y), b(x[0], x[1]);
+ }
+ if (a.invert && b.invert) compose.invert = function(x, y) {
+ return x = b.invert(x, y), x && a.invert(x[0], x[1]);
+ };
+ return compose;
+ }
+ function d3_true() {
+ return true;
+ }
+ function d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener) {
+ var subject = [], clip = [];
+ segments.forEach(function(segment) {
+ if ((n = segment.length - 1) <= 0) return;
+ var n, p0 = segment[0], p1 = segment[n];
+ if (d3_geo_sphericalEqual(p0, p1)) {
+ listener.lineStart();
+ for (var i = 0; i < n; ++i) listener.point((p0 = segment[i])[0], p0[1]);
+ listener.lineEnd();
+ return;
+ }
+ var a = new d3_geo_clipPolygonIntersection(p0, segment, null, true), b = new d3_geo_clipPolygonIntersection(p0, null, a, false);
+ a.o = b;
+ subject.push(a);
+ clip.push(b);
+ a = new d3_geo_clipPolygonIntersection(p1, segment, null, false);
+ b = new d3_geo_clipPolygonIntersection(p1, null, a, true);
+ a.o = b;
+ subject.push(a);
+ clip.push(b);
+ });
+ clip.sort(compare);
+ d3_geo_clipPolygonLinkCircular(subject);
+ d3_geo_clipPolygonLinkCircular(clip);
+ if (!subject.length) return;
+ for (var i = 0, entry = clipStartInside, n = clip.length; i < n; ++i) {
+ clip[i].e = entry = !entry;
+ }
+ var start = subject[0], points, point;
+ while (1) {
+ var current = start, isSubject = true;
+ while (current.v) if ((current = current.n) === start) return;
+ points = current.z;
+ listener.lineStart();
+ do {
+ current.v = current.o.v = true;
+ if (current.e) {
+ if (isSubject) {
+ for (var i = 0, n = points.length; i < n; ++i) listener.point((point = points[i])[0], point[1]);
+ } else {
+ interpolate(current.x, current.n.x, 1, listener);
+ }
+ current = current.n;
+ } else {
+ if (isSubject) {
+ points = current.p.z;
+ for (var i = points.length - 1; i >= 0; --i) listener.point((point = points[i])[0], point[1]);
+ } else {
+ interpolate(current.x, current.p.x, -1, listener);
+ }
+ current = current.p;
+ }
+ current = current.o;
+ points = current.z;
+ isSubject = !isSubject;
+ } while (!current.v);
+ listener.lineEnd();
+ }
+ }
+ function d3_geo_clipPolygonLinkCircular(array) {
+ if (!(n = array.length)) return;
+ var n, i = 0, a = array[0], b;
+ while (++i < n) {
+ a.n = b = array[i];
+ b.p = a;
+ a = b;
+ }
+ a.n = b = array[0];
+ b.p = a;
+ }
+ function d3_geo_clipPolygonIntersection(point, points, other, entry) {
+ this.x = point;
+ this.z = points;
+ this.o = other;
+ this.e = entry;
+ this.v = false;
+ this.n = this.p = null;
+ }
+ function d3_geo_clip(pointVisible, clipLine, interpolate, clipStart) {
+ return function(rotate, listener) {
+ var line = clipLine(listener), rotatedClipStart = rotate.invert(clipStart[0], clipStart[1]);
+ var clip = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ clip.point = pointRing;
+ clip.lineStart = ringStart;
+ clip.lineEnd = ringEnd;
+ segments = [];
+ polygon = [];
+ },
+ polygonEnd: function() {
+ clip.point = point;
+ clip.lineStart = lineStart;
+ clip.lineEnd = lineEnd;
+ segments = d3.merge(segments);
+ var clipStartInside = d3_geo_pointInPolygon(rotatedClipStart, polygon);
+ if (segments.length) {
+ if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+ d3_geo_clipPolygon(segments, d3_geo_clipSort, clipStartInside, interpolate, listener);
+ } else if (clipStartInside) {
+ if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+ listener.lineStart();
+ interpolate(null, null, 1, listener);
+ listener.lineEnd();
+ }
+ if (polygonStarted) listener.polygonEnd(), polygonStarted = false;
+ segments = polygon = null;
+ },
+ sphere: function() {
+ listener.polygonStart();
+ listener.lineStart();
+ interpolate(null, null, 1, listener);
+ listener.lineEnd();
+ listener.polygonEnd();
+ }
+ };
+ function point(λ, φ) {
+ var point = rotate(λ, φ);
+ if (pointVisible(λ = point[0], φ = point[1])) listener.point(λ, φ);
+ }
+ function pointLine(λ, φ) {
+ var point = rotate(λ, φ);
+ line.point(point[0], point[1]);
+ }
+ function lineStart() {
+ clip.point = pointLine;
+ line.lineStart();
+ }
+ function lineEnd() {
+ clip.point = point;
+ line.lineEnd();
+ }
+ var segments;
+ var buffer = d3_geo_clipBufferListener(), ringListener = clipLine(buffer), polygonStarted = false, polygon, ring;
+ function pointRing(λ, φ) {
+ ring.push([ λ, φ ]);
+ var point = rotate(λ, φ);
+ ringListener.point(point[0], point[1]);
+ }
+ function ringStart() {
+ ringListener.lineStart();
+ ring = [];
+ }
+ function ringEnd() {
+ pointRing(ring[0][0], ring[0][1]);
+ ringListener.lineEnd();
+ var clean = ringListener.clean(), ringSegments = buffer.buffer(), segment, n = ringSegments.length;
+ ring.pop();
+ polygon.push(ring);
+ ring = null;
+ if (!n) return;
+ if (clean & 1) {
+ segment = ringSegments[0];
+ var n = segment.length - 1, i = -1, point;
+ if (n > 0) {
+ if (!polygonStarted) listener.polygonStart(), polygonStarted = true;
+ listener.lineStart();
+ while (++i < n) listener.point((point = segment[i])[0], point[1]);
+ listener.lineEnd();
+ }
+ return;
+ }
+ if (n > 1 && clean & 2) ringSegments.push(ringSegments.pop().concat(ringSegments.shift()));
+ segments.push(ringSegments.filter(d3_geo_clipSegmentLength1));
+ }
+ return clip;
+ };
+ }
+ function d3_geo_clipSegmentLength1(segment) {
+ return segment.length > 1;
+ }
+ function d3_geo_clipBufferListener() {
+ var lines = [], line;
+ return {
+ lineStart: function() {
+ lines.push(line = []);
+ },
+ point: function(λ, φ) {
+ line.push([ λ, φ ]);
+ },
+ lineEnd: d3_noop,
+ buffer: function() {
+ var buffer = lines;
+ lines = [];
+ line = null;
+ return buffer;
+ },
+ rejoin: function() {
+ if (lines.length > 1) lines.push(lines.pop().concat(lines.shift()));
+ }
+ };
+ }
+ function d3_geo_clipSort(a, b) {
+ return ((a = a.x)[0] < 0 ? a[1] - halfπ - ε : halfπ - a[1]) - ((b = b.x)[0] < 0 ? b[1] - halfπ - ε : halfπ - b[1]);
+ }
+ var d3_geo_clipAntimeridian = d3_geo_clip(d3_true, d3_geo_clipAntimeridianLine, d3_geo_clipAntimeridianInterpolate, [ -π, -π / 2 ]);
+ function d3_geo_clipAntimeridianLine(listener) {
+ var λ0 = NaN, φ0 = NaN, sλ0 = NaN, clean;
+ return {
+ lineStart: function() {
+ listener.lineStart();
+ clean = 1;
+ },
+ point: function(λ1, φ1) {
+ var sλ1 = λ1 > 0 ? π : -π, dλ = abs(λ1 - λ0);
+ if (abs(dλ - π) < ε) {
+ listener.point(λ0, φ0 = (φ0 + φ1) / 2 > 0 ? halfπ : -halfπ);
+ listener.point(sλ0, φ0);
+ listener.lineEnd();
+ listener.lineStart();
+ listener.point(sλ1, φ0);
+ listener.point(λ1, φ0);
+ clean = 0;
+ } else if (sλ0 !== sλ1 && dλ >= π) {
+ if (abs(λ0 - sλ0) < ε) λ0 -= sλ0 * ε;
+ if (abs(λ1 - sλ1) < ε) λ1 -= sλ1 * ε;
+ φ0 = d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1);
+ listener.point(sλ0, φ0);
+ listener.lineEnd();
+ listener.lineStart();
+ listener.point(sλ1, φ0);
+ clean = 0;
+ }
+ listener.point(λ0 = λ1, φ0 = φ1);
+ sλ0 = sλ1;
+ },
+ lineEnd: function() {
+ listener.lineEnd();
+ λ0 = φ0 = NaN;
+ },
+ clean: function() {
+ return 2 - clean;
+ }
+ };
+ }
+ function d3_geo_clipAntimeridianIntersect(λ0, φ0, λ1, φ1) {
+ var cosφ0, cosφ1, sinλ0_λ1 = Math.sin(λ0 - λ1);
+ return abs(sinλ0_λ1) > ε ? Math.atan((Math.sin(φ0) * (cosφ1 = Math.cos(φ1)) * Math.sin(λ1) - Math.sin(φ1) * (cosφ0 = Math.cos(φ0)) * Math.sin(λ0)) / (cosφ0 * cosφ1 * sinλ0_λ1)) : (φ0 + φ1) / 2;
+ }
+ function d3_geo_clipAntimeridianInterpolate(from, to, direction, listener) {
+ var φ;
+ if (from == null) {
+ φ = direction * halfπ;
+ listener.point(-π, φ);
+ listener.point(0, φ);
+ listener.point(π, φ);
+ listener.point(π, 0);
+ listener.point(π, -φ);
+ listener.point(0, -φ);
+ listener.point(-π, -φ);
+ listener.point(-π, 0);
+ listener.point(-π, φ);
+ } else if (abs(from[0] - to[0]) > ε) {
+ var s = from[0] < to[0] ? π : -π;
+ φ = direction * s / 2;
+ listener.point(-s, φ);
+ listener.point(0, φ);
+ listener.point(s, φ);
+ } else {
+ listener.point(to[0], to[1]);
+ }
+ }
+ function d3_geo_pointInPolygon(point, polygon) {
+ var meridian = point[0], parallel = point[1], meridianNormal = [ Math.sin(meridian), -Math.cos(meridian), 0 ], polarAngle = 0, winding = 0;
+ d3_geo_areaRingSum.reset();
+ for (var i = 0, n = polygon.length; i < n; ++i) {
+ var ring = polygon[i], m = ring.length;
+ if (!m) continue;
+ var point0 = ring[0], λ0 = point0[0], φ0 = point0[1] / 2 + π / 4, sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), j = 1;
+ while (true) {
+ if (j === m) j = 0;
+ point = ring[j];
+ var λ = point[0], φ = point[1] / 2 + π / 4, sinφ = Math.sin(φ), cosφ = Math.cos(φ), dλ = λ - λ0, sdλ = dλ >= 0 ? 1 : -1, adλ = sdλ * dλ, antimeridian = adλ > π, k = sinφ0 * sinφ;
+ d3_geo_areaRingSum.add(Math.atan2(k * sdλ * Math.sin(adλ), cosφ0 * cosφ + k * Math.cos(adλ)));
+ polarAngle += antimeridian ? dλ + sdλ * τ : dλ;
+ if (antimeridian ^ λ0 >= meridian ^ λ >= meridian) {
+ var arc = d3_geo_cartesianCross(d3_geo_cartesian(point0), d3_geo_cartesian(point));
+ d3_geo_cartesianNormalize(arc);
+ var intersection = d3_geo_cartesianCross(meridianNormal, arc);
+ d3_geo_cartesianNormalize(intersection);
+ var φarc = (antimeridian ^ dλ >= 0 ? -1 : 1) * d3_asin(intersection[2]);
+ if (parallel > φarc || parallel === φarc && (arc[0] || arc[1])) {
+ winding += antimeridian ^ dλ >= 0 ? 1 : -1;
+ }
+ }
+ if (!j++) break;
+ λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ, point0 = point;
+ }
+ }
+ return (polarAngle < -ε || polarAngle < ε && d3_geo_areaRingSum < 0) ^ winding & 1;
+ }
+ function d3_geo_clipCircle(radius) {
+ var cr = Math.cos(radius), smallRadius = cr > 0, notHemisphere = abs(cr) > ε, interpolate = d3_geo_circleInterpolate(radius, 6 * d3_radians);
+ return d3_geo_clip(visible, clipLine, interpolate, smallRadius ? [ 0, -radius ] : [ -π, radius - π ]);
+ function visible(λ, φ) {
+ return Math.cos(λ) * Math.cos(φ) > cr;
+ }
+ function clipLine(listener) {
+ var point0, c0, v0, v00, clean;
+ return {
+ lineStart: function() {
+ v00 = v0 = false;
+ clean = 1;
+ },
+ point: function(λ, φ) {
+ var point1 = [ λ, φ ], point2, v = visible(λ, φ), c = smallRadius ? v ? 0 : code(λ, φ) : v ? code(λ + (λ < 0 ? π : -π), φ) : 0;
+ if (!point0 && (v00 = v0 = v)) listener.lineStart();
+ if (v !== v0) {
+ point2 = intersect(point0, point1);
+ if (d3_geo_sphericalEqual(point0, point2) || d3_geo_sphericalEqual(point1, point2)) {
+ point1[0] += ε;
+ point1[1] += ε;
+ v = visible(point1[0], point1[1]);
+ }
+ }
+ if (v !== v0) {
+ clean = 0;
+ if (v) {
+ listener.lineStart();
+ point2 = intersect(point1, point0);
+ listener.point(point2[0], point2[1]);
+ } else {
+ point2 = intersect(point0, point1);
+ listener.point(point2[0], point2[1]);
+ listener.lineEnd();
+ }
+ point0 = point2;
+ } else if (notHemisphere && point0 && smallRadius ^ v) {
+ var t;
+ if (!(c & c0) && (t = intersect(point1, point0, true))) {
+ clean = 0;
+ if (smallRadius) {
+ listener.lineStart();
+ listener.point(t[0][0], t[0][1]);
+ listener.point(t[1][0], t[1][1]);
+ listener.lineEnd();
+ } else {
+ listener.point(t[1][0], t[1][1]);
+ listener.lineEnd();
+ listener.lineStart();
+ listener.point(t[0][0], t[0][1]);
+ }
+ }
+ }
+ if (v && (!point0 || !d3_geo_sphericalEqual(point0, point1))) {
+ listener.point(point1[0], point1[1]);
+ }
+ point0 = point1, v0 = v, c0 = c;
+ },
+ lineEnd: function() {
+ if (v0) listener.lineEnd();
+ point0 = null;
+ },
+ clean: function() {
+ return clean | (v00 && v0) << 1;
+ }
+ };
+ }
+ function intersect(a, b, two) {
+ var pa = d3_geo_cartesian(a), pb = d3_geo_cartesian(b);
+ var n1 = [ 1, 0, 0 ], n2 = d3_geo_cartesianCross(pa, pb), n2n2 = d3_geo_cartesianDot(n2, n2), n1n2 = n2[0], determinant = n2n2 - n1n2 * n1n2;
+ if (!determinant) return !two && a;
+ var c1 = cr * n2n2 / determinant, c2 = -cr * n1n2 / determinant, n1xn2 = d3_geo_cartesianCross(n1, n2), A = d3_geo_cartesianScale(n1, c1), B = d3_geo_cartesianScale(n2, c2);
+ d3_geo_cartesianAdd(A, B);
+ var u = n1xn2, w = d3_geo_cartesianDot(A, u), uu = d3_geo_cartesianDot(u, u), t2 = w * w - uu * (d3_geo_cartesianDot(A, A) - 1);
+ if (t2 < 0) return;
+ var t = Math.sqrt(t2), q = d3_geo_cartesianScale(u, (-w - t) / uu);
+ d3_geo_cartesianAdd(q, A);
+ q = d3_geo_spherical(q);
+ if (!two) return q;
+ var λ0 = a[0], λ1 = b[0], φ0 = a[1], φ1 = b[1], z;
+ if (λ1 < λ0) z = λ0, λ0 = λ1, λ1 = z;
+ var δλ = λ1 - λ0, polar = abs(δλ - π) < ε, meridian = polar || δλ < ε;
+ if (!polar && φ1 < φ0) z = φ0, φ0 = φ1, φ1 = z;
+ if (meridian ? polar ? φ0 + φ1 > 0 ^ q[1] < (abs(q[0] - λ0) < ε ? φ0 : φ1) : φ0 <= q[1] && q[1] <= φ1 : δλ > π ^ (λ0 <= q[0] && q[0] <= λ1)) {
+ var q1 = d3_geo_cartesianScale(u, (-w + t) / uu);
+ d3_geo_cartesianAdd(q1, A);
+ return [ q, d3_geo_spherical(q1) ];
+ }
+ }
+ function code(λ, φ) {
+ var r = smallRadius ? radius : π - radius, code = 0;
+ if (λ < -r) code |= 1; else if (λ > r) code |= 2;
+ if (φ < -r) code |= 4; else if (φ > r) code |= 8;
+ return code;
+ }
+ }
+ function d3_geom_clipLine(x0, y0, x1, y1) {
+ return function(line) {
+ var a = line.a, b = line.b, ax = a.x, ay = a.y, bx = b.x, by = b.y, t0 = 0, t1 = 1, dx = bx - ax, dy = by - ay, r;
+ r = x0 - ax;
+ if (!dx && r > 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dx > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ }
+ r = x1 - ax;
+ if (!dx && r < 0) return;
+ r /= dx;
+ if (dx < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dx > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ }
+ r = y0 - ay;
+ if (!dy && r > 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ } else if (dy > 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ }
+ r = y1 - ay;
+ if (!dy && r < 0) return;
+ r /= dy;
+ if (dy < 0) {
+ if (r > t1) return;
+ if (r > t0) t0 = r;
+ } else if (dy > 0) {
+ if (r < t0) return;
+ if (r < t1) t1 = r;
+ }
+ if (t0 > 0) line.a = {
+ x: ax + t0 * dx,
+ y: ay + t0 * dy
+ };
+ if (t1 < 1) line.b = {
+ x: ax + t1 * dx,
+ y: ay + t1 * dy
+ };
+ return line;
+ };
+ }
+ var d3_geo_clipExtentMAX = 1e9;
+ d3.geo.clipExtent = function() {
+ var x0, y0, x1, y1, stream, clip, clipExtent = {
+ stream: function(output) {
+ if (stream) stream.valid = false;
+ stream = clip(output);
+ stream.valid = true;
+ return stream;
+ },
+ extent: function(_) {
+ if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
+ clip = d3_geo_clipExtent(x0 = +_[0][0], y0 = +_[0][1], x1 = +_[1][0], y1 = +_[1][1]);
+ if (stream) stream.valid = false, stream = null;
+ return clipExtent;
+ }
+ };
+ return clipExtent.extent([ [ 0, 0 ], [ 960, 500 ] ]);
+ };
+ function d3_geo_clipExtent(x0, y0, x1, y1) {
+ return function(listener) {
+ var listener_ = listener, bufferListener = d3_geo_clipBufferListener(), clipLine = d3_geom_clipLine(x0, y0, x1, y1), segments, polygon, ring;
+ var clip = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ listener = bufferListener;
+ segments = [];
+ polygon = [];
+ clean = true;
+ },
+ polygonEnd: function() {
+ listener = listener_;
+ segments = d3.merge(segments);
+ var clipStartInside = insidePolygon([ x0, y1 ]), inside = clean && clipStartInside, visible = segments.length;
+ if (inside || visible) {
+ listener.polygonStart();
+ if (inside) {
+ listener.lineStart();
+ interpolate(null, null, 1, listener);
+ listener.lineEnd();
+ }
+ if (visible) {
+ d3_geo_clipPolygon(segments, compare, clipStartInside, interpolate, listener);
+ }
+ listener.polygonEnd();
+ }
+ segments = polygon = ring = null;
+ }
+ };
+ function insidePolygon(p) {
+ var wn = 0, n = polygon.length, y = p[1];
+ for (var i = 0; i < n; ++i) {
+ for (var j = 1, v = polygon[i], m = v.length, a = v[0], b; j < m; ++j) {
+ b = v[j];
+ if (a[1] <= y) {
+ if (b[1] > y && d3_cross2d(a, b, p) > 0) ++wn;
+ } else {
+ if (b[1] <= y && d3_cross2d(a, b, p) < 0) --wn;
+ }
+ a = b;
+ }
+ }
+ return wn !== 0;
+ }
+ function interpolate(from, to, direction, listener) {
+ var a = 0, a1 = 0;
+ if (from == null || (a = corner(from, direction)) !== (a1 = corner(to, direction)) || comparePoints(from, to) < 0 ^ direction > 0) {
+ do {
+ listener.point(a === 0 || a === 3 ? x0 : x1, a > 1 ? y1 : y0);
+ } while ((a = (a + direction + 4) % 4) !== a1);
+ } else {
+ listener.point(to[0], to[1]);
+ }
+ }
+ function pointVisible(x, y) {
+ return x0 <= x && x <= x1 && y0 <= y && y <= y1;
+ }
+ function point(x, y) {
+ if (pointVisible(x, y)) listener.point(x, y);
+ }
+ var x__, y__, v__, x_, y_, v_, first, clean;
+ function lineStart() {
+ clip.point = linePoint;
+ if (polygon) polygon.push(ring = []);
+ first = true;
+ v_ = false;
+ x_ = y_ = NaN;
+ }
+ function lineEnd() {
+ if (segments) {
+ linePoint(x__, y__);
+ if (v__ && v_) bufferListener.rejoin();
+ segments.push(bufferListener.buffer());
+ }
+ clip.point = point;
+ if (v_) listener.lineEnd();
+ }
+ function linePoint(x, y) {
+ x = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, x));
+ y = Math.max(-d3_geo_clipExtentMAX, Math.min(d3_geo_clipExtentMAX, y));
+ var v = pointVisible(x, y);
+ if (polygon) ring.push([ x, y ]);
+ if (first) {
+ x__ = x, y__ = y, v__ = v;
+ first = false;
+ if (v) {
+ listener.lineStart();
+ listener.point(x, y);
+ }
+ } else {
+ if (v && v_) listener.point(x, y); else {
+ var l = {
+ a: {
+ x: x_,
+ y: y_
+ },
+ b: {
+ x: x,
+ y: y
+ }
+ };
+ if (clipLine(l)) {
+ if (!v_) {
+ listener.lineStart();
+ listener.point(l.a.x, l.a.y);
+ }
+ listener.point(l.b.x, l.b.y);
+ if (!v) listener.lineEnd();
+ clean = false;
+ } else if (v) {
+ listener.lineStart();
+ listener.point(x, y);
+ clean = false;
+ }
+ }
+ }
+ x_ = x, y_ = y, v_ = v;
+ }
+ return clip;
+ };
+ function corner(p, direction) {
+ return abs(p[0] - x0) < ε ? direction > 0 ? 0 : 3 : abs(p[0] - x1) < ε ? direction > 0 ? 2 : 1 : abs(p[1] - y0) < ε ? direction > 0 ? 1 : 0 : direction > 0 ? 3 : 2;
+ }
+ function compare(a, b) {
+ return comparePoints(a.x, b.x);
+ }
+ function comparePoints(a, b) {
+ var ca = corner(a, 1), cb = corner(b, 1);
+ return ca !== cb ? ca - cb : ca === 0 ? b[1] - a[1] : ca === 1 ? a[0] - b[0] : ca === 2 ? a[1] - b[1] : b[0] - a[0];
+ }
+ }
+ function d3_geo_conic(projectAt) {
+ var φ0 = 0, φ1 = π / 3, m = d3_geo_projectionMutator(projectAt), p = m(φ0, φ1);
+ p.parallels = function(_) {
+ if (!arguments.length) return [ φ0 / π * 180, φ1 / π * 180 ];
+ return m(φ0 = _[0] * π / 180, φ1 = _[1] * π / 180);
+ };
+ return p;
+ }
+ function d3_geo_conicEqualArea(φ0, φ1) {
+ var sinφ0 = Math.sin(φ0), n = (sinφ0 + Math.sin(φ1)) / 2, C = 1 + sinφ0 * (2 * n - sinφ0), ρ0 = Math.sqrt(C) / n;
+ function forward(λ, φ) {
+ var ρ = Math.sqrt(C - 2 * n * Math.sin(φ)) / n;
+ return [ ρ * Math.sin(λ *= n), ρ0 - ρ * Math.cos(λ) ];
+ }
+ forward.invert = function(x, y) {
+ var ρ0_y = ρ0 - y;
+ return [ Math.atan2(x, ρ0_y) / n, d3_asin((C - (x * x + ρ0_y * ρ0_y) * n * n) / (2 * n)) ];
+ };
+ return forward;
+ }
+ (d3.geo.conicEqualArea = function() {
+ return d3_geo_conic(d3_geo_conicEqualArea);
+ }).raw = d3_geo_conicEqualArea;
+ d3.geo.albers = function() {
+ return d3.geo.conicEqualArea().rotate([ 96, 0 ]).center([ -.6, 38.7 ]).parallels([ 29.5, 45.5 ]).scale(1070);
+ };
+ d3.geo.albersUsa = function() {
+ var lower48 = d3.geo.albers();
+ var alaska = d3.geo.conicEqualArea().rotate([ 154, 0 ]).center([ -2, 58.5 ]).parallels([ 55, 65 ]);
+ var hawaii = d3.geo.conicEqualArea().rotate([ 157, 0 ]).center([ -3, 19.9 ]).parallels([ 8, 18 ]);
+ var point, pointStream = {
+ point: function(x, y) {
+ point = [ x, y ];
+ }
+ }, lower48Point, alaskaPoint, hawaiiPoint;
+ function albersUsa(coordinates) {
+ var x = coordinates[0], y = coordinates[1];
+ point = null;
+ (lower48Point(x, y), point) || (alaskaPoint(x, y), point) || hawaiiPoint(x, y);
+ return point;
+ }
+ albersUsa.invert = function(coordinates) {
+ var k = lower48.scale(), t = lower48.translate(), x = (coordinates[0] - t[0]) / k, y = (coordinates[1] - t[1]) / k;
+ return (y >= .12 && y < .234 && x >= -.425 && x < -.214 ? alaska : y >= .166 && y < .234 && x >= -.214 && x < -.115 ? hawaii : lower48).invert(coordinates);
+ };
+ albersUsa.stream = function(stream) {
+ var lower48Stream = lower48.stream(stream), alaskaStream = alaska.stream(stream), hawaiiStream = hawaii.stream(stream);
+ return {
+ point: function(x, y) {
+ lower48Stream.point(x, y);
+ alaskaStream.point(x, y);
+ hawaiiStream.point(x, y);
+ },
+ sphere: function() {
+ lower48Stream.sphere();
+ alaskaStream.sphere();
+ hawaiiStream.sphere();
+ },
+ lineStart: function() {
+ lower48Stream.lineStart();
+ alaskaStream.lineStart();
+ hawaiiStream.lineStart();
+ },
+ lineEnd: function() {
+ lower48Stream.lineEnd();
+ alaskaStream.lineEnd();
+ hawaiiStream.lineEnd();
+ },
+ polygonStart: function() {
+ lower48Stream.polygonStart();
+ alaskaStream.polygonStart();
+ hawaiiStream.polygonStart();
+ },
+ polygonEnd: function() {
+ lower48Stream.polygonEnd();
+ alaskaStream.polygonEnd();
+ hawaiiStream.polygonEnd();
+ }
+ };
+ };
+ albersUsa.precision = function(_) {
+ if (!arguments.length) return lower48.precision();
+ lower48.precision(_);
+ alaska.precision(_);
+ hawaii.precision(_);
+ return albersUsa;
+ };
+ albersUsa.scale = function(_) {
+ if (!arguments.length) return lower48.scale();
+ lower48.scale(_);
+ alaska.scale(_ * .35);
+ hawaii.scale(_);
+ return albersUsa.translate(lower48.translate());
+ };
+ albersUsa.translate = function(_) {
+ if (!arguments.length) return lower48.translate();
+ var k = lower48.scale(), x = +_[0], y = +_[1];
+ lower48Point = lower48.translate(_).clipExtent([ [ x - .455 * k, y - .238 * k ], [ x + .455 * k, y + .238 * k ] ]).stream(pointStream).point;
+ alaskaPoint = alaska.translate([ x - .307 * k, y + .201 * k ]).clipExtent([ [ x - .425 * k + ε, y + .12 * k + ε ], [ x - .214 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
+ hawaiiPoint = hawaii.translate([ x - .205 * k, y + .212 * k ]).clipExtent([ [ x - .214 * k + ε, y + .166 * k + ε ], [ x - .115 * k - ε, y + .234 * k - ε ] ]).stream(pointStream).point;
+ return albersUsa;
+ };
+ return albersUsa.scale(1070);
+ };
+ var d3_geo_pathAreaSum, d3_geo_pathAreaPolygon, d3_geo_pathArea = {
+ point: d3_noop,
+ lineStart: d3_noop,
+ lineEnd: d3_noop,
+ polygonStart: function() {
+ d3_geo_pathAreaPolygon = 0;
+ d3_geo_pathArea.lineStart = d3_geo_pathAreaRingStart;
+ },
+ polygonEnd: function() {
+ d3_geo_pathArea.lineStart = d3_geo_pathArea.lineEnd = d3_geo_pathArea.point = d3_noop;
+ d3_geo_pathAreaSum += abs(d3_geo_pathAreaPolygon / 2);
+ }
+ };
+ function d3_geo_pathAreaRingStart() {
+ var x00, y00, x0, y0;
+ d3_geo_pathArea.point = function(x, y) {
+ d3_geo_pathArea.point = nextPoint;
+ x00 = x0 = x, y00 = y0 = y;
+ };
+ function nextPoint(x, y) {
+ d3_geo_pathAreaPolygon += y0 * x - x0 * y;
+ x0 = x, y0 = y;
+ }
+ d3_geo_pathArea.lineEnd = function() {
+ nextPoint(x00, y00);
+ };
+ }
+ var d3_geo_pathBoundsX0, d3_geo_pathBoundsY0, d3_geo_pathBoundsX1, d3_geo_pathBoundsY1;
+ var d3_geo_pathBounds = {
+ point: d3_geo_pathBoundsPoint,
+ lineStart: d3_noop,
+ lineEnd: d3_noop,
+ polygonStart: d3_noop,
+ polygonEnd: d3_noop
+ };
+ function d3_geo_pathBoundsPoint(x, y) {
+ if (x < d3_geo_pathBoundsX0) d3_geo_pathBoundsX0 = x;
+ if (x > d3_geo_pathBoundsX1) d3_geo_pathBoundsX1 = x;
+ if (y < d3_geo_pathBoundsY0) d3_geo_pathBoundsY0 = y;
+ if (y > d3_geo_pathBoundsY1) d3_geo_pathBoundsY1 = y;
+ }
+ function d3_geo_pathBuffer() {
+ var pointCircle = d3_geo_pathBufferCircle(4.5), buffer = [];
+ var stream = {
+ point: point,
+ lineStart: function() {
+ stream.point = pointLineStart;
+ },
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ stream.lineEnd = lineEndPolygon;
+ },
+ polygonEnd: function() {
+ stream.lineEnd = lineEnd;
+ stream.point = point;
+ },
+ pointRadius: function(_) {
+ pointCircle = d3_geo_pathBufferCircle(_);
+ return stream;
+ },
+ result: function() {
+ if (buffer.length) {
+ var result = buffer.join("");
+ buffer = [];
+ return result;
+ }
+ }
+ };
+ function point(x, y) {
+ buffer.push("M", x, ",", y, pointCircle);
+ }
+ function pointLineStart(x, y) {
+ buffer.push("M", x, ",", y);
+ stream.point = pointLine;
+ }
+ function pointLine(x, y) {
+ buffer.push("L", x, ",", y);
+ }
+ function lineEnd() {
+ stream.point = point;
+ }
+ function lineEndPolygon() {
+ buffer.push("Z");
+ }
+ return stream;
+ }
+ function d3_geo_pathBufferCircle(radius) {
+ return "m0," + radius + "a" + radius + "," + radius + " 0 1,1 0," + -2 * radius + "a" + radius + "," + radius + " 0 1,1 0," + 2 * radius + "z";
+ }
+ var d3_geo_pathCentroid = {
+ point: d3_geo_pathCentroidPoint,
+ lineStart: d3_geo_pathCentroidLineStart,
+ lineEnd: d3_geo_pathCentroidLineEnd,
+ polygonStart: function() {
+ d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidRingStart;
+ },
+ polygonEnd: function() {
+ d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
+ d3_geo_pathCentroid.lineStart = d3_geo_pathCentroidLineStart;
+ d3_geo_pathCentroid.lineEnd = d3_geo_pathCentroidLineEnd;
+ }
+ };
+ function d3_geo_pathCentroidPoint(x, y) {
+ d3_geo_centroidX0 += x;
+ d3_geo_centroidY0 += y;
+ ++d3_geo_centroidZ0;
+ }
+ function d3_geo_pathCentroidLineStart() {
+ var x0, y0;
+ d3_geo_pathCentroid.point = function(x, y) {
+ d3_geo_pathCentroid.point = nextPoint;
+ d3_geo_pathCentroidPoint(x0 = x, y0 = y);
+ };
+ function nextPoint(x, y) {
+ var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
+ d3_geo_centroidX1 += z * (x0 + x) / 2;
+ d3_geo_centroidY1 += z * (y0 + y) / 2;
+ d3_geo_centroidZ1 += z;
+ d3_geo_pathCentroidPoint(x0 = x, y0 = y);
+ }
+ }
+ function d3_geo_pathCentroidLineEnd() {
+ d3_geo_pathCentroid.point = d3_geo_pathCentroidPoint;
+ }
+ function d3_geo_pathCentroidRingStart() {
+ var x00, y00, x0, y0;
+ d3_geo_pathCentroid.point = function(x, y) {
+ d3_geo_pathCentroid.point = nextPoint;
+ d3_geo_pathCentroidPoint(x00 = x0 = x, y00 = y0 = y);
+ };
+ function nextPoint(x, y) {
+ var dx = x - x0, dy = y - y0, z = Math.sqrt(dx * dx + dy * dy);
+ d3_geo_centroidX1 += z * (x0 + x) / 2;
+ d3_geo_centroidY1 += z * (y0 + y) / 2;
+ d3_geo_centroidZ1 += z;
+ z = y0 * x - x0 * y;
+ d3_geo_centroidX2 += z * (x0 + x);
+ d3_geo_centroidY2 += z * (y0 + y);
+ d3_geo_centroidZ2 += z * 3;
+ d3_geo_pathCentroidPoint(x0 = x, y0 = y);
+ }
+ d3_geo_pathCentroid.lineEnd = function() {
+ nextPoint(x00, y00);
+ };
+ }
+ function d3_geo_pathContext(context) {
+ var pointRadius = 4.5;
+ var stream = {
+ point: point,
+ lineStart: function() {
+ stream.point = pointLineStart;
+ },
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ stream.lineEnd = lineEndPolygon;
+ },
+ polygonEnd: function() {
+ stream.lineEnd = lineEnd;
+ stream.point = point;
+ },
+ pointRadius: function(_) {
+ pointRadius = _;
+ return stream;
+ },
+ result: d3_noop
+ };
+ function point(x, y) {
+ context.moveTo(x + pointRadius, y);
+ context.arc(x, y, pointRadius, 0, τ);
+ }
+ function pointLineStart(x, y) {
+ context.moveTo(x, y);
+ stream.point = pointLine;
+ }
+ function pointLine(x, y) {
+ context.lineTo(x, y);
+ }
+ function lineEnd() {
+ stream.point = point;
+ }
+ function lineEndPolygon() {
+ context.closePath();
+ }
+ return stream;
+ }
+ function d3_geo_resample(project) {
+ var δ2 = .5, cosMinDistance = Math.cos(30 * d3_radians), maxDepth = 16;
+ function resample(stream) {
+ return (maxDepth ? resampleRecursive : resampleNone)(stream);
+ }
+ function resampleNone(stream) {
+ return d3_geo_transformPoint(stream, function(x, y) {
+ x = project(x, y);
+ stream.point(x[0], x[1]);
+ });
+ }
+ function resampleRecursive(stream) {
+ var λ00, φ00, x00, y00, a00, b00, c00, λ0, x0, y0, a0, b0, c0;
+ var resample = {
+ point: point,
+ lineStart: lineStart,
+ lineEnd: lineEnd,
+ polygonStart: function() {
+ stream.polygonStart();
+ resample.lineStart = ringStart;
+ },
+ polygonEnd: function() {
+ stream.polygonEnd();
+ resample.lineStart = lineStart;
+ }
+ };
+ function point(x, y) {
+ x = project(x, y);
+ stream.point(x[0], x[1]);
+ }
+ function lineStart() {
+ x0 = NaN;
+ resample.point = linePoint;
+ stream.lineStart();
+ }
+ function linePoint(λ, φ) {
+ var c = d3_geo_cartesian([ λ, φ ]), p = project(λ, φ);
+ resampleLineTo(x0, y0, λ0, a0, b0, c0, x0 = p[0], y0 = p[1], λ0 = λ, a0 = c[0], b0 = c[1], c0 = c[2], maxDepth, stream);
+ stream.point(x0, y0);
+ }
+ function lineEnd() {
+ resample.point = point;
+ stream.lineEnd();
+ }
+ function ringStart() {
+ lineStart();
+ resample.point = ringPoint;
+ resample.lineEnd = ringEnd;
+ }
+ function ringPoint(λ, φ) {
+ linePoint(λ00 = λ, φ00 = φ), x00 = x0, y00 = y0, a00 = a0, b00 = b0, c00 = c0;
+ resample.point = linePoint;
+ }
+ function ringEnd() {
+ resampleLineTo(x0, y0, λ0, a0, b0, c0, x00, y00, λ00, a00, b00, c00, maxDepth, stream);
+ resample.lineEnd = lineEnd;
+ lineEnd();
+ }
+ return resample;
+ }
+ function resampleLineTo(x0, y0, λ0, a0, b0, c0, x1, y1, λ1, a1, b1, c1, depth, stream) {
+ var dx = x1 - x0, dy = y1 - y0, d2 = dx * dx + dy * dy;
+ if (d2 > 4 * δ2 && depth--) {
+ var a = a0 + a1, b = b0 + b1, c = c0 + c1, m = Math.sqrt(a * a + b * b + c * c), φ2 = Math.asin(c /= m), λ2 = abs(abs(c) - 1) < ε || abs(λ0 - λ1) < ε ? (λ0 + λ1) / 2 : Math.atan2(b, a), p = project(λ2, φ2), x2 = p[0], y2 = p[1], dx2 = x2 - x0, dy2 = y2 - y0, dz = dy * dx2 - dx * dy2;
+ if (dz * dz / d2 > δ2 || abs((dx * dx2 + dy * dy2) / d2 - .5) > .3 || a0 * a1 + b0 * b1 + c0 * c1 < cosMinDistance) {
+ resampleLineTo(x0, y0, λ0, a0, b0, c0, x2, y2, λ2, a /= m, b /= m, c, depth, stream);
+ stream.point(x2, y2);
+ resampleLineTo(x2, y2, λ2, a, b, c, x1, y1, λ1, a1, b1, c1, depth, stream);
+ }
+ }
+ }
+ resample.precision = function(_) {
+ if (!arguments.length) return Math.sqrt(δ2);
+ maxDepth = (δ2 = _ * _) > 0 && 16;
+ return resample;
+ };
+ return resample;
+ }
+ d3.geo.path = function() {
+ var pointRadius = 4.5, projection, context, projectStream, contextStream, cacheStream;
+ function path(object) {
+ if (object) {
+ if (typeof pointRadius === "function") contextStream.pointRadius(+pointRadius.apply(this, arguments));
+ if (!cacheStream || !cacheStream.valid) cacheStream = projectStream(contextStream);
+ d3.geo.stream(object, cacheStream);
+ }
+ return contextStream.result();
+ }
+ path.area = function(object) {
+ d3_geo_pathAreaSum = 0;
+ d3.geo.stream(object, projectStream(d3_geo_pathArea));
+ return d3_geo_pathAreaSum;
+ };
+ path.centroid = function(object) {
+ d3_geo_centroidX0 = d3_geo_centroidY0 = d3_geo_centroidZ0 = d3_geo_centroidX1 = d3_geo_centroidY1 = d3_geo_centroidZ1 = d3_geo_centroidX2 = d3_geo_centroidY2 = d3_geo_centroidZ2 = 0;
+ d3.geo.stream(object, projectStream(d3_geo_pathCentroid));
+ return d3_geo_centroidZ2 ? [ d3_geo_centroidX2 / d3_geo_centroidZ2, d3_geo_centroidY2 / d3_geo_centroidZ2 ] : d3_geo_centroidZ1 ? [ d3_geo_centroidX1 / d3_geo_centroidZ1, d3_geo_centroidY1 / d3_geo_centroidZ1 ] : d3_geo_centroidZ0 ? [ d3_geo_centroidX0 / d3_geo_centroidZ0, d3_geo_centroidY0 / d3_geo_centroidZ0 ] : [ NaN, NaN ];
+ };
+ path.bounds = function(object) {
+ d3_geo_pathBoundsX1 = d3_geo_pathBoundsY1 = -(d3_geo_pathBoundsX0 = d3_geo_pathBoundsY0 = Infinity);
+ d3.geo.stream(object, projectStream(d3_geo_pathBounds));
+ return [ [ d3_geo_pathBoundsX0, d3_geo_pathBoundsY0 ], [ d3_geo_pathBoundsX1, d3_geo_pathBoundsY1 ] ];
+ };
+ path.projection = function(_) {
+ if (!arguments.length) return projection;
+ projectStream = (projection = _) ? _.stream || d3_geo_pathProjectStream(_) : d3_identity;
+ return reset();
+ };
+ path.context = function(_) {
+ if (!arguments.length) return context;
+ contextStream = (context = _) == null ? new d3_geo_pathBuffer() : new d3_geo_pathContext(_);
+ if (typeof pointRadius !== "function") contextStream.pointRadius(pointRadius);
+ return reset();
+ };
+ path.pointRadius = function(_) {
+ if (!arguments.length) return pointRadius;
+ pointRadius = typeof _ === "function" ? _ : (contextStream.pointRadius(+_), +_);
+ return path;
+ };
+ function reset() {
+ cacheStream = null;
+ return path;
+ }
+ return path.projection(d3.geo.albersUsa()).context(null);
+ };
+ function d3_geo_pathProjectStream(project) {
+ var resample = d3_geo_resample(function(x, y) {
+ return project([ x * d3_degrees, y * d3_degrees ]);
+ });
+ return function(stream) {
+ return d3_geo_projectionRadians(resample(stream));
+ };
+ }
+ d3.geo.transform = function(methods) {
+ return {
+ stream: function(stream) {
+ var transform = new d3_geo_transform(stream);
+ for (var k in methods) transform[k] = methods[k];
+ return transform;
+ }
+ };
+ };
+ function d3_geo_transform(stream) {
+ this.stream = stream;
+ }
+ d3_geo_transform.prototype = {
+ point: function(x, y) {
+ this.stream.point(x, y);
+ },
+ sphere: function() {
+ this.stream.sphere();
+ },
+ lineStart: function() {
+ this.stream.lineStart();
+ },
+ lineEnd: function() {
+ this.stream.lineEnd();
+ },
+ polygonStart: function() {
+ this.stream.polygonStart();
+ },
+ polygonEnd: function() {
+ this.stream.polygonEnd();
+ }
+ };
+ function d3_geo_transformPoint(stream, point) {
+ return {
+ point: point,
+ sphere: function() {
+ stream.sphere();
+ },
+ lineStart: function() {
+ stream.lineStart();
+ },
+ lineEnd: function() {
+ stream.lineEnd();
+ },
+ polygonStart: function() {
+ stream.polygonStart();
+ },
+ polygonEnd: function() {
+ stream.polygonEnd();
+ }
+ };
+ }
+ d3.geo.projection = d3_geo_projection;
+ d3.geo.projectionMutator = d3_geo_projectionMutator;
+ function d3_geo_projection(project) {
+ return d3_geo_projectionMutator(function() {
+ return project;
+ })();
+ }
+ function d3_geo_projectionMutator(projectAt) {
+ var project, rotate, projectRotate, projectResample = d3_geo_resample(function(x, y) {
+ x = project(x, y);
+ return [ x[0] * k + δx, δy - x[1] * k ];
+ }), k = 150, x = 480, y = 250, λ = 0, φ = 0, δλ = 0, δφ = 0, δγ = 0, δx, δy, preclip = d3_geo_clipAntimeridian, postclip = d3_identity, clipAngle = null, clipExtent = null, stream;
+ function projection(point) {
+ point = projectRotate(point[0] * d3_radians, point[1] * d3_radians);
+ return [ point[0] * k + δx, δy - point[1] * k ];
+ }
+ function invert(point) {
+ point = projectRotate.invert((point[0] - δx) / k, (δy - point[1]) / k);
+ return point && [ point[0] * d3_degrees, point[1] * d3_degrees ];
+ }
+ projection.stream = function(output) {
+ if (stream) stream.valid = false;
+ stream = d3_geo_projectionRadians(preclip(rotate, projectResample(postclip(output))));
+ stream.valid = true;
+ return stream;
+ };
+ projection.clipAngle = function(_) {
+ if (!arguments.length) return clipAngle;
+ preclip = _ == null ? (clipAngle = _, d3_geo_clipAntimeridian) : d3_geo_clipCircle((clipAngle = +_) * d3_radians);
+ return invalidate();
+ };
+ projection.clipExtent = function(_) {
+ if (!arguments.length) return clipExtent;
+ clipExtent = _;
+ postclip = _ ? d3_geo_clipExtent(_[0][0], _[0][1], _[1][0], _[1][1]) : d3_identity;
+ return invalidate();
+ };
+ projection.scale = function(_) {
+ if (!arguments.length) return k;
+ k = +_;
+ return reset();
+ };
+ projection.translate = function(_) {
+ if (!arguments.length) return [ x, y ];
+ x = +_[0];
+ y = +_[1];
+ return reset();
+ };
+ projection.center = function(_) {
+ if (!arguments.length) return [ λ * d3_degrees, φ * d3_degrees ];
+ λ = _[0] % 360 * d3_radians;
+ φ = _[1] % 360 * d3_radians;
+ return reset();
+ };
+ projection.rotate = function(_) {
+ if (!arguments.length) return [ δλ * d3_degrees, δφ * d3_degrees, δγ * d3_degrees ];
+ δλ = _[0] % 360 * d3_radians;
+ δφ = _[1] % 360 * d3_radians;
+ δγ = _.length > 2 ? _[2] % 360 * d3_radians : 0;
+ return reset();
+ };
+ d3.rebind(projection, projectResample, "precision");
+ function reset() {
+ projectRotate = d3_geo_compose(rotate = d3_geo_rotation(δλ, δφ, δγ), project);
+ var center = project(λ, φ);
+ δx = x - center[0] * k;
+ δy = y + center[1] * k;
+ return invalidate();
+ }
+ function invalidate() {
+ if (stream) stream.valid = false, stream = null;
+ return projection;
+ }
+ return function() {
+ project = projectAt.apply(this, arguments);
+ projection.invert = project.invert && invert;
+ return reset();
+ };
+ }
+ function d3_geo_projectionRadians(stream) {
+ return d3_geo_transformPoint(stream, function(x, y) {
+ stream.point(x * d3_radians, y * d3_radians);
+ });
+ }
+ function d3_geo_equirectangular(λ, φ) {
+ return [ λ, φ ];
+ }
+ (d3.geo.equirectangular = function() {
+ return d3_geo_projection(d3_geo_equirectangular);
+ }).raw = d3_geo_equirectangular.invert = d3_geo_equirectangular;
+ d3.geo.rotation = function(rotate) {
+ rotate = d3_geo_rotation(rotate[0] % 360 * d3_radians, rotate[1] * d3_radians, rotate.length > 2 ? rotate[2] * d3_radians : 0);
+ function forward(coordinates) {
+ coordinates = rotate(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
+ return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
+ }
+ forward.invert = function(coordinates) {
+ coordinates = rotate.invert(coordinates[0] * d3_radians, coordinates[1] * d3_radians);
+ return coordinates[0] *= d3_degrees, coordinates[1] *= d3_degrees, coordinates;
+ };
+ return forward;
+ };
+ function d3_geo_identityRotation(λ, φ) {
+ return [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
+ }
+ d3_geo_identityRotation.invert = d3_geo_equirectangular;
+ function d3_geo_rotation(δλ, δφ, δγ) {
+ return δλ ? δφ || δγ ? d3_geo_compose(d3_geo_rotationλ(δλ), d3_geo_rotationφγ(δφ, δγ)) : d3_geo_rotationλ(δλ) : δφ || δγ ? d3_geo_rotationφγ(δφ, δγ) : d3_geo_identityRotation;
+ }
+ function d3_geo_forwardRotationλ(δλ) {
+ return function(λ, φ) {
+ return λ += δλ, [ λ > π ? λ - τ : λ < -π ? λ + τ : λ, φ ];
+ };
+ }
+ function d3_geo_rotationλ(δλ) {
+ var rotation = d3_geo_forwardRotationλ(δλ);
+ rotation.invert = d3_geo_forwardRotationλ(-δλ);
+ return rotation;
+ }
+ function d3_geo_rotationφγ(δφ, δγ) {
+ var cosδφ = Math.cos(δφ), sinδφ = Math.sin(δφ), cosδγ = Math.cos(δγ), sinδγ = Math.sin(δγ);
+ function rotation(λ, φ) {
+ var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδφ + x * sinδφ;
+ return [ Math.atan2(y * cosδγ - k * sinδγ, x * cosδφ - z * sinδφ), d3_asin(k * cosδγ + y * sinδγ) ];
+ }
+ rotation.invert = function(λ, φ) {
+ var cosφ = Math.cos(φ), x = Math.cos(λ) * cosφ, y = Math.sin(λ) * cosφ, z = Math.sin(φ), k = z * cosδγ - y * sinδγ;
+ return [ Math.atan2(y * cosδγ + z * sinδγ, x * cosδφ + k * sinδφ), d3_asin(k * cosδφ - x * sinδφ) ];
+ };
+ return rotation;
+ }
+ d3.geo.circle = function() {
+ var origin = [ 0, 0 ], angle, precision = 6, interpolate;
+ function circle() {
+ var center = typeof origin === "function" ? origin.apply(this, arguments) : origin, rotate = d3_geo_rotation(-center[0] * d3_radians, -center[1] * d3_radians, 0).invert, ring = [];
+ interpolate(null, null, 1, {
+ point: function(x, y) {
+ ring.push(x = rotate(x, y));
+ x[0] *= d3_degrees, x[1] *= d3_degrees;
+ }
+ });
+ return {
+ type: "Polygon",
+ coordinates: [ ring ]
+ };
+ }
+ circle.origin = function(x) {
+ if (!arguments.length) return origin;
+ origin = x;
+ return circle;
+ };
+ circle.angle = function(x) {
+ if (!arguments.length) return angle;
+ interpolate = d3_geo_circleInterpolate((angle = +x) * d3_radians, precision * d3_radians);
+ return circle;
+ };
+ circle.precision = function(_) {
+ if (!arguments.length) return precision;
+ interpolate = d3_geo_circleInterpolate(angle * d3_radians, (precision = +_) * d3_radians);
+ return circle;
+ };
+ return circle.angle(90);
+ };
+ function d3_geo_circleInterpolate(radius, precision) {
+ var cr = Math.cos(radius), sr = Math.sin(radius);
+ return function(from, to, direction, listener) {
+ var step = direction * precision;
+ if (from != null) {
+ from = d3_geo_circleAngle(cr, from);
+ to = d3_geo_circleAngle(cr, to);
+ if (direction > 0 ? from < to : from > to) from += direction * τ;
+ } else {
+ from = radius + direction * τ;
+ to = radius - .5 * step;
+ }
+ for (var point, t = from; direction > 0 ? t > to : t < to; t -= step) {
+ listener.point((point = d3_geo_spherical([ cr, -sr * Math.cos(t), -sr * Math.sin(t) ]))[0], point[1]);
+ }
+ };
+ }
+ function d3_geo_circleAngle(cr, point) {
+ var a = d3_geo_cartesian(point);
+ a[0] -= cr;
+ d3_geo_cartesianNormalize(a);
+ var angle = d3_acos(-a[1]);
+ return ((-a[2] < 0 ? -angle : angle) + 2 * Math.PI - ε) % (2 * Math.PI);
+ }
+ d3.geo.distance = function(a, b) {
+ var Δλ = (b[0] - a[0]) * d3_radians, φ0 = a[1] * d3_radians, φ1 = b[1] * d3_radians, sinΔλ = Math.sin(Δλ), cosΔλ = Math.cos(Δλ), sinφ0 = Math.sin(φ0), cosφ0 = Math.cos(φ0), sinφ1 = Math.sin(φ1), cosφ1 = Math.cos(φ1), t;
+ return Math.atan2(Math.sqrt((t = cosφ1 * sinΔλ) * t + (t = cosφ0 * sinφ1 - sinφ0 * cosφ1 * cosΔλ) * t), sinφ0 * sinφ1 + cosφ0 * cosφ1 * cosΔλ);
+ };
+ d3.geo.graticule = function() {
+ var x1, x0, X1, X0, y1, y0, Y1, Y0, dx = 10, dy = dx, DX = 90, DY = 360, x, y, X, Y, precision = 2.5;
+ function graticule() {
+ return {
+ type: "MultiLineString",
+ coordinates: lines()
+ };
+ }
+ function lines() {
+ return d3.range(Math.ceil(X0 / DX) * DX, X1, DX).map(X).concat(d3.range(Math.ceil(Y0 / DY) * DY, Y1, DY).map(Y)).concat(d3.range(Math.ceil(x0 / dx) * dx, x1, dx).filter(function(x) {
+ return abs(x % DX) > ε;
+ }).map(x)).concat(d3.range(Math.ceil(y0 / dy) * dy, y1, dy).filter(function(y) {
+ return abs(y % DY) > ε;
+ }).map(y));
+ }
+ graticule.lines = function() {
+ return lines().map(function(coordinates) {
+ return {
+ type: "LineString",
+ coordinates: coordinates
+ };
+ });
+ };
+ graticule.outline = function() {
+ return {
+ type: "Polygon",
+ coordinates: [ X(X0).concat(Y(Y1).slice(1), X(X1).reverse().slice(1), Y(Y0).reverse().slice(1)) ]
+ };
+ };
+ graticule.extent = function(_) {
+ if (!arguments.length) return graticule.minorExtent();
+ return graticule.majorExtent(_).minorExtent(_);
+ };
+ graticule.majorExtent = function(_) {
+ if (!arguments.length) return [ [ X0, Y0 ], [ X1, Y1 ] ];
+ X0 = +_[0][0], X1 = +_[1][0];
+ Y0 = +_[0][1], Y1 = +_[1][1];
+ if (X0 > X1) _ = X0, X0 = X1, X1 = _;
+ if (Y0 > Y1) _ = Y0, Y0 = Y1, Y1 = _;
+ return graticule.precision(precision);
+ };
+ graticule.minorExtent = function(_) {
+ if (!arguments.length) return [ [ x0, y0 ], [ x1, y1 ] ];
+ x0 = +_[0][0], x1 = +_[1][0];
+ y0 = +_[0][1], y1 = +_[1][1];
+ if (x0 > x1) _ = x0, x0 = x1, x1 = _;
+ if (y0 > y1) _ = y0, y0 = y1, y1 = _;
+ return graticule.precision(precision);
+ };
+ graticule.step = function(_) {
+ if (!arguments.length) return graticule.minorStep();
+ return graticule.majorStep(_).minorStep(_);
+ };
+ graticule.majorStep = function(_) {
+ if (!arguments.length) return [ DX, DY ];
+ DX = +_[0], DY = +_[1];
+ return graticule;
+ };
+ graticule.minorStep = function(_) {
+ if (!arguments.length) return [ dx, dy ];
+ dx = +_[0], dy = +_[1];
+ return graticule;
+ };
+ graticule.precision = function(_) {
+ if (!arguments.length) return precision;
+ precision = +_;
+ x = d3_geo_graticuleX(y0, y1, 90);
+ y = d3_geo_graticuleY(x0, x1, precision);
+ X = d3_geo_graticuleX(Y0, Y1, 90);
+ Y = d3_geo_graticuleY(X0, X1, precision);
+ return graticule;
+ };
+ return graticule.majorExtent([ [ -180, -90 + ε ], [ 180, 90 - ε ] ]).minorExtent([ [ -180, -80 - ε ], [ 180, 80 + ε ] ]);
+ };
+ function d3_geo_graticuleX(y0, y1, dy) {
+ var y = d3.range(y0, y1 - ε, dy).concat(y1);
+ return function(x) {
+ return y.map(function(y) {
+ return [ x, y ];
+ });
+ };
+ }
+ function d3_geo_graticuleY(x0, x1, dx) {
+ var x = d3.range(x0, x1 - ε, dx).concat(x1);
+ return function(y) {
+ return x.map(function(x) {
+ return [ x, y ];
+ });
+ };
+ }
+ function d3_source(d) {
+ return d.source;
+ }
+ function d3_target(d) {
+ return d.target;
+ }
+ d3.geo.greatArc = function() {
+ var source = d3_source, source_, target = d3_target, target_;
+ function greatArc() {
+ return {
+ type: "LineString",
+ coordinates: [ source_ || source.apply(this, arguments), target_ || target.apply(this, arguments) ]
+ };
+ }
+ greatArc.distance = function() {
+ return d3.geo.distance(source_ || source.apply(this, arguments), target_ || target.apply(this, arguments));
+ };
+ greatArc.source = function(_) {
+ if (!arguments.length) return source;
+ source = _, source_ = typeof _ === "function" ? null : _;
+ return greatArc;
+ };
+ greatArc.target = function(_) {
+ if (!arguments.length) return target;
+ target = _, target_ = typeof _ === "function" ? null : _;
+ return greatArc;
+ };
+ greatArc.precision = function() {
+ return arguments.length ? greatArc : 0;
+ };
+ return greatArc;
+ };
+ d3.geo.interpolate = function(source, target) {
+ return d3_geo_interpolate(source[0] * d3_radians, source[1] * d3_radians, target[0] * d3_radians, target[1] * d3_radians);
+ };
+ function d3_geo_interpolate(x0, y0, x1, y1) {
+ var cy0 = Math.cos(y0), sy0 = Math.sin(y0), cy1 = Math.cos(y1), sy1 = Math.sin(y1), kx0 = cy0 * Math.cos(x0), ky0 = cy0 * Math.sin(x0), kx1 = cy1 * Math.cos(x1), ky1 = cy1 * Math.sin(x1), d = 2 * Math.asin(Math.sqrt(d3_haversin(y1 - y0) + cy0 * cy1 * d3_haversin(x1 - x0))), k = 1 / Math.sin(d);
+ var interpolate = d ? function(t) {
+ var B = Math.sin(t *= d) * k, A = Math.sin(d - t) * k, x = A * kx0 + B * kx1, y = A * ky0 + B * ky1, z = A * sy0 + B * sy1;
+ return [ Math.atan2(y, x) * d3_degrees, Math.atan2(z, Math.sqrt(x * x + y * y)) * d3_degrees ];
+ } : function() {
+ return [ x0 * d3_degrees, y0 * d3_degrees ];
+ };
+ interpolate.distance = d;
+ return interpolate;
+ }
+ d3.geo.length = function(object) {
+ d3_geo_lengthSum = 0;
+ d3.geo.stream(object, d3_geo_length);
+ return d3_geo_lengthSum;
+ };
+ var d3_geo_lengthSum;
+ var d3_geo_length = {
+ sphere: d3_noop,
+ point: d3_noop,
+ lineStart: d3_geo_lengthLineStart,
+ lineEnd: d3_noop,
+ polygonStart: d3_noop,
+ polygonEnd: d3_noop
+ };
+ function d3_geo_lengthLineStart() {
+ var λ0, sinφ0, cosφ0;
+ d3_geo_length.point = function(λ, φ) {
+ λ0 = λ * d3_radians, sinφ0 = Math.sin(φ *= d3_radians), cosφ0 = Math.cos(φ);
+ d3_geo_length.point = nextPoint;
+ };
+ d3_geo_length.lineEnd = function() {
+ d3_geo_length.point = d3_geo_length.lineEnd = d3_noop;
+ };
+ function nextPoint(λ, φ) {
+ var sinφ = Math.sin(φ *= d3_radians), cosφ = Math.cos(φ), t = abs((λ *= d3_radians) - λ0), cosΔλ = Math.cos(t);
+ d3_geo_lengthSum += Math.atan2(Math.sqrt((t = cosφ * Math.sin(t)) * t + (t = cosφ0 * sinφ - sinφ0 * cosφ * cosΔλ) * t), sinφ0 * sinφ + cosφ0 * cosφ * cosΔλ);
+ λ0 = λ, sinφ0 = sinφ, cosφ0 = cosφ;
+ }
+ }
+ function d3_geo_azimuthal(scale, angle) {
+ function azimuthal(λ, φ) {
+ var cosλ = Math.cos(λ), cosφ = Math.cos(φ), k = scale(cosλ * cosφ);
+ return [ k * cosφ * Math.sin(λ), k * Math.sin(φ) ];
+ }
+ azimuthal.invert = function(x, y) {
+ var ρ = Math.sqrt(x * x + y * y), c = angle(ρ), sinc = Math.sin(c), cosc = Math.cos(c);
+ return [ Math.atan2(x * sinc, ρ * cosc), Math.asin(ρ && y * sinc / ρ) ];
+ };
+ return azimuthal;
+ }
+ var d3_geo_azimuthalEqualArea = d3_geo_azimuthal(function(cosλcosφ) {
+ return Math.sqrt(2 / (1 + cosλcosφ));
+ }, function(ρ) {
+ return 2 * Math.asin(ρ / 2);
+ });
+ (d3.geo.azimuthalEqualArea = function() {
+ return d3_geo_projection(d3_geo_azimuthalEqualArea);
+ }).raw = d3_geo_azimuthalEqualArea;
+ var d3_geo_azimuthalEquidistant = d3_geo_azimuthal(function(cosλcosφ) {
+ var c = Math.acos(cosλcosφ);
+ return c && c / Math.sin(c);
+ }, d3_identity);
+ (d3.geo.azimuthalEquidistant = function() {
+ return d3_geo_projection(d3_geo_azimuthalEquidistant);
+ }).raw = d3_geo_azimuthalEquidistant;
+ function d3_geo_conicConformal(φ0, φ1) {
+ var cosφ0 = Math.cos(φ0), t = function(φ) {
+ return Math.tan(π / 4 + φ / 2);
+ }, n = φ0 === φ1 ? Math.sin(φ0) : Math.log(cosφ0 / Math.cos(φ1)) / Math.log(t(φ1) / t(φ0)), F = cosφ0 * Math.pow(t(φ0), n) / n;
+ if (!n) return d3_geo_mercator;
+ function forward(λ, φ) {
+ if (F > 0) {
+ if (φ < -halfπ + ε) φ = -halfπ + ε;
+ } else {
+ if (φ > halfπ - ε) φ = halfπ - ε;
+ }
+ var ρ = F / Math.pow(t(φ), n);
+ return [ ρ * Math.sin(n * λ), F - ρ * Math.cos(n * λ) ];
+ }
+ forward.invert = function(x, y) {
+ var ρ0_y = F - y, ρ = d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y);
+ return [ Math.atan2(x, ρ0_y) / n, 2 * Math.atan(Math.pow(F / ρ, 1 / n)) - halfπ ];
+ };
+ return forward;
+ }
+ (d3.geo.conicConformal = function() {
+ return d3_geo_conic(d3_geo_conicConformal);
+ }).raw = d3_geo_conicConformal;
+ function d3_geo_conicEquidistant(φ0, φ1) {
+ var cosφ0 = Math.cos(φ0), n = φ0 === φ1 ? Math.sin(φ0) : (cosφ0 - Math.cos(φ1)) / (φ1 - φ0), G = cosφ0 / n + φ0;
+ if (abs(n) < ε) return d3_geo_equirectangular;
+ function forward(λ, φ) {
+ var ρ = G - φ;
+ return [ ρ * Math.sin(n * λ), G - ρ * Math.cos(n * λ) ];
+ }
+ forward.invert = function(x, y) {
+ var ρ0_y = G - y;
+ return [ Math.atan2(x, ρ0_y) / n, G - d3_sgn(n) * Math.sqrt(x * x + ρ0_y * ρ0_y) ];
+ };
+ return forward;
+ }
+ (d3.geo.conicEquidistant = function() {
+ return d3_geo_conic(d3_geo_conicEquidistant);
+ }).raw = d3_geo_conicEquidistant;
+ var d3_geo_gnomonic = d3_geo_azimuthal(function(cosλcosφ) {
+ return 1 / cosλcosφ;
+ }, Math.atan);
+ (d3.geo.gnomonic = function() {
+ return d3_geo_projection(d3_geo_gnomonic);
+ }).raw = d3_geo_gnomonic;
+ function d3_geo_mercator(λ, φ) {
+ return [ λ, Math.log(Math.tan(π / 4 + φ / 2)) ];
+ }
+ d3_geo_mercator.invert = function(x, y) {
+ return [ x, 2 * Math.atan(Math.exp(y)) - halfπ ];
+ };
+ function d3_geo_mercatorProjection(project) {
+ var m = d3_geo_projection(project), scale = m.scale, translate = m.translate, clipExtent = m.clipExtent, clipAuto;
+ m.scale = function() {
+ var v = scale.apply(m, arguments);
+ return v === m ? clipAuto ? m.clipExtent(null) : m : v;
+ };
+ m.translate = function() {
+ var v = translate.apply(m, arguments);
+ return v === m ? clipAuto ? m.clipExtent(null) : m : v;
+ };
+ m.clipExtent = function(_) {
+ var v = clipExtent.apply(m, arguments);
+ if (v === m) {
+ if (clipAuto = _ == null) {
+ var k = π * scale(), t = translate();
+ clipExtent([ [ t[0] - k, t[1] - k ], [ t[0] + k, t[1] + k ] ]);
+ }
+ } else if (clipAuto) {
+ v = null;
+ }
+ return v;
+ };
+ return m.clipExtent(null);
+ }
+ (d3.geo.mercator = function() {
+ return d3_geo_mercatorProjection(d3_geo_mercator);
+ }).raw = d3_geo_mercator;
+ var d3_geo_orthographic = d3_geo_azimuthal(function() {
+ return 1;
+ }, Math.asin);
+ (d3.geo.orthographic = function() {
+ return d3_geo_projection(d3_geo_orthographic);
+ }).raw = d3_geo_orthographic;
+ var d3_geo_stereographic = d3_geo_azimuthal(function(cosλcosφ) {
+ return 1 / (1 + cosλcosφ);
+ }, function(ρ) {
+ return 2 * Math.atan(ρ);
+ });
+ (d3.geo.stereographic = function() {
+ return d3_geo_projection(d3_geo_stereographic);
+ }).raw = d3_geo_stereographic;
+ function d3_geo_transverseMercator(λ, φ) {
+ return [ Math.log(Math.tan(π / 4 + φ / 2)), -λ ];
+ }
+ d3_geo_transverseMercator.invert = function(x, y) {
+ return [ -y, 2 * Math.atan(Math.exp(x)) - halfπ ];
+ };
+ (d3.geo.transverseMercator = function() {
+ var projection = d3_geo_mercatorProjection(d3_geo_transverseMercator), center = projection.center, rotate = projection.rotate;
+ projection.center = function(_) {
+ return _ ? center([ -_[1], _[0] ]) : (_ = center(), [ _[1], -_[0] ]);
+ };
+ projection.rotate = function(_) {
+ return _ ? rotate([ _[0], _[1], _.length > 2 ? _[2] + 90 : 90 ]) : (_ = rotate(),
+ [ _[0], _[1], _[2] - 90 ]);
+ };
+ return rotate([ 0, 0, 90 ]);
+ }).raw = d3_geo_transverseMercator;
+ d3.geom = {};
+ function d3_geom_pointX(d) {
+ return d[0];
+ }
+ function d3_geom_pointY(d) {
+ return d[1];
+ }
+ d3.geom.hull = function(vertices) {
+ var x = d3_geom_pointX, y = d3_geom_pointY;
+ if (arguments.length) return hull(vertices);
+ function hull(data) {
+ if (data.length < 3) return [];
+ var fx = d3_functor(x), fy = d3_functor(y), i, n = data.length, points = [], flippedPoints = [];
+ for (i = 0; i < n; i++) {
+ points.push([ +fx.call(this, data[i], i), +fy.call(this, data[i], i), i ]);
+ }
+ points.sort(d3_geom_hullOrder);
+ for (i = 0; i < n; i++) flippedPoints.push([ points[i][0], -points[i][1] ]);
+ var upper = d3_geom_hullUpper(points), lower = d3_geom_hullUpper(flippedPoints);
+ var skipLeft = lower[0] === upper[0], skipRight = lower[lower.length - 1] === upper[upper.length - 1], polygon = [];
+ for (i = upper.length - 1; i >= 0; --i) polygon.push(data[points[upper[i]][2]]);
+ for (i = +skipLeft; i < lower.length - skipRight; ++i) polygon.push(data[points[lower[i]][2]]);
+ return polygon;
+ }
+ hull.x = function(_) {
+ return arguments.length ? (x = _, hull) : x;
+ };
+ hull.y = function(_) {
+ return arguments.length ? (y = _, hull) : y;
+ };
+ return hull;
+ };
+ function d3_geom_hullUpper(points) {
+ var n = points.length, hull = [ 0, 1 ], hs = 2;
+ for (var i = 2; i < n; i++) {
+ while (hs > 1 && d3_cross2d(points[hull[hs - 2]], points[hull[hs - 1]], points[i]) <= 0) --hs;
+ hull[hs++] = i;
+ }
+ return hull.slice(0, hs);
+ }
+ function d3_geom_hullOrder(a, b) {
+ return a[0] - b[0] || a[1] - b[1];
+ }
+ d3.geom.polygon = function(coordinates) {
+ d3_subclass(coordinates, d3_geom_polygonPrototype);
+ return coordinates;
+ };
+ var d3_geom_polygonPrototype = d3.geom.polygon.prototype = [];
+ d3_geom_polygonPrototype.area = function() {
+ var i = -1, n = this.length, a, b = this[n - 1], area = 0;
+ while (++i < n) {
+ a = b;
+ b = this[i];
+ area += a[1] * b[0] - a[0] * b[1];
+ }
+ return area * .5;
+ };
+ d3_geom_polygonPrototype.centroid = function(k) {
+ var i = -1, n = this.length, x = 0, y = 0, a, b = this[n - 1], c;
+ if (!arguments.length) k = -1 / (6 * this.area());
+ while (++i < n) {
+ a = b;
+ b = this[i];
+ c = a[0] * b[1] - b[0] * a[1];
+ x += (a[0] + b[0]) * c;
+ y += (a[1] + b[1]) * c;
+ }
+ return [ x * k, y * k ];
+ };
+ d3_geom_polygonPrototype.clip = function(subject) {
+ var input, closed = d3_geom_polygonClosed(subject), i = -1, n = this.length - d3_geom_polygonClosed(this), j, m, a = this[n - 1], b, c, d;
+ while (++i < n) {
+ input = subject.slice();
+ subject.length = 0;
+ b = this[i];
+ c = input[(m = input.length - closed) - 1];
+ j = -1;
+ while (++j < m) {
+ d = input[j];
+ if (d3_geom_polygonInside(d, a, b)) {
+ if (!d3_geom_polygonInside(c, a, b)) {
+ subject.push(d3_geom_polygonIntersect(c, d, a, b));
+ }
+ subject.push(d);
+ } else if (d3_geom_polygonInside(c, a, b)) {
+ subject.push(d3_geom_polygonIntersect(c, d, a, b));
+ }
+ c = d;
+ }
+ if (closed) subject.push(subject[0]);
+ a = b;
+ }
+ return subject;
+ };
+ function d3_geom_polygonInside(p, a, b) {
+ return (b[0] - a[0]) * (p[1] - a[1]) < (b[1] - a[1]) * (p[0] - a[0]);
+ }
+ function d3_geom_polygonIntersect(c, d, a, b) {
+ var x1 = c[0], x3 = a[0], x21 = d[0] - x1, x43 = b[0] - x3, y1 = c[1], y3 = a[1], y21 = d[1] - y1, y43 = b[1] - y3, ua = (x43 * (y1 - y3) - y43 * (x1 - x3)) / (y43 * x21 - x43 * y21);
+ return [ x1 + ua * x21, y1 + ua * y21 ];
+ }
+ function d3_geom_polygonClosed(coordinates) {
+ var a = coordinates[0], b = coordinates[coordinates.length - 1];
+ return !(a[0] - b[0] || a[1] - b[1]);
+ }
+ var d3_geom_voronoiEdges, d3_geom_voronoiCells, d3_geom_voronoiBeaches, d3_geom_voronoiBeachPool = [], d3_geom_voronoiFirstCircle, d3_geom_voronoiCircles, d3_geom_voronoiCirclePool = [];
+ function d3_geom_voronoiBeach() {
+ d3_geom_voronoiRedBlackNode(this);
+ this.edge = this.site = this.circle = null;
+ }
+ function d3_geom_voronoiCreateBeach(site) {
+ var beach = d3_geom_voronoiBeachPool.pop() || new d3_geom_voronoiBeach();
+ beach.site = site;
+ return beach;
+ }
+ function d3_geom_voronoiDetachBeach(beach) {
+ d3_geom_voronoiDetachCircle(beach);
+ d3_geom_voronoiBeaches.remove(beach);
+ d3_geom_voronoiBeachPool.push(beach);
+ d3_geom_voronoiRedBlackNode(beach);
+ }
+ function d3_geom_voronoiRemoveBeach(beach) {
+ var circle = beach.circle, x = circle.x, y = circle.cy, vertex = {
+ x: x,
+ y: y
+ }, previous = beach.P, next = beach.N, disappearing = [ beach ];
+ d3_geom_voronoiDetachBeach(beach);
+ var lArc = previous;
+ while (lArc.circle && abs(x - lArc.circle.x) < ε && abs(y - lArc.circle.cy) < ε) {
+ previous = lArc.P;
+ disappearing.unshift(lArc);
+ d3_geom_voronoiDetachBeach(lArc);
+ lArc = previous;
+ }
+ disappearing.unshift(lArc);
+ d3_geom_voronoiDetachCircle(lArc);
+ var rArc = next;
+ while (rArc.circle && abs(x - rArc.circle.x) < ε && abs(y - rArc.circle.cy) < ε) {
+ next = rArc.N;
+ disappearing.push(rArc);
+ d3_geom_voronoiDetachBeach(rArc);
+ rArc = next;
+ }
+ disappearing.push(rArc);
+ d3_geom_voronoiDetachCircle(rArc);
+ var nArcs = disappearing.length, iArc;
+ for (iArc = 1; iArc < nArcs; ++iArc) {
+ rArc = disappearing[iArc];
+ lArc = disappearing[iArc - 1];
+ d3_geom_voronoiSetEdgeEnd(rArc.edge, lArc.site, rArc.site, vertex);
+ }
+ lArc = disappearing[0];
+ rArc = disappearing[nArcs - 1];
+ rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, rArc.site, null, vertex);
+ d3_geom_voronoiAttachCircle(lArc);
+ d3_geom_voronoiAttachCircle(rArc);
+ }
+ function d3_geom_voronoiAddBeach(site) {
+ var x = site.x, directrix = site.y, lArc, rArc, dxl, dxr, node = d3_geom_voronoiBeaches._;
+ while (node) {
+ dxl = d3_geom_voronoiLeftBreakPoint(node, directrix) - x;
+ if (dxl > ε) node = node.L; else {
+ dxr = x - d3_geom_voronoiRightBreakPoint(node, directrix);
+ if (dxr > ε) {
+ if (!node.R) {
+ lArc = node;
+ break;
+ }
+ node = node.R;
+ } else {
+ if (dxl > -ε) {
+ lArc = node.P;
+ rArc = node;
+ } else if (dxr > -ε) {
+ lArc = node;
+ rArc = node.N;
+ } else {
+ lArc = rArc = node;
+ }
+ break;
+ }
+ }
+ }
+ var newArc = d3_geom_voronoiCreateBeach(site);
+ d3_geom_voronoiBeaches.insert(lArc, newArc);
+ if (!lArc && !rArc) return;
+ if (lArc === rArc) {
+ d3_geom_voronoiDetachCircle(lArc);
+ rArc = d3_geom_voronoiCreateBeach(lArc.site);
+ d3_geom_voronoiBeaches.insert(newArc, rArc);
+ newArc.edge = rArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
+ d3_geom_voronoiAttachCircle(lArc);
+ d3_geom_voronoiAttachCircle(rArc);
+ return;
+ }
+ if (!rArc) {
+ newArc.edge = d3_geom_voronoiCreateEdge(lArc.site, newArc.site);
+ return;
+ }
+ d3_geom_voronoiDetachCircle(lArc);
+ d3_geom_voronoiDetachCircle(rArc);
+ var lSite = lArc.site, ax = lSite.x, ay = lSite.y, bx = site.x - ax, by = site.y - ay, rSite = rArc.site, cx = rSite.x - ax, cy = rSite.y - ay, d = 2 * (bx * cy - by * cx), hb = bx * bx + by * by, hc = cx * cx + cy * cy, vertex = {
+ x: (cy * hb - by * hc) / d + ax,
+ y: (bx * hc - cx * hb) / d + ay
+ };
+ d3_geom_voronoiSetEdgeEnd(rArc.edge, lSite, rSite, vertex);
+ newArc.edge = d3_geom_voronoiCreateEdge(lSite, site, null, vertex);
+ rArc.edge = d3_geom_voronoiCreateEdge(site, rSite, null, vertex);
+ d3_geom_voronoiAttachCircle(lArc);
+ d3_geom_voronoiAttachCircle(rArc);
+ }
+ function d3_geom_voronoiLeftBreakPoint(arc, directrix) {
+ var site = arc.site, rfocx = site.x, rfocy = site.y, pby2 = rfocy - directrix;
+ if (!pby2) return rfocx;
+ var lArc = arc.P;
+ if (!lArc) return -Infinity;
+ site = lArc.site;
+ var lfocx = site.x, lfocy = site.y, plby2 = lfocy - directrix;
+ if (!plby2) return lfocx;
+ var hl = lfocx - rfocx, aby2 = 1 / pby2 - 1 / plby2, b = hl / plby2;
+ if (aby2) return (-b + Math.sqrt(b * b - 2 * aby2 * (hl * hl / (-2 * plby2) - lfocy + plby2 / 2 + rfocy - pby2 / 2))) / aby2 + rfocx;
+ return (rfocx + lfocx) / 2;
+ }
+ function d3_geom_voronoiRightBreakPoint(arc, directrix) {
+ var rArc = arc.N;
+ if (rArc) return d3_geom_voronoiLeftBreakPoint(rArc, directrix);
+ var site = arc.site;
+ return site.y === directrix ? site.x : Infinity;
+ }
+ function d3_geom_voronoiCell(site) {
+ this.site = site;
+ this.edges = [];
+ }
+ d3_geom_voronoiCell.prototype.prepare = function() {
+ var halfEdges = this.edges, iHalfEdge = halfEdges.length, edge;
+ while (iHalfEdge--) {
+ edge = halfEdges[iHalfEdge].edge;
+ if (!edge.b || !edge.a) halfEdges.splice(iHalfEdge, 1);
+ }
+ halfEdges.sort(d3_geom_voronoiHalfEdgeOrder);
+ return halfEdges.length;
+ };
+ function d3_geom_voronoiCloseCells(extent) {
+ var x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], x2, y2, x3, y3, cells = d3_geom_voronoiCells, iCell = cells.length, cell, iHalfEdge, halfEdges, nHalfEdges, start, end;
+ while (iCell--) {
+ cell = cells[iCell];
+ if (!cell || !cell.prepare()) continue;
+ halfEdges = cell.edges;
+ nHalfEdges = halfEdges.length;
+ iHalfEdge = 0;
+ while (iHalfEdge < nHalfEdges) {
+ end = halfEdges[iHalfEdge].end(), x3 = end.x, y3 = end.y;
+ start = halfEdges[++iHalfEdge % nHalfEdges].start(), x2 = start.x, y2 = start.y;
+ if (abs(x3 - x2) > ε || abs(y3 - y2) > ε) {
+ halfEdges.splice(iHalfEdge, 0, new d3_geom_voronoiHalfEdge(d3_geom_voronoiCreateBorderEdge(cell.site, end, abs(x3 - x0) < ε && y1 - y3 > ε ? {
+ x: x0,
+ y: abs(x2 - x0) < ε ? y2 : y1
+ } : abs(y3 - y1) < ε && x1 - x3 > ε ? {
+ x: abs(y2 - y1) < ε ? x2 : x1,
+ y: y1
+ } : abs(x3 - x1) < ε && y3 - y0 > ε ? {
+ x: x1,
+ y: abs(x2 - x1) < ε ? y2 : y0
+ } : abs(y3 - y0) < ε && x3 - x0 > ε ? {
+ x: abs(y2 - y0) < ε ? x2 : x0,
+ y: y0
+ } : null), cell.site, null));
+ ++nHalfEdges;
+ }
+ }
+ }
+ }
+ function d3_geom_voronoiHalfEdgeOrder(a, b) {
+ return b.angle - a.angle;
+ }
+ function d3_geom_voronoiCircle() {
+ d3_geom_voronoiRedBlackNode(this);
+ this.x = this.y = this.arc = this.site = this.cy = null;
+ }
+ function d3_geom_voronoiAttachCircle(arc) {
+ var lArc = arc.P, rArc = arc.N;
+ if (!lArc || !rArc) return;
+ var lSite = lArc.site, cSite = arc.site, rSite = rArc.site;
+ if (lSite === rSite) return;
+ var bx = cSite.x, by = cSite.y, ax = lSite.x - bx, ay = lSite.y - by, cx = rSite.x - bx, cy = rSite.y - by;
+ var d = 2 * (ax * cy - ay * cx);
+ if (d >= -ε2) return;
+ var ha = ax * ax + ay * ay, hc = cx * cx + cy * cy, x = (cy * ha - ay * hc) / d, y = (ax * hc - cx * ha) / d, cy = y + by;
+ var circle = d3_geom_voronoiCirclePool.pop() || new d3_geom_voronoiCircle();
+ circle.arc = arc;
+ circle.site = cSite;
+ circle.x = x + bx;
+ circle.y = cy + Math.sqrt(x * x + y * y);
+ circle.cy = cy;
+ arc.circle = circle;
+ var before = null, node = d3_geom_voronoiCircles._;
+ while (node) {
+ if (circle.y < node.y || circle.y === node.y && circle.x <= node.x) {
+ if (node.L) node = node.L; else {
+ before = node.P;
+ break;
+ }
+ } else {
+ if (node.R) node = node.R; else {
+ before = node;
+ break;
+ }
+ }
+ }
+ d3_geom_voronoiCircles.insert(before, circle);
+ if (!before) d3_geom_voronoiFirstCircle = circle;
+ }
+ function d3_geom_voronoiDetachCircle(arc) {
+ var circle = arc.circle;
+ if (circle) {
+ if (!circle.P) d3_geom_voronoiFirstCircle = circle.N;
+ d3_geom_voronoiCircles.remove(circle);
+ d3_geom_voronoiCirclePool.push(circle);
+ d3_geom_voronoiRedBlackNode(circle);
+ arc.circle = null;
+ }
+ }
+ function d3_geom_voronoiClipEdges(extent) {
+ var edges = d3_geom_voronoiEdges, clip = d3_geom_clipLine(extent[0][0], extent[0][1], extent[1][0], extent[1][1]), i = edges.length, e;
+ while (i--) {
+ e = edges[i];
+ if (!d3_geom_voronoiConnectEdge(e, extent) || !clip(e) || abs(e.a.x - e.b.x) < ε && abs(e.a.y - e.b.y) < ε) {
+ e.a = e.b = null;
+ edges.splice(i, 1);
+ }
+ }
+ }
+ function d3_geom_voronoiConnectEdge(edge, extent) {
+ var vb = edge.b;
+ if (vb) return true;
+ var va = edge.a, x0 = extent[0][0], x1 = extent[1][0], y0 = extent[0][1], y1 = extent[1][1], lSite = edge.l, rSite = edge.r, lx = lSite.x, ly = lSite.y, rx = rSite.x, ry = rSite.y, fx = (lx + rx) / 2, fy = (ly + ry) / 2, fm, fb;
+ if (ry === ly) {
+ if (fx < x0 || fx >= x1) return;
+ if (lx > rx) {
+ if (!va) va = {
+ x: fx,
+ y: y0
+ }; else if (va.y >= y1) return;
+ vb = {
+ x: fx,
+ y: y1
+ };
+ } else {
+ if (!va) va = {
+ x: fx,
+ y: y1
+ }; else if (va.y < y0) return;
+ vb = {
+ x: fx,
+ y: y0
+ };
+ }
+ } else {
+ fm = (lx - rx) / (ry - ly);
+ fb = fy - fm * fx;
+ if (fm < -1 || fm > 1) {
+ if (lx > rx) {
+ if (!va) va = {
+ x: (y0 - fb) / fm,
+ y: y0
+ }; else if (va.y >= y1) return;
+ vb = {
+ x: (y1 - fb) / fm,
+ y: y1
+ };
+ } else {
+ if (!va) va = {
+ x: (y1 - fb) / fm,
+ y: y1
+ }; else if (va.y < y0) return;
+ vb = {
+ x: (y0 - fb) / fm,
+ y: y0
+ };
+ }
+ } else {
+ if (ly < ry) {
+ if (!va) va = {
+ x: x0,
+ y: fm * x0 + fb
+ }; else if (va.x >= x1) return;
+ vb = {
+ x: x1,
+ y: fm * x1 + fb
+ };
+ } else {
+ if (!va) va = {
+ x: x1,
+ y: fm * x1 + fb
+ }; else if (va.x < x0) return;
+ vb = {
+ x: x0,
+ y: fm * x0 + fb
+ };
+ }
+ }
+ }
+ edge.a = va;
+ edge.b = vb;
+ return true;
+ }
+ function d3_geom_voronoiEdge(lSite, rSite) {
+ this.l = lSite;
+ this.r = rSite;
+ this.a = this.b = null;
+ }
+ function d3_geom_voronoiCreateEdge(lSite, rSite, va, vb) {
+ var edge = new d3_geom_voronoiEdge(lSite, rSite);
+ d3_geom_voronoiEdges.push(edge);
+ if (va) d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, va);
+ if (vb) d3_geom_voronoiSetEdgeEnd(edge, rSite, lSite, vb);
+ d3_geom_voronoiCells[lSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, lSite, rSite));
+ d3_geom_voronoiCells[rSite.i].edges.push(new d3_geom_voronoiHalfEdge(edge, rSite, lSite));
+ return edge;
+ }
+ function d3_geom_voronoiCreateBorderEdge(lSite, va, vb) {
+ var edge = new d3_geom_voronoiEdge(lSite, null);
+ edge.a = va;
+ edge.b = vb;
+ d3_geom_voronoiEdges.push(edge);
+ return edge;
+ }
+ function d3_geom_voronoiSetEdgeEnd(edge, lSite, rSite, vertex) {
+ if (!edge.a && !edge.b) {
+ edge.a = vertex;
+ edge.l = lSite;
+ edge.r = rSite;
+ } else if (edge.l === rSite) {
+ edge.b = vertex;
+ } else {
+ edge.a = vertex;
+ }
+ }
+ function d3_geom_voronoiHalfEdge(edge, lSite, rSite) {
+ var va = edge.a, vb = edge.b;
+ this.edge = edge;
+ this.site = lSite;
+ this.angle = rSite ? Math.atan2(rSite.y - lSite.y, rSite.x - lSite.x) : edge.l === lSite ? Math.atan2(vb.x - va.x, va.y - vb.y) : Math.atan2(va.x - vb.x, vb.y - va.y);
+ }
+ d3_geom_voronoiHalfEdge.prototype = {
+ start: function() {
+ return this.edge.l === this.site ? this.edge.a : this.edge.b;
+ },
+ end: function() {
+ return this.edge.l === this.site ? this.edge.b : this.edge.a;
+ }
+ };
+ function d3_geom_voronoiRedBlackTree() {
+ this._ = null;
+ }
+ function d3_geom_voronoiRedBlackNode(node) {
+ node.U = node.C = node.L = node.R = node.P = node.N = null;
+ }
+ d3_geom_voronoiRedBlackTree.prototype = {
+ insert: function(after, node) {
+ var parent, grandpa, uncle;
+ if (after) {
+ node.P = after;
+ node.N = after.N;
+ if (after.N) after.N.P = node;
+ after.N = node;
+ if (after.R) {
+ after = after.R;
+ while (after.L) after = after.L;
+ after.L = node;
+ } else {
+ after.R = node;
+ }
+ parent = after;
+ } else if (this._) {
+ after = d3_geom_voronoiRedBlackFirst(this._);
+ node.P = null;
+ node.N = after;
+ after.P = after.L = node;
+ parent = after;
+ } else {
+ node.P = node.N = null;
+ this._ = node;
+ parent = null;
+ }
+ node.L = node.R = null;
+ node.U = parent;
+ node.C = true;
+ after = node;
+ while (parent && parent.C) {
+ grandpa = parent.U;
+ if (parent === grandpa.L) {
+ uncle = grandpa.R;
+ if (uncle && uncle.C) {
+ parent.C = uncle.C = false;
+ grandpa.C = true;
+ after = grandpa;
+ } else {
+ if (after === parent.R) {
+ d3_geom_voronoiRedBlackRotateLeft(this, parent);
+ after = parent;
+ parent = after.U;
+ }
+ parent.C = false;
+ grandpa.C = true;
+ d3_geom_voronoiRedBlackRotateRight(this, grandpa);
+ }
+ } else {
+ uncle = grandpa.L;
+ if (uncle && uncle.C) {
+ parent.C = uncle.C = false;
+ grandpa.C = true;
+ after = grandpa;
+ } else {
+ if (after === parent.L) {
+ d3_geom_voronoiRedBlackRotateRight(this, parent);
+ after = parent;
+ parent = after.U;
+ }
+ parent.C = false;
+ grandpa.C = true;
+ d3_geom_voronoiRedBlackRotateLeft(this, grandpa);
+ }
+ }
+ parent = after.U;
+ }
+ this._.C = false;
+ },
+ remove: function(node) {
+ if (node.N) node.N.P = node.P;
+ if (node.P) node.P.N = node.N;
+ node.N = node.P = null;
+ var parent = node.U, sibling, left = node.L, right = node.R, next, red;
+ if (!left) next = right; else if (!right) next = left; else next = d3_geom_voronoiRedBlackFirst(right);
+ if (parent) {
+ if (parent.L === node) parent.L = next; else parent.R = next;
+ } else {
+ this._ = next;
+ }
+ if (left && right) {
+ red = next.C;
+ next.C = node.C;
+ next.L = left;
+ left.U = next;
+ if (next !== right) {
+ parent = next.U;
+ next.U = node.U;
+ node = next.R;
+ parent.L = node;
+ next.R = right;
+ right.U = next;
+ } else {
+ next.U = parent;
+ parent = next;
+ node = next.R;
+ }
+ } else {
+ red = node.C;
+ node = next;
+ }
+ if (node) node.U = parent;
+ if (red) return;
+ if (node && node.C) {
+ node.C = false;
+ return;
+ }
+ do {
+ if (node === this._) break;
+ if (node === parent.L) {
+ sibling = parent.R;
+ if (sibling.C) {
+ sibling.C = false;
+ parent.C = true;
+ d3_geom_voronoiRedBlackRotateLeft(this, parent);
+ sibling = parent.R;
+ }
+ if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
+ if (!sibling.R || !sibling.R.C) {
+ sibling.L.C = false;
+ sibling.C = true;
+ d3_geom_voronoiRedBlackRotateRight(this, sibling);
+ sibling = parent.R;
+ }
+ sibling.C = parent.C;
+ parent.C = sibling.R.C = false;
+ d3_geom_voronoiRedBlackRotateLeft(this, parent);
+ node = this._;
+ break;
+ }
+ } else {
+ sibling = parent.L;
+ if (sibling.C) {
+ sibling.C = false;
+ parent.C = true;
+ d3_geom_voronoiRedBlackRotateRight(this, parent);
+ sibling = parent.L;
+ }
+ if (sibling.L && sibling.L.C || sibling.R && sibling.R.C) {
+ if (!sibling.L || !sibling.L.C) {
+ sibling.R.C = false;
+ sibling.C = true;
+ d3_geom_voronoiRedBlackRotateLeft(this, sibling);
+ sibling = parent.L;
+ }
+ sibling.C = parent.C;
+ parent.C = sibling.L.C = false;
+ d3_geom_voronoiRedBlackRotateRight(this, parent);
+ node = this._;
+ break;
+ }
+ }
+ sibling.C = true;
+ node = parent;
+ parent = parent.U;
+ } while (!node.C);
+ if (node) node.C = false;
+ }
+ };
+ function d3_geom_voronoiRedBlackRotateLeft(tree, node) {
+ var p = node, q = node.R, parent = p.U;
+ if (parent) {
+ if (parent.L === p) parent.L = q; else parent.R = q;
+ } else {
+ tree._ = q;
+ }
+ q.U = parent;
+ p.U = q;
+ p.R = q.L;
+ if (p.R) p.R.U = p;
+ q.L = p;
+ }
+ function d3_geom_voronoiRedBlackRotateRight(tree, node) {
+ var p = node, q = node.L, parent = p.U;
+ if (parent) {
+ if (parent.L === p) parent.L = q; else parent.R = q;
+ } else {
+ tree._ = q;
+ }
+ q.U = parent;
+ p.U = q;
+ p.L = q.R;
+ if (p.L) p.L.U = p;
+ q.R = p;
+ }
+ function d3_geom_voronoiRedBlackFirst(node) {
+ while (node.L) node = node.L;
+ return node;
+ }
+ function d3_geom_voronoi(sites, bbox) {
+ var site = sites.sort(d3_geom_voronoiVertexOrder).pop(), x0, y0, circle;
+ d3_geom_voronoiEdges = [];
+ d3_geom_voronoiCells = new Array(sites.length);
+ d3_geom_voronoiBeaches = new d3_geom_voronoiRedBlackTree();
+ d3_geom_voronoiCircles = new d3_geom_voronoiRedBlackTree();
+ while (true) {
+ circle = d3_geom_voronoiFirstCircle;
+ if (site && (!circle || site.y < circle.y || site.y === circle.y && site.x < circle.x)) {
+ if (site.x !== x0 || site.y !== y0) {
+ d3_geom_voronoiCells[site.i] = new d3_geom_voronoiCell(site);
+ d3_geom_voronoiAddBeach(site);
+ x0 = site.x, y0 = site.y;
+ }
+ site = sites.pop();
+ } else if (circle) {
+ d3_geom_voronoiRemoveBeach(circle.arc);
+ } else {
+ break;
+ }
+ }
+ if (bbox) d3_geom_voronoiClipEdges(bbox), d3_geom_voronoiCloseCells(bbox);
+ var diagram = {
+ cells: d3_geom_voronoiCells,
+ edges: d3_geom_voronoiEdges
+ };
+ d3_geom_voronoiBeaches = d3_geom_voronoiCircles = d3_geom_voronoiEdges = d3_geom_voronoiCells = null;
+ return diagram;
+ }
+ function d3_geom_voronoiVertexOrder(a, b) {
+ return b.y - a.y || b.x - a.x;
+ }
+ d3.geom.voronoi = function(points) {
+ var x = d3_geom_pointX, y = d3_geom_pointY, fx = x, fy = y, clipExtent = d3_geom_voronoiClipExtent;
+ if (points) return voronoi(points);
+ function voronoi(data) {
+ var polygons = new Array(data.length), x0 = clipExtent[0][0], y0 = clipExtent[0][1], x1 = clipExtent[1][0], y1 = clipExtent[1][1];
+ d3_geom_voronoi(sites(data), clipExtent).cells.forEach(function(cell, i) {
+ var edges = cell.edges, site = cell.site, polygon = polygons[i] = edges.length ? edges.map(function(e) {
+ var s = e.start();
+ return [ s.x, s.y ];
+ }) : site.x >= x0 && site.x <= x1 && site.y >= y0 && site.y <= y1 ? [ [ x0, y1 ], [ x1, y1 ], [ x1, y0 ], [ x0, y0 ] ] : [];
+ polygon.point = data[i];
+ });
+ return polygons;
+ }
+ function sites(data) {
+ return data.map(function(d, i) {
+ return {
+ x: Math.round(fx(d, i) / ε) * ε,
+ y: Math.round(fy(d, i) / ε) * ε,
+ i: i
+ };
+ });
+ }
+ voronoi.links = function(data) {
+ return d3_geom_voronoi(sites(data)).edges.filter(function(edge) {
+ return edge.l && edge.r;
+ }).map(function(edge) {
+ return {
+ source: data[edge.l.i],
+ target: data[edge.r.i]
+ };
+ });
+ };
+ voronoi.triangles = function(data) {
+ var triangles = [];
+ d3_geom_voronoi(sites(data)).cells.forEach(function(cell, i) {
+ var site = cell.site, edges = cell.edges.sort(d3_geom_voronoiHalfEdgeOrder), j = -1, m = edges.length, e0, s0, e1 = edges[m - 1].edge, s1 = e1.l === site ? e1.r : e1.l;
+ while (++j < m) {
+ e0 = e1;
+ s0 = s1;
+ e1 = edges[j].edge;
+ s1 = e1.l === site ? e1.r : e1.l;
+ if (i < s0.i && i < s1.i && d3_geom_voronoiTriangleArea(site, s0, s1) < 0) {
+ triangles.push([ data[i], data[s0.i], data[s1.i] ]);
+ }
+ }
+ });
+ return triangles;
+ };
+ voronoi.x = function(_) {
+ return arguments.length ? (fx = d3_functor(x = _), voronoi) : x;
+ };
+ voronoi.y = function(_) {
+ return arguments.length ? (fy = d3_functor(y = _), voronoi) : y;
+ };
+ voronoi.clipExtent = function(_) {
+ if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent;
+ clipExtent = _ == null ? d3_geom_voronoiClipExtent : _;
+ return voronoi;
+ };
+ voronoi.size = function(_) {
+ if (!arguments.length) return clipExtent === d3_geom_voronoiClipExtent ? null : clipExtent && clipExtent[1];
+ return voronoi.clipExtent(_ && [ [ 0, 0 ], _ ]);
+ };
+ return voronoi;
+ };
+ var d3_geom_voronoiClipExtent = [ [ -1e6, -1e6 ], [ 1e6, 1e6 ] ];
+ function d3_geom_voronoiTriangleArea(a, b, c) {
+ return (a.x - c.x) * (b.y - a.y) - (a.x - b.x) * (c.y - a.y);
+ }
+ d3.geom.delaunay = function(vertices) {
+ return d3.geom.voronoi().triangles(vertices);
+ };
+ d3.geom.quadtree = function(points, x1, y1, x2, y2) {
+ var x = d3_geom_pointX, y = d3_geom_pointY, compat;
+ if (compat = arguments.length) {
+ x = d3_geom_quadtreeCompatX;
+ y = d3_geom_quadtreeCompatY;
+ if (compat === 3) {
+ y2 = y1;
+ x2 = x1;
+ y1 = x1 = 0;
+ }
+ return quadtree(points);
+ }
+ function quadtree(data) {
+ var d, fx = d3_functor(x), fy = d3_functor(y), xs, ys, i, n, x1_, y1_, x2_, y2_;
+ if (x1 != null) {
+ x1_ = x1, y1_ = y1, x2_ = x2, y2_ = y2;
+ } else {
+ x2_ = y2_ = -(x1_ = y1_ = Infinity);
+ xs = [], ys = [];
+ n = data.length;
+ if (compat) for (i = 0; i < n; ++i) {
+ d = data[i];
+ if (d.x < x1_) x1_ = d.x;
+ if (d.y < y1_) y1_ = d.y;
+ if (d.x > x2_) x2_ = d.x;
+ if (d.y > y2_) y2_ = d.y;
+ xs.push(d.x);
+ ys.push(d.y);
+ } else for (i = 0; i < n; ++i) {
+ var x_ = +fx(d = data[i], i), y_ = +fy(d, i);
+ if (x_ < x1_) x1_ = x_;
+ if (y_ < y1_) y1_ = y_;
+ if (x_ > x2_) x2_ = x_;
+ if (y_ > y2_) y2_ = y_;
+ xs.push(x_);
+ ys.push(y_);
+ }
+ }
+ var dx = x2_ - x1_, dy = y2_ - y1_;
+ if (dx > dy) y2_ = y1_ + dx; else x2_ = x1_ + dy;
+ function insert(n, d, x, y, x1, y1, x2, y2) {
+ if (isNaN(x) || isNaN(y)) return;
+ if (n.leaf) {
+ var nx = n.x, ny = n.y;
+ if (nx != null) {
+ if (abs(nx - x) + abs(ny - y) < .01) {
+ insertChild(n, d, x, y, x1, y1, x2, y2);
+ } else {
+ var nPoint = n.point;
+ n.x = n.y = n.point = null;
+ insertChild(n, nPoint, nx, ny, x1, y1, x2, y2);
+ insertChild(n, d, x, y, x1, y1, x2, y2);
+ }
+ } else {
+ n.x = x, n.y = y, n.point = d;
+ }
+ } else {
+ insertChild(n, d, x, y, x1, y1, x2, y2);
+ }
+ }
+ function insertChild(n, d, x, y, x1, y1, x2, y2) {
+ var xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym, i = below << 1 | right;
+ n.leaf = false;
+ n = n.nodes[i] || (n.nodes[i] = d3_geom_quadtreeNode());
+ if (right) x1 = xm; else x2 = xm;
+ if (below) y1 = ym; else y2 = ym;
+ insert(n, d, x, y, x1, y1, x2, y2);
+ }
+ var root = d3_geom_quadtreeNode();
+ root.add = function(d) {
+ insert(root, d, +fx(d, ++i), +fy(d, i), x1_, y1_, x2_, y2_);
+ };
+ root.visit = function(f) {
+ d3_geom_quadtreeVisit(f, root, x1_, y1_, x2_, y2_);
+ };
+ root.find = function(point) {
+ return d3_geom_quadtreeFind(root, point[0], point[1], x1_, y1_, x2_, y2_);
+ };
+ i = -1;
+ if (x1 == null) {
+ while (++i < n) {
+ insert(root, data[i], xs[i], ys[i], x1_, y1_, x2_, y2_);
+ }
+ --i;
+ } else data.forEach(root.add);
+ xs = ys = data = d = null;
+ return root;
+ }
+ quadtree.x = function(_) {
+ return arguments.length ? (x = _, quadtree) : x;
+ };
+ quadtree.y = function(_) {
+ return arguments.length ? (y = _, quadtree) : y;
+ };
+ quadtree.extent = function(_) {
+ if (!arguments.length) return x1 == null ? null : [ [ x1, y1 ], [ x2, y2 ] ];
+ if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = +_[0][0], y1 = +_[0][1], x2 = +_[1][0],
+ y2 = +_[1][1];
+ return quadtree;
+ };
+ quadtree.size = function(_) {
+ if (!arguments.length) return x1 == null ? null : [ x2 - x1, y2 - y1 ];
+ if (_ == null) x1 = y1 = x2 = y2 = null; else x1 = y1 = 0, x2 = +_[0], y2 = +_[1];
+ return quadtree;
+ };
+ return quadtree;
+ };
+ function d3_geom_quadtreeCompatX(d) {
+ return d.x;
+ }
+ function d3_geom_quadtreeCompatY(d) {
+ return d.y;
+ }
+ function d3_geom_quadtreeNode() {
+ return {
+ leaf: true,
+ nodes: [],
+ point: null,
+ x: null,
+ y: null
+ };
+ }
+ function d3_geom_quadtreeVisit(f, node, x1, y1, x2, y2) {
+ if (!f(node, x1, y1, x2, y2)) {
+ var sx = (x1 + x2) * .5, sy = (y1 + y2) * .5, children = node.nodes;
+ if (children[0]) d3_geom_quadtreeVisit(f, children[0], x1, y1, sx, sy);
+ if (children[1]) d3_geom_quadtreeVisit(f, children[1], sx, y1, x2, sy);
+ if (children[2]) d3_geom_quadtreeVisit(f, children[2], x1, sy, sx, y2);
+ if (children[3]) d3_geom_quadtreeVisit(f, children[3], sx, sy, x2, y2);
+ }
+ }
+ function d3_geom_quadtreeFind(root, x, y, x0, y0, x3, y3) {
+ var minDistance2 = Infinity, closestPoint;
+ (function find(node, x1, y1, x2, y2) {
+ if (x1 > x3 || y1 > y3 || x2 < x0 || y2 < y0) return;
+ if (point = node.point) {
+ var point, dx = x - node.x, dy = y - node.y, distance2 = dx * dx + dy * dy;
+ if (distance2 < minDistance2) {
+ var distance = Math.sqrt(minDistance2 = distance2);
+ x0 = x - distance, y0 = y - distance;
+ x3 = x + distance, y3 = y + distance;
+ closestPoint = point;
+ }
+ }
+ var children = node.nodes, xm = (x1 + x2) * .5, ym = (y1 + y2) * .5, right = x >= xm, below = y >= ym;
+ for (var i = below << 1 | right, j = i + 4; i < j; ++i) {
+ if (node = children[i & 3]) switch (i & 3) {
+ case 0:
+ find(node, x1, y1, xm, ym);
+ break;
+
+ case 1:
+ find(node, xm, y1, x2, ym);
+ break;
+
+ case 2:
+ find(node, x1, ym, xm, y2);
+ break;
+
+ case 3:
+ find(node, xm, ym, x2, y2);
+ break;
+ }
+ }
+ })(root, x0, y0, x3, y3);
+ return closestPoint;
+ }
+ d3.interpolateRgb = d3_interpolateRgb;
+ function d3_interpolateRgb(a, b) {
+ a = d3.rgb(a);
+ b = d3.rgb(b);
+ var ar = a.r, ag = a.g, ab = a.b, br = b.r - ar, bg = b.g - ag, bb = b.b - ab;
+ return function(t) {
+ return "#" + d3_rgb_hex(Math.round(ar + br * t)) + d3_rgb_hex(Math.round(ag + bg * t)) + d3_rgb_hex(Math.round(ab + bb * t));
+ };
+ }
+ d3.interpolateObject = d3_interpolateObject;
+ function d3_interpolateObject(a, b) {
+ var i = {}, c = {}, k;
+ for (k in a) {
+ if (k in b) {
+ i[k] = d3_interpolate(a[k], b[k]);
+ } else {
+ c[k] = a[k];
+ }
+ }
+ for (k in b) {
+ if (!(k in a)) {
+ c[k] = b[k];
+ }
+ }
+ return function(t) {
+ for (k in i) c[k] = i[k](t);
+ return c;
+ };
+ }
+ d3.interpolateNumber = d3_interpolateNumber;
+ function d3_interpolateNumber(a, b) {
+ a = +a, b = +b;
+ return function(t) {
+ return a * (1 - t) + b * t;
+ };
+ }
+ d3.interpolateString = d3_interpolateString;
+ function d3_interpolateString(a, b) {
+ var bi = d3_interpolate_numberA.lastIndex = d3_interpolate_numberB.lastIndex = 0, am, bm, bs, i = -1, s = [], q = [];
+ a = a + "", b = b + "";
+ while ((am = d3_interpolate_numberA.exec(a)) && (bm = d3_interpolate_numberB.exec(b))) {
+ if ((bs = bm.index) > bi) {
+ bs = b.slice(bi, bs);
+ if (s[i]) s[i] += bs; else s[++i] = bs;
+ }
+ if ((am = am[0]) === (bm = bm[0])) {
+ if (s[i]) s[i] += bm; else s[++i] = bm;
+ } else {
+ s[++i] = null;
+ q.push({
+ i: i,
+ x: d3_interpolateNumber(am, bm)
+ });
+ }
+ bi = d3_interpolate_numberB.lastIndex;
+ }
+ if (bi < b.length) {
+ bs = b.slice(bi);
+ if (s[i]) s[i] += bs; else s[++i] = bs;
+ }
+ return s.length < 2 ? q[0] ? (b = q[0].x, function(t) {
+ return b(t) + "";
+ }) : function() {
+ return b;
+ } : (b = q.length, function(t) {
+ for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ });
+ }
+ var d3_interpolate_numberA = /[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g, d3_interpolate_numberB = new RegExp(d3_interpolate_numberA.source, "g");
+ d3.interpolate = d3_interpolate;
+ function d3_interpolate(a, b) {
+ var i = d3.interpolators.length, f;
+ while (--i >= 0 && !(f = d3.interpolators[i](a, b))) ;
+ return f;
+ }
+ d3.interpolators = [ function(a, b) {
+ var t = typeof b;
+ return (t === "string" ? d3_rgb_names.has(b) || /^(#|rgb\(|hsl\()/.test(b) ? d3_interpolateRgb : d3_interpolateString : b instanceof d3_color ? d3_interpolateRgb : Array.isArray(b) ? d3_interpolateArray : t === "object" && isNaN(b) ? d3_interpolateObject : d3_interpolateNumber)(a, b);
+ } ];
+ d3.interpolateArray = d3_interpolateArray;
+ function d3_interpolateArray(a, b) {
+ var x = [], c = [], na = a.length, nb = b.length, n0 = Math.min(a.length, b.length), i;
+ for (i = 0; i < n0; ++i) x.push(d3_interpolate(a[i], b[i]));
+ for (;i < na; ++i) c[i] = a[i];
+ for (;i < nb; ++i) c[i] = b[i];
+ return function(t) {
+ for (i = 0; i < n0; ++i) c[i] = x[i](t);
+ return c;
+ };
+ }
+ var d3_ease_default = function() {
+ return d3_identity;
+ };
+ var d3_ease = d3.map({
+ linear: d3_ease_default,
+ poly: d3_ease_poly,
+ quad: function() {
+ return d3_ease_quad;
+ },
+ cubic: function() {
+ return d3_ease_cubic;
+ },
+ sin: function() {
+ return d3_ease_sin;
+ },
+ exp: function() {
+ return d3_ease_exp;
+ },
+ circle: function() {
+ return d3_ease_circle;
+ },
+ elastic: d3_ease_elastic,
+ back: d3_ease_back,
+ bounce: function() {
+ return d3_ease_bounce;
+ }
+ });
+ var d3_ease_mode = d3.map({
+ "in": d3_identity,
+ out: d3_ease_reverse,
+ "in-out": d3_ease_reflect,
+ "out-in": function(f) {
+ return d3_ease_reflect(d3_ease_reverse(f));
+ }
+ });
+ d3.ease = function(name) {
+ var i = name.indexOf("-"), t = i >= 0 ? name.slice(0, i) : name, m = i >= 0 ? name.slice(i + 1) : "in";
+ t = d3_ease.get(t) || d3_ease_default;
+ m = d3_ease_mode.get(m) || d3_identity;
+ return d3_ease_clamp(m(t.apply(null, d3_arraySlice.call(arguments, 1))));
+ };
+ function d3_ease_clamp(f) {
+ return function(t) {
+ return t <= 0 ? 0 : t >= 1 ? 1 : f(t);
+ };
+ }
+ function d3_ease_reverse(f) {
+ return function(t) {
+ return 1 - f(1 - t);
+ };
+ }
+ function d3_ease_reflect(f) {
+ return function(t) {
+ return .5 * (t < .5 ? f(2 * t) : 2 - f(2 - 2 * t));
+ };
+ }
+ function d3_ease_quad(t) {
+ return t * t;
+ }
+ function d3_ease_cubic(t) {
+ return t * t * t;
+ }
+ function d3_ease_cubicInOut(t) {
+ if (t <= 0) return 0;
+ if (t >= 1) return 1;
+ var t2 = t * t, t3 = t2 * t;
+ return 4 * (t < .5 ? t3 : 3 * (t - t2) + t3 - .75);
+ }
+ function d3_ease_poly(e) {
+ return function(t) {
+ return Math.pow(t, e);
+ };
+ }
+ function d3_ease_sin(t) {
+ return 1 - Math.cos(t * halfπ);
+ }
+ function d3_ease_exp(t) {
+ return Math.pow(2, 10 * (t - 1));
+ }
+ function d3_ease_circle(t) {
+ return 1 - Math.sqrt(1 - t * t);
+ }
+ function d3_ease_elastic(a, p) {
+ var s;
+ if (arguments.length < 2) p = .45;
+ if (arguments.length) s = p / τ * Math.asin(1 / a); else a = 1, s = p / 4;
+ return function(t) {
+ return 1 + a * Math.pow(2, -10 * t) * Math.sin((t - s) * τ / p);
+ };
+ }
+ function d3_ease_back(s) {
+ if (!s) s = 1.70158;
+ return function(t) {
+ return t * t * ((s + 1) * t - s);
+ };
+ }
+ function d3_ease_bounce(t) {
+ return t < 1 / 2.75 ? 7.5625 * t * t : t < 2 / 2.75 ? 7.5625 * (t -= 1.5 / 2.75) * t + .75 : t < 2.5 / 2.75 ? 7.5625 * (t -= 2.25 / 2.75) * t + .9375 : 7.5625 * (t -= 2.625 / 2.75) * t + .984375;
+ }
+ d3.interpolateHcl = d3_interpolateHcl;
+ function d3_interpolateHcl(a, b) {
+ a = d3.hcl(a);
+ b = d3.hcl(b);
+ var ah = a.h, ac = a.c, al = a.l, bh = b.h - ah, bc = b.c - ac, bl = b.l - al;
+ if (isNaN(bc)) bc = 0, ac = isNaN(ac) ? b.c : ac;
+ if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
+ return function(t) {
+ return d3_hcl_lab(ah + bh * t, ac + bc * t, al + bl * t) + "";
+ };
+ }
+ d3.interpolateHsl = d3_interpolateHsl;
+ function d3_interpolateHsl(a, b) {
+ a = d3.hsl(a);
+ b = d3.hsl(b);
+ var ah = a.h, as = a.s, al = a.l, bh = b.h - ah, bs = b.s - as, bl = b.l - al;
+ if (isNaN(bs)) bs = 0, as = isNaN(as) ? b.s : as;
+ if (isNaN(bh)) bh = 0, ah = isNaN(ah) ? b.h : ah; else if (bh > 180) bh -= 360; else if (bh < -180) bh += 360;
+ return function(t) {
+ return d3_hsl_rgb(ah + bh * t, as + bs * t, al + bl * t) + "";
+ };
+ }
+ d3.interpolateLab = d3_interpolateLab;
+ function d3_interpolateLab(a, b) {
+ a = d3.lab(a);
+ b = d3.lab(b);
+ var al = a.l, aa = a.a, ab = a.b, bl = b.l - al, ba = b.a - aa, bb = b.b - ab;
+ return function(t) {
+ return d3_lab_rgb(al + bl * t, aa + ba * t, ab + bb * t) + "";
+ };
+ }
+ d3.interpolateRound = d3_interpolateRound;
+ function d3_interpolateRound(a, b) {
+ b -= a;
+ return function(t) {
+ return Math.round(a + b * t);
+ };
+ }
+ d3.transform = function(string) {
+ var g = d3_document.createElementNS(d3.ns.prefix.svg, "g");
+ return (d3.transform = function(string) {
+ if (string != null) {
+ g.setAttribute("transform", string);
+ var t = g.transform.baseVal.consolidate();
+ }
+ return new d3_transform(t ? t.matrix : d3_transformIdentity);
+ })(string);
+ };
+ function d3_transform(m) {
+ var r0 = [ m.a, m.b ], r1 = [ m.c, m.d ], kx = d3_transformNormalize(r0), kz = d3_transformDot(r0, r1), ky = d3_transformNormalize(d3_transformCombine(r1, r0, -kz)) || 0;
+ if (r0[0] * r1[1] < r1[0] * r0[1]) {
+ r0[0] *= -1;
+ r0[1] *= -1;
+ kx *= -1;
+ kz *= -1;
+ }
+ this.rotate = (kx ? Math.atan2(r0[1], r0[0]) : Math.atan2(-r1[0], r1[1])) * d3_degrees;
+ this.translate = [ m.e, m.f ];
+ this.scale = [ kx, ky ];
+ this.skew = ky ? Math.atan2(kz, ky) * d3_degrees : 0;
+ }
+ d3_transform.prototype.toString = function() {
+ return "translate(" + this.translate + ")rotate(" + this.rotate + ")skewX(" + this.skew + ")scale(" + this.scale + ")";
+ };
+ function d3_transformDot(a, b) {
+ return a[0] * b[0] + a[1] * b[1];
+ }
+ function d3_transformNormalize(a) {
+ var k = Math.sqrt(d3_transformDot(a, a));
+ if (k) {
+ a[0] /= k;
+ a[1] /= k;
+ }
+ return k;
+ }
+ function d3_transformCombine(a, b, k) {
+ a[0] += k * b[0];
+ a[1] += k * b[1];
+ return a;
+ }
+ var d3_transformIdentity = {
+ a: 1,
+ b: 0,
+ c: 0,
+ d: 1,
+ e: 0,
+ f: 0
+ };
+ d3.interpolateTransform = d3_interpolateTransform;
+ function d3_interpolateTransform(a, b) {
+ var s = [], q = [], n, A = d3.transform(a), B = d3.transform(b), ta = A.translate, tb = B.translate, ra = A.rotate, rb = B.rotate, wa = A.skew, wb = B.skew, ka = A.scale, kb = B.scale;
+ if (ta[0] != tb[0] || ta[1] != tb[1]) {
+ s.push("translate(", null, ",", null, ")");
+ q.push({
+ i: 1,
+ x: d3_interpolateNumber(ta[0], tb[0])
+ }, {
+ i: 3,
+ x: d3_interpolateNumber(ta[1], tb[1])
+ });
+ } else if (tb[0] || tb[1]) {
+ s.push("translate(" + tb + ")");
+ } else {
+ s.push("");
+ }
+ if (ra != rb) {
+ if (ra - rb > 180) rb += 360; else if (rb - ra > 180) ra += 360;
+ q.push({
+ i: s.push(s.pop() + "rotate(", null, ")") - 2,
+ x: d3_interpolateNumber(ra, rb)
+ });
+ } else if (rb) {
+ s.push(s.pop() + "rotate(" + rb + ")");
+ }
+ if (wa != wb) {
+ q.push({
+ i: s.push(s.pop() + "skewX(", null, ")") - 2,
+ x: d3_interpolateNumber(wa, wb)
+ });
+ } else if (wb) {
+ s.push(s.pop() + "skewX(" + wb + ")");
+ }
+ if (ka[0] != kb[0] || ka[1] != kb[1]) {
+ n = s.push(s.pop() + "scale(", null, ",", null, ")");
+ q.push({
+ i: n - 4,
+ x: d3_interpolateNumber(ka[0], kb[0])
+ }, {
+ i: n - 2,
+ x: d3_interpolateNumber(ka[1], kb[1])
+ });
+ } else if (kb[0] != 1 || kb[1] != 1) {
+ s.push(s.pop() + "scale(" + kb + ")");
+ }
+ n = q.length;
+ return function(t) {
+ var i = -1, o;
+ while (++i < n) s[(o = q[i]).i] = o.x(t);
+ return s.join("");
+ };
+ }
+ function d3_uninterpolateNumber(a, b) {
+ b = (b -= a = +a) || 1 / b;
+ return function(x) {
+ return (x - a) / b;
+ };
+ }
+ function d3_uninterpolateClamp(a, b) {
+ b = (b -= a = +a) || 1 / b;
+ return function(x) {
+ return Math.max(0, Math.min(1, (x - a) / b));
+ };
+ }
+ d3.layout = {};
+ d3.layout.bundle = function() {
+ return function(links) {
+ var paths = [], i = -1, n = links.length;
+ while (++i < n) paths.push(d3_layout_bundlePath(links[i]));
+ return paths;
+ };
+ };
+ function d3_layout_bundlePath(link) {
+ var start = link.source, end = link.target, lca = d3_layout_bundleLeastCommonAncestor(start, end), points = [ start ];
+ while (start !== lca) {
+ start = start.parent;
+ points.push(start);
+ }
+ var k = points.length;
+ while (end !== lca) {
+ points.splice(k, 0, end);
+ end = end.parent;
+ }
+ return points;
+ }
+ function d3_layout_bundleAncestors(node) {
+ var ancestors = [], parent = node.parent;
+ while (parent != null) {
+ ancestors.push(node);
+ node = parent;
+ parent = parent.parent;
+ }
+ ancestors.push(node);
+ return ancestors;
+ }
+ function d3_layout_bundleLeastCommonAncestor(a, b) {
+ if (a === b) return a;
+ var aNodes = d3_layout_bundleAncestors(a), bNodes = d3_layout_bundleAncestors(b), aNode = aNodes.pop(), bNode = bNodes.pop(), sharedNode = null;
+ while (aNode === bNode) {
+ sharedNode = aNode;
+ aNode = aNodes.pop();
+ bNode = bNodes.pop();
+ }
+ return sharedNode;
+ }
+ d3.layout.chord = function() {
+ var chord = {}, chords, groups, matrix, n, padding = 0, sortGroups, sortSubgroups, sortChords;
+ function relayout() {
+ var subgroups = {}, groupSums = [], groupIndex = d3.range(n), subgroupIndex = [], k, x, x0, i, j;
+ chords = [];
+ groups = [];
+ k = 0, i = -1;
+ while (++i < n) {
+ x = 0, j = -1;
+ while (++j < n) {
+ x += matrix[i][j];
+ }
+ groupSums.push(x);
+ subgroupIndex.push(d3.range(n));
+ k += x;
+ }
+ if (sortGroups) {
+ groupIndex.sort(function(a, b) {
+ return sortGroups(groupSums[a], groupSums[b]);
+ });
+ }
+ if (sortSubgroups) {
+ subgroupIndex.forEach(function(d, i) {
+ d.sort(function(a, b) {
+ return sortSubgroups(matrix[i][a], matrix[i][b]);
+ });
+ });
+ }
+ k = (τ - padding * n) / k;
+ x = 0, i = -1;
+ while (++i < n) {
+ x0 = x, j = -1;
+ while (++j < n) {
+ var di = groupIndex[i], dj = subgroupIndex[di][j], v = matrix[di][dj], a0 = x, a1 = x += v * k;
+ subgroups[di + "-" + dj] = {
+ index: di,
+ subindex: dj,
+ startAngle: a0,
+ endAngle: a1,
+ value: v
+ };
+ }
+ groups[di] = {
+ index: di,
+ startAngle: x0,
+ endAngle: x,
+ value: (x - x0) / k
+ };
+ x += padding;
+ }
+ i = -1;
+ while (++i < n) {
+ j = i - 1;
+ while (++j < n) {
+ var source = subgroups[i + "-" + j], target = subgroups[j + "-" + i];
+ if (source.value || target.value) {
+ chords.push(source.value < target.value ? {
+ source: target,
+ target: source
+ } : {
+ source: source,
+ target: target
+ });
+ }
+ }
+ }
+ if (sortChords) resort();
+ }
+ function resort() {
+ chords.sort(function(a, b) {
+ return sortChords((a.source.value + a.target.value) / 2, (b.source.value + b.target.value) / 2);
+ });
+ }
+ chord.matrix = function(x) {
+ if (!arguments.length) return matrix;
+ n = (matrix = x) && matrix.length;
+ chords = groups = null;
+ return chord;
+ };
+ chord.padding = function(x) {
+ if (!arguments.length) return padding;
+ padding = x;
+ chords = groups = null;
+ return chord;
+ };
+ chord.sortGroups = function(x) {
+ if (!arguments.length) return sortGroups;
+ sortGroups = x;
+ chords = groups = null;
+ return chord;
+ };
+ chord.sortSubgroups = function(x) {
+ if (!arguments.length) return sortSubgroups;
+ sortSubgroups = x;
+ chords = null;
+ return chord;
+ };
+ chord.sortChords = function(x) {
+ if (!arguments.length) return sortChords;
+ sortChords = x;
+ if (chords) resort();
+ return chord;
+ };
+ chord.chords = function() {
+ if (!chords) relayout();
+ return chords;
+ };
+ chord.groups = function() {
+ if (!groups) relayout();
+ return groups;
+ };
+ return chord;
+ };
+ d3.layout.force = function() {
+ var force = {}, event = d3.dispatch("start", "tick", "end"), size = [ 1, 1 ], drag, alpha, friction = .9, linkDistance = d3_layout_forceLinkDistance, linkStrength = d3_layout_forceLinkStrength, charge = -30, chargeDistance2 = d3_layout_forceChargeDistance2, gravity = .1, theta2 = .64, nodes = [], links = [], distances, strengths, charges;
+ function repulse(node) {
+ return function(quad, x1, _, x2) {
+ if (quad.point !== node) {
+ var dx = quad.cx - node.x, dy = quad.cy - node.y, dw = x2 - x1, dn = dx * dx + dy * dy;
+ if (dw * dw / theta2 < dn) {
+ if (dn < chargeDistance2) {
+ var k = quad.charge / dn;
+ node.px -= dx * k;
+ node.py -= dy * k;
+ }
+ return true;
+ }
+ if (quad.point && dn && dn < chargeDistance2) {
+ var k = quad.pointCharge / dn;
+ node.px -= dx * k;
+ node.py -= dy * k;
+ }
+ }
+ return !quad.charge;
+ };
+ }
+ force.tick = function() {
+ if ((alpha *= .99) < .005) {
+ event.end({
+ type: "end",
+ alpha: alpha = 0
+ });
+ return true;
+ }
+ var n = nodes.length, m = links.length, q, i, o, s, t, l, k, x, y;
+ for (i = 0; i < m; ++i) {
+ o = links[i];
+ s = o.source;
+ t = o.target;
+ x = t.x - s.x;
+ y = t.y - s.y;
+ if (l = x * x + y * y) {
+ l = alpha * strengths[i] * ((l = Math.sqrt(l)) - distances[i]) / l;
+ x *= l;
+ y *= l;
+ t.x -= x * (k = s.weight / (t.weight + s.weight));
+ t.y -= y * k;
+ s.x += x * (k = 1 - k);
+ s.y += y * k;
+ }
+ }
+ if (k = alpha * gravity) {
+ x = size[0] / 2;
+ y = size[1] / 2;
+ i = -1;
+ if (k) while (++i < n) {
+ o = nodes[i];
+ o.x += (x - o.x) * k;
+ o.y += (y - o.y) * k;
+ }
+ }
+ if (charge) {
+ d3_layout_forceAccumulate(q = d3.geom.quadtree(nodes), alpha, charges);
+ i = -1;
+ while (++i < n) {
+ if (!(o = nodes[i]).fixed) {
+ q.visit(repulse(o));
+ }
+ }
+ }
+ i = -1;
+ while (++i < n) {
+ o = nodes[i];
+ if (o.fixed) {
+ o.x = o.px;
+ o.y = o.py;
+ } else {
+ o.x -= (o.px - (o.px = o.x)) * friction;
+ o.y -= (o.py - (o.py = o.y)) * friction;
+ }
+ }
+ event.tick({
+ type: "tick",
+ alpha: alpha
+ });
+ };
+ force.nodes = function(x) {
+ if (!arguments.length) return nodes;
+ nodes = x;
+ return force;
+ };
+ force.links = function(x) {
+ if (!arguments.length) return links;
+ links = x;
+ return force;
+ };
+ force.size = function(x) {
+ if (!arguments.length) return size;
+ size = x;
+ return force;
+ };
+ force.linkDistance = function(x) {
+ if (!arguments.length) return linkDistance;
+ linkDistance = typeof x === "function" ? x : +x;
+ return force;
+ };
+ force.distance = force.linkDistance;
+ force.linkStrength = function(x) {
+ if (!arguments.length) return linkStrength;
+ linkStrength = typeof x === "function" ? x : +x;
+ return force;
+ };
+ force.friction = function(x) {
+ if (!arguments.length) return friction;
+ friction = +x;
+ return force;
+ };
+ force.charge = function(x) {
+ if (!arguments.length) return charge;
+ charge = typeof x === "function" ? x : +x;
+ return force;
+ };
+ force.chargeDistance = function(x) {
+ if (!arguments.length) return Math.sqrt(chargeDistance2);
+ chargeDistance2 = x * x;
+ return force;
+ };
+ force.gravity = function(x) {
+ if (!arguments.length) return gravity;
+ gravity = +x;
+ return force;
+ };
+ force.theta = function(x) {
+ if (!arguments.length) return Math.sqrt(theta2);
+ theta2 = x * x;
+ return force;
+ };
+ force.alpha = function(x) {
+ if (!arguments.length) return alpha;
+ x = +x;
+ if (alpha) {
+ if (x > 0) alpha = x; else alpha = 0;
+ } else if (x > 0) {
+ event.start({
+ type: "start",
+ alpha: alpha = x
+ });
+ d3.timer(force.tick);
+ }
+ return force;
+ };
+ force.start = function() {
+ var i, n = nodes.length, m = links.length, w = size[0], h = size[1], neighbors, o;
+ for (i = 0; i < n; ++i) {
+ (o = nodes[i]).index = i;
+ o.weight = 0;
+ }
+ for (i = 0; i < m; ++i) {
+ o = links[i];
+ if (typeof o.source == "number") o.source = nodes[o.source];
+ if (typeof o.target == "number") o.target = nodes[o.target];
+ ++o.source.weight;
+ ++o.target.weight;
+ }
+ for (i = 0; i < n; ++i) {
+ o = nodes[i];
+ if (isNaN(o.x)) o.x = position("x", w);
+ if (isNaN(o.y)) o.y = position("y", h);
+ if (isNaN(o.px)) o.px = o.x;
+ if (isNaN(o.py)) o.py = o.y;
+ }
+ distances = [];
+ if (typeof linkDistance === "function") for (i = 0; i < m; ++i) distances[i] = +linkDistance.call(this, links[i], i); else for (i = 0; i < m; ++i) distances[i] = linkDistance;
+ strengths = [];
+ if (typeof linkStrength === "function") for (i = 0; i < m; ++i) strengths[i] = +linkStrength.call(this, links[i], i); else for (i = 0; i < m; ++i) strengths[i] = linkStrength;
+ charges = [];
+ if (typeof charge === "function") for (i = 0; i < n; ++i) charges[i] = +charge.call(this, nodes[i], i); else for (i = 0; i < n; ++i) charges[i] = charge;
+ function position(dimension, size) {
+ if (!neighbors) {
+ neighbors = new Array(n);
+ for (j = 0; j < n; ++j) {
+ neighbors[j] = [];
+ }
+ for (j = 0; j < m; ++j) {
+ var o = links[j];
+ neighbors[o.source.index].push(o.target);
+ neighbors[o.target.index].push(o.source);
+ }
+ }
+ var candidates = neighbors[i], j = -1, l = candidates.length, x;
+ while (++j < l) if (!isNaN(x = candidates[j][dimension])) return x;
+ return Math.random() * size;
+ }
+ return force.resume();
+ };
+ force.resume = function() {
+ return force.alpha(.1);
+ };
+ force.stop = function() {
+ return force.alpha(0);
+ };
+ force.drag = function() {
+ if (!drag) drag = d3.behavior.drag().origin(d3_identity).on("dragstart.force", d3_layout_forceDragstart).on("drag.force", dragmove).on("dragend.force", d3_layout_forceDragend);
+ if (!arguments.length) return drag;
+ this.on("mouseover.force", d3_layout_forceMouseover).on("mouseout.force", d3_layout_forceMouseout).call(drag);
+ };
+ function dragmove(d) {
+ d.px = d3.event.x, d.py = d3.event.y;
+ force.resume();
+ }
+ return d3.rebind(force, event, "on");
+ };
+ function d3_layout_forceDragstart(d) {
+ d.fixed |= 2;
+ }
+ function d3_layout_forceDragend(d) {
+ d.fixed &= ~6;
+ }
+ function d3_layout_forceMouseover(d) {
+ d.fixed |= 4;
+ d.px = d.x, d.py = d.y;
+ }
+ function d3_layout_forceMouseout(d) {
+ d.fixed &= ~4;
+ }
+ function d3_layout_forceAccumulate(quad, alpha, charges) {
+ var cx = 0, cy = 0;
+ quad.charge = 0;
+ if (!quad.leaf) {
+ var nodes = quad.nodes, n = nodes.length, i = -1, c;
+ while (++i < n) {
+ c = nodes[i];
+ if (c == null) continue;
+ d3_layout_forceAccumulate(c, alpha, charges);
+ quad.charge += c.charge;
+ cx += c.charge * c.cx;
+ cy += c.charge * c.cy;
+ }
+ }
+ if (quad.point) {
+ if (!quad.leaf) {
+ quad.point.x += Math.random() - .5;
+ quad.point.y += Math.random() - .5;
+ }
+ var k = alpha * charges[quad.point.index];
+ quad.charge += quad.pointCharge = k;
+ cx += k * quad.point.x;
+ cy += k * quad.point.y;
+ }
+ quad.cx = cx / quad.charge;
+ quad.cy = cy / quad.charge;
+ }
+ var d3_layout_forceLinkDistance = 20, d3_layout_forceLinkStrength = 1, d3_layout_forceChargeDistance2 = Infinity;
+ d3.layout.hierarchy = function() {
+ var sort = d3_layout_hierarchySort, children = d3_layout_hierarchyChildren, value = d3_layout_hierarchyValue;
+ function hierarchy(root) {
+ var stack = [ root ], nodes = [], node;
+ root.depth = 0;
+ while ((node = stack.pop()) != null) {
+ nodes.push(node);
+ if ((childs = children.call(hierarchy, node, node.depth)) && (n = childs.length)) {
+ var n, childs, child;
+ while (--n >= 0) {
+ stack.push(child = childs[n]);
+ child.parent = node;
+ child.depth = node.depth + 1;
+ }
+ if (value) node.value = 0;
+ node.children = childs;
+ } else {
+ if (value) node.value = +value.call(hierarchy, node, node.depth) || 0;
+ delete node.children;
+ }
+ }
+ d3_layout_hierarchyVisitAfter(root, function(node) {
+ var childs, parent;
+ if (sort && (childs = node.children)) childs.sort(sort);
+ if (value && (parent = node.parent)) parent.value += node.value;
+ });
+ return nodes;
+ }
+ hierarchy.sort = function(x) {
+ if (!arguments.length) return sort;
+ sort = x;
+ return hierarchy;
+ };
+ hierarchy.children = function(x) {
+ if (!arguments.length) return children;
+ children = x;
+ return hierarchy;
+ };
+ hierarchy.value = function(x) {
+ if (!arguments.length) return value;
+ value = x;
+ return hierarchy;
+ };
+ hierarchy.revalue = function(root) {
+ if (value) {
+ d3_layout_hierarchyVisitBefore(root, function(node) {
+ if (node.children) node.value = 0;
+ });
+ d3_layout_hierarchyVisitAfter(root, function(node) {
+ var parent;
+ if (!node.children) node.value = +value.call(hierarchy, node, node.depth) || 0;
+ if (parent = node.parent) parent.value += node.value;
+ });
+ }
+ return root;
+ };
+ return hierarchy;
+ };
+ function d3_layout_hierarchyRebind(object, hierarchy) {
+ d3.rebind(object, hierarchy, "sort", "children", "value");
+ object.nodes = object;
+ object.links = d3_layout_hierarchyLinks;
+ return object;
+ }
+ function d3_layout_hierarchyVisitBefore(node, callback) {
+ var nodes = [ node ];
+ while ((node = nodes.pop()) != null) {
+ callback(node);
+ if ((children = node.children) && (n = children.length)) {
+ var n, children;
+ while (--n >= 0) nodes.push(children[n]);
+ }
+ }
+ }
+ function d3_layout_hierarchyVisitAfter(node, callback) {
+ var nodes = [ node ], nodes2 = [];
+ while ((node = nodes.pop()) != null) {
+ nodes2.push(node);
+ if ((children = node.children) && (n = children.length)) {
+ var i = -1, n, children;
+ while (++i < n) nodes.push(children[i]);
+ }
+ }
+ while ((node = nodes2.pop()) != null) {
+ callback(node);
+ }
+ }
+ function d3_layout_hierarchyChildren(d) {
+ return d.children;
+ }
+ function d3_layout_hierarchyValue(d) {
+ return d.value;
+ }
+ function d3_layout_hierarchySort(a, b) {
+ return b.value - a.value;
+ }
+ function d3_layout_hierarchyLinks(nodes) {
+ return d3.merge(nodes.map(function(parent) {
+ return (parent.children || []).map(function(child) {
+ return {
+ source: parent,
+ target: child
+ };
+ });
+ }));
+ }
+ d3.layout.partition = function() {
+ var hierarchy = d3.layout.hierarchy(), size = [ 1, 1 ];
+ function position(node, x, dx, dy) {
+ var children = node.children;
+ node.x = x;
+ node.y = node.depth * dy;
+ node.dx = dx;
+ node.dy = dy;
+ if (children && (n = children.length)) {
+ var i = -1, n, c, d;
+ dx = node.value ? dx / node.value : 0;
+ while (++i < n) {
+ position(c = children[i], x, d = c.value * dx, dy);
+ x += d;
+ }
+ }
+ }
+ function depth(node) {
+ var children = node.children, d = 0;
+ if (children && (n = children.length)) {
+ var i = -1, n;
+ while (++i < n) d = Math.max(d, depth(children[i]));
+ }
+ return 1 + d;
+ }
+ function partition(d, i) {
+ var nodes = hierarchy.call(this, d, i);
+ position(nodes[0], 0, size[0], size[1] / depth(nodes[0]));
+ return nodes;
+ }
+ partition.size = function(x) {
+ if (!arguments.length) return size;
+ size = x;
+ return partition;
+ };
+ return d3_layout_hierarchyRebind(partition, hierarchy);
+ };
+ d3.layout.pie = function() {
+ var value = Number, sort = d3_layout_pieSortByValue, startAngle = 0, endAngle = τ, padAngle = 0;
+ function pie(data) {
+ var n = data.length, values = data.map(function(d, i) {
+ return +value.call(pie, d, i);
+ }), a = +(typeof startAngle === "function" ? startAngle.apply(this, arguments) : startAngle), da = (typeof endAngle === "function" ? endAngle.apply(this, arguments) : endAngle) - a, p = Math.min(Math.abs(da) / n, +(typeof padAngle === "function" ? padAngle.apply(this, arguments) : padAngle)), pa = p * (da < 0 ? -1 : 1), k = (da - n * pa) / d3.sum(values), index = d3.range(n), arcs = [], v;
+ if (sort != null) index.sort(sort === d3_layout_pieSortByValue ? function(i, j) {
+ return values[j] - values[i];
+ } : function(i, j) {
+ return sort(data[i], data[j]);
+ });
+ index.forEach(function(i) {
+ arcs[i] = {
+ data: data[i],
+ value: v = values[i],
+ startAngle: a,
+ endAngle: a += v * k + pa,
+ padAngle: p
+ };
+ });
+ return arcs;
+ }
+ pie.value = function(_) {
+ if (!arguments.length) return value;
+ value = _;
+ return pie;
+ };
+ pie.sort = function(_) {
+ if (!arguments.length) return sort;
+ sort = _;
+ return pie;
+ };
+ pie.startAngle = function(_) {
+ if (!arguments.length) return startAngle;
+ startAngle = _;
+ return pie;
+ };
+ pie.endAngle = function(_) {
+ if (!arguments.length) return endAngle;
+ endAngle = _;
+ return pie;
+ };
+ pie.padAngle = function(_) {
+ if (!arguments.length) return padAngle;
+ padAngle = _;
+ return pie;
+ };
+ return pie;
+ };
+ var d3_layout_pieSortByValue = {};
+ d3.layout.stack = function() {
+ var values = d3_identity, order = d3_layout_stackOrderDefault, offset = d3_layout_stackOffsetZero, out = d3_layout_stackOut, x = d3_layout_stackX, y = d3_layout_stackY;
+ function stack(data, index) {
+ if (!(n = data.length)) return data;
+ var series = data.map(function(d, i) {
+ return values.call(stack, d, i);
+ });
+ var points = series.map(function(d) {
+ return d.map(function(v, i) {
+ return [ x.call(stack, v, i), y.call(stack, v, i) ];
+ });
+ });
+ var orders = order.call(stack, points, index);
+ series = d3.permute(series, orders);
+ points = d3.permute(points, orders);
+ var offsets = offset.call(stack, points, index);
+ var m = series[0].length, n, i, j, o;
+ for (j = 0; j < m; ++j) {
+ out.call(stack, series[0][j], o = offsets[j], points[0][j][1]);
+ for (i = 1; i < n; ++i) {
+ out.call(stack, series[i][j], o += points[i - 1][j][1], points[i][j][1]);
+ }
+ }
+ return data;
+ }
+ stack.values = function(x) {
+ if (!arguments.length) return values;
+ values = x;
+ return stack;
+ };
+ stack.order = function(x) {
+ if (!arguments.length) return order;
+ order = typeof x === "function" ? x : d3_layout_stackOrders.get(x) || d3_layout_stackOrderDefault;
+ return stack;
+ };
+ stack.offset = function(x) {
+ if (!arguments.length) return offset;
+ offset = typeof x === "function" ? x : d3_layout_stackOffsets.get(x) || d3_layout_stackOffsetZero;
+ return stack;
+ };
+ stack.x = function(z) {
+ if (!arguments.length) return x;
+ x = z;
+ return stack;
+ };
+ stack.y = function(z) {
+ if (!arguments.length) return y;
+ y = z;
+ return stack;
+ };
+ stack.out = function(z) {
+ if (!arguments.length) return out;
+ out = z;
+ return stack;
+ };
+ return stack;
+ };
+ function d3_layout_stackX(d) {
+ return d.x;
+ }
+ function d3_layout_stackY(d) {
+ return d.y;
+ }
+ function d3_layout_stackOut(d, y0, y) {
+ d.y0 = y0;
+ d.y = y;
+ }
+ var d3_layout_stackOrders = d3.map({
+ "inside-out": function(data) {
+ var n = data.length, i, j, max = data.map(d3_layout_stackMaxIndex), sums = data.map(d3_layout_stackReduceSum), index = d3.range(n).sort(function(a, b) {
+ return max[a] - max[b];
+ }), top = 0, bottom = 0, tops = [], bottoms = [];
+ for (i = 0; i < n; ++i) {
+ j = index[i];
+ if (top < bottom) {
+ top += sums[j];
+ tops.push(j);
+ } else {
+ bottom += sums[j];
+ bottoms.push(j);
+ }
+ }
+ return bottoms.reverse().concat(tops);
+ },
+ reverse: function(data) {
+ return d3.range(data.length).reverse();
+ },
+ "default": d3_layout_stackOrderDefault
+ });
+ var d3_layout_stackOffsets = d3.map({
+ silhouette: function(data) {
+ var n = data.length, m = data[0].length, sums = [], max = 0, i, j, o, y0 = [];
+ for (j = 0; j < m; ++j) {
+ for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
+ if (o > max) max = o;
+ sums.push(o);
+ }
+ for (j = 0; j < m; ++j) {
+ y0[j] = (max - sums[j]) / 2;
+ }
+ return y0;
+ },
+ wiggle: function(data) {
+ var n = data.length, x = data[0], m = x.length, i, j, k, s1, s2, s3, dx, o, o0, y0 = [];
+ y0[0] = o = o0 = 0;
+ for (j = 1; j < m; ++j) {
+ for (i = 0, s1 = 0; i < n; ++i) s1 += data[i][j][1];
+ for (i = 0, s2 = 0, dx = x[j][0] - x[j - 1][0]; i < n; ++i) {
+ for (k = 0, s3 = (data[i][j][1] - data[i][j - 1][1]) / (2 * dx); k < i; ++k) {
+ s3 += (data[k][j][1] - data[k][j - 1][1]) / dx;
+ }
+ s2 += s3 * data[i][j][1];
+ }
+ y0[j] = o -= s1 ? s2 / s1 * dx : 0;
+ if (o < o0) o0 = o;
+ }
+ for (j = 0; j < m; ++j) y0[j] -= o0;
+ return y0;
+ },
+ expand: function(data) {
+ var n = data.length, m = data[0].length, k = 1 / n, i, j, o, y0 = [];
+ for (j = 0; j < m; ++j) {
+ for (i = 0, o = 0; i < n; i++) o += data[i][j][1];
+ if (o) for (i = 0; i < n; i++) data[i][j][1] /= o; else for (i = 0; i < n; i++) data[i][j][1] = k;
+ }
+ for (j = 0; j < m; ++j) y0[j] = 0;
+ return y0;
+ },
+ zero: d3_layout_stackOffsetZero
+ });
+ function d3_layout_stackOrderDefault(data) {
+ return d3.range(data.length);
+ }
+ function d3_layout_stackOffsetZero(data) {
+ var j = -1, m = data[0].length, y0 = [];
+ while (++j < m) y0[j] = 0;
+ return y0;
+ }
+ function d3_layout_stackMaxIndex(array) {
+ var i = 1, j = 0, v = array[0][1], k, n = array.length;
+ for (;i < n; ++i) {
+ if ((k = array[i][1]) > v) {
+ j = i;
+ v = k;
+ }
+ }
+ return j;
+ }
+ function d3_layout_stackReduceSum(d) {
+ return d.reduce(d3_layout_stackSum, 0);
+ }
+ function d3_layout_stackSum(p, d) {
+ return p + d[1];
+ }
+ d3.layout.histogram = function() {
+ var frequency = true, valuer = Number, ranger = d3_layout_histogramRange, binner = d3_layout_histogramBinSturges;
+ function histogram(data, i) {
+ var bins = [], values = data.map(valuer, this), range = ranger.call(this, values, i), thresholds = binner.call(this, range, values, i), bin, i = -1, n = values.length, m = thresholds.length - 1, k = frequency ? 1 : 1 / n, x;
+ while (++i < m) {
+ bin = bins[i] = [];
+ bin.dx = thresholds[i + 1] - (bin.x = thresholds[i]);
+ bin.y = 0;
+ }
+ if (m > 0) {
+ i = -1;
+ while (++i < n) {
+ x = values[i];
+ if (x >= range[0] && x <= range[1]) {
+ bin = bins[d3.bisect(thresholds, x, 1, m) - 1];
+ bin.y += k;
+ bin.push(data[i]);
+ }
+ }
+ }
+ return bins;
+ }
+ histogram.value = function(x) {
+ if (!arguments.length) return valuer;
+ valuer = x;
+ return histogram;
+ };
+ histogram.range = function(x) {
+ if (!arguments.length) return ranger;
+ ranger = d3_functor(x);
+ return histogram;
+ };
+ histogram.bins = function(x) {
+ if (!arguments.length) return binner;
+ binner = typeof x === "number" ? function(range) {
+ return d3_layout_histogramBinFixed(range, x);
+ } : d3_functor(x);
+ return histogram;
+ };
+ histogram.frequency = function(x) {
+ if (!arguments.length) return frequency;
+ frequency = !!x;
+ return histogram;
+ };
+ return histogram;
+ };
+ function d3_layout_histogramBinSturges(range, values) {
+ return d3_layout_histogramBinFixed(range, Math.ceil(Math.log(values.length) / Math.LN2 + 1));
+ }
+ function d3_layout_histogramBinFixed(range, n) {
+ var x = -1, b = +range[0], m = (range[1] - b) / n, f = [];
+ while (++x <= n) f[x] = m * x + b;
+ return f;
+ }
+ function d3_layout_histogramRange(values) {
+ return [ d3.min(values), d3.max(values) ];
+ }
+ d3.layout.pack = function() {
+ var hierarchy = d3.layout.hierarchy().sort(d3_layout_packSort), padding = 0, size = [ 1, 1 ], radius;
+ function pack(d, i) {
+ var nodes = hierarchy.call(this, d, i), root = nodes[0], w = size[0], h = size[1], r = radius == null ? Math.sqrt : typeof radius === "function" ? radius : function() {
+ return radius;
+ };
+ root.x = root.y = 0;
+ d3_layout_hierarchyVisitAfter(root, function(d) {
+ d.r = +r(d.value);
+ });
+ d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
+ if (padding) {
+ var dr = padding * (radius ? 1 : Math.max(2 * root.r / w, 2 * root.r / h)) / 2;
+ d3_layout_hierarchyVisitAfter(root, function(d) {
+ d.r += dr;
+ });
+ d3_layout_hierarchyVisitAfter(root, d3_layout_packSiblings);
+ d3_layout_hierarchyVisitAfter(root, function(d) {
+ d.r -= dr;
+ });
+ }
+ d3_layout_packTransform(root, w / 2, h / 2, radius ? 1 : 1 / Math.max(2 * root.r / w, 2 * root.r / h));
+ return nodes;
+ }
+ pack.size = function(_) {
+ if (!arguments.length) return size;
+ size = _;
+ return pack;
+ };
+ pack.radius = function(_) {
+ if (!arguments.length) return radius;
+ radius = _ == null || typeof _ === "function" ? _ : +_;
+ return pack;
+ };
+ pack.padding = function(_) {
+ if (!arguments.length) return padding;
+ padding = +_;
+ return pack;
+ };
+ return d3_layout_hierarchyRebind(pack, hierarchy);
+ };
+ function d3_layout_packSort(a, b) {
+ return a.value - b.value;
+ }
+ function d3_layout_packInsert(a, b) {
+ var c = a._pack_next;
+ a._pack_next = b;
+ b._pack_prev = a;
+ b._pack_next = c;
+ c._pack_prev = b;
+ }
+ function d3_layout_packSplice(a, b) {
+ a._pack_next = b;
+ b._pack_prev = a;
+ }
+ function d3_layout_packIntersects(a, b) {
+ var dx = b.x - a.x, dy = b.y - a.y, dr = a.r + b.r;
+ return .999 * dr * dr > dx * dx + dy * dy;
+ }
+ function d3_layout_packSiblings(node) {
+ if (!(nodes = node.children) || !(n = nodes.length)) return;
+ var nodes, xMin = Infinity, xMax = -Infinity, yMin = Infinity, yMax = -Infinity, a, b, c, i, j, k, n;
+ function bound(node) {
+ xMin = Math.min(node.x - node.r, xMin);
+ xMax = Math.max(node.x + node.r, xMax);
+ yMin = Math.min(node.y - node.r, yMin);
+ yMax = Math.max(node.y + node.r, yMax);
+ }
+ nodes.forEach(d3_layout_packLink);
+ a = nodes[0];
+ a.x = -a.r;
+ a.y = 0;
+ bound(a);
+ if (n > 1) {
+ b = nodes[1];
+ b.x = b.r;
+ b.y = 0;
+ bound(b);
+ if (n > 2) {
+ c = nodes[2];
+ d3_layout_packPlace(a, b, c);
+ bound(c);
+ d3_layout_packInsert(a, c);
+ a._pack_prev = c;
+ d3_layout_packInsert(c, b);
+ b = a._pack_next;
+ for (i = 3; i < n; i++) {
+ d3_layout_packPlace(a, b, c = nodes[i]);
+ var isect = 0, s1 = 1, s2 = 1;
+ for (j = b._pack_next; j !== b; j = j._pack_next, s1++) {
+ if (d3_layout_packIntersects(j, c)) {
+ isect = 1;
+ break;
+ }
+ }
+ if (isect == 1) {
+ for (k = a._pack_prev; k !== j._pack_prev; k = k._pack_prev, s2++) {
+ if (d3_layout_packIntersects(k, c)) {
+ break;
+ }
+ }
+ }
+ if (isect) {
+ if (s1 < s2 || s1 == s2 && b.r < a.r) d3_layout_packSplice(a, b = j); else d3_layout_packSplice(a = k, b);
+ i--;
+ } else {
+ d3_layout_packInsert(a, c);
+ b = c;
+ bound(c);
+ }
+ }
+ }
+ }
+ var cx = (xMin + xMax) / 2, cy = (yMin + yMax) / 2, cr = 0;
+ for (i = 0; i < n; i++) {
+ c = nodes[i];
+ c.x -= cx;
+ c.y -= cy;
+ cr = Math.max(cr, c.r + Math.sqrt(c.x * c.x + c.y * c.y));
+ }
+ node.r = cr;
+ nodes.forEach(d3_layout_packUnlink);
+ }
+ function d3_layout_packLink(node) {
+ node._pack_next = node._pack_prev = node;
+ }
+ function d3_layout_packUnlink(node) {
+ delete node._pack_next;
+ delete node._pack_prev;
+ }
+ function d3_layout_packTransform(node, x, y, k) {
+ var children = node.children;
+ node.x = x += k * node.x;
+ node.y = y += k * node.y;
+ node.r *= k;
+ if (children) {
+ var i = -1, n = children.length;
+ while (++i < n) d3_layout_packTransform(children[i], x, y, k);
+ }
+ }
+ function d3_layout_packPlace(a, b, c) {
+ var db = a.r + c.r, dx = b.x - a.x, dy = b.y - a.y;
+ if (db && (dx || dy)) {
+ var da = b.r + c.r, dc = dx * dx + dy * dy;
+ da *= da;
+ db *= db;
+ var x = .5 + (db - da) / (2 * dc), y = Math.sqrt(Math.max(0, 2 * da * (db + dc) - (db -= dc) * db - da * da)) / (2 * dc);
+ c.x = a.x + x * dx + y * dy;
+ c.y = a.y + x * dy - y * dx;
+ } else {
+ c.x = a.x + db;
+ c.y = a.y;
+ }
+ }
+ d3.layout.tree = function() {
+ var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = null;
+ function tree(d, i) {
+ var nodes = hierarchy.call(this, d, i), root0 = nodes[0], root1 = wrapTree(root0);
+ d3_layout_hierarchyVisitAfter(root1, firstWalk), root1.parent.m = -root1.z;
+ d3_layout_hierarchyVisitBefore(root1, secondWalk);
+ if (nodeSize) d3_layout_hierarchyVisitBefore(root0, sizeNode); else {
+ var left = root0, right = root0, bottom = root0;
+ d3_layout_hierarchyVisitBefore(root0, function(node) {
+ if (node.x < left.x) left = node;
+ if (node.x > right.x) right = node;
+ if (node.depth > bottom.depth) bottom = node;
+ });
+ var tx = separation(left, right) / 2 - left.x, kx = size[0] / (right.x + separation(right, left) / 2 + tx), ky = size[1] / (bottom.depth || 1);
+ d3_layout_hierarchyVisitBefore(root0, function(node) {
+ node.x = (node.x + tx) * kx;
+ node.y = node.depth * ky;
+ });
+ }
+ return nodes;
+ }
+ function wrapTree(root0) {
+ var root1 = {
+ A: null,
+ children: [ root0 ]
+ }, queue = [ root1 ], node1;
+ while ((node1 = queue.pop()) != null) {
+ for (var children = node1.children, child, i = 0, n = children.length; i < n; ++i) {
+ queue.push((children[i] = child = {
+ _: children[i],
+ parent: node1,
+ children: (child = children[i].children) && child.slice() || [],
+ A: null,
+ a: null,
+ z: 0,
+ m: 0,
+ c: 0,
+ s: 0,
+ t: null,
+ i: i
+ }).a = child);
+ }
+ }
+ return root1.children[0];
+ }
+ function firstWalk(v) {
+ var children = v.children, siblings = v.parent.children, w = v.i ? siblings[v.i - 1] : null;
+ if (children.length) {
+ d3_layout_treeShift(v);
+ var midpoint = (children[0].z + children[children.length - 1].z) / 2;
+ if (w) {
+ v.z = w.z + separation(v._, w._);
+ v.m = v.z - midpoint;
+ } else {
+ v.z = midpoint;
+ }
+ } else if (w) {
+ v.z = w.z + separation(v._, w._);
+ }
+ v.parent.A = apportion(v, w, v.parent.A || siblings[0]);
+ }
+ function secondWalk(v) {
+ v._.x = v.z + v.parent.m;
+ v.m += v.parent.m;
+ }
+ function apportion(v, w, ancestor) {
+ if (w) {
+ var vip = v, vop = v, vim = w, vom = vip.parent.children[0], sip = vip.m, sop = vop.m, sim = vim.m, som = vom.m, shift;
+ while (vim = d3_layout_treeRight(vim), vip = d3_layout_treeLeft(vip), vim && vip) {
+ vom = d3_layout_treeLeft(vom);
+ vop = d3_layout_treeRight(vop);
+ vop.a = v;
+ shift = vim.z + sim - vip.z - sip + separation(vim._, vip._);
+ if (shift > 0) {
+ d3_layout_treeMove(d3_layout_treeAncestor(vim, v, ancestor), v, shift);
+ sip += shift;
+ sop += shift;
+ }
+ sim += vim.m;
+ sip += vip.m;
+ som += vom.m;
+ sop += vop.m;
+ }
+ if (vim && !d3_layout_treeRight(vop)) {
+ vop.t = vim;
+ vop.m += sim - sop;
+ }
+ if (vip && !d3_layout_treeLeft(vom)) {
+ vom.t = vip;
+ vom.m += sip - som;
+ ancestor = v;
+ }
+ }
+ return ancestor;
+ }
+ function sizeNode(node) {
+ node.x *= size[0];
+ node.y = node.depth * size[1];
+ }
+ tree.separation = function(x) {
+ if (!arguments.length) return separation;
+ separation = x;
+ return tree;
+ };
+ tree.size = function(x) {
+ if (!arguments.length) return nodeSize ? null : size;
+ nodeSize = (size = x) == null ? sizeNode : null;
+ return tree;
+ };
+ tree.nodeSize = function(x) {
+ if (!arguments.length) return nodeSize ? size : null;
+ nodeSize = (size = x) == null ? null : sizeNode;
+ return tree;
+ };
+ return d3_layout_hierarchyRebind(tree, hierarchy);
+ };
+ function d3_layout_treeSeparation(a, b) {
+ return a.parent == b.parent ? 1 : 2;
+ }
+ function d3_layout_treeLeft(v) {
+ var children = v.children;
+ return children.length ? children[0] : v.t;
+ }
+ function d3_layout_treeRight(v) {
+ var children = v.children, n;
+ return (n = children.length) ? children[n - 1] : v.t;
+ }
+ function d3_layout_treeMove(wm, wp, shift) {
+ var change = shift / (wp.i - wm.i);
+ wp.c -= change;
+ wp.s += shift;
+ wm.c += change;
+ wp.z += shift;
+ wp.m += shift;
+ }
+ function d3_layout_treeShift(v) {
+ var shift = 0, change = 0, children = v.children, i = children.length, w;
+ while (--i >= 0) {
+ w = children[i];
+ w.z += shift;
+ w.m += shift;
+ shift += w.s + (change += w.c);
+ }
+ }
+ function d3_layout_treeAncestor(vim, v, ancestor) {
+ return vim.a.parent === v.parent ? vim.a : ancestor;
+ }
+ d3.layout.cluster = function() {
+ var hierarchy = d3.layout.hierarchy().sort(null).value(null), separation = d3_layout_treeSeparation, size = [ 1, 1 ], nodeSize = false;
+ function cluster(d, i) {
+ var nodes = hierarchy.call(this, d, i), root = nodes[0], previousNode, x = 0;
+ d3_layout_hierarchyVisitAfter(root, function(node) {
+ var children = node.children;
+ if (children && children.length) {
+ node.x = d3_layout_clusterX(children);
+ node.y = d3_layout_clusterY(children);
+ } else {
+ node.x = previousNode ? x += separation(node, previousNode) : 0;
+ node.y = 0;
+ previousNode = node;
+ }
+ });
+ var left = d3_layout_clusterLeft(root), right = d3_layout_clusterRight(root), x0 = left.x - separation(left, right) / 2, x1 = right.x + separation(right, left) / 2;
+ d3_layout_hierarchyVisitAfter(root, nodeSize ? function(node) {
+ node.x = (node.x - root.x) * size[0];
+ node.y = (root.y - node.y) * size[1];
+ } : function(node) {
+ node.x = (node.x - x0) / (x1 - x0) * size[0];
+ node.y = (1 - (root.y ? node.y / root.y : 1)) * size[1];
+ });
+ return nodes;
+ }
+ cluster.separation = function(x) {
+ if (!arguments.length) return separation;
+ separation = x;
+ return cluster;
+ };
+ cluster.size = function(x) {
+ if (!arguments.length) return nodeSize ? null : size;
+ nodeSize = (size = x) == null;
+ return cluster;
+ };
+ cluster.nodeSize = function(x) {
+ if (!arguments.length) return nodeSize ? size : null;
+ nodeSize = (size = x) != null;
+ return cluster;
+ };
+ return d3_layout_hierarchyRebind(cluster, hierarchy);
+ };
+ function d3_layout_clusterY(children) {
+ return 1 + d3.max(children, function(child) {
+ return child.y;
+ });
+ }
+ function d3_layout_clusterX(children) {
+ return children.reduce(function(x, child) {
+ return x + child.x;
+ }, 0) / children.length;
+ }
+ function d3_layout_clusterLeft(node) {
+ var children = node.children;
+ return children && children.length ? d3_layout_clusterLeft(children[0]) : node;
+ }
+ function d3_layout_clusterRight(node) {
+ var children = node.children, n;
+ return children && (n = children.length) ? d3_layout_clusterRight(children[n - 1]) : node;
+ }
+ d3.layout.treemap = function() {
+ var hierarchy = d3.layout.hierarchy(), round = Math.round, size = [ 1, 1 ], padding = null, pad = d3_layout_treemapPadNull, sticky = false, stickies, mode = "squarify", ratio = .5 * (1 + Math.sqrt(5));
+ function scale(children, k) {
+ var i = -1, n = children.length, child, area;
+ while (++i < n) {
+ area = (child = children[i]).value * (k < 0 ? 0 : k);
+ child.area = isNaN(area) || area <= 0 ? 0 : area;
+ }
+ }
+ function squarify(node) {
+ var children = node.children;
+ if (children && children.length) {
+ var rect = pad(node), row = [], remaining = children.slice(), child, best = Infinity, score, u = mode === "slice" ? rect.dx : mode === "dice" ? rect.dy : mode === "slice-dice" ? node.depth & 1 ? rect.dy : rect.dx : Math.min(rect.dx, rect.dy), n;
+ scale(remaining, rect.dx * rect.dy / node.value);
+ row.area = 0;
+ while ((n = remaining.length) > 0) {
+ row.push(child = remaining[n - 1]);
+ row.area += child.area;
+ if (mode !== "squarify" || (score = worst(row, u)) <= best) {
+ remaining.pop();
+ best = score;
+ } else {
+ row.area -= row.pop().area;
+ position(row, u, rect, false);
+ u = Math.min(rect.dx, rect.dy);
+ row.length = row.area = 0;
+ best = Infinity;
+ }
+ }
+ if (row.length) {
+ position(row, u, rect, true);
+ row.length = row.area = 0;
+ }
+ children.forEach(squarify);
+ }
+ }
+ function stickify(node) {
+ var children = node.children;
+ if (children && children.length) {
+ var rect = pad(node), remaining = children.slice(), child, row = [];
+ scale(remaining, rect.dx * rect.dy / node.value);
+ row.area = 0;
+ while (child = remaining.pop()) {
+ row.push(child);
+ row.area += child.area;
+ if (child.z != null) {
+ position(row, child.z ? rect.dx : rect.dy, rect, !remaining.length);
+ row.length = row.area = 0;
+ }
+ }
+ children.forEach(stickify);
+ }
+ }
+ function worst(row, u) {
+ var s = row.area, r, rmax = 0, rmin = Infinity, i = -1, n = row.length;
+ while (++i < n) {
+ if (!(r = row[i].area)) continue;
+ if (r < rmin) rmin = r;
+ if (r > rmax) rmax = r;
+ }
+ s *= s;
+ u *= u;
+ return s ? Math.max(u * rmax * ratio / s, s / (u * rmin * ratio)) : Infinity;
+ }
+ function position(row, u, rect, flush) {
+ var i = -1, n = row.length, x = rect.x, y = rect.y, v = u ? round(row.area / u) : 0, o;
+ if (u == rect.dx) {
+ if (flush || v > rect.dy) v = rect.dy;
+ while (++i < n) {
+ o = row[i];
+ o.x = x;
+ o.y = y;
+ o.dy = v;
+ x += o.dx = Math.min(rect.x + rect.dx - x, v ? round(o.area / v) : 0);
+ }
+ o.z = true;
+ o.dx += rect.x + rect.dx - x;
+ rect.y += v;
+ rect.dy -= v;
+ } else {
+ if (flush || v > rect.dx) v = rect.dx;
+ while (++i < n) {
+ o = row[i];
+ o.x = x;
+ o.y = y;
+ o.dx = v;
+ y += o.dy = Math.min(rect.y + rect.dy - y, v ? round(o.area / v) : 0);
+ }
+ o.z = false;
+ o.dy += rect.y + rect.dy - y;
+ rect.x += v;
+ rect.dx -= v;
+ }
+ }
+ function treemap(d) {
+ var nodes = stickies || hierarchy(d), root = nodes[0];
+ root.x = 0;
+ root.y = 0;
+ root.dx = size[0];
+ root.dy = size[1];
+ if (stickies) hierarchy.revalue(root);
+ scale([ root ], root.dx * root.dy / root.value);
+ (stickies ? stickify : squarify)(root);
+ if (sticky) stickies = nodes;
+ return nodes;
+ }
+ treemap.size = function(x) {
+ if (!arguments.length) return size;
+ size = x;
+ return treemap;
+ };
+ treemap.padding = function(x) {
+ if (!arguments.length) return padding;
+ function padFunction(node) {
+ var p = x.call(treemap, node, node.depth);
+ return p == null ? d3_layout_treemapPadNull(node) : d3_layout_treemapPad(node, typeof p === "number" ? [ p, p, p, p ] : p);
+ }
+ function padConstant(node) {
+ return d3_layout_treemapPad(node, x);
+ }
+ var type;
+ pad = (padding = x) == null ? d3_layout_treemapPadNull : (type = typeof x) === "function" ? padFunction : type === "number" ? (x = [ x, x, x, x ],
+ padConstant) : padConstant;
+ return treemap;
+ };
+ treemap.round = function(x) {
+ if (!arguments.length) return round != Number;
+ round = x ? Math.round : Number;
+ return treemap;
+ };
+ treemap.sticky = function(x) {
+ if (!arguments.length) return sticky;
+ sticky = x;
+ stickies = null;
+ return treemap;
+ };
+ treemap.ratio = function(x) {
+ if (!arguments.length) return ratio;
+ ratio = x;
+ return treemap;
+ };
+ treemap.mode = function(x) {
+ if (!arguments.length) return mode;
+ mode = x + "";
+ return treemap;
+ };
+ return d3_layout_hierarchyRebind(treemap, hierarchy);
+ };
+ function d3_layout_treemapPadNull(node) {
+ return {
+ x: node.x,
+ y: node.y,
+ dx: node.dx,
+ dy: node.dy
+ };
+ }
+ function d3_layout_treemapPad(node, padding) {
+ var x = node.x + padding[3], y = node.y + padding[0], dx = node.dx - padding[1] - padding[3], dy = node.dy - padding[0] - padding[2];
+ if (dx < 0) {
+ x += dx / 2;
+ dx = 0;
+ }
+ if (dy < 0) {
+ y += dy / 2;
+ dy = 0;
+ }
+ return {
+ x: x,
+ y: y,
+ dx: dx,
+ dy: dy
+ };
+ }
+ d3.random = {
+ normal: function(µ, σ) {
+ var n = arguments.length;
+ if (n < 2) σ = 1;
+ if (n < 1) µ = 0;
+ return function() {
+ var x, y, r;
+ do {
+ x = Math.random() * 2 - 1;
+ y = Math.random() * 2 - 1;
+ r = x * x + y * y;
+ } while (!r || r > 1);
+ return µ + σ * x * Math.sqrt(-2 * Math.log(r) / r);
+ };
+ },
+ logNormal: function() {
+ var random = d3.random.normal.apply(d3, arguments);
+ return function() {
+ return Math.exp(random());
+ };
+ },
+ bates: function(m) {
+ var random = d3.random.irwinHall(m);
+ return function() {
+ return random() / m;
+ };
+ },
+ irwinHall: function(m) {
+ return function() {
+ for (var s = 0, j = 0; j < m; j++) s += Math.random();
+ return s;
+ };
+ }
+ };
+ d3.scale = {};
+ function d3_scaleExtent(domain) {
+ var start = domain[0], stop = domain[domain.length - 1];
+ return start < stop ? [ start, stop ] : [ stop, start ];
+ }
+ function d3_scaleRange(scale) {
+ return scale.rangeExtent ? scale.rangeExtent() : d3_scaleExtent(scale.range());
+ }
+ function d3_scale_bilinear(domain, range, uninterpolate, interpolate) {
+ var u = uninterpolate(domain[0], domain[1]), i = interpolate(range[0], range[1]);
+ return function(x) {
+ return i(u(x));
+ };
+ }
+ function d3_scale_nice(domain, nice) {
+ var i0 = 0, i1 = domain.length - 1, x0 = domain[i0], x1 = domain[i1], dx;
+ if (x1 < x0) {
+ dx = i0, i0 = i1, i1 = dx;
+ dx = x0, x0 = x1, x1 = dx;
+ }
+ domain[i0] = nice.floor(x0);
+ domain[i1] = nice.ceil(x1);
+ return domain;
+ }
+ function d3_scale_niceStep(step) {
+ return step ? {
+ floor: function(x) {
+ return Math.floor(x / step) * step;
+ },
+ ceil: function(x) {
+ return Math.ceil(x / step) * step;
+ }
+ } : d3_scale_niceIdentity;
+ }
+ var d3_scale_niceIdentity = {
+ floor: d3_identity,
+ ceil: d3_identity
+ };
+ function d3_scale_polylinear(domain, range, uninterpolate, interpolate) {
+ var u = [], i = [], j = 0, k = Math.min(domain.length, range.length) - 1;
+ if (domain[k] < domain[0]) {
+ domain = domain.slice().reverse();
+ range = range.slice().reverse();
+ }
+ while (++j <= k) {
+ u.push(uninterpolate(domain[j - 1], domain[j]));
+ i.push(interpolate(range[j - 1], range[j]));
+ }
+ return function(x) {
+ var j = d3.bisect(domain, x, 1, k) - 1;
+ return i[j](u[j](x));
+ };
+ }
+ d3.scale.linear = function() {
+ return d3_scale_linear([ 0, 1 ], [ 0, 1 ], d3_interpolate, false);
+ };
+ function d3_scale_linear(domain, range, interpolate, clamp) {
+ var output, input;
+ function rescale() {
+ var linear = Math.min(domain.length, range.length) > 2 ? d3_scale_polylinear : d3_scale_bilinear, uninterpolate = clamp ? d3_uninterpolateClamp : d3_uninterpolateNumber;
+ output = linear(domain, range, uninterpolate, interpolate);
+ input = linear(range, domain, uninterpolate, d3_interpolate);
+ return scale;
+ }
+ function scale(x) {
+ return output(x);
+ }
+ scale.invert = function(y) {
+ return input(y);
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ domain = x.map(Number);
+ return rescale();
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ return rescale();
+ };
+ scale.rangeRound = function(x) {
+ return scale.range(x).interpolate(d3_interpolateRound);
+ };
+ scale.clamp = function(x) {
+ if (!arguments.length) return clamp;
+ clamp = x;
+ return rescale();
+ };
+ scale.interpolate = function(x) {
+ if (!arguments.length) return interpolate;
+ interpolate = x;
+ return rescale();
+ };
+ scale.ticks = function(m) {
+ return d3_scale_linearTicks(domain, m);
+ };
+ scale.tickFormat = function(m, format) {
+ return d3_scale_linearTickFormat(domain, m, format);
+ };
+ scale.nice = function(m) {
+ d3_scale_linearNice(domain, m);
+ return rescale();
+ };
+ scale.copy = function() {
+ return d3_scale_linear(domain, range, interpolate, clamp);
+ };
+ return rescale();
+ }
+ function d3_scale_linearRebind(scale, linear) {
+ return d3.rebind(scale, linear, "range", "rangeRound", "interpolate", "clamp");
+ }
+ function d3_scale_linearNice(domain, m) {
+ return d3_scale_nice(domain, d3_scale_niceStep(d3_scale_linearTickRange(domain, m)[2]));
+ }
+ function d3_scale_linearTickRange(domain, m) {
+ if (m == null) m = 10;
+ var extent = d3_scaleExtent(domain), span = extent[1] - extent[0], step = Math.pow(10, Math.floor(Math.log(span / m) / Math.LN10)), err = m / span * step;
+ if (err <= .15) step *= 10; else if (err <= .35) step *= 5; else if (err <= .75) step *= 2;
+ extent[0] = Math.ceil(extent[0] / step) * step;
+ extent[1] = Math.floor(extent[1] / step) * step + step * .5;
+ extent[2] = step;
+ return extent;
+ }
+ function d3_scale_linearTicks(domain, m) {
+ return d3.range.apply(d3, d3_scale_linearTickRange(domain, m));
+ }
+ function d3_scale_linearTickFormat(domain, m, format) {
+ var range = d3_scale_linearTickRange(domain, m);
+ if (format) {
+ var match = d3_format_re.exec(format);
+ match.shift();
+ if (match[8] === "s") {
+ var prefix = d3.formatPrefix(Math.max(abs(range[0]), abs(range[1])));
+ if (!match[7]) match[7] = "." + d3_scale_linearPrecision(prefix.scale(range[2]));
+ match[8] = "f";
+ format = d3.format(match.join(""));
+ return function(d) {
+ return format(prefix.scale(d)) + prefix.symbol;
+ };
+ }
+ if (!match[7]) match[7] = "." + d3_scale_linearFormatPrecision(match[8], range);
+ format = match.join("");
+ } else {
+ format = ",." + d3_scale_linearPrecision(range[2]) + "f";
+ }
+ return d3.format(format);
+ }
+ var d3_scale_linearFormatSignificant = {
+ s: 1,
+ g: 1,
+ p: 1,
+ r: 1,
+ e: 1
+ };
+ function d3_scale_linearPrecision(value) {
+ return -Math.floor(Math.log(value) / Math.LN10 + .01);
+ }
+ function d3_scale_linearFormatPrecision(type, range) {
+ var p = d3_scale_linearPrecision(range[2]);
+ return type in d3_scale_linearFormatSignificant ? Math.abs(p - d3_scale_linearPrecision(Math.max(abs(range[0]), abs(range[1])))) + +(type !== "e") : p - (type === "%") * 2;
+ }
+ d3.scale.log = function() {
+ return d3_scale_log(d3.scale.linear().domain([ 0, 1 ]), 10, true, [ 1, 10 ]);
+ };
+ function d3_scale_log(linear, base, positive, domain) {
+ function log(x) {
+ return (positive ? Math.log(x < 0 ? 0 : x) : -Math.log(x > 0 ? 0 : -x)) / Math.log(base);
+ }
+ function pow(x) {
+ return positive ? Math.pow(base, x) : -Math.pow(base, -x);
+ }
+ function scale(x) {
+ return linear(log(x));
+ }
+ scale.invert = function(x) {
+ return pow(linear.invert(x));
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ positive = x[0] >= 0;
+ linear.domain((domain = x.map(Number)).map(log));
+ return scale;
+ };
+ scale.base = function(_) {
+ if (!arguments.length) return base;
+ base = +_;
+ linear.domain(domain.map(log));
+ return scale;
+ };
+ scale.nice = function() {
+ var niced = d3_scale_nice(domain.map(log), positive ? Math : d3_scale_logNiceNegative);
+ linear.domain(niced);
+ domain = niced.map(pow);
+ return scale;
+ };
+ scale.ticks = function() {
+ var extent = d3_scaleExtent(domain), ticks = [], u = extent[0], v = extent[1], i = Math.floor(log(u)), j = Math.ceil(log(v)), n = base % 1 ? 2 : base;
+ if (isFinite(j - i)) {
+ if (positive) {
+ for (;i < j; i++) for (var k = 1; k < n; k++) ticks.push(pow(i) * k);
+ ticks.push(pow(i));
+ } else {
+ ticks.push(pow(i));
+ for (;i++ < j; ) for (var k = n - 1; k > 0; k--) ticks.push(pow(i) * k);
+ }
+ for (i = 0; ticks[i] < u; i++) {}
+ for (j = ticks.length; ticks[j - 1] > v; j--) {}
+ ticks = ticks.slice(i, j);
+ }
+ return ticks;
+ };
+ scale.tickFormat = function(n, format) {
+ if (!arguments.length) return d3_scale_logFormat;
+ if (arguments.length < 2) format = d3_scale_logFormat; else if (typeof format !== "function") format = d3.format(format);
+ var k = Math.max(.1, n / scale.ticks().length), f = positive ? (e = 1e-12, Math.ceil) : (e = -1e-12,
+ Math.floor), e;
+ return function(d) {
+ return d / pow(f(log(d) + e)) <= k ? format(d) : "";
+ };
+ };
+ scale.copy = function() {
+ return d3_scale_log(linear.copy(), base, positive, domain);
+ };
+ return d3_scale_linearRebind(scale, linear);
+ }
+ var d3_scale_logFormat = d3.format(".0e"), d3_scale_logNiceNegative = {
+ floor: function(x) {
+ return -Math.ceil(-x);
+ },
+ ceil: function(x) {
+ return -Math.floor(-x);
+ }
+ };
+ d3.scale.pow = function() {
+ return d3_scale_pow(d3.scale.linear(), 1, [ 0, 1 ]);
+ };
+ function d3_scale_pow(linear, exponent, domain) {
+ var powp = d3_scale_powPow(exponent), powb = d3_scale_powPow(1 / exponent);
+ function scale(x) {
+ return linear(powp(x));
+ }
+ scale.invert = function(x) {
+ return powb(linear.invert(x));
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ linear.domain((domain = x.map(Number)).map(powp));
+ return scale;
+ };
+ scale.ticks = function(m) {
+ return d3_scale_linearTicks(domain, m);
+ };
+ scale.tickFormat = function(m, format) {
+ return d3_scale_linearTickFormat(domain, m, format);
+ };
+ scale.nice = function(m) {
+ return scale.domain(d3_scale_linearNice(domain, m));
+ };
+ scale.exponent = function(x) {
+ if (!arguments.length) return exponent;
+ powp = d3_scale_powPow(exponent = x);
+ powb = d3_scale_powPow(1 / exponent);
+ linear.domain(domain.map(powp));
+ return scale;
+ };
+ scale.copy = function() {
+ return d3_scale_pow(linear.copy(), exponent, domain);
+ };
+ return d3_scale_linearRebind(scale, linear);
+ }
+ function d3_scale_powPow(e) {
+ return function(x) {
+ return x < 0 ? -Math.pow(-x, e) : Math.pow(x, e);
+ };
+ }
+ d3.scale.sqrt = function() {
+ return d3.scale.pow().exponent(.5);
+ };
+ d3.scale.ordinal = function() {
+ return d3_scale_ordinal([], {
+ t: "range",
+ a: [ [] ]
+ });
+ };
+ function d3_scale_ordinal(domain, ranger) {
+ var index, range, rangeBand;
+ function scale(x) {
+ return range[((index.get(x) || (ranger.t === "range" ? index.set(x, domain.push(x)) : NaN)) - 1) % range.length];
+ }
+ function steps(start, step) {
+ return d3.range(domain.length).map(function(i) {
+ return start + step * i;
+ });
+ }
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ domain = [];
+ index = new d3_Map();
+ var i = -1, n = x.length, xi;
+ while (++i < n) if (!index.has(xi = x[i])) index.set(xi, domain.push(xi));
+ return scale[ranger.t].apply(scale, ranger.a);
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ rangeBand = 0;
+ ranger = {
+ t: "range",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangePoints = function(x, padding) {
+ if (arguments.length < 2) padding = 0;
+ var start = x[0], stop = x[1], step = domain.length < 2 ? (start = (start + stop) / 2,
+ 0) : (stop - start) / (domain.length - 1 + padding);
+ range = steps(start + step * padding / 2, step);
+ rangeBand = 0;
+ ranger = {
+ t: "rangePoints",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeRoundPoints = function(x, padding) {
+ if (arguments.length < 2) padding = 0;
+ var start = x[0], stop = x[1], step = domain.length < 2 ? (start = stop = Math.round((start + stop) / 2),
+ 0) : (stop - start) / (domain.length - 1 + padding) | 0;
+ range = steps(start + Math.round(step * padding / 2 + (stop - start - (domain.length - 1 + padding) * step) / 2), step);
+ rangeBand = 0;
+ ranger = {
+ t: "rangeRoundPoints",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeBands = function(x, padding, outerPadding) {
+ if (arguments.length < 2) padding = 0;
+ if (arguments.length < 3) outerPadding = padding;
+ var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = (stop - start) / (domain.length - padding + 2 * outerPadding);
+ range = steps(start + step * outerPadding, step);
+ if (reverse) range.reverse();
+ rangeBand = step * (1 - padding);
+ ranger = {
+ t: "rangeBands",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeRoundBands = function(x, padding, outerPadding) {
+ if (arguments.length < 2) padding = 0;
+ if (arguments.length < 3) outerPadding = padding;
+ var reverse = x[1] < x[0], start = x[reverse - 0], stop = x[1 - reverse], step = Math.floor((stop - start) / (domain.length - padding + 2 * outerPadding));
+ range = steps(start + Math.round((stop - start - (domain.length - padding) * step) / 2), step);
+ if (reverse) range.reverse();
+ rangeBand = Math.round(step * (1 - padding));
+ ranger = {
+ t: "rangeRoundBands",
+ a: arguments
+ };
+ return scale;
+ };
+ scale.rangeBand = function() {
+ return rangeBand;
+ };
+ scale.rangeExtent = function() {
+ return d3_scaleExtent(ranger.a[0]);
+ };
+ scale.copy = function() {
+ return d3_scale_ordinal(domain, ranger);
+ };
+ return scale.domain(domain);
+ }
+ d3.scale.category10 = function() {
+ return d3.scale.ordinal().range(d3_category10);
+ };
+ d3.scale.category20 = function() {
+ return d3.scale.ordinal().range(d3_category20);
+ };
+ d3.scale.category20b = function() {
+ return d3.scale.ordinal().range(d3_category20b);
+ };
+ d3.scale.category20c = function() {
+ return d3.scale.ordinal().range(d3_category20c);
+ };
+ var d3_category10 = [ 2062260, 16744206, 2924588, 14034728, 9725885, 9197131, 14907330, 8355711, 12369186, 1556175 ].map(d3_rgbString);
+ var d3_category20 = [ 2062260, 11454440, 16744206, 16759672, 2924588, 10018698, 14034728, 16750742, 9725885, 12955861, 9197131, 12885140, 14907330, 16234194, 8355711, 13092807, 12369186, 14408589, 1556175, 10410725 ].map(d3_rgbString);
+ var d3_category20b = [ 3750777, 5395619, 7040719, 10264286, 6519097, 9216594, 11915115, 13556636, 9202993, 12426809, 15186514, 15190932, 8666169, 11356490, 14049643, 15177372, 8077683, 10834324, 13528509, 14589654 ].map(d3_rgbString);
+ var d3_category20c = [ 3244733, 7057110, 10406625, 13032431, 15095053, 16616764, 16625259, 16634018, 3253076, 7652470, 10607003, 13101504, 7695281, 10394312, 12369372, 14342891, 6513507, 9868950, 12434877, 14277081 ].map(d3_rgbString);
+ d3.scale.quantile = function() {
+ return d3_scale_quantile([], []);
+ };
+ function d3_scale_quantile(domain, range) {
+ var thresholds;
+ function rescale() {
+ var k = 0, q = range.length;
+ thresholds = [];
+ while (++k < q) thresholds[k - 1] = d3.quantile(domain, k / q);
+ return scale;
+ }
+ function scale(x) {
+ if (!isNaN(x = +x)) return range[d3.bisect(thresholds, x)];
+ }
+ scale.domain = function(x) {
+ if (!arguments.length) return domain;
+ domain = x.map(d3_number).filter(d3_numeric).sort(d3_ascending);
+ return rescale();
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ return rescale();
+ };
+ scale.quantiles = function() {
+ return thresholds;
+ };
+ scale.invertExtent = function(y) {
+ y = range.indexOf(y);
+ return y < 0 ? [ NaN, NaN ] : [ y > 0 ? thresholds[y - 1] : domain[0], y < thresholds.length ? thresholds[y] : domain[domain.length - 1] ];
+ };
+ scale.copy = function() {
+ return d3_scale_quantile(domain, range);
+ };
+ return rescale();
+ }
+ d3.scale.quantize = function() {
+ return d3_scale_quantize(0, 1, [ 0, 1 ]);
+ };
+ function d3_scale_quantize(x0, x1, range) {
+ var kx, i;
+ function scale(x) {
+ return range[Math.max(0, Math.min(i, Math.floor(kx * (x - x0))))];
+ }
+ function rescale() {
+ kx = range.length / (x1 - x0);
+ i = range.length - 1;
+ return scale;
+ }
+ scale.domain = function(x) {
+ if (!arguments.length) return [ x0, x1 ];
+ x0 = +x[0];
+ x1 = +x[x.length - 1];
+ return rescale();
+ };
+ scale.range = function(x) {
+ if (!arguments.length) return range;
+ range = x;
+ return rescale();
+ };
+ scale.invertExtent = function(y) {
+ y = range.indexOf(y);
+ y = y < 0 ? NaN : y / kx + x0;
+ return [ y, y + 1 / kx ];
+ };
+ scale.copy = function() {
+ return d3_scale_quantize(x0, x1, range);
+ };
+ return rescale();
+ }
+ d3.scale.threshold = function() {
+ return d3_scale_threshold([ .5 ], [ 0, 1 ]);
+ };
+ function d3_scale_threshold(domain, range) {
+ function scale(x) {
+ if (x <= x) return range[d3.bisect(domain, x)];
+ }
+ scale.domain = function(_) {
+ if (!arguments.length) return domain;
+ domain = _;
+ return scale;
+ };
+ scale.range = function(_) {
+ if (!arguments.length) return range;
+ range = _;
+ return scale;
+ };
+ scale.invertExtent = function(y) {
+ y = range.indexOf(y);
+ return [ domain[y - 1], domain[y] ];
+ };
+ scale.copy = function() {
+ return d3_scale_threshold(domain, range);
+ };
+ return scale;
+ }
+ d3.scale.identity = function() {
+ return d3_scale_identity([ 0, 1 ]);
+ };
+ function d3_scale_identity(domain) {
+ function identity(x) {
+ return +x;
+ }
+ identity.invert = identity;
+ identity.domain = identity.range = function(x) {
+ if (!arguments.length) return domain;
+ domain = x.map(identity);
+ return identity;
+ };
+ identity.ticks = function(m) {
+ return d3_scale_linearTicks(domain, m);
+ };
+ identity.tickFormat = function(m, format) {
+ return d3_scale_linearTickFormat(domain, m, format);
+ };
+ identity.copy = function() {
+ return d3_scale_identity(domain);
+ };
+ return identity;
+ }
+ d3.svg = {};
+ function d3_zero() {
+ return 0;
+ }
+ d3.svg.arc = function() {
+ var innerRadius = d3_svg_arcInnerRadius, outerRadius = d3_svg_arcOuterRadius, cornerRadius = d3_zero, padRadius = d3_svg_arcAuto, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle, padAngle = d3_svg_arcPadAngle;
+ function arc() {
+ var r0 = Math.max(0, +innerRadius.apply(this, arguments)), r1 = Math.max(0, +outerRadius.apply(this, arguments)), a0 = startAngle.apply(this, arguments) - halfπ, a1 = endAngle.apply(this, arguments) - halfπ, da = Math.abs(a1 - a0), cw = a0 > a1 ? 0 : 1;
+ if (r1 < r0) rc = r1, r1 = r0, r0 = rc;
+ if (da >= τε) return circleSegment(r1, cw) + (r0 ? circleSegment(r0, 1 - cw) : "") + "Z";
+ var rc, cr, rp, ap, p0 = 0, p1 = 0, x0, y0, x1, y1, x2, y2, x3, y3, path = [];
+ if (ap = (+padAngle.apply(this, arguments) || 0) / 2) {
+ rp = padRadius === d3_svg_arcAuto ? Math.sqrt(r0 * r0 + r1 * r1) : +padRadius.apply(this, arguments);
+ if (!cw) p1 *= -1;
+ if (r1) p1 = d3_asin(rp / r1 * Math.sin(ap));
+ if (r0) p0 = d3_asin(rp / r0 * Math.sin(ap));
+ }
+ if (r1) {
+ x0 = r1 * Math.cos(a0 + p1);
+ y0 = r1 * Math.sin(a0 + p1);
+ x1 = r1 * Math.cos(a1 - p1);
+ y1 = r1 * Math.sin(a1 - p1);
+ var l1 = Math.abs(a1 - a0 - 2 * p1) <= π ? 0 : 1;
+ if (p1 && d3_svg_arcSweep(x0, y0, x1, y1) === cw ^ l1) {
+ var h1 = (a0 + a1) / 2;
+ x0 = r1 * Math.cos(h1);
+ y0 = r1 * Math.sin(h1);
+ x1 = y1 = null;
+ }
+ } else {
+ x0 = y0 = 0;
+ }
+ if (r0) {
+ x2 = r0 * Math.cos(a1 - p0);
+ y2 = r0 * Math.sin(a1 - p0);
+ x3 = r0 * Math.cos(a0 + p0);
+ y3 = r0 * Math.sin(a0 + p0);
+ var l0 = Math.abs(a0 - a1 + 2 * p0) <= π ? 0 : 1;
+ if (p0 && d3_svg_arcSweep(x2, y2, x3, y3) === 1 - cw ^ l0) {
+ var h0 = (a0 + a1) / 2;
+ x2 = r0 * Math.cos(h0);
+ y2 = r0 * Math.sin(h0);
+ x3 = y3 = null;
+ }
+ } else {
+ x2 = y2 = 0;
+ }
+ if ((rc = Math.min(Math.abs(r1 - r0) / 2, +cornerRadius.apply(this, arguments))) > .001) {
+ cr = r0 < r1 ^ cw ? 0 : 1;
+ var oc = x3 == null ? [ x2, y2 ] : x1 == null ? [ x0, y0 ] : d3_geom_polygonIntersect([ x0, y0 ], [ x3, y3 ], [ x1, y1 ], [ x2, y2 ]), ax = x0 - oc[0], ay = y0 - oc[1], bx = x1 - oc[0], by = y1 - oc[1], kc = 1 / Math.sin(Math.acos((ax * bx + ay * by) / (Math.sqrt(ax * ax + ay * ay) * Math.sqrt(bx * bx + by * by))) / 2), lc = Math.sqrt(oc[0] * oc[0] + oc[1] * oc[1]);
+ if (x1 != null) {
+ var rc1 = Math.min(rc, (r1 - lc) / (kc + 1)), t30 = d3_svg_arcCornerTangents(x3 == null ? [ x2, y2 ] : [ x3, y3 ], [ x0, y0 ], r1, rc1, cw), t12 = d3_svg_arcCornerTangents([ x1, y1 ], [ x2, y2 ], r1, rc1, cw);
+ if (rc === rc1) {
+ path.push("M", t30[0], "A", rc1, ",", rc1, " 0 0,", cr, " ", t30[1], "A", r1, ",", r1, " 0 ", 1 - cw ^ d3_svg_arcSweep(t30[1][0], t30[1][1], t12[1][0], t12[1][1]), ",", cw, " ", t12[1], "A", rc1, ",", rc1, " 0 0,", cr, " ", t12[0]);
+ } else {
+ path.push("M", t30[0], "A", rc1, ",", rc1, " 0 1,", cr, " ", t12[0]);
+ }
+ } else {
+ path.push("M", x0, ",", y0);
+ }
+ if (x3 != null) {
+ var rc0 = Math.min(rc, (r0 - lc) / (kc - 1)), t03 = d3_svg_arcCornerTangents([ x0, y0 ], [ x3, y3 ], r0, -rc0, cw), t21 = d3_svg_arcCornerTangents([ x2, y2 ], x1 == null ? [ x0, y0 ] : [ x1, y1 ], r0, -rc0, cw);
+ if (rc === rc0) {
+ path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t21[1], "A", r0, ",", r0, " 0 ", cw ^ d3_svg_arcSweep(t21[1][0], t21[1][1], t03[1][0], t03[1][1]), ",", 1 - cw, " ", t03[1], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
+ } else {
+ path.push("L", t21[0], "A", rc0, ",", rc0, " 0 0,", cr, " ", t03[0]);
+ }
+ } else {
+ path.push("L", x2, ",", y2);
+ }
+ } else {
+ path.push("M", x0, ",", y0);
+ if (x1 != null) path.push("A", r1, ",", r1, " 0 ", l1, ",", cw, " ", x1, ",", y1);
+ path.push("L", x2, ",", y2);
+ if (x3 != null) path.push("A", r0, ",", r0, " 0 ", l0, ",", 1 - cw, " ", x3, ",", y3);
+ }
+ path.push("Z");
+ return path.join("");
+ }
+ function circleSegment(r1, cw) {
+ return "M0," + r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + -r1 + "A" + r1 + "," + r1 + " 0 1," + cw + " 0," + r1;
+ }
+ arc.innerRadius = function(v) {
+ if (!arguments.length) return innerRadius;
+ innerRadius = d3_functor(v);
+ return arc;
+ };
+ arc.outerRadius = function(v) {
+ if (!arguments.length) return outerRadius;
+ outerRadius = d3_functor(v);
+ return arc;
+ };
+ arc.cornerRadius = function(v) {
+ if (!arguments.length) return cornerRadius;
+ cornerRadius = d3_functor(v);
+ return arc;
+ };
+ arc.padRadius = function(v) {
+ if (!arguments.length) return padRadius;
+ padRadius = v == d3_svg_arcAuto ? d3_svg_arcAuto : d3_functor(v);
+ return arc;
+ };
+ arc.startAngle = function(v) {
+ if (!arguments.length) return startAngle;
+ startAngle = d3_functor(v);
+ return arc;
+ };
+ arc.endAngle = function(v) {
+ if (!arguments.length) return endAngle;
+ endAngle = d3_functor(v);
+ return arc;
+ };
+ arc.padAngle = function(v) {
+ if (!arguments.length) return padAngle;
+ padAngle = d3_functor(v);
+ return arc;
+ };
+ arc.centroid = function() {
+ var r = (+innerRadius.apply(this, arguments) + +outerRadius.apply(this, arguments)) / 2, a = (+startAngle.apply(this, arguments) + +endAngle.apply(this, arguments)) / 2 - halfπ;
+ return [ Math.cos(a) * r, Math.sin(a) * r ];
+ };
+ return arc;
+ };
+ var d3_svg_arcAuto = "auto";
+ function d3_svg_arcInnerRadius(d) {
+ return d.innerRadius;
+ }
+ function d3_svg_arcOuterRadius(d) {
+ return d.outerRadius;
+ }
+ function d3_svg_arcStartAngle(d) {
+ return d.startAngle;
+ }
+ function d3_svg_arcEndAngle(d) {
+ return d.endAngle;
+ }
+ function d3_svg_arcPadAngle(d) {
+ return d && d.padAngle;
+ }
+ function d3_svg_arcSweep(x0, y0, x1, y1) {
+ return (x0 - x1) * y0 - (y0 - y1) * x0 > 0 ? 0 : 1;
+ }
+ function d3_svg_arcCornerTangents(p0, p1, r1, rc, cw) {
+ var x01 = p0[0] - p1[0], y01 = p0[1] - p1[1], lo = (cw ? rc : -rc) / Math.sqrt(x01 * x01 + y01 * y01), ox = lo * y01, oy = -lo * x01, x1 = p0[0] + ox, y1 = p0[1] + oy, x2 = p1[0] + ox, y2 = p1[1] + oy, x3 = (x1 + x2) / 2, y3 = (y1 + y2) / 2, dx = x2 - x1, dy = y2 - y1, d2 = dx * dx + dy * dy, r = r1 - rc, D = x1 * y2 - x2 * y1, d = (dy < 0 ? -1 : 1) * Math.sqrt(r * r * d2 - D * D), cx0 = (D * dy - dx * d) / d2, cy0 = (-D * dx - dy * d) / d2, cx1 = (D * dy + dx * d) / d2, cy1 = (-D * dx + dy * d) / d2, dx0 = cx0 - x3, dy0 = cy0 - y3, dx1 = cx1 - x3, dy1 = cy1 - y3;
+ if (dx0 * dx0 + dy0 * dy0 > dx1 * dx1 + dy1 * dy1) cx0 = cx1, cy0 = cy1;
+ return [ [ cx0 - ox, cy0 - oy ], [ cx0 * r1 / r, cy0 * r1 / r ] ];
+ }
+ function d3_svg_line(projection) {
+ var x = d3_geom_pointX, y = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, tension = .7;
+ function line(data) {
+ var segments = [], points = [], i = -1, n = data.length, d, fx = d3_functor(x), fy = d3_functor(y);
+ function segment() {
+ segments.push("M", interpolate(projection(points), tension));
+ }
+ while (++i < n) {
+ if (defined.call(this, d = data[i], i)) {
+ points.push([ +fx.call(this, d, i), +fy.call(this, d, i) ]);
+ } else if (points.length) {
+ segment();
+ points = [];
+ }
+ }
+ if (points.length) segment();
+ return segments.length ? segments.join("") : null;
+ }
+ line.x = function(_) {
+ if (!arguments.length) return x;
+ x = _;
+ return line;
+ };
+ line.y = function(_) {
+ if (!arguments.length) return y;
+ y = _;
+ return line;
+ };
+ line.defined = function(_) {
+ if (!arguments.length) return defined;
+ defined = _;
+ return line;
+ };
+ line.interpolate = function(_) {
+ if (!arguments.length) return interpolateKey;
+ if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
+ return line;
+ };
+ line.tension = function(_) {
+ if (!arguments.length) return tension;
+ tension = _;
+ return line;
+ };
+ return line;
+ }
+ d3.svg.line = function() {
+ return d3_svg_line(d3_identity);
+ };
+ var d3_svg_lineInterpolators = d3.map({
+ linear: d3_svg_lineLinear,
+ "linear-closed": d3_svg_lineLinearClosed,
+ step: d3_svg_lineStep,
+ "step-before": d3_svg_lineStepBefore,
+ "step-after": d3_svg_lineStepAfter,
+ basis: d3_svg_lineBasis,
+ "basis-open": d3_svg_lineBasisOpen,
+ "basis-closed": d3_svg_lineBasisClosed,
+ bundle: d3_svg_lineBundle,
+ cardinal: d3_svg_lineCardinal,
+ "cardinal-open": d3_svg_lineCardinalOpen,
+ "cardinal-closed": d3_svg_lineCardinalClosed,
+ monotone: d3_svg_lineMonotone
+ });
+ d3_svg_lineInterpolators.forEach(function(key, value) {
+ value.key = key;
+ value.closed = /-closed$/.test(key);
+ });
+ function d3_svg_lineLinear(points) {
+ return points.join("L");
+ }
+ function d3_svg_lineLinearClosed(points) {
+ return d3_svg_lineLinear(points) + "Z";
+ }
+ function d3_svg_lineStep(points) {
+ var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
+ while (++i < n) path.push("H", (p[0] + (p = points[i])[0]) / 2, "V", p[1]);
+ if (n > 1) path.push("H", p[0]);
+ return path.join("");
+ }
+ function d3_svg_lineStepBefore(points) {
+ var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
+ while (++i < n) path.push("V", (p = points[i])[1], "H", p[0]);
+ return path.join("");
+ }
+ function d3_svg_lineStepAfter(points) {
+ var i = 0, n = points.length, p = points[0], path = [ p[0], ",", p[1] ];
+ while (++i < n) path.push("H", (p = points[i])[0], "V", p[1]);
+ return path.join("");
+ }
+ function d3_svg_lineCardinalOpen(points, tension) {
+ return points.length < 4 ? d3_svg_lineLinear(points) : points[1] + d3_svg_lineHermite(points.slice(1, -1), d3_svg_lineCardinalTangents(points, tension));
+ }
+ function d3_svg_lineCardinalClosed(points, tension) {
+ return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite((points.push(points[0]),
+ points), d3_svg_lineCardinalTangents([ points[points.length - 2] ].concat(points, [ points[1] ]), tension));
+ }
+ function d3_svg_lineCardinal(points, tension) {
+ return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineCardinalTangents(points, tension));
+ }
+ function d3_svg_lineHermite(points, tangents) {
+ if (tangents.length < 1 || points.length != tangents.length && points.length != tangents.length + 2) {
+ return d3_svg_lineLinear(points);
+ }
+ var quad = points.length != tangents.length, path = "", p0 = points[0], p = points[1], t0 = tangents[0], t = t0, pi = 1;
+ if (quad) {
+ path += "Q" + (p[0] - t0[0] * 2 / 3) + "," + (p[1] - t0[1] * 2 / 3) + "," + p[0] + "," + p[1];
+ p0 = points[1];
+ pi = 2;
+ }
+ if (tangents.length > 1) {
+ t = tangents[1];
+ p = points[pi];
+ pi++;
+ path += "C" + (p0[0] + t0[0]) + "," + (p0[1] + t0[1]) + "," + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
+ for (var i = 2; i < tangents.length; i++, pi++) {
+ p = points[pi];
+ t = tangents[i];
+ path += "S" + (p[0] - t[0]) + "," + (p[1] - t[1]) + "," + p[0] + "," + p[1];
+ }
+ }
+ if (quad) {
+ var lp = points[pi];
+ path += "Q" + (p[0] + t[0] * 2 / 3) + "," + (p[1] + t[1] * 2 / 3) + "," + lp[0] + "," + lp[1];
+ }
+ return path;
+ }
+ function d3_svg_lineCardinalTangents(points, tension) {
+ var tangents = [], a = (1 - tension) / 2, p0, p1 = points[0], p2 = points[1], i = 1, n = points.length;
+ while (++i < n) {
+ p0 = p1;
+ p1 = p2;
+ p2 = points[i];
+ tangents.push([ a * (p2[0] - p0[0]), a * (p2[1] - p0[1]) ]);
+ }
+ return tangents;
+ }
+ function d3_svg_lineBasis(points) {
+ if (points.length < 3) return d3_svg_lineLinear(points);
+ var i = 1, n = points.length, pi = points[0], x0 = pi[0], y0 = pi[1], px = [ x0, x0, x0, (pi = points[1])[0] ], py = [ y0, y0, y0, pi[1] ], path = [ x0, ",", y0, "L", d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
+ points.push(points[n - 1]);
+ while (++i <= n) {
+ pi = points[i];
+ px.shift();
+ px.push(pi[0]);
+ py.shift();
+ py.push(pi[1]);
+ d3_svg_lineBasisBezier(path, px, py);
+ }
+ points.pop();
+ path.push("L", pi);
+ return path.join("");
+ }
+ function d3_svg_lineBasisOpen(points) {
+ if (points.length < 4) return d3_svg_lineLinear(points);
+ var path = [], i = -1, n = points.length, pi, px = [ 0 ], py = [ 0 ];
+ while (++i < 3) {
+ pi = points[i];
+ px.push(pi[0]);
+ py.push(pi[1]);
+ }
+ path.push(d3_svg_lineDot4(d3_svg_lineBasisBezier3, px) + "," + d3_svg_lineDot4(d3_svg_lineBasisBezier3, py));
+ --i;
+ while (++i < n) {
+ pi = points[i];
+ px.shift();
+ px.push(pi[0]);
+ py.shift();
+ py.push(pi[1]);
+ d3_svg_lineBasisBezier(path, px, py);
+ }
+ return path.join("");
+ }
+ function d3_svg_lineBasisClosed(points) {
+ var path, i = -1, n = points.length, m = n + 4, pi, px = [], py = [];
+ while (++i < 4) {
+ pi = points[i % n];
+ px.push(pi[0]);
+ py.push(pi[1]);
+ }
+ path = [ d3_svg_lineDot4(d3_svg_lineBasisBezier3, px), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, py) ];
+ --i;
+ while (++i < m) {
+ pi = points[i % n];
+ px.shift();
+ px.push(pi[0]);
+ py.shift();
+ py.push(pi[1]);
+ d3_svg_lineBasisBezier(path, px, py);
+ }
+ return path.join("");
+ }
+ function d3_svg_lineBundle(points, tension) {
+ var n = points.length - 1;
+ if (n) {
+ var x0 = points[0][0], y0 = points[0][1], dx = points[n][0] - x0, dy = points[n][1] - y0, i = -1, p, t;
+ while (++i <= n) {
+ p = points[i];
+ t = i / n;
+ p[0] = tension * p[0] + (1 - tension) * (x0 + t * dx);
+ p[1] = tension * p[1] + (1 - tension) * (y0 + t * dy);
+ }
+ }
+ return d3_svg_lineBasis(points);
+ }
+ function d3_svg_lineDot4(a, b) {
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];
+ }
+ var d3_svg_lineBasisBezier1 = [ 0, 2 / 3, 1 / 3, 0 ], d3_svg_lineBasisBezier2 = [ 0, 1 / 3, 2 / 3, 0 ], d3_svg_lineBasisBezier3 = [ 0, 1 / 6, 2 / 3, 1 / 6 ];
+ function d3_svg_lineBasisBezier(path, x, y) {
+ path.push("C", d3_svg_lineDot4(d3_svg_lineBasisBezier1, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier1, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier2, y), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, x), ",", d3_svg_lineDot4(d3_svg_lineBasisBezier3, y));
+ }
+ function d3_svg_lineSlope(p0, p1) {
+ return (p1[1] - p0[1]) / (p1[0] - p0[0]);
+ }
+ function d3_svg_lineFiniteDifferences(points) {
+ var i = 0, j = points.length - 1, m = [], p0 = points[0], p1 = points[1], d = m[0] = d3_svg_lineSlope(p0, p1);
+ while (++i < j) {
+ m[i] = (d + (d = d3_svg_lineSlope(p0 = p1, p1 = points[i + 1]))) / 2;
+ }
+ m[i] = d;
+ return m;
+ }
+ function d3_svg_lineMonotoneTangents(points) {
+ var tangents = [], d, a, b, s, m = d3_svg_lineFiniteDifferences(points), i = -1, j = points.length - 1;
+ while (++i < j) {
+ d = d3_svg_lineSlope(points[i], points[i + 1]);
+ if (abs(d) < ε) {
+ m[i] = m[i + 1] = 0;
+ } else {
+ a = m[i] / d;
+ b = m[i + 1] / d;
+ s = a * a + b * b;
+ if (s > 9) {
+ s = d * 3 / Math.sqrt(s);
+ m[i] = s * a;
+ m[i + 1] = s * b;
+ }
+ }
+ }
+ i = -1;
+ while (++i <= j) {
+ s = (points[Math.min(j, i + 1)][0] - points[Math.max(0, i - 1)][0]) / (6 * (1 + m[i] * m[i]));
+ tangents.push([ s || 0, m[i] * s || 0 ]);
+ }
+ return tangents;
+ }
+ function d3_svg_lineMonotone(points) {
+ return points.length < 3 ? d3_svg_lineLinear(points) : points[0] + d3_svg_lineHermite(points, d3_svg_lineMonotoneTangents(points));
+ }
+ d3.svg.line.radial = function() {
+ var line = d3_svg_line(d3_svg_lineRadial);
+ line.radius = line.x, delete line.x;
+ line.angle = line.y, delete line.y;
+ return line;
+ };
+ function d3_svg_lineRadial(points) {
+ var point, i = -1, n = points.length, r, a;
+ while (++i < n) {
+ point = points[i];
+ r = point[0];
+ a = point[1] - halfπ;
+ point[0] = r * Math.cos(a);
+ point[1] = r * Math.sin(a);
+ }
+ return points;
+ }
+ function d3_svg_area(projection) {
+ var x0 = d3_geom_pointX, x1 = d3_geom_pointX, y0 = 0, y1 = d3_geom_pointY, defined = d3_true, interpolate = d3_svg_lineLinear, interpolateKey = interpolate.key, interpolateReverse = interpolate, L = "L", tension = .7;
+ function area(data) {
+ var segments = [], points0 = [], points1 = [], i = -1, n = data.length, d, fx0 = d3_functor(x0), fy0 = d3_functor(y0), fx1 = x0 === x1 ? function() {
+ return x;
+ } : d3_functor(x1), fy1 = y0 === y1 ? function() {
+ return y;
+ } : d3_functor(y1), x, y;
+ function segment() {
+ segments.push("M", interpolate(projection(points1), tension), L, interpolateReverse(projection(points0.reverse()), tension), "Z");
+ }
+ while (++i < n) {
+ if (defined.call(this, d = data[i], i)) {
+ points0.push([ x = +fx0.call(this, d, i), y = +fy0.call(this, d, i) ]);
+ points1.push([ +fx1.call(this, d, i), +fy1.call(this, d, i) ]);
+ } else if (points0.length) {
+ segment();
+ points0 = [];
+ points1 = [];
+ }
+ }
+ if (points0.length) segment();
+ return segments.length ? segments.join("") : null;
+ }
+ area.x = function(_) {
+ if (!arguments.length) return x1;
+ x0 = x1 = _;
+ return area;
+ };
+ area.x0 = function(_) {
+ if (!arguments.length) return x0;
+ x0 = _;
+ return area;
+ };
+ area.x1 = function(_) {
+ if (!arguments.length) return x1;
+ x1 = _;
+ return area;
+ };
+ area.y = function(_) {
+ if (!arguments.length) return y1;
+ y0 = y1 = _;
+ return area;
+ };
+ area.y0 = function(_) {
+ if (!arguments.length) return y0;
+ y0 = _;
+ return area;
+ };
+ area.y1 = function(_) {
+ if (!arguments.length) return y1;
+ y1 = _;
+ return area;
+ };
+ area.defined = function(_) {
+ if (!arguments.length) return defined;
+ defined = _;
+ return area;
+ };
+ area.interpolate = function(_) {
+ if (!arguments.length) return interpolateKey;
+ if (typeof _ === "function") interpolateKey = interpolate = _; else interpolateKey = (interpolate = d3_svg_lineInterpolators.get(_) || d3_svg_lineLinear).key;
+ interpolateReverse = interpolate.reverse || interpolate;
+ L = interpolate.closed ? "M" : "L";
+ return area;
+ };
+ area.tension = function(_) {
+ if (!arguments.length) return tension;
+ tension = _;
+ return area;
+ };
+ return area;
+ }
+ d3_svg_lineStepBefore.reverse = d3_svg_lineStepAfter;
+ d3_svg_lineStepAfter.reverse = d3_svg_lineStepBefore;
+ d3.svg.area = function() {
+ return d3_svg_area(d3_identity);
+ };
+ d3.svg.area.radial = function() {
+ var area = d3_svg_area(d3_svg_lineRadial);
+ area.radius = area.x, delete area.x;
+ area.innerRadius = area.x0, delete area.x0;
+ area.outerRadius = area.x1, delete area.x1;
+ area.angle = area.y, delete area.y;
+ area.startAngle = area.y0, delete area.y0;
+ area.endAngle = area.y1, delete area.y1;
+ return area;
+ };
+ d3.svg.chord = function() {
+ var source = d3_source, target = d3_target, radius = d3_svg_chordRadius, startAngle = d3_svg_arcStartAngle, endAngle = d3_svg_arcEndAngle;
+ function chord(d, i) {
+ var s = subgroup(this, source, d, i), t = subgroup(this, target, d, i);
+ return "M" + s.p0 + arc(s.r, s.p1, s.a1 - s.a0) + (equals(s, t) ? curve(s.r, s.p1, s.r, s.p0) : curve(s.r, s.p1, t.r, t.p0) + arc(t.r, t.p1, t.a1 - t.a0) + curve(t.r, t.p1, s.r, s.p0)) + "Z";
+ }
+ function subgroup(self, f, d, i) {
+ var subgroup = f.call(self, d, i), r = radius.call(self, subgroup, i), a0 = startAngle.call(self, subgroup, i) - halfπ, a1 = endAngle.call(self, subgroup, i) - halfπ;
+ return {
+ r: r,
+ a0: a0,
+ a1: a1,
+ p0: [ r * Math.cos(a0), r * Math.sin(a0) ],
+ p1: [ r * Math.cos(a1), r * Math.sin(a1) ]
+ };
+ }
+ function equals(a, b) {
+ return a.a0 == b.a0 && a.a1 == b.a1;
+ }
+ function arc(r, p, a) {
+ return "A" + r + "," + r + " 0 " + +(a > π) + ",1 " + p;
+ }
+ function curve(r0, p0, r1, p1) {
+ return "Q 0,0 " + p1;
+ }
+ chord.radius = function(v) {
+ if (!arguments.length) return radius;
+ radius = d3_functor(v);
+ return chord;
+ };
+ chord.source = function(v) {
+ if (!arguments.length) return source;
+ source = d3_functor(v);
+ return chord;
+ };
+ chord.target = function(v) {
+ if (!arguments.length) return target;
+ target = d3_functor(v);
+ return chord;
+ };
+ chord.startAngle = function(v) {
+ if (!arguments.length) return startAngle;
+ startAngle = d3_functor(v);
+ return chord;
+ };
+ chord.endAngle = function(v) {
+ if (!arguments.length) return endAngle;
+ endAngle = d3_functor(v);
+ return chord;
+ };
+ return chord;
+ };
+ function d3_svg_chordRadius(d) {
+ return d.radius;
+ }
+ d3.svg.diagonal = function() {
+ var source = d3_source, target = d3_target, projection = d3_svg_diagonalProjection;
+ function diagonal(d, i) {
+ var p0 = source.call(this, d, i), p3 = target.call(this, d, i), m = (p0.y + p3.y) / 2, p = [ p0, {
+ x: p0.x,
+ y: m
+ }, {
+ x: p3.x,
+ y: m
+ }, p3 ];
+ p = p.map(projection);
+ return "M" + p[0] + "C" + p[1] + " " + p[2] + " " + p[3];
+ }
+ diagonal.source = function(x) {
+ if (!arguments.length) return source;
+ source = d3_functor(x);
+ return diagonal;
+ };
+ diagonal.target = function(x) {
+ if (!arguments.length) return target;
+ target = d3_functor(x);
+ return diagonal;
+ };
+ diagonal.projection = function(x) {
+ if (!arguments.length) return projection;
+ projection = x;
+ return diagonal;
+ };
+ return diagonal;
+ };
+ function d3_svg_diagonalProjection(d) {
+ return [ d.x, d.y ];
+ }
+ d3.svg.diagonal.radial = function() {
+ var diagonal = d3.svg.diagonal(), projection = d3_svg_diagonalProjection, projection_ = diagonal.projection;
+ diagonal.projection = function(x) {
+ return arguments.length ? projection_(d3_svg_diagonalRadialProjection(projection = x)) : projection;
+ };
+ return diagonal;
+ };
+ function d3_svg_diagonalRadialProjection(projection) {
+ return function() {
+ var d = projection.apply(this, arguments), r = d[0], a = d[1] - halfπ;
+ return [ r * Math.cos(a), r * Math.sin(a) ];
+ };
+ }
+ d3.svg.symbol = function() {
+ var type = d3_svg_symbolType, size = d3_svg_symbolSize;
+ function symbol(d, i) {
+ return (d3_svg_symbols.get(type.call(this, d, i)) || d3_svg_symbolCircle)(size.call(this, d, i));
+ }
+ symbol.type = function(x) {
+ if (!arguments.length) return type;
+ type = d3_functor(x);
+ return symbol;
+ };
+ symbol.size = function(x) {
+ if (!arguments.length) return size;
+ size = d3_functor(x);
+ return symbol;
+ };
+ return symbol;
+ };
+ function d3_svg_symbolSize() {
+ return 64;
+ }
+ function d3_svg_symbolType() {
+ return "circle";
+ }
+ function d3_svg_symbolCircle(size) {
+ var r = Math.sqrt(size / π);
+ return "M0," + r + "A" + r + "," + r + " 0 1,1 0," + -r + "A" + r + "," + r + " 0 1,1 0," + r + "Z";
+ }
+ var d3_svg_symbols = d3.map({
+ circle: d3_svg_symbolCircle,
+ cross: function(size) {
+ var r = Math.sqrt(size / 5) / 2;
+ return "M" + -3 * r + "," + -r + "H" + -r + "V" + -3 * r + "H" + r + "V" + -r + "H" + 3 * r + "V" + r + "H" + r + "V" + 3 * r + "H" + -r + "V" + r + "H" + -3 * r + "Z";
+ },
+ diamond: function(size) {
+ var ry = Math.sqrt(size / (2 * d3_svg_symbolTan30)), rx = ry * d3_svg_symbolTan30;
+ return "M0," + -ry + "L" + rx + ",0" + " 0," + ry + " " + -rx + ",0" + "Z";
+ },
+ square: function(size) {
+ var r = Math.sqrt(size) / 2;
+ return "M" + -r + "," + -r + "L" + r + "," + -r + " " + r + "," + r + " " + -r + "," + r + "Z";
+ },
+ "triangle-down": function(size) {
+ var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
+ return "M0," + ry + "L" + rx + "," + -ry + " " + -rx + "," + -ry + "Z";
+ },
+ "triangle-up": function(size) {
+ var rx = Math.sqrt(size / d3_svg_symbolSqrt3), ry = rx * d3_svg_symbolSqrt3 / 2;
+ return "M0," + -ry + "L" + rx + "," + ry + " " + -rx + "," + ry + "Z";
+ }
+ });
+ d3.svg.symbolTypes = d3_svg_symbols.keys();
+ var d3_svg_symbolSqrt3 = Math.sqrt(3), d3_svg_symbolTan30 = Math.tan(30 * d3_radians);
+ d3_selectionPrototype.transition = function(name) {
+ var id = d3_transitionInheritId || ++d3_transitionId, ns = d3_transitionNamespace(name), subgroups = [], subgroup, node, transition = d3_transitionInherit || {
+ time: Date.now(),
+ ease: d3_ease_cubicInOut,
+ delay: 0,
+ duration: 250
+ };
+ for (var j = -1, m = this.length; ++j < m; ) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) d3_transitionNode(node, i, ns, id, transition);
+ subgroup.push(node);
+ }
+ }
+ return d3_transition(subgroups, ns, id);
+ };
+ d3_selectionPrototype.interrupt = function(name) {
+ return this.each(name == null ? d3_selection_interrupt : d3_selection_interruptNS(d3_transitionNamespace(name)));
+ };
+ var d3_selection_interrupt = d3_selection_interruptNS(d3_transitionNamespace());
+ function d3_selection_interruptNS(ns) {
+ return function() {
+ var lock, active;
+ if ((lock = this[ns]) && (active = lock[lock.active])) {
+ if (--lock.count) delete lock[lock.active]; else delete this[ns];
+ lock.active += .5;
+ active.event && active.event.interrupt.call(this, this.__data__, active.index);
+ }
+ };
+ }
+ function d3_transition(groups, ns, id) {
+ d3_subclass(groups, d3_transitionPrototype);
+ groups.namespace = ns;
+ groups.id = id;
+ return groups;
+ }
+ var d3_transitionPrototype = [], d3_transitionId = 0, d3_transitionInheritId, d3_transitionInherit;
+ d3_transitionPrototype.call = d3_selectionPrototype.call;
+ d3_transitionPrototype.empty = d3_selectionPrototype.empty;
+ d3_transitionPrototype.node = d3_selectionPrototype.node;
+ d3_transitionPrototype.size = d3_selectionPrototype.size;
+ d3.transition = function(selection, name) {
+ return selection && selection.transition ? d3_transitionInheritId ? selection.transition(name) : selection : d3.selection().transition(selection);
+ };
+ d3.transition.prototype = d3_transitionPrototype;
+ d3_transitionPrototype.select = function(selector) {
+ var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnode, node;
+ selector = d3_selection_selector(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if ((node = group[i]) && (subnode = selector.call(node, node.__data__, i, j))) {
+ if ("__data__" in node) subnode.__data__ = node.__data__;
+ d3_transitionNode(subnode, i, ns, id, node[ns][id]);
+ subgroup.push(subnode);
+ } else {
+ subgroup.push(null);
+ }
+ }
+ }
+ return d3_transition(subgroups, ns, id);
+ };
+ d3_transitionPrototype.selectAll = function(selector) {
+ var id = this.id, ns = this.namespace, subgroups = [], subgroup, subnodes, node, subnode, transition;
+ selector = d3_selection_selectorAll(selector);
+ for (var j = -1, m = this.length; ++j < m; ) {
+ for (var group = this[j], i = -1, n = group.length; ++i < n; ) {
+ if (node = group[i]) {
+ transition = node[ns][id];
+ subnodes = selector.call(node, node.__data__, i, j);
+ subgroups.push(subgroup = []);
+ for (var k = -1, o = subnodes.length; ++k < o; ) {
+ if (subnode = subnodes[k]) d3_transitionNode(subnode, k, ns, id, transition);
+ subgroup.push(subnode);
+ }
+ }
+ }
+ }
+ return d3_transition(subgroups, ns, id);
+ };
+ d3_transitionPrototype.filter = function(filter) {
+ var subgroups = [], subgroup, group, node;
+ if (typeof filter !== "function") filter = d3_selection_filter(filter);
+ for (var j = 0, m = this.length; j < m; j++) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = 0, n = group.length; i < n; i++) {
+ if ((node = group[i]) && filter.call(node, node.__data__, i, j)) {
+ subgroup.push(node);
+ }
+ }
+ }
+ return d3_transition(subgroups, this.namespace, this.id);
+ };
+ d3_transitionPrototype.tween = function(name, tween) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 2) return this.node()[ns][id].tween.get(name);
+ return d3_selection_each(this, tween == null ? function(node) {
+ node[ns][id].tween.remove(name);
+ } : function(node) {
+ node[ns][id].tween.set(name, tween);
+ });
+ };
+ function d3_transition_tween(groups, name, value, tween) {
+ var id = groups.id, ns = groups.namespace;
+ return d3_selection_each(groups, typeof value === "function" ? function(node, i, j) {
+ node[ns][id].tween.set(name, tween(value.call(node, node.__data__, i, j)));
+ } : (value = tween(value), function(node) {
+ node[ns][id].tween.set(name, value);
+ }));
+ }
+ d3_transitionPrototype.attr = function(nameNS, value) {
+ if (arguments.length < 2) {
+ for (value in nameNS) this.attr(value, nameNS[value]);
+ return this;
+ }
+ var interpolate = nameNS == "transform" ? d3_interpolateTransform : d3_interpolate, name = d3.ns.qualify(nameNS);
+ function attrNull() {
+ this.removeAttribute(name);
+ }
+ function attrNullNS() {
+ this.removeAttributeNS(name.space, name.local);
+ }
+ function attrTween(b) {
+ return b == null ? attrNull : (b += "", function() {
+ var a = this.getAttribute(name), i;
+ return a !== b && (i = interpolate(a, b), function(t) {
+ this.setAttribute(name, i(t));
+ });
+ });
+ }
+ function attrTweenNS(b) {
+ return b == null ? attrNullNS : (b += "", function() {
+ var a = this.getAttributeNS(name.space, name.local), i;
+ return a !== b && (i = interpolate(a, b), function(t) {
+ this.setAttributeNS(name.space, name.local, i(t));
+ });
+ });
+ }
+ return d3_transition_tween(this, "attr." + nameNS, value, name.local ? attrTweenNS : attrTween);
+ };
+ d3_transitionPrototype.attrTween = function(nameNS, tween) {
+ var name = d3.ns.qualify(nameNS);
+ function attrTween(d, i) {
+ var f = tween.call(this, d, i, this.getAttribute(name));
+ return f && function(t) {
+ this.setAttribute(name, f(t));
+ };
+ }
+ function attrTweenNS(d, i) {
+ var f = tween.call(this, d, i, this.getAttributeNS(name.space, name.local));
+ return f && function(t) {
+ this.setAttributeNS(name.space, name.local, f(t));
+ };
+ }
+ return this.tween("attr." + nameNS, name.local ? attrTweenNS : attrTween);
+ };
+ d3_transitionPrototype.style = function(name, value, priority) {
+ var n = arguments.length;
+ if (n < 3) {
+ if (typeof name !== "string") {
+ if (n < 2) value = "";
+ for (priority in name) this.style(priority, name[priority], value);
+ return this;
+ }
+ priority = "";
+ }
+ function styleNull() {
+ this.style.removeProperty(name);
+ }
+ function styleString(b) {
+ return b == null ? styleNull : (b += "", function() {
+ var a = d3_window(this).getComputedStyle(this, null).getPropertyValue(name), i;
+ return a !== b && (i = d3_interpolate(a, b), function(t) {
+ this.style.setProperty(name, i(t), priority);
+ });
+ });
+ }
+ return d3_transition_tween(this, "style." + name, value, styleString);
+ };
+ d3_transitionPrototype.styleTween = function(name, tween, priority) {
+ if (arguments.length < 3) priority = "";
+ function styleTween(d, i) {
+ var f = tween.call(this, d, i, d3_window(this).getComputedStyle(this, null).getPropertyValue(name));
+ return f && function(t) {
+ this.style.setProperty(name, f(t), priority);
+ };
+ }
+ return this.tween("style." + name, styleTween);
+ };
+ d3_transitionPrototype.text = function(value) {
+ return d3_transition_tween(this, "text", value, d3_transition_text);
+ };
+ function d3_transition_text(b) {
+ if (b == null) b = "";
+ return function() {
+ this.textContent = b;
+ };
+ }
+ d3_transitionPrototype.remove = function() {
+ var ns = this.namespace;
+ return this.each("end.transition", function() {
+ var p;
+ if (this[ns].count < 2 && (p = this.parentNode)) p.removeChild(this);
+ });
+ };
+ d3_transitionPrototype.ease = function(value) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 1) return this.node()[ns][id].ease;
+ if (typeof value !== "function") value = d3.ease.apply(d3, arguments);
+ return d3_selection_each(this, function(node) {
+ node[ns][id].ease = value;
+ });
+ };
+ d3_transitionPrototype.delay = function(value) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 1) return this.node()[ns][id].delay;
+ return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
+ node[ns][id].delay = +value.call(node, node.__data__, i, j);
+ } : (value = +value, function(node) {
+ node[ns][id].delay = value;
+ }));
+ };
+ d3_transitionPrototype.duration = function(value) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 1) return this.node()[ns][id].duration;
+ return d3_selection_each(this, typeof value === "function" ? function(node, i, j) {
+ node[ns][id].duration = Math.max(1, value.call(node, node.__data__, i, j));
+ } : (value = Math.max(1, value), function(node) {
+ node[ns][id].duration = value;
+ }));
+ };
+ d3_transitionPrototype.each = function(type, listener) {
+ var id = this.id, ns = this.namespace;
+ if (arguments.length < 2) {
+ var inherit = d3_transitionInherit, inheritId = d3_transitionInheritId;
+ try {
+ d3_transitionInheritId = id;
+ d3_selection_each(this, function(node, i, j) {
+ d3_transitionInherit = node[ns][id];
+ type.call(node, node.__data__, i, j);
+ });
+ } finally {
+ d3_transitionInherit = inherit;
+ d3_transitionInheritId = inheritId;
+ }
+ } else {
+ d3_selection_each(this, function(node) {
+ var transition = node[ns][id];
+ (transition.event || (transition.event = d3.dispatch("start", "end", "interrupt"))).on(type, listener);
+ });
+ }
+ return this;
+ };
+ d3_transitionPrototype.transition = function() {
+ var id0 = this.id, id1 = ++d3_transitionId, ns = this.namespace, subgroups = [], subgroup, group, node, transition;
+ for (var j = 0, m = this.length; j < m; j++) {
+ subgroups.push(subgroup = []);
+ for (var group = this[j], i = 0, n = group.length; i < n; i++) {
+ if (node = group[i]) {
+ transition = node[ns][id0];
+ d3_transitionNode(node, i, ns, id1, {
+ time: transition.time,
+ ease: transition.ease,
+ delay: transition.delay + transition.duration,
+ duration: transition.duration
+ });
+ }
+ subgroup.push(node);
+ }
+ }
+ return d3_transition(subgroups, ns, id1);
+ };
+ function d3_transitionNamespace(name) {
+ return name == null ? "__transition__" : "__transition_" + name + "__";
+ }
+ function d3_transitionNode(node, i, ns, id, inherit) {
+ var lock = node[ns] || (node[ns] = {
+ active: 0,
+ count: 0
+ }), transition = lock[id];
+ if (!transition) {
+ var time = inherit.time;
+ transition = lock[id] = {
+ tween: new d3_Map(),
+ time: time,
+ delay: inherit.delay,
+ duration: inherit.duration,
+ ease: inherit.ease,
+ index: i
+ };
+ inherit = null;
+ ++lock.count;
+ d3.timer(function(elapsed) {
+ var delay = transition.delay, duration, ease, timer = d3_timer_active, tweened = [];
+ timer.t = delay + time;
+ if (delay <= elapsed) return start(elapsed - delay);
+ timer.c = start;
+ function start(elapsed) {
+ if (lock.active > id) return stop();
+ var active = lock[lock.active];
+ if (active) {
+ --lock.count;
+ delete lock[lock.active];
+ active.event && active.event.interrupt.call(node, node.__data__, active.index);
+ }
+ lock.active = id;
+ transition.event && transition.event.start.call(node, node.__data__, i);
+ transition.tween.forEach(function(key, value) {
+ if (value = value.call(node, node.__data__, i)) {
+ tweened.push(value);
+ }
+ });
+ ease = transition.ease;
+ duration = transition.duration;
+ d3.timer(function() {
+ timer.c = tick(elapsed || 1) ? d3_true : tick;
+ return 1;
+ }, 0, time);
+ }
+ function tick(elapsed) {
+ if (lock.active !== id) return 1;
+ var t = elapsed / duration, e = ease(t), n = tweened.length;
+ while (n > 0) {
+ tweened[--n].call(node, e);
+ }
+ if (t >= 1) {
+ transition.event && transition.event.end.call(node, node.__data__, i);
+ return stop();
+ }
+ }
+ function stop() {
+ if (--lock.count) delete lock[id]; else delete node[ns];
+ return 1;
+ }
+ }, 0, time);
+ }
+ }
+ d3.svg.axis = function() {
+ var scale = d3.scale.linear(), orient = d3_svg_axisDefaultOrient, innerTickSize = 6, outerTickSize = 6, tickPadding = 3, tickArguments_ = [ 10 ], tickValues = null, tickFormat_;
+ function axis(g) {
+ g.each(function() {
+ var g = d3.select(this);
+ var scale0 = this.__chart__ || scale, scale1 = this.__chart__ = scale.copy();
+ var ticks = tickValues == null ? scale1.ticks ? scale1.ticks.apply(scale1, tickArguments_) : scale1.domain() : tickValues, tickFormat = tickFormat_ == null ? scale1.tickFormat ? scale1.tickFormat.apply(scale1, tickArguments_) : d3_identity : tickFormat_, tick = g.selectAll(".tick").data(ticks, scale1), tickEnter = tick.enter().insert("g", ".domain").attr("class", "tick").style("opacity", ε), tickExit = d3.transition(tick.exit()).style("opacity", ε).remove(), tickUpdate = d3.transition(tick.order()).style("opacity", 1), tickSpacing = Math.max(innerTickSize, 0) + tickPadding, tickTransform;
+ var range = d3_scaleRange(scale1), path = g.selectAll(".domain").data([ 0 ]), pathUpdate = (path.enter().append("path").attr("class", "domain"),
+ d3.transition(path));
+ tickEnter.append("line");
+ tickEnter.append("text");
+ var lineEnter = tickEnter.select("line"), lineUpdate = tickUpdate.select("line"), text = tick.select("text").text(tickFormat), textEnter = tickEnter.select("text"), textUpdate = tickUpdate.select("text"), sign = orient === "top" || orient === "left" ? -1 : 1, x1, x2, y1, y2;
+ if (orient === "bottom" || orient === "top") {
+ tickTransform = d3_svg_axisX, x1 = "x", y1 = "y", x2 = "x2", y2 = "y2";
+ text.attr("dy", sign < 0 ? "0em" : ".71em").style("text-anchor", "middle");
+ pathUpdate.attr("d", "M" + range[0] + "," + sign * outerTickSize + "V0H" + range[1] + "V" + sign * outerTickSize);
+ } else {
+ tickTransform = d3_svg_axisY, x1 = "y", y1 = "x", x2 = "y2", y2 = "x2";
+ text.attr("dy", ".32em").style("text-anchor", sign < 0 ? "end" : "start");
+ pathUpdate.attr("d", "M" + sign * outerTickSize + "," + range[0] + "H0V" + range[1] + "H" + sign * outerTickSize);
+ }
+ lineEnter.attr(y2, sign * innerTickSize);
+ textEnter.attr(y1, sign * tickSpacing);
+ lineUpdate.attr(x2, 0).attr(y2, sign * innerTickSize);
+ textUpdate.attr(x1, 0).attr(y1, sign * tickSpacing);
+ if (scale1.rangeBand) {
+ var x = scale1, dx = x.rangeBand() / 2;
+ scale0 = scale1 = function(d) {
+ return x(d) + dx;
+ };
+ } else if (scale0.rangeBand) {
+ scale0 = scale1;
+ } else {
+ tickExit.call(tickTransform, scale1, scale0);
+ }
+ tickEnter.call(tickTransform, scale0, scale1);
+ tickUpdate.call(tickTransform, scale1, scale1);
+ });
+ }
+ axis.scale = function(x) {
+ if (!arguments.length) return scale;
+ scale = x;
+ return axis;
+ };
+ axis.orient = function(x) {
+ if (!arguments.length) return orient;
+ orient = x in d3_svg_axisOrients ? x + "" : d3_svg_axisDefaultOrient;
+ return axis;
+ };
+ axis.ticks = function() {
+ if (!arguments.length) return tickArguments_;
+ tickArguments_ = arguments;
+ return axis;
+ };
+ axis.tickValues = function(x) {
+ if (!arguments.length) return tickValues;
+ tickValues = x;
+ return axis;
+ };
+ axis.tickFormat = function(x) {
+ if (!arguments.length) return tickFormat_;
+ tickFormat_ = x;
+ return axis;
+ };
+ axis.tickSize = function(x) {
+ var n = arguments.length;
+ if (!n) return innerTickSize;
+ innerTickSize = +x;
+ outerTickSize = +arguments[n - 1];
+ return axis;
+ };
+ axis.innerTickSize = function(x) {
+ if (!arguments.length) return innerTickSize;
+ innerTickSize = +x;
+ return axis;
+ };
+ axis.outerTickSize = function(x) {
+ if (!arguments.length) return outerTickSize;
+ outerTickSize = +x;
+ return axis;
+ };
+ axis.tickPadding = function(x) {
+ if (!arguments.length) return tickPadding;
+ tickPadding = +x;
+ return axis;
+ };
+ axis.tickSubdivide = function() {
+ return arguments.length && axis;
+ };
+ return axis;
+ };
+ var d3_svg_axisDefaultOrient = "bottom", d3_svg_axisOrients = {
+ top: 1,
+ right: 1,
+ bottom: 1,
+ left: 1
+ };
+ function d3_svg_axisX(selection, x0, x1) {
+ selection.attr("transform", function(d) {
+ var v0 = x0(d);
+ return "translate(" + (isFinite(v0) ? v0 : x1(d)) + ",0)";
+ });
+ }
+ function d3_svg_axisY(selection, y0, y1) {
+ selection.attr("transform", function(d) {
+ var v0 = y0(d);
+ return "translate(0," + (isFinite(v0) ? v0 : y1(d)) + ")";
+ });
+ }
+ d3.svg.brush = function() {
+ var event = d3_eventDispatch(brush, "brushstart", "brush", "brushend"), x = null, y = null, xExtent = [ 0, 0 ], yExtent = [ 0, 0 ], xExtentDomain, yExtentDomain, xClamp = true, yClamp = true, resizes = d3_svg_brushResizes[0];
+ function brush(g) {
+ g.each(function() {
+ var g = d3.select(this).style("pointer-events", "all").style("-webkit-tap-highlight-color", "rgba(0,0,0,0)").on("mousedown.brush", brushstart).on("touchstart.brush", brushstart);
+ var background = g.selectAll(".background").data([ 0 ]);
+ background.enter().append("rect").attr("class", "background").style("visibility", "hidden").style("cursor", "crosshair");
+ g.selectAll(".extent").data([ 0 ]).enter().append("rect").attr("class", "extent").style("cursor", "move");
+ var resize = g.selectAll(".resize").data(resizes, d3_identity);
+ resize.exit().remove();
+ resize.enter().append("g").attr("class", function(d) {
+ return "resize " + d;
+ }).style("cursor", function(d) {
+ return d3_svg_brushCursor[d];
+ }).append("rect").attr("x", function(d) {
+ return /[ew]$/.test(d) ? -3 : null;
+ }).attr("y", function(d) {
+ return /^[ns]/.test(d) ? -3 : null;
+ }).attr("width", 6).attr("height", 6).style("visibility", "hidden");
+ resize.style("display", brush.empty() ? "none" : null);
+ var gUpdate = d3.transition(g), backgroundUpdate = d3.transition(background), range;
+ if (x) {
+ range = d3_scaleRange(x);
+ backgroundUpdate.attr("x", range[0]).attr("width", range[1] - range[0]);
+ redrawX(gUpdate);
+ }
+ if (y) {
+ range = d3_scaleRange(y);
+ backgroundUpdate.attr("y", range[0]).attr("height", range[1] - range[0]);
+ redrawY(gUpdate);
+ }
+ redraw(gUpdate);
+ });
+ }
+ brush.event = function(g) {
+ g.each(function() {
+ var event_ = event.of(this, arguments), extent1 = {
+ x: xExtent,
+ y: yExtent,
+ i: xExtentDomain,
+ j: yExtentDomain
+ }, extent0 = this.__chart__ || extent1;
+ this.__chart__ = extent1;
+ if (d3_transitionInheritId) {
+ d3.select(this).transition().each("start.brush", function() {
+ xExtentDomain = extent0.i;
+ yExtentDomain = extent0.j;
+ xExtent = extent0.x;
+ yExtent = extent0.y;
+ event_({
+ type: "brushstart"
+ });
+ }).tween("brush:brush", function() {
+ var xi = d3_interpolateArray(xExtent, extent1.x), yi = d3_interpolateArray(yExtent, extent1.y);
+ xExtentDomain = yExtentDomain = null;
+ return function(t) {
+ xExtent = extent1.x = xi(t);
+ yExtent = extent1.y = yi(t);
+ event_({
+ type: "brush",
+ mode: "resize"
+ });
+ };
+ }).each("end.brush", function() {
+ xExtentDomain = extent1.i;
+ yExtentDomain = extent1.j;
+ event_({
+ type: "brush",
+ mode: "resize"
+ });
+ event_({
+ type: "brushend"
+ });
+ });
+ } else {
+ event_({
+ type: "brushstart"
+ });
+ event_({
+ type: "brush",
+ mode: "resize"
+ });
+ event_({
+ type: "brushend"
+ });
+ }
+ });
+ };
+ function redraw(g) {
+ g.selectAll(".resize").attr("transform", function(d) {
+ return "translate(" + xExtent[+/e$/.test(d)] + "," + yExtent[+/^s/.test(d)] + ")";
+ });
+ }
+ function redrawX(g) {
+ g.select(".extent").attr("x", xExtent[0]);
+ g.selectAll(".extent,.n>rect,.s>rect").attr("width", xExtent[1] - xExtent[0]);
+ }
+ function redrawY(g) {
+ g.select(".extent").attr("y", yExtent[0]);
+ g.selectAll(".extent,.e>rect,.w>rect").attr("height", yExtent[1] - yExtent[0]);
+ }
+ function brushstart() {
+ var target = this, eventTarget = d3.select(d3.event.target), event_ = event.of(target, arguments), g = d3.select(target), resizing = eventTarget.datum(), resizingX = !/^(n|s)$/.test(resizing) && x, resizingY = !/^(e|w)$/.test(resizing) && y, dragging = eventTarget.classed("extent"), dragRestore = d3_event_dragSuppress(target), center, origin = d3.mouse(target), offset;
+ var w = d3.select(d3_window(target)).on("keydown.brush", keydown).on("keyup.brush", keyup);
+ if (d3.event.changedTouches) {
+ w.on("touchmove.brush", brushmove).on("touchend.brush", brushend);
+ } else {
+ w.on("mousemove.brush", brushmove).on("mouseup.brush", brushend);
+ }
+ g.interrupt().selectAll("*").interrupt();
+ if (dragging) {
+ origin[0] = xExtent[0] - origin[0];
+ origin[1] = yExtent[0] - origin[1];
+ } else if (resizing) {
+ var ex = +/w$/.test(resizing), ey = +/^n/.test(resizing);
+ offset = [ xExtent[1 - ex] - origin[0], yExtent[1 - ey] - origin[1] ];
+ origin[0] = xExtent[ex];
+ origin[1] = yExtent[ey];
+ } else if (d3.event.altKey) center = origin.slice();
+ g.style("pointer-events", "none").selectAll(".resize").style("display", null);
+ d3.select("body").style("cursor", eventTarget.style("cursor"));
+ event_({
+ type: "brushstart"
+ });
+ brushmove();
+ function keydown() {
+ if (d3.event.keyCode == 32) {
+ if (!dragging) {
+ center = null;
+ origin[0] -= xExtent[1];
+ origin[1] -= yExtent[1];
+ dragging = 2;
+ }
+ d3_eventPreventDefault();
+ }
+ }
+ function keyup() {
+ if (d3.event.keyCode == 32 && dragging == 2) {
+ origin[0] += xExtent[1];
+ origin[1] += yExtent[1];
+ dragging = 0;
+ d3_eventPreventDefault();
+ }
+ }
+ function brushmove() {
+ var point = d3.mouse(target), moved = false;
+ if (offset) {
+ point[0] += offset[0];
+ point[1] += offset[1];
+ }
+ if (!dragging) {
+ if (d3.event.altKey) {
+ if (!center) center = [ (xExtent[0] + xExtent[1]) / 2, (yExtent[0] + yExtent[1]) / 2 ];
+ origin[0] = xExtent[+(point[0] < center[0])];
+ origin[1] = yExtent[+(point[1] < center[1])];
+ } else center = null;
+ }
+ if (resizingX && move1(point, x, 0)) {
+ redrawX(g);
+ moved = true;
+ }
+ if (resizingY && move1(point, y, 1)) {
+ redrawY(g);
+ moved = true;
+ }
+ if (moved) {
+ redraw(g);
+ event_({
+ type: "brush",
+ mode: dragging ? "move" : "resize"
+ });
+ }
+ }
+ function move1(point, scale, i) {
+ var range = d3_scaleRange(scale), r0 = range[0], r1 = range[1], position = origin[i], extent = i ? yExtent : xExtent, size = extent[1] - extent[0], min, max;
+ if (dragging) {
+ r0 -= position;
+ r1 -= size + position;
+ }
+ min = (i ? yClamp : xClamp) ? Math.max(r0, Math.min(r1, point[i])) : point[i];
+ if (dragging) {
+ max = (min += position) + size;
+ } else {
+ if (center) position = Math.max(r0, Math.min(r1, 2 * center[i] - min));
+ if (position < min) {
+ max = min;
+ min = position;
+ } else {
+ max = position;
+ }
+ }
+ if (extent[0] != min || extent[1] != max) {
+ if (i) yExtentDomain = null; else xExtentDomain = null;
+ extent[0] = min;
+ extent[1] = max;
+ return true;
+ }
+ }
+ function brushend() {
+ brushmove();
+ g.style("pointer-events", "all").selectAll(".resize").style("display", brush.empty() ? "none" : null);
+ d3.select("body").style("cursor", null);
+ w.on("mousemove.brush", null).on("mouseup.brush", null).on("touchmove.brush", null).on("touchend.brush", null).on("keydown.brush", null).on("keyup.brush", null);
+ dragRestore();
+ event_({
+ type: "brushend"
+ });
+ }
+ }
+ brush.x = function(z) {
+ if (!arguments.length) return x;
+ x = z;
+ resizes = d3_svg_brushResizes[!x << 1 | !y];
+ return brush;
+ };
+ brush.y = function(z) {
+ if (!arguments.length) return y;
+ y = z;
+ resizes = d3_svg_brushResizes[!x << 1 | !y];
+ return brush;
+ };
+ brush.clamp = function(z) {
+ if (!arguments.length) return x && y ? [ xClamp, yClamp ] : x ? xClamp : y ? yClamp : null;
+ if (x && y) xClamp = !!z[0], yClamp = !!z[1]; else if (x) xClamp = !!z; else if (y) yClamp = !!z;
+ return brush;
+ };
+ brush.extent = function(z) {
+ var x0, x1, y0, y1, t;
+ if (!arguments.length) {
+ if (x) {
+ if (xExtentDomain) {
+ x0 = xExtentDomain[0], x1 = xExtentDomain[1];
+ } else {
+ x0 = xExtent[0], x1 = xExtent[1];
+ if (x.invert) x0 = x.invert(x0), x1 = x.invert(x1);
+ if (x1 < x0) t = x0, x0 = x1, x1 = t;
+ }
+ }
+ if (y) {
+ if (yExtentDomain) {
+ y0 = yExtentDomain[0], y1 = yExtentDomain[1];
+ } else {
+ y0 = yExtent[0], y1 = yExtent[1];
+ if (y.invert) y0 = y.invert(y0), y1 = y.invert(y1);
+ if (y1 < y0) t = y0, y0 = y1, y1 = t;
+ }
+ }
+ return x && y ? [ [ x0, y0 ], [ x1, y1 ] ] : x ? [ x0, x1 ] : y && [ y0, y1 ];
+ }
+ if (x) {
+ x0 = z[0], x1 = z[1];
+ if (y) x0 = x0[0], x1 = x1[0];
+ xExtentDomain = [ x0, x1 ];
+ if (x.invert) x0 = x(x0), x1 = x(x1);
+ if (x1 < x0) t = x0, x0 = x1, x1 = t;
+ if (x0 != xExtent[0] || x1 != xExtent[1]) xExtent = [ x0, x1 ];
+ }
+ if (y) {
+ y0 = z[0], y1 = z[1];
+ if (x) y0 = y0[1], y1 = y1[1];
+ yExtentDomain = [ y0, y1 ];
+ if (y.invert) y0 = y(y0), y1 = y(y1);
+ if (y1 < y0) t = y0, y0 = y1, y1 = t;
+ if (y0 != yExtent[0] || y1 != yExtent[1]) yExtent = [ y0, y1 ];
+ }
+ return brush;
+ };
+ brush.clear = function() {
+ if (!brush.empty()) {
+ xExtent = [ 0, 0 ], yExtent = [ 0, 0 ];
+ xExtentDomain = yExtentDomain = null;
+ }
+ return brush;
+ };
+ brush.empty = function() {
+ return !!x && xExtent[0] == xExtent[1] || !!y && yExtent[0] == yExtent[1];
+ };
+ return d3.rebind(brush, event, "on");
+ };
+ var d3_svg_brushCursor = {
+ n: "ns-resize",
+ e: "ew-resize",
+ s: "ns-resize",
+ w: "ew-resize",
+ nw: "nwse-resize",
+ ne: "nesw-resize",
+ se: "nwse-resize",
+ sw: "nesw-resize"
+ };
+ var d3_svg_brushResizes = [ [ "n", "e", "s", "w", "nw", "ne", "se", "sw" ], [ "e", "w" ], [ "n", "s" ], [] ];
+ var d3_time_format = d3_time.format = d3_locale_enUS.timeFormat;
+ var d3_time_formatUtc = d3_time_format.utc;
+ var d3_time_formatIso = d3_time_formatUtc("%Y-%m-%dT%H:%M:%S.%LZ");
+ d3_time_format.iso = Date.prototype.toISOString && +new Date("2000-01-01T00:00:00.000Z") ? d3_time_formatIsoNative : d3_time_formatIso;
+ function d3_time_formatIsoNative(date) {
+ return date.toISOString();
+ }
+ d3_time_formatIsoNative.parse = function(string) {
+ var date = new Date(string);
+ return isNaN(date) ? null : date;
+ };
+ d3_time_formatIsoNative.toString = d3_time_formatIso.toString;
+ d3_time.second = d3_time_interval(function(date) {
+ return new d3_date(Math.floor(date / 1e3) * 1e3);
+ }, function(date, offset) {
+ date.setTime(date.getTime() + Math.floor(offset) * 1e3);
+ }, function(date) {
+ return date.getSeconds();
+ });
+ d3_time.seconds = d3_time.second.range;
+ d3_time.seconds.utc = d3_time.second.utc.range;
+ d3_time.minute = d3_time_interval(function(date) {
+ return new d3_date(Math.floor(date / 6e4) * 6e4);
+ }, function(date, offset) {
+ date.setTime(date.getTime() + Math.floor(offset) * 6e4);
+ }, function(date) {
+ return date.getMinutes();
+ });
+ d3_time.minutes = d3_time.minute.range;
+ d3_time.minutes.utc = d3_time.minute.utc.range;
+ d3_time.hour = d3_time_interval(function(date) {
+ var timezone = date.getTimezoneOffset() / 60;
+ return new d3_date((Math.floor(date / 36e5 - timezone) + timezone) * 36e5);
+ }, function(date, offset) {
+ date.setTime(date.getTime() + Math.floor(offset) * 36e5);
+ }, function(date) {
+ return date.getHours();
+ });
+ d3_time.hours = d3_time.hour.range;
+ d3_time.hours.utc = d3_time.hour.utc.range;
+ d3_time.month = d3_time_interval(function(date) {
+ date = d3_time.day(date);
+ date.setDate(1);
+ return date;
+ }, function(date, offset) {
+ date.setMonth(date.getMonth() + offset);
+ }, function(date) {
+ return date.getMonth();
+ });
+ d3_time.months = d3_time.month.range;
+ d3_time.months.utc = d3_time.month.utc.range;
+ function d3_time_scale(linear, methods, format) {
+ function scale(x) {
+ return linear(x);
+ }
+ scale.invert = function(x) {
+ return d3_time_scaleDate(linear.invert(x));
+ };
+ scale.domain = function(x) {
+ if (!arguments.length) return linear.domain().map(d3_time_scaleDate);
+ linear.domain(x);
+ return scale;
+ };
+ function tickMethod(extent, count) {
+ var span = extent[1] - extent[0], target = span / count, i = d3.bisect(d3_time_scaleSteps, target);
+ return i == d3_time_scaleSteps.length ? [ methods.year, d3_scale_linearTickRange(extent.map(function(d) {
+ return d / 31536e6;
+ }), count)[2] ] : !i ? [ d3_time_scaleMilliseconds, d3_scale_linearTickRange(extent, count)[2] ] : methods[target / d3_time_scaleSteps[i - 1] < d3_time_scaleSteps[i] / target ? i - 1 : i];
+ }
+ scale.nice = function(interval, skip) {
+ var domain = scale.domain(), extent = d3_scaleExtent(domain), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" && tickMethod(extent, interval);
+ if (method) interval = method[0], skip = method[1];
+ function skipped(date) {
+ return !isNaN(date) && !interval.range(date, d3_time_scaleDate(+date + 1), skip).length;
+ }
+ return scale.domain(d3_scale_nice(domain, skip > 1 ? {
+ floor: function(date) {
+ while (skipped(date = interval.floor(date))) date = d3_time_scaleDate(date - 1);
+ return date;
+ },
+ ceil: function(date) {
+ while (skipped(date = interval.ceil(date))) date = d3_time_scaleDate(+date + 1);
+ return date;
+ }
+ } : interval));
+ };
+ scale.ticks = function(interval, skip) {
+ var extent = d3_scaleExtent(scale.domain()), method = interval == null ? tickMethod(extent, 10) : typeof interval === "number" ? tickMethod(extent, interval) : !interval.range && [ {
+ range: interval
+ }, skip ];
+ if (method) interval = method[0], skip = method[1];
+ return interval.range(extent[0], d3_time_scaleDate(+extent[1] + 1), skip < 1 ? 1 : skip);
+ };
+ scale.tickFormat = function() {
+ return format;
+ };
+ scale.copy = function() {
+ return d3_time_scale(linear.copy(), methods, format);
+ };
+ return d3_scale_linearRebind(scale, linear);
+ }
+ function d3_time_scaleDate(t) {
+ return new Date(t);
+ }
+ var d3_time_scaleSteps = [ 1e3, 5e3, 15e3, 3e4, 6e4, 3e5, 9e5, 18e5, 36e5, 108e5, 216e5, 432e5, 864e5, 1728e5, 6048e5, 2592e6, 7776e6, 31536e6 ];
+ var d3_time_scaleLocalMethods = [ [ d3_time.second, 1 ], [ d3_time.second, 5 ], [ d3_time.second, 15 ], [ d3_time.second, 30 ], [ d3_time.minute, 1 ], [ d3_time.minute, 5 ], [ d3_time.minute, 15 ], [ d3_time.minute, 30 ], [ d3_time.hour, 1 ], [ d3_time.hour, 3 ], [ d3_time.hour, 6 ], [ d3_time.hour, 12 ], [ d3_time.day, 1 ], [ d3_time.day, 2 ], [ d3_time.week, 1 ], [ d3_time.month, 1 ], [ d3_time.month, 3 ], [ d3_time.year, 1 ] ];
+ var d3_time_scaleLocalFormat = d3_time_format.multi([ [ ".%L", function(d) {
+ return d.getMilliseconds();
+ } ], [ ":%S", function(d) {
+ return d.getSeconds();
+ } ], [ "%I:%M", function(d) {
+ return d.getMinutes();
+ } ], [ "%I %p", function(d) {
+ return d.getHours();
+ } ], [ "%a %d", function(d) {
+ return d.getDay() && d.getDate() != 1;
+ } ], [ "%b %d", function(d) {
+ return d.getDate() != 1;
+ } ], [ "%B", function(d) {
+ return d.getMonth();
+ } ], [ "%Y", d3_true ] ]);
+ var d3_time_scaleMilliseconds = {
+ range: function(start, stop, step) {
+ return d3.range(Math.ceil(start / step) * step, +stop, step).map(d3_time_scaleDate);
+ },
+ floor: d3_identity,
+ ceil: d3_identity
+ };
+ d3_time_scaleLocalMethods.year = d3_time.year;
+ d3_time.scale = function() {
+ return d3_time_scale(d3.scale.linear(), d3_time_scaleLocalMethods, d3_time_scaleLocalFormat);
+ };
+ var d3_time_scaleUtcMethods = d3_time_scaleLocalMethods.map(function(m) {
+ return [ m[0].utc, m[1] ];
+ });
+ var d3_time_scaleUtcFormat = d3_time_formatUtc.multi([ [ ".%L", function(d) {
+ return d.getUTCMilliseconds();
+ } ], [ ":%S", function(d) {
+ return d.getUTCSeconds();
+ } ], [ "%I:%M", function(d) {
+ return d.getUTCMinutes();
+ } ], [ "%I %p", function(d) {
+ return d.getUTCHours();
+ } ], [ "%a %d", function(d) {
+ return d.getUTCDay() && d.getUTCDate() != 1;
+ } ], [ "%b %d", function(d) {
+ return d.getUTCDate() != 1;
+ } ], [ "%B", function(d) {
+ return d.getUTCMonth();
+ } ], [ "%Y", d3_true ] ]);
+ d3_time_scaleUtcMethods.year = d3_time.year.utc;
+ d3_time.scale.utc = function() {
+ return d3_time_scale(d3.scale.linear(), d3_time_scaleUtcMethods, d3_time_scaleUtcFormat);
+ };
+ d3.text = d3_xhrType(function(request) {
+ return request.responseText;
+ });
+ d3.json = function(url, callback) {
+ return d3_xhr(url, "application/json", d3_json, callback);
+ };
+ function d3_json(request) {
+ return JSON.parse(request.responseText);
+ }
+ d3.html = function(url, callback) {
+ return d3_xhr(url, "text/html", d3_html, callback);
+ };
+ function d3_html(request) {
+ var range = d3_document.createRange();
+ range.selectNode(d3_document.body);
+ return range.createContextualFragment(request.responseText);
+ }
+ d3.xml = d3_xhrType(function(request) {
+ return request.responseXML;
+ });
+ if (typeof define === "function" && define.amd) define(d3); else if (typeof module === "object" && module.exports) module.exports = d3;
+ this.d3 = d3;
+}();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js.old b/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js.old
new file mode 100644
index 000000000..b916e0f11
Binary files /dev/null and b/shrine-webclient/src/main/html/js-ext/d3code/d3.v3.js.old differ
diff --git a/shrine-webclient/src/main/html/js-ext/excanvas-License.txt b/shrine-webclient/src/main/html/js-ext/excanvas-License.txt
old mode 100755
new mode 100644
index f6b22ab4f..c797a01aa
--- a/shrine-webclient/src/main/html/js-ext/excanvas-License.txt
+++ b/shrine-webclient/src/main/html/js-ext/excanvas-License.txt
@@ -1,53 +1,53 @@
-Apache License
-Version 2.0, January 2004
-http://www.apache.org/licenses/
-
-TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-1. Definitions.
-
-"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
-
-"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
-
-"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
-
-"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
-
-"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
-
-"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
-
-"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
-
-"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
-
-"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
-
-"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
-
-2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
-
-3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
-
-4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
-
- 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
-
- 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
-
- 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
-
- 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
-
-You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
-
-5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
-
-6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
-
-7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
-
-8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
-
+Apache License
+Version 2.0, January 2004
+http://www.apache.org/licenses/
+
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+1. Definitions.
+
+"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
+
+"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
+
+"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
+
+"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
+
+"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
+
+"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
+
+"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
+
+"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
+
+"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
+
+"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
+
+2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
+
+3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
+
+4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
+
+ 1. You must give any other recipients of the Work or Derivative Works a copy of this License; and
+
+ 2. You must cause any modified files to carry prominent notices stating that You changed the files; and
+
+ 3. You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
+
+ 4. If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
+
+You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
+
+5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
+
+6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
+
+7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
+
+8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
+
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/excanvas.js b/shrine-webclient/src/main/html/js-ext/excanvas.js
old mode 100755
new mode 100644
index a7fe6f89b..3e1aedf80
--- a/shrine-webclient/src/main/html/js-ext/excanvas.js
+++ b/shrine-webclient/src/main/html/js-ext/excanvas.js
@@ -1,785 +1,785 @@
-// Copyright 2006 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-// Known Issues:
-//
-// * Patterns are not implemented.
-// * Radial gradient are not implemented. The VML version of these look very
-// different from the canvas one.
-// * Clipping paths are not implemented.
-// * Coordsize. The width and height attribute have higher priority than the
-// width and height style values which isn't correct.
-// * Painting mode isn't implemented.
-// * Canvas width/height should is using content-box by default. IE in
-// Quirks mode will draw the canvas using border-box. Either change your
-// doctype to HTML5
-// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
-// or use Box Sizing Behavior from WebFX
-// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
-// * Optimize. There is always room for speed improvements.
-
-// only add this code if we do not already have a canvas implementation
-if (!window.CanvasRenderingContext2D) {
-
-(function () {
-
- // alias some functions to make (compiled) code shorter
- var m = Math;
- var mr = m.round;
- var ms = m.sin;
- var mc = m.cos;
-
- // this is used for sub pixel precision
- var Z = 10;
- var Z2 = Z / 2;
-
- var G_vmlCanvasManager_ = {
- init: function (opt_doc) {
- var doc = opt_doc || document;
- if (/MSIE/.test(navigator.userAgent) && !window.opera) {
- var self = this;
- doc.attachEvent("onreadystatechange", function () {
- self.init_(doc);
- });
- }
- },
-
- init_: function (doc) {
- if (doc.readyState == "complete") {
- // create xmlns
- if (!doc.namespaces["g_vml_"]) {
- doc.namespaces.add("g_vml_", "urn:schemas-microsoft-com:vml");
- }
-
- // setup default css
- var ss = doc.createStyleSheet();
- ss.cssText = "canvas{display:inline-block;overflow:hidden;" +
- // default size is 300x150 in Gecko and Opera
- "text-align:left;width:300px;height:150px}" +
- "g_vml_\\:*{behavior:url(#default#VML)}";
-
- // find all canvas elements
- var els = doc.getElementsByTagName("canvas");
- for (var i = 0; i < els.length; i++) {
- if (!els[i].getContext) {
- this.initElement(els[i]);
- }
- }
- }
- },
-
- fixElement_: function (el) {
- // in IE before version 5.5 we would need to add HTML: to the tag name
- // but we do not care about IE before version 6
- var outerHTML = el.outerHTML;
-
- var newEl = el.ownerDocument.createElement(outerHTML);
- // if the tag is still open IE has created the children as siblings and
- // it has also created a tag with the name "/FOO"
- if (outerHTML.slice(-2) != "/>") {
- var tagName = "/" + el.tagName;
- var ns;
- // remove content
- while ((ns = el.nextSibling) && ns.tagName != tagName) {
- ns.removeNode();
- }
- // remove the incorrect closing tag
- if (ns) {
- ns.removeNode();
- }
- }
- el.parentNode.replaceChild(newEl, el);
- return newEl;
- },
-
- /**
- * Public initializes a canvas element so that it can be used as canvas
- * element from now on. This is called automatically before the page is
- * loaded but if you are creating elements using createElement you need to
- * make sure this is called on the element.
- * @param {HTMLElement} el The canvas element to initialize.
- * @return {HTMLElement} the element that was created.
- */
- initElement: function (el) {
- el = this.fixElement_(el);
- el.getContext = function () {
- if (this.context_) {
- return this.context_;
- }
- return this.context_ = new CanvasRenderingContext2D_(this);
- };
-
- // do not use inline function because that will leak memory
- el.attachEvent('onpropertychange', onPropertyChange);
- el.attachEvent('onresize', onResize);
-
- var attrs = el.attributes;
- if (attrs.width && attrs.width.specified) {
- // TODO: use runtimeStyle and coordsize
- // el.getContext().setWidth_(attrs.width.nodeValue);
- el.style.width = attrs.width.nodeValue + "px";
- } else {
- el.width = el.clientWidth;
- }
- if (attrs.height && attrs.height.specified) {
- // TODO: use runtimeStyle and coordsize
- // el.getContext().setHeight_(attrs.height.nodeValue);
- el.style.height = attrs.height.nodeValue + "px";
- } else {
- el.height = el.clientHeight;
- }
- //el.getContext().setCoordsize_()
- return el;
- }
- };
-
- function onPropertyChange(e) {
- var el = e.srcElement;
-
- switch (e.propertyName) {
- case 'width':
- el.style.width = el.attributes.width.nodeValue + "px";
- el.getContext().clearRect();
- break;
- case 'height':
- el.style.height = el.attributes.height.nodeValue + "px";
- el.getContext().clearRect();
- break;
- }
- }
-
- function onResize(e) {
- var el = e.srcElement;
- if (el.firstChild) {
- el.firstChild.style.width = el.clientWidth + 'px';
- el.firstChild.style.height = el.clientHeight + 'px';
- }
- }
-
- G_vmlCanvasManager_.init();
-
- // precompute "00" to "FF"
- var dec2hex = [];
- for (var i = 0; i < 16; i++) {
- for (var j = 0; j < 16; j++) {
- dec2hex[i * 16 + j] = i.toString(16) + j.toString(16);
- }
- }
-
- function createMatrixIdentity() {
- return [
- [1, 0, 0],
- [0, 1, 0],
- [0, 0, 1]
- ];
- }
-
- function matrixMultiply(m1, m2) {
- var result = createMatrixIdentity();
-
- for (var x = 0; x < 3; x++) {
- for (var y = 0; y < 3; y++) {
- var sum = 0;
-
- for (var z = 0; z < 3; z++) {
- sum += m1[x][z] * m2[z][y];
- }
-
- result[x][y] = sum;
- }
- }
- return result;
- }
-
- function copyState(o1, o2) {
- o2.fillStyle = o1.fillStyle;
- o2.lineCap = o1.lineCap;
- o2.lineJoin = o1.lineJoin;
- o2.lineWidth = o1.lineWidth;
- o2.miterLimit = o1.miterLimit;
- o2.shadowBlur = o1.shadowBlur;
- o2.shadowColor = o1.shadowColor;
- o2.shadowOffsetX = o1.shadowOffsetX;
- o2.shadowOffsetY = o1.shadowOffsetY;
- o2.strokeStyle = o1.strokeStyle;
- o2.arcScaleX_ = o1.arcScaleX_;
- o2.arcScaleY_ = o1.arcScaleY_;
- }
-
- function processStyle(styleString) {
- var str, alpha = 1;
-
- styleString = String(styleString);
- if (styleString.substring(0, 3) == "rgb") {
- var start = styleString.indexOf("(", 3);
- var end = styleString.indexOf(")", start + 1);
- var guts = styleString.substring(start + 1, end).split(",");
-
- str = "#";
- for (var i = 0; i < 3; i++) {
- str += dec2hex[Number(guts[i])];
- }
-
- if ((guts.length == 4) && (styleString.substr(3, 1) == "a")) {
- alpha = guts[3];
- }
- } else {
- str = styleString;
- }
-
- return [str, alpha];
- }
-
- function processLineCap(lineCap) {
- switch (lineCap) {
- case "butt":
- return "flat";
- case "round":
- return "round";
- case "square":
- default:
- return "square";
- }
- }
-
- /**
- * This class implements CanvasRenderingContext2D interface as described by
- * the WHATWG.
- * @param {HTMLElement} surfaceElement The element that the 2D context should
- * be associated with
- */
- function CanvasRenderingContext2D_(surfaceElement) {
- this.m_ = createMatrixIdentity();
-
- this.mStack_ = [];
- this.aStack_ = [];
- this.currentPath_ = [];
-
- // Canvas context properties
- this.strokeStyle = "#000";
- this.fillStyle = "#000";
-
- this.lineWidth = 1;
- this.lineJoin = "miter";
- this.lineCap = "butt";
- this.miterLimit = Z * 1;
- this.globalAlpha = 1;
- this.canvas = surfaceElement;
-
- var el = surfaceElement.ownerDocument.createElement('div');
- el.style.width = surfaceElement.clientWidth + 'px';
- el.style.height = surfaceElement.clientHeight + 'px';
- el.style.overflow = 'hidden';
- el.style.position = 'absolute';
- surfaceElement.appendChild(el);
-
- this.element_ = el;
- this.arcScaleX_ = 1;
- this.arcScaleY_ = 1;
- };
-
- var contextPrototype = CanvasRenderingContext2D_.prototype;
- contextPrototype.clearRect = function() {
- this.element_.innerHTML = "";
- this.currentPath_ = [];
- };
-
- contextPrototype.beginPath = function() {
- // TODO: Branch current matrix so that save/restore has no effect
- // as per safari docs.
-
- this.currentPath_ = [];
- };
-
- contextPrototype.moveTo = function(aX, aY) {
- this.currentPath_.push({type: "moveTo", x: aX, y: aY});
- this.currentX_ = aX;
- this.currentY_ = aY;
- };
-
- contextPrototype.lineTo = function(aX, aY) {
- this.currentPath_.push({type: "lineTo", x: aX, y: aY});
- this.currentX_ = aX;
- this.currentY_ = aY;
- };
-
- contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
- aCP2x, aCP2y,
- aX, aY) {
- this.currentPath_.push({type: "bezierCurveTo",
- cp1x: aCP1x,
- cp1y: aCP1y,
- cp2x: aCP2x,
- cp2y: aCP2y,
- x: aX,
- y: aY});
- this.currentX_ = aX;
- this.currentY_ = aY;
- };
-
- contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
- // the following is lifted almost directly from
- // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
- var cp1x = this.currentX_ + 2.0 / 3.0 * (aCPx - this.currentX_);
- var cp1y = this.currentY_ + 2.0 / 3.0 * (aCPy - this.currentY_);
- var cp2x = cp1x + (aX - this.currentX_) / 3.0;
- var cp2y = cp1y + (aY - this.currentY_) / 3.0;
- this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, aX, aY);
- };
-
- contextPrototype.arc = function(aX, aY, aRadius,
- aStartAngle, aEndAngle, aClockwise) {
- aRadius *= Z;
- var arcType = aClockwise ? "at" : "wa";
-
- var xStart = aX + (mc(aStartAngle) * aRadius) - Z2;
- var yStart = aY + (ms(aStartAngle) * aRadius) - Z2;
-
- var xEnd = aX + (mc(aEndAngle) * aRadius) - Z2;
- var yEnd = aY + (ms(aEndAngle) * aRadius) - Z2;
-
- // IE won't render arches drawn counter clockwise if xStart == xEnd.
- if (xStart == xEnd && !aClockwise) {
- xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
- // that can be represented in binary
- }
-
- this.currentPath_.push({type: arcType,
- x: aX,
- y: aY,
- radius: aRadius,
- xStart: xStart,
- yStart: yStart,
- xEnd: xEnd,
- yEnd: yEnd});
-
- };
-
- contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
- this.moveTo(aX, aY);
- this.lineTo(aX + aWidth, aY);
- this.lineTo(aX + aWidth, aY + aHeight);
- this.lineTo(aX, aY + aHeight);
- this.closePath();
- };
-
- contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
- // Will destroy any existing path (same as FF behaviour)
- this.beginPath();
- this.moveTo(aX, aY);
- this.lineTo(aX + aWidth, aY);
- this.lineTo(aX + aWidth, aY + aHeight);
- this.lineTo(aX, aY + aHeight);
- this.closePath();
- this.stroke();
- };
-
- contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
- // Will destroy any existing path (same as FF behaviour)
- this.beginPath();
- this.moveTo(aX, aY);
- this.lineTo(aX + aWidth, aY);
- this.lineTo(aX + aWidth, aY + aHeight);
- this.lineTo(aX, aY + aHeight);
- this.closePath();
- this.fill();
- };
-
- contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
- var gradient = new CanvasGradient_("gradient");
- return gradient;
- };
-
- contextPrototype.createRadialGradient = function(aX0, aY0,
- aR0, aX1,
- aY1, aR1) {
- var gradient = new CanvasGradient_("gradientradial");
- gradient.radius1_ = aR0;
- gradient.radius2_ = aR1;
- gradient.focus_.x = aX0;
- gradient.focus_.y = aY0;
- return gradient;
- };
-
- contextPrototype.drawImage = function (image, var_args) {
- var dx, dy, dw, dh, sx, sy, sw, sh;
-
- // to find the original width we overide the width and height
- var oldRuntimeWidth = image.runtimeStyle.width;
- var oldRuntimeHeight = image.runtimeStyle.height;
- image.runtimeStyle.width = 'auto';
- image.runtimeStyle.height = 'auto';
-
- // get the original size
- var w = image.width;
- var h = image.height;
-
- // and remove overides
- image.runtimeStyle.width = oldRuntimeWidth;
- image.runtimeStyle.height = oldRuntimeHeight;
-
- if (arguments.length == 3) {
- dx = arguments[1];
- dy = arguments[2];
- sx = sy = 0;
- sw = dw = w;
- sh = dh = h;
- } else if (arguments.length == 5) {
- dx = arguments[1];
- dy = arguments[2];
- dw = arguments[3];
- dh = arguments[4];
- sx = sy = 0;
- sw = w;
- sh = h;
- } else if (arguments.length == 9) {
- sx = arguments[1];
- sy = arguments[2];
- sw = arguments[3];
- sh = arguments[4];
- dx = arguments[5];
- dy = arguments[6];
- dw = arguments[7];
- dh = arguments[8];
- } else {
- throw "Invalid number of arguments";
- }
-
- var d = this.getCoords_(dx, dy);
-
- var w2 = sw / 2;
- var h2 = sh / 2;
-
- var vmlStr = [];
-
- var W = 10;
- var H = 10;
-
- // For some reason that I've now forgotten, using divs didn't work
- vmlStr.push(' <g_vml_:group',
- ' coordsize="', Z * W, ',', Z * H, '"',
- ' coordorigin="0,0"' ,
- ' style="width:', W, ';height:', H, ';position:absolute;');
-
- // If filters are necessary (rotation exists), create them
- // filters are bog-slow, so only create them if abbsolutely necessary
- // The following check doesn't account for skews (which don't exist
- // in the canvas spec (yet) anyway.
-
- if (this.m_[0][0] != 1 || this.m_[0][1]) {
- var filter = [];
-
- // Note the 12/21 reversal
- filter.push("M11='", this.m_[0][0], "',",
- "M12='", this.m_[1][0], "',",
- "M21='", this.m_[0][1], "',",
- "M22='", this.m_[1][1], "',",
- "Dx='", mr(d.x / Z), "',",
- "Dy='", mr(d.y / Z), "'");
-
- // Bounding box calculation (need to minimize displayed area so that
- // filters don't waste time on unused pixels.
- var max = d;
- var c2 = this.getCoords_(dx + dw, dy);
- var c3 = this.getCoords_(dx, dy + dh);
- var c4 = this.getCoords_(dx + dw, dy + dh);
-
- max.x = Math.max(max.x, c2.x, c3.x, c4.x);
- max.y = Math.max(max.y, c2.y, c3.y, c4.y);
-
- vmlStr.push("padding:0 ", mr(max.x / Z), "px ", mr(max.y / Z),
- "px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",
- filter.join(""), ", sizingmethod='clip');")
- } else {
- vmlStr.push("top:", mr(d.y / Z), "px;left:", mr(d.x / Z), "px;")
- }
-
- vmlStr.push(' ">' ,
- '<g_vml_:image src="', image.src, '"',
- ' style="width:', Z * dw, ';',
- ' height:', Z * dh, ';"',
- ' cropleft="', sx / w, '"',
- ' croptop="', sy / h, '"',
- ' cropright="', (w - sx - sw) / w, '"',
- ' cropbottom="', (h - sy - sh) / h, '"',
- ' />',
- '</g_vml_:group>');
-
- this.element_.insertAdjacentHTML("BeforeEnd",
- vmlStr.join(""));
- };
-
- contextPrototype.stroke = function(aFill) {
- var lineStr = [];
- var lineOpen = false;
- var a = processStyle(aFill ? this.fillStyle : this.strokeStyle);
- var color = a[0];
- var opacity = a[1] * this.globalAlpha;
-
- var W = 10;
- var H = 10;
-
- lineStr.push('<g_vml_:shape',
- ' fillcolor="', color, '"',
- ' filled="', Boolean(aFill), '"',
- ' style="position:absolute;width:', W, ';height:', H, ';"',
- ' coordorigin="0 0" coordsize="', Z * W, ' ', Z * H, '"',
- ' stroked="', !aFill, '"',
- ' strokeweight="', this.lineWidth, '"',
- ' strokecolor="', color, '"',
- ' path="');
-
- var newSeq = false;
- var min = {x: null, y: null};
- var max = {x: null, y: null};
-
- for (var i = 0; i < this.currentPath_.length; i++) {
- var p = this.currentPath_[i];
-
- if (p.type == "moveTo") {
- lineStr.push(" m ");
- var c = this.getCoords_(p.x, p.y);
- lineStr.push(mr(c.x), ",", mr(c.y));
- } else if (p.type == "lineTo") {
- lineStr.push(" l ");
- var c = this.getCoords_(p.x, p.y);
- lineStr.push(mr(c.x), ",", mr(c.y));
- } else if (p.type == "close") {
- lineStr.push(" x ");
- } else if (p.type == "bezierCurveTo") {
- lineStr.push(" c ");
- var c = this.getCoords_(p.x, p.y);
- var c1 = this.getCoords_(p.cp1x, p.cp1y);
- var c2 = this.getCoords_(p.cp2x, p.cp2y);
- lineStr.push(mr(c1.x), ",", mr(c1.y), ",",
- mr(c2.x), ",", mr(c2.y), ",",
- mr(c.x), ",", mr(c.y));
- } else if (p.type == "at" || p.type == "wa") {
- lineStr.push(" ", p.type, " ");
- var c = this.getCoords_(p.x, p.y);
- var cStart = this.getCoords_(p.xStart, p.yStart);
- var cEnd = this.getCoords_(p.xEnd, p.yEnd);
-
- lineStr.push(mr(c.x - this.arcScaleX_ * p.radius), ",",
- mr(c.y - this.arcScaleY_ * p.radius), " ",
- mr(c.x + this.arcScaleX_ * p.radius), ",",
- mr(c.y + this.arcScaleY_ * p.radius), " ",
- mr(cStart.x), ",", mr(cStart.y), " ",
- mr(cEnd.x), ",", mr(cEnd.y));
- }
-
-
- // TODO: Following is broken for curves due to
- // move to proper paths.
-
- // Figure out dimensions so we can do gradient fills
- // properly
- if(c) {
- if (min.x == null || c.x < min.x) {
- min.x = c.x;
- }
- if (max.x == null || c.x > max.x) {
- max.x = c.x;
- }
- if (min.y == null || c.y < min.y) {
- min.y = c.y;
- }
- if (max.y == null || c.y > max.y) {
- max.y = c.y;
- }
- }
- }
- lineStr.push(' ">');
-
- if (typeof this.fillStyle == "object") {
- var focus = {x: "50%", y: "50%"};
- var width = (max.x - min.x);
- var height = (max.y - min.y);
- var dimension = (width > height) ? width : height;
-
- focus.x = mr((this.fillStyle.focus_.x / width) * 100 + 50) + "%";
- focus.y = mr((this.fillStyle.focus_.y / height) * 100 + 50) + "%";
-
- var colors = [];
-
- // inside radius (%)
- if (this.fillStyle.type_ == "gradientradial") {
- var inside = (this.fillStyle.radius1_ / dimension * 100);
-
- // percentage that outside radius exceeds inside radius
- var expansion = (this.fillStyle.radius2_ / dimension * 100) - inside;
- } else {
- var inside = 0;
- var expansion = 100;
- }
-
- var insidecolor = {offset: null, color: null};
- var outsidecolor = {offset: null, color: null};
-
- // We need to sort 'colors' by percentage, from 0 > 100 otherwise ie
- // won't interpret it correctly
- this.fillStyle.colors_.sort(function (cs1, cs2) {
- return cs1.offset - cs2.offset;
- });
-
- for (var i = 0; i < this.fillStyle.colors_.length; i++) {
- var fs = this.fillStyle.colors_[i];
-
- colors.push( (fs.offset * expansion) + inside, "% ", fs.color, ",");
-
- if (fs.offset > insidecolor.offset || insidecolor.offset == null) {
- insidecolor.offset = fs.offset;
- insidecolor.color = fs.color;
- }
-
- if (fs.offset < outsidecolor.offset || outsidecolor.offset == null) {
- outsidecolor.offset = fs.offset;
- outsidecolor.color = fs.color;
- }
- }
- colors.pop();
-
- lineStr.push('<g_vml_:fill',
- ' color="', outsidecolor.color, '"',
- ' color2="', insidecolor.color, '"',
- ' type="', this.fillStyle.type_, '"',
- ' focusposition="', focus.x, ', ', focus.y, '"',
- ' colors="', colors.join(""), '"',
- ' opacity="', opacity, '" />');
- } else if (aFill) {
- lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity, '" />');
- } else {
- lineStr.push(
- '<g_vml_:stroke',
- ' opacity="', opacity,'"',
- ' joinstyle="', this.lineJoin, '"',
- ' miterlimit="', this.miterLimit, '"',
- ' endcap="', processLineCap(this.lineCap) ,'"',
- ' weight="', this.lineWidth, 'px"',
- ' color="', color,'" />'
- );
- }
-
- lineStr.push("</g_vml_:shape>");
-
- this.element_.insertAdjacentHTML("beforeEnd", lineStr.join(""));
-
- this.currentPath_ = [];
- };
-
- contextPrototype.fill = function() {
- this.stroke(true);
- }
-
- contextPrototype.closePath = function() {
- this.currentPath_.push({type: "close"});
- };
-
- /**
- * @private
- */
- contextPrototype.getCoords_ = function(aX, aY) {
- return {
- x: Z * (aX * this.m_[0][0] + aY * this.m_[1][0] + this.m_[2][0]) - Z2,
- y: Z * (aX * this.m_[0][1] + aY * this.m_[1][1] + this.m_[2][1]) - Z2
- }
- };
-
- contextPrototype.save = function() {
- var o = {};
- copyState(this, o);
- this.aStack_.push(o);
- this.mStack_.push(this.m_);
- this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
- };
-
- contextPrototype.restore = function() {
- copyState(this.aStack_.pop(), this);
- this.m_ = this.mStack_.pop();
- };
-
- contextPrototype.translate = function(aX, aY) {
- var m1 = [
- [1, 0, 0],
- [0, 1, 0],
- [aX, aY, 1]
- ];
-
- this.m_ = matrixMultiply(m1, this.m_);
- };
-
- contextPrototype.rotate = function(aRot) {
- var c = mc(aRot);
- var s = ms(aRot);
-
- var m1 = [
- [c, s, 0],
- [-s, c, 0],
- [0, 0, 1]
- ];
-
- this.m_ = matrixMultiply(m1, this.m_);
- };
-
- contextPrototype.scale = function(aX, aY) {
- this.arcScaleX_ *= aX;
- this.arcScaleY_ *= aY;
- var m1 = [
- [aX, 0, 0],
- [0, aY, 0],
- [0, 0, 1]
- ];
-
- this.m_ = matrixMultiply(m1, this.m_);
- };
-
- /******** STUBS ********/
- contextPrototype.clip = function() {
- // TODO: Implement
- };
-
- contextPrototype.arcTo = function() {
- // TODO: Implement
- };
-
- contextPrototype.createPattern = function() {
- return new CanvasPattern_;
- };
-
- // Gradient / Pattern Stubs
- function CanvasGradient_(aType) {
- this.type_ = aType;
- this.radius1_ = 0;
- this.radius2_ = 0;
- this.colors_ = [];
- this.focus_ = {x: 0, y: 0};
- }
-
- CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
- aColor = processStyle(aColor);
- this.colors_.push({offset: 1-aOffset, color: aColor});
- };
-
- function CanvasPattern_() {}
-
- // set up externs
- G_vmlCanvasManager = G_vmlCanvasManager_;
- CanvasRenderingContext2D = CanvasRenderingContext2D_;
- CanvasGradient = CanvasGradient_;
- CanvasPattern = CanvasPattern_;
-
-})();
-
-} // if
+// Copyright 2006 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+
+// Known Issues:
+//
+// * Patterns are not implemented.
+// * Radial gradient are not implemented. The VML version of these look very
+// different from the canvas one.
+// * Clipping paths are not implemented.
+// * Coordsize. The width and height attribute have higher priority than the
+// width and height style values which isn't correct.
+// * Painting mode isn't implemented.
+// * Canvas width/height should is using content-box by default. IE in
+// Quirks mode will draw the canvas using border-box. Either change your
+// doctype to HTML5
+// (http://www.whatwg.org/specs/web-apps/current-work/#the-doctype)
+// or use Box Sizing Behavior from WebFX
+// (http://webfx.eae.net/dhtml/boxsizing/boxsizing.html)
+// * Optimize. There is always room for speed improvements.
+
+// only add this code if we do not already have a canvas implementation
+if (!window.CanvasRenderingContext2D) {
+
+(function () {
+
+ // alias some functions to make (compiled) code shorter
+ var m = Math;
+ var mr = m.round;
+ var ms = m.sin;
+ var mc = m.cos;
+
+ // this is used for sub pixel precision
+ var Z = 10;
+ var Z2 = Z / 2;
+
+ var G_vmlCanvasManager_ = {
+ init: function (opt_doc) {
+ var doc = opt_doc || document;
+ if (/MSIE/.test(navigator.userAgent) && !window.opera) {
+ var self = this;
+ doc.attachEvent("onreadystatechange", function () {
+ self.init_(doc);
+ });
+ }
+ },
+
+ init_: function (doc) {
+ if (doc.readyState == "complete") {
+ // create xmlns
+ if (!doc.namespaces["g_vml_"]) {
+ doc.namespaces.add("g_vml_", "urn:schemas-microsoft-com:vml");
+ }
+
+ // setup default css
+ var ss = doc.createStyleSheet();
+ ss.cssText = "canvas{display:inline-block;overflow:hidden;" +
+ // default size is 300x150 in Gecko and Opera
+ "text-align:left;width:300px;height:150px}" +
+ "g_vml_\\:*{behavior:url(#default#VML)}";
+
+ // find all canvas elements
+ var els = doc.getElementsByTagName("canvas");
+ for (var i = 0; i < els.length; i++) {
+ if (!els[i].getContext) {
+ this.initElement(els[i]);
+ }
+ }
+ }
+ },
+
+ fixElement_: function (el) {
+ // in IE before version 5.5 we would need to add HTML: to the tag name
+ // but we do not care about IE before version 6
+ var outerHTML = el.outerHTML;
+
+ var newEl = el.ownerDocument.createElement(outerHTML);
+ // if the tag is still open IE has created the children as siblings and
+ // it has also created a tag with the name "/FOO"
+ if (outerHTML.slice(-2) != "/>") {
+ var tagName = "/" + el.tagName;
+ var ns;
+ // remove content
+ while ((ns = el.nextSibling) && ns.tagName != tagName) {
+ ns.removeNode();
+ }
+ // remove the incorrect closing tag
+ if (ns) {
+ ns.removeNode();
+ }
+ }
+ el.parentNode.replaceChild(newEl, el);
+ return newEl;
+ },
+
+ /**
+ * Public initializes a canvas element so that it can be used as canvas
+ * element from now on. This is called automatically before the page is
+ * loaded but if you are creating elements using createElement you need to
+ * make sure this is called on the element.
+ * @param {HTMLElement} el The canvas element to initialize.
+ * @return {HTMLElement} the element that was created.
+ */
+ initElement: function (el) {
+ el = this.fixElement_(el);
+ el.getContext = function () {
+ if (this.context_) {
+ return this.context_;
+ }
+ return this.context_ = new CanvasRenderingContext2D_(this);
+ };
+
+ // do not use inline function because that will leak memory
+ el.attachEvent('onpropertychange', onPropertyChange);
+ el.attachEvent('onresize', onResize);
+
+ var attrs = el.attributes;
+ if (attrs.width && attrs.width.specified) {
+ // TODO: use runtimeStyle and coordsize
+ // el.getContext().setWidth_(attrs.width.nodeValue);
+ el.style.width = attrs.width.nodeValue + "px";
+ } else {
+ el.width = el.clientWidth;
+ }
+ if (attrs.height && attrs.height.specified) {
+ // TODO: use runtimeStyle and coordsize
+ // el.getContext().setHeight_(attrs.height.nodeValue);
+ el.style.height = attrs.height.nodeValue + "px";
+ } else {
+ el.height = el.clientHeight;
+ }
+ //el.getContext().setCoordsize_()
+ return el;
+ }
+ };
+
+ function onPropertyChange(e) {
+ var el = e.srcElement;
+
+ switch (e.propertyName) {
+ case 'width':
+ el.style.width = el.attributes.width.nodeValue + "px";
+ el.getContext().clearRect();
+ break;
+ case 'height':
+ el.style.height = el.attributes.height.nodeValue + "px";
+ el.getContext().clearRect();
+ break;
+ }
+ }
+
+ function onResize(e) {
+ var el = e.srcElement;
+ if (el.firstChild) {
+ el.firstChild.style.width = el.clientWidth + 'px';
+ el.firstChild.style.height = el.clientHeight + 'px';
+ }
+ }
+
+ G_vmlCanvasManager_.init();
+
+ // precompute "00" to "FF"
+ var dec2hex = [];
+ for (var i = 0; i < 16; i++) {
+ for (var j = 0; j < 16; j++) {
+ dec2hex[i * 16 + j] = i.toString(16) + j.toString(16);
+ }
+ }
+
+ function createMatrixIdentity() {
+ return [
+ [1, 0, 0],
+ [0, 1, 0],
+ [0, 0, 1]
+ ];
+ }
+
+ function matrixMultiply(m1, m2) {
+ var result = createMatrixIdentity();
+
+ for (var x = 0; x < 3; x++) {
+ for (var y = 0; y < 3; y++) {
+ var sum = 0;
+
+ for (var z = 0; z < 3; z++) {
+ sum += m1[x][z] * m2[z][y];
+ }
+
+ result[x][y] = sum;
+ }
+ }
+ return result;
+ }
+
+ function copyState(o1, o2) {
+ o2.fillStyle = o1.fillStyle;
+ o2.lineCap = o1.lineCap;
+ o2.lineJoin = o1.lineJoin;
+ o2.lineWidth = o1.lineWidth;
+ o2.miterLimit = o1.miterLimit;
+ o2.shadowBlur = o1.shadowBlur;
+ o2.shadowColor = o1.shadowColor;
+ o2.shadowOffsetX = o1.shadowOffsetX;
+ o2.shadowOffsetY = o1.shadowOffsetY;
+ o2.strokeStyle = o1.strokeStyle;
+ o2.arcScaleX_ = o1.arcScaleX_;
+ o2.arcScaleY_ = o1.arcScaleY_;
+ }
+
+ function processStyle(styleString) {
+ var str, alpha = 1;
+
+ styleString = String(styleString);
+ if (styleString.substring(0, 3) == "rgb") {
+ var start = styleString.indexOf("(", 3);
+ var end = styleString.indexOf(")", start + 1);
+ var guts = styleString.substring(start + 1, end).split(",");
+
+ str = "#";
+ for (var i = 0; i < 3; i++) {
+ str += dec2hex[Number(guts[i])];
+ }
+
+ if ((guts.length == 4) && (styleString.substr(3, 1) == "a")) {
+ alpha = guts[3];
+ }
+ } else {
+ str = styleString;
+ }
+
+ return [str, alpha];
+ }
+
+ function processLineCap(lineCap) {
+ switch (lineCap) {
+ case "butt":
+ return "flat";
+ case "round":
+ return "round";
+ case "square":
+ default:
+ return "square";
+ }
+ }
+
+ /**
+ * This class implements CanvasRenderingContext2D interface as described by
+ * the WHATWG.
+ * @param {HTMLElement} surfaceElement The element that the 2D context should
+ * be associated with
+ */
+ function CanvasRenderingContext2D_(surfaceElement) {
+ this.m_ = createMatrixIdentity();
+
+ this.mStack_ = [];
+ this.aStack_ = [];
+ this.currentPath_ = [];
+
+ // Canvas context properties
+ this.strokeStyle = "#000";
+ this.fillStyle = "#000";
+
+ this.lineWidth = 1;
+ this.lineJoin = "miter";
+ this.lineCap = "butt";
+ this.miterLimit = Z * 1;
+ this.globalAlpha = 1;
+ this.canvas = surfaceElement;
+
+ var el = surfaceElement.ownerDocument.createElement('div');
+ el.style.width = surfaceElement.clientWidth + 'px';
+ el.style.height = surfaceElement.clientHeight + 'px';
+ el.style.overflow = 'hidden';
+ el.style.position = 'absolute';
+ surfaceElement.appendChild(el);
+
+ this.element_ = el;
+ this.arcScaleX_ = 1;
+ this.arcScaleY_ = 1;
+ };
+
+ var contextPrototype = CanvasRenderingContext2D_.prototype;
+ contextPrototype.clearRect = function() {
+ this.element_.innerHTML = "";
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.beginPath = function() {
+ // TODO: Branch current matrix so that save/restore has no effect
+ // as per safari docs.
+
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.moveTo = function(aX, aY) {
+ this.currentPath_.push({type: "moveTo", x: aX, y: aY});
+ this.currentX_ = aX;
+ this.currentY_ = aY;
+ };
+
+ contextPrototype.lineTo = function(aX, aY) {
+ this.currentPath_.push({type: "lineTo", x: aX, y: aY});
+ this.currentX_ = aX;
+ this.currentY_ = aY;
+ };
+
+ contextPrototype.bezierCurveTo = function(aCP1x, aCP1y,
+ aCP2x, aCP2y,
+ aX, aY) {
+ this.currentPath_.push({type: "bezierCurveTo",
+ cp1x: aCP1x,
+ cp1y: aCP1y,
+ cp2x: aCP2x,
+ cp2y: aCP2y,
+ x: aX,
+ y: aY});
+ this.currentX_ = aX;
+ this.currentY_ = aY;
+ };
+
+ contextPrototype.quadraticCurveTo = function(aCPx, aCPy, aX, aY) {
+ // the following is lifted almost directly from
+ // http://developer.mozilla.org/en/docs/Canvas_tutorial:Drawing_shapes
+ var cp1x = this.currentX_ + 2.0 / 3.0 * (aCPx - this.currentX_);
+ var cp1y = this.currentY_ + 2.0 / 3.0 * (aCPy - this.currentY_);
+ var cp2x = cp1x + (aX - this.currentX_) / 3.0;
+ var cp2y = cp1y + (aY - this.currentY_) / 3.0;
+ this.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, aX, aY);
+ };
+
+ contextPrototype.arc = function(aX, aY, aRadius,
+ aStartAngle, aEndAngle, aClockwise) {
+ aRadius *= Z;
+ var arcType = aClockwise ? "at" : "wa";
+
+ var xStart = aX + (mc(aStartAngle) * aRadius) - Z2;
+ var yStart = aY + (ms(aStartAngle) * aRadius) - Z2;
+
+ var xEnd = aX + (mc(aEndAngle) * aRadius) - Z2;
+ var yEnd = aY + (ms(aEndAngle) * aRadius) - Z2;
+
+ // IE won't render arches drawn counter clockwise if xStart == xEnd.
+ if (xStart == xEnd && !aClockwise) {
+ xStart += 0.125; // Offset xStart by 1/80 of a pixel. Use something
+ // that can be represented in binary
+ }
+
+ this.currentPath_.push({type: arcType,
+ x: aX,
+ y: aY,
+ radius: aRadius,
+ xStart: xStart,
+ yStart: yStart,
+ xEnd: xEnd,
+ yEnd: yEnd});
+
+ };
+
+ contextPrototype.rect = function(aX, aY, aWidth, aHeight) {
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ };
+
+ contextPrototype.strokeRect = function(aX, aY, aWidth, aHeight) {
+ // Will destroy any existing path (same as FF behaviour)
+ this.beginPath();
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ this.stroke();
+ };
+
+ contextPrototype.fillRect = function(aX, aY, aWidth, aHeight) {
+ // Will destroy any existing path (same as FF behaviour)
+ this.beginPath();
+ this.moveTo(aX, aY);
+ this.lineTo(aX + aWidth, aY);
+ this.lineTo(aX + aWidth, aY + aHeight);
+ this.lineTo(aX, aY + aHeight);
+ this.closePath();
+ this.fill();
+ };
+
+ contextPrototype.createLinearGradient = function(aX0, aY0, aX1, aY1) {
+ var gradient = new CanvasGradient_("gradient");
+ return gradient;
+ };
+
+ contextPrototype.createRadialGradient = function(aX0, aY0,
+ aR0, aX1,
+ aY1, aR1) {
+ var gradient = new CanvasGradient_("gradientradial");
+ gradient.radius1_ = aR0;
+ gradient.radius2_ = aR1;
+ gradient.focus_.x = aX0;
+ gradient.focus_.y = aY0;
+ return gradient;
+ };
+
+ contextPrototype.drawImage = function (image, var_args) {
+ var dx, dy, dw, dh, sx, sy, sw, sh;
+
+ // to find the original width we overide the width and height
+ var oldRuntimeWidth = image.runtimeStyle.width;
+ var oldRuntimeHeight = image.runtimeStyle.height;
+ image.runtimeStyle.width = 'auto';
+ image.runtimeStyle.height = 'auto';
+
+ // get the original size
+ var w = image.width;
+ var h = image.height;
+
+ // and remove overides
+ image.runtimeStyle.width = oldRuntimeWidth;
+ image.runtimeStyle.height = oldRuntimeHeight;
+
+ if (arguments.length == 3) {
+ dx = arguments[1];
+ dy = arguments[2];
+ sx = sy = 0;
+ sw = dw = w;
+ sh = dh = h;
+ } else if (arguments.length == 5) {
+ dx = arguments[1];
+ dy = arguments[2];
+ dw = arguments[3];
+ dh = arguments[4];
+ sx = sy = 0;
+ sw = w;
+ sh = h;
+ } else if (arguments.length == 9) {
+ sx = arguments[1];
+ sy = arguments[2];
+ sw = arguments[3];
+ sh = arguments[4];
+ dx = arguments[5];
+ dy = arguments[6];
+ dw = arguments[7];
+ dh = arguments[8];
+ } else {
+ throw "Invalid number of arguments";
+ }
+
+ var d = this.getCoords_(dx, dy);
+
+ var w2 = sw / 2;
+ var h2 = sh / 2;
+
+ var vmlStr = [];
+
+ var W = 10;
+ var H = 10;
+
+ // For some reason that I've now forgotten, using divs didn't work
+ vmlStr.push(' <g_vml_:group',
+ ' coordsize="', Z * W, ',', Z * H, '"',
+ ' coordorigin="0,0"' ,
+ ' style="width:', W, ';height:', H, ';position:absolute;');
+
+ // If filters are necessary (rotation exists), create them
+ // filters are bog-slow, so only create them if abbsolutely necessary
+ // The following check doesn't account for skews (which don't exist
+ // in the canvas spec (yet) anyway.
+
+ if (this.m_[0][0] != 1 || this.m_[0][1]) {
+ var filter = [];
+
+ // Note the 12/21 reversal
+ filter.push("M11='", this.m_[0][0], "',",
+ "M12='", this.m_[1][0], "',",
+ "M21='", this.m_[0][1], "',",
+ "M22='", this.m_[1][1], "',",
+ "Dx='", mr(d.x / Z), "',",
+ "Dy='", mr(d.y / Z), "'");
+
+ // Bounding box calculation (need to minimize displayed area so that
+ // filters don't waste time on unused pixels.
+ var max = d;
+ var c2 = this.getCoords_(dx + dw, dy);
+ var c3 = this.getCoords_(dx, dy + dh);
+ var c4 = this.getCoords_(dx + dw, dy + dh);
+
+ max.x = Math.max(max.x, c2.x, c3.x, c4.x);
+ max.y = Math.max(max.y, c2.y, c3.y, c4.y);
+
+ vmlStr.push("padding:0 ", mr(max.x / Z), "px ", mr(max.y / Z),
+ "px 0;filter:progid:DXImageTransform.Microsoft.Matrix(",
+ filter.join(""), ", sizingmethod='clip');")
+ } else {
+ vmlStr.push("top:", mr(d.y / Z), "px;left:", mr(d.x / Z), "px;")
+ }
+
+ vmlStr.push(' ">' ,
+ '<g_vml_:image src="', image.src, '"',
+ ' style="width:', Z * dw, ';',
+ ' height:', Z * dh, ';"',
+ ' cropleft="', sx / w, '"',
+ ' croptop="', sy / h, '"',
+ ' cropright="', (w - sx - sw) / w, '"',
+ ' cropbottom="', (h - sy - sh) / h, '"',
+ ' />',
+ '</g_vml_:group>');
+
+ this.element_.insertAdjacentHTML("BeforeEnd",
+ vmlStr.join(""));
+ };
+
+ contextPrototype.stroke = function(aFill) {
+ var lineStr = [];
+ var lineOpen = false;
+ var a = processStyle(aFill ? this.fillStyle : this.strokeStyle);
+ var color = a[0];
+ var opacity = a[1] * this.globalAlpha;
+
+ var W = 10;
+ var H = 10;
+
+ lineStr.push('<g_vml_:shape',
+ ' fillcolor="', color, '"',
+ ' filled="', Boolean(aFill), '"',
+ ' style="position:absolute;width:', W, ';height:', H, ';"',
+ ' coordorigin="0 0" coordsize="', Z * W, ' ', Z * H, '"',
+ ' stroked="', !aFill, '"',
+ ' strokeweight="', this.lineWidth, '"',
+ ' strokecolor="', color, '"',
+ ' path="');
+
+ var newSeq = false;
+ var min = {x: null, y: null};
+ var max = {x: null, y: null};
+
+ for (var i = 0; i < this.currentPath_.length; i++) {
+ var p = this.currentPath_[i];
+
+ if (p.type == "moveTo") {
+ lineStr.push(" m ");
+ var c = this.getCoords_(p.x, p.y);
+ lineStr.push(mr(c.x), ",", mr(c.y));
+ } else if (p.type == "lineTo") {
+ lineStr.push(" l ");
+ var c = this.getCoords_(p.x, p.y);
+ lineStr.push(mr(c.x), ",", mr(c.y));
+ } else if (p.type == "close") {
+ lineStr.push(" x ");
+ } else if (p.type == "bezierCurveTo") {
+ lineStr.push(" c ");
+ var c = this.getCoords_(p.x, p.y);
+ var c1 = this.getCoords_(p.cp1x, p.cp1y);
+ var c2 = this.getCoords_(p.cp2x, p.cp2y);
+ lineStr.push(mr(c1.x), ",", mr(c1.y), ",",
+ mr(c2.x), ",", mr(c2.y), ",",
+ mr(c.x), ",", mr(c.y));
+ } else if (p.type == "at" || p.type == "wa") {
+ lineStr.push(" ", p.type, " ");
+ var c = this.getCoords_(p.x, p.y);
+ var cStart = this.getCoords_(p.xStart, p.yStart);
+ var cEnd = this.getCoords_(p.xEnd, p.yEnd);
+
+ lineStr.push(mr(c.x - this.arcScaleX_ * p.radius), ",",
+ mr(c.y - this.arcScaleY_ * p.radius), " ",
+ mr(c.x + this.arcScaleX_ * p.radius), ",",
+ mr(c.y + this.arcScaleY_ * p.radius), " ",
+ mr(cStart.x), ",", mr(cStart.y), " ",
+ mr(cEnd.x), ",", mr(cEnd.y));
+ }
+
+
+ // TODO: Following is broken for curves due to
+ // move to proper paths.
+
+ // Figure out dimensions so we can do gradient fills
+ // properly
+ if(c) {
+ if (min.x == null || c.x < min.x) {
+ min.x = c.x;
+ }
+ if (max.x == null || c.x > max.x) {
+ max.x = c.x;
+ }
+ if (min.y == null || c.y < min.y) {
+ min.y = c.y;
+ }
+ if (max.y == null || c.y > max.y) {
+ max.y = c.y;
+ }
+ }
+ }
+ lineStr.push(' ">');
+
+ if (typeof this.fillStyle == "object") {
+ var focus = {x: "50%", y: "50%"};
+ var width = (max.x - min.x);
+ var height = (max.y - min.y);
+ var dimension = (width > height) ? width : height;
+
+ focus.x = mr((this.fillStyle.focus_.x / width) * 100 + 50) + "%";
+ focus.y = mr((this.fillStyle.focus_.y / height) * 100 + 50) + "%";
+
+ var colors = [];
+
+ // inside radius (%)
+ if (this.fillStyle.type_ == "gradientradial") {
+ var inside = (this.fillStyle.radius1_ / dimension * 100);
+
+ // percentage that outside radius exceeds inside radius
+ var expansion = (this.fillStyle.radius2_ / dimension * 100) - inside;
+ } else {
+ var inside = 0;
+ var expansion = 100;
+ }
+
+ var insidecolor = {offset: null, color: null};
+ var outsidecolor = {offset: null, color: null};
+
+ // We need to sort 'colors' by percentage, from 0 > 100 otherwise ie
+ // won't interpret it correctly
+ this.fillStyle.colors_.sort(function (cs1, cs2) {
+ return cs1.offset - cs2.offset;
+ });
+
+ for (var i = 0; i < this.fillStyle.colors_.length; i++) {
+ var fs = this.fillStyle.colors_[i];
+
+ colors.push( (fs.offset * expansion) + inside, "% ", fs.color, ",");
+
+ if (fs.offset > insidecolor.offset || insidecolor.offset == null) {
+ insidecolor.offset = fs.offset;
+ insidecolor.color = fs.color;
+ }
+
+ if (fs.offset < outsidecolor.offset || outsidecolor.offset == null) {
+ outsidecolor.offset = fs.offset;
+ outsidecolor.color = fs.color;
+ }
+ }
+ colors.pop();
+
+ lineStr.push('<g_vml_:fill',
+ ' color="', outsidecolor.color, '"',
+ ' color2="', insidecolor.color, '"',
+ ' type="', this.fillStyle.type_, '"',
+ ' focusposition="', focus.x, ', ', focus.y, '"',
+ ' colors="', colors.join(""), '"',
+ ' opacity="', opacity, '" />');
+ } else if (aFill) {
+ lineStr.push('<g_vml_:fill color="', color, '" opacity="', opacity, '" />');
+ } else {
+ lineStr.push(
+ '<g_vml_:stroke',
+ ' opacity="', opacity,'"',
+ ' joinstyle="', this.lineJoin, '"',
+ ' miterlimit="', this.miterLimit, '"',
+ ' endcap="', processLineCap(this.lineCap) ,'"',
+ ' weight="', this.lineWidth, 'px"',
+ ' color="', color,'" />'
+ );
+ }
+
+ lineStr.push("</g_vml_:shape>");
+
+ this.element_.insertAdjacentHTML("beforeEnd", lineStr.join(""));
+
+ this.currentPath_ = [];
+ };
+
+ contextPrototype.fill = function() {
+ this.stroke(true);
+ }
+
+ contextPrototype.closePath = function() {
+ this.currentPath_.push({type: "close"});
+ };
+
+ /**
+ * @private
+ */
+ contextPrototype.getCoords_ = function(aX, aY) {
+ return {
+ x: Z * (aX * this.m_[0][0] + aY * this.m_[1][0] + this.m_[2][0]) - Z2,
+ y: Z * (aX * this.m_[0][1] + aY * this.m_[1][1] + this.m_[2][1]) - Z2
+ }
+ };
+
+ contextPrototype.save = function() {
+ var o = {};
+ copyState(this, o);
+ this.aStack_.push(o);
+ this.mStack_.push(this.m_);
+ this.m_ = matrixMultiply(createMatrixIdentity(), this.m_);
+ };
+
+ contextPrototype.restore = function() {
+ copyState(this.aStack_.pop(), this);
+ this.m_ = this.mStack_.pop();
+ };
+
+ contextPrototype.translate = function(aX, aY) {
+ var m1 = [
+ [1, 0, 0],
+ [0, 1, 0],
+ [aX, aY, 1]
+ ];
+
+ this.m_ = matrixMultiply(m1, this.m_);
+ };
+
+ contextPrototype.rotate = function(aRot) {
+ var c = mc(aRot);
+ var s = ms(aRot);
+
+ var m1 = [
+ [c, s, 0],
+ [-s, c, 0],
+ [0, 0, 1]
+ ];
+
+ this.m_ = matrixMultiply(m1, this.m_);
+ };
+
+ contextPrototype.scale = function(aX, aY) {
+ this.arcScaleX_ *= aX;
+ this.arcScaleY_ *= aY;
+ var m1 = [
+ [aX, 0, 0],
+ [0, aY, 0],
+ [0, 0, 1]
+ ];
+
+ this.m_ = matrixMultiply(m1, this.m_);
+ };
+
+ /******** STUBS ********/
+ contextPrototype.clip = function() {
+ // TODO: Implement
+ };
+
+ contextPrototype.arcTo = function() {
+ // TODO: Implement
+ };
+
+ contextPrototype.createPattern = function() {
+ return new CanvasPattern_;
+ };
+
+ // Gradient / Pattern Stubs
+ function CanvasGradient_(aType) {
+ this.type_ = aType;
+ this.radius1_ = 0;
+ this.radius2_ = 0;
+ this.colors_ = [];
+ this.focus_ = {x: 0, y: 0};
+ }
+
+ CanvasGradient_.prototype.addColorStop = function(aOffset, aColor) {
+ aColor = processStyle(aColor);
+ this.colors_.push({offset: 1-aOffset, color: aColor});
+ };
+
+ function CanvasPattern_() {}
+
+ // set up externs
+ G_vmlCanvasManager = G_vmlCanvasManager_;
+ CanvasRenderingContext2D = CanvasRenderingContext2D_;
+ CanvasGradient = CanvasGradient_;
+ CanvasPattern = CanvasPattern_;
+
+})();
+
+} // if
diff --git a/shrine-webclient/src/main/html/js-ext/firebug-License.txt b/shrine-webclient/src/main/html/js-ext/firebug-License.txt
old mode 100755
new mode 100644
index 13679b3b1..06f965147
--- a/shrine-webclient/src/main/html/js-ext/firebug-License.txt
+++ b/shrine-webclient/src/main/html/js-ext/firebug-License.txt
@@ -1,469 +1,469 @@
- MOZILLA PUBLIC LICENSE
- Version 1.1
-
- ---------------
-
-1. Definitions.
-
- 1.0.1. "Commercial Use" means distribution or otherwise making the
- Covered Code available to a third party.
-
- 1.1. "Contributor" means each entity that creates or contributes to
- the creation of Modifications.
-
- 1.2. "Contributor Version" means the combination of the Original
- Code, prior Modifications used by a Contributor, and the Modifications
- made by that particular Contributor.
-
- 1.3. "Covered Code" means the Original Code or Modifications or the
- combination of the Original Code and Modifications, in each case
- including portions thereof.
-
- 1.4. "Electronic Distribution Mechanism" means a mechanism generally
- accepted in the software development community for the electronic
- transfer of data.
-
- 1.5. "Executable" means Covered Code in any form other than Source
- Code.
-
- 1.6. "Initial Developer" means the individual or entity identified
- as the Initial Developer in the Source Code notice required by Exhibit
- A.
-
- 1.7. "Larger Work" means a work which combines Covered Code or
- portions thereof with code not governed by the terms of this License.
-
- 1.8. "License" means this document.
-
- 1.8.1. "Licensable" means having the right to grant, to the maximum
- extent possible, whether at the time of the initial grant or
- subsequently acquired, any and all of the rights conveyed herein.
-
- 1.9. "Modifications" means any addition to or deletion from the
- substance or structure of either the Original Code or any previous
- Modifications. When Covered Code is released as a series of files, a
- Modification is:
- A. Any addition to or deletion from the contents of a file
- containing Original Code or previous Modifications.
-
- B. Any new file that contains any part of the Original Code or
- previous Modifications.
-
- 1.10. "Original Code" means Source Code of computer software code
- which is described in the Source Code notice required by Exhibit A as
- Original Code, and which, at the time of its release under this
- License is not already Covered Code governed by this License.
-
- 1.10.1. "Patent Claims" means any patent claim(s), now owned or
- hereafter acquired, including without limitation, method, process,
- and apparatus claims, in any patent Licensable by grantor.
-
- 1.11. "Source Code" means the preferred form of the Covered Code for
- making modifications to it, including all modules it contains, plus
- any associated interface definition files, scripts used to control
- compilation and installation of an Executable, or source code
- differential comparisons against either the Original Code or another
- well known, available Covered Code of the Contributor's choice. The
- Source Code can be in a compressed or archival form, provided the
- appropriate decompression or de-archiving software is widely available
- for no charge.
-
- 1.12. "You" (or "Your") means an individual or a legal entity
- exercising rights under, and complying with all of the terms of, this
- License or a future version of this License issued under Section 6.1.
- For legal entities, "You" includes any entity which controls, is
- controlled by, or is under common control with You. For purposes of
- this definition, "control" means (a) the power, direct or indirect,
- to cause the direction or management of such entity, whether by
- contract or otherwise, or (b) ownership of more than fifty percent
- (50%) of the outstanding shares or beneficial ownership of such
- entity.
-
-2. Source Code License.
-
- 2.1. The Initial Developer Grant.
- The Initial Developer hereby grants You a world-wide, royalty-free,
- non-exclusive license, subject to third party intellectual property
- claims:
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Initial Developer to use, reproduce,
- modify, display, perform, sublicense and distribute the Original
- Code (or portions thereof) with or without Modifications, and/or
- as part of a Larger Work; and
-
- (b) under Patents Claims infringed by the making, using or
- selling of Original Code, to make, have made, use, practice,
- sell, and offer for sale, and/or otherwise dispose of the
- Original Code (or portions thereof).
-
- (c) the licenses granted in this Section 2.1(a) and (b) are
- effective on the date Initial Developer first distributes
- Original Code under the terms of this License.
-
- (d) Notwithstanding Section 2.1(b) above, no patent license is
- granted: 1) for code that You delete from the Original Code; 2)
- separate from the Original Code; or 3) for infringements caused
- by: i) the modification of the Original Code or ii) the
- combination of the Original Code with other software or devices.
-
- 2.2. Contributor Grant.
- Subject to third party intellectual property claims, each Contributor
- hereby grants You a world-wide, royalty-free, non-exclusive license
-
- (a) under intellectual property rights (other than patent or
- trademark) Licensable by Contributor, to use, reproduce, modify,
- display, perform, sublicense and distribute the Modifications
- created by such Contributor (or portions thereof) either on an
- unmodified basis, with other Modifications, as Covered Code
- and/or as part of a Larger Work; and
-
- (b) under Patent Claims infringed by the making, using, or
- selling of Modifications made by that Contributor either alone
- and/or in combination with its Contributor Version (or portions
- of such combination), to make, use, sell, offer for sale, have
- made, and/or otherwise dispose of: 1) Modifications made by that
- Contributor (or portions thereof); and 2) the combination of
- Modifications made by that Contributor with its Contributor
- Version (or portions of such combination).
-
- (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
- effective on the date Contributor first makes Commercial Use of
- the Covered Code.
-
- (d) Notwithstanding Section 2.2(b) above, no patent license is
- granted: 1) for any code that Contributor has deleted from the
- Contributor Version; 2) separate from the Contributor Version;
- 3) for infringements caused by: i) third party modifications of
- Contributor Version or ii) the combination of Modifications made
- by that Contributor with other software (except as part of the
- Contributor Version) or other devices; or 4) under Patent Claims
- infringed by Covered Code in the absence of Modifications made by
- that Contributor.
-
-3. Distribution Obligations.
-
- 3.1. Application of License.
- The Modifications which You create or to which You contribute are
- governed by the terms of this License, including without limitation
- Section 2.2. The Source Code version of Covered Code may be
- distributed only under the terms of this License or a future version
- of this License released under Section 6.1, and You must include a
- copy of this License with every copy of the Source Code You
- distribute. You may not offer or impose any terms on any Source Code
- version that alters or restricts the applicable version of this
- License or the recipients' rights hereunder. However, You may include
- an additional document offering the additional rights described in
- Section 3.5.
-
- 3.2. Availability of Source Code.
- Any Modification which You create or to which You contribute must be
- made available in Source Code form under the terms of this License
- either on the same media as an Executable version or via an accepted
- Electronic Distribution Mechanism to anyone to whom you made an
- Executable version available; and if made available via Electronic
- Distribution Mechanism, must remain available for at least twelve (12)
- months after the date it initially became available, or at least six
- (6) months after a subsequent version of that particular Modification
- has been made available to such recipients. You are responsible for
- ensuring that the Source Code version remains available even if the
- Electronic Distribution Mechanism is maintained by a third party.
-
- 3.3. Description of Modifications.
- You must cause all Covered Code to which You contribute to contain a
- file documenting the changes You made to create that Covered Code and
- the date of any change. You must include a prominent statement that
- the Modification is derived, directly or indirectly, from Original
- Code provided by the Initial Developer and including the name of the
- Initial Developer in (a) the Source Code, and (b) in any notice in an
- Executable version or related documentation in which You describe the
- origin or ownership of the Covered Code.
-
- 3.4. Intellectual Property Matters
- (a) Third Party Claims.
- If Contributor has knowledge that a license under a third party's
- intellectual property rights is required to exercise the rights
- granted by such Contributor under Sections 2.1 or 2.2,
- Contributor must include a text file with the Source Code
- distribution titled "LEGAL" which describes the claim and the
- party making the claim in sufficient detail that a recipient will
- know whom to contact. If Contributor obtains such knowledge after
- the Modification is made available as described in Section 3.2,
- Contributor shall promptly modify the LEGAL file in all copies
- Contributor makes available thereafter and shall take other steps
- (such as notifying appropriate mailing lists or newsgroups)
- reasonably calculated to inform those who received the Covered
- Code that new knowledge has been obtained.
-
- (b) Contributor APIs.
- If Contributor's Modifications include an application programming
- interface and Contributor has knowledge of patent licenses which
- are reasonably necessary to implement that API, Contributor must
- also include this information in the LEGAL file.
-
- (c) Representations.
- Contributor represents that, except as disclosed pursuant to
- Section 3.4(a) above, Contributor believes that Contributor's
- Modifications are Contributor's original creation(s) and/or
- Contributor has sufficient rights to grant the rights conveyed by
- this License.
-
- 3.5. Required Notices.
- You must duplicate the notice in Exhibit A in each file of the Source
- Code. If it is not possible to put such notice in a particular Source
- Code file due to its structure, then You must include such notice in a
- location (such as a relevant directory) where a user would be likely
- to look for such a notice. If You created one or more Modification(s)
- You may add your name as a Contributor to the notice described in
- Exhibit A. You must also duplicate this License in any documentation
- for the Source Code where You describe recipients' rights or ownership
- rights relating to Covered Code. You may choose to offer, and to
- charge a fee for, warranty, support, indemnity or liability
- obligations to one or more recipients of Covered Code. However, You
- may do so only on Your own behalf, and not on behalf of the Initial
- Developer or any Contributor. You must make it absolutely clear than
- any such warranty, support, indemnity or liability obligation is
- offered by You alone, and You hereby agree to indemnify the Initial
- Developer and every Contributor for any liability incurred by the
- Initial Developer or such Contributor as a result of warranty,
- support, indemnity or liability terms You offer.
-
- 3.6. Distribution of Executable Versions.
- You may distribute Covered Code in Executable form only if the
- requirements of Section 3.1-3.5 have been met for that Covered Code,
- and if You include a notice stating that the Source Code version of
- the Covered Code is available under the terms of this License,
- including a description of how and where You have fulfilled the
- obligations of Section 3.2. The notice must be conspicuously included
- in any notice in an Executable version, related documentation or
- collateral in which You describe recipients' rights relating to the
- Covered Code. You may distribute the Executable version of Covered
- Code or ownership rights under a license of Your choice, which may
- contain terms different from this License, provided that You are in
- compliance with the terms of this License and that the license for the
- Executable version does not attempt to limit or alter the recipient's
- rights in the Source Code version from the rights set forth in this
- License. If You distribute the Executable version under a different
- license You must make it absolutely clear that any terms which differ
- from this License are offered by You alone, not by the Initial
- Developer or any Contributor. You hereby agree to indemnify the
- Initial Developer and every Contributor for any liability incurred by
- the Initial Developer or such Contributor as a result of any such
- terms You offer.
-
- 3.7. Larger Works.
- You may create a Larger Work by combining Covered Code with other code
- not governed by the terms of this License and distribute the Larger
- Work as a single product. In such a case, You must make sure the
- requirements of this License are fulfilled for the Covered Code.
-
-4. Inability to Comply Due to Statute or Regulation.
-
- If it is impossible for You to comply with any of the terms of this
- License with respect to some or all of the Covered Code due to
- statute, judicial order, or regulation then You must: (a) comply with
- the terms of this License to the maximum extent possible; and (b)
- describe the limitations and the code they affect. Such description
- must be included in the LEGAL file described in Section 3.4 and must
- be included with all distributions of the Source Code. Except to the
- extent prohibited by statute or regulation, such description must be
- sufficiently detailed for a recipient of ordinary skill to be able to
- understand it.
-
-5. Application of this License.
-
- This License applies to code to which the Initial Developer has
- attached the notice in Exhibit A and to related Covered Code.
-
-6. Versions of the License.
-
- 6.1. New Versions.
- Netscape Communications Corporation ("Netscape") may publish revised
- and/or new versions of the License from time to time. Each version
- will be given a distinguishing version number.
-
- 6.2. Effect of New Versions.
- Once Covered Code has been published under a particular version of the
- License, You may always continue to use it under the terms of that
- version. You may also choose to use such Covered Code under the terms
- of any subsequent version of the License published by Netscape. No one
- other than Netscape has the right to modify the terms applicable to
- Covered Code created under this License.
-
- 6.3. Derivative Works.
- If You create or use a modified version of this License (which you may
- only do in order to apply it to code which is not already Covered Code
- governed by this License), You must (a) rename Your license so that
- the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
- "MPL", "NPL" or any confusingly similar phrase do not appear in your
- license (except to note that your license differs from this License)
- and (b) otherwise make it clear that Your version of the license
- contains terms which differ from the Mozilla Public License and
- Netscape Public License. (Filling in the name of the Initial
- Developer, Original Code or Contributor in the notice described in
- Exhibit A shall not of themselves be deemed to be modifications of
- this License.)
-
-7. DISCLAIMER OF WARRANTY.
-
- COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
- WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
- DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
- THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
- IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
- YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
- COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
- OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
- ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
-
-8. TERMINATION.
-
- 8.1. This License and the rights granted hereunder will terminate
- automatically if You fail to comply with terms herein and fail to cure
- such breach within 30 days of becoming aware of the breach. All
- sublicenses to the Covered Code which are properly granted shall
- survive any termination of this License. Provisions which, by their
- nature, must remain in effect beyond the termination of this License
- shall survive.
-
- 8.2. If You initiate litigation by asserting a patent infringement
- claim (excluding declatory judgment actions) against Initial Developer
- or a Contributor (the Initial Developer or Contributor against whom
- You file such action is referred to as "Participant") alleging that:
-
- (a) such Participant's Contributor Version directly or indirectly
- infringes any patent, then any and all rights granted by such
- Participant to You under Sections 2.1 and/or 2.2 of this License
- shall, upon 60 days notice from Participant terminate prospectively,
- unless if within 60 days after receipt of notice You either: (i)
- agree in writing to pay Participant a mutually agreeable reasonable
- royalty for Your past and future use of Modifications made by such
- Participant, or (ii) withdraw Your litigation claim with respect to
- the Contributor Version against such Participant. If within 60 days
- of notice, a reasonable royalty and payment arrangement are not
- mutually agreed upon in writing by the parties or the litigation claim
- is not withdrawn, the rights granted by Participant to You under
- Sections 2.1 and/or 2.2 automatically terminate at the expiration of
- the 60 day notice period specified above.
-
- (b) any software, hardware, or device, other than such Participant's
- Contributor Version, directly or indirectly infringes any patent, then
- any rights granted to You by such Participant under Sections 2.1(b)
- and 2.2(b) are revoked effective as of the date You first made, used,
- sold, distributed, or had made, Modifications made by that
- Participant.
-
- 8.3. If You assert a patent infringement claim against Participant
- alleging that such Participant's Contributor Version directly or
- indirectly infringes any patent where such claim is resolved (such as
- by license or settlement) prior to the initiation of patent
- infringement litigation, then the reasonable value of the licenses
- granted by such Participant under Sections 2.1 or 2.2 shall be taken
- into account in determining the amount or value of any payment or
- license.
-
- 8.4. In the event of termination under Sections 8.1 or 8.2 above,
- all end user license agreements (excluding distributors and resellers)
- which have been validly granted by You or any distributor hereunder
- prior to termination shall survive termination.
-
-9. LIMITATION OF LIABILITY.
-
- UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
- (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
- DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
- OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
- ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
- CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
- WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
- COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
- INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
- LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
- RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
- PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
- EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
- THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
-
-10. U.S. GOVERNMENT END USERS.
-
- The Covered Code is a "commercial item," as that term is defined in
- 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
- software" and "commercial computer software documentation," as such
- terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
- C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
- all U.S. Government End Users acquire Covered Code with only those
- rights set forth herein.
-
-11. MISCELLANEOUS.
-
- This License represents the complete agreement concerning subject
- matter hereof. If any provision of this License is held to be
- unenforceable, such provision shall be reformed only to the extent
- necessary to make it enforceable. This License shall be governed by
- California law provisions (except to the extent applicable law, if
- any, provides otherwise), excluding its conflict-of-law provisions.
- With respect to disputes in which at least one party is a citizen of,
- or an entity chartered or registered to do business in the United
- States of America, any litigation relating to this License shall be
- subject to the jurisdiction of the Federal Courts of the Northern
- District of California, with venue lying in Santa Clara County,
- California, with the losing party responsible for costs, including
- without limitation, court costs and reasonable attorneys' fees and
- expenses. The application of the United Nations Convention on
- Contracts for the International Sale of Goods is expressly excluded.
- Any law or regulation which provides that the language of a contract
- shall be construed against the drafter shall not apply to this
- License.
-
-12. RESPONSIBILITY FOR CLAIMS.
-
- As between Initial Developer and the Contributors, each party is
- responsible for claims and damages arising, directly or indirectly,
- out of its utilization of rights under this License and You agree to
- work with Initial Developer and Contributors to distribute such
- responsibility on an equitable basis. Nothing herein is intended or
- shall be deemed to constitute any admission of liability.
-
-13. MULTIPLE-LICENSED CODE.
-
- Initial Developer may designate portions of the Covered Code as
- "Multiple-Licensed". "Multiple-Licensed" means that the Initial
- Developer permits you to utilize portions of the Covered Code under
- Your choice of the NPL or the alternative licenses, if any, specified
- by the Initial Developer in the file described in Exhibit A.
-
-EXHIBIT A -Mozilla Public License.
-
- ``The contents of this file are subject to the Mozilla Public License
- Version 1.1 (the "License"); you may not use this file except in
- compliance with the License. You may obtain a copy of the License at
- http://www.mozilla.org/MPL/
-
- Software distributed under the License is distributed on an "AS IS"
- basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
- License for the specific language governing rights and limitations
- under the License.
-
- The Original Code is ______________________________________.
-
- The Initial Developer of the Original Code is ________________________.
- Portions created by ______________________ are Copyright (C) ______
- _______________________. All Rights Reserved.
-
- Contributor(s): ______________________________________.
-
- Alternatively, the contents of this file may be used under the terms
- of the _____ license (the "[___] License"), in which case the
- provisions of [______] License are applicable instead of those
- above. If you wish to allow use of your version of this file only
- under the terms of the [____] License and not to allow others to use
- your version of this file under the MPL, indicate your decision by
- deleting the provisions above and replace them with the notice and
- other provisions required by the [___] License. If you do not delete
- the provisions above, a recipient may use your version of this file
- under either the MPL or the [___] License."
-
- [NOTE: The text of this Exhibit A may differ slightly from the text of
- the notices in the Source Code files of the Original Code. You should
- use the text of this Exhibit A rather than the text found in the
- Original Code Source Code for Your Modifications.]
+ MOZILLA PUBLIC LICENSE
+ Version 1.1
+
+ ---------------
+
+1. Definitions.
+
+ 1.0.1. "Commercial Use" means distribution or otherwise making the
+ Covered Code available to a third party.
+
+ 1.1. "Contributor" means each entity that creates or contributes to
+ the creation of Modifications.
+
+ 1.2. "Contributor Version" means the combination of the Original
+ Code, prior Modifications used by a Contributor, and the Modifications
+ made by that particular Contributor.
+
+ 1.3. "Covered Code" means the Original Code or Modifications or the
+ combination of the Original Code and Modifications, in each case
+ including portions thereof.
+
+ 1.4. "Electronic Distribution Mechanism" means a mechanism generally
+ accepted in the software development community for the electronic
+ transfer of data.
+
+ 1.5. "Executable" means Covered Code in any form other than Source
+ Code.
+
+ 1.6. "Initial Developer" means the individual or entity identified
+ as the Initial Developer in the Source Code notice required by Exhibit
+ A.
+
+ 1.7. "Larger Work" means a work which combines Covered Code or
+ portions thereof with code not governed by the terms of this License.
+
+ 1.8. "License" means this document.
+
+ 1.8.1. "Licensable" means having the right to grant, to the maximum
+ extent possible, whether at the time of the initial grant or
+ subsequently acquired, any and all of the rights conveyed herein.
+
+ 1.9. "Modifications" means any addition to or deletion from the
+ substance or structure of either the Original Code or any previous
+ Modifications. When Covered Code is released as a series of files, a
+ Modification is:
+ A. Any addition to or deletion from the contents of a file
+ containing Original Code or previous Modifications.
+
+ B. Any new file that contains any part of the Original Code or
+ previous Modifications.
+
+ 1.10. "Original Code" means Source Code of computer software code
+ which is described in the Source Code notice required by Exhibit A as
+ Original Code, and which, at the time of its release under this
+ License is not already Covered Code governed by this License.
+
+ 1.10.1. "Patent Claims" means any patent claim(s), now owned or
+ hereafter acquired, including without limitation, method, process,
+ and apparatus claims, in any patent Licensable by grantor.
+
+ 1.11. "Source Code" means the preferred form of the Covered Code for
+ making modifications to it, including all modules it contains, plus
+ any associated interface definition files, scripts used to control
+ compilation and installation of an Executable, or source code
+ differential comparisons against either the Original Code or another
+ well known, available Covered Code of the Contributor's choice. The
+ Source Code can be in a compressed or archival form, provided the
+ appropriate decompression or de-archiving software is widely available
+ for no charge.
+
+ 1.12. "You" (or "Your") means an individual or a legal entity
+ exercising rights under, and complying with all of the terms of, this
+ License or a future version of this License issued under Section 6.1.
+ For legal entities, "You" includes any entity which controls, is
+ controlled by, or is under common control with You. For purposes of
+ this definition, "control" means (a) the power, direct or indirect,
+ to cause the direction or management of such entity, whether by
+ contract or otherwise, or (b) ownership of more than fifty percent
+ (50%) of the outstanding shares or beneficial ownership of such
+ entity.
+
+2. Source Code License.
+
+ 2.1. The Initial Developer Grant.
+ The Initial Developer hereby grants You a world-wide, royalty-free,
+ non-exclusive license, subject to third party intellectual property
+ claims:
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Initial Developer to use, reproduce,
+ modify, display, perform, sublicense and distribute the Original
+ Code (or portions thereof) with or without Modifications, and/or
+ as part of a Larger Work; and
+
+ (b) under Patents Claims infringed by the making, using or
+ selling of Original Code, to make, have made, use, practice,
+ sell, and offer for sale, and/or otherwise dispose of the
+ Original Code (or portions thereof).
+
+ (c) the licenses granted in this Section 2.1(a) and (b) are
+ effective on the date Initial Developer first distributes
+ Original Code under the terms of this License.
+
+ (d) Notwithstanding Section 2.1(b) above, no patent license is
+ granted: 1) for code that You delete from the Original Code; 2)
+ separate from the Original Code; or 3) for infringements caused
+ by: i) the modification of the Original Code or ii) the
+ combination of the Original Code with other software or devices.
+
+ 2.2. Contributor Grant.
+ Subject to third party intellectual property claims, each Contributor
+ hereby grants You a world-wide, royalty-free, non-exclusive license
+
+ (a) under intellectual property rights (other than patent or
+ trademark) Licensable by Contributor, to use, reproduce, modify,
+ display, perform, sublicense and distribute the Modifications
+ created by such Contributor (or portions thereof) either on an
+ unmodified basis, with other Modifications, as Covered Code
+ and/or as part of a Larger Work; and
+
+ (b) under Patent Claims infringed by the making, using, or
+ selling of Modifications made by that Contributor either alone
+ and/or in combination with its Contributor Version (or portions
+ of such combination), to make, use, sell, offer for sale, have
+ made, and/or otherwise dispose of: 1) Modifications made by that
+ Contributor (or portions thereof); and 2) the combination of
+ Modifications made by that Contributor with its Contributor
+ Version (or portions of such combination).
+
+ (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+ effective on the date Contributor first makes Commercial Use of
+ the Covered Code.
+
+ (d) Notwithstanding Section 2.2(b) above, no patent license is
+ granted: 1) for any code that Contributor has deleted from the
+ Contributor Version; 2) separate from the Contributor Version;
+ 3) for infringements caused by: i) third party modifications of
+ Contributor Version or ii) the combination of Modifications made
+ by that Contributor with other software (except as part of the
+ Contributor Version) or other devices; or 4) under Patent Claims
+ infringed by Covered Code in the absence of Modifications made by
+ that Contributor.
+
+3. Distribution Obligations.
+
+ 3.1. Application of License.
+ The Modifications which You create or to which You contribute are
+ governed by the terms of this License, including without limitation
+ Section 2.2. The Source Code version of Covered Code may be
+ distributed only under the terms of this License or a future version
+ of this License released under Section 6.1, and You must include a
+ copy of this License with every copy of the Source Code You
+ distribute. You may not offer or impose any terms on any Source Code
+ version that alters or restricts the applicable version of this
+ License or the recipients' rights hereunder. However, You may include
+ an additional document offering the additional rights described in
+ Section 3.5.
+
+ 3.2. Availability of Source Code.
+ Any Modification which You create or to which You contribute must be
+ made available in Source Code form under the terms of this License
+ either on the same media as an Executable version or via an accepted
+ Electronic Distribution Mechanism to anyone to whom you made an
+ Executable version available; and if made available via Electronic
+ Distribution Mechanism, must remain available for at least twelve (12)
+ months after the date it initially became available, or at least six
+ (6) months after a subsequent version of that particular Modification
+ has been made available to such recipients. You are responsible for
+ ensuring that the Source Code version remains available even if the
+ Electronic Distribution Mechanism is maintained by a third party.
+
+ 3.3. Description of Modifications.
+ You must cause all Covered Code to which You contribute to contain a
+ file documenting the changes You made to create that Covered Code and
+ the date of any change. You must include a prominent statement that
+ the Modification is derived, directly or indirectly, from Original
+ Code provided by the Initial Developer and including the name of the
+ Initial Developer in (a) the Source Code, and (b) in any notice in an
+ Executable version or related documentation in which You describe the
+ origin or ownership of the Covered Code.
+
+ 3.4. Intellectual Property Matters
+ (a) Third Party Claims.
+ If Contributor has knowledge that a license under a third party's
+ intellectual property rights is required to exercise the rights
+ granted by such Contributor under Sections 2.1 or 2.2,
+ Contributor must include a text file with the Source Code
+ distribution titled "LEGAL" which describes the claim and the
+ party making the claim in sufficient detail that a recipient will
+ know whom to contact. If Contributor obtains such knowledge after
+ the Modification is made available as described in Section 3.2,
+ Contributor shall promptly modify the LEGAL file in all copies
+ Contributor makes available thereafter and shall take other steps
+ (such as notifying appropriate mailing lists or newsgroups)
+ reasonably calculated to inform those who received the Covered
+ Code that new knowledge has been obtained.
+
+ (b) Contributor APIs.
+ If Contributor's Modifications include an application programming
+ interface and Contributor has knowledge of patent licenses which
+ are reasonably necessary to implement that API, Contributor must
+ also include this information in the LEGAL file.
+
+ (c) Representations.
+ Contributor represents that, except as disclosed pursuant to
+ Section 3.4(a) above, Contributor believes that Contributor's
+ Modifications are Contributor's original creation(s) and/or
+ Contributor has sufficient rights to grant the rights conveyed by
+ this License.
+
+ 3.5. Required Notices.
+ You must duplicate the notice in Exhibit A in each file of the Source
+ Code. If it is not possible to put such notice in a particular Source
+ Code file due to its structure, then You must include such notice in a
+ location (such as a relevant directory) where a user would be likely
+ to look for such a notice. If You created one or more Modification(s)
+ You may add your name as a Contributor to the notice described in
+ Exhibit A. You must also duplicate this License in any documentation
+ for the Source Code where You describe recipients' rights or ownership
+ rights relating to Covered Code. You may choose to offer, and to
+ charge a fee for, warranty, support, indemnity or liability
+ obligations to one or more recipients of Covered Code. However, You
+ may do so only on Your own behalf, and not on behalf of the Initial
+ Developer or any Contributor. You must make it absolutely clear than
+ any such warranty, support, indemnity or liability obligation is
+ offered by You alone, and You hereby agree to indemnify the Initial
+ Developer and every Contributor for any liability incurred by the
+ Initial Developer or such Contributor as a result of warranty,
+ support, indemnity or liability terms You offer.
+
+ 3.6. Distribution of Executable Versions.
+ You may distribute Covered Code in Executable form only if the
+ requirements of Section 3.1-3.5 have been met for that Covered Code,
+ and if You include a notice stating that the Source Code version of
+ the Covered Code is available under the terms of this License,
+ including a description of how and where You have fulfilled the
+ obligations of Section 3.2. The notice must be conspicuously included
+ in any notice in an Executable version, related documentation or
+ collateral in which You describe recipients' rights relating to the
+ Covered Code. You may distribute the Executable version of Covered
+ Code or ownership rights under a license of Your choice, which may
+ contain terms different from this License, provided that You are in
+ compliance with the terms of this License and that the license for the
+ Executable version does not attempt to limit or alter the recipient's
+ rights in the Source Code version from the rights set forth in this
+ License. If You distribute the Executable version under a different
+ license You must make it absolutely clear that any terms which differ
+ from this License are offered by You alone, not by the Initial
+ Developer or any Contributor. You hereby agree to indemnify the
+ Initial Developer and every Contributor for any liability incurred by
+ the Initial Developer or such Contributor as a result of any such
+ terms You offer.
+
+ 3.7. Larger Works.
+ You may create a Larger Work by combining Covered Code with other code
+ not governed by the terms of this License and distribute the Larger
+ Work as a single product. In such a case, You must make sure the
+ requirements of this License are fulfilled for the Covered Code.
+
+4. Inability to Comply Due to Statute or Regulation.
+
+ If it is impossible for You to comply with any of the terms of this
+ License with respect to some or all of the Covered Code due to
+ statute, judicial order, or regulation then You must: (a) comply with
+ the terms of this License to the maximum extent possible; and (b)
+ describe the limitations and the code they affect. Such description
+ must be included in the LEGAL file described in Section 3.4 and must
+ be included with all distributions of the Source Code. Except to the
+ extent prohibited by statute or regulation, such description must be
+ sufficiently detailed for a recipient of ordinary skill to be able to
+ understand it.
+
+5. Application of this License.
+
+ This License applies to code to which the Initial Developer has
+ attached the notice in Exhibit A and to related Covered Code.
+
+6. Versions of the License.
+
+ 6.1. New Versions.
+ Netscape Communications Corporation ("Netscape") may publish revised
+ and/or new versions of the License from time to time. Each version
+ will be given a distinguishing version number.
+
+ 6.2. Effect of New Versions.
+ Once Covered Code has been published under a particular version of the
+ License, You may always continue to use it under the terms of that
+ version. You may also choose to use such Covered Code under the terms
+ of any subsequent version of the License published by Netscape. No one
+ other than Netscape has the right to modify the terms applicable to
+ Covered Code created under this License.
+
+ 6.3. Derivative Works.
+ If You create or use a modified version of this License (which you may
+ only do in order to apply it to code which is not already Covered Code
+ governed by this License), You must (a) rename Your license so that
+ the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+ "MPL", "NPL" or any confusingly similar phrase do not appear in your
+ license (except to note that your license differs from this License)
+ and (b) otherwise make it clear that Your version of the license
+ contains terms which differ from the Mozilla Public License and
+ Netscape Public License. (Filling in the name of the Initial
+ Developer, Original Code or Contributor in the notice described in
+ Exhibit A shall not of themselves be deemed to be modifications of
+ this License.)
+
+7. DISCLAIMER OF WARRANTY.
+
+ COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+ WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+ DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+ THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+ IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+ YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+ COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+ OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+ ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+
+8. TERMINATION.
+
+ 8.1. This License and the rights granted hereunder will terminate
+ automatically if You fail to comply with terms herein and fail to cure
+ such breach within 30 days of becoming aware of the breach. All
+ sublicenses to the Covered Code which are properly granted shall
+ survive any termination of this License. Provisions which, by their
+ nature, must remain in effect beyond the termination of this License
+ shall survive.
+
+ 8.2. If You initiate litigation by asserting a patent infringement
+ claim (excluding declatory judgment actions) against Initial Developer
+ or a Contributor (the Initial Developer or Contributor against whom
+ You file such action is referred to as "Participant") alleging that:
+
+ (a) such Participant's Contributor Version directly or indirectly
+ infringes any patent, then any and all rights granted by such
+ Participant to You under Sections 2.1 and/or 2.2 of this License
+ shall, upon 60 days notice from Participant terminate prospectively,
+ unless if within 60 days after receipt of notice You either: (i)
+ agree in writing to pay Participant a mutually agreeable reasonable
+ royalty for Your past and future use of Modifications made by such
+ Participant, or (ii) withdraw Your litigation claim with respect to
+ the Contributor Version against such Participant. If within 60 days
+ of notice, a reasonable royalty and payment arrangement are not
+ mutually agreed upon in writing by the parties or the litigation claim
+ is not withdrawn, the rights granted by Participant to You under
+ Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+ the 60 day notice period specified above.
+
+ (b) any software, hardware, or device, other than such Participant's
+ Contributor Version, directly or indirectly infringes any patent, then
+ any rights granted to You by such Participant under Sections 2.1(b)
+ and 2.2(b) are revoked effective as of the date You first made, used,
+ sold, distributed, or had made, Modifications made by that
+ Participant.
+
+ 8.3. If You assert a patent infringement claim against Participant
+ alleging that such Participant's Contributor Version directly or
+ indirectly infringes any patent where such claim is resolved (such as
+ by license or settlement) prior to the initiation of patent
+ infringement litigation, then the reasonable value of the licenses
+ granted by such Participant under Sections 2.1 or 2.2 shall be taken
+ into account in determining the amount or value of any payment or
+ license.
+
+ 8.4. In the event of termination under Sections 8.1 or 8.2 above,
+ all end user license agreements (excluding distributors and resellers)
+ which have been validly granted by You or any distributor hereunder
+ prior to termination shall survive termination.
+
+9. LIMITATION OF LIABILITY.
+
+ UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+ (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+ DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+ OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+ ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+ CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+ WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+ COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+ INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+ LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+ RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+ PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+ EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+ THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+
+10. U.S. GOVERNMENT END USERS.
+
+ The Covered Code is a "commercial item," as that term is defined in
+ 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+ software" and "commercial computer software documentation," as such
+ terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+ C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+ all U.S. Government End Users acquire Covered Code with only those
+ rights set forth herein.
+
+11. MISCELLANEOUS.
+
+ This License represents the complete agreement concerning subject
+ matter hereof. If any provision of this License is held to be
+ unenforceable, such provision shall be reformed only to the extent
+ necessary to make it enforceable. This License shall be governed by
+ California law provisions (except to the extent applicable law, if
+ any, provides otherwise), excluding its conflict-of-law provisions.
+ With respect to disputes in which at least one party is a citizen of,
+ or an entity chartered or registered to do business in the United
+ States of America, any litigation relating to this License shall be
+ subject to the jurisdiction of the Federal Courts of the Northern
+ District of California, with venue lying in Santa Clara County,
+ California, with the losing party responsible for costs, including
+ without limitation, court costs and reasonable attorneys' fees and
+ expenses. The application of the United Nations Convention on
+ Contracts for the International Sale of Goods is expressly excluded.
+ Any law or regulation which provides that the language of a contract
+ shall be construed against the drafter shall not apply to this
+ License.
+
+12. RESPONSIBILITY FOR CLAIMS.
+
+ As between Initial Developer and the Contributors, each party is
+ responsible for claims and damages arising, directly or indirectly,
+ out of its utilization of rights under this License and You agree to
+ work with Initial Developer and Contributors to distribute such
+ responsibility on an equitable basis. Nothing herein is intended or
+ shall be deemed to constitute any admission of liability.
+
+13. MULTIPLE-LICENSED CODE.
+
+ Initial Developer may designate portions of the Covered Code as
+ "Multiple-Licensed". "Multiple-Licensed" means that the Initial
+ Developer permits you to utilize portions of the Covered Code under
+ Your choice of the NPL or the alternative licenses, if any, specified
+ by the Initial Developer in the file described in Exhibit A.
+
+EXHIBIT A -Mozilla Public License.
+
+ ``The contents of this file are subject to the Mozilla Public License
+ Version 1.1 (the "License"); you may not use this file except in
+ compliance with the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+
+ Software distributed under the License is distributed on an "AS IS"
+ basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ License for the specific language governing rights and limitations
+ under the License.
+
+ The Original Code is ______________________________________.
+
+ The Initial Developer of the Original Code is ________________________.
+ Portions created by ______________________ are Copyright (C) ______
+ _______________________. All Rights Reserved.
+
+ Contributor(s): ______________________________________.
+
+ Alternatively, the contents of this file may be used under the terms
+ of the _____ license (the "[___] License"), in which case the
+ provisions of [______] License are applicable instead of those
+ above. If you wish to allow use of your version of this file only
+ under the terms of the [____] License and not to allow others to use
+ your version of this file under the MPL, indicate your decision by
+ deleting the provisions above and replace them with the notice and
+ other provisions required by the [___] License. If you do not delete
+ the provisions above, a recipient may use your version of this file
+ under either the MPL or the [___] License."
+
+ [NOTE: The text of this Exhibit A may differ slightly from the text of
+ the notices in the Source Code files of the Original Code. You should
+ use the text of this Exhibit A rather than the text found in the
+ Original Code Source Code for Your Modifications.]
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/errorIcon.png b/shrine-webclient/src/main/html/js-ext/firebug/errorIcon.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite-compressed.js b/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite-compressed.js
old mode 100755
new mode 100644
index af2c05dca..abd035ad5
--- a/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite-compressed.js
+++ b/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite-compressed.js
@@ -1,118 +1,118 @@
-var firebug={version:[1.23,20090309],el:{},env:{"cache":{},"extConsole":null,"css":"http://getfirebug.com/releases/lite/1.2/firebug-lite.css","debug":true,"detectFirebug":false,"dIndex":"console","height":295,"hideDOMFunctions":false,"init":false,"isPopup":false,"liteFilename":"firebug-lite.js","minimized":false,"openInPopup":false,"override":false,"ml":false,"popupWin":null,"showIconWhenHidden":true,"targetWindow":undefined,"popupTop":1,"popupLeft":1,"popupWidth":undefined,"popupHeight":undefined},initConsole:function(){var command;try{if((!window.console||(window.console&&!window.console.firebug))||(firebug.env.override&&!(/Firefox\/3/i.test(navigator.userAgent)))){window.console={"provider":"Firebug Lite"};for(command in firebug.d.console.cmd){window.console[command]=firebug.lib.util.Curry(firebug.d.console.run,window,command);};}
-window.onerror=function(_message,_file,_line){firebug.d.console.run('error',firebug.lib.util.String.format('{0} ({1},{2})',_message,firebug.getFileName(_file),_line));};}catch(e){}},overrideConsole:function(){with(firebug){env.override=true;try{env.extConsole=window.console;}catch(e){}
-initConsole();}},restoreConsole:function(){with(firebug){if(env.extConsole){env.override=false;try{window.console=env.extConsole;}catch(e){}
-env.extConsole=null;}}},init:function(_css){var iconTitle="Click here or press F12, (CTRL|CMD)+SHIFT+L or SHIFT+ENTER to show Firebug Lite. CTRL|CMD click this icon to hide it.";with(firebug){if(document.getElementsByTagName('html')[0].attributes.getNamedItem('debug')){env.debug=document.getElementsByTagName('html')[0].attributes.getNamedItem('debug').nodeValue!=="false";}
-if(env.isPopup){env.openInPopup=false;env.targetWindow=window.opener;env.popupWidth=window.opener.firebug.env.popupWidth||window.opener.firebug.lib.util.GetViewport().width;env.popupHeight=window.opener.firebug.env.popupHeight||window.opener.firebug.lib.util.GetViewport().height;}else{env.targetWindow=window;env.popupWidth=env.popupWidth||lib.util.GetViewport().width;env.popupHeight=env.popupHeight||lib.util.GetViewport().height;}
-settings.readCookie();if(env.init||(env.detectFirebug&&window.console&&window.console.firebug)){return;}
-document.getElementsByTagName("head")[0].appendChild(new lib.element("link").attribute.set("rel","stylesheet").attribute.set("type","text/css").attribute.set("href",env.css).element);if(env.override){overrideConsole();}
-el.firebugIcon=new lib.element("div").attribute.set("id","firebugIconDiv").attribute.set("title",iconTitle).attribute.set("alt",iconTitle).event.addListener("mousedown",win.iconClicked).insert(document.body);el.content={};el.mainiframe=new lib.element("IFRAME").attribute.set("id","FirebugIFrame").environment.addStyle({"display":"none","width":lib.util.GetViewport().width+"px"}).insert(document.body);el.main=new lib.element("DIV").attribute.set("id","Firebug").environment.addStyle({"display":"none","width":lib.util.GetViewport().width+"px"}).insert(document.body);if(!env.isPopup){el.resizer=new lib.element("DIV").attribute.addClass("Resizer").event.addListener("mousedown",win.resizer.start).insert(el.main);}
-el.header=new lib.element("DIV").attribute.addClass("Header").insert(el.main);el.left={};el.left.container=new lib.element("DIV").attribute.addClass("Left").insert(el.main);el.right={};el.right.container=new lib.element("DIV").attribute.addClass("Right").insert(el.main);el.main.child.add(new lib.element("DIV").attribute.addClass('Clear'));el.button={};el.button.container=new lib.element("DIV").attribute.addClass("ButtonContainer").insert(el.header);el.button.logo=new lib.element("A").attribute.set("title","Firebug Lite").attribute.set("target","_blank").attribute.set("href","http://getfirebug.com/lite.html").update("&nbsp;").attribute.addClass("Button Logo").insert(el.button.container);el.button.inspect=new lib.element("A").attribute.addClass("Button").event.addListener("click",env.targetWindow.firebug.d.inspector.toggle).update("Inspect").insert(el.button.container);el.button.dock=new lib.element("A").attribute.addClass("Button Dock").event.addListener("click",win.dock).insert(el.button.container);el.button.newWindow=new lib.element("A").attribute.addClass("Button NewWindow").event.addListener("click",win.newWindow).insert(el.button.container);if(!env.isPopup){el.button.maximize=new lib.element("A").attribute.addClass("Button Maximize").event.addListener("click",win.maximize).insert(el.button.container);el.button.minimize=new lib.element("A").attribute.addClass("Button Minimize").event.addListener("click",win.minimize).insert(el.button.container);el.button.close=new lib.element("A").attribute.addClass("Button Close").event.addListener("click",win.hide).insert(el.button.container);}
-if(lib.env.ie||lib.env.webkit){el.button.container.environment.addStyle({"paddingTop":"12px"});}
-el.nav={};el.nav.container=new lib.element("DIV").attribute.addClass("Nav").insert(el.left.container);el.nav.console=new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.navigate,window,"console")).update("Console").insert(el.nav.container);el.nav.html=new lib.element("A").attribute.addClass("Tab").update("HTML").event.addListener("click",lib.util.Curry(d.navigate,window,"html")).insert(el.nav.container);el.nav.css=new lib.element("A").attribute.addClass("Tab").update("CSS").event.addListener("click",lib.util.Curry(d.navigate,window,"css")).insert(el.nav.container);if(!env.isPopup){el.nav.scripts=new lib.element("A").attribute.addClass("Tab").update("Script").event.addListener("click",lib.util.Curry(d.navigate,window,"scripts")).insert(el.nav.container);}
-el.nav.dom=new lib.element("A").attribute.addClass("Tab").update("DOM").event.addListener("click",lib.util.Curry(d.navigate,env.targetWindow,"dom")).insert(el.nav.container);el.nav.xhr=new lib.element("A").attribute.addClass("Tab").update("XHR").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).insert(el.nav.container);el.nav.optionsdiv=new lib.element("DIV").attribute.addClass("Settings").insert(el.nav.container);el.nav.options=new lib.element("A").attribute.addClass("Tab").update("Options&nbsp;&or;").event.addListener("click",settings.toggle).insert(el.nav.optionsdiv);el.borderInspector=new lib.element("DIV").attribute.set("id","FirebugBorderInspector").event.addListener("click",listen.inspector).insert(document.body);el.bgInspector=new lib.element("DIV").attribute.set("id","FirebugBGInspector").insert(document.body);el.left.console={};el.left.console.container=new lib.element("DIV").attribute.addClass("Console").insert(el.left.container);el.left.console.mlButton=new lib.element("A").attribute.addClass("MLButton").event.addListener("click",d.console.toggleML).insert(el.left.console.container);el.left.console.monitor=new lib.element("DIV").insert(new lib.element("DIV").attribute.addClass("Monitor").insert(el.left.console.container));el.left.console.container.child.add(new lib.element("DIV").attribute.addClass("InputArrow").update(">>>"));el.left.console.input=new lib.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert(new lib.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container));el.right.console={};el.right.console.container=new lib.element("DIV").attribute.addClass("Console Container").insert(el.right.container);el.right.console.mlButton=new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container);el.right.console.input=new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container);el.right.console.input.event.addListener("keydown",lib.util.Curry(tab,window,el.right.console.input.element));el.right.console.run=new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container);el.right.console.clear=new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.console.input)).update("Clear").insert(el.right.console.container);el.button.console={};el.button.console.container=new lib.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container);el.button.console.clear=new lib.element("A").attribute.addClass("Button").event.addListener("click",d.console.clear).update("Clear").insert(el.button.console.container);el.left.html={};el.left.html.container=new lib.element("DIV").attribute.addClass("HTML").insert(el.left.container);el.right.html={};el.right.html.container=new lib.element("DIV").attribute.addClass("HTML Container").insert(el.right.container);el.right.html.nav={};el.right.html.nav.container=new lib.element("DIV").attribute.addClass("Nav").insert(el.right.html.container);el.right.html.nav.computedStyle=new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container);el.right.html.nav.dom=new lib.element("A").attribute.addClass("Tab").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"dom")).update("DOM").insert(el.right.html.nav.container);el.right.html.content=new lib.element("DIV").attribute.addClass("Content").insert(el.right.html.container);el.button.html={};el.button.html.container=new lib.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container);el.left.css={};el.left.css.container=new lib.element("DIV").attribute.addClass("CSS").insert(el.left.container);el.right.css={};el.right.css.container=new lib.element("DIV").attribute.addClass("CSS Container").insert(el.right.container);el.right.css.nav={};el.right.css.nav.container=new lib.element("DIV").attribute.addClass("Nav").insert(el.right.css.container);el.right.css.nav.runCSS=new lib.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container);el.right.css.mlButton=new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container);el.right.css.input=new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container);el.right.css.input.event.addListener("keydown",lib.util.Curry(firebug.tab,window,el.right.css.input.element));el.right.css.run=new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container);el.right.css.clear=new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.css.input)).update("Clear").insert(el.right.css.container);el.button.css={};el.button.css.container=new lib.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container);el.button.css.selectbox=new lib.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container);el.left.scripts={};el.left.scripts.container=new lib.element("DIV").attribute.addClass("Scripts").insert(el.left.container);el.right.scripts={};el.right.scripts.container=new lib.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container);el.button.scripts={};el.button.scripts.container=new lib.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container);el.button.scripts.selectbox=new lib.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container);el.button.scripts.lineNumbers=new lib.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container);el.left.dom={};el.left.dom.container=new lib.element("DIV").attribute.addClass("DOM").insert(el.left.container);el.right.dom={};el.right.dom.container=new lib.element("DIV").attribute.addClass("DOM Container").insert(el.right.container);el.button.dom={};el.button.dom.container=new lib.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container);el.button.dom.label=new lib.element("LABEL").update("Object Path:").insert(el.button.dom.container);el.button.dom.textbox=new lib.element("INPUT").event.addListener("keydown",listen.domTextbox).update(env.isPopup?"window.opener":"window").insert(el.button.dom.container);el.left.str={};el.left.str.container=new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);el.right.str={};el.right.str.container=new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);el.button.str={};el.button.str.container=new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);el.button.str.watch=new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).update("Back").insert(el.button.str.container);el.left.xhr={};el.left.xhr.container=new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);el.right.xhr={};el.right.xhr.container=new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);el.button.xhr={};el.button.xhr.container=new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);el.button.xhr.label=new lib.element("LABEL").update("XHR Path:").insert(el.button.xhr.container);el.button.xhr.textbox=new lib.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container);el.button.xhr.watch=new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container);el.settings={};el.settings.container=new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("Header").child.add(new lib.element().attribute.addClass("Title").update('Firebug Lite Settings'))).attribute.addClass("SettingsDiv").insert(el.main);el.settings.content=new lib.element("DIV").attribute.addClass("Content").insert(el.settings.container);el.settings.progressDiv=new lib.element("DIV").attribute.addClass("ProgressDiv").insert(el.settings.content);el.settings.progress=new lib.element("DIV").attribute.addClass("Progress").insert(el.settings.progressDiv);el.settings.cbxDebug=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Start visible"));new lib.element("BR").insert(el.settings.content);el.settings.cbxDetectFirebug=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Hide when Firebug active"));new lib.element("BR").insert(el.settings.content);el.settings.cbxHideDOMFunctions=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Hide DOM functions"));new lib.element("BR").insert(el.settings.content);el.settings.cbxOverride=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Override window.console"));new lib.element("BR").insert(el.settings.content);el.settings.cbxShowIcon=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Show icon when hidden"));new lib.element("BR").insert(el.settings.content);el.settings.cbxOpenInPopup=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Open in popup"));el.settings.buttonDiv=new lib.element("DIV").insert(el.settings.content);el.settings.buttonLeftDiv=new lib.element("DIV").attribute.addClass("ButtonsLeft").insert(el.settings.buttonDiv);el.settings.resetButton=new lib.element("INPUT").attribute.set("type","button").update("Reset").event.addListener("click",settings.reset).insert(el.settings.buttonLeftDiv);el.settings.buttonRightDiv=new lib.element("DIV").attribute.addClass("ButtonsRight").insert(el.settings.buttonDiv);el.settings.cancelButton=new lib.element("INPUT").attribute.set("type","button").update("Cancel").event.addListener("click",settings.hide).insert(el.settings.buttonRightDiv);el.settings.buttonRightDiv.child.add(document.createTextNode(" "));el.settings.saveButton=new lib.element("INPUT").attribute.set("type","button").update("Save").event.addListener("click",settings.saveClicked).insert(el.settings.buttonRightDiv);lib.util.AddEvent(document,"mousemove",listen.mouse)("mousemove",win.resizer.resize)("mouseup",win.resizer.stop)("keydown",listen.keyboard);env.init=true;for(var i=0,len=d.console.cache.length;i<len;i++){var item=d.console.cache[i];d.console.cmd[item.command].apply(window,item.arg);};if(lib.env.ie6){window.onscroll=lib.util.Curry(win.setVerticalPosition,window,null);var buttons=[el.button.inspect,el.button.close,el.button.inspect,el.button.console.clear,el.right.console.run,el.right.console.clear,el.right.css.run,el.right.css.clear];for(var i=0,len=buttons.length;i<len;i++)
-buttons[i].attribute.set("href","#");win.refreshSize();}
-if(env.showIconWhenHidden){if(!env.popupWin){el.firebugIcon.environment.addStyle({"display":env.debug&&'none'||'block'});}}
-lib.util.AddEvent(window,"unload",win.unload);if(env.isPopup){env.height=lib.util.GetViewport().height;lib.util.AddEvent(window,"resize",win.fitToPopup);win.fitToPopup();}else{lib.util.AddEvent(window,"resize",win.refreshSize);}
-win.setHeight(env.height);if(env.openInPopup&&!env.isPopup){win.newWindow();}else{el.main.environment.addStyle({"display":env.debug&&'block'||'none'});el.mainiframe.environment.addStyle({"display":env.debug&&'block'||'none'});}}},inspect:function(){return firebug.d.html.inspect.apply(window,arguments);},watchXHR:function(){with(firebug){d.xhr.addObject.apply(window,arguments);if(env.dIndex!="xhr"){d.navigate("xhr");}}},settings:{isVisible:false,show:function(){with(firebug){var posXY=lib.util.Element.getPosition(firebug.el.nav.options.element);settings.refreshForm();el.settings.container.environment.addStyle({"display":"block","left":(posXY.offsetLeft-125)+"px"});el.settings.progressDiv.environment.addStyle({"display":"none"});firebug.settings.isVisible=true;}},hide:function(){with(firebug){firebug.el.settings.container.environment.addStyle({"display":"none"});firebug.settings.isVisible=false;}},toggle:function(){with(firebug){settings[!settings.isVisible&&'show'||'hide']();}},saveClicked:function(){firebug.el.settings.progressDiv.environment.addStyle({"display":"block"});setTimeout(firebug.settings.formToSettings,0);},formToSettings:function(){var fe=firebug.env,ofe,elSet=firebug.el.settings,exdate;fe.debug=elSet.cbxDebug.element.checked;fe.detectFirebug=elSet.cbxDetectFirebug.element.checked;fe.hideDOMFunctions=elSet.cbxHideDOMFunctions.element.checked;fe.override=elSet.cbxOverride.element.checked;fe.showIconWhenHidden=elSet.cbxShowIcon.element.checked;fe.openInPopup=elSet.cbxOpenInPopup.element.checked;if(fe.isPopup){ofe=window.opener.firebug.env;ofe.debug=fe.debug;ofe.detectFirebug=fe.detectFirebug;ofe.hideDOMFunctions=fe.hideDOMFunctions;ofe.override=fe.override;ofe.showIconWhenHidden=fe.showIconWhenHidden;ofe.openInPopup=fe.openInPopup;ofe.popupTop=fe.popupTop;ofe.popupLeft=fe.popupLeft;ofe.popupWidth=fe.popupWidth;ofe.popupHeight=fe.popupHeight;}
-with(firebug){settings.writeCookie();settings.hide();win.refreshDOM();}},reset:function(){var exdate=new Date();exdate.setTime(exdate.getTime()-1);document.cookie='FBLiteSettings=;expires='+exdate.toGMTString();location.reload(true);},readCookie:function(){var i,cookieArr,valueArr,item,value;with(firebug.env){if(targetWindow.document.cookie.length>0){cookieArr=targetWindow.document.cookie.split('; ');for(i=0;i<cookieArr.length;i++){if(cookieArr[i].split('=')[0]=='FBLiteSettings'){valueArr=cookieArr[i].split('=')[1].split(',');}}
-if(valueArr){for(i=0;i<valueArr.length;i++){item=valueArr[i].split(':')[0];value=valueArr[i].split(':')[1];switch(item){case'debug':debug=value=="true";break;case'detectFirebug':detectFirebug=value=="true";break;case'hideDOMFunctions':hideDOMFunctions=value=="true";break;case'override':override=value=="true";break;case'showIconWhenHidden':showIconWhenHidden=value=="true";break;case'openInPopup':openInPopup=value=="true";break;case'popupTop':popupTop=parseInt(value,10);break;case'popupLeft':popupLeft=parseInt(value,10);break;case'popupWidth':popupWidth=parseInt(value,10);break;case'popupHeight':popupHeight=parseInt(value,10);break;case'height':height=parseInt(value,10);break;}}}}}},writeCookie:function(){var values;with(firebug.env){values='debug:'+debug+',';values+='detectFirebug:'+detectFirebug+',';values+='hideDOMFunctions:'+hideDOMFunctions+',';values+='override:'+override+',';values+='showIconWhenHidden:'+showIconWhenHidden+',';values+='openInPopup:'+openInPopup+',';if(isPopup){if(window.outerWidth===undefined){values+='popupTop:'+(window.screenTop-56)+',';values+='popupLeft:'+(window.screenLeft-8)+',';values+='popupWidth:'+document.body.clientWidth+',';values+='popupHeight:'+document.body.clientHeight+',';}else{values+='popupTop:'+window.screenY+',';values+='popupLeft:'+window.screenX+',';values+='popupWidth:'+window.outerWidth+',';values+='popupHeight:'+window.outerHeight+',';}}else{values+='popupTop:'+popupTop+',';values+='popupLeft:'+popupLeft+',';values+='popupWidth:'+popupWidth+',';values+='popupHeight:'+popupHeight+',';}
-values+='height:'+(parseInt(targetWindow.firebug.el.main.element.style.height.replace(/px/,''),10)-38);exdate=new Date();exdate.setDate(exdate.getDate()+365);targetWindow.document.cookie='FBLiteSettings='+values+';expires='+exdate.toGMTString();}},refreshForm:function(){var fe=firebug.env,elSet=firebug.el.settings;elSet.cbxDebug.element.checked=fe.debug;elSet.cbxDetectFirebug.element.checked=fe.detectFirebug;elSet.cbxHideDOMFunctions.element.checked=fe.hideDOMFunctions;elSet.cbxOverride.element.checked=fe.override;elSet.cbxShowIcon.element.checked=fe.showIconWhenHidden;elSet.cbxOpenInPopup.element.checked=fe.openInPopup;}},win:{hide:function(){with(firebug){el.main.environment.addStyle({"display":"none"});el.mainiframe.environment.addStyle({"display":"none"});if(env.showIconWhenHidden){el.firebugIcon.environment.addStyle({"display":"block"});}}},show:function(){with(firebug){el.main.environment.addStyle({"display":"block"});el.mainiframe.environment.addStyle({"display":"block"});if(env.showIconWhenHidden){el.firebugIcon.environment.addStyle({"display":"none"});}}},iconClicked:function(_event){with(firebug){if(_event.ctrlKey==true||_event.metaKey==true){el.firebugIcon.environment.addStyle({"display":"none"});env.showIconWhenHidden=false;}else{win.show();}}},minimize:function(){with(firebug){env.minimized=true;el.main.environment.addStyle({"height":"35px"});el.mainiframe.environment.addStyle({"height":"35px"});el.button.maximize.environment.addStyle({"display":"block"});el.button.minimize.environment.addStyle({"display":"none"});win.refreshSize();}},maximize:function(){with(firebug){env.minimized=false;el.button.minimize.environment.addStyle({"display":"block"});el.button.maximize.environment.addStyle({"display":"none"});win.setHeight(env.height);}},newWindow:function(){var interval,scripts,script,scriptPath,fe=firebug.env;if(!fe.popupWin){scripts=document.getElementsByTagName('script');fe.popupWin=window.open("","_firebug","status=0,menubar=0,resizable=1,top="+fe.popupTop+",left="+fe.popupLeft+",width="+fe.popupWidth+",height="+fe.popupHeight+",scrollbars=0,addressbar=0,outerWidth="+fe.popupWidth+",outerHeight="+fe.popupHeight+"toolbar=0,location=0,directories=0,dialog=0");if(!fe.popupWin){alert("Firebug Lite could not open a pop-up window, most likely because of a popup blocker.\nPlease enable popups for this domain");}else{firebug.settings.hide();for(i=0,len=scripts.length;i<len;i++){if(scripts[i].src.indexOf(fe.liteFilename)>-1){scriptPath=scripts[i].src;break;}}
-if(scriptPath){script=fe.popupWin.document.createElement('script'),done=false;script.type='text/javascript';script.src=scriptPath;script[firebug.lib.env.ie?"onreadystatechange":"onload"]=function(){if(!done&&(!firebug.lib.env.ie||this.readyState=="complete"||this.readyState=="loaded")){done=true;if(fe.popupWin.firebug){with(fe.popupWin.firebug){env.isPopup=true;env.css=fe.css;init();el.button.dock.environment.addStyle({"display":"block"});el.button.newWindow.environment.addStyle({"display":"none"});}}}};if(!done&&firebug.lib.env.webkit){fe.popupWin.document.write('<html><head></head><body></body></html>');interval=setInterval(function(){if(fe.popupWin.firebug){clearInterval(interval);done=true;with(fe.popupWin.firebug){env.isPopup=true;env.css=fe.css;init();el.button.dock.environment.addStyle({"display":"block"});el.button.newWindow.environment.addStyle({"display":"none"});}}},10);};if(!done){fe.popupWin.document.getElementsByTagName('head')[0].appendChild(script);firebug.el.main.environment.addStyle({"display":"none"});firebug.el.mainiframe.environment.addStyle({"display":"none"});}}else{alert("Unable to detect the following script \""+fe.liteFilename+"\" ... if the script has been renamed then please set the value of firebug.env.liteFilename to reflect this change");fe.popupWin.close();fe.popupWin=null;}}}},dock:function(){with(opener.firebug){env.popupWin=null;el.main.environment.addStyle({"display":"block"});el.mainiframe.environment.addStyle({"display":"block"});settings.readCookie();window.close();};},unload:function(){with(firebug){if(env.isPopup){win.dock();}else if(env.popupWin){env.popupWin.close();}}},fitToPopup:function(){with(firebug){var viewport=lib.util.GetViewport(window);win.setHeight((window.innerHeight||viewport.height)-38);el.main.environment.addStyle({"width":(viewport.width)+"px"});el.mainiframe.environment.addStyle({"width":(viewport.width)+"px"});}},resizer:{y:[],enabled:false,start:function(_event){with(firebug){if(env.minimized)return;win.resizer.y=[el.main.element.offsetHeight,_event.clientY];if(lib.env.ie6){win.resizer.y[3]=parseInt(el.main.environment.getPosition().top);}
-win.resizer.enabled=true;}},resize:function(_event){with(firebug){if(!win.resizer.enabled)return;win.resizer.y[2]=(win.resizer.y[0]+(win.resizer.y[1]-_event.clientY));el.main.environment.addStyle({"height":win.resizer.y[2]+"px"});el.mainiframe.environment.addStyle({"height":win.resizer.y[2]+"px"});if(lib.env.ie6){el.main.environment.addStyle({"top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px"});el.mainiframe.environment.addStyle({"top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px"});}}},stop:function(_event){with(firebug){if(win.resizer.enabled){win.resizer.enabled=false;win.setHeight(win.resizer.y[2]-35);}}}},setHeight:function(_height){with(firebug){env.height=_height;el.left.container.environment.addStyle({"height":_height+"px"});el.right.container.environment.addStyle({"height":_height+"px"});el.main.environment.addStyle({"height":_height+38+"px"});el.mainiframe.environment.addStyle({"height":_height+38+"px"});win.refreshSize();el.left.console.monitor.element.parentNode.style.height=_height-47+"px";el.left.console.mlButton.environment.addStyle({"top":_height+19+"px"});el.right.console.mlButton.environment.addStyle({"top":_height+19+"px"});el.right.console.input.environment.addStyle({"height":_height-29+"px"});el.left.html.container.environment.addStyle({"height":_height-23+"px"});el.right.html.content.environment.addStyle({"height":_height-23+"px"});el.left.css.container.environment.addStyle({"height":_height-33+"px"});el.right.css.input.environment.addStyle({"height":_height-55+"px"});el.left.scripts.container.environment.addStyle({"height":_height-23+"px"});el.left.dom.container.environment.addStyle({"height":_height-31+"px"});el.left.xhr.container.environment.addStyle({"height":_height-32+"px"});el.left.str.container.environment.addStyle({"height":_height-32+"px"});}},refreshDOM:function(){with(firebug){d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);if(d.html.nIndex=="dom"){firebug.d.html.navigate("dom")}}},refreshSize:function(){with(firebug){if(!env.init)
-return;var dim=lib.util.GetViewport();el.main.environment.addStyle({"width":dim.width+"px"});el.mainiframe.environment.addStyle({"width":dim.width+"px"});if(lib.env.ie6)
-win.setVerticalPosition(dim);}},setVerticalPosition:function(_dim,_event){with(firebug){var dim=_dim||lib.util.GetViewport();el.main.environment.addStyle({"top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px"});el.mainiframe.environment.addStyle({"top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px"});}}},d:{clean:function(_element){with(firebug){_element.update("");}},console:{addLine:function(){with(firebug){return new lib.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor);}},cache:[],clear:function(){with(firebug){d.clean(el.left.console.monitor);d.console.cache=[];}},formatArgs:function(){with(firebug){var content=[];for(var i=0,len=arguments.length;i<len;i++){content.push(d.highlight(arguments[i],false,false,true));}
-return content.join(" ");}},history:[],historyIndex:0,openObject:function(_index){with(firebug){d.dom.open(d.console.cache[_index],el.left.dom.container,lib.env.ie);d.navigate("dom");}},print:function(_cmd,_text){with(firebug){d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);d.console.addLine().update(d.highlight(_text,false,false,true));d.console.scroll();}},printException:function(_exception){with(firebug){var message=_exception.description||_exception.message||_exception;if(_exception.fileName){message+=' ('+(_exception.name&&(_exception.name+', ')||'')+getFileName(_exception.fileName)+', '+_exception.lineNumber+')';}
-d.console.addLine().attribute.addClass("Error").update("<strong>Error: </strong>"+message,true);}},eval:function(_cmd){var result;with(firebug){if(_cmd.length==0)
-return;el.left.console.input.environment.getElement().value="";d.console.historyIndex=d.console.history.push(_cmd);try{if(_cmd==='console.firebug'){d.console.addLine().attribute.addClass("Arrow").update(firebug.version);}else{result=eval.call(window,_cmd);d.console.print(_cmd,result);}}catch(e){d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);d.console.printException(e);}
-d.console.scroll();}},scroll:function(){with(firebug){el.left.console.monitor.environment.getElement().parentNode.scrollTop=Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-(el.left.console.monitor.element.parentNode.offsetHeight-11));}},run:function(_command){with(firebug){if(!env.init){d.console.cache.push({"command":_command,"arg":Array.prototype.slice.call(arguments,1)});}else{d.console.cmd[_command].apply(window,Array.prototype.slice.call(arguments,1));}}},toggleML:function(){with(firebug){var open=!env.ml;env.ml=!env.ml;d.navigateRightColumn("console",open);el[open?"left":"right"].console.mlButton.environment.addStyle({display:"none"});el[!open?"left":"right"].console.mlButton.environment.addStyle({display:"block"});el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML");}},countMap:{},timeMap:{},cmd:{log:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Log").update(args);d.console.scroll();}},warn:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Warn").update(args);d.console.scroll();}},info:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Info").update(args);d.console.scroll();}},debug:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Debug").update(args);d.console.scroll();}},error:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Error").update(args);d.console.scroll();}},trace:function(_value){with(firebug){var stackAmt=3,f=arguments.caller,isArray=lib.util.IsArray(f);if((!isArray&&f)||(isArray&&f.length>0)){d.console.addLine().attribute.addClass("Arrow").update(">>> console.trace(stack)");for(var i=0;i<stackAmt;i++){var func=f.toString(),args=f.arguments;d.dom.open({"function":func,"arguments":args},d.console.addLine());f=f.caller;}}}},dir:function(_value){with(firebug){d.console.addLine().attribute.addClass("Arrow").update(">>> console.dir("+_value+")");d.dom.open(_value,d.console.addLine());}},dirxml:function(){with(firebug){d.console.cmd.log.apply(this,arguments);}},time:function(_name){with(firebug){d.console.timeMap[_name]=new Date().getTime();}},timeEnd:function(_name){with(firebug){if(_name in d.console.timeMap){var delta=new Date().getTime()-d.console.timeMap[_name],args=d.console.formatArgs.apply(window,[_name+":",delta+"ms"]);d.console.addLine().attribute.addClass("log").update(args);delete d.console.timeMap[_name];}}},count:function(_name){with(firebug){if(!d.console.countMap[_name])
-d.console.countMap[_name]=0;d.console.countMap[_name]++;d.console.cmd.log.apply(window,[_name,d.console.countMap[_name]]);}},group:function(){with(firebug){d.console.cmd.log.apply(this,["console.group is not supported"]);}},groupEnd:function(){with(firebug){d.console.cmd.log.apply(this,["console.groupEnd is not supported"]);}},profile:function(){with(firebug){d.console.cmd.log.apply(this,["console.profile is not supported"]);}},profileEnd:function(){with(firebug){d.console.cmd.log.apply(this,["console.profileEnd is not supported"]);}}}},css:{index:-1,open:function(_index){with(firebug){var item=env.targetWindow.document.styleSheets[_index],uri=item.href;try{var rules=item[lib.env.ie?"rules":"cssRules"],str="";for(var i=0;i<rules.length;i++){var item=rules[i];var selector=item.selectorText;var cssText=lib.env.ie?item.style.cssText:item.cssText.match(/\{(.*)\}/)[1];str+=d.css.printRule(selector,cssText.split(";"),el.left.css.container);}}catch(e){str="<em>Access to restricted URI denied</em>";}
-el.left.css.container.update(str);}},printRule:function(_selector,_css,_layer){with(firebug){var str="<div class='Selector'>"+_selector+" {</div>";for(var i=0,len=_css.length;i<len;i++){var item=_css[i];str+="<div class='CSSText'>"+item.replace(/(.+\:)(.+)/,"<span class='CSSProperty'>$1</span><span class='CSSValue'>$2;</span>")+"</div>";}
-str+="<div class='Selector'>}</div>";return str;}},refresh:function(){with(firebug){el.button.css.selectbox.update("");var collection=env.targetWindow.document.styleSheets;for(var i=0,len=collection.length;i<len;i++){var uri=getFileName(collection[i].href);d.css.index=d.css.index<0?i:d.css.index;el.button.css.selectbox.child.add(new lib.element("OPTION").attribute.set("value",i).update(uri))};d.css.open(d.css.index);}}},dom:{open:function(_object,_layer){with(firebug){_layer.clean();var container=new lib.element("DIV").attribute.addClass("DOMContent").insert(_layer);d.dom.print(_object,container);}},print:function(_object,_parent,_inTree){with(firebug){var obj=_object||window,parentElement=_parent;parentElement.update("");if(parentElement.opened&&parentElement!=el.left.dom.container){parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.removeClass("Opened");parentElement.opened=false;parentElement.environment.addStyle({"display":"none"});return;}
-if(_inTree)
-parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.addClass("Opened");parentElement.opened=true;for(var key in obj){try{if(env.hideDOMFunctions&&typeof(obj[key])=="function")continue;var value=obj[key],property=key,container=new lib.element("DIV").attribute.addClass("DOMRow").insert(parentElement),left=new lib.element("DIV").attribute.addClass("DOMRowLeft").insert(container),right=new lib.element("DIV").attribute.addClass("DOMRowRight").insert(container);container.child.add(new lib.element("DIV").attribute.addClass('Clear'));var link=new lib.element("A").attribute.addClass(typeof value=="object"&&Boolean(value)?"Property Object":"Property").update(property).insert(left);right.update(d.highlight(value,false,true));var subContainer=new lib.element("DIV").attribute.addClass("DOMRowSubContainer").insert(container);if(typeof value!="object"||Boolean(value)==false)
-continue;link.event.addListener("click",lib.util.Curry(d.dom.print,window,value,subContainer,true));}catch(e){}}
-parentElement.environment.addStyle({"display":"block"});}}},highlight:function(_value,_inObject,_inArray,_link){with(firebug){var isArray=false,isHash,isElement=false,vtype=typeof _value,result=[];if(vtype=="object"){if(Object.prototype.toString.call(_value)==="[object Date]"){vtype="date";}else if(Object.prototype.toString.call(_value)==="[object String]"){vtype="string";}else if(Object.prototype.toString.call(_value)==="[object Boolean]"){vtype="boolean";}else if(Object.prototype.toString.call(_value)==="[object RegExp]"){vtype="regexp";}}
-try{isArray=lib.util.IsArray(_value);isHash=lib.util.IsHash(_value);isElement=_value!=undefined&&Boolean(_value.nodeName)&&Boolean(_value.nodeType);if(_value==null||vtype=="number"||vtype=="string"||vtype=="boolean"||vtype=="function"||vtype=="regexp"||vtype=="date"){if(_value==null){result.push("<span class='Null'>null</span>");}else if(vtype=="regexp"){result.push("<span class='Maroon'>"+_value+"</span>");}else if(vtype=="date"){result.push("<span class='DarkBlue'>'"+_value+"'</span>");}else if(vtype=="boolean"||vtype=="number"){result.push("<span class='DarkBlue'>"+_value+"</span>");}else if(vtype=="function"){result.push("<span class='"+(_inObject?"Italic Gray":"Green")+"'>function()</span>");}else{result.push("<span class='Red'>\""+(!_inObject&&!_inArray?_value:_value.substring(0,35)+(_value.length>35?" ...":"")).replace(/\n/g,"\\n").replace(/\s/g,"&nbsp;").replace(/>/g,"&#62;").replace(/</g,"&#60;")+"\"</span>");}}
-else if(isElement){if(_value.nodeType==3)
-result.push(d.highlight(_value.nodeValue));else if(_inObject){result.push("<span class='Gray Italic'>"+_value.nodeName.toLowerCase()+"</span>");}else{result.push("<span class='Blue"+(!_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.html.inspect(firebug.d.console.cache["+(d.console.cache.push(_value)-1)+"])'")+"'>");if(_inArray){result.push(_value.nodeName.toLowerCase());if(_value.getAttribute){if(_value.getAttribute&&_value.getAttribute("id"))
-result.push("<span class='DarkBlue'>#"+_value.getAttribute("id")+"</span>");var elClass=_value.getAttribute(lib.env.ie&&!lib.env.ie8?"className":"class")||"";result.push(!elClass?"":"<span class='Red'>."+elClass.split(" ")[0]+"</span>");}
-result.push("</span>");}else{result.push("<span class='DarkBlue'>&#60;<span class='Blue TagName'>"+_value.nodeName.toLowerCase());if(_value.attributes){for(var i=0,len=_value.attributes.length;i<len;i++){var item=_value.attributes[i];if(!lib.env.ie||item.nodeValue)
-result.push(" <span class='DarkBlue'>"+item.nodeName+"=\"<span class='Red'>"+item.nodeValue+"</span>\"</span>");}}
-result.push("</span>&#62;</span>");}}}
-else if(isArray||isHash){if(isArray){if(_inObject){result.push("<span class='Gray Italic'>["+_value.length+"]</span>");}else{result.push("<span class='Strong'>[ ");for(var i=0,len=_value.length;i<len;i++){if((_inObject||_inArray)&&i>3){result.push(", <span class='Strong Gray'>"+(len-4)+" More...</span>");break;}
-result.push((i>0?", ":"")+d.highlight(_value[i],false,true,true));}
-result.push(" ]</span>");}}else if(_inObject){result.push("<span class='Gray Italic'>Object</span>");}else{result.push("<span class='Strong Green"+(!_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.console.openObject("+(d.console.cache.push(_value)-1)+")'")+">Object");var i=0;for(var key in _value){var value=_value[key];if((_inObject||_inArray)&&i>3){result.push(" <span class='Strong Gray'>More...</span>");break;}
-result.push(" "+key+"="+d.highlight(value,true));i++;}
-result.push("</span>");}}else{result.push(["<span class'Gray Italic'>"+_value+"</span>"]);}}catch(e){result.push("..");}
-return result.join("");}},html:{nIndex:"computedStyle",current:null,highlight:function(_element,_clear,_event){with(firebug){if(_element.firebugElement){return;}
-if(_clear){env.targetWindow.firebug.el.bgInspector.environment.addStyle({"display":"none"});return;}
-d.inspector.inspect(_element,true);}},inspect:function(_element){var map=[],parentLayer,t,tagName,parent=_element;while(parent){map.push(parent);if(parent==firebug.env.targetWindow.document.body)break;parent=parent.parentNode;}
-map=map.reverse();with(firebug){if(env.dIndex!="html"){env.targetWindow.firebug.d.navigate("html");}
-env.targetWindow.firebug.d.inspector.toggle(false);for(t=0;t<el.left.html.container.child.get().length;t++){if(el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0]){if(el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText){tagName=el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText;}else{tagName=el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].textContent;}
-if(/<body/i.test(tagName)){parentLayer=el.left.html.container.child.get()[t].childNodes[1].lib;break;}}}
-if(!parentLayer){parentLayer=el.left.html.container.child.get()[3].childNodes[1].lib;}
-for(t=0,len=map.length;map[t];t++){if(t==len-1){var link=parentLayer.environment.getElement().previousSibling.lib;link.attribute.addClass("Selected");if(d.html.current){d.html.current[1].attribute.removeClass("Selected");}
-d.html.current=[_element,link];return;}
-parentLayer=d.html.openHtmlTree(map[t],parentLayer,map[t+1]);}}},navigate:function(_index,_element){with(firebug){el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected");el.right.html.nav[_index].attribute.addClass("Selected");d.html.nIndex=_index;d.html.openProperties();}},openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){with(firebug){var element=_element||env.targetWindow.document.documentElement,parent=_parent||el.left.html.container,returnParentEl=_returnParentElementByElement||null,returnParentVal=null,len=element.childNodes.length,nodeLink;if(parent!=el.left.html.container){nodeLink=parent.environment.getParent().lib.child.get()[0].lib;if(d.html.current){d.html.current[1].attribute.removeClass("Selected");}
-nodeLink.attribute.addClass("Selected");d.html.current=[_element,nodeLink];d.html.openProperties();};if(element.childNodes&&(len==0||(len==1&&element.childNodes[0].nodeType==3)))return;parent.clean();if(parent.opened&&Boolean(_returnParentElementByElement)==false){parent.opened=false;parent.element.previousSibling.lib.attribute.removeClass("Open");parent.element.lib.attribute.removeClass("OpenSubContainer");return;};if(parent!=el.left.html.container){parent.element.previousSibling.lib.attribute.addClass("Open");parent.element.lib.attribute.addClass("OpenSubContainer");parent.opened=true;};if(element==document.documentElement){new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;<span class='Blue'>html</span>&#62;").insert(parent);};for(var i=0;i<=len;i++){if(i==len){new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;/<span class='Blue'>"+element.nodeName.toLowerCase()+"</span>&#62;").insert(container);break;}
-var item=element.childNodes[i];if(item.nodeType!=3){var container=new lib.element().attribute.addClass("Block").insert(parent),link=new lib.element("A").attribute.addClass("Link").insert(container),spacer=new lib.element("SPAN").attribute.addClass("Spacer").update("&nbsp;").insert(link),html=new lib.element("SPAN").attribute.addClass("Content").update(d.highlight(item)).insert(link),subContainer=new lib.element("DIV").attribute.addClass("SubContainer").insert(container),view=lib.util.Element.getView(item);link.event.addListener("click",lib.util.Curry(d.html.openHtmlTree,window,item,subContainer,false));link.event.addListener("mouseover",lib.util.Curry(d.html.highlight,window,item,false));link.event.addListener("mouseout",lib.util.Curry(d.html.highlight,window,item,true));returnParentVal=returnParentEl==item?subContainer:returnParentVal;if(d.html.current==null&&item==document.body){link.attribute.addClass("Selected");d.html.current=[item,link];d.html.openHtmlTree(item,subContainer);}
-if(element.nodeName!="HEAD"&&element!=document.documentElement&&(view.visibility=="hidden"||view.display=="none")){container.attribute.addClass("Unvisible");};if(item.childNodes){var childLen=item.childNodes.length;if(childLen==1&&item.childNodes[0].nodeType==3){html.child.add(document.createTextNode(item.childNodes[0].nodeValue.substring(0,50)));html.child.add(document.createTextNode("</"));html.child.add(new lib.element("span").attribute.addClass("Blue").update(item.nodeName.toLowerCase()).environment.getElement());html.child.add(document.createTextNode(">"));continue;}
-else
-if(childLen>0){link.attribute.addClass("Parent");}}}};return returnParentVal;}},openProperties:function(){with(firebug){var index=d.html.nIndex;var node=d.html.current[0];d.clean(el.right.html.content);var str="";switch(index){case"computedStyle":var property=["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort();var view=document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle;for(var i=0,len=property.length;i<len;i++){var item=property[i];if(!view[item])continue;str+="<div class='CSSItem'><div class='CSSProperty'>"+item+"</div><div class='CSSValue'>"+d.highlight(view[item])+"</div></div>";}
-el.right.html.content.update(str);break;case"dom":d.dom.open(node,el.right.html.content,lib.env.ie);break;}}}},inspector:{enabled:false,el:null,inspect:function(_element,_bgInspector){with(firebug){var pos=env.targetWindow.firebug.lib.util.Element.getPosition(_element);env.targetWindow.firebug.el[_bgInspector&&"bgInspector"||"borderInspector"].environment.addStyle({"width":_element.offsetWidth+"px","height":_element.offsetHeight+"px","top":pos.offsetTop-(_bgInspector?0:2)+"px","left":pos.offsetLeft-(_bgInspector?0:2)+"px","display":"block"});9
-if(!_bgInspector){d.inspector.el=_element;}};},toggle:function(_absoluteValue,_event){with(firebug){if(_absoluteValue==d.inspector.enabled)
-return;d.inspector.enabled=_absoluteValue!=undefined&&!_absoluteValue.clientX?_absoluteValue:!d.inspector.enabled;el.button.inspect.attribute[(d.inspector.enabled?"add":"remove")+"Class"]("Enabled");if(d.inspector.enabled==false){el.borderInspector.environment.addStyle({"display":"none"});d.inspector.el=null;}else if(lib.env.dIndex!="html"){if(env.popupWin){env.popupWin.firebug.d.navigate("html");}else{d.navigate("html");}}}}},scripts:{index:-1,lineNumbers:false,open:function(_index){with(firebug){d.scripts.index=_index;el.left.scripts.container.update("");var script=document.getElementsByTagName("script")[_index],uri=script.src||document.location.href,source;try{if(uri!=document.location.href){source=env.cache[uri]||lib.xhr.get(uri).responseText;env.cache[uri]=source;}else{source=script.innerHTML;}
-source=source.replace(/<|>/g,function(_ch){return({"<":"&#60;",">":"&#62;"})[_ch];});if(!d.scripts.lineNumbers)
-el.left.scripts.container.child.add(new lib.element("DIV").attribute.addClass("CodeContainer").update(source));else{source=source.split("<br />");for(var i=0;i<source.length;i++){el.left.scripts.container.child.add(new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("LineNumber").update(i+1),new lib.element("DIV").attribute.addClass("Code").update("&nbsp;"+source[i]),new lib.element("DIV").attribute.addClass('Clear')));};};}catch(e){el.left.scripts.container.child.add(new lib.element("DIV").attribute.addClass("CodeContainer").update("<em>Access to restricted URI denied</em>"));}}},toggleLineNumbers:function(){with(firebug){d.scripts.lineNumbers=!d.scripts.lineNumbers;el.button.scripts.lineNumbers.attribute[(d.scripts.lineNumbers?"add":"remove")+"Class"]("Enabled");d.scripts.open(d.scripts.index);}},refresh:function(){with(firebug){el.button.scripts.selectbox.clean();var collection=env.targetWindow.document.getElementsByTagName("script");for(var i=0,len=collection.length;i<len;i++){var item=collection[i],fileName=getFileName(item.src||item.baseURI||"..");d.scripts.index=d.scripts.index<0?i:d.scripts.index;el.button.scripts.selectbox.child.add(new lib.element("OPTION").attribute.set("value",i).update(fileName));}
-d.scripts.open(d.scripts.index);}}},str:{open:function(_str){with(firebug){d.navigate("str");el.left.str.container.update(_str.replace(/\n/g,"<br />"))}}},xhr:{objects:[],addObject:function(){with(firebug){for(var i=0,len=arguments.length;i<len;i++){try{var item=arguments[i],val=env.targetWindow.eval(item);d.xhr.objects.push([item,val]);}catch(e){continue;}}}},open:function(){with(firebug){el.left.xhr.container.update("");el.left.xhr.name=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({"width":"20%"}).insert(el.left.xhr.container));el.left.xhr.nameTitle=new lib.element("STRONG").update("Object Name:").insert(el.left.xhr.name);el.left.xhr.nameContent=new lib.element("DIV").insert(el.left.xhr.name);el.left.xhr.status=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({"width":"10%"}).insert(el.left.xhr.container));el.left.xhr.statusTitle=new lib.element("STRONG").update("Status:").insert(el.left.xhr.status);el.left.xhr.statusContent=new lib.element("DIV").insert(el.left.xhr.status);el.left.xhr.readystate=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({"width":"15%"}).attribute.addClass("Block").insert(el.left.xhr.container));el.left.xhr.readystateTitle=el.left.xhr.nameTitle=new lib.element("STRONG").update("Ready State:").insert(el.left.xhr.readystate);el.left.xhr.readystateContent=new lib.element("DIV").insert(el.left.xhr.readystate);el.left.xhr.response=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({"width":(lib.env.ie?"50":"55")+"%"}).attribute.addClass("Block").insert(el.left.xhr.container));el.left.xhr.responseTitle=new lib.element("STRONG").update("Response:").insert(el.left.xhr.response);el.left.xhr.responseContent=new lib.element("DIV").insert(el.left.xhr.response);setTimeout(d.xhr.refresh,500);}},refresh:function(){with(firebug){el.left.xhr.nameContent.update("");el.left.xhr.statusContent.update("");el.left.xhr.readystateContent.update("");el.left.xhr.responseContent.update("");for(var i=0,len=d.xhr.objects.length;i<len;i++){var item=d.xhr.objects[i],response=item[1].responseText;if(Boolean(item[1])==false)continue;el.left.xhr.nameContent.child.add(new lib.element("span").update(item[0]));try{el.left.xhr.statusContent.child.add(new lib.element("span").update(item[1].status));}catch(e){el.left.xhr.statusContent.child.add(new lib.element("span").update("&nbsp;"));}
-el.left.xhr.readystateContent.child.add(new lib.element("span").update(item[1].readyState));el.left.xhr.responseContent.child.add(new lib.element("span").child.add(new lib.element("A").event.addListener("click",lib.util.Curry(d.str.open,window,response)).update("&nbsp;"+response.substring(0,50))));};if(env.dIndex=="xhr")
-setTimeout(d.xhr.refresh,500);}}},navigateRightColumn:function(_index,_open){with(firebug){el.left.container.environment.addStyle({"width":_open?"70%":"100%"});el.right.container.environment.addStyle({"display":_open?"block":"none"});}},navigate:function(_index){with(firebug){var open=_index,close=env.dIndex;env.dIndex=open;settings.hide();el.button[close].container.environment.addStyle({"display":"none"});el.left[close].container.environment.addStyle({"display":"none"});el.right[close].container.environment.addStyle({"display":"none"});el.button[open].container.environment.addStyle({"display":"inline"});el.left[open].container.environment.addStyle({"display":"block"});el.right[open].container.environment.addStyle({"display":"block"});if(el.nav[close])
-el.nav[close].attribute.removeClass("Selected");if(el.nav[open])
-el.nav[open].attribute.addClass("Selected");switch(open){case"console":d.navigateRightColumn(_index);break;case"html":d.navigateRightColumn(_index,true);if(!d.html.current){var t=Number(new Date);d.html.openHtmlTree();}
-break;case"css":d.navigateRightColumn(_index,true);d.css.refresh();break;case"scripts":d.navigateRightColumn(_index);d.scripts.refresh();break;case"dom":d.navigateRightColumn(_index);if(el.left.dom.container.environment.getElement().innerHTML==""){var t=Number(new Date);d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);}
-break;case"xhr":d.navigateRightColumn(_index);d.xhr.open();break;}}}},getFileName:function(_path){var match=_path&&_path.match(/[\w\-\.\?\=\&]+$/);return match&&match[0]||_path;},cancelEvent:function(_event){if(_event.stopPropagation)
-_event.stopPropagation();if(_event.preventDefault)
-_event.preventDefault();},getSelection:function(_el){with(firebug){if(lib.env.ie){var range=document.selection.createRange(),stored=range.duplicate();stored.moveToElementText(_el);stored.setEndPoint('EndToEnd',range);_el.selectionStart=stored.text.length-range.text.length;_el.selectionEnd=_el.selectionStart+range.text.length;}
-return{start:_el.selectionStart,length:_el.selectionEnd-_el.selectionStart}}},tab:function(_el,_event){with(firebug){if(_event.keyCode==9){if(_el.setSelectionRange){var position=firebug.getSelection(_el);_el.value=_el.value.substring(0,position.start)+String.fromCharCode(9)+_el.value.substring(position.start+position.length,_el.value.length);_el.setSelectionRange(position.start+1,position.start+1);}else if(document.selection){var range=document.selection.createRange(),isCollapsed=range.text=='';range.text=String.fromCharCode(9);range.moveStart('character',-1);}
-firebug.cancelEvent(_event);if(lib.env.ie)
-setTimeout(_el.focus,100);};}},listen:{addXhrObject:function(){with(firebug){d.xhr.addObject.apply(env.targetWindow,el.button.xhr.textbox.environment.getElement().value.split(","));}},consoleTextbox:function(_event){with(firebug){if(_event.keyCode==13&&(env.multilinemode==false||_event.shiftKey==false)){d.console.historyIndex=d.console.history.length;d.console.eval(el.left.console.input.environment.getElement().value);return false;}
-switch(_event.keyCode){case 40:if(d.console.history[d.console.historyIndex+1]){d.console.historyIndex+=1;el.left.console.input.update(d.console.history[d.console.historyIndex]);}
-break;case 38:if(d.console.history[d.console.historyIndex-1]){d.console.historyIndex-=1;el.left.console.input.update(d.console.history[d.console.historyIndex]);}
-break;}}},cssSelectbox:function(){with(firebug){d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex);}},domTextbox:function(_event){with(firebug){if(_event.keyCode==13){d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);}}},inspector:function(){with(firebug){if(env.popupWin){env.popupWin.firebug.d.html.inspect(firebug.d.inspector.el);}else{firebug.d.html.inspect(firebug.d.inspector.el);}}},keyboard:function(_event){with(firebug){if(_event.keyCode==27&&d.inspector.enabled){d.inspector.toggle();}else if(_event.keyCode===123&&_event.ctrlKey||_event.metaKey){if(env.isPopup){win.dock();}else{win.newWindow();}}else if((_event.keyCode===123&&!_event.ctrlKey&&!_event.metaKey)||(_event.keyCode===76&&(_event.ctrlKey||_event.metaKey)&&_event.shiftKey)||(_event.keyCode===13&&_event.shiftKey)){if(env.isPopup){win.dock();}else if(el.main.environment.getStyle("display")==='none'){win.show();}else{win.hide();}}}},mouse:function(_event){with(firebug){var target;if(document.elementFromPoint){target=document.elementFromPoint(_event.clientX,_event.clientY);}else{if(lib.env.ie){target=_event.srcElement;}else{target=_event.explicitOriginalTarget||_event.target;}}
-if(d.inspector.enabled&&target!=document.body&&target!=document.firstChild&&target!=document.childNodes[1]&&target!=el.borderInspector.environment.getElement()&&target!=el.main.environment.getElement()&&target.offsetParent!=el.main.environment.getElement()){d.inspector.inspect(target);}}},runMultiline:function(){with(firebug){d.console.eval.call(window,el.right.console.input.environment.getElement().value);}},runCSS:function(){with(firebug){var source=el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}");for(var i=0,len=source.length;i<len;i++){var item=source[i]+"}",rule=!lib.env.ie?item:item.split(/{|}/),styleSheet=document.styleSheets[0];console.log(rule);if(item.match(/.+\{.+\}/)){if(lib.env.ie)
-styleSheet.addRule(rule[0],rule[1]);else
-styleSheet.insertRule(rule,styleSheet.cssRules.length);}}}},scriptsSelectbox:function(){with(firebug){d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value));}},xhrTextbox:function(_event){with(firebug){if(_event.keyCode==13){d.xhr.addObject.apply(env.targetWindow,el.button.xhr.textbox.environment.getElement().value.split(","));}}}}};(function(_scope){_scope.lib={};var pi=_scope.lib;pi.version=[1.1,2008091000];pi.env={ie:/MSIE/i.test(navigator.userAgent),ie6:/MSIE 6/i.test(navigator.userAgent),ie7:/MSIE 7/i.test(navigator.userAgent),ie8:/MSIE 8/i.test(navigator.userAgent),firefox:/Firefox/i.test(navigator.userAgent),opera:/Opera/i.test(navigator.userAgent),webkit:/Webkit/i.test(navigator.userAgent),camino:/Camino/i.test(navigator.userAgent)};pi.get=function(){return document.getElementById(arguments[0]);};pi.get.byTag=function(){return document.getElementsByTagName(arguments[0]);};pi.get.byClass=function(){return document.getElementsByClassName.apply(document,arguments);};pi.util={Array:{clone:function(_array,_undeep){var tmp=[];Array.prototype.push.apply(tmp,_array);pi.util.Array.forEach(tmp,function(_item,_index,_source){if(_item instanceof Array&&!_undeep)
-_source[_index]=pi.util.Array.clone(_source[_index]);});return tmp;},count:function(_array,_value){var count=0;pi.util.Array.forEach(_array,function(){count+=Number(arguments[0]==_value);});return count;},forEach:function(_array,_function){if(_array.forEach)
-return _array.forEach(_function);for(var i=0,len=_array.length;i<len;i++)
-_function.apply(_array,[_array[i],i,_array]);},getLatest:function(_array){return _array[_array.length-1];},indexOf:function(_array,_value){if(!pi.env.ie){return _array.indexOf(_value);};var index=-1;for(var i=0,len=_array.length;i<len;i++){if(_array[i]==_value){index=i;break;}}
-return index;},remove:function(_array,_index){var result=_array.slice(0,_index);_array=Array.prototype.push.apply(result,_array.slice(_index+1));return result;}},Curry:function(_fn,_scope){var fn=_fn,scope=_scope||window,args=Array.prototype.slice.call(arguments,2);return function(){return fn.apply(scope,args.concat(Array.prototype.slice.call(arguments,0)));};},Extend:function(_superClass,_prototype,_skipClonning){var object=new pi.base;if(_prototype["$Init"]){object.init=_prototype["$Init"];delete _prototype["$Init"];};object.body=_superClass==pi.base?_prototype:pi.util.Hash.merge(_prototype,_superClass.prototype);object.init=object.init||function(){if(_superClass!=pi.base)
-_superClass.apply(this,arguments);};return object.build(_skipClonning);},IsArray:function(_object){if(_object===null){return false;}
-if(window.NodeList&&window.NamedNodeMap&&!pi.env.ie8){if(_object instanceof Array||_object instanceof NodeList||_object instanceof NamedNodeMap||(window.HTMLCollection&&_object instanceof HTMLCollection))
-return true;};if(!_object||_object==window||typeof _object=="function"||typeof _object=="string"||typeof _object.length!="number"){return false};var len=_object.length;if(len>0&&_object[0]!=undefined&&_object[len-1]!=undefined){return true;}else{for(var key in _object){if(key!="item"&&key!="length"&&key!="setNamedItemNS"&&key!="setNamedItem"&&key!="getNamedItem"&&key!="removeNamedItem"&&key!="getNamedItemNS"&&key!="removeNamedItemNS"&&key!="tags"){return false;}}
-return true};},IsHash:function(_object){return _object&&typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object)},Init:[],AddEvent:function(_element,_eventName,_fn,_useCapture){_element[pi.env.ie?"attachEvent":"addEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);return pi.util.Curry(pi.util.AddEvent,this,_element);},RemoveEvent:function(_element,_eventName,_fn,_useCapture){_element[pi.env.ie?"detachEvent":"removeEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);return pi.util.Curry(pi.util.RemoveEvent,this,_element);},Element:{addClass:function(_element,_class){if(!pi.util.Element.hasClass(_element,_class))
-pi.util.Element.setClass(_element,pi.util.Element.getClass(_element)+" "+_class);},getClass:function(_element){return _element.getAttribute(pi.env.ie&&!pi.env.ie8?"className":"class")||"";},hasClass:function(_element,_class){return pi.util.Array.indexOf(pi.util.Element.getClass(_element).split(" "),_class)>-1;},removeClass:function(_element,_class){if(pi.util.Element.hasClass(_element,_class)){var names=pi.util.Element.getClass(_element,_class).split(" ");pi.util.Element.setClass(_element,pi.util.Array.remove(names,pi.util.Array.indexOf(names,_class)).join(" "));}},setClass:function(_element,_value){if(pi.env.ie8){_element.setAttribute("className",_value);_element.setAttribute("class",_value);}else{_element.setAttribute(pi.env.ie?"className":"class",_value);}},toggleClass:function(){if(pi.util.Element.hasClass.apply(this,arguments))
-pi.util.Element.removeClass.apply(this,arguments);else
-pi.util.Element.addClass.apply(this,arguments);},getOpacity:function(_styleObject){var styleObject=_styleObject;if(!pi.env.ie)
-return styleObject["opacity"];var alpha=styleObject["filter"].match(/opacity\=(\d+)/i);return alpha?alpha[1]/100:1;},setOpacity:function(_element,_value){if(!pi.env.ie)
-return pi.util.Element.addStyle(_element,{"opacity":_value});_value*=100;pi.util.Element.addStyle(_element,{"filter":"alpha(opacity="+_value+")"});return this._parent_;},getPosition:function(_element){var parent=_element,offsetLeft=document.body.offsetLeft,offsetTop=document.body.offsetTop,view=pi.util.Element.getView(_element);while(parent&&parent!=document.body&&parent!=document.firstChild){offsetLeft+=parseInt(parent.offsetLeft);offsetTop+=parseInt(parent.offsetTop);parent=parent.offsetParent;};return{"bottom":view["bottom"],"clientLeft":_element.clientLeft,"clientTop":_element.clientTop,"left":view["left"],"marginTop":view["marginTop"],"marginLeft":view["marginLeft"],"offsetLeft":offsetLeft,"offsetTop":offsetTop,"position":view["position"],"right":view["right"],"top":view["top"],"zIndex":view["zIndex"]};},getSize:function(_element){var view=pi.util.Element.getView(_element);return{"height":view["height"],"clientHeight":_element.clientHeight,"clientWidth":_element.clientWidth,"offsetHeight":_element.offsetHeight,"offsetWidth":_element.offsetWidth,"width":view["width"]}},addStyle:function(_element,_style){for(var key in _style){key=key=="float"?pi.env.ie?"styleFloat":"cssFloat":key;if(key=="opacity"&&pi.env.ie){pi.util.Element.setOpacity(_element,_style[key]);continue;}
-try{_element.style[key]=_style[key];}catch(e){}}},getStyle:function(_element,_property){_property=_property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;if(_property=="opacity"&&pi.env.ie)
-return pi.util.Element.getOpacity(_element.style);return typeof _property=="string"?_element.style[_property]:_element.style;},getValue:function(_element){switch(_element.nodeName.toLowerCase()){case"input":case"textarea":return _element.value;case"select":return _element.options[_element.selectedIndex].value;default:return _element.innerHTML;break;}},getView:function(_element,_property){var view=document.defaultView?document.defaultView.getComputedStyle(_element,null):_element.currentStyle;_property=_property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;if(_property=="opacity"&&pi.env.ie)
-return pi.util.Element.getOpacity(_element,view);return typeof _property=="string"?view[_property]:view;}},Hash:{clone:function(_hash,_undeep){var tmp={};for(var key in _hash){if(!_undeep&&pi.util.IsArray(_hash[key])){tmp[key]=pi.util.Array.clone(_hash[key]);}else if(!_undeep&&pi.util.IsHash(_hash[key])){tmp[key]=pi.util.Hash.clone(_hash[key]);}else{tmp[key]=_hash[key];}}
-return tmp;},merge:function(_hash,_source,_undeep){for(var key in _source){var value=_source[key];if(!_undeep&&pi.util.IsArray(_source[key])){if(pi.util.IsArray(_hash[key])){Array.prototype.push.apply(_source[key],_hash[key])}
-else
-value=pi.util.Array.clone(_source[key]);}
-else if(!_undeep&&pi.util.IsHash(_source[key])){if(pi.util.IsHash(_hash[key])){value=pi.util.Hash.merge(_hash[key],_source[key]);}else{value=pi.util.Hash.clone(_source[key]);}}else if(_hash[key])
-value=_hash[key];_hash[key]=value;};return _hash;}},String:{format:function(_str){var values=Array.prototype.slice.call(arguments,1);return _str.replace(/\{(\d)\}/g,function(){return values[arguments[1]];})}},GetViewport:function(){return{height:document.documentElement.clientHeight||document.body.clientHeight,width:document.documentElement.clientWidth||document.body.clientWidth}}};pi.base=function(){this.body={};this.init=null;this.build=function(_skipClonning){var base=this,skipClonning=_skipClonning||false,_private={},fn=function(){var _p=pi.util.Hash.clone(_private);if(!skipClonning){for(var key in this){if(pi.util.IsArray(this[key])){this[key]=pi.util.Array.clone(this[key]);}else
-if(pi.util.IsHash(this[key])){this[key]=pi.util.Hash.clone(this[key],function(_key,_object){this[_key]._parent_=this;});}}};base.createAccessors(_p,this);if(base.init)
-return base.init.apply(this,arguments);return this;};this.movePrivateMembers(this.body,_private);if(this.init){fn["$Init"]=this.init;};fn.prototype=this.body;return fn;};this.createAccessors=function(_p,_branch){var getter=function(_property){return this[_property];},setter=function(_property,_value){this[_property]=_value;return _branch._parent_||_branch;};for(var name in _p){var isPrivate=name.substring(0,1)=="_",title=name.substring(1,2).toUpperCase()+name.substring(2);if(isPrivate){_branch[(_branch["get"+title]?"_":"")+"get"+title]=pi.util.Curry(getter,_p,name);_branch[(_branch["set"+title]?"_":"")+"set"+title]=pi.util.Curry(setter,_p,name);}
-else
-if(pi.util.IsHash(_p[name])){_branch[name]._parent_=_branch;if(!_branch[name])
-_branch[name]={};this.createAccessors(_p[name],_branch[name]);}};};this.movePrivateMembers=function(_object,_branch){for(var name in _object){var isPrivate=name.substring(0,1)=="_";if(isPrivate){_branch[name]=_object[name];delete _object[name];}
-else
-if(pi.util.IsHash(_object[name])){_branch[name]={};this.movePrivateMembers(_object[name],_branch[name]);}};};};pi.element=new pi.base;pi.element.init=function(_val){this.environment.setElement(typeof _val=="string"||!_val?document.createElement(_val||"DIV"):_val);return this;};pi.element.body={"addStyle":function(){return this.environment.addStyle.apply(this.environment,arguments);},"clean":function(){var childs=this.child.get();while(childs.length){childs[0].parentNode.removeChild(childs[0]);}},"clone":function(_deep){return this.environment.getElement().cloneNode(_deep);},"insert":function(_element){_element=_element.environment?_element.environment.getElement():_element;_element.appendChild(this.environment.getElement());return this;},"insertAfter":function(_referenceElement){_referenceElement=_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;_referenceElement.nextSibling?this.insertBefore(_referenceElement.nextSibling):this.insert(_referenceElement.parentNode);return this;},"insertBefore":function(_referenceElement){_referenceElement=_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;_referenceElement.parentNode.insertBefore(this.environment.getElement(),_referenceElement);return this;},"query":function(_expression,_resultType,namespaceResolver,_result){return pi.xpath(_expression,_resultType||"ORDERED_NODE_SNAPSHOT_TYPE",this.environment.getElement(),_namespaceResolver,_result);},"remove":function(){if(this.environment.getParent()){this.environment.getParent().removeChild(this.environment.getElement());}},"update":function(_value){this.element[this.element.nodeName.toLowerCase()=="textarea"||this.element.nodeName.toLowerCase()=="input"?"value":"innerHTML"]=_value;return this;},"attribute":{"getAll":function(){return this._parent_.environment.getElement().attributes;},"clear":function(_name){this.set(_name,"");return this._parent_;},"get":function(_name){return this._parent_.environment.getElement().getAttribute(_name);},"has":function(_name){return pi.env.ie?(this.get(_name)!=null):this._parent_.environment.getElement().hasAttribute(_name);},"remove":function(_name){this._parent_.environment.getElement().removeAttribute(_name);return this._parent_;},"set":function(_name,_value){this._parent_.environment.getElement().setAttribute(_name,_value);return this._parent_;},"addClass":function(_classes){for(var i=0,len=arguments.length;i<len;i++){pi.util.Element.addClass(this._parent_.environment.getElement(),arguments[i]);};return this._parent_;},"clearClass":function(){this.setClass("");this._parent_;},"getClass":function(){return pi.util.Element.getClass(this._parent_.environment.getElement());},"hasClass":function(_class){return pi.util.Element.hasClass(this._parent_.environment.getElement(),_class);},"setClass":function(_value){return pi.util.Element.setClass(this._parent_.environment.getElement(),_value);},"removeClass":function(_class){pi.util.Element.removeClass(this._parent_.environment.getElement(),_class);return this._parent_;},"toggleClass":function(_class){pi.util.Element.toggleClass(this._parent_.environment.getElement(),_class);}},"child":{"get":function(){return this._parent_.environment.getElement().childNodes;},"add":function(_elements){for(var i=0;i<arguments.length;i++){var el=arguments[i];this._parent_.environment.getElement().appendChild(el.environment?el.environment.getElement():el);}
-return this._parent_;},"addAfter":function(_element,_referenceElement){this.addBefore(_element.environment?_element.environment.getElement():_element,(_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement).nextSibling);return this._parent_;},"addBefore":function(_element,_referenceElement){this._parent_.environment.getElement().insertBefore(_element.environment?_element.environment.getElement():_element,_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement);return this._parent_;},"remove":function(_element){this._parent_.environment.getElement().removeChild(_element.environment?_element.environment.getElement():_element);}},"environment":{"_element":null,"setElement":function(_value){this._parent_.element=_value;this._parent_.element.lib=this._parent_;this._parent_.element.firebugElement=true;this._setElement(_value);},"getParent":function(){return this.getElement().parentNode;},"getPosition":function(){return pi.util.Element.getPosition(this.getElement());},"getSize":function(){return pi.util.Element.getSize(this.getElement());},"addStyle":function(_styleObject){pi.util.Element.addStyle(this.getElement(),_styleObject);return this._parent_;},"getStyle":function(_property){return pi.util.Element.getStyle(this.getElement(),_property);},"getName":function(){return this.getElement().nodeName;},"getType":function(){return this.getElement().nodeType;},"getValue":function(){return pi.util.Element.getValue(this.getElement());},"getView":function(_property){return pi.util.Element.getView(this.getElement(),_property);}},"event":{"addListener":function(_event,_fn,_useCapture){pi.util.AddEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);return this._parent_;},"removeListener":function(_event,_fn,_useCapture){pi.util.RemoveEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);return this._parent_;}}};pi.element=pi.element.build();pi.xhr=new pi.base;pi.xhr.init=function(_url){if(!window.XMLHttpRequest){var names=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(var i=0;i<names.length;i++){try{this.environment.setApi(new ActiveXObject(names[i]));break;}catch(e){continue;}}}
-else{this.environment.setApi(new XMLHttpRequest());}
-this.environment.getApi().onreadystatechange=pi.util.Curry(this.event.readystatechange,this);this.environment.setUrl(_url);this.environment.setCallback([]);return this;};pi.xhr.body={"addCallback":function(){return this.environment.addCallback.apply(this.environment,arguments);},"addData":function(){return this.environment.addData.apply(this.environment,arguments);},"abort":function(){this.environment.getApi().abort();return this;},"send":function(){var url=this.environment.getUrl(),data=this.environment.getData(),dataUrl="";if(!this.environment.getCache())
-data["forceCache"]=Number(new Date);for(var key in data)
-dataUrl+=pi.util.String.format("{0}={1}&",key,data[key]);if(this.environment.getType()=="GET")
+var firebug={version:[1.23,20090309],el:{},env:{"cache":{},"extConsole":null,"css":"http://getfirebug.com/releases/lite/1.2/firebug-lite.css","debug":true,"detectFirebug":false,"dIndex":"console","height":295,"hideDOMFunctions":false,"init":false,"isPopup":false,"liteFilename":"firebug-lite.js","minimized":false,"openInPopup":false,"override":false,"ml":false,"popupWin":null,"showIconWhenHidden":true,"targetWindow":undefined,"popupTop":1,"popupLeft":1,"popupWidth":undefined,"popupHeight":undefined},initConsole:function(){var command;try{if((!window.console||(window.console&&!window.console.firebug))||(firebug.env.override&&!(/Firefox\/3/i.test(navigator.userAgent)))){window.console={"provider":"Firebug Lite"};for(command in firebug.d.console.cmd){window.console[command]=firebug.lib.util.Curry(firebug.d.console.run,window,command);};}
+window.onerror=function(_message,_file,_line){firebug.d.console.run('error',firebug.lib.util.String.format('{0} ({1},{2})',_message,firebug.getFileName(_file),_line));};}catch(e){}},overrideConsole:function(){with(firebug){env.override=true;try{env.extConsole=window.console;}catch(e){}
+initConsole();}},restoreConsole:function(){with(firebug){if(env.extConsole){env.override=false;try{window.console=env.extConsole;}catch(e){}
+env.extConsole=null;}}},init:function(_css){var iconTitle="Click here or press F12, (CTRL|CMD)+SHIFT+L or SHIFT+ENTER to show Firebug Lite. CTRL|CMD click this icon to hide it.";with(firebug){if(document.getElementsByTagName('html')[0].attributes.getNamedItem('debug')){env.debug=document.getElementsByTagName('html')[0].attributes.getNamedItem('debug').nodeValue!=="false";}
+if(env.isPopup){env.openInPopup=false;env.targetWindow=window.opener;env.popupWidth=window.opener.firebug.env.popupWidth||window.opener.firebug.lib.util.GetViewport().width;env.popupHeight=window.opener.firebug.env.popupHeight||window.opener.firebug.lib.util.GetViewport().height;}else{env.targetWindow=window;env.popupWidth=env.popupWidth||lib.util.GetViewport().width;env.popupHeight=env.popupHeight||lib.util.GetViewport().height;}
+settings.readCookie();if(env.init||(env.detectFirebug&&window.console&&window.console.firebug)){return;}
+document.getElementsByTagName("head")[0].appendChild(new lib.element("link").attribute.set("rel","stylesheet").attribute.set("type","text/css").attribute.set("href",env.css).element);if(env.override){overrideConsole();}
+el.firebugIcon=new lib.element("div").attribute.set("id","firebugIconDiv").attribute.set("title",iconTitle).attribute.set("alt",iconTitle).event.addListener("mousedown",win.iconClicked).insert(document.body);el.content={};el.mainiframe=new lib.element("IFRAME").attribute.set("id","FirebugIFrame").environment.addStyle({"display":"none","width":lib.util.GetViewport().width+"px"}).insert(document.body);el.main=new lib.element("DIV").attribute.set("id","Firebug").environment.addStyle({"display":"none","width":lib.util.GetViewport().width+"px"}).insert(document.body);if(!env.isPopup){el.resizer=new lib.element("DIV").attribute.addClass("Resizer").event.addListener("mousedown",win.resizer.start).insert(el.main);}
+el.header=new lib.element("DIV").attribute.addClass("Header").insert(el.main);el.left={};el.left.container=new lib.element("DIV").attribute.addClass("Left").insert(el.main);el.right={};el.right.container=new lib.element("DIV").attribute.addClass("Right").insert(el.main);el.main.child.add(new lib.element("DIV").attribute.addClass('Clear'));el.button={};el.button.container=new lib.element("DIV").attribute.addClass("ButtonContainer").insert(el.header);el.button.logo=new lib.element("A").attribute.set("title","Firebug Lite").attribute.set("target","_blank").attribute.set("href","http://getfirebug.com/lite.html").update("&nbsp;").attribute.addClass("Button Logo").insert(el.button.container);el.button.inspect=new lib.element("A").attribute.addClass("Button").event.addListener("click",env.targetWindow.firebug.d.inspector.toggle).update("Inspect").insert(el.button.container);el.button.dock=new lib.element("A").attribute.addClass("Button Dock").event.addListener("click",win.dock).insert(el.button.container);el.button.newWindow=new lib.element("A").attribute.addClass("Button NewWindow").event.addListener("click",win.newWindow).insert(el.button.container);if(!env.isPopup){el.button.maximize=new lib.element("A").attribute.addClass("Button Maximize").event.addListener("click",win.maximize).insert(el.button.container);el.button.minimize=new lib.element("A").attribute.addClass("Button Minimize").event.addListener("click",win.minimize).insert(el.button.container);el.button.close=new lib.element("A").attribute.addClass("Button Close").event.addListener("click",win.hide).insert(el.button.container);}
+if(lib.env.ie||lib.env.webkit){el.button.container.environment.addStyle({"paddingTop":"12px"});}
+el.nav={};el.nav.container=new lib.element("DIV").attribute.addClass("Nav").insert(el.left.container);el.nav.console=new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.navigate,window,"console")).update("Console").insert(el.nav.container);el.nav.html=new lib.element("A").attribute.addClass("Tab").update("HTML").event.addListener("click",lib.util.Curry(d.navigate,window,"html")).insert(el.nav.container);el.nav.css=new lib.element("A").attribute.addClass("Tab").update("CSS").event.addListener("click",lib.util.Curry(d.navigate,window,"css")).insert(el.nav.container);if(!env.isPopup){el.nav.scripts=new lib.element("A").attribute.addClass("Tab").update("Script").event.addListener("click",lib.util.Curry(d.navigate,window,"scripts")).insert(el.nav.container);}
+el.nav.dom=new lib.element("A").attribute.addClass("Tab").update("DOM").event.addListener("click",lib.util.Curry(d.navigate,env.targetWindow,"dom")).insert(el.nav.container);el.nav.xhr=new lib.element("A").attribute.addClass("Tab").update("XHR").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).insert(el.nav.container);el.nav.optionsdiv=new lib.element("DIV").attribute.addClass("Settings").insert(el.nav.container);el.nav.options=new lib.element("A").attribute.addClass("Tab").update("Options&nbsp;&or;").event.addListener("click",settings.toggle).insert(el.nav.optionsdiv);el.borderInspector=new lib.element("DIV").attribute.set("id","FirebugBorderInspector").event.addListener("click",listen.inspector).insert(document.body);el.bgInspector=new lib.element("DIV").attribute.set("id","FirebugBGInspector").insert(document.body);el.left.console={};el.left.console.container=new lib.element("DIV").attribute.addClass("Console").insert(el.left.container);el.left.console.mlButton=new lib.element("A").attribute.addClass("MLButton").event.addListener("click",d.console.toggleML).insert(el.left.console.container);el.left.console.monitor=new lib.element("DIV").insert(new lib.element("DIV").attribute.addClass("Monitor").insert(el.left.console.container));el.left.console.container.child.add(new lib.element("DIV").attribute.addClass("InputArrow").update(">>>"));el.left.console.input=new lib.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert(new lib.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container));el.right.console={};el.right.console.container=new lib.element("DIV").attribute.addClass("Console Container").insert(el.right.container);el.right.console.mlButton=new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container);el.right.console.input=new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container);el.right.console.input.event.addListener("keydown",lib.util.Curry(tab,window,el.right.console.input.element));el.right.console.run=new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container);el.right.console.clear=new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.console.input)).update("Clear").insert(el.right.console.container);el.button.console={};el.button.console.container=new lib.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container);el.button.console.clear=new lib.element("A").attribute.addClass("Button").event.addListener("click",d.console.clear).update("Clear").insert(el.button.console.container);el.left.html={};el.left.html.container=new lib.element("DIV").attribute.addClass("HTML").insert(el.left.container);el.right.html={};el.right.html.container=new lib.element("DIV").attribute.addClass("HTML Container").insert(el.right.container);el.right.html.nav={};el.right.html.nav.container=new lib.element("DIV").attribute.addClass("Nav").insert(el.right.html.container);el.right.html.nav.computedStyle=new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container);el.right.html.nav.dom=new lib.element("A").attribute.addClass("Tab").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"dom")).update("DOM").insert(el.right.html.nav.container);el.right.html.content=new lib.element("DIV").attribute.addClass("Content").insert(el.right.html.container);el.button.html={};el.button.html.container=new lib.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container);el.left.css={};el.left.css.container=new lib.element("DIV").attribute.addClass("CSS").insert(el.left.container);el.right.css={};el.right.css.container=new lib.element("DIV").attribute.addClass("CSS Container").insert(el.right.container);el.right.css.nav={};el.right.css.nav.container=new lib.element("DIV").attribute.addClass("Nav").insert(el.right.css.container);el.right.css.nav.runCSS=new lib.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container);el.right.css.mlButton=new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container);el.right.css.input=new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container);el.right.css.input.event.addListener("keydown",lib.util.Curry(firebug.tab,window,el.right.css.input.element));el.right.css.run=new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container);el.right.css.clear=new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.css.input)).update("Clear").insert(el.right.css.container);el.button.css={};el.button.css.container=new lib.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container);el.button.css.selectbox=new lib.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container);el.left.scripts={};el.left.scripts.container=new lib.element("DIV").attribute.addClass("Scripts").insert(el.left.container);el.right.scripts={};el.right.scripts.container=new lib.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container);el.button.scripts={};el.button.scripts.container=new lib.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container);el.button.scripts.selectbox=new lib.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container);el.button.scripts.lineNumbers=new lib.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container);el.left.dom={};el.left.dom.container=new lib.element("DIV").attribute.addClass("DOM").insert(el.left.container);el.right.dom={};el.right.dom.container=new lib.element("DIV").attribute.addClass("DOM Container").insert(el.right.container);el.button.dom={};el.button.dom.container=new lib.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container);el.button.dom.label=new lib.element("LABEL").update("Object Path:").insert(el.button.dom.container);el.button.dom.textbox=new lib.element("INPUT").event.addListener("keydown",listen.domTextbox).update(env.isPopup?"window.opener":"window").insert(el.button.dom.container);el.left.str={};el.left.str.container=new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);el.right.str={};el.right.str.container=new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);el.button.str={};el.button.str.container=new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);el.button.str.watch=new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).update("Back").insert(el.button.str.container);el.left.xhr={};el.left.xhr.container=new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);el.right.xhr={};el.right.xhr.container=new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);el.button.xhr={};el.button.xhr.container=new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);el.button.xhr.label=new lib.element("LABEL").update("XHR Path:").insert(el.button.xhr.container);el.button.xhr.textbox=new lib.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container);el.button.xhr.watch=new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container);el.settings={};el.settings.container=new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("Header").child.add(new lib.element().attribute.addClass("Title").update('Firebug Lite Settings'))).attribute.addClass("SettingsDiv").insert(el.main);el.settings.content=new lib.element("DIV").attribute.addClass("Content").insert(el.settings.container);el.settings.progressDiv=new lib.element("DIV").attribute.addClass("ProgressDiv").insert(el.settings.content);el.settings.progress=new lib.element("DIV").attribute.addClass("Progress").insert(el.settings.progressDiv);el.settings.cbxDebug=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Start visible"));new lib.element("BR").insert(el.settings.content);el.settings.cbxDetectFirebug=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Hide when Firebug active"));new lib.element("BR").insert(el.settings.content);el.settings.cbxHideDOMFunctions=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Hide DOM functions"));new lib.element("BR").insert(el.settings.content);el.settings.cbxOverride=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Override window.console"));new lib.element("BR").insert(el.settings.content);el.settings.cbxShowIcon=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Show icon when hidden"));new lib.element("BR").insert(el.settings.content);el.settings.cbxOpenInPopup=new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);el.settings.content.child.add(document.createTextNode("Open in popup"));el.settings.buttonDiv=new lib.element("DIV").insert(el.settings.content);el.settings.buttonLeftDiv=new lib.element("DIV").attribute.addClass("ButtonsLeft").insert(el.settings.buttonDiv);el.settings.resetButton=new lib.element("INPUT").attribute.set("type","button").update("Reset").event.addListener("click",settings.reset).insert(el.settings.buttonLeftDiv);el.settings.buttonRightDiv=new lib.element("DIV").attribute.addClass("ButtonsRight").insert(el.settings.buttonDiv);el.settings.cancelButton=new lib.element("INPUT").attribute.set("type","button").update("Cancel").event.addListener("click",settings.hide).insert(el.settings.buttonRightDiv);el.settings.buttonRightDiv.child.add(document.createTextNode(" "));el.settings.saveButton=new lib.element("INPUT").attribute.set("type","button").update("Save").event.addListener("click",settings.saveClicked).insert(el.settings.buttonRightDiv);lib.util.AddEvent(document,"mousemove",listen.mouse)("mousemove",win.resizer.resize)("mouseup",win.resizer.stop)("keydown",listen.keyboard);env.init=true;for(var i=0,len=d.console.cache.length;i<len;i++){var item=d.console.cache[i];d.console.cmd[item.command].apply(window,item.arg);};if(lib.env.ie6){window.onscroll=lib.util.Curry(win.setVerticalPosition,window,null);var buttons=[el.button.inspect,el.button.close,el.button.inspect,el.button.console.clear,el.right.console.run,el.right.console.clear,el.right.css.run,el.right.css.clear];for(var i=0,len=buttons.length;i<len;i++)
+buttons[i].attribute.set("href","#");win.refreshSize();}
+if(env.showIconWhenHidden){if(!env.popupWin){el.firebugIcon.environment.addStyle({"display":env.debug&&'none'||'block'});}}
+lib.util.AddEvent(window,"unload",win.unload);if(env.isPopup){env.height=lib.util.GetViewport().height;lib.util.AddEvent(window,"resize",win.fitToPopup);win.fitToPopup();}else{lib.util.AddEvent(window,"resize",win.refreshSize);}
+win.setHeight(env.height);if(env.openInPopup&&!env.isPopup){win.newWindow();}else{el.main.environment.addStyle({"display":env.debug&&'block'||'none'});el.mainiframe.environment.addStyle({"display":env.debug&&'block'||'none'});}}},inspect:function(){return firebug.d.html.inspect.apply(window,arguments);},watchXHR:function(){with(firebug){d.xhr.addObject.apply(window,arguments);if(env.dIndex!="xhr"){d.navigate("xhr");}}},settings:{isVisible:false,show:function(){with(firebug){var posXY=lib.util.Element.getPosition(firebug.el.nav.options.element);settings.refreshForm();el.settings.container.environment.addStyle({"display":"block","left":(posXY.offsetLeft-125)+"px"});el.settings.progressDiv.environment.addStyle({"display":"none"});firebug.settings.isVisible=true;}},hide:function(){with(firebug){firebug.el.settings.container.environment.addStyle({"display":"none"});firebug.settings.isVisible=false;}},toggle:function(){with(firebug){settings[!settings.isVisible&&'show'||'hide']();}},saveClicked:function(){firebug.el.settings.progressDiv.environment.addStyle({"display":"block"});setTimeout(firebug.settings.formToSettings,0);},formToSettings:function(){var fe=firebug.env,ofe,elSet=firebug.el.settings,exdate;fe.debug=elSet.cbxDebug.element.checked;fe.detectFirebug=elSet.cbxDetectFirebug.element.checked;fe.hideDOMFunctions=elSet.cbxHideDOMFunctions.element.checked;fe.override=elSet.cbxOverride.element.checked;fe.showIconWhenHidden=elSet.cbxShowIcon.element.checked;fe.openInPopup=elSet.cbxOpenInPopup.element.checked;if(fe.isPopup){ofe=window.opener.firebug.env;ofe.debug=fe.debug;ofe.detectFirebug=fe.detectFirebug;ofe.hideDOMFunctions=fe.hideDOMFunctions;ofe.override=fe.override;ofe.showIconWhenHidden=fe.showIconWhenHidden;ofe.openInPopup=fe.openInPopup;ofe.popupTop=fe.popupTop;ofe.popupLeft=fe.popupLeft;ofe.popupWidth=fe.popupWidth;ofe.popupHeight=fe.popupHeight;}
+with(firebug){settings.writeCookie();settings.hide();win.refreshDOM();}},reset:function(){var exdate=new Date();exdate.setTime(exdate.getTime()-1);document.cookie='FBLiteSettings=;expires='+exdate.toGMTString();location.reload(true);},readCookie:function(){var i,cookieArr,valueArr,item,value;with(firebug.env){if(targetWindow.document.cookie.length>0){cookieArr=targetWindow.document.cookie.split('; ');for(i=0;i<cookieArr.length;i++){if(cookieArr[i].split('=')[0]=='FBLiteSettings'){valueArr=cookieArr[i].split('=')[1].split(',');}}
+if(valueArr){for(i=0;i<valueArr.length;i++){item=valueArr[i].split(':')[0];value=valueArr[i].split(':')[1];switch(item){case'debug':debug=value=="true";break;case'detectFirebug':detectFirebug=value=="true";break;case'hideDOMFunctions':hideDOMFunctions=value=="true";break;case'override':override=value=="true";break;case'showIconWhenHidden':showIconWhenHidden=value=="true";break;case'openInPopup':openInPopup=value=="true";break;case'popupTop':popupTop=parseInt(value,10);break;case'popupLeft':popupLeft=parseInt(value,10);break;case'popupWidth':popupWidth=parseInt(value,10);break;case'popupHeight':popupHeight=parseInt(value,10);break;case'height':height=parseInt(value,10);break;}}}}}},writeCookie:function(){var values;with(firebug.env){values='debug:'+debug+',';values+='detectFirebug:'+detectFirebug+',';values+='hideDOMFunctions:'+hideDOMFunctions+',';values+='override:'+override+',';values+='showIconWhenHidden:'+showIconWhenHidden+',';values+='openInPopup:'+openInPopup+',';if(isPopup){if(window.outerWidth===undefined){values+='popupTop:'+(window.screenTop-56)+',';values+='popupLeft:'+(window.screenLeft-8)+',';values+='popupWidth:'+document.body.clientWidth+',';values+='popupHeight:'+document.body.clientHeight+',';}else{values+='popupTop:'+window.screenY+',';values+='popupLeft:'+window.screenX+',';values+='popupWidth:'+window.outerWidth+',';values+='popupHeight:'+window.outerHeight+',';}}else{values+='popupTop:'+popupTop+',';values+='popupLeft:'+popupLeft+',';values+='popupWidth:'+popupWidth+',';values+='popupHeight:'+popupHeight+',';}
+values+='height:'+(parseInt(targetWindow.firebug.el.main.element.style.height.replace(/px/,''),10)-38);exdate=new Date();exdate.setDate(exdate.getDate()+365);targetWindow.document.cookie='FBLiteSettings='+values+';expires='+exdate.toGMTString();}},refreshForm:function(){var fe=firebug.env,elSet=firebug.el.settings;elSet.cbxDebug.element.checked=fe.debug;elSet.cbxDetectFirebug.element.checked=fe.detectFirebug;elSet.cbxHideDOMFunctions.element.checked=fe.hideDOMFunctions;elSet.cbxOverride.element.checked=fe.override;elSet.cbxShowIcon.element.checked=fe.showIconWhenHidden;elSet.cbxOpenInPopup.element.checked=fe.openInPopup;}},win:{hide:function(){with(firebug){el.main.environment.addStyle({"display":"none"});el.mainiframe.environment.addStyle({"display":"none"});if(env.showIconWhenHidden){el.firebugIcon.environment.addStyle({"display":"block"});}}},show:function(){with(firebug){el.main.environment.addStyle({"display":"block"});el.mainiframe.environment.addStyle({"display":"block"});if(env.showIconWhenHidden){el.firebugIcon.environment.addStyle({"display":"none"});}}},iconClicked:function(_event){with(firebug){if(_event.ctrlKey==true||_event.metaKey==true){el.firebugIcon.environment.addStyle({"display":"none"});env.showIconWhenHidden=false;}else{win.show();}}},minimize:function(){with(firebug){env.minimized=true;el.main.environment.addStyle({"height":"35px"});el.mainiframe.environment.addStyle({"height":"35px"});el.button.maximize.environment.addStyle({"display":"block"});el.button.minimize.environment.addStyle({"display":"none"});win.refreshSize();}},maximize:function(){with(firebug){env.minimized=false;el.button.minimize.environment.addStyle({"display":"block"});el.button.maximize.environment.addStyle({"display":"none"});win.setHeight(env.height);}},newWindow:function(){var interval,scripts,script,scriptPath,fe=firebug.env;if(!fe.popupWin){scripts=document.getElementsByTagName('script');fe.popupWin=window.open("","_firebug","status=0,menubar=0,resizable=1,top="+fe.popupTop+",left="+fe.popupLeft+",width="+fe.popupWidth+",height="+fe.popupHeight+",scrollbars=0,addressbar=0,outerWidth="+fe.popupWidth+",outerHeight="+fe.popupHeight+"toolbar=0,location=0,directories=0,dialog=0");if(!fe.popupWin){alert("Firebug Lite could not open a pop-up window, most likely because of a popup blocker.\nPlease enable popups for this domain");}else{firebug.settings.hide();for(i=0,len=scripts.length;i<len;i++){if(scripts[i].src.indexOf(fe.liteFilename)>-1){scriptPath=scripts[i].src;break;}}
+if(scriptPath){script=fe.popupWin.document.createElement('script'),done=false;script.type='text/javascript';script.src=scriptPath;script[firebug.lib.env.ie?"onreadystatechange":"onload"]=function(){if(!done&&(!firebug.lib.env.ie||this.readyState=="complete"||this.readyState=="loaded")){done=true;if(fe.popupWin.firebug){with(fe.popupWin.firebug){env.isPopup=true;env.css=fe.css;init();el.button.dock.environment.addStyle({"display":"block"});el.button.newWindow.environment.addStyle({"display":"none"});}}}};if(!done&&firebug.lib.env.webkit){fe.popupWin.document.write('<html><head></head><body></body></html>');interval=setInterval(function(){if(fe.popupWin.firebug){clearInterval(interval);done=true;with(fe.popupWin.firebug){env.isPopup=true;env.css=fe.css;init();el.button.dock.environment.addStyle({"display":"block"});el.button.newWindow.environment.addStyle({"display":"none"});}}},10);};if(!done){fe.popupWin.document.getElementsByTagName('head')[0].appendChild(script);firebug.el.main.environment.addStyle({"display":"none"});firebug.el.mainiframe.environment.addStyle({"display":"none"});}}else{alert("Unable to detect the following script \""+fe.liteFilename+"\" ... if the script has been renamed then please set the value of firebug.env.liteFilename to reflect this change");fe.popupWin.close();fe.popupWin=null;}}}},dock:function(){with(opener.firebug){env.popupWin=null;el.main.environment.addStyle({"display":"block"});el.mainiframe.environment.addStyle({"display":"block"});settings.readCookie();window.close();};},unload:function(){with(firebug){if(env.isPopup){win.dock();}else if(env.popupWin){env.popupWin.close();}}},fitToPopup:function(){with(firebug){var viewport=lib.util.GetViewport(window);win.setHeight((window.innerHeight||viewport.height)-38);el.main.environment.addStyle({"width":(viewport.width)+"px"});el.mainiframe.environment.addStyle({"width":(viewport.width)+"px"});}},resizer:{y:[],enabled:false,start:function(_event){with(firebug){if(env.minimized)return;win.resizer.y=[el.main.element.offsetHeight,_event.clientY];if(lib.env.ie6){win.resizer.y[3]=parseInt(el.main.environment.getPosition().top);}
+win.resizer.enabled=true;}},resize:function(_event){with(firebug){if(!win.resizer.enabled)return;win.resizer.y[2]=(win.resizer.y[0]+(win.resizer.y[1]-_event.clientY));el.main.environment.addStyle({"height":win.resizer.y[2]+"px"});el.mainiframe.environment.addStyle({"height":win.resizer.y[2]+"px"});if(lib.env.ie6){el.main.environment.addStyle({"top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px"});el.mainiframe.environment.addStyle({"top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px"});}}},stop:function(_event){with(firebug){if(win.resizer.enabled){win.resizer.enabled=false;win.setHeight(win.resizer.y[2]-35);}}}},setHeight:function(_height){with(firebug){env.height=_height;el.left.container.environment.addStyle({"height":_height+"px"});el.right.container.environment.addStyle({"height":_height+"px"});el.main.environment.addStyle({"height":_height+38+"px"});el.mainiframe.environment.addStyle({"height":_height+38+"px"});win.refreshSize();el.left.console.monitor.element.parentNode.style.height=_height-47+"px";el.left.console.mlButton.environment.addStyle({"top":_height+19+"px"});el.right.console.mlButton.environment.addStyle({"top":_height+19+"px"});el.right.console.input.environment.addStyle({"height":_height-29+"px"});el.left.html.container.environment.addStyle({"height":_height-23+"px"});el.right.html.content.environment.addStyle({"height":_height-23+"px"});el.left.css.container.environment.addStyle({"height":_height-33+"px"});el.right.css.input.environment.addStyle({"height":_height-55+"px"});el.left.scripts.container.environment.addStyle({"height":_height-23+"px"});el.left.dom.container.environment.addStyle({"height":_height-31+"px"});el.left.xhr.container.environment.addStyle({"height":_height-32+"px"});el.left.str.container.environment.addStyle({"height":_height-32+"px"});}},refreshDOM:function(){with(firebug){d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);if(d.html.nIndex=="dom"){firebug.d.html.navigate("dom")}}},refreshSize:function(){with(firebug){if(!env.init)
+return;var dim=lib.util.GetViewport();el.main.environment.addStyle({"width":dim.width+"px"});el.mainiframe.environment.addStyle({"width":dim.width+"px"});if(lib.env.ie6)
+win.setVerticalPosition(dim);}},setVerticalPosition:function(_dim,_event){with(firebug){var dim=_dim||lib.util.GetViewport();el.main.environment.addStyle({"top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px"});el.mainiframe.environment.addStyle({"top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px"});}}},d:{clean:function(_element){with(firebug){_element.update("");}},console:{addLine:function(){with(firebug){return new lib.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor);}},cache:[],clear:function(){with(firebug){d.clean(el.left.console.monitor);d.console.cache=[];}},formatArgs:function(){with(firebug){var content=[];for(var i=0,len=arguments.length;i<len;i++){content.push(d.highlight(arguments[i],false,false,true));}
+return content.join(" ");}},history:[],historyIndex:0,openObject:function(_index){with(firebug){d.dom.open(d.console.cache[_index],el.left.dom.container,lib.env.ie);d.navigate("dom");}},print:function(_cmd,_text){with(firebug){d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);d.console.addLine().update(d.highlight(_text,false,false,true));d.console.scroll();}},printException:function(_exception){with(firebug){var message=_exception.description||_exception.message||_exception;if(_exception.fileName){message+=' ('+(_exception.name&&(_exception.name+', ')||'')+getFileName(_exception.fileName)+', '+_exception.lineNumber+')';}
+d.console.addLine().attribute.addClass("Error").update("<strong>Error: </strong>"+message,true);}},eval:function(_cmd){var result;with(firebug){if(_cmd.length==0)
+return;el.left.console.input.environment.getElement().value="";d.console.historyIndex=d.console.history.push(_cmd);try{if(_cmd==='console.firebug'){d.console.addLine().attribute.addClass("Arrow").update(firebug.version);}else{result=eval.call(window,_cmd);d.console.print(_cmd,result);}}catch(e){d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);d.console.printException(e);}
+d.console.scroll();}},scroll:function(){with(firebug){el.left.console.monitor.environment.getElement().parentNode.scrollTop=Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-(el.left.console.monitor.element.parentNode.offsetHeight-11));}},run:function(_command){with(firebug){if(!env.init){d.console.cache.push({"command":_command,"arg":Array.prototype.slice.call(arguments,1)});}else{d.console.cmd[_command].apply(window,Array.prototype.slice.call(arguments,1));}}},toggleML:function(){with(firebug){var open=!env.ml;env.ml=!env.ml;d.navigateRightColumn("console",open);el[open?"left":"right"].console.mlButton.environment.addStyle({display:"none"});el[!open?"left":"right"].console.mlButton.environment.addStyle({display:"block"});el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML");}},countMap:{},timeMap:{},cmd:{log:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Log").update(args);d.console.scroll();}},warn:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Warn").update(args);d.console.scroll();}},info:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Info").update(args);d.console.scroll();}},debug:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Debug").update(args);d.console.scroll();}},error:function(_value){with(firebug){var args=d.console.formatArgs.apply(window,arguments);d.console.addLine().attribute.addClass("Error").update(args);d.console.scroll();}},trace:function(_value){with(firebug){var stackAmt=3,f=arguments.caller,isArray=lib.util.IsArray(f);if((!isArray&&f)||(isArray&&f.length>0)){d.console.addLine().attribute.addClass("Arrow").update(">>> console.trace(stack)");for(var i=0;i<stackAmt;i++){var func=f.toString(),args=f.arguments;d.dom.open({"function":func,"arguments":args},d.console.addLine());f=f.caller;}}}},dir:function(_value){with(firebug){d.console.addLine().attribute.addClass("Arrow").update(">>> console.dir("+_value+")");d.dom.open(_value,d.console.addLine());}},dirxml:function(){with(firebug){d.console.cmd.log.apply(this,arguments);}},time:function(_name){with(firebug){d.console.timeMap[_name]=new Date().getTime();}},timeEnd:function(_name){with(firebug){if(_name in d.console.timeMap){var delta=new Date().getTime()-d.console.timeMap[_name],args=d.console.formatArgs.apply(window,[_name+":",delta+"ms"]);d.console.addLine().attribute.addClass("log").update(args);delete d.console.timeMap[_name];}}},count:function(_name){with(firebug){if(!d.console.countMap[_name])
+d.console.countMap[_name]=0;d.console.countMap[_name]++;d.console.cmd.log.apply(window,[_name,d.console.countMap[_name]]);}},group:function(){with(firebug){d.console.cmd.log.apply(this,["console.group is not supported"]);}},groupEnd:function(){with(firebug){d.console.cmd.log.apply(this,["console.groupEnd is not supported"]);}},profile:function(){with(firebug){d.console.cmd.log.apply(this,["console.profile is not supported"]);}},profileEnd:function(){with(firebug){d.console.cmd.log.apply(this,["console.profileEnd is not supported"]);}}}},css:{index:-1,open:function(_index){with(firebug){var item=env.targetWindow.document.styleSheets[_index],uri=item.href;try{var rules=item[lib.env.ie?"rules":"cssRules"],str="";for(var i=0;i<rules.length;i++){var item=rules[i];var selector=item.selectorText;var cssText=lib.env.ie?item.style.cssText:item.cssText.match(/\{(.*)\}/)[1];str+=d.css.printRule(selector,cssText.split(";"),el.left.css.container);}}catch(e){str="<em>Access to restricted URI denied</em>";}
+el.left.css.container.update(str);}},printRule:function(_selector,_css,_layer){with(firebug){var str="<div class='Selector'>"+_selector+" {</div>";for(var i=0,len=_css.length;i<len;i++){var item=_css[i];str+="<div class='CSSText'>"+item.replace(/(.+\:)(.+)/,"<span class='CSSProperty'>$1</span><span class='CSSValue'>$2;</span>")+"</div>";}
+str+="<div class='Selector'>}</div>";return str;}},refresh:function(){with(firebug){el.button.css.selectbox.update("");var collection=env.targetWindow.document.styleSheets;for(var i=0,len=collection.length;i<len;i++){var uri=getFileName(collection[i].href);d.css.index=d.css.index<0?i:d.css.index;el.button.css.selectbox.child.add(new lib.element("OPTION").attribute.set("value",i).update(uri))};d.css.open(d.css.index);}}},dom:{open:function(_object,_layer){with(firebug){_layer.clean();var container=new lib.element("DIV").attribute.addClass("DOMContent").insert(_layer);d.dom.print(_object,container);}},print:function(_object,_parent,_inTree){with(firebug){var obj=_object||window,parentElement=_parent;parentElement.update("");if(parentElement.opened&&parentElement!=el.left.dom.container){parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.removeClass("Opened");parentElement.opened=false;parentElement.environment.addStyle({"display":"none"});return;}
+if(_inTree)
+parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.addClass("Opened");parentElement.opened=true;for(var key in obj){try{if(env.hideDOMFunctions&&typeof(obj[key])=="function")continue;var value=obj[key],property=key,container=new lib.element("DIV").attribute.addClass("DOMRow").insert(parentElement),left=new lib.element("DIV").attribute.addClass("DOMRowLeft").insert(container),right=new lib.element("DIV").attribute.addClass("DOMRowRight").insert(container);container.child.add(new lib.element("DIV").attribute.addClass('Clear'));var link=new lib.element("A").attribute.addClass(typeof value=="object"&&Boolean(value)?"Property Object":"Property").update(property).insert(left);right.update(d.highlight(value,false,true));var subContainer=new lib.element("DIV").attribute.addClass("DOMRowSubContainer").insert(container);if(typeof value!="object"||Boolean(value)==false)
+continue;link.event.addListener("click",lib.util.Curry(d.dom.print,window,value,subContainer,true));}catch(e){}}
+parentElement.environment.addStyle({"display":"block"});}}},highlight:function(_value,_inObject,_inArray,_link){with(firebug){var isArray=false,isHash,isElement=false,vtype=typeof _value,result=[];if(vtype=="object"){if(Object.prototype.toString.call(_value)==="[object Date]"){vtype="date";}else if(Object.prototype.toString.call(_value)==="[object String]"){vtype="string";}else if(Object.prototype.toString.call(_value)==="[object Boolean]"){vtype="boolean";}else if(Object.prototype.toString.call(_value)==="[object RegExp]"){vtype="regexp";}}
+try{isArray=lib.util.IsArray(_value);isHash=lib.util.IsHash(_value);isElement=_value!=undefined&&Boolean(_value.nodeName)&&Boolean(_value.nodeType);if(_value==null||vtype=="number"||vtype=="string"||vtype=="boolean"||vtype=="function"||vtype=="regexp"||vtype=="date"){if(_value==null){result.push("<span class='Null'>null</span>");}else if(vtype=="regexp"){result.push("<span class='Maroon'>"+_value+"</span>");}else if(vtype=="date"){result.push("<span class='DarkBlue'>'"+_value+"'</span>");}else if(vtype=="boolean"||vtype=="number"){result.push("<span class='DarkBlue'>"+_value+"</span>");}else if(vtype=="function"){result.push("<span class='"+(_inObject?"Italic Gray":"Green")+"'>function()</span>");}else{result.push("<span class='Red'>\""+(!_inObject&&!_inArray?_value:_value.substring(0,35)+(_value.length>35?" ...":"")).replace(/\n/g,"\\n").replace(/\s/g,"&nbsp;").replace(/>/g,"&#62;").replace(/</g,"&#60;")+"\"</span>");}}
+else if(isElement){if(_value.nodeType==3)
+result.push(d.highlight(_value.nodeValue));else if(_inObject){result.push("<span class='Gray Italic'>"+_value.nodeName.toLowerCase()+"</span>");}else{result.push("<span class='Blue"+(!_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.html.inspect(firebug.d.console.cache["+(d.console.cache.push(_value)-1)+"])'")+"'>");if(_inArray){result.push(_value.nodeName.toLowerCase());if(_value.getAttribute){if(_value.getAttribute&&_value.getAttribute("id"))
+result.push("<span class='DarkBlue'>#"+_value.getAttribute("id")+"</span>");var elClass=_value.getAttribute(lib.env.ie&&!lib.env.ie8?"className":"class")||"";result.push(!elClass?"":"<span class='Red'>."+elClass.split(" ")[0]+"</span>");}
+result.push("</span>");}else{result.push("<span class='DarkBlue'>&#60;<span class='Blue TagName'>"+_value.nodeName.toLowerCase());if(_value.attributes){for(var i=0,len=_value.attributes.length;i<len;i++){var item=_value.attributes[i];if(!lib.env.ie||item.nodeValue)
+result.push(" <span class='DarkBlue'>"+item.nodeName+"=\"<span class='Red'>"+item.nodeValue+"</span>\"</span>");}}
+result.push("</span>&#62;</span>");}}}
+else if(isArray||isHash){if(isArray){if(_inObject){result.push("<span class='Gray Italic'>["+_value.length+"]</span>");}else{result.push("<span class='Strong'>[ ");for(var i=0,len=_value.length;i<len;i++){if((_inObject||_inArray)&&i>3){result.push(", <span class='Strong Gray'>"+(len-4)+" More...</span>");break;}
+result.push((i>0?", ":"")+d.highlight(_value[i],false,true,true));}
+result.push(" ]</span>");}}else if(_inObject){result.push("<span class='Gray Italic'>Object</span>");}else{result.push("<span class='Strong Green"+(!_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.console.openObject("+(d.console.cache.push(_value)-1)+")'")+">Object");var i=0;for(var key in _value){var value=_value[key];if((_inObject||_inArray)&&i>3){result.push(" <span class='Strong Gray'>More...</span>");break;}
+result.push(" "+key+"="+d.highlight(value,true));i++;}
+result.push("</span>");}}else{result.push(["<span class'Gray Italic'>"+_value+"</span>"]);}}catch(e){result.push("..");}
+return result.join("");}},html:{nIndex:"computedStyle",current:null,highlight:function(_element,_clear,_event){with(firebug){if(_element.firebugElement){return;}
+if(_clear){env.targetWindow.firebug.el.bgInspector.environment.addStyle({"display":"none"});return;}
+d.inspector.inspect(_element,true);}},inspect:function(_element){var map=[],parentLayer,t,tagName,parent=_element;while(parent){map.push(parent);if(parent==firebug.env.targetWindow.document.body)break;parent=parent.parentNode;}
+map=map.reverse();with(firebug){if(env.dIndex!="html"){env.targetWindow.firebug.d.navigate("html");}
+env.targetWindow.firebug.d.inspector.toggle(false);for(t=0;t<el.left.html.container.child.get().length;t++){if(el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0]){if(el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText){tagName=el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText;}else{tagName=el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].textContent;}
+if(/<body/i.test(tagName)){parentLayer=el.left.html.container.child.get()[t].childNodes[1].lib;break;}}}
+if(!parentLayer){parentLayer=el.left.html.container.child.get()[3].childNodes[1].lib;}
+for(t=0,len=map.length;map[t];t++){if(t==len-1){var link=parentLayer.environment.getElement().previousSibling.lib;link.attribute.addClass("Selected");if(d.html.current){d.html.current[1].attribute.removeClass("Selected");}
+d.html.current=[_element,link];return;}
+parentLayer=d.html.openHtmlTree(map[t],parentLayer,map[t+1]);}}},navigate:function(_index,_element){with(firebug){el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected");el.right.html.nav[_index].attribute.addClass("Selected");d.html.nIndex=_index;d.html.openProperties();}},openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){with(firebug){var element=_element||env.targetWindow.document.documentElement,parent=_parent||el.left.html.container,returnParentEl=_returnParentElementByElement||null,returnParentVal=null,len=element.childNodes.length,nodeLink;if(parent!=el.left.html.container){nodeLink=parent.environment.getParent().lib.child.get()[0].lib;if(d.html.current){d.html.current[1].attribute.removeClass("Selected");}
+nodeLink.attribute.addClass("Selected");d.html.current=[_element,nodeLink];d.html.openProperties();};if(element.childNodes&&(len==0||(len==1&&element.childNodes[0].nodeType==3)))return;parent.clean();if(parent.opened&&Boolean(_returnParentElementByElement)==false){parent.opened=false;parent.element.previousSibling.lib.attribute.removeClass("Open");parent.element.lib.attribute.removeClass("OpenSubContainer");return;};if(parent!=el.left.html.container){parent.element.previousSibling.lib.attribute.addClass("Open");parent.element.lib.attribute.addClass("OpenSubContainer");parent.opened=true;};if(element==document.documentElement){new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;<span class='Blue'>html</span>&#62;").insert(parent);};for(var i=0;i<=len;i++){if(i==len){new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;/<span class='Blue'>"+element.nodeName.toLowerCase()+"</span>&#62;").insert(container);break;}
+var item=element.childNodes[i];if(item.nodeType!=3){var container=new lib.element().attribute.addClass("Block").insert(parent),link=new lib.element("A").attribute.addClass("Link").insert(container),spacer=new lib.element("SPAN").attribute.addClass("Spacer").update("&nbsp;").insert(link),html=new lib.element("SPAN").attribute.addClass("Content").update(d.highlight(item)).insert(link),subContainer=new lib.element("DIV").attribute.addClass("SubContainer").insert(container),view=lib.util.Element.getView(item);link.event.addListener("click",lib.util.Curry(d.html.openHtmlTree,window,item,subContainer,false));link.event.addListener("mouseover",lib.util.Curry(d.html.highlight,window,item,false));link.event.addListener("mouseout",lib.util.Curry(d.html.highlight,window,item,true));returnParentVal=returnParentEl==item?subContainer:returnParentVal;if(d.html.current==null&&item==document.body){link.attribute.addClass("Selected");d.html.current=[item,link];d.html.openHtmlTree(item,subContainer);}
+if(element.nodeName!="HEAD"&&element!=document.documentElement&&(view.visibility=="hidden"||view.display=="none")){container.attribute.addClass("Unvisible");};if(item.childNodes){var childLen=item.childNodes.length;if(childLen==1&&item.childNodes[0].nodeType==3){html.child.add(document.createTextNode(item.childNodes[0].nodeValue.substring(0,50)));html.child.add(document.createTextNode("</"));html.child.add(new lib.element("span").attribute.addClass("Blue").update(item.nodeName.toLowerCase()).environment.getElement());html.child.add(document.createTextNode(">"));continue;}
+else
+if(childLen>0){link.attribute.addClass("Parent");}}}};return returnParentVal;}},openProperties:function(){with(firebug){var index=d.html.nIndex;var node=d.html.current[0];d.clean(el.right.html.content);var str="";switch(index){case"computedStyle":var property=["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort();var view=document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle;for(var i=0,len=property.length;i<len;i++){var item=property[i];if(!view[item])continue;str+="<div class='CSSItem'><div class='CSSProperty'>"+item+"</div><div class='CSSValue'>"+d.highlight(view[item])+"</div></div>";}
+el.right.html.content.update(str);break;case"dom":d.dom.open(node,el.right.html.content,lib.env.ie);break;}}}},inspector:{enabled:false,el:null,inspect:function(_element,_bgInspector){with(firebug){var pos=env.targetWindow.firebug.lib.util.Element.getPosition(_element);env.targetWindow.firebug.el[_bgInspector&&"bgInspector"||"borderInspector"].environment.addStyle({"width":_element.offsetWidth+"px","height":_element.offsetHeight+"px","top":pos.offsetTop-(_bgInspector?0:2)+"px","left":pos.offsetLeft-(_bgInspector?0:2)+"px","display":"block"});9
+if(!_bgInspector){d.inspector.el=_element;}};},toggle:function(_absoluteValue,_event){with(firebug){if(_absoluteValue==d.inspector.enabled)
+return;d.inspector.enabled=_absoluteValue!=undefined&&!_absoluteValue.clientX?_absoluteValue:!d.inspector.enabled;el.button.inspect.attribute[(d.inspector.enabled?"add":"remove")+"Class"]("Enabled");if(d.inspector.enabled==false){el.borderInspector.environment.addStyle({"display":"none"});d.inspector.el=null;}else if(lib.env.dIndex!="html"){if(env.popupWin){env.popupWin.firebug.d.navigate("html");}else{d.navigate("html");}}}}},scripts:{index:-1,lineNumbers:false,open:function(_index){with(firebug){d.scripts.index=_index;el.left.scripts.container.update("");var script=document.getElementsByTagName("script")[_index],uri=script.src||document.location.href,source;try{if(uri!=document.location.href){source=env.cache[uri]||lib.xhr.get(uri).responseText;env.cache[uri]=source;}else{source=script.innerHTML;}
+source=source.replace(/<|>/g,function(_ch){return({"<":"&#60;",">":"&#62;"})[_ch];});if(!d.scripts.lineNumbers)
+el.left.scripts.container.child.add(new lib.element("DIV").attribute.addClass("CodeContainer").update(source));else{source=source.split("<br />");for(var i=0;i<source.length;i++){el.left.scripts.container.child.add(new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("LineNumber").update(i+1),new lib.element("DIV").attribute.addClass("Code").update("&nbsp;"+source[i]),new lib.element("DIV").attribute.addClass('Clear')));};};}catch(e){el.left.scripts.container.child.add(new lib.element("DIV").attribute.addClass("CodeContainer").update("<em>Access to restricted URI denied</em>"));}}},toggleLineNumbers:function(){with(firebug){d.scripts.lineNumbers=!d.scripts.lineNumbers;el.button.scripts.lineNumbers.attribute[(d.scripts.lineNumbers?"add":"remove")+"Class"]("Enabled");d.scripts.open(d.scripts.index);}},refresh:function(){with(firebug){el.button.scripts.selectbox.clean();var collection=env.targetWindow.document.getElementsByTagName("script");for(var i=0,len=collection.length;i<len;i++){var item=collection[i],fileName=getFileName(item.src||item.baseURI||"..");d.scripts.index=d.scripts.index<0?i:d.scripts.index;el.button.scripts.selectbox.child.add(new lib.element("OPTION").attribute.set("value",i).update(fileName));}
+d.scripts.open(d.scripts.index);}}},str:{open:function(_str){with(firebug){d.navigate("str");el.left.str.container.update(_str.replace(/\n/g,"<br />"))}}},xhr:{objects:[],addObject:function(){with(firebug){for(var i=0,len=arguments.length;i<len;i++){try{var item=arguments[i],val=env.targetWindow.eval(item);d.xhr.objects.push([item,val]);}catch(e){continue;}}}},open:function(){with(firebug){el.left.xhr.container.update("");el.left.xhr.name=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({"width":"20%"}).insert(el.left.xhr.container));el.left.xhr.nameTitle=new lib.element("STRONG").update("Object Name:").insert(el.left.xhr.name);el.left.xhr.nameContent=new lib.element("DIV").insert(el.left.xhr.name);el.left.xhr.status=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({"width":"10%"}).insert(el.left.xhr.container));el.left.xhr.statusTitle=new lib.element("STRONG").update("Status:").insert(el.left.xhr.status);el.left.xhr.statusContent=new lib.element("DIV").insert(el.left.xhr.status);el.left.xhr.readystate=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({"width":"15%"}).attribute.addClass("Block").insert(el.left.xhr.container));el.left.xhr.readystateTitle=el.left.xhr.nameTitle=new lib.element("STRONG").update("Ready State:").insert(el.left.xhr.readystate);el.left.xhr.readystateContent=new lib.element("DIV").insert(el.left.xhr.readystate);el.left.xhr.response=new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({"width":(lib.env.ie?"50":"55")+"%"}).attribute.addClass("Block").insert(el.left.xhr.container));el.left.xhr.responseTitle=new lib.element("STRONG").update("Response:").insert(el.left.xhr.response);el.left.xhr.responseContent=new lib.element("DIV").insert(el.left.xhr.response);setTimeout(d.xhr.refresh,500);}},refresh:function(){with(firebug){el.left.xhr.nameContent.update("");el.left.xhr.statusContent.update("");el.left.xhr.readystateContent.update("");el.left.xhr.responseContent.update("");for(var i=0,len=d.xhr.objects.length;i<len;i++){var item=d.xhr.objects[i],response=item[1].responseText;if(Boolean(item[1])==false)continue;el.left.xhr.nameContent.child.add(new lib.element("span").update(item[0]));try{el.left.xhr.statusContent.child.add(new lib.element("span").update(item[1].status));}catch(e){el.left.xhr.statusContent.child.add(new lib.element("span").update("&nbsp;"));}
+el.left.xhr.readystateContent.child.add(new lib.element("span").update(item[1].readyState));el.left.xhr.responseContent.child.add(new lib.element("span").child.add(new lib.element("A").event.addListener("click",lib.util.Curry(d.str.open,window,response)).update("&nbsp;"+response.substring(0,50))));};if(env.dIndex=="xhr")
+setTimeout(d.xhr.refresh,500);}}},navigateRightColumn:function(_index,_open){with(firebug){el.left.container.environment.addStyle({"width":_open?"70%":"100%"});el.right.container.environment.addStyle({"display":_open?"block":"none"});}},navigate:function(_index){with(firebug){var open=_index,close=env.dIndex;env.dIndex=open;settings.hide();el.button[close].container.environment.addStyle({"display":"none"});el.left[close].container.environment.addStyle({"display":"none"});el.right[close].container.environment.addStyle({"display":"none"});el.button[open].container.environment.addStyle({"display":"inline"});el.left[open].container.environment.addStyle({"display":"block"});el.right[open].container.environment.addStyle({"display":"block"});if(el.nav[close])
+el.nav[close].attribute.removeClass("Selected");if(el.nav[open])
+el.nav[open].attribute.addClass("Selected");switch(open){case"console":d.navigateRightColumn(_index);break;case"html":d.navigateRightColumn(_index,true);if(!d.html.current){var t=Number(new Date);d.html.openHtmlTree();}
+break;case"css":d.navigateRightColumn(_index,true);d.css.refresh();break;case"scripts":d.navigateRightColumn(_index);d.scripts.refresh();break;case"dom":d.navigateRightColumn(_index);if(el.left.dom.container.environment.getElement().innerHTML==""){var t=Number(new Date);d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);}
+break;case"xhr":d.navigateRightColumn(_index);d.xhr.open();break;}}}},getFileName:function(_path){var match=_path&&_path.match(/[\w\-\.\?\=\&]+$/);return match&&match[0]||_path;},cancelEvent:function(_event){if(_event.stopPropagation)
+_event.stopPropagation();if(_event.preventDefault)
+_event.preventDefault();},getSelection:function(_el){with(firebug){if(lib.env.ie){var range=document.selection.createRange(),stored=range.duplicate();stored.moveToElementText(_el);stored.setEndPoint('EndToEnd',range);_el.selectionStart=stored.text.length-range.text.length;_el.selectionEnd=_el.selectionStart+range.text.length;}
+return{start:_el.selectionStart,length:_el.selectionEnd-_el.selectionStart}}},tab:function(_el,_event){with(firebug){if(_event.keyCode==9){if(_el.setSelectionRange){var position=firebug.getSelection(_el);_el.value=_el.value.substring(0,position.start)+String.fromCharCode(9)+_el.value.substring(position.start+position.length,_el.value.length);_el.setSelectionRange(position.start+1,position.start+1);}else if(document.selection){var range=document.selection.createRange(),isCollapsed=range.text=='';range.text=String.fromCharCode(9);range.moveStart('character',-1);}
+firebug.cancelEvent(_event);if(lib.env.ie)
+setTimeout(_el.focus,100);};}},listen:{addXhrObject:function(){with(firebug){d.xhr.addObject.apply(env.targetWindow,el.button.xhr.textbox.environment.getElement().value.split(","));}},consoleTextbox:function(_event){with(firebug){if(_event.keyCode==13&&(env.multilinemode==false||_event.shiftKey==false)){d.console.historyIndex=d.console.history.length;d.console.eval(el.left.console.input.environment.getElement().value);return false;}
+switch(_event.keyCode){case 40:if(d.console.history[d.console.historyIndex+1]){d.console.historyIndex+=1;el.left.console.input.update(d.console.history[d.console.historyIndex]);}
+break;case 38:if(d.console.history[d.console.historyIndex-1]){d.console.historyIndex-=1;el.left.console.input.update(d.console.history[d.console.historyIndex]);}
+break;}}},cssSelectbox:function(){with(firebug){d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex);}},domTextbox:function(_event){with(firebug){if(_event.keyCode==13){d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);}}},inspector:function(){with(firebug){if(env.popupWin){env.popupWin.firebug.d.html.inspect(firebug.d.inspector.el);}else{firebug.d.html.inspect(firebug.d.inspector.el);}}},keyboard:function(_event){with(firebug){if(_event.keyCode==27&&d.inspector.enabled){d.inspector.toggle();}else if(_event.keyCode===123&&_event.ctrlKey||_event.metaKey){if(env.isPopup){win.dock();}else{win.newWindow();}}else if((_event.keyCode===123&&!_event.ctrlKey&&!_event.metaKey)||(_event.keyCode===76&&(_event.ctrlKey||_event.metaKey)&&_event.shiftKey)||(_event.keyCode===13&&_event.shiftKey)){if(env.isPopup){win.dock();}else if(el.main.environment.getStyle("display")==='none'){win.show();}else{win.hide();}}}},mouse:function(_event){with(firebug){var target;if(document.elementFromPoint){target=document.elementFromPoint(_event.clientX,_event.clientY);}else{if(lib.env.ie){target=_event.srcElement;}else{target=_event.explicitOriginalTarget||_event.target;}}
+if(d.inspector.enabled&&target!=document.body&&target!=document.firstChild&&target!=document.childNodes[1]&&target!=el.borderInspector.environment.getElement()&&target!=el.main.environment.getElement()&&target.offsetParent!=el.main.environment.getElement()){d.inspector.inspect(target);}}},runMultiline:function(){with(firebug){d.console.eval.call(window,el.right.console.input.environment.getElement().value);}},runCSS:function(){with(firebug){var source=el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}");for(var i=0,len=source.length;i<len;i++){var item=source[i]+"}",rule=!lib.env.ie?item:item.split(/{|}/),styleSheet=document.styleSheets[0];console.log(rule);if(item.match(/.+\{.+\}/)){if(lib.env.ie)
+styleSheet.addRule(rule[0],rule[1]);else
+styleSheet.insertRule(rule,styleSheet.cssRules.length);}}}},scriptsSelectbox:function(){with(firebug){d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value));}},xhrTextbox:function(_event){with(firebug){if(_event.keyCode==13){d.xhr.addObject.apply(env.targetWindow,el.button.xhr.textbox.environment.getElement().value.split(","));}}}}};(function(_scope){_scope.lib={};var pi=_scope.lib;pi.version=[1.1,2008091000];pi.env={ie:/MSIE/i.test(navigator.userAgent),ie6:/MSIE 6/i.test(navigator.userAgent),ie7:/MSIE 7/i.test(navigator.userAgent),ie8:/MSIE 8/i.test(navigator.userAgent),firefox:/Firefox/i.test(navigator.userAgent),opera:/Opera/i.test(navigator.userAgent),webkit:/Webkit/i.test(navigator.userAgent),camino:/Camino/i.test(navigator.userAgent)};pi.get=function(){return document.getElementById(arguments[0]);};pi.get.byTag=function(){return document.getElementsByTagName(arguments[0]);};pi.get.byClass=function(){return document.getElementsByClassName.apply(document,arguments);};pi.util={Array:{clone:function(_array,_undeep){var tmp=[];Array.prototype.push.apply(tmp,_array);pi.util.Array.forEach(tmp,function(_item,_index,_source){if(_item instanceof Array&&!_undeep)
+_source[_index]=pi.util.Array.clone(_source[_index]);});return tmp;},count:function(_array,_value){var count=0;pi.util.Array.forEach(_array,function(){count+=Number(arguments[0]==_value);});return count;},forEach:function(_array,_function){if(_array.forEach)
+return _array.forEach(_function);for(var i=0,len=_array.length;i<len;i++)
+_function.apply(_array,[_array[i],i,_array]);},getLatest:function(_array){return _array[_array.length-1];},indexOf:function(_array,_value){if(!pi.env.ie){return _array.indexOf(_value);};var index=-1;for(var i=0,len=_array.length;i<len;i++){if(_array[i]==_value){index=i;break;}}
+return index;},remove:function(_array,_index){var result=_array.slice(0,_index);_array=Array.prototype.push.apply(result,_array.slice(_index+1));return result;}},Curry:function(_fn,_scope){var fn=_fn,scope=_scope||window,args=Array.prototype.slice.call(arguments,2);return function(){return fn.apply(scope,args.concat(Array.prototype.slice.call(arguments,0)));};},Extend:function(_superClass,_prototype,_skipClonning){var object=new pi.base;if(_prototype["$Init"]){object.init=_prototype["$Init"];delete _prototype["$Init"];};object.body=_superClass==pi.base?_prototype:pi.util.Hash.merge(_prototype,_superClass.prototype);object.init=object.init||function(){if(_superClass!=pi.base)
+_superClass.apply(this,arguments);};return object.build(_skipClonning);},IsArray:function(_object){if(_object===null){return false;}
+if(window.NodeList&&window.NamedNodeMap&&!pi.env.ie8){if(_object instanceof Array||_object instanceof NodeList||_object instanceof NamedNodeMap||(window.HTMLCollection&&_object instanceof HTMLCollection))
+return true;};if(!_object||_object==window||typeof _object=="function"||typeof _object=="string"||typeof _object.length!="number"){return false};var len=_object.length;if(len>0&&_object[0]!=undefined&&_object[len-1]!=undefined){return true;}else{for(var key in _object){if(key!="item"&&key!="length"&&key!="setNamedItemNS"&&key!="setNamedItem"&&key!="getNamedItem"&&key!="removeNamedItem"&&key!="getNamedItemNS"&&key!="removeNamedItemNS"&&key!="tags"){return false;}}
+return true};},IsHash:function(_object){return _object&&typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object)},Init:[],AddEvent:function(_element,_eventName,_fn,_useCapture){_element[pi.env.ie?"attachEvent":"addEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);return pi.util.Curry(pi.util.AddEvent,this,_element);},RemoveEvent:function(_element,_eventName,_fn,_useCapture){_element[pi.env.ie?"detachEvent":"removeEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);return pi.util.Curry(pi.util.RemoveEvent,this,_element);},Element:{addClass:function(_element,_class){if(!pi.util.Element.hasClass(_element,_class))
+pi.util.Element.setClass(_element,pi.util.Element.getClass(_element)+" "+_class);},getClass:function(_element){return _element.getAttribute(pi.env.ie&&!pi.env.ie8?"className":"class")||"";},hasClass:function(_element,_class){return pi.util.Array.indexOf(pi.util.Element.getClass(_element).split(" "),_class)>-1;},removeClass:function(_element,_class){if(pi.util.Element.hasClass(_element,_class)){var names=pi.util.Element.getClass(_element,_class).split(" ");pi.util.Element.setClass(_element,pi.util.Array.remove(names,pi.util.Array.indexOf(names,_class)).join(" "));}},setClass:function(_element,_value){if(pi.env.ie8){_element.setAttribute("className",_value);_element.setAttribute("class",_value);}else{_element.setAttribute(pi.env.ie?"className":"class",_value);}},toggleClass:function(){if(pi.util.Element.hasClass.apply(this,arguments))
+pi.util.Element.removeClass.apply(this,arguments);else
+pi.util.Element.addClass.apply(this,arguments);},getOpacity:function(_styleObject){var styleObject=_styleObject;if(!pi.env.ie)
+return styleObject["opacity"];var alpha=styleObject["filter"].match(/opacity\=(\d+)/i);return alpha?alpha[1]/100:1;},setOpacity:function(_element,_value){if(!pi.env.ie)
+return pi.util.Element.addStyle(_element,{"opacity":_value});_value*=100;pi.util.Element.addStyle(_element,{"filter":"alpha(opacity="+_value+")"});return this._parent_;},getPosition:function(_element){var parent=_element,offsetLeft=document.body.offsetLeft,offsetTop=document.body.offsetTop,view=pi.util.Element.getView(_element);while(parent&&parent!=document.body&&parent!=document.firstChild){offsetLeft+=parseInt(parent.offsetLeft);offsetTop+=parseInt(parent.offsetTop);parent=parent.offsetParent;};return{"bottom":view["bottom"],"clientLeft":_element.clientLeft,"clientTop":_element.clientTop,"left":view["left"],"marginTop":view["marginTop"],"marginLeft":view["marginLeft"],"offsetLeft":offsetLeft,"offsetTop":offsetTop,"position":view["position"],"right":view["right"],"top":view["top"],"zIndex":view["zIndex"]};},getSize:function(_element){var view=pi.util.Element.getView(_element);return{"height":view["height"],"clientHeight":_element.clientHeight,"clientWidth":_element.clientWidth,"offsetHeight":_element.offsetHeight,"offsetWidth":_element.offsetWidth,"width":view["width"]}},addStyle:function(_element,_style){for(var key in _style){key=key=="float"?pi.env.ie?"styleFloat":"cssFloat":key;if(key=="opacity"&&pi.env.ie){pi.util.Element.setOpacity(_element,_style[key]);continue;}
+try{_element.style[key]=_style[key];}catch(e){}}},getStyle:function(_element,_property){_property=_property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;if(_property=="opacity"&&pi.env.ie)
+return pi.util.Element.getOpacity(_element.style);return typeof _property=="string"?_element.style[_property]:_element.style;},getValue:function(_element){switch(_element.nodeName.toLowerCase()){case"input":case"textarea":return _element.value;case"select":return _element.options[_element.selectedIndex].value;default:return _element.innerHTML;break;}},getView:function(_element,_property){var view=document.defaultView?document.defaultView.getComputedStyle(_element,null):_element.currentStyle;_property=_property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;if(_property=="opacity"&&pi.env.ie)
+return pi.util.Element.getOpacity(_element,view);return typeof _property=="string"?view[_property]:view;}},Hash:{clone:function(_hash,_undeep){var tmp={};for(var key in _hash){if(!_undeep&&pi.util.IsArray(_hash[key])){tmp[key]=pi.util.Array.clone(_hash[key]);}else if(!_undeep&&pi.util.IsHash(_hash[key])){tmp[key]=pi.util.Hash.clone(_hash[key]);}else{tmp[key]=_hash[key];}}
+return tmp;},merge:function(_hash,_source,_undeep){for(var key in _source){var value=_source[key];if(!_undeep&&pi.util.IsArray(_source[key])){if(pi.util.IsArray(_hash[key])){Array.prototype.push.apply(_source[key],_hash[key])}
+else
+value=pi.util.Array.clone(_source[key]);}
+else if(!_undeep&&pi.util.IsHash(_source[key])){if(pi.util.IsHash(_hash[key])){value=pi.util.Hash.merge(_hash[key],_source[key]);}else{value=pi.util.Hash.clone(_source[key]);}}else if(_hash[key])
+value=_hash[key];_hash[key]=value;};return _hash;}},String:{format:function(_str){var values=Array.prototype.slice.call(arguments,1);return _str.replace(/\{(\d)\}/g,function(){return values[arguments[1]];})}},GetViewport:function(){return{height:document.documentElement.clientHeight||document.body.clientHeight,width:document.documentElement.clientWidth||document.body.clientWidth}}};pi.base=function(){this.body={};this.init=null;this.build=function(_skipClonning){var base=this,skipClonning=_skipClonning||false,_private={},fn=function(){var _p=pi.util.Hash.clone(_private);if(!skipClonning){for(var key in this){if(pi.util.IsArray(this[key])){this[key]=pi.util.Array.clone(this[key]);}else
+if(pi.util.IsHash(this[key])){this[key]=pi.util.Hash.clone(this[key],function(_key,_object){this[_key]._parent_=this;});}}};base.createAccessors(_p,this);if(base.init)
+return base.init.apply(this,arguments);return this;};this.movePrivateMembers(this.body,_private);if(this.init){fn["$Init"]=this.init;};fn.prototype=this.body;return fn;};this.createAccessors=function(_p,_branch){var getter=function(_property){return this[_property];},setter=function(_property,_value){this[_property]=_value;return _branch._parent_||_branch;};for(var name in _p){var isPrivate=name.substring(0,1)=="_",title=name.substring(1,2).toUpperCase()+name.substring(2);if(isPrivate){_branch[(_branch["get"+title]?"_":"")+"get"+title]=pi.util.Curry(getter,_p,name);_branch[(_branch["set"+title]?"_":"")+"set"+title]=pi.util.Curry(setter,_p,name);}
+else
+if(pi.util.IsHash(_p[name])){_branch[name]._parent_=_branch;if(!_branch[name])
+_branch[name]={};this.createAccessors(_p[name],_branch[name]);}};};this.movePrivateMembers=function(_object,_branch){for(var name in _object){var isPrivate=name.substring(0,1)=="_";if(isPrivate){_branch[name]=_object[name];delete _object[name];}
+else
+if(pi.util.IsHash(_object[name])){_branch[name]={};this.movePrivateMembers(_object[name],_branch[name]);}};};};pi.element=new pi.base;pi.element.init=function(_val){this.environment.setElement(typeof _val=="string"||!_val?document.createElement(_val||"DIV"):_val);return this;};pi.element.body={"addStyle":function(){return this.environment.addStyle.apply(this.environment,arguments);},"clean":function(){var childs=this.child.get();while(childs.length){childs[0].parentNode.removeChild(childs[0]);}},"clone":function(_deep){return this.environment.getElement().cloneNode(_deep);},"insert":function(_element){_element=_element.environment?_element.environment.getElement():_element;_element.appendChild(this.environment.getElement());return this;},"insertAfter":function(_referenceElement){_referenceElement=_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;_referenceElement.nextSibling?this.insertBefore(_referenceElement.nextSibling):this.insert(_referenceElement.parentNode);return this;},"insertBefore":function(_referenceElement){_referenceElement=_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;_referenceElement.parentNode.insertBefore(this.environment.getElement(),_referenceElement);return this;},"query":function(_expression,_resultType,namespaceResolver,_result){return pi.xpath(_expression,_resultType||"ORDERED_NODE_SNAPSHOT_TYPE",this.environment.getElement(),_namespaceResolver,_result);},"remove":function(){if(this.environment.getParent()){this.environment.getParent().removeChild(this.environment.getElement());}},"update":function(_value){this.element[this.element.nodeName.toLowerCase()=="textarea"||this.element.nodeName.toLowerCase()=="input"?"value":"innerHTML"]=_value;return this;},"attribute":{"getAll":function(){return this._parent_.environment.getElement().attributes;},"clear":function(_name){this.set(_name,"");return this._parent_;},"get":function(_name){return this._parent_.environment.getElement().getAttribute(_name);},"has":function(_name){return pi.env.ie?(this.get(_name)!=null):this._parent_.environment.getElement().hasAttribute(_name);},"remove":function(_name){this._parent_.environment.getElement().removeAttribute(_name);return this._parent_;},"set":function(_name,_value){this._parent_.environment.getElement().setAttribute(_name,_value);return this._parent_;},"addClass":function(_classes){for(var i=0,len=arguments.length;i<len;i++){pi.util.Element.addClass(this._parent_.environment.getElement(),arguments[i]);};return this._parent_;},"clearClass":function(){this.setClass("");this._parent_;},"getClass":function(){return pi.util.Element.getClass(this._parent_.environment.getElement());},"hasClass":function(_class){return pi.util.Element.hasClass(this._parent_.environment.getElement(),_class);},"setClass":function(_value){return pi.util.Element.setClass(this._parent_.environment.getElement(),_value);},"removeClass":function(_class){pi.util.Element.removeClass(this._parent_.environment.getElement(),_class);return this._parent_;},"toggleClass":function(_class){pi.util.Element.toggleClass(this._parent_.environment.getElement(),_class);}},"child":{"get":function(){return this._parent_.environment.getElement().childNodes;},"add":function(_elements){for(var i=0;i<arguments.length;i++){var el=arguments[i];this._parent_.environment.getElement().appendChild(el.environment?el.environment.getElement():el);}
+return this._parent_;},"addAfter":function(_element,_referenceElement){this.addBefore(_element.environment?_element.environment.getElement():_element,(_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement).nextSibling);return this._parent_;},"addBefore":function(_element,_referenceElement){this._parent_.environment.getElement().insertBefore(_element.environment?_element.environment.getElement():_element,_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement);return this._parent_;},"remove":function(_element){this._parent_.environment.getElement().removeChild(_element.environment?_element.environment.getElement():_element);}},"environment":{"_element":null,"setElement":function(_value){this._parent_.element=_value;this._parent_.element.lib=this._parent_;this._parent_.element.firebugElement=true;this._setElement(_value);},"getParent":function(){return this.getElement().parentNode;},"getPosition":function(){return pi.util.Element.getPosition(this.getElement());},"getSize":function(){return pi.util.Element.getSize(this.getElement());},"addStyle":function(_styleObject){pi.util.Element.addStyle(this.getElement(),_styleObject);return this._parent_;},"getStyle":function(_property){return pi.util.Element.getStyle(this.getElement(),_property);},"getName":function(){return this.getElement().nodeName;},"getType":function(){return this.getElement().nodeType;},"getValue":function(){return pi.util.Element.getValue(this.getElement());},"getView":function(_property){return pi.util.Element.getView(this.getElement(),_property);}},"event":{"addListener":function(_event,_fn,_useCapture){pi.util.AddEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);return this._parent_;},"removeListener":function(_event,_fn,_useCapture){pi.util.RemoveEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);return this._parent_;}}};pi.element=pi.element.build();pi.xhr=new pi.base;pi.xhr.init=function(_url){if(!window.XMLHttpRequest){var names=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];for(var i=0;i<names.length;i++){try{this.environment.setApi(new ActiveXObject(names[i]));break;}catch(e){continue;}}}
+else{this.environment.setApi(new XMLHttpRequest());}
+this.environment.getApi().onreadystatechange=pi.util.Curry(this.event.readystatechange,this);this.environment.setUrl(_url);this.environment.setCallback([]);return this;};pi.xhr.body={"addCallback":function(){return this.environment.addCallback.apply(this.environment,arguments);},"addData":function(){return this.environment.addData.apply(this.environment,arguments);},"abort":function(){this.environment.getApi().abort();return this;},"send":function(){var url=this.environment.getUrl(),data=this.environment.getData(),dataUrl="";if(!this.environment.getCache())
+data["forceCache"]=Number(new Date);for(var key in data)
+dataUrl+=pi.util.String.format("{0}={1}&",key,data[key]);if(this.environment.getType()=="GET")
url+=(url.search("\\?")==-1?"?":"&")+pi.util.String.format("{0}",dataUrl);this.api.open(this.environment.getType(),url,this.environment.getAsync());if(this.environment.getType()=="POST"){this.api.setRequestHeader("Content-Type","application/x-www-form-urlencoded");};this.api.send(this.environment.getType()=="GET"?"":dataUrl);return this;}};pi.xhr.body.environment={"_async":true,"_api":null,"_cache":true,"_callback":null,"_data":{},"_type":"GET","_url":"","setApi":function(_value){this._parent_.api=_value;this._setApi(_value);},"addCallback":function(_readyState,_fn){this.getCallback().push({"fn":_fn,"readyState":_readyState});return this._parent_;},"addData":function(_key,_value){this.getData()[_key]=_value;return this._parent_;},"setType":function(_value){this._setType(_value);return this._parent_;}};pi.xhr.body.event={"readystatechange":function(){var readyState=this.environment.getApi().readyState,callback=this.environment.getCallback();for(var i=0,len=callback.length;i<len;i++){if(pi.util.Array.indexOf(callback[i].readyState,readyState)>-1){callback[i].fn.apply(this);}}}};pi.xhr=pi.xhr.build();pi.xhr.get=function(_url,_returnPiObject){var request=new pi.xhr();request.environment.setAsync(false);request.environment.setUrl(_url);request.send();return _returnPiObject?request:request.environment.getApi();};pi.util.AddEvent(pi.env.ie?window:document,pi.env.ie?"load":"DOMContentLoaded",function(){for(var i=0,len=pi.util.Init.length;i<len;i++){pi.util.Init[i]();}});})(firebug);with(firebug){initConsole();lib.util.Init.push(firebug.init);}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.css b/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.css
old mode 100755
new mode 100644
index 8c85d4328..c71baad91
--- a/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.css
+++ b/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.css
@@ -1,214 +1,214 @@
-/* */
-#Firebug div, #Firebug h3, #Firebug span, #Firebug input, #Firebug textarea, #Firebug select, #Firebug option, #Firebug a, #Firebug strong, #Firebug em, #Firebug label, #Firebug center {
- position:static; float:none; width:auto; height:auto; text-align:left; border:0; overflow:visible; background:transparent none repeat left top; color:#111; font-size:1em; font-weight:normal; font-style:normal; font-family:sans-serif; margin:0; padding:0; min-height:0;
-}
-#Firebug input, #Firebug select, #Firebug textarea { background:#fff; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; border:1px outset #aaa; padding:2px }
-#Firebug center { text-align:center; }
-#Firebug strong { font-weight:bold; }
-#Firebug em { font-style:italic; }
-/* */
-
-#FirebugIFrame { position:fixed !important; position:absolute; z-index:99999998; left:0; bottom:0; width:100%; height:295px; background:#fff; border-width:0px; }
-
-#Firebug { position:fixed !important; position:absolute; z-index:99999999; left:0; bottom:0; width:100%; height:295px; background:#fff; overflow:hidden; }
-#Firebug .Resizer { position:absolute; top:0; width:100%; height:5px; background:transparent; *background:url(spacer.gif); cursor:n-resize; -moz-user-select:none; }
-#Firebug .Header { height:38px; background:#ccc url(firebug.gif) 0 -85px; }
-#Firebug .Left, #Firebug > .Right { background:#fff; height:257px;}
-#Firebug .Left { float:left; width:100%; }
-#Firebug .Right { float:left; display:none; width:30%; overflow:hidden; }
-#Firebug .Right .Container { height:100%; border-left:1px solid #ccc; }
-
-/*
- * buttonset
- */
-
-#Firebug .ButtonContainer { padding:8px 0 5px 10px; *margin-top:-3px; _margin-top:0; }
-#Firebug .ButtonContainer .Button { cursor:pointer; font:12px "MS Sans Serif", Geneva, sans-serif; color:#000; margin-right:5px; padding:4px 4px 4px 4px; border:1px solid transparent !important; border-color:#ccc; text-decoration:none; }
-#Firebug .ButtonContainer .Button:hover { border:1px outset #aaa !important; }
-#Firebug .ButtonContainer .Button:active { border-style:inset !important; background-color:#ccc; }
-#Firebug .ButtonContainer .Enabled { border:1px outset #aaa !important; }
-#Firebug .ButtonContainer .Logo { text-decoration:none; padding-left:24px; background:url(firebug.gif) no-repeat 5px 3px; border:0 !important; opacity:0.7; filter:Alpha(Opacity=70); }
-#Firebug .ButtonContainer .Logo:hover, #Firebug .ButtonContainer .Logo:active { border:0 !important; background-color:transparent; opacity:1; filter:Alpha(Opacity=100); }
-#Firebug .ButtonContainer .Maximize, #Firebug .ButtonContainer .Minimize, #Firebug .ButtonContainer .NewWindow, #Firebug .ButtonContainer .Dock, #Firebug .ButtonContainer .Close { position:absolute; right:0; top:12px; padding:6px 8px 8px 8px; background:url(firebug.gif) no-repeat -3px -48px; border:0 !important; opacity:0.7; filter:Alpha(Opacity:80); *padding:0px 7px 1px 7px; }
-#Firebug .ButtonContainer .Maximize:hover, #Firebug .ButtonContainer .Maximize:active, #Firebug .ButtonContainer .NewWindow:hover, #Firebug .ButtonContainer .NewWindow:active, #Firebug .ButtonContainer .Dock:hover, #Firebug .ButtonContainer .Dock:active, #Firebug .ButtonContainer .Minimize:hover, #Firebug .ButtonContainer .Minimize:active, #Firebug .ButtonContainer .Close:hover, #Firebug .ButtonContainer .Close:active { border:0 !important; background-color:transparent; opacity:1; filter:Alpha(Opacity:100); }
-#Firebug .ButtonContainer .Minimize { background-position:-3px -20px; right:40px; }
-#Firebug .ButtonContainer .Maximize { display:none; background-position:-3px -34px; right:40px; }
-#Firebug .ButtonContainer .NewWindow { background-position:-3px -123px; right:20px; }
-#Firebug .ButtonContainer .Dock { background-position:-3px -137px; }
-#Firebug .ButtonContainer .ButtonSet { border-left:1px solid #ccc; padding:0 0 0 3px; display:inline; }
-
-/*
- * navigation
- */
-
-#Firebug .Nav { height:23px; background:url(firebug.gif) repeat-x 0 -62px; padding-left:10px; }
-#Firebug .Nav .Tab { display:block; width:auto; float:left; padding:3px 6px 2px 6px; cursor:pointer; border:1px outset transparent !important; border:0; font:bold 11px Arial, Helvetica, sans-serif; color:#666; }
-#Firebug .Nav .Tab:hover, #Firebug .Nav .Selected { border:1px outset #ccc !important; border-top-color:transparent !important; }
-#Firebug .Nav .Selected { color:#111; cursor:default; background-color:#f2f2f2; }
-#Firebug .Nav .Settings { float:right; }
-
-/*
- * inspector
- */
-
-#FirebugBorderInspector { display:none; z-index:99999998; position:absolute; top:0; left:0; border:2px solid #0000ff; background:transparent; *background:url(spacer.gif); opacity:0.5; filter:Alpha(Opacity=50); padding:0; margin:0; }
-#FirebugBGInspector { display:none; z-index:99999998; position:absolute; top:0; left:0; background:rgb(0,150,255); opacity:0.5; filter:Alpha(Opacity=50); padding:0; margin:0; }
-
-/*
- * dom
- */
-
-#Firebug .DOMRow { width:100% !important; width:90%; }
-#Firebug .DOMRow .DOMRowLeft { float:left; width:30%; overflow:hidden; }
-#Firebug .DOMRow .DOMRowLeft a { padding-left:15px; }
-#Firebug .DOMRow .DOMRowRight { float:left; width:60%; *width:60%; _overflow:hidden; white-space:nowrap; }
-#Firebug .DOMRow .DOMRowLeft .Object { background:url(tree_open.gif) no-repeat left center; cursor:pointer; }
-#Firebug .DOMRow .DOMRowLeft .Object:hover { text-decoration:underline; color:#0000ff; }
-#Firebug .DOMRow .DOMRowLeft .Opened { background-image:url(tree_close.gif) }
-#Firebug .DOMRow .DOMRowSubContainer { display:none; padding-left:25px; }
-
-/*
- * console
- */
-#Firebug .Left .Console { overflow:hidden; }
-#Firebug .Left .Console .Monitor { height:210px; border-bottom:1px solid #ccc; overflow:scroll; overflow-x:hidden; }
-#Firebug .Left .Console .Monitor .Error { background:#ffeff1; color:#ff0000; }
-#Firebug .Left .Console .Monitor .Error strong { color:#ff0000; }
-#Firebug .Left .Console .Monitor .Row { padding:2px 5px 2px 5px; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; overflow:hidden; border-bottom:1px solid #e5e5e5; }
-#Firebug .Left .Console .Monitor .Arrow { color:rgb(0,0,255); white-space:nowrap; }
-
-#Firebug .Left .Console .InputArrow { position:absolute; left:0px; width:20px; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; color:#0000ff; padding:2px 4px 0 4px; }
-#Firebug .Left .Console .InputContainer { margin-left:35px; margin-right:5px; }
-#Firebug .Left .Console .Input { width:100% !important; margin-top:2px; width:98%; overflow:hidden; border:0; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-#Firebug .Console .MLButton { cursor:pointer; position:absolute; top:276px; right:-22px; width:20px; padding:4px 10px 10px 10px; font-size:1px; *padding:2px 10px 10px 10px; background:url(firebug.gif) no-repeat -3px -34px; opacity:0.8; filter:Alpha(Opacity:80); }
-#Firebug .Console .MLButton:hover { opacity:1; filter:Alpha(Opacity:100); }
-#Firebug .Console .CloseML { background-position:-3px -20px; }
-
-#Firebug .Right .Console { background:#eee; }
-#Firebug .Right .Console .Input { width:100%; _width:98%; height:228px; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; background:#fff; border:0; border-bottom:1px solid #ccc; margin-bottom:2px; *overflow:scroll; }
-#Firebug .Right .Console .Button { cursor:pointer; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:1px 4px 1px 4px; margin:0 4px 0 4px; background:#eee; border:1px solid #eee; text-decoration:none; *display:block; *width:auto; *float:left; *margin-top:-1px; }
-#Firebug .Right .Console .Button:hover { border:1px outset #ccc; background:#fff; }
-#Firebug .Right .Console .Button:active { border:1px inset #ccc; background:#ccc; }
-
-#Firebug .Left .Console .Monitor .Warn { background:url(warningIcon.png) #00FFFF no-repeat 2px center; padding-left:20px; }
-#Firebug .Left .Console .Monitor .Info { background:url(infoIcon.png) #fff no-repeat 2px center; padding-left:20px; }
-#Firebug .Left .Console .Monitor .Error { background:url(errorIcon.png) #FFFFE0 no-repeat 2px center; padding-left:20px; }
-
-
-/*
- * html
- */
-
-#Firebug .Left .HTML { display:none; height:250px; overflow:scroll; padding:0 10px 2px 10px; }
-#Firebug .Left .HTML .Block { padding:0 0 0 0px; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-#Firebug .Left .HTML .Block .Spacer { cursor:default; padding:2px 2px 2px 15px; }
-#Firebug .Left .HTML .Block .Link { display:block; color:#333; padding:2px 2px 2px 0; }
-#Firebug .Left .HTML .Block .Link .Content { padding:2px 2px 2px 2px; }
-#Firebug .Left .HTML .Block .Link .TagName { cursor:pointer; }
-#Firebug .Left .HTML .Block .Parent { font-weight:bold; color:#111; text-decoration:none; }
-#Firebug .Left .HTML .Block .Parent .Spacer { background:#fff center no-repeat; }
-#Firebug .Left .HTML .Block .Parent .Spacer { background-image:url(tree_open.gif); }
-#Firebug .Left .HTML .Block .Open .Spacer { background-image:url(tree_close.gif) }
-#Firebug .Left .HTML .Block .Selected { background-color:#4473c4; }
-#Firebug .Left .HTML .Block .Selected * { color:#fff; }
-#Firebug .Left .HTML .Block .SubContainer { padding-left:20px; height:0; font-size:0px; }
-#Firebug .Left .HTML .Block .OpenSubContainer { height:auto; }
-#Firebug .Left .HTML .Unvisible { opacity:0.5; filter:Alpha(Opacity=50); }
-
-#Firebug .Right .HTML { display:none; }
-#Firebug .Right .HTML .Content { overflow:scroll; height:235px; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-#Firebug .Right .HTML .Content .CSSItem { padding:5px; color:#333; height:6px }
-#Firebug .Right .HTML .Content .CSSProperty { width:45%; float:left; overflow:hidden; }
-#Firebug .Right .HTML .Content .CSSValue { width:55%; float:left; white-space:nowrap; overflow:visible !important; overflow:hidden; }
-#Firebug .Right .HTML .Content .CSSValue input { font:11px ArArial, Helvetica, sans-serif; color:#333; 3px 0 0 -3px; }
-#Firebug .Right .HTML .Content .CSSItem center { color:rgb(0,150,0); padding:0 0 3px 0; font:bold 12px Arial, Helvetica, sans-serif; }
-#Firebug .ButtonContainer .HTML { display:none; }
-
-/*
- * CSS
- */
-
-#Firebug .Left .CSS { display:none; padding:5px; height:225px; overflow:scroll; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-#Firebug .Right .CSS { display:none; }
-#Firebug .Left .CSS .Selector { margin-top:10px }
-#Firebug .Left .CSS .CSSText { padding-left:20px; }
-#Firebug .Left .CSS .CSSProperty { color:#005500; margin-top:10px; }
-#Firebug .Left .CSS .CSSValue { padding-left:5px; color:#000088; }
-#Firebug .ButtonContainer .CSS { display:none; }
-
-#Firebug .Right .CSS { background:#eee; }
-#Firebug .Right .CSS .Input { width:100%; _width:98%; height:205px; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; background:#fff; border:0; border-bottom:1px solid #ccc; margin-bottom:2px; *overflow:scroll; }
-#Firebug .Right .CSS .Button { cursor:pointer; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:1px 4px 1px 4px; margin:0 4px 0 4px; background:#eee; border:1px solid #eee; text-decoration:none; *display:block; *width:auto; *float:left; *margin-top:-1px; }
-#Firebug .Right .CSS .Button:hover { border:1px outset #ccc; background:#fff; }
-#Firebug .Right .CSS .Button:active { border:1px inset #ccc; background:#ccc; }
-
-/*
- * Scripts
- */
-
-#Firebug .Left .Scripts { display:none; height:225px; *height:235px; overflow:scroll; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-#Firebug .Left .Scripts .LineNumber { float:left; width:30px; height:20px; padding:0 2px 0 0; background:#eee; color:#666; font-family:Courier; text-align:right; border-right:1px solid #ccc; }
-#Firebug .Left .Scripts .CodeContainer { padding:5px; }
-#Firebug .Left .Scripts .Code { height:20px; }
-#Firebug .Left .Scripts .CodeContainer, #Firebug .Left .Scripts .Code { word-wrap:normal; white-space:pre; }
-#Firebug .Right .Scripts { display:none; }
-#Firebug .ButtonContainer .Scripts { display:none; }
-
-/*
- * DOM
- */
-
-#Firebug .Left .DOM { display:none; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:5px; overflow:scroll; height:225px; }
-#Firebug .Left .DOM .Object { font-weight:bold; }
-#Firebug .Right .DOM { display:none; overflow:scroll; }
-#Firebug .ButtonContainer .DOM { display:none; }
-#Firebug .ButtonContainer .DOM label { font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-
-/*
- * XHR
- */
-
-#Firebug .Left .XHR { display:none; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:5px; overflow:scroll; height:225px; }
-#Firebug .Left .XHR .Block { float:left; width:30%; }
-#Firebug .Left .XHR .BlockContent { padding:3px; border-right:1px dotted #aaa; }
-#Firebug .Left .XHR .Block strong { display:block; text-align:center; padding:3px; background:rgb(200,225,255); color:rgb(50,50,50); }
-#Firebug .Left .XHR .Block span { display:block; text-align:center; overflow:hidden; }
-#Firebug .Left .XHR .Block span a { cursor:pointer; color:rgb(0,0,200); }
-#Firebug .Right .XHR { display:none; overflow:scroll; }
-#Firebug .ButtonContainer .XHR { display:none; }
-#Firebug .ButtonContainer .XHR label { font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-
-#Firebug .Left .STR { display:none; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:5px; overflow:scroll; height:225px; }
-
-/*
- * settings
- */
-#Firebug .SettingsDiv {position:absolute;width:190px;top:60px;border:1px outset #000;-x-system-font:none;color:#000;font-family:"MS Sans Serif",Geneva,sans-serif;font-size:12px;font-size-adjust:none;font-stretch:normal;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal;display:none;background-color:#FFF;}
-#Firebug .SettingsDiv .Header {background:#CCC url(firebug.gif) repeat scroll 0 -85px;height:30px;border-bottom:1px inset #000;}
-#Firebug .SettingsDiv .Header .Title {padding-top:10px;text-align:center;}
-#Firebug .SettingsDiv .Content {padding:5px;}
-#Firebug .SettingsDiv .Content .SettingsCBX{position:relative;top:2px;margin: 4px 5px 0 0; border:0 !important; padding:0 !important; height: 15px !important;}
-#Firebug .SettingsDiv .Content .ButtonsLeft {float:left;padding:10px 0px 5px 0px;}
-#Firebug .SettingsDiv .Content .ButtonsRight {float:right;padding:10px 0px 5px 0px;}
-#Firebug .SettingsDiv .Content .ProgressDiv {background-color:#FFF;width:100%;height:100%;position:absolute;left:0;top:0;z-index:1;opacity:.8;filter:alpha(opacity=80);display:none;}
-#Firebug .SettingsDiv .Content .Progress {background-image:url(progress.gif);width:66px;height:66px;position:absolute;top:50%;left:50%;margin-left:-33px;margin-top:-33px;}
-
-/*
- * element highlighting
- */
-#Firebug .Italic { font-style:italic; }
-#Firebug .Strong { font-weight:bold; }
-#Firebug .NormalWeight { font-weight:normal; }
-#Firebug .Green { color:#008800; }
-#Firebug .Gray { color:#666; }
-#Firebug .Blue { color:#0000ee; }
-#Firebug .DarkBlue { color:#000099; }
-#Firebug .Red { color:#ee0000; }
-#Firebug .Maroon { color:#800000; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
-#Firebug .Null { font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; color:#fff; padding:0 2px 0 2px; background:#999; border:1px solid #666; }
-#Firebug .ObjectLink, #Firebug .ObjectLinkHover { cursor:pointer; }
-#Firebug .ObjectLinkHover { border-bottom:1px solid #008800; }
-
-#Firebug .Clear { clear:both; height:0px; font-size:0px; }
-
+/* */
+#Firebug div, #Firebug h3, #Firebug span, #Firebug input, #Firebug textarea, #Firebug select, #Firebug option, #Firebug a, #Firebug strong, #Firebug em, #Firebug label, #Firebug center {
+ position:static; float:none; width:auto; height:auto; text-align:left; border:0; overflow:visible; background:transparent none repeat left top; color:#111; font-size:1em; font-weight:normal; font-style:normal; font-family:sans-serif; margin:0; padding:0; min-height:0;
+}
+#Firebug input, #Firebug select, #Firebug textarea { background:#fff; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; border:1px outset #aaa; padding:2px }
+#Firebug center { text-align:center; }
+#Firebug strong { font-weight:bold; }
+#Firebug em { font-style:italic; }
+/* */
+
+#FirebugIFrame { position:fixed !important; position:absolute; z-index:99999998; left:0; bottom:0; width:100%; height:295px; background:#fff; border-width:0px; }
+
+#Firebug { position:fixed !important; position:absolute; z-index:99999999; left:0; bottom:0; width:100%; height:295px; background:#fff; overflow:hidden; }
+#Firebug .Resizer { position:absolute; top:0; width:100%; height:5px; background:transparent; *background:url(spacer.gif); cursor:n-resize; -moz-user-select:none; }
+#Firebug .Header { height:38px; background:#ccc url(firebug.gif) 0 -85px; }
+#Firebug .Left, #Firebug > .Right { background:#fff; height:257px;}
+#Firebug .Left { float:left; width:100%; }
+#Firebug .Right { float:left; display:none; width:30%; overflow:hidden; }
+#Firebug .Right .Container { height:100%; border-left:1px solid #ccc; }
+
+/*
+ * buttonset
+ */
+
+#Firebug .ButtonContainer { padding:8px 0 5px 10px; *margin-top:-3px; _margin-top:0; }
+#Firebug .ButtonContainer .Button { cursor:pointer; font:12px "MS Sans Serif", Geneva, sans-serif; color:#000; margin-right:5px; padding:4px 4px 4px 4px; border:1px solid transparent !important; border-color:#ccc; text-decoration:none; }
+#Firebug .ButtonContainer .Button:hover { border:1px outset #aaa !important; }
+#Firebug .ButtonContainer .Button:active { border-style:inset !important; background-color:#ccc; }
+#Firebug .ButtonContainer .Enabled { border:1px outset #aaa !important; }
+#Firebug .ButtonContainer .Logo { text-decoration:none; padding-left:24px; background:url(firebug.gif) no-repeat 5px 3px; border:0 !important; opacity:0.7; filter:Alpha(Opacity=70); }
+#Firebug .ButtonContainer .Logo:hover, #Firebug .ButtonContainer .Logo:active { border:0 !important; background-color:transparent; opacity:1; filter:Alpha(Opacity=100); }
+#Firebug .ButtonContainer .Maximize, #Firebug .ButtonContainer .Minimize, #Firebug .ButtonContainer .NewWindow, #Firebug .ButtonContainer .Dock, #Firebug .ButtonContainer .Close { position:absolute; right:0; top:12px; padding:6px 8px 8px 8px; background:url(firebug.gif) no-repeat -3px -48px; border:0 !important; opacity:0.7; filter:Alpha(Opacity:80); *padding:0px 7px 1px 7px; }
+#Firebug .ButtonContainer .Maximize:hover, #Firebug .ButtonContainer .Maximize:active, #Firebug .ButtonContainer .NewWindow:hover, #Firebug .ButtonContainer .NewWindow:active, #Firebug .ButtonContainer .Dock:hover, #Firebug .ButtonContainer .Dock:active, #Firebug .ButtonContainer .Minimize:hover, #Firebug .ButtonContainer .Minimize:active, #Firebug .ButtonContainer .Close:hover, #Firebug .ButtonContainer .Close:active { border:0 !important; background-color:transparent; opacity:1; filter:Alpha(Opacity:100); }
+#Firebug .ButtonContainer .Minimize { background-position:-3px -20px; right:40px; }
+#Firebug .ButtonContainer .Maximize { display:none; background-position:-3px -34px; right:40px; }
+#Firebug .ButtonContainer .NewWindow { background-position:-3px -123px; right:20px; }
+#Firebug .ButtonContainer .Dock { background-position:-3px -137px; }
+#Firebug .ButtonContainer .ButtonSet { border-left:1px solid #ccc; padding:0 0 0 3px; display:inline; }
+
+/*
+ * navigation
+ */
+
+#Firebug .Nav { height:23px; background:url(firebug.gif) repeat-x 0 -62px; padding-left:10px; }
+#Firebug .Nav .Tab { display:block; width:auto; float:left; padding:3px 6px 2px 6px; cursor:pointer; border:1px outset transparent !important; border:0; font:bold 11px Arial, Helvetica, sans-serif; color:#666; }
+#Firebug .Nav .Tab:hover, #Firebug .Nav .Selected { border:1px outset #ccc !important; border-top-color:transparent !important; }
+#Firebug .Nav .Selected { color:#111; cursor:default; background-color:#f2f2f2; }
+#Firebug .Nav .Settings { float:right; }
+
+/*
+ * inspector
+ */
+
+#FirebugBorderInspector { display:none; z-index:99999998; position:absolute; top:0; left:0; border:2px solid #0000ff; background:transparent; *background:url(spacer.gif); opacity:0.5; filter:Alpha(Opacity=50); padding:0; margin:0; }
+#FirebugBGInspector { display:none; z-index:99999998; position:absolute; top:0; left:0; background:rgb(0,150,255); opacity:0.5; filter:Alpha(Opacity=50); padding:0; margin:0; }
+
+/*
+ * dom
+ */
+
+#Firebug .DOMRow { width:100% !important; width:90%; }
+#Firebug .DOMRow .DOMRowLeft { float:left; width:30%; overflow:hidden; }
+#Firebug .DOMRow .DOMRowLeft a { padding-left:15px; }
+#Firebug .DOMRow .DOMRowRight { float:left; width:60%; *width:60%; _overflow:hidden; white-space:nowrap; }
+#Firebug .DOMRow .DOMRowLeft .Object { background:url(tree_open.gif) no-repeat left center; cursor:pointer; }
+#Firebug .DOMRow .DOMRowLeft .Object:hover { text-decoration:underline; color:#0000ff; }
+#Firebug .DOMRow .DOMRowLeft .Opened { background-image:url(tree_close.gif) }
+#Firebug .DOMRow .DOMRowSubContainer { display:none; padding-left:25px; }
+
+/*
+ * console
+ */
+#Firebug .Left .Console { overflow:hidden; }
+#Firebug .Left .Console .Monitor { height:210px; border-bottom:1px solid #ccc; overflow:scroll; overflow-x:hidden; }
+#Firebug .Left .Console .Monitor .Error { background:#ffeff1; color:#ff0000; }
+#Firebug .Left .Console .Monitor .Error strong { color:#ff0000; }
+#Firebug .Left .Console .Monitor .Row { padding:2px 5px 2px 5px; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; overflow:hidden; border-bottom:1px solid #e5e5e5; }
+#Firebug .Left .Console .Monitor .Arrow { color:rgb(0,0,255); white-space:nowrap; }
+
+#Firebug .Left .Console .InputArrow { position:absolute; left:0px; width:20px; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; color:#0000ff; padding:2px 4px 0 4px; }
+#Firebug .Left .Console .InputContainer { margin-left:35px; margin-right:5px; }
+#Firebug .Left .Console .Input { width:100% !important; margin-top:2px; width:98%; overflow:hidden; border:0; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+#Firebug .Console .MLButton { cursor:pointer; position:absolute; top:276px; right:-22px; width:20px; padding:4px 10px 10px 10px; font-size:1px; *padding:2px 10px 10px 10px; background:url(firebug.gif) no-repeat -3px -34px; opacity:0.8; filter:Alpha(Opacity:80); }
+#Firebug .Console .MLButton:hover { opacity:1; filter:Alpha(Opacity:100); }
+#Firebug .Console .CloseML { background-position:-3px -20px; }
+
+#Firebug .Right .Console { background:#eee; }
+#Firebug .Right .Console .Input { width:100%; _width:98%; height:228px; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; background:#fff; border:0; border-bottom:1px solid #ccc; margin-bottom:2px; *overflow:scroll; }
+#Firebug .Right .Console .Button { cursor:pointer; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:1px 4px 1px 4px; margin:0 4px 0 4px; background:#eee; border:1px solid #eee; text-decoration:none; *display:block; *width:auto; *float:left; *margin-top:-1px; }
+#Firebug .Right .Console .Button:hover { border:1px outset #ccc; background:#fff; }
+#Firebug .Right .Console .Button:active { border:1px inset #ccc; background:#ccc; }
+
+#Firebug .Left .Console .Monitor .Warn { background:url(warningIcon.png) #00FFFF no-repeat 2px center; padding-left:20px; }
+#Firebug .Left .Console .Monitor .Info { background:url(infoIcon.png) #fff no-repeat 2px center; padding-left:20px; }
+#Firebug .Left .Console .Monitor .Error { background:url(errorIcon.png) #FFFFE0 no-repeat 2px center; padding-left:20px; }
+
+
+/*
+ * html
+ */
+
+#Firebug .Left .HTML { display:none; height:250px; overflow:scroll; padding:0 10px 2px 10px; }
+#Firebug .Left .HTML .Block { padding:0 0 0 0px; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+#Firebug .Left .HTML .Block .Spacer { cursor:default; padding:2px 2px 2px 15px; }
+#Firebug .Left .HTML .Block .Link { display:block; color:#333; padding:2px 2px 2px 0; }
+#Firebug .Left .HTML .Block .Link .Content { padding:2px 2px 2px 2px; }
+#Firebug .Left .HTML .Block .Link .TagName { cursor:pointer; }
+#Firebug .Left .HTML .Block .Parent { font-weight:bold; color:#111; text-decoration:none; }
+#Firebug .Left .HTML .Block .Parent .Spacer { background:#fff center no-repeat; }
+#Firebug .Left .HTML .Block .Parent .Spacer { background-image:url(tree_open.gif); }
+#Firebug .Left .HTML .Block .Open .Spacer { background-image:url(tree_close.gif) }
+#Firebug .Left .HTML .Block .Selected { background-color:#4473c4; }
+#Firebug .Left .HTML .Block .Selected * { color:#fff; }
+#Firebug .Left .HTML .Block .SubContainer { padding-left:20px; height:0; font-size:0px; }
+#Firebug .Left .HTML .Block .OpenSubContainer { height:auto; }
+#Firebug .Left .HTML .Unvisible { opacity:0.5; filter:Alpha(Opacity=50); }
+
+#Firebug .Right .HTML { display:none; }
+#Firebug .Right .HTML .Content { overflow:scroll; height:235px; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+#Firebug .Right .HTML .Content .CSSItem { padding:5px; color:#333; height:6px }
+#Firebug .Right .HTML .Content .CSSProperty { width:45%; float:left; overflow:hidden; }
+#Firebug .Right .HTML .Content .CSSValue { width:55%; float:left; white-space:nowrap; overflow:visible !important; overflow:hidden; }
+#Firebug .Right .HTML .Content .CSSValue input { font:11px ArArial, Helvetica, sans-serif; color:#333; 3px 0 0 -3px; }
+#Firebug .Right .HTML .Content .CSSItem center { color:rgb(0,150,0); padding:0 0 3px 0; font:bold 12px Arial, Helvetica, sans-serif; }
+#Firebug .ButtonContainer .HTML { display:none; }
+
+/*
+ * CSS
+ */
+
+#Firebug .Left .CSS { display:none; padding:5px; height:225px; overflow:scroll; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+#Firebug .Right .CSS { display:none; }
+#Firebug .Left .CSS .Selector { margin-top:10px }
+#Firebug .Left .CSS .CSSText { padding-left:20px; }
+#Firebug .Left .CSS .CSSProperty { color:#005500; margin-top:10px; }
+#Firebug .Left .CSS .CSSValue { padding-left:5px; color:#000088; }
+#Firebug .ButtonContainer .CSS { display:none; }
+
+#Firebug .Right .CSS { background:#eee; }
+#Firebug .Right .CSS .Input { width:100%; _width:98%; height:205px; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; background:#fff; border:0; border-bottom:1px solid #ccc; margin-bottom:2px; *overflow:scroll; }
+#Firebug .Right .CSS .Button { cursor:pointer; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:1px 4px 1px 4px; margin:0 4px 0 4px; background:#eee; border:1px solid #eee; text-decoration:none; *display:block; *width:auto; *float:left; *margin-top:-1px; }
+#Firebug .Right .CSS .Button:hover { border:1px outset #ccc; background:#fff; }
+#Firebug .Right .CSS .Button:active { border:1px inset #ccc; background:#ccc; }
+
+/*
+ * Scripts
+ */
+
+#Firebug .Left .Scripts { display:none; height:225px; *height:235px; overflow:scroll; font:12px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+#Firebug .Left .Scripts .LineNumber { float:left; width:30px; height:20px; padding:0 2px 0 0; background:#eee; color:#666; font-family:Courier; text-align:right; border-right:1px solid #ccc; }
+#Firebug .Left .Scripts .CodeContainer { padding:5px; }
+#Firebug .Left .Scripts .Code { height:20px; }
+#Firebug .Left .Scripts .CodeContainer, #Firebug .Left .Scripts .Code { word-wrap:normal; white-space:pre; }
+#Firebug .Right .Scripts { display:none; }
+#Firebug .ButtonContainer .Scripts { display:none; }
+
+/*
+ * DOM
+ */
+
+#Firebug .Left .DOM { display:none; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:5px; overflow:scroll; height:225px; }
+#Firebug .Left .DOM .Object { font-weight:bold; }
+#Firebug .Right .DOM { display:none; overflow:scroll; }
+#Firebug .ButtonContainer .DOM { display:none; }
+#Firebug .ButtonContainer .DOM label { font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+
+/*
+ * XHR
+ */
+
+#Firebug .Left .XHR { display:none; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:5px; overflow:scroll; height:225px; }
+#Firebug .Left .XHR .Block { float:left; width:30%; }
+#Firebug .Left .XHR .BlockContent { padding:3px; border-right:1px dotted #aaa; }
+#Firebug .Left .XHR .Block strong { display:block; text-align:center; padding:3px; background:rgb(200,225,255); color:rgb(50,50,50); }
+#Firebug .Left .XHR .Block span { display:block; text-align:center; overflow:hidden; }
+#Firebug .Left .XHR .Block span a { cursor:pointer; color:rgb(0,0,200); }
+#Firebug .Right .XHR { display:none; overflow:scroll; }
+#Firebug .ButtonContainer .XHR { display:none; }
+#Firebug .ButtonContainer .XHR label { font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+
+#Firebug .Left .STR { display:none; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; padding:5px; overflow:scroll; height:225px; }
+
+/*
+ * settings
+ */
+#Firebug .SettingsDiv {position:absolute;width:190px;top:60px;border:1px outset #000;-x-system-font:none;color:#000;font-family:"MS Sans Serif",Geneva,sans-serif;font-size:12px;font-size-adjust:none;font-stretch:normal;font-style:normal;font-variant:normal;font-weight:normal;line-height:normal;display:none;background-color:#FFF;}
+#Firebug .SettingsDiv .Header {background:#CCC url(firebug.gif) repeat scroll 0 -85px;height:30px;border-bottom:1px inset #000;}
+#Firebug .SettingsDiv .Header .Title {padding-top:10px;text-align:center;}
+#Firebug .SettingsDiv .Content {padding:5px;}
+#Firebug .SettingsDiv .Content .SettingsCBX{position:relative;top:2px;margin: 4px 5px 0 0; border:0 !important; padding:0 !important; height: 15px !important;}
+#Firebug .SettingsDiv .Content .ButtonsLeft {float:left;padding:10px 0px 5px 0px;}
+#Firebug .SettingsDiv .Content .ButtonsRight {float:right;padding:10px 0px 5px 0px;}
+#Firebug .SettingsDiv .Content .ProgressDiv {background-color:#FFF;width:100%;height:100%;position:absolute;left:0;top:0;z-index:1;opacity:.8;filter:alpha(opacity=80);display:none;}
+#Firebug .SettingsDiv .Content .Progress {background-image:url(progress.gif);width:66px;height:66px;position:absolute;top:50%;left:50%;margin-left:-33px;margin-top:-33px;}
+
+/*
+ * element highlighting
+ */
+#Firebug .Italic { font-style:italic; }
+#Firebug .Strong { font-weight:bold; }
+#Firebug .NormalWeight { font-weight:normal; }
+#Firebug .Green { color:#008800; }
+#Firebug .Gray { color:#666; }
+#Firebug .Blue { color:#0000ee; }
+#Firebug .DarkBlue { color:#000099; }
+#Firebug .Red { color:#ee0000; }
+#Firebug .Maroon { color:#800000; font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; }
+#Firebug .Null { font:11px Verdana, Geneva, Arial, Helvetica, sans-serif; color:#fff; padding:0 2px 0 2px; background:#999; border:1px solid #666; }
+#Firebug .ObjectLink, #Firebug .ObjectLinkHover { cursor:pointer; }
+#Firebug .ObjectLinkHover { border-bottom:1px solid #008800; }
+
+#Firebug .Clear { clear:both; height:0px; font-size:0px; }
+
#firebugIconDiv {width:38px;height:38px;right:15pt;bottom:5pt;border:2px solid #000;display:none;position:fixed;background-image:url(firebug_logo.png);text-decoration:underline;cursor:pointer;filter:alpha(opacity:60);opacity:.6;z-index:99999998;}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.js b/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.js
old mode 100755
new mode 100644
index 8ce693588..211b6ebc2
--- a/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.js
+++ b/shrine-webclient/src/main/html/js-ext/firebug/firebug-lite.js
@@ -1,2518 +1,2518 @@
-var firebug = {
- version:[1.23,20090309],
- el:{},
- env:{
- "cache":{},
- "extConsole":null,
- "css":"http://getfirebug.com/releases/lite/1.2/firebug-lite.css",
- "debug":true,
- "detectFirebug":false,
- "dIndex":"console",
- "height":295,
- "hideDOMFunctions":false,
- "init":false,
- "isPopup":false,
- "liteFilename":"firebug-lite.js",
- "minimized":false,
- "openInPopup": false,
- "override":false,
- "ml":false,
- "popupWin":null,
- "showIconWhenHidden":true,
- "targetWindow":undefined,
- "popupTop":1,
- "popupLeft":1,
- "popupWidth":undefined,
- "popupHeight":undefined
- },
- initConsole:function(){
- /*
- * initialize the console - user defined values are not available within this method because FBLite is not yet initialized
- */
- var command;
- try{
- if((!window.console || (window.console && !window.console.firebug)) || (firebug.env.override && !(/Firefox\/3/i.test(navigator.userAgent)))){
- window.console = { "provider":"Firebug Lite" };
-
- for(command in firebug.d.console.cmd){
- window.console[command] = firebug.lib.util.Curry(firebug.d.console.run,window,command);
- };
- }
- window.onerror = function(_message,_file,_line){
- firebug.d.console.run('error',firebug.lib.util.String.format('{0} ({1},{2})',_message,firebug.getFileName(_file),_line));
- };
- } catch(e){}
- },
- overrideConsole:function(){
- with (firebug){
- env.override=true;
- try{
- env.extConsole=window.console;
- } catch(e){}
- initConsole();
- }
- },
- restoreConsole:function(){
- with(firebug){
- if(env.extConsole){
- env.override=false;
- try{
- window.console=env.extConsole;
- } catch(e){}
- env.extConsole=null;
- }
- }
- },
- init:function(_css){
- var iconTitle = "Click here or press F12, (CTRL|CMD)+SHIFT+L or SHIFT+ENTER to show Firebug Lite. CTRL|CMD click this icon to hide it.";
-
- with(firebug){
- if(document.getElementsByTagName('html')[0].attributes.getNamedItem('debug')){
- env.debug = document.getElementsByTagName('html')[0].attributes.getNamedItem('debug').nodeValue !== "false";
- }
-
- if(env.isPopup) {
- env.openInPopup = false;
- env.targetWindow = window.opener;
- env.popupWidth = window.opener.firebug.env.popupWidth || window.opener.firebug.lib.util.GetViewport().width;
- env.popupHeight = window.opener.firebug.env.popupHeight || window.opener.firebug.lib.util.GetViewport().height;
- } else {
- env.targetWindow = window;
- env.popupWidth = env.popupWidth || lib.util.GetViewport().width;
- env.popupHeight = env.popupHeight || lib.util.GetViewport().height;
- }
-
- settings.readCookie();
-
- if(env.init || (env.detectFirebug && window.console && window.console.firebug)) {
- return;
- }
-
- document.getElementsByTagName("head")[0].appendChild(
- new lib.element("link").attribute.set("rel","stylesheet").attribute.set("type","text/css").attribute.set("href",env.css).element
- );
-
- if(env.override){
- overrideConsole();
- }
-
- /*
- * Firebug Icon
- */
- el.firebugIcon = new lib.element("div").attribute.set("id","firebugIconDiv").attribute.set("title",iconTitle).attribute.set("alt",iconTitle).event.addListener("mousedown",win.iconClicked).insert(document.body);
-
- /*
- * main interface
- */
- el.content = {};
- el.mainiframe = new lib.element("IFRAME").attribute.set("id","FirebugIFrame").environment.addStyle({ "display":"none", "width":lib.util.GetViewport().width+"px" }).insert(document.body);
- el.main = new lib.element("DIV").attribute.set("id","Firebug").environment.addStyle({ "display":"none", "width":lib.util.GetViewport().width+"px" }).insert(document.body);
- if(!env.isPopup){
- el.resizer = new lib.element("DIV").attribute.addClass("Resizer").event.addListener("mousedown",win.resizer.start).insert(el.main);
- }
- el.header = new lib.element("DIV").attribute.addClass("Header").insert(el.main);
- el.left = {};
- el.left.container = new lib.element("DIV").attribute.addClass("Left").insert(el.main);
- el.right = {};
- el.right.container = new lib.element("DIV").attribute.addClass("Right").insert(el.main);
- el.main.child.add(new lib.element("DIV").attribute.addClass('Clear'));
-
- /*
- * buttons
- */
- el.button = {};
- el.button.container = new lib.element("DIV").attribute.addClass("ButtonContainer").insert(el.header);
- el.button.logo = new lib.element("A").attribute.set("title","Firebug Lite").attribute.set("target","_blank").attribute.set("href","http://getfirebug.com/lite.html").update("&nbsp;").attribute.addClass("Button Logo").insert(el.button.container);
- el.button.inspect = new lib.element("A").attribute.addClass("Button").event.addListener("click",env.targetWindow.firebug.d.inspector.toggle).update("Inspect").insert(el.button.container);
- el.button.dock = new lib.element("A").attribute.addClass("Button Dock").event.addListener("click", win.dock).insert(el.button.container);
- el.button.newWindow = new lib.element("A").attribute.addClass("Button NewWindow").event.addListener("click", win.newWindow).insert(el.button.container);
-
- if(!env.isPopup){
- el.button.maximize = new lib.element("A").attribute.addClass("Button Maximize").event.addListener("click",win.maximize).insert(el.button.container);
- el.button.minimize = new lib.element("A").attribute.addClass("Button Minimize").event.addListener("click",win.minimize).insert(el.button.container);
- el.button.close = new lib.element("A").attribute.addClass("Button Close").event.addListener("click",win.hide).insert(el.button.container);
- }
-
- if(lib.env.ie||lib.env.webkit){
- el.button.container.environment.addStyle({ "paddingTop":"12px" });
- }
-
- /*
- * navigation
- */
- el.nav = {};
- el.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.left.container);
- el.nav.console = new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.navigate,window,"console")).update("Console").insert(el.nav.container);
- el.nav.html = new lib.element("A").attribute.addClass("Tab").update("HTML").event.addListener("click",lib.util.Curry(d.navigate,window,"html")).insert(el.nav.container);
- el.nav.css = new lib.element("A").attribute.addClass("Tab").update("CSS").event.addListener("click",lib.util.Curry(d.navigate,window,"css")).insert(el.nav.container);
- if(!env.isPopup){
- el.nav.scripts = new lib.element("A").attribute.addClass("Tab").update("Script").event.addListener("click",lib.util.Curry(d.navigate,window,"scripts")).insert(el.nav.container);
- }
- el.nav.dom = new lib.element("A").attribute.addClass("Tab").update("DOM").event.addListener("click",lib.util.Curry(d.navigate,env.targetWindow,"dom")).insert(el.nav.container);
- el.nav.xhr = new lib.element("A").attribute.addClass("Tab").update("XHR").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).insert(el.nav.container);
- el.nav.optionsdiv = new lib.element("DIV").attribute.addClass("Settings").insert(el.nav.container);
- el.nav.options = new lib.element("A").attribute.addClass("Tab").update("Options&nbsp;&or;").event.addListener("click", settings.toggle).insert(el.nav.optionsdiv);
-
- /*
- * inspector
- */
- el.borderInspector = new lib.element("DIV").attribute.set("id","FirebugBorderInspector").event.addListener("click",listen.inspector).insert(document.body);
- el.bgInspector = new lib.element("DIV").attribute.set("id","FirebugBGInspector").insert(document.body);
-
- /*
- * console
- */
- el.left.console = {};
- el.left.console.container = new lib.element("DIV").attribute.addClass("Console").insert(el.left.container);
- el.left.console.mlButton = new lib.element("A").attribute.addClass("MLButton").event.addListener("click",d.console.toggleML).insert(el.left.console.container);
- el.left.console.monitor = new lib.element("DIV").insert(
- new lib.element("DIV").attribute.addClass("Monitor").insert(el.left.console.container)
- );
- el.left.console.container.child.add(
- new lib.element("DIV").attribute.addClass("InputArrow").update(">>>")
- );
- el.left.console.input = new lib.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert(
- new lib.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container)
- );
-
- el.right.console = {};
- el.right.console.container = new lib.element("DIV").attribute.addClass("Console Container").insert(el.right.container);
- el.right.console.mlButton = new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container);
- el.right.console.input = new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container);
- el.right.console.input.event.addListener("keydown",lib.util.Curry(tab,window,el.right.console.input.element));
- el.right.console.run = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container);
- el.right.console.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.console.input)).update("Clear").insert(el.right.console.container);
-
- el.button.console = {};
- el.button.console.container = new lib.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container);
- el.button.console.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",d.console.clear).update("Clear").insert(el.button.console.container);
-
- /*
- * html
- */
-
- el.left.html = {};
- el.left.html.container = new lib.element("DIV").attribute.addClass("HTML").insert(el.left.container);
-
- el.right.html = {};
- el.right.html.container = new lib.element("DIV").attribute.addClass("HTML Container").insert(el.right.container);
-
- el.right.html.nav = {};
- el.right.html.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.right.html.container);
- el.right.html.nav.computedStyle = new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container);
- el.right.html.nav.dom = new lib.element("A").attribute.addClass("Tab").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"dom")).update("DOM").insert(el.right.html.nav.container);
-
- el.right.html.content = new lib.element("DIV").attribute.addClass("Content").insert(el.right.html.container);
-
- el.button.html = {};
- el.button.html.container = new lib.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container);
-
- /*
- * css
- */
-
- el.left.css = {};
- el.left.css.container = new lib.element("DIV").attribute.addClass("CSS").insert(el.left.container);
-
- el.right.css = {};
- el.right.css.container = new lib.element("DIV").attribute.addClass("CSS Container").insert(el.right.container);
-
- el.right.css.nav = {};
- el.right.css.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.right.css.container);
- el.right.css.nav.runCSS = new lib.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container);
-
- el.right.css.mlButton = new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container);
- el.right.css.input = new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container);
- el.right.css.input.event.addListener("keydown",lib.util.Curry(firebug.tab,window,el.right.css.input.element));
- el.right.css.run = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container);
- el.right.css.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.css.input)).update("Clear").insert(el.right.css.container);
-
- el.button.css = {};
- el.button.css.container = new lib.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container);
- el.button.css.selectbox = new lib.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container);
-
- /*
- * scripts
- */
-
- el.left.scripts = {};
- el.left.scripts.container = new lib.element("DIV").attribute.addClass("Scripts").insert(el.left.container);
-
- el.right.scripts = {};
- el.right.scripts.container = new lib.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container);
-
- el.button.scripts = {};
- el.button.scripts.container = new lib.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container);
- el.button.scripts.selectbox = new lib.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container);
- el.button.scripts.lineNumbers = new lib.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container);
-
- /*
- * dom
- */
-
- el.left.dom = {};
- el.left.dom.container = new lib.element("DIV").attribute.addClass("DOM").insert(el.left.container);
-
- el.right.dom = {};
- el.right.dom.container = new lib.element("DIV").attribute.addClass("DOM Container").insert(el.right.container);
-
- el.button.dom = {};
- el.button.dom.container = new lib.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container);
- el.button.dom.label = new lib.element("LABEL").update("Object Path:").insert(el.button.dom.container);
- el.button.dom.textbox = new lib.element("INPUT").event.addListener("keydown",listen.domTextbox).update(env.isPopup?"window.opener":"window").insert(el.button.dom.container);
-
- /*
- * str
- */
- el.left.str = {};
- el.left.str.container = new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);
-
- el.right.str = {};
- el.right.str.container = new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);
-
- el.button.str = {};
- el.button.str.container = new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);
- el.button.str.watch = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).update("Back").insert(el.button.str.container);
-
- /*
- * xhr
- */
- el.left.xhr = {};
- el.left.xhr.container = new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);
-
- el.right.xhr = {};
- el.right.xhr.container = new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);
-
-
- el.button.xhr = {};
- el.button.xhr.container = new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);
- el.button.xhr.label = new lib.element("LABEL").update("XHR Path:").insert(el.button.xhr.container);
- el.button.xhr.textbox = new lib.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container);
- el.button.xhr.watch = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container);
-
- /*
- * settings
- */
- el.settings = {};
- el.settings.container = new lib.element("DIV").child.add(
- new lib.element("DIV").attribute.addClass("Header").child.add(
- new lib.element().attribute.addClass("Title").update('Firebug Lite Settings')
- )
- ).attribute.addClass("SettingsDiv").insert(el.main);
- el.settings.content = new lib.element("DIV").attribute.addClass("Content").insert(el.settings.container);
- el.settings.progressDiv = new lib.element("DIV").attribute.addClass("ProgressDiv").insert(el.settings.content);
- el.settings.progress = new lib.element("DIV").attribute.addClass("Progress").insert(el.settings.progressDiv);
- el.settings.cbxDebug = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
- el.settings.content.child.add(document.createTextNode("Start visible"));
- new lib.element("BR").insert(el.settings.content);
- el.settings.cbxDetectFirebug = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
- el.settings.content.child.add(document.createTextNode("Hide when Firebug active"));
- new lib.element("BR").insert(el.settings.content);
- el.settings.cbxHideDOMFunctions = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
- el.settings.content.child.add(document.createTextNode("Hide DOM functions"));
- new lib.element("BR").insert(el.settings.content);
- el.settings.cbxOverride = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
- el.settings.content.child.add(document.createTextNode("Override window.console"));
- new lib.element("BR").insert(el.settings.content);
- el.settings.cbxShowIcon = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
- el.settings.content.child.add(document.createTextNode("Show icon when hidden"));
- new lib.element("BR").insert(el.settings.content);
- el.settings.cbxOpenInPopup = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
- el.settings.content.child.add(document.createTextNode("Open in popup"));
- el.settings.buttonDiv = new lib.element("DIV").insert(el.settings.content);
- el.settings.buttonLeftDiv = new lib.element("DIV").attribute.addClass("ButtonsLeft").insert(el.settings.buttonDiv);
- el.settings.resetButton = new lib.element("INPUT").attribute.set("type","button").update("Reset").event.addListener("click",settings.reset).insert(el.settings.buttonLeftDiv);
- el.settings.buttonRightDiv = new lib.element("DIV").attribute.addClass("ButtonsRight").insert(el.settings.buttonDiv);
- el.settings.cancelButton = new lib.element("INPUT").attribute.set("type","button").update("Cancel").event.addListener("click",settings.hide).insert(el.settings.buttonRightDiv);
- el.settings.buttonRightDiv.child.add(document.createTextNode(" "));
- el.settings.saveButton = new lib.element("INPUT").attribute.set("type","button").update("Save").event.addListener("click",settings.saveClicked).insert(el.settings.buttonRightDiv);
-
- lib.util.AddEvent(document,"mousemove",listen.mouse)("mousemove",win.resizer.resize)("mouseup",win.resizer.stop)("keydown",listen.keyboard);
-
- env.init = true;
-
- for(var i=0, len=d.console.cache.length; i<len; i++){
- var item = d.console.cache[i];
- d.console.cmd[item.command].apply(window,item.arg);
- };
-
- if(lib.env.ie6){
- window.onscroll = lib.util.Curry(win.setVerticalPosition,window,null);
- var buttons = [
- el.button.inspect,
- el.button.close,
- el.button.inspect,
- el.button.console.clear,
- el.right.console.run,
- el.right.console.clear,
- el.right.css.run,
- el.right.css.clear
- ];
- for(var i=0, len=buttons.length; i<len; i++)
- buttons[i].attribute.set("href","#");
- win.refreshSize();
- }
-
- if(env.showIconWhenHidden) {
- if(!env.popupWin) {
- el.firebugIcon.environment.addStyle({ "display": env.debug&&'none'||'block' });
- }
- }
-
- lib.util.AddEvent(window, "unload", win.unload);
-
- if (env.isPopup) {
- env.height=lib.util.GetViewport().height;
- lib.util.AddEvent(window, "resize", win.fitToPopup);
- win.fitToPopup();
- } else {
- lib.util.AddEvent(window, "resize", win.refreshSize);
- }
-
- win.setHeight(env.height);
-
- if(env.openInPopup&&!env.isPopup) {
- win.newWindow();
- } else {
- el.main.environment.addStyle({ "display":env.debug&&'block'||'none' });
- el.mainiframe.environment.addStyle({ "display":env.debug&&'block'||'none' });
- }
- }
- },
- inspect:function(){
- return firebug.d.html.inspect.apply(window,arguments);
- },
- watchXHR:function(){
- with(firebug){
- d.xhr.addObject.apply(window,arguments);
- if(env.dIndex!="xhr"){
- d.navigate("xhr");
- }
- }
- },
- settings:{
- isVisible:false,
- show: function() {
- with(firebug){
- var posXY=lib.util.Element.getPosition(firebug.el.nav.options.element);
- settings.refreshForm();
-
- el.settings.container.environment.addStyle({
- "display": "block",
- "left": (posXY.offsetLeft-125)+"px"
- });
- el.settings.progressDiv.environment.addStyle({
- "display": "none"
- });
- firebug.settings.isVisible = true;
- }
- },
- hide: function() {
- with(firebug){
- firebug.el.settings.container.environment.addStyle({
- "display": "none"
- });
- firebug.settings.isVisible = false;
- }
- },
- toggle: function(){
- with(firebug){
- settings[!settings.isVisible && 'show' || 'hide']();
- }
- },
- saveClicked: function() {
- firebug.el.settings.progressDiv.environment.addStyle({
- "display": "block"
- });
- setTimeout(firebug.settings.formToSettings,0);
- },
- formToSettings: function() {
- var fe=firebug.env,
- ofe,
- elSet=firebug.el.settings,
- exdate;
-
- fe.debug=elSet.cbxDebug.element.checked;
- fe.detectFirebug=elSet.cbxDetectFirebug.element.checked;
- fe.hideDOMFunctions=elSet.cbxHideDOMFunctions.element.checked;
- fe.override=elSet.cbxOverride.element.checked;
- fe.showIconWhenHidden=elSet.cbxShowIcon.element.checked;
- fe.openInPopup=elSet.cbxOpenInPopup.element.checked;
-
- if(fe.isPopup) {
- ofe=window.opener.firebug.env;
- ofe.debug=fe.debug;
- ofe.detectFirebug=fe.detectFirebug;
- ofe.hideDOMFunctions=fe.hideDOMFunctions;
- ofe.override=fe.override;
- ofe.showIconWhenHidden=fe.showIconWhenHidden;
- ofe.openInPopup=fe.openInPopup;
- ofe.popupTop=fe.popupTop;
- ofe.popupLeft=fe.popupLeft;
- ofe.popupWidth=fe.popupWidth;
- ofe.popupHeight=fe.popupHeight;
- }
-
- with(firebug) {
- settings.writeCookie();
- settings.hide();
- win.refreshDOM();
- }
- },
- reset: function() {
- var exdate=new Date();
-
- exdate.setTime(exdate.getTime()-1);
- document.cookie='FBLiteSettings=;expires='+exdate.toGMTString();
- location.reload(true);
- },
- readCookie: function() {
- var i,cookieArr,valueArr,item,value;
-
- with(firebug.env){
- if(targetWindow.document.cookie.length>0) {
- cookieArr=targetWindow.document.cookie.split('; ');
-
- for(i=0;i<cookieArr.length;i++) {
- if(cookieArr[i].split('=')[0]=='FBLiteSettings') {
- valueArr=cookieArr[i].split('=')[1].split(',');
- }
- }
-
- if(valueArr) {
- for(i=0;i<valueArr.length;i++) {
- item=valueArr[i].split(':')[0];
- value=valueArr[i].split(':')[1];
-
- switch(item) {
- case 'debug':
- debug=value=="true";
- break;
- case 'detectFirebug':
- detectFirebug=value=="true";
- break;
- case 'hideDOMFunctions':
- hideDOMFunctions=value=="true";
- break;
- case 'override':
- override=value=="true";
- break;
- case 'showIconWhenHidden':
- showIconWhenHidden=value=="true";
- break;
- case 'openInPopup':
- openInPopup=value=="true";
- break;
- case 'popupTop':
- popupTop=parseInt(value,10);
- break;
- case 'popupLeft':
- popupLeft=parseInt(value,10);
- break;
- case 'popupWidth':
- popupWidth=parseInt(value,10);
- break;
- case 'popupHeight':
- popupHeight=parseInt(value,10);
- break;
- case 'height':
- height=parseInt(value,10);
- break;
- }
- }
- }
- }
- }
- },
- writeCookie: function() {
- var values;
-
- with(firebug.env){
- values='debug:'+debug+',';
- values+='detectFirebug:'+detectFirebug+',';
- values+='hideDOMFunctions:'+hideDOMFunctions+',';
- values+='override:'+override+',';
- values+='showIconWhenHidden:'+showIconWhenHidden+',';
- values+='openInPopup:'+openInPopup+',';
-
- if(isPopup) {
- if(window.outerWidth===undefined) {
- values+='popupTop:'+(window.screenTop-56)+',';
- values+='popupLeft:'+(window.screenLeft-8)+',';
- values+='popupWidth:'+document.body.clientWidth+',';
- values+='popupHeight:'+document.body.clientHeight+',';
- } else {
- values+='popupTop:'+window.screenY+',';
- values+='popupLeft:'+window.screenX+',';
- values+='popupWidth:'+window.outerWidth+',';
- values+='popupHeight:'+window.outerHeight+',';
- }
- } else {
- values+='popupTop:'+popupTop+',';
- values+='popupLeft:'+popupLeft+',';
- values+='popupWidth:'+popupWidth+',';
- values+='popupHeight:'+popupHeight+',';
- }
-
- values+='height:'+(parseInt(targetWindow.firebug.el.main.element.style.height.replace(/px/,''),10)-38);
-
- exdate=new Date();
- exdate.setDate(exdate.getDate()+365);
- targetWindow.document.cookie='FBLiteSettings='+values+';expires='+exdate.toGMTString();
- }
- },
- refreshForm: function() {
- var fe=firebug.env,
- elSet=firebug.el.settings;
-
- elSet.cbxDebug.element.checked=fe.debug;
- elSet.cbxDetectFirebug.element.checked=fe.detectFirebug;
- elSet.cbxHideDOMFunctions.element.checked=fe.hideDOMFunctions;
- elSet.cbxOverride.element.checked=fe.override;
- elSet.cbxShowIcon.element.checked=fe.showIconWhenHidden;
- elSet.cbxOpenInPopup.element.checked=fe.openInPopup;
- }
- },
- win:{
- hide:function(){
- with(firebug){
- el.main.environment.addStyle({
- "display": "none"
- });
- el.mainiframe.environment.addStyle({
- "display": "none"
- });
- if(env.showIconWhenHidden) {
- el.firebugIcon.environment.addStyle({
- "display": "block"
- });
- }
- }
- },
- show:function(){
- with(firebug){
- el.main.environment.addStyle({
- "display": "block"
- });
- el.mainiframe.environment.addStyle({
- "display": "block"
- });
- if(env.showIconWhenHidden) {
- el.firebugIcon.environment.addStyle({
- "display": "none"
- });
- }
- }
- },
- iconClicked:function(_event) {
- with(firebug) {
- if(_event.ctrlKey==true||_event.metaKey==true) {
- el.firebugIcon.environment.addStyle({ "display": "none" });
- env.showIconWhenHidden=false;
- } else {
- win.show();
- }
- }
- },
- minimize:function(){
- with(firebug){
- env.minimized=true;
- el.main.environment.addStyle({ "height":"35px" });
- el.mainiframe.environment.addStyle({ "height":"35px" });
- el.button.maximize.environment.addStyle({ "display":"block" });
- el.button.minimize.environment.addStyle({ "display":"none" });
- win.refreshSize();
- }
- },
- maximize:function(){
- with(firebug){
- env.minimized=false;
- el.button.minimize.environment.addStyle({ "display":"block" });
- el.button.maximize.environment.addStyle({ "display":"none" });
- win.setHeight(env.height);
- }
- },
- newWindow: function() {
- var interval,scripts,script,scriptPath,
- fe=firebug.env;
-
- if (!fe.popupWin) {
- scripts = document.getElementsByTagName('script');
-
- fe.popupWin = window.open("", "_firebug",
- "status=0,menubar=0,resizable=1,top="+fe.popupTop+",left="+fe.popupLeft+",width=" + fe.popupWidth +
- ",height=" + fe.popupHeight + ",scrollbars=0,addressbar=0,outerWidth="+fe.popupWidth+",outerHeight="+fe.popupHeight+
- "toolbar=0,location=0,directories=0,dialog=0");
-
- if(!fe.popupWin) {
- alert("Firebug Lite could not open a pop-up window, most likely because of a popup blocker.\nPlease enable popups for this domain");
- } else {
- firebug.settings.hide();
-
- for (i=0,len=scripts.length; i<len; i++) {
- if (scripts[i].src.indexOf(fe.liteFilename) > -1) {
- scriptPath = scripts[i].src;
- break;
- }
- }
-
- if (scriptPath) {
- script = fe.popupWin.document.createElement('script'), done = false;
- script.type = 'text/javascript';
- script.src = scriptPath;
-
- script[firebug.lib.env.ie?"onreadystatechange":"onload"] = function(){
- if(!done && (!firebug.lib.env.ie || this.readyState == "complete" || this.readyState=="loaded")){
- done = true;
- if(fe.popupWin.firebug) {
- with(fe.popupWin.firebug) {
- env.isPopup = true;
- env.css = fe.css;
- init();
- el.button.dock.environment.addStyle({ "display": "block"});
- el.button.newWindow.environment.addStyle({ "display": "none"});
- }
- }
- }
- };
-
- if (!done && firebug.lib.env.webkit) {
- fe.popupWin.document.write('<html><head></head><body></body></html>');
- interval = setInterval(function() {
- if (fe.popupWin.firebug) {
- clearInterval(interval);
- done = true;
- with(fe.popupWin.firebug) {
- env.isPopup = true;
- env.css = fe.css;
- init();
- el.button.dock.environment.addStyle({ "display": "block"});
- el.button.newWindow.environment.addStyle({ "display": "none"});
- }
- }
- }, 10);
- };
-
- if (!done) {
- fe.popupWin.document.getElementsByTagName('head')[0].appendChild(script);
- firebug.el.main.environment.addStyle({"display": "none"});
- firebug.el.mainiframe.environment.addStyle({"display": "none"});
- }
- } else {
- alert("Unable to detect the following script \"" + fe.liteFilename +
- "\" ... if the script has been renamed then please set the value of firebug.env.liteFilename to reflect this change");
- fe.popupWin.close();
- fe.popupWin=null;
- }
- }
- }
- },
- dock: function() {
- with(opener.firebug) {
- env.popupWin = null;
- el.main.environment.addStyle({
- "display": "block"
- });
- el.mainiframe.environment.addStyle({
- "display": "block"
- });
- settings.readCookie();
- window.close();
- };
- },
- unload: function() {
- with(firebug){
- if(env.isPopup) {
- win.dock();
- } else if(env.popupWin) {
- env.popupWin.close();
- }
- }
- },
- fitToPopup: function() {
- with(firebug) {
- var viewport = lib.util.GetViewport(window);
- win.setHeight((window.innerHeight||viewport.height) - 38);
- el.main.environment.addStyle({
- "width": (viewport.width) + "px"
- });
- el.mainiframe.environment.addStyle({
- "width": (viewport.width) + "px"
- });
- }
- },
- resizer:{
- y:[], enabled:false,
- start:function(_event){
- with(firebug){
- if(env.minimized)return;
- win.resizer.y=[el.main.element.offsetHeight,_event.clientY];
- if(lib.env.ie6){
- win.resizer.y[3]=parseInt(el.main.environment.getPosition().top);
- }
- win.resizer.enabled=true;
- }
- },
- resize:function(_event){
- with(firebug){
- if(!win.resizer.enabled)return;
- win.resizer.y[2]=(win.resizer.y[0]+(win.resizer.y[1]-_event.clientY));
- el.main.environment.addStyle({ "height":win.resizer.y[2]+"px" });
- el.mainiframe.environment.addStyle({ "height":win.resizer.y[2]+"px" });
- if(lib.env.ie6){
- el.main.environment.addStyle({ "top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px" });
- el.mainiframe.environment.addStyle({ "top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px" });
- }
- }
- },
- stop:function(_event){
- with(firebug){
- if(win.resizer.enabled){
- win.resizer.enabled=false;
- win.setHeight(win.resizer.y[2]-35);
- }
- }
- }
- },
- setHeight:function(_height){
- with(firebug){
- env.height=_height;
-
- el.left.container.environment.addStyle({ "height":_height+"px" });
- el.right.container.environment.addStyle({ "height":_height+"px" });
- el.main.environment.addStyle({ "height":_height+38+"px" });
- el.mainiframe.environment.addStyle({ "height":_height+38+"px" });
-
- win.refreshSize();
-
- // console
- el.left.console.monitor.element.parentNode.style.height=_height-47+"px";
- el.left.console.mlButton.environment.addStyle({ "top":_height+19+"px" });
- el.right.console.mlButton.environment.addStyle({ "top":_height+19+"px" });
- el.right.console.input.environment.addStyle({ "height":_height-29+"px" });
-
- // html
- el.left.html.container.environment.addStyle({"height":_height-23+"px"});
- el.right.html.content.environment.addStyle({"height":_height-23+"px"});
-
- // css
- el.left.css.container.environment.addStyle({"height":_height-33+"px"});
- el.right.css.input.environment.addStyle({ "height":_height-55+"px" });
-
- // script
- el.left.scripts.container.environment.addStyle({"height":_height-23+"px"});
-
- // dom
- el.left.dom.container.environment.addStyle({"height":_height-31+"px"});
-
- // xhr
- el.left.xhr.container.environment.addStyle({"height":_height-32+"px"});
-
- // string
- el.left.str.container.environment.addStyle({"height":_height-32+"px"});
- }
- },
- refreshDOM:function(){
- with(firebug){
- d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);
- if(d.html.nIndex=="dom"){
- firebug.d.html.navigate("dom")
- }
- }
- },
- refreshSize:function(){
- with(firebug){
- if(!env.init)
- return;
-
- var dim = lib.util.GetViewport();
- el.main.environment.addStyle({ "width":dim.width+"px"});
- el.mainiframe.environment.addStyle({ "width":dim.width+"px"});
- if(lib.env.ie6)
- win.setVerticalPosition(dim);
- }
- },
- setVerticalPosition:function(_dim,_event){
- with(firebug){
- var dim = _dim||lib.util.GetViewport();
- el.main.environment.addStyle({ "top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px" });
- el.mainiframe.environment.addStyle({ "top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px" });
- }
- }
- },
- d: {
- clean:function(_element){
- with(firebug){
- _element.update("");
- }
- },
- console:{
- addLine:function(){
- with (firebug) {
- return new lib.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor);
- }
- },
- cache:[],
- clear:function(){
- with(firebug){
- d.clean(el.left.console.monitor);
- d.console.cache = [];
- }
- },
- formatArgs:function(){
- with(firebug){
- var content = [];
- for(var i=0, len=arguments.length; i<len; i++){
- content.push( d.highlight(arguments[i],false,false,true) );
- }
- return content.join(" ");
- }
- },
- history:[], historyIndex:0,
- openObject:function(_index){
- with (firebug) {
- d.dom.open(d.console.cache[_index], el.left.dom.container, lib.env.ie);
- d.navigate("dom");
- }
- },
- print: function(_cmd,_text){
- with (firebug){
- d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);
- d.console.addLine().update(d.highlight(_text,false,false,true));
- d.console.scroll();
- }
- },
- printException: function(_exception){
- with(firebug){
- var message = _exception.description||_exception.message||_exception;
- if(_exception.fileName){
- message+=' ('+(_exception.name&&(_exception.name+', ')||'')+getFileName(_exception.fileName)+', '+_exception.lineNumber+')';
- }
- d.console.addLine().attribute.addClass("Error").update("<strong>Error: </strong>"+message,true);
- }
- },
- eval:function(_cmd){
- var result;
- with(firebug){
- if(_cmd.length==0)
- return;
-
- el.left.console.input.environment.getElement().value = "";
- d.console.historyIndex = d.console.history.push(_cmd);
-
- try {
- if(_cmd==='console.firebug') {
- d.console.addLine().attribute.addClass("Arrow").update(firebug.version);
- } else {
- result = eval.call(window,_cmd);
- d.console.print(_cmd,result);
- }
- } catch(e){
- d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);
- d.console.printException(e);
- }
- d.console.scroll();
- }
- },
- scroll:function(){
- with(firebug){
- el.left.console.monitor.environment.getElement().parentNode.scrollTop = Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-(el.left.console.monitor.element.parentNode.offsetHeight-11));
- }
- },
- run:function(_command){
- with(firebug){
- if(!env.init){
- d.console.cache.push({ "command":_command, "arg":Array.prototype.slice.call(arguments,1) });
- } else {
- d.console.cmd[_command].apply(window,Array.prototype.slice.call(arguments,1));
- }
- }
- },
- toggleML:function(){
- with(firebug){
- var open = !env.ml;
- env.ml = !env.ml;
- d.navigateRightColumn("console",open);
- el[open?"left":"right"].console.mlButton.environment.addStyle({ display:"none" });
- el[!open?"left":"right"].console.mlButton.environment.addStyle({ display:"block" });
- el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML");
- }
- },
- countMap:{}, timeMap: {},
- cmd:{
- log: function(_value){
- with(firebug){
- var args = d.console.formatArgs.apply(window,arguments);
- d.console.addLine().attribute.addClass("Log").update(args);
- d.console.scroll();
- }
- },
- warn: function(_value){
- with(firebug){
- var args = d.console.formatArgs.apply(window,arguments);
- d.console.addLine().attribute.addClass("Warn").update(args);
- d.console.scroll();
- }
- },
- info: function(_value){
- with(firebug){
- var args = d.console.formatArgs.apply(window,arguments);
- d.console.addLine().attribute.addClass("Info").update(args);
- d.console.scroll();
- }
- },
- debug: function(_value){
- with(firebug){
- var args = d.console.formatArgs.apply(window,arguments);
- d.console.addLine().attribute.addClass("Debug").update(args);
- d.console.scroll();
- }
- },
- error: function(_value){
- with(firebug){
- var args = d.console.formatArgs.apply(window,arguments);
- d.console.addLine().attribute.addClass("Error").update(args);
- d.console.scroll();
- }
- },
- trace: function(_value){
- with(firebug){
- var stackAmt = 3, f = arguments.caller, isArray = lib.util.IsArray(f); //function that called trace
-
- if((!isArray&&f)||(isArray&&f.length>0)){
- d.console.addLine().attribute.addClass("Arrow").update(">>> console.trace(stack)");
- for(var i=0;i<stackAmt;i++){
- var func = f.toString(), args = f.arguments;
- d.dom.open({"function":func, "arguments":args},d.console.addLine());
- f = f.caller;
- }
- }
- }
- },
- dir:function(_value){
- with(firebug){
- d.console.addLine().attribute.addClass("Arrow").update(">>> console.dir("+_value+")");
- d.dom.open(_value,d.console.addLine());
- }
- },
- dirxml: function(){
- with(firebug){
- d.console.cmd.log.apply(this, arguments);
- }
- },
- time: function(_name){
- with(firebug){
- d.console.timeMap[_name] = new Date().getTime();
- }
- },
- timeEnd: function(_name){
- with(firebug){
- if(_name in d.console.timeMap){
- var delta = new Date().getTime() - d.console.timeMap[_name],
- args = d.console.formatArgs.apply(window,[_name+":", delta+"ms"]);
- d.console.addLine().attribute.addClass("log").update(args);
- delete d.console.timeMap[_name];
- }
- }
- },
- count: function(_name){
- with(firebug){
- if(!d.console.countMap[_name])
- d.console.countMap[_name] = 0;
- d.console.countMap[_name]++;
- d.console.cmd.log.apply(window, [_name, d.console.countMap[_name]]);
- }
- },
- group:function(){
- with(firebug){
- d.console.cmd.log.apply(this, ["console.group is not supported"]);
- }
- },
- groupEnd:function(){
- with(firebug){
- d.console.cmd.log.apply(this, ["console.groupEnd is not supported"]);
- }
- },
- profile:function(){
- with(firebug){
- d.console.cmd.log.apply(this, ["console.profile is not supported"]);
- }
- },
- profileEnd:function(){
- with(firebug){
- d.console.cmd.log.apply(this, ["console.profileEnd is not supported"]);
- }
- }
- }
- },
- css:{
- index:-1,
- open:function(_index){
- with (firebug) {
- var item = env.targetWindow.document.styleSheets[_index],
- uri = item.href;
- try {
- var rules = item[lib.env.ie ? "rules" : "cssRules"], str = "";
- for (var i=0; i<rules.length; i++) {
- var item = rules[i];
- var selector = item.selectorText;
- var cssText = lib.env.ie?item.style.cssText:item.cssText.match(/\{(.*)\}/)[1];
- str+=d.css.printRule(selector, cssText.split(";"), el.left.css.container);
- }
- } catch(e) {
- str="<em>Access to restricted URI denied</em>";
- }
- el.left.css.container.update(str);
- }
- },
- printRule:function(_selector,_css,_layer){
- with(firebug){
- var str = "<div class='Selector'>"+_selector+" {</div>";
- for(var i=0,len=_css.length; i<len; i++){
- var item = _css[i];
- str += "<div class='CSSText'>"+item.replace(/(.+\:)(.+)/,"<span class='CSSProperty'>$1</span><span class='CSSValue'>$2;</span>")+"</div>";
- }
- str+="<div class='Selector'>}</div>";
- return str;
- }
- },
- refresh:function(){
- with(firebug){
- el.button.css.selectbox.update("");
- var collection = env.targetWindow.document.styleSheets;
- for(var i=0,len=collection.length; i<len; i++){
- var uri = getFileName(collection[i].href);
- d.css.index=d.css.index<0?i:d.css.index;
- el.button.css.selectbox.child.add(
- new lib.element("OPTION").attribute.set("value",i).update(uri)
- )
- };
- d.css.open(d.css.index);
- }
- }
- },
- dom: {
- open: function(_object,_layer){
- with (firebug) {
- _layer.clean();
- var container = new lib.element("DIV").attribute.addClass("DOMContent").insert(_layer);
- d.dom.print(_object, container);
- }
- },
- print:function(_object,_parent, _inTree){
- with (firebug) {
- var obj = _object || window, parentElement = _parent;
- parentElement.update("");
-
- if(parentElement.opened&&parentElement!=el.left.dom.container){
- parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.removeClass("Opened");
- parentElement.opened = false;
- parentElement.environment.addStyle({ "display":"none" });
- return;
- }
- if(_inTree)
- parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.addClass("Opened");
- parentElement.opened = true;
-
- for (var key in obj) {
- try {
- if (env.hideDOMFunctions && typeof(obj[key]) == "function") continue;
- var value = obj[key], property = key, container = new lib.element("DIV").attribute.addClass("DOMRow").insert(parentElement),
- left = new lib.element("DIV").attribute.addClass("DOMRowLeft").insert(container), right = new lib.element("DIV").attribute.addClass("DOMRowRight").insert(container);
-
- container.child.add(
- new lib.element("DIV").attribute.addClass('Clear')
- );
-
- var link = new lib.element("A").attribute.addClass(
- typeof value=="object"&&Boolean(value)?"Property Object":"Property"
- ).update(property).insert(left);
-
- right.update(d.highlight(value,false,true));
-
- var subContainer = new lib.element("DIV").attribute.addClass("DOMRowSubContainer").insert(container);
-
- if(typeof value!="object"||Boolean(value)==false)
- continue;
-
- link.event.addListener("click",lib.util.Curry(d.dom.print,window,value, subContainer, true));
- }catch(e){
- }
- }
- parentElement.environment.addStyle({ "display":"block" });
- }
- }
- },
- highlight:function(_value,_inObject,_inArray,_link){
- with(firebug){
- var isArray = false, isHash, isElement = false, vtype=typeof _value, result=[];
-
- if(vtype=="object"){
- if(Object.prototype.toString.call(_value) === "[object Date]"){
- vtype = "date";
- } else if(Object.prototype.toString.call(_value) === "[object String]"){
- vtype = "string";
- } else if(Object.prototype.toString.call(_value) === "[object Boolean]"){
- vtype = "boolean";
- } else if(Object.prototype.toString.call(_value) === "[object RegExp]"){
- vtype = "regexp";
- }
- }
-
- try {
- isArray = lib.util.IsArray(_value);
- isHash = lib.util.IsHash(_value);
- isElement = _value!=undefined&&Boolean(_value.nodeName)&&Boolean(_value.nodeType);
-
- // number, string, boolean, null, function
- if(_value==null||vtype=="number"||vtype=="string"||vtype=="boolean"||vtype=="function"||vtype=="regexp"||vtype=="date"){
- if(_value==null){
- result.push("<span class='Null'>null</span>");
- }else if (vtype=="regexp") {
- result.push("<span class='Maroon'>" + _value + "</span>");
- }else if (vtype=="date") {
- result.push("<span class='DarkBlue'>'" + _value + "'</span>");
- } else if (vtype=="boolean"||vtype=="number") {
- result.push("<span class='DarkBlue'>" + _value + "</span>");
- } else if(vtype=="function"){
- result.push("<span class='"+(_inObject?"Italic Gray":"Green")+"'>function()</span>");
- } else {
- result.push("<span class='Red'>\""+( !_inObject&&!_inArray?_value : _value.substring(0,35)+(_value.length>35?" ...":"") ).replace(/\n/g,"\\n").replace(/\s/g,"&nbsp;").replace(/>/g,"&#62;").replace(/</g,"&#60;")+"\"</span>");
- }
- }
- // element
- else if(isElement){
-
- if(_value.nodeType==3)
- result.push(d.highlight(_value.nodeValue));
- else if(_inObject){
- result.push("<span class='Gray Italic'>"+_value.nodeName.toLowerCase()+"</span>");
- } else {
- result.push("<span class='Blue"+ ( !_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.html.inspect(firebug.d.console.cache[" +( d.console.cache.push( _value ) -1 )+"])'" ) + "'>");
-
- if(_inArray){
- result.push(_value.nodeName.toLowerCase());
- if(_value.getAttribute){
- if(_value.getAttribute&&_value.getAttribute("id"))
- result.push("<span class='DarkBlue'>#"+_value.getAttribute("id")+"</span>");
- var elClass = _value.getAttribute(lib.env.ie&&!lib.env.ie8?"className":"class")||"";
- result.push(!elClass?"":"<span class='Red'>."+elClass.split(" ")[0]+"</span>");
- }
- result.push("</span>");
- } else {
- result.push("<span class='DarkBlue'>&#60;<span class='Blue TagName'>"+ _value.nodeName.toLowerCase());
-
- if(_value.attributes){
- for(var i=0,len=_value.attributes.length; i<len; i++){
- var item = _value.attributes[i];
-
- if(!lib.env.ie||item.nodeValue)
- result.push(" <span class='DarkBlue'>"+item.nodeName+"=\"<span class='Red'>"+item.nodeValue+"</span>\"</span>");
- }
- }
-
- result.push("</span>&#62;</span>");
- }
- }
- }
- // array, hash
- else if(isArray||isHash){
- if(isArray){
- if(_inObject){
- result.push("<span class='Gray Italic'>["+_value.length+"]</span>");
- } else {
- result.push("<span class='Strong'>[ ");
-
- for(var i=0,len=_value.length; i<len; i++){
- if((_inObject||_inArray)&&i>3){
- result.push(", <span class='Strong Gray'>"+(len-4)+" More...</span>");
- break;
- }
- result.push( (i > 0 ? ", " : "") + d.highlight(_value[i], false, true, true) );
- }
-
- result.push(" ]</span>");
- }
- } else if(_inObject){
- result.push("<span class='Gray Italic'>Object</span>");
- } else {
- result.push("<span class='Strong Green"+ ( !_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.console.openObject(" +( d.console.cache.push( _value ) -1 )+")'" ) + ">Object");
- var i=0;
- for(var key in _value){
- var value = _value[key];
- if((_inObject||_inArray)&&i>3){
- result.push(" <span class='Strong Gray'>More...</span>");
- break;
- }
- result.push(" "+key+"="+d.highlight(value,true));
- i++;
- }
- result.push("</span>");
- }
- } else {
- result.push(["<span class'Gray Italic'>"+_value+"</span>"]);
- }
- } catch(e){
- result.push("..");
- }
- return result.join("");
- }
- },
- html:{
- nIndex:"computedStyle",
- current:null,
- highlight:function(_element,_clear,_event){
- with(firebug){
- if(_element.firebugElement){
- return;
- }
- if(_clear){
- env.targetWindow.firebug.el.bgInspector.environment.addStyle({ "display":"none" });
- return;
- }
- d.inspector.inspect(_element,true);
- }
- },
- inspect:function(_element){
- var map = [],
- parentLayer,
- t,
- tagName,
- parent = _element;
- while (parent) {
- map.push(parent);
- if (parent == firebug.env.targetWindow.document.body) break;
- parent = parent.parentNode;
- }
- map = map.reverse();
- with(firebug) {
- if (env.dIndex != "html") {
- env.targetWindow.firebug.d.navigate("html");
- }
-
- env.targetWindow.firebug.d.inspector.toggle(false);
-
- for (t = 0; t < el.left.html.container.child.get().length; t++) {
- if (el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0]) {
- if (el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText) {
- tagName = el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText;
- } else {
- tagName = el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].textContent;
- }
-
- if (/<body/i.test(tagName)) {
- parentLayer = el.left.html.container.child.get()[t].childNodes[1].lib;
- break;
- }
- }
- }
-
- if (!parentLayer) {
- parentLayer = el.left.html.container.child.get()[3].childNodes[1].lib;
- }
-
- for (t = 0, len = map.length; map[t]; t++) {
- if (t == len - 1) {
- var link = parentLayer.environment.getElement().previousSibling.lib;
- link.attribute.addClass("Selected");
-
- if (d.html.current) {
- d.html.current[1].attribute.removeClass("Selected");
- }
- d.html.current = [_element, link];
- return;
- }
- parentLayer = d.html.openHtmlTree(map[t], parentLayer, map[t + 1]);
- }
- }
- },
- navigate:function(_index,_element){
- with(firebug){
- el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected");
- el.right.html.nav[_index].attribute.addClass("Selected");
- d.html.nIndex = _index;
- d.html.openProperties();
- }
- },
- openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){
- with(firebug){
- var element = _element || env.targetWindow.document.documentElement,
- parent = _parent || el.left.html.container,
- returnParentEl = _returnParentElementByElement || null,
- returnParentVal = null,
- len = element.childNodes.length,
- nodeLink;
-
- if(parent!=el.left.html.container){
- nodeLink = parent.environment.getParent().lib.child.get()[0].lib;
- if (d.html.current) {
- d.html.current[1].attribute.removeClass("Selected");
- }
- nodeLink.attribute.addClass("Selected");
-
- d.html.current = [_element,nodeLink];
- d.html.openProperties();
- };
-
- if(element.childNodes&&(len==0||(len==1&&element.childNodes[0].nodeType==3)))return;
- parent.clean();
-
- if(parent.opened&&Boolean(_returnParentElementByElement)==false){
- parent.opened = false;
- parent.element.previousSibling.lib.attribute.removeClass("Open");
- parent.element.lib.attribute.removeClass("OpenSubContainer");
- return;
- };
-
- if (parent != el.left.html.container) {
- parent.element.previousSibling.lib.attribute.addClass("Open");
- parent.element.lib.attribute.addClass("OpenSubContainer");
- parent.opened = true;
- };
-
- if(element==document.documentElement){
- new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;<span class='Blue'>html</span>&#62;").insert(parent);
- };
-
- for(var i=0; i<=len; i++){
- if(i==len){
- new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;/<span class='Blue'>"+element.nodeName.toLowerCase()+"</span>&#62;").insert(container);
- break;
- }
- var item = element.childNodes[i];
-
- if (item.nodeType != 3){
- var container = new lib.element().attribute.addClass("Block").insert(parent),
- link = new lib.element("A").attribute.addClass("Link").insert(container),
- spacer = new lib.element("SPAN").attribute.addClass("Spacer").update("&nbsp;").insert(link),
- html = new lib.element("SPAN").attribute.addClass("Content").update(d.highlight(item)).insert(link),
- subContainer = new lib.element("DIV").attribute.addClass("SubContainer").insert(container),
- view = lib.util.Element.getView(item);
-
- link.event.addListener("click", lib.util.Curry(d.html.openHtmlTree, window, item, subContainer, false));
- link.event.addListener("mouseover", lib.util.Curry(d.html.highlight, window, item, false));
- link.event.addListener("mouseout", lib.util.Curry(d.html.highlight, window, item, true));
-
- returnParentVal = returnParentEl == item ? subContainer : returnParentVal;
-
- if(d.html.current==null&&item==document.body){
- link.attribute.addClass("Selected");
- d.html.current = [item,link];
- d.html.openHtmlTree(item,subContainer);
- }
-
- if(element.nodeName!="HEAD"&&element!=document.documentElement&&(view.visibility=="hidden"||view.display=="none")){
- container.attribute.addClass("Unvisible");
- };
-
- if (item.childNodes){
- var childLen = item.childNodes.length;
- if (childLen == 1 && item.childNodes[0].nodeType == 3) {
- html.child.add(document.createTextNode(item.childNodes[0].nodeValue.substring(0, 50)));
- html.child.add(document.createTextNode("</"));
- html.child.add(new lib.element("span").attribute.addClass("Blue").update(item.nodeName.toLowerCase()).environment.getElement());
- html.child.add(document.createTextNode(">"));
- continue;
- }
- else
- if (childLen > 0) {
- link.attribute.addClass("Parent");
- }
- }
- }
- };
- return returnParentVal;
- }
- },
- openProperties:function(){
- with(firebug){
- var index = d.html.nIndex;
- var node = d.html.current[0];
- d.clean(el.right.html.content);
- var str = "";
- switch(index){
- case "computedStyle":
- var property = ["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort();
- var view = document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle;
- for(var i=0,len=property.length; i<len; i++){
- var item = property[i];
- if(!view[item])continue;
- str+="<div class='CSSItem'><div class='CSSProperty'>"+item+"</div><div class='CSSValue'>"+d.highlight(view[item])+"</div></div>";
- }
- el.right.html.content.update(str);
- break;
- case "dom":
- d.dom.open(node,el.right.html.content,lib.env.ie);
- break;
- }
- }
- }
- },
- inspector:{
- enabled:false,
- el:null,
- inspect:function(_element,_bgInspector){
- with(firebug){
- var pos = env.targetWindow.firebug.lib.util.Element.getPosition(_element);
-
- env.targetWindow.firebug.el[_bgInspector&&"bgInspector"||"borderInspector"].environment.addStyle({
- "width":_element.offsetWidth+"px", "height":_element.offsetHeight+"px",
- "top":pos.offsetTop-(_bgInspector?0:2)+"px", "left":pos.offsetLeft-(_bgInspector?0:2)+"px",
- "display":"block"
- });
-9
- if(!_bgInspector){
- d.inspector.el = _element;
- }
- };
- },
- toggle:function(_absoluteValue,_event){
- with (firebug) {
- if(_absoluteValue==d.inspector.enabled)
- return;
- d.inspector.enabled = _absoluteValue!=undefined&&!_absoluteValue.clientX?_absoluteValue:!d.inspector.enabled;
- el.button.inspect.attribute[(d.inspector.enabled ? "add" : "remove") + "Class"]("Enabled");
- if(d.inspector.enabled==false){
- el.borderInspector.environment.addStyle({ "display":"none" });
- d.inspector.el = null;
- } else if(lib.env.dIndex!="html") {
- if (env.popupWin) {
- env.popupWin.firebug.d.navigate("html");
- } else {
- d.navigate("html");
- }
- }
- }
- }
- },
- scripts:{
- index:-1,
- lineNumbers:false,
- open:function(_index){
- with(firebug){
- d.scripts.index = _index;
- el.left.scripts.container.update("");
- var script = document.getElementsByTagName("script")[_index],uri = script.src||document.location.href,source;
- try {
- if(uri!=document.location.href){
- source = env.cache[uri]||lib.xhr.get(uri).responseText;
- env.cache[uri] = source;
- } else {
- source = script.innerHTML;
- }
- source = source.replace(/<|>/g,function(_ch){
- return ({"<":"&#60;",">":"&#62;"})[_ch];
- });
-
- if(!d.scripts.lineNumbers)
- el.left.scripts.container.child.add(
- new lib.element("DIV").attribute.addClass("CodeContainer").update(source)
- );
- else {
- source = source.split("<br />");
- for (var i = 0; i < source.length; i++) {
- el.left.scripts.container.child.add(new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("LineNumber").update(i + 1), new lib.element("DIV").attribute.addClass("Code").update("&nbsp;" + source[i]), new lib.element("DIV").attribute.addClass('Clear')));
- };
- };
- } catch(e){
- el.left.scripts.container.child.add(
- new lib.element("DIV").attribute.addClass("CodeContainer").update("<em>Access to restricted URI denied</em>")
- );
- }
- }
- },
- toggleLineNumbers:function(){
- with(firebug){
- d.scripts.lineNumbers = !d.scripts.lineNumbers;
- el.button.scripts.lineNumbers.attribute[(d.scripts.lineNumbers ? "add" : "remove") + "Class"]("Enabled");
- d.scripts.open( d.scripts.index );
- }
- },
- refresh:function(){
- with(firebug){
- el.button.scripts.selectbox.clean();
- var collection = env.targetWindow.document.getElementsByTagName("script");
- for(var i=0,len=collection.length; i<len; i++){
- var item = collection[i],
- fileName = getFileName(item.src||item.baseURI||"..");
- d.scripts.index=d.scripts.index<0?i:d.scripts.index;
- el.button.scripts.selectbox.child.add(
- new lib.element("OPTION").attribute.set("value",i).update(fileName)
- );
- }
- d.scripts.open( d.scripts.index );
- }
- }
- },
- str: {
- open:function(_str){
- with(firebug){
- d.navigate("str");
- el.left.str.container.update(_str.replace(/\n/g,"<br />"))
- }
- }
- },
- xhr:{
- objects:[],
- addObject:function(){
- with(firebug){
- for(var i=0,len=arguments.length; i<len; i++){
- try {
- var item = arguments[i],
- val = env.targetWindow.eval(item);
- d.xhr.objects.push([item, val]);
- } catch(e){
- continue;
- }
- }
- }
- },
- open:function(){
- with(firebug){
- el.left.xhr.container.update("");
- el.left.xhr.name = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({ "width":"20%" }).insert(el.left.xhr.container));
- el.left.xhr.nameTitle = new lib.element("STRONG").update("Object Name:").insert(el.left.xhr.name);
- el.left.xhr.nameContent = new lib.element("DIV").insert(el.left.xhr.name);
- el.left.xhr.status = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({ "width":"10%" }).insert(el.left.xhr.container));
- el.left.xhr.statusTitle = new lib.element("STRONG").update("Status:").insert(el.left.xhr.status);
- el.left.xhr.statusContent = new lib.element("DIV").insert(el.left.xhr.status);
- el.left.xhr.readystate = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({ "width":"15%" }).attribute.addClass("Block").insert(el.left.xhr.container));
- el.left.xhr.readystateTitle =el.left.xhr.nameTitle = new lib.element("STRONG").update("Ready State:").insert(el.left.xhr.readystate);
- el.left.xhr.readystateContent = new lib.element("DIV").insert(el.left.xhr.readystate);
- el.left.xhr.response = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({ "width":(lib.env.ie?"50":"55")+"%" }).attribute.addClass("Block").insert(el.left.xhr.container));
- el.left.xhr.responseTitle = new lib.element("STRONG").update("Response:").insert(el.left.xhr.response);
- el.left.xhr.responseContent = new lib.element("DIV").insert(el.left.xhr.response);
- setTimeout(d.xhr.refresh,500);
- }
- },
- refresh:function(){
- with(firebug){
- el.left.xhr.nameContent.update("");
- el.left.xhr.statusContent.update("");
- el.left.xhr.readystateContent.update("");
- el.left.xhr.responseContent.update("");
- for(var i=0,len=d.xhr.objects.length; i<len; i++){
- var item = d.xhr.objects[i],
- response = item[1].responseText;
- if(Boolean(item[1])==false)continue;
- el.left.xhr.nameContent.child.add(new lib.element("span").update(item[0]));
- try {
- el.left.xhr.statusContent.child.add(new lib.element("span").update(item[1].status));
- } catch(e){ el.left.xhr.statusContent.child.add(new lib.element("span").update("&nbsp;")); }
- el.left.xhr.readystateContent.child.add(new lib.element("span").update(item[1].readyState));
-
- el.left.xhr.responseContent.child.add(new lib.element("span").child.add(
- new lib.element("A").event.addListener("click",lib.util.Curry(d.str.open,window,response)).update("&nbsp;"+response.substring(0,50))
- ));
- };
- if(env.dIndex=="xhr")
- setTimeout(d.xhr.refresh,500);
- }
- }
- },
- navigateRightColumn:function(_index,_open){
- with(firebug){
- el.left.container.environment.addStyle({ "width":_open?"70%":"100%" });
- el.right.container.environment.addStyle({ "display":_open?"block":"none" });
- }
- },
- navigate:function(_index){
- with(firebug){
- var open = _index, close = env.dIndex;
- env.dIndex = open;
-
- settings.hide();
-
- el.button[close].container.environment.addStyle({ "display":"none" });
- el.left[close].container.environment.addStyle({ "display":"none" });
- el.right[close].container.environment.addStyle({ "display":"none" });
-
- el.button[open].container.environment.addStyle({ "display":"inline" });
- el.left[open].container.environment.addStyle({ "display":"block" });
- el.right[open].container.environment.addStyle({ "display":"block" });
-
- if(el.nav[close])
- el.nav[close].attribute.removeClass("Selected");
- if(el.nav[open])
- el.nav[open].attribute.addClass("Selected");
-
- switch(open){
- case "console":
- d.navigateRightColumn(_index);
- break;
- case "html":
- d.navigateRightColumn(_index,true);
- if(!d.html.current){
- var t=Number(new Date);
- d.html.openHtmlTree();
- }
- break;
- case "css":
- d.navigateRightColumn(_index,true);
- d.css.refresh();
- break;
- case "scripts":
- d.navigateRightColumn(_index);
- d.scripts.refresh();
- break;
- case "dom":
- d.navigateRightColumn(_index);
- if(el.left.dom.container.environment.getElement().innerHTML==""){
- var t=Number(new Date);
- d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);
- }
- break;
- case "xhr":
- d.navigateRightColumn(_index);
- d.xhr.open();
- break;
- }
- }
- }
- },
- getFileName:function(_path){
- var match = _path&&_path.match(/[\w\-\.\?\=\&]+$/);
- return match&&match[0]||_path;
- },
- cancelEvent:function(_event){
- if(_event.stopPropagation)
- _event.stopPropagation();
- if(_event.preventDefault)
- _event.preventDefault();
- },
- getSelection:function(_el){
- with(firebug){
- if(lib.env.ie){
- var range = document.selection.createRange(),stored = range.duplicate();
- stored.moveToElementText(_el);
- stored.setEndPoint('EndToEnd', range);
- _el.selectionStart = stored.text.length - range.text.length;
- _el.selectionEnd = _el.selectionStart + range.text.length;
- }
- return {
- start:_el.selectionStart,
- length:_el.selectionEnd-_el.selectionStart
- }
- }
- },
- tab:function(_el,_event){
- with(firebug){
- if(_event.keyCode==9){
- if(_el.setSelectionRange){
- var position = firebug.getSelection(_el);
- _el.value = _el.value.substring(0,position.start) + String.fromCharCode(9) + _el.value.substring(position.start+position.length,_el.value.length);
- _el.setSelectionRange(position.start+1,position.start+1);
- } else if(document.selection) {
- var range = document.selection.createRange(), isCollapsed = range.text == '';
- range.text = String.fromCharCode(9);
- range.moveStart('character', -1);
- }
- firebug.cancelEvent(_event);
- if(lib.env.ie)
- setTimeout(_el.focus,100);
- };
- }
- },
- listen: {
- addXhrObject:function(){
- with(firebug){
- d.xhr.addObject.apply(env.targetWindow, el.button.xhr.textbox.environment.getElement().value.split(","));
- }
- },
- consoleTextbox:function(_event){
- with(firebug){
- if(_event.keyCode==13&&(env.multilinemode==false||_event.shiftKey==false)){
- d.console.historyIndex = d.console.history.length;
- d.console.eval(el.left.console.input.environment.getElement().value);
- return false;
- }
-
- switch(_event.keyCode){
- case 40:
- if(d.console.history[d.console.historyIndex+1]){
- d.console.historyIndex+=1;
- el.left.console.input.update( d.console.history[d.console.historyIndex] );
- }
- break;
- case 38:
- if(d.console.history[d.console.historyIndex-1]){
- d.console.historyIndex-=1;
- el.left.console.input.update( d.console.history[d.console.historyIndex] );
- }
- break;
- }
- }
- },
- cssSelectbox:function(){
- with(firebug){
- d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex);
- }
- },
- domTextbox:function(_event){
- with(firebug){
- if(_event.keyCode==13){
- d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);
- }
- }
- },
- inspector:function(){
- with(firebug){
- if (env.popupWin) {
- env.popupWin.firebug.d.html.inspect(firebug.d.inspector.el);
- } else {
- firebug.d.html.inspect(firebug.d.inspector.el);
- }
- }
- },
- keyboard:function(_event){
- with(firebug){
- if(_event.keyCode==27 && d.inspector.enabled){
- d.inspector.toggle();
- } else if(_event.keyCode === 123 && _event.ctrlKey || _event.metaKey) {
- if(env.isPopup){
- win.dock();
- }else {
- win.newWindow();
- }
- } else if(
- (_event.keyCode === 123 && !_event.ctrlKey && !_event.metaKey) ||
- (_event.keyCode === 76 && (_event.ctrlKey || _event.metaKey) && _event.shiftKey) ||
- (_event.keyCode === 13 && _event.shiftKey)) {
-
- if(env.isPopup){
- win.dock();
- } else if (el.main.environment.getStyle("display") === 'none') {
- win.show();
- } else {
- win.hide();
- }
- }
- }
- },
- mouse:function(_event){
- with(firebug){
- var target;
-
- if(document.elementFromPoint) {
- target = document.elementFromPoint(_event.clientX, _event.clientY);
- } else {
- if(lib.env.ie) {
- target = _event.srcElement;
- } else {
- target = _event.explicitOriginalTarget || _event.target;
- }
- }
-
- if( d.inspector.enabled&&
- target!=document.body&&
- target!=document.firstChild&&
- target!=document.childNodes[1]&&
- target!=el.borderInspector.environment.getElement()&&
- target!=el.main.environment.getElement()&&
- target.offsetParent!=el.main.environment.getElement() ) {
- d.inspector.inspect(target);
- }
- }
- },
- runMultiline:function(){
- with(firebug){
- d.console.eval.call(window,el.right.console.input.environment.getElement().value);
- }
- },
- runCSS:function(){
- with(firebug){
- var source = el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}");
- for(var i=0, len=source.length; i<len; i++){
- var item = source[i]+"}", rule = !lib.env.ie?item:item.split(/{|}/),
- styleSheet = document.styleSheets[0];
- console.log(rule);
- if(item.match(/.+\{.+\}/)){
- if(lib.env.ie)
- styleSheet.addRule(rule[0],rule[1]);
- else
- styleSheet.insertRule( rule, styleSheet.cssRules.length );
- }
- }
- }
- },
- scriptsSelectbox:function(){
- with(firebug){
- d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value));
- }
- },
- xhrTextbox:function(_event){
- with(firebug){
- if(_event.keyCode==13){
- d.xhr.addObject.apply(env.targetWindow, el.button.xhr.textbox.environment.getElement().value.split(","));
- }
- }
- }
- }
-};
-
-(function(_scope){
- _scope.lib = {};
- var pi = _scope.lib; pi.version = [1.1,2008091000];
-
- pi.env = {
- ie: /MSIE/i.test(navigator.userAgent),
- ie6: /MSIE 6/i.test(navigator.userAgent),
- ie7: /MSIE 7/i.test(navigator.userAgent),
- ie8: /MSIE 8/i.test(navigator.userAgent),
- firefox: /Firefox/i.test(navigator.userAgent),
- opera: /Opera/i.test(navigator.userAgent),
- webkit: /Webkit/i.test(navigator.userAgent),
- camino: /Camino/i.test(navigator.userAgent)
- };
-
- pi.get = function(){
- return document.getElementById(arguments[0]);
- };
- pi.get.byTag = function(){
- return document.getElementsByTagName(arguments[0]);
- };
- pi.get.byClass = function(){ return document.getElementsByClassName.apply(document,arguments); };
-
- pi.util = {
- Array:{
- clone:function(_array,_undeep){
- var tmp = [];
- Array.prototype.push.apply(tmp,_array);
- pi.util.Array.forEach(tmp,function(_item,_index,_source){
- if(_item instanceof Array&&!_undeep)
- _source[_index] = pi.util.Array.clone(_source[_index]);
- });
- return tmp;
- },
- count:function(_array,_value){
- var count = 0;
- pi.util.Array.forEach(_array,function(){
- count+=Number(arguments[0]==_value);
- });
- return count;
- },
- forEach:function(_array,_function){
- if(_array.forEach)
- return _array.forEach(_function);
- for(var i=0,len=_array.length; i<len; i++)
- _function.apply(_array,[_array[i],i,_array]);
- },
- getLatest:function(_array){
- return _array[_array.length-1];
- },
- indexOf:function(_array,_value){
- if(!pi.env.ie){
- return _array.indexOf(_value);
- };
-
- var index = -1;
- for(var i=0, len=_array.length; i<len; i++){
- if(_array[i]==_value){
- index = i;
- break;
- }
- }
- return index;
- },
- remove:function(_array,_index){
- var result = _array.slice(0,_index);
- _array = Array.prototype.push.apply(result,_array.slice(_index+1));
- return result;
- }
- },
- Curry:function(_fn,_scope){
- var fn = _fn, scope = _scope||window, args = Array.prototype.slice.call(arguments,2);
- return function(){
- return fn.apply(scope,args.concat( Array.prototype.slice.call(arguments,0) ));
- };
- },
- Extend:function(_superClass,_prototype,_skipClonning){
- var object = new pi.base;
- if(_prototype["$Init"]){
- object.init = _prototype["$Init"];
- delete _prototype["$Init"];
- };
-
- object.body = _superClass==pi.base?_prototype:pi.util.Hash.merge(_prototype,_superClass.prototype);
- object.init=object.init||function(){
- if(_superClass!=pi.base)
- _superClass.apply(this,arguments);
- };
-
- return object.build(_skipClonning);
- },
- IsArray:function(_object){
- if(_object===null){
- return false;
- }
- if(window.NodeList&&window.NamedNodeMap&&!pi.env.ie8){
- if(_object instanceof Array||_object instanceof NodeList||_object instanceof NamedNodeMap||(window.HTMLCollection&&_object instanceof HTMLCollection))
- return true;
- };
- if(!_object||_object==window||typeof _object=="function"||typeof _object=="string"||typeof _object.length!="number"){
- return false
- };
- var len = _object.length;
- if(len>0&&_object[0]!=undefined&&_object[len-1]!=undefined){
- return true;
- } else {
- for(var key in _object){
- if(key!="item"&&key!="length"&&key!="setNamedItemNS"&&key!="setNamedItem"&&key!="getNamedItem"&&key!="removeNamedItem"&&key!="getNamedItemNS"&&key!="removeNamedItemNS"&&key!="tags"){
- return false;
- }
- }
- return true
- };
- },
- IsHash:function(_object){
- return _object && typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object)
- },
- Init:[],
- AddEvent: function(_element,_eventName,_fn,_useCapture){
- _element[pi.env.ie?"attachEvent":"addEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);
- return pi.util.Curry(pi.util.AddEvent,this,_element);
- },
- RemoveEvent: function(_element,_eventName,_fn,_useCapture){
- _element[pi.env.ie?"detachEvent":"removeEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);
- return pi.util.Curry(pi.util.RemoveEvent,this,_element);
- },
- Element:{
- addClass:function(_element,_class){
- if( !pi.util.Element.hasClass(_element,_class) )
- pi.util.Element.setClass(_element, pi.util.Element.getClass(_element) + " " + _class );
- },
- getClass:function(_element){
- return _element.getAttribute(pi.env.ie&&!pi.env.ie8?"className":"class")||"";
- },
- hasClass:function(_element,_class){
- return pi.util.Array.indexOf(pi.util.Element.getClass(_element).split(" "),_class)>-1;
- },
- removeClass:function(_element,_class){
- if( pi.util.Element.hasClass(_element,_class) ){
- var names = pi.util.Element.getClass(_element,_class).split(" ");
- pi.util.Element.setClass(
- _element,
- pi.util.Array.remove(names,pi.util.Array.indexOf(names,_class)).join(" ")
- );
- }
- },
- setClass:function(_element,_value){
- if(pi.env.ie8){
- _element.setAttribute("className", _value );
- _element.setAttribute("class", _value );
- } else {
- _element.setAttribute(pi.env.ie?"className":"class", _value );
- }
- },
- toggleClass:function(){
- if(pi.util.Element.hasClass.apply(this,arguments))
- pi.util.Element.removeClass.apply(this,arguments);
- else
- pi.util.Element.addClass.apply(this,arguments);
- },
- getOpacity:function(_styleObject){
- var styleObject = _styleObject;
- if(!pi.env.ie)
- return styleObject["opacity"];
-
- var alpha = styleObject["filter"].match(/opacity\=(\d+)/i);
- return alpha?alpha[1]/100:1;
- },
- setOpacity:function(_element,_value){
- if(!pi.env.ie)
- return pi.util.Element.addStyle(_element,{ "opacity":_value });
- _value*=100;
- pi.util.Element.addStyle(_element,{ "filter":"alpha(opacity="+_value+")" });
- return this._parent_;
- },
- getPosition:function(_element){
- var parent = _element,offsetLeft = document.body.offsetLeft, offsetTop = document.body.offsetTop, view = pi.util.Element.getView(_element);
- while(parent&&parent!=document.body&&parent!=document.firstChild){
- offsetLeft +=parseInt(parent.offsetLeft);
- offsetTop += parseInt(parent.offsetTop);
- parent = parent.offsetParent;
- };
- return {
- "bottom":view["bottom"],
- "clientLeft":_element.clientLeft,
- "clientTop":_element.clientTop,
- "left":view["left"],
- "marginTop":view["marginTop"],
- "marginLeft":view["marginLeft"],
- "offsetLeft":offsetLeft,
- "offsetTop":offsetTop,
- "position":view["position"],
- "right":view["right"],
- "top":view["top"],
- "zIndex":view["zIndex"]
- };
- },
- getSize:function(_element){
- var view = pi.util.Element.getView(_element);
- return {
- "height":view["height"],
- "clientHeight":_element.clientHeight,
- "clientWidth":_element.clientWidth,
- "offsetHeight":_element.offsetHeight,
- "offsetWidth":_element.offsetWidth,
- "width":view["width"]
- }
- },
- addStyle:function(_element,_style){
- for(var key in _style){
- key = key=="float"?pi.env.ie?"styleFloat":"cssFloat":key;
- if (key == "opacity" && pi.env.ie) {
- pi.util.Element.setOpacity(_element,_style[key]);
- continue;
- }
- try {
- _element.style[key] = _style[key];
- }catch(e){}
- }
- },
- getStyle:function(_element,_property){
- _property = _property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;
- if(_property=="opacity"&&pi.env.ie)
- return pi.util.Element.getOpacity(_element.style);
- return typeof _property=="string"?_element.style[_property]:_element.style;
- },
- getValue:function(_element){
- switch(_element.nodeName.toLowerCase()){
- case "input":
- case "textarea":
- return _element.value;
- case "select":
- return _element.options[_element.selectedIndex].value;
- default:
- return _element.innerHTML;
- break;
- }
- },
- getView:function(_element,_property){
- var view = document.defaultView?document.defaultView.getComputedStyle(_element,null):_element.currentStyle;
- _property = _property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;
- if(_property=="opacity"&&pi.env.ie)
- return pi.util.Element.getOpacity(_element,view);
- return typeof _property=="string"?view[_property]:view;
- }
- },
- Hash: {
- clone:function(_hash,_undeep){
- var tmp = {};
- for(var key in _hash){
- if( !_undeep&&pi.util.IsArray( _hash[key] ) ){
- tmp[key] = pi.util.Array.clone( _hash[key] );
- } else if( !_undeep&&pi.util.IsHash( _hash[key] ) ){
- tmp[ key ] = pi.util.Hash.clone(_hash[key]);
- } else {
- tmp[key] = _hash[key];
- }
- }
- return tmp;
- },
- merge:function(_hash,_source,_undeep){
- for(var key in _source){
- var value = _source[key];
- if (!_undeep&&pi.util.IsArray(_source[key])) {
- if(pi.util.IsArray( _hash[key] )){
- Array.prototype.push.apply( _source[key], _hash[key] )
- }
- else
- value = pi.util.Array.clone(_source[key]);
- }
- else if (!_undeep&&pi.util.IsHash(_source[key])) {
- if (pi.util.IsHash(_hash[key])) {
- value = pi.util.Hash.merge(_hash[key], _source[key]);
- } else {
- value = pi.util.Hash.clone( _source[key] );
- }
- } else if( _hash[key] )
- value = _hash[ key ];
- _hash[key] = value;
- };
- return _hash;
- }
- },
- String:{
- format:function(_str){
- var values = Array.prototype.slice.call(arguments,1);
- return _str.replace(/\{(\d)\}/g,function(){
- return values[arguments[1]];
- })
- }
- },
- GetViewport:function(){
- return {
- height:document.documentElement.clientHeight||document.body.clientHeight,
- width:document.documentElement.clientWidth||document.body.clientWidth
- }
- }
- };
-
- pi.base = function(){
- this.body = {};
- this.init = null;
-
- this.build = function(_skipClonning){
- var base = this, skipClonning = _skipClonning||false, _private = {},
- fn = function(){
- var _p = pi.util.Hash.clone(_private);
- if(!skipClonning){
- for(var key in this){
- if(pi.util.IsArray( this[ key ] ) ){
- this[key] = pi.util.Array.clone( this[key] );
- } else
- if( pi.util.IsHash(this[key]) ){
- this[key] = pi.util.Hash.clone(
- this[ key ],
- function(_key,_object){
- this[ _key ]._parent_ = this;
- }
- );
- //this[key]._parent_ = this;
- }
- }
- };
- base.createAccessors( _p, this );
- if(base.init)
- return base.init.apply(this,arguments);
- return this;
- };
- this.movePrivateMembers(this.body,_private);
- if(this.init){
- fn["$Init"] = this.init;
- };
- fn.prototype = this.body;
- return fn;
- };
-
- this.createAccessors = function(_p, _branch){
- var getter = function(_property){ return this[_property]; },
- setter = function(_property,_value){ this[_property] = _value; return _branch._parent_||_branch; };
-
- for (var name in _p) {
- var isPrivate = name.substring(0, 1) == "_", title = name.substring(1, 2).toUpperCase() + name.substring(2);
-
- if (isPrivate) {
- _branch[(_branch["get" + title]?"_":"")+"get" + title] = pi.util.Curry(getter,_p,name);
- _branch[(_branch["set" + title]?"_":"")+"set" + title] = pi.util.Curry(setter,_p,name);
- }
- else
- if (pi.util.IsHash(_p[name])){
- _branch[name]._parent_ = _branch;
- if(!_branch[name])
- _branch[name] = {};
- this.createAccessors(_p[name], _branch[name]);
- }
- };
- };
-
- this.movePrivateMembers = function(_object, _branch){
- for (var name in _object) {
- var isPrivate = name.substring(0, 1) == "_";
-
- if (isPrivate) {
- _branch[name] = _object[name];
- delete _object[name];
- }
- else
- if (pi.util.IsHash(_object[name])){
- _branch[name] = {};
- this.movePrivateMembers(_object[name], _branch[name]);
- }
- };
- };
- };
-
- pi.element = new pi.base;
- pi.element.init = function(_val){
- this.environment.setElement(
- typeof _val=="string"||!_val?
- document.createElement(_val||"DIV"):
- _val
- );
- return this;
- };
-
- pi.element.body = {
- "addStyle":function(){
- return this.environment.addStyle.apply(this.environment,arguments);
- },
- "clean":function(){
- var childs = this.child.get();
- while(childs.length){
- childs[0].parentNode.removeChild(childs[0]);
- }
- },
- "clone":function(_deep){
- return this.environment.getElement().cloneNode(_deep);
- },
- "insert":function(_element){
- _element = _element.environment?_element.environment.getElement():_element;
- _element.appendChild(this.environment.getElement());
- return this;
- },
- "insertAfter":function(_referenceElement){
- _referenceElement = _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;
- _referenceElement.nextSibling?this.insertBefore(_referenceElement.nextSibling):this.insert(_referenceElement.parentNode);
- return this;
- },
- "insertBefore":function(_referenceElement){
- _referenceElement = _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;
- _referenceElement.parentNode.insertBefore(this.environment.getElement(),_referenceElement);
- return this;
- },
- "query":function(_expression,_resultType,namespaceResolver,_result){
- return pi.xpath(_expression,_resultType||"ORDERED_NODE_SNAPSHOT_TYPE",this.environment.getElement(),_namespaceResolver,_result);
- },
- "remove":function(){
- if (this.environment.getParent()) {
- this.environment.getParent().removeChild(this.environment.getElement());
- }
- },
- "update":function(_value){
- this.element[this.element.nodeName.toLowerCase()=="textarea"||this.element.nodeName.toLowerCase()=="input"?"value":"innerHTML"]=_value;
- return this;
- },
- "attribute":{
- "getAll":function(){
- return this._parent_.environment.getElement().attributes;
- },
- "clear":function(_name){
- this.set(_name,"");
- return this._parent_;
- },
- "get":function(_name){
- return this._parent_.environment.getElement().getAttribute(_name);
- },
- "has":function(_name){
- return pi.env.ie?(this.get(_name)!=null):this._parent_.environment.getElement().hasAttribute(_name);
- },
- "remove":function(_name){
- this._parent_.environment.getElement().removeAttribute(_name);
- return this._parent_;
- },
- "set":function(_name,_value){
- this._parent_.environment.getElement().setAttribute(_name,_value);
- return this._parent_;
- },
- "addClass":function(_classes){
- for(var i=0,len=arguments.length; i<len; i++){
- pi.util.Element.addClass(this._parent_.environment.getElement(),arguments[i]);
- };
- return this._parent_;
- },
- "clearClass":function(){
- this.setClass("");
- this._parent_;
- },
- "getClass":function(){
- return pi.util.Element.getClass( this._parent_.environment.getElement() );
- },
- "hasClass":function(_class){
- return pi.util.Element.hasClass( this._parent_.environment.getElement(), _class );
- },
- "setClass":function(_value){
- return pi.util.Element.setClass( this._parent_.environment.getElement(), _value );
- },
- "removeClass":function(_class){
- pi.util.Element.removeClass( this._parent_.environment.getElement(), _class );
- return this._parent_;
- },
- "toggleClass":function(_class){
- pi.util.Element.toggleClass( this._parent_.environment.getElement(), _class );
- }
- },
- "child":{
- "get":function(){
- return this._parent_.environment.getElement().childNodes;
- },
- "add":function(_elements){
- for (var i = 0; i < arguments.length; i++) {
- var el = arguments[i];
- this._parent_.environment.getElement().appendChild(
- el.environment ? el.environment.getElement() : el
- );
- }
- return this._parent_;
- },
- "addAfter":function(_element,_referenceElement){
- this.addBefore(
- _element.environment?_element.environment.getElement():_element,
- (_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement).nextSibling
- );
- return this._parent_;
- },
- "addBefore":function(_element,_referenceElement){
- this._parent_.environment.getElement().insertBefore(
- _element.environment?_element.environment.getElement():_element,
- _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement
- );
- return this._parent_;
- },
- "remove":function(_element){
- this._parent_.environment.getElement().removeChild(_element.environment?_element.environment.getElement():_element);
- }
- },
- "environment":{
- "_element":null,
- "setElement":function(_value){
- this._parent_.element = _value;
- this._parent_.element.lib = this._parent_;
- this._parent_.element.firebugElement = true;
- this._setElement(_value);
- },
- "getParent":function(){
- return this.getElement().parentNode;
- },
- "getPosition":function(){
- return pi.util.Element.getPosition(this.getElement());
- },
- "getSize":function(){
- return pi.util.Element.getSize( this.getElement() );
- },
- "addStyle":function(_styleObject){
- pi.util.Element.addStyle(this.getElement(),_styleObject);
- return this._parent_;
- },
- "getStyle":function(_property){
- return pi.util.Element.getStyle(this.getElement(),_property);
- },
- "getName":function(){
- return this.getElement().nodeName;
- },
- "getType":function(){
- return this.getElement().nodeType;
- },
- "getValue":function(){
- return pi.util.Element.getValue(this.getElement());
- },
- "getView":function(_property){
- return pi.util.Element.getView(this.getElement(),_property);
- }
- },
- "event":{
- "addListener":function(_event,_fn,_useCapture){
- pi.util.AddEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);
- return this._parent_;
- },
- "removeListener":function(_event,_fn,_useCapture){
- pi.util.RemoveEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);
- return this._parent_;
- }
- }
- };
- pi.element = pi.element.build();
-
- pi.xhr = new pi.base;
- pi.xhr.init = function(_url){
- if(!window.XMLHttpRequest){
- var names = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
- for (var i = 0; i < names.length; i++) {
- try {
- this.environment.setApi(new ActiveXObject(names[i]));
- break;
- } catch (e) { continue; }
- }
- }
- else {
- this.environment.setApi(new XMLHttpRequest());
- }
- this.environment.getApi().onreadystatechange=pi.util.Curry(this.event.readystatechange,this);
- this.environment.setUrl(_url);
- this.environment.setCallback([]);
-
- return this;
- };
- pi.xhr.body = {
- "addCallback": function(){
- return this.environment.addCallback.apply(this.environment,arguments);
- },
- "addData": function(){
- return this.environment.addData.apply(this.environment,arguments);
- },
- "abort":function(){
- this.environment.getApi().abort();
- return this;
- },
- "send":function(){
- var url = this.environment.getUrl(), data = this.environment.getData(),dataUrl = "";
-
- if(!this.environment.getCache())
- data["forceCache"] = Number(new Date);
-
- for (var key in data)
- dataUrl += pi.util.String.format("{0}={1}&",key, data[key]);
-
- if (this.environment.getType()=="GET")
- url += (url.search("\\?")==-1?"?":"&")+pi.util.String.format("{0}",dataUrl);
-
- this.api.open(this.environment.getType(),url,this.environment.getAsync());
- if(this.environment.getType()=="POST"){
- this.api.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
- };
- this.api.send(this.environment.getType()=="GET"?"":dataUrl);
- return this;
- }
- };
- pi.xhr.body.environment = {
- "_async":true, "_api":null, "_cache":true, "_callback":null, "_data":{}, "_type":"GET", "_url":"",
- "setApi":function(_value){
- this._parent_.api = _value;
- this._setApi(_value);
- },
- "addCallback": function(_readyState,_fn){
- this.getCallback().push({ "fn":_fn, "readyState":_readyState });
- return this._parent_;
- },
- "addData": function(_key,_value){
- this.getData()[_key] = _value;
- return this._parent_;
- },
- "setType": function(_value){
- this._setType(_value);
- return this._parent_;
- }
- };
- pi.xhr.body.event = {
- "readystatechange":function(){
- var readyState = this.environment.getApi().readyState, callback=this.environment.getCallback();
- for (var i = 0, len=callback.length; i < len; i++) {
- if(pi.util.Array.indexOf(callback[i].readyState,readyState)>-1){
- callback[i].fn.apply(this);
- }
- }
- }
- };
- pi.xhr = pi.xhr.build();
-
- /*
- * xml.xhr.get
- */
-
- pi.xhr.get = function(_url,_returnPiObject){
- var request = new pi.xhr();
- request.environment.setAsync(false);
- request.environment.setUrl(_url);
- request.send();
- return _returnPiObject?request:request.environment.getApi();
- };
-
- /*
- * registering onload event for init functions
- */
- pi.util.AddEvent(
- pi.env.ie?window:document,
- pi.env.ie?"load":"DOMContentLoaded",
- function(){
- for(var i=0,len=pi.util.Init.length; i<len; i++){
- pi.util.Init[ i ]();
- }
- }
- );
-})(firebug);
-
-with(firebug){
- initConsole();
- lib.util.Init.push(firebug.init);
-}
+var firebug = {
+ version:[1.23,20090309],
+ el:{},
+ env:{
+ "cache":{},
+ "extConsole":null,
+ "css":"http://getfirebug.com/releases/lite/1.2/firebug-lite.css",
+ "debug":true,
+ "detectFirebug":false,
+ "dIndex":"console",
+ "height":295,
+ "hideDOMFunctions":false,
+ "init":false,
+ "isPopup":false,
+ "liteFilename":"firebug-lite.js",
+ "minimized":false,
+ "openInPopup": false,
+ "override":false,
+ "ml":false,
+ "popupWin":null,
+ "showIconWhenHidden":true,
+ "targetWindow":undefined,
+ "popupTop":1,
+ "popupLeft":1,
+ "popupWidth":undefined,
+ "popupHeight":undefined
+ },
+ initConsole:function(){
+ /*
+ * initialize the console - user defined values are not available within this method because FBLite is not yet initialized
+ */
+ var command;
+ try{
+ if((!window.console || (window.console && !window.console.firebug)) || (firebug.env.override && !(/Firefox\/3/i.test(navigator.userAgent)))){
+ window.console = { "provider":"Firebug Lite" };
+
+ for(command in firebug.d.console.cmd){
+ window.console[command] = firebug.lib.util.Curry(firebug.d.console.run,window,command);
+ };
+ }
+ window.onerror = function(_message,_file,_line){
+ firebug.d.console.run('error',firebug.lib.util.String.format('{0} ({1},{2})',_message,firebug.getFileName(_file),_line));
+ };
+ } catch(e){}
+ },
+ overrideConsole:function(){
+ with (firebug){
+ env.override=true;
+ try{
+ env.extConsole=window.console;
+ } catch(e){}
+ initConsole();
+ }
+ },
+ restoreConsole:function(){
+ with(firebug){
+ if(env.extConsole){
+ env.override=false;
+ try{
+ window.console=env.extConsole;
+ } catch(e){}
+ env.extConsole=null;
+ }
+ }
+ },
+ init:function(_css){
+ var iconTitle = "Click here or press F12, (CTRL|CMD)+SHIFT+L or SHIFT+ENTER to show Firebug Lite. CTRL|CMD click this icon to hide it.";
+
+ with(firebug){
+ if(document.getElementsByTagName('html')[0].attributes.getNamedItem('debug')){
+ env.debug = document.getElementsByTagName('html')[0].attributes.getNamedItem('debug').nodeValue !== "false";
+ }
+
+ if(env.isPopup) {
+ env.openInPopup = false;
+ env.targetWindow = window.opener;
+ env.popupWidth = window.opener.firebug.env.popupWidth || window.opener.firebug.lib.util.GetViewport().width;
+ env.popupHeight = window.opener.firebug.env.popupHeight || window.opener.firebug.lib.util.GetViewport().height;
+ } else {
+ env.targetWindow = window;
+ env.popupWidth = env.popupWidth || lib.util.GetViewport().width;
+ env.popupHeight = env.popupHeight || lib.util.GetViewport().height;
+ }
+
+ settings.readCookie();
+
+ if(env.init || (env.detectFirebug && window.console && window.console.firebug)) {
+ return;
+ }
+
+ document.getElementsByTagName("head")[0].appendChild(
+ new lib.element("link").attribute.set("rel","stylesheet").attribute.set("type","text/css").attribute.set("href",env.css).element
+ );
+
+ if(env.override){
+ overrideConsole();
+ }
+
+ /*
+ * Firebug Icon
+ */
+ el.firebugIcon = new lib.element("div").attribute.set("id","firebugIconDiv").attribute.set("title",iconTitle).attribute.set("alt",iconTitle).event.addListener("mousedown",win.iconClicked).insert(document.body);
+
+ /*
+ * main interface
+ */
+ el.content = {};
+ el.mainiframe = new lib.element("IFRAME").attribute.set("id","FirebugIFrame").environment.addStyle({ "display":"none", "width":lib.util.GetViewport().width+"px" }).insert(document.body);
+ el.main = new lib.element("DIV").attribute.set("id","Firebug").environment.addStyle({ "display":"none", "width":lib.util.GetViewport().width+"px" }).insert(document.body);
+ if(!env.isPopup){
+ el.resizer = new lib.element("DIV").attribute.addClass("Resizer").event.addListener("mousedown",win.resizer.start).insert(el.main);
+ }
+ el.header = new lib.element("DIV").attribute.addClass("Header").insert(el.main);
+ el.left = {};
+ el.left.container = new lib.element("DIV").attribute.addClass("Left").insert(el.main);
+ el.right = {};
+ el.right.container = new lib.element("DIV").attribute.addClass("Right").insert(el.main);
+ el.main.child.add(new lib.element("DIV").attribute.addClass('Clear'));
+
+ /*
+ * buttons
+ */
+ el.button = {};
+ el.button.container = new lib.element("DIV").attribute.addClass("ButtonContainer").insert(el.header);
+ el.button.logo = new lib.element("A").attribute.set("title","Firebug Lite").attribute.set("target","_blank").attribute.set("href","http://getfirebug.com/lite.html").update("&nbsp;").attribute.addClass("Button Logo").insert(el.button.container);
+ el.button.inspect = new lib.element("A").attribute.addClass("Button").event.addListener("click",env.targetWindow.firebug.d.inspector.toggle).update("Inspect").insert(el.button.container);
+ el.button.dock = new lib.element("A").attribute.addClass("Button Dock").event.addListener("click", win.dock).insert(el.button.container);
+ el.button.newWindow = new lib.element("A").attribute.addClass("Button NewWindow").event.addListener("click", win.newWindow).insert(el.button.container);
+
+ if(!env.isPopup){
+ el.button.maximize = new lib.element("A").attribute.addClass("Button Maximize").event.addListener("click",win.maximize).insert(el.button.container);
+ el.button.minimize = new lib.element("A").attribute.addClass("Button Minimize").event.addListener("click",win.minimize).insert(el.button.container);
+ el.button.close = new lib.element("A").attribute.addClass("Button Close").event.addListener("click",win.hide).insert(el.button.container);
+ }
+
+ if(lib.env.ie||lib.env.webkit){
+ el.button.container.environment.addStyle({ "paddingTop":"12px" });
+ }
+
+ /*
+ * navigation
+ */
+ el.nav = {};
+ el.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.left.container);
+ el.nav.console = new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.navigate,window,"console")).update("Console").insert(el.nav.container);
+ el.nav.html = new lib.element("A").attribute.addClass("Tab").update("HTML").event.addListener("click",lib.util.Curry(d.navigate,window,"html")).insert(el.nav.container);
+ el.nav.css = new lib.element("A").attribute.addClass("Tab").update("CSS").event.addListener("click",lib.util.Curry(d.navigate,window,"css")).insert(el.nav.container);
+ if(!env.isPopup){
+ el.nav.scripts = new lib.element("A").attribute.addClass("Tab").update("Script").event.addListener("click",lib.util.Curry(d.navigate,window,"scripts")).insert(el.nav.container);
+ }
+ el.nav.dom = new lib.element("A").attribute.addClass("Tab").update("DOM").event.addListener("click",lib.util.Curry(d.navigate,env.targetWindow,"dom")).insert(el.nav.container);
+ el.nav.xhr = new lib.element("A").attribute.addClass("Tab").update("XHR").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).insert(el.nav.container);
+ el.nav.optionsdiv = new lib.element("DIV").attribute.addClass("Settings").insert(el.nav.container);
+ el.nav.options = new lib.element("A").attribute.addClass("Tab").update("Options&nbsp;&or;").event.addListener("click", settings.toggle).insert(el.nav.optionsdiv);
+
+ /*
+ * inspector
+ */
+ el.borderInspector = new lib.element("DIV").attribute.set("id","FirebugBorderInspector").event.addListener("click",listen.inspector).insert(document.body);
+ el.bgInspector = new lib.element("DIV").attribute.set("id","FirebugBGInspector").insert(document.body);
+
+ /*
+ * console
+ */
+ el.left.console = {};
+ el.left.console.container = new lib.element("DIV").attribute.addClass("Console").insert(el.left.container);
+ el.left.console.mlButton = new lib.element("A").attribute.addClass("MLButton").event.addListener("click",d.console.toggleML).insert(el.left.console.container);
+ el.left.console.monitor = new lib.element("DIV").insert(
+ new lib.element("DIV").attribute.addClass("Monitor").insert(el.left.console.container)
+ );
+ el.left.console.container.child.add(
+ new lib.element("DIV").attribute.addClass("InputArrow").update(">>>")
+ );
+ el.left.console.input = new lib.element("INPUT").attribute.set("type","text").attribute.addClass("Input").event.addListener("keydown",listen.consoleTextbox).insert(
+ new lib.element("DIV").attribute.addClass("InputContainer").insert(el.left.console.container)
+ );
+
+ el.right.console = {};
+ el.right.console.container = new lib.element("DIV").attribute.addClass("Console Container").insert(el.right.container);
+ el.right.console.mlButton = new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.console.container);
+ el.right.console.input = new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.console.container);
+ el.right.console.input.event.addListener("keydown",lib.util.Curry(tab,window,el.right.console.input.element));
+ el.right.console.run = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runMultiline).update("Run").insert(el.right.console.container);
+ el.right.console.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.console.input)).update("Clear").insert(el.right.console.container);
+
+ el.button.console = {};
+ el.button.console.container = new lib.element("DIV").attribute.addClass("ButtonSet").insert(el.button.container);
+ el.button.console.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",d.console.clear).update("Clear").insert(el.button.console.container);
+
+ /*
+ * html
+ */
+
+ el.left.html = {};
+ el.left.html.container = new lib.element("DIV").attribute.addClass("HTML").insert(el.left.container);
+
+ el.right.html = {};
+ el.right.html.container = new lib.element("DIV").attribute.addClass("HTML Container").insert(el.right.container);
+
+ el.right.html.nav = {};
+ el.right.html.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.right.html.container);
+ el.right.html.nav.computedStyle = new lib.element("A").attribute.addClass("Tab Selected").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"computedStyle")).update("Computed Style").insert(el.right.html.nav.container);
+ el.right.html.nav.dom = new lib.element("A").attribute.addClass("Tab").event.addListener("click",lib.util.Curry(d.html.navigate,firebug,"dom")).update("DOM").insert(el.right.html.nav.container);
+
+ el.right.html.content = new lib.element("DIV").attribute.addClass("Content").insert(el.right.html.container);
+
+ el.button.html = {};
+ el.button.html.container = new lib.element("DIV").attribute.addClass("ButtonSet HTML").insert(el.button.container);
+
+ /*
+ * css
+ */
+
+ el.left.css = {};
+ el.left.css.container = new lib.element("DIV").attribute.addClass("CSS").insert(el.left.container);
+
+ el.right.css = {};
+ el.right.css.container = new lib.element("DIV").attribute.addClass("CSS Container").insert(el.right.container);
+
+ el.right.css.nav = {};
+ el.right.css.nav.container = new lib.element("DIV").attribute.addClass("Nav").insert(el.right.css.container);
+ el.right.css.nav.runCSS = new lib.element("A").attribute.addClass("Tab Selected").update("Run CSS").insert(el.right.css.nav.container);
+
+ el.right.css.mlButton = new lib.element("A").attribute.addClass("MLButton CloseML").event.addListener("click",d.console.toggleML).insert(el.right.css.container);
+ el.right.css.input = new lib.element("TEXTAREA").attribute.addClass("Input").insert(el.right.css.container);
+ el.right.css.input.event.addListener("keydown",lib.util.Curry(firebug.tab,window,el.right.css.input.element));
+ el.right.css.run = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.runCSS).update("Run").insert(el.right.css.container);
+ el.right.css.clear = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.clean,window,el.right.css.input)).update("Clear").insert(el.right.css.container);
+
+ el.button.css = {};
+ el.button.css.container = new lib.element("DIV").attribute.addClass("ButtonSet CSS").insert(el.button.container);
+ el.button.css.selectbox = new lib.element("SELECT").event.addListener("change",listen.cssSelectbox).insert(el.button.css.container);
+
+ /*
+ * scripts
+ */
+
+ el.left.scripts = {};
+ el.left.scripts.container = new lib.element("DIV").attribute.addClass("Scripts").insert(el.left.container);
+
+ el.right.scripts = {};
+ el.right.scripts.container = new lib.element("DIV").attribute.addClass("Scripts Container").insert(el.right.container);
+
+ el.button.scripts = {};
+ el.button.scripts.container = new lib.element("DIV").attribute.addClass("ButtonSet Scripts").insert(el.button.container);
+ el.button.scripts.selectbox = new lib.element("SELECT").event.addListener("change",listen.scriptsSelectbox).insert(el.button.scripts.container);
+ el.button.scripts.lineNumbers = new lib.element("A").attribute.addClass("Button").event.addListener("click",d.scripts.toggleLineNumbers).update("Show Line Numbers").insert(el.button.scripts.container);
+
+ /*
+ * dom
+ */
+
+ el.left.dom = {};
+ el.left.dom.container = new lib.element("DIV").attribute.addClass("DOM").insert(el.left.container);
+
+ el.right.dom = {};
+ el.right.dom.container = new lib.element("DIV").attribute.addClass("DOM Container").insert(el.right.container);
+
+ el.button.dom = {};
+ el.button.dom.container = new lib.element("DIV").attribute.addClass("ButtonSet DOM").insert(el.button.container);
+ el.button.dom.label = new lib.element("LABEL").update("Object Path:").insert(el.button.dom.container);
+ el.button.dom.textbox = new lib.element("INPUT").event.addListener("keydown",listen.domTextbox).update(env.isPopup?"window.opener":"window").insert(el.button.dom.container);
+
+ /*
+ * str
+ */
+ el.left.str = {};
+ el.left.str.container = new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);
+
+ el.right.str = {};
+ el.right.str.container = new lib.element("DIV").attribute.addClass("STR").insert(el.left.container);
+
+ el.button.str = {};
+ el.button.str.container = new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);
+ el.button.str.watch = new lib.element("A").attribute.addClass("Button").event.addListener("click",lib.util.Curry(d.navigate,window,"xhr")).update("Back").insert(el.button.str.container);
+
+ /*
+ * xhr
+ */
+ el.left.xhr = {};
+ el.left.xhr.container = new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);
+
+ el.right.xhr = {};
+ el.right.xhr.container = new lib.element("DIV").attribute.addClass("XHR").insert(el.left.container);
+
+
+ el.button.xhr = {};
+ el.button.xhr.container = new lib.element("DIV").attribute.addClass("ButtonSet XHR").insert(el.button.container);
+ el.button.xhr.label = new lib.element("LABEL").update("XHR Path:").insert(el.button.xhr.container);
+ el.button.xhr.textbox = new lib.element("INPUT").event.addListener("keydown",listen.xhrTextbox).insert(el.button.xhr.container);
+ el.button.xhr.watch = new lib.element("A").attribute.addClass("Button").event.addListener("click",listen.addXhrObject).update("Watch").insert(el.button.xhr.container);
+
+ /*
+ * settings
+ */
+ el.settings = {};
+ el.settings.container = new lib.element("DIV").child.add(
+ new lib.element("DIV").attribute.addClass("Header").child.add(
+ new lib.element().attribute.addClass("Title").update('Firebug Lite Settings')
+ )
+ ).attribute.addClass("SettingsDiv").insert(el.main);
+ el.settings.content = new lib.element("DIV").attribute.addClass("Content").insert(el.settings.container);
+ el.settings.progressDiv = new lib.element("DIV").attribute.addClass("ProgressDiv").insert(el.settings.content);
+ el.settings.progress = new lib.element("DIV").attribute.addClass("Progress").insert(el.settings.progressDiv);
+ el.settings.cbxDebug = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
+ el.settings.content.child.add(document.createTextNode("Start visible"));
+ new lib.element("BR").insert(el.settings.content);
+ el.settings.cbxDetectFirebug = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
+ el.settings.content.child.add(document.createTextNode("Hide when Firebug active"));
+ new lib.element("BR").insert(el.settings.content);
+ el.settings.cbxHideDOMFunctions = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
+ el.settings.content.child.add(document.createTextNode("Hide DOM functions"));
+ new lib.element("BR").insert(el.settings.content);
+ el.settings.cbxOverride = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
+ el.settings.content.child.add(document.createTextNode("Override window.console"));
+ new lib.element("BR").insert(el.settings.content);
+ el.settings.cbxShowIcon = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
+ el.settings.content.child.add(document.createTextNode("Show icon when hidden"));
+ new lib.element("BR").insert(el.settings.content);
+ el.settings.cbxOpenInPopup = new lib.element("INPUT").attribute.set("type","checkbox").attribute.addClass("SettingsCBX").insert(el.settings.content);
+ el.settings.content.child.add(document.createTextNode("Open in popup"));
+ el.settings.buttonDiv = new lib.element("DIV").insert(el.settings.content);
+ el.settings.buttonLeftDiv = new lib.element("DIV").attribute.addClass("ButtonsLeft").insert(el.settings.buttonDiv);
+ el.settings.resetButton = new lib.element("INPUT").attribute.set("type","button").update("Reset").event.addListener("click",settings.reset).insert(el.settings.buttonLeftDiv);
+ el.settings.buttonRightDiv = new lib.element("DIV").attribute.addClass("ButtonsRight").insert(el.settings.buttonDiv);
+ el.settings.cancelButton = new lib.element("INPUT").attribute.set("type","button").update("Cancel").event.addListener("click",settings.hide).insert(el.settings.buttonRightDiv);
+ el.settings.buttonRightDiv.child.add(document.createTextNode(" "));
+ el.settings.saveButton = new lib.element("INPUT").attribute.set("type","button").update("Save").event.addListener("click",settings.saveClicked).insert(el.settings.buttonRightDiv);
+
+ lib.util.AddEvent(document,"mousemove",listen.mouse)("mousemove",win.resizer.resize)("mouseup",win.resizer.stop)("keydown",listen.keyboard);
+
+ env.init = true;
+
+ for(var i=0, len=d.console.cache.length; i<len; i++){
+ var item = d.console.cache[i];
+ d.console.cmd[item.command].apply(window,item.arg);
+ };
+
+ if(lib.env.ie6){
+ window.onscroll = lib.util.Curry(win.setVerticalPosition,window,null);
+ var buttons = [
+ el.button.inspect,
+ el.button.close,
+ el.button.inspect,
+ el.button.console.clear,
+ el.right.console.run,
+ el.right.console.clear,
+ el.right.css.run,
+ el.right.css.clear
+ ];
+ for(var i=0, len=buttons.length; i<len; i++)
+ buttons[i].attribute.set("href","#");
+ win.refreshSize();
+ }
+
+ if(env.showIconWhenHidden) {
+ if(!env.popupWin) {
+ el.firebugIcon.environment.addStyle({ "display": env.debug&&'none'||'block' });
+ }
+ }
+
+ lib.util.AddEvent(window, "unload", win.unload);
+
+ if (env.isPopup) {
+ env.height=lib.util.GetViewport().height;
+ lib.util.AddEvent(window, "resize", win.fitToPopup);
+ win.fitToPopup();
+ } else {
+ lib.util.AddEvent(window, "resize", win.refreshSize);
+ }
+
+ win.setHeight(env.height);
+
+ if(env.openInPopup&&!env.isPopup) {
+ win.newWindow();
+ } else {
+ el.main.environment.addStyle({ "display":env.debug&&'block'||'none' });
+ el.mainiframe.environment.addStyle({ "display":env.debug&&'block'||'none' });
+ }
+ }
+ },
+ inspect:function(){
+ return firebug.d.html.inspect.apply(window,arguments);
+ },
+ watchXHR:function(){
+ with(firebug){
+ d.xhr.addObject.apply(window,arguments);
+ if(env.dIndex!="xhr"){
+ d.navigate("xhr");
+ }
+ }
+ },
+ settings:{
+ isVisible:false,
+ show: function() {
+ with(firebug){
+ var posXY=lib.util.Element.getPosition(firebug.el.nav.options.element);
+ settings.refreshForm();
+
+ el.settings.container.environment.addStyle({
+ "display": "block",
+ "left": (posXY.offsetLeft-125)+"px"
+ });
+ el.settings.progressDiv.environment.addStyle({
+ "display": "none"
+ });
+ firebug.settings.isVisible = true;
+ }
+ },
+ hide: function() {
+ with(firebug){
+ firebug.el.settings.container.environment.addStyle({
+ "display": "none"
+ });
+ firebug.settings.isVisible = false;
+ }
+ },
+ toggle: function(){
+ with(firebug){
+ settings[!settings.isVisible && 'show' || 'hide']();
+ }
+ },
+ saveClicked: function() {
+ firebug.el.settings.progressDiv.environment.addStyle({
+ "display": "block"
+ });
+ setTimeout(firebug.settings.formToSettings,0);
+ },
+ formToSettings: function() {
+ var fe=firebug.env,
+ ofe,
+ elSet=firebug.el.settings,
+ exdate;
+
+ fe.debug=elSet.cbxDebug.element.checked;
+ fe.detectFirebug=elSet.cbxDetectFirebug.element.checked;
+ fe.hideDOMFunctions=elSet.cbxHideDOMFunctions.element.checked;
+ fe.override=elSet.cbxOverride.element.checked;
+ fe.showIconWhenHidden=elSet.cbxShowIcon.element.checked;
+ fe.openInPopup=elSet.cbxOpenInPopup.element.checked;
+
+ if(fe.isPopup) {
+ ofe=window.opener.firebug.env;
+ ofe.debug=fe.debug;
+ ofe.detectFirebug=fe.detectFirebug;
+ ofe.hideDOMFunctions=fe.hideDOMFunctions;
+ ofe.override=fe.override;
+ ofe.showIconWhenHidden=fe.showIconWhenHidden;
+ ofe.openInPopup=fe.openInPopup;
+ ofe.popupTop=fe.popupTop;
+ ofe.popupLeft=fe.popupLeft;
+ ofe.popupWidth=fe.popupWidth;
+ ofe.popupHeight=fe.popupHeight;
+ }
+
+ with(firebug) {
+ settings.writeCookie();
+ settings.hide();
+ win.refreshDOM();
+ }
+ },
+ reset: function() {
+ var exdate=new Date();
+
+ exdate.setTime(exdate.getTime()-1);
+ document.cookie='FBLiteSettings=;expires='+exdate.toGMTString();
+ location.reload(true);
+ },
+ readCookie: function() {
+ var i,cookieArr,valueArr,item,value;
+
+ with(firebug.env){
+ if(targetWindow.document.cookie.length>0) {
+ cookieArr=targetWindow.document.cookie.split('; ');
+
+ for(i=0;i<cookieArr.length;i++) {
+ if(cookieArr[i].split('=')[0]=='FBLiteSettings') {
+ valueArr=cookieArr[i].split('=')[1].split(',');
+ }
+ }
+
+ if(valueArr) {
+ for(i=0;i<valueArr.length;i++) {
+ item=valueArr[i].split(':')[0];
+ value=valueArr[i].split(':')[1];
+
+ switch(item) {
+ case 'debug':
+ debug=value=="true";
+ break;
+ case 'detectFirebug':
+ detectFirebug=value=="true";
+ break;
+ case 'hideDOMFunctions':
+ hideDOMFunctions=value=="true";
+ break;
+ case 'override':
+ override=value=="true";
+ break;
+ case 'showIconWhenHidden':
+ showIconWhenHidden=value=="true";
+ break;
+ case 'openInPopup':
+ openInPopup=value=="true";
+ break;
+ case 'popupTop':
+ popupTop=parseInt(value,10);
+ break;
+ case 'popupLeft':
+ popupLeft=parseInt(value,10);
+ break;
+ case 'popupWidth':
+ popupWidth=parseInt(value,10);
+ break;
+ case 'popupHeight':
+ popupHeight=parseInt(value,10);
+ break;
+ case 'height':
+ height=parseInt(value,10);
+ break;
+ }
+ }
+ }
+ }
+ }
+ },
+ writeCookie: function() {
+ var values;
+
+ with(firebug.env){
+ values='debug:'+debug+',';
+ values+='detectFirebug:'+detectFirebug+',';
+ values+='hideDOMFunctions:'+hideDOMFunctions+',';
+ values+='override:'+override+',';
+ values+='showIconWhenHidden:'+showIconWhenHidden+',';
+ values+='openInPopup:'+openInPopup+',';
+
+ if(isPopup) {
+ if(window.outerWidth===undefined) {
+ values+='popupTop:'+(window.screenTop-56)+',';
+ values+='popupLeft:'+(window.screenLeft-8)+',';
+ values+='popupWidth:'+document.body.clientWidth+',';
+ values+='popupHeight:'+document.body.clientHeight+',';
+ } else {
+ values+='popupTop:'+window.screenY+',';
+ values+='popupLeft:'+window.screenX+',';
+ values+='popupWidth:'+window.outerWidth+',';
+ values+='popupHeight:'+window.outerHeight+',';
+ }
+ } else {
+ values+='popupTop:'+popupTop+',';
+ values+='popupLeft:'+popupLeft+',';
+ values+='popupWidth:'+popupWidth+',';
+ values+='popupHeight:'+popupHeight+',';
+ }
+
+ values+='height:'+(parseInt(targetWindow.firebug.el.main.element.style.height.replace(/px/,''),10)-38);
+
+ exdate=new Date();
+ exdate.setDate(exdate.getDate()+365);
+ targetWindow.document.cookie='FBLiteSettings='+values+';expires='+exdate.toGMTString();
+ }
+ },
+ refreshForm: function() {
+ var fe=firebug.env,
+ elSet=firebug.el.settings;
+
+ elSet.cbxDebug.element.checked=fe.debug;
+ elSet.cbxDetectFirebug.element.checked=fe.detectFirebug;
+ elSet.cbxHideDOMFunctions.element.checked=fe.hideDOMFunctions;
+ elSet.cbxOverride.element.checked=fe.override;
+ elSet.cbxShowIcon.element.checked=fe.showIconWhenHidden;
+ elSet.cbxOpenInPopup.element.checked=fe.openInPopup;
+ }
+ },
+ win:{
+ hide:function(){
+ with(firebug){
+ el.main.environment.addStyle({
+ "display": "none"
+ });
+ el.mainiframe.environment.addStyle({
+ "display": "none"
+ });
+ if(env.showIconWhenHidden) {
+ el.firebugIcon.environment.addStyle({
+ "display": "block"
+ });
+ }
+ }
+ },
+ show:function(){
+ with(firebug){
+ el.main.environment.addStyle({
+ "display": "block"
+ });
+ el.mainiframe.environment.addStyle({
+ "display": "block"
+ });
+ if(env.showIconWhenHidden) {
+ el.firebugIcon.environment.addStyle({
+ "display": "none"
+ });
+ }
+ }
+ },
+ iconClicked:function(_event) {
+ with(firebug) {
+ if(_event.ctrlKey==true||_event.metaKey==true) {
+ el.firebugIcon.environment.addStyle({ "display": "none" });
+ env.showIconWhenHidden=false;
+ } else {
+ win.show();
+ }
+ }
+ },
+ minimize:function(){
+ with(firebug){
+ env.minimized=true;
+ el.main.environment.addStyle({ "height":"35px" });
+ el.mainiframe.environment.addStyle({ "height":"35px" });
+ el.button.maximize.environment.addStyle({ "display":"block" });
+ el.button.minimize.environment.addStyle({ "display":"none" });
+ win.refreshSize();
+ }
+ },
+ maximize:function(){
+ with(firebug){
+ env.minimized=false;
+ el.button.minimize.environment.addStyle({ "display":"block" });
+ el.button.maximize.environment.addStyle({ "display":"none" });
+ win.setHeight(env.height);
+ }
+ },
+ newWindow: function() {
+ var interval,scripts,script,scriptPath,
+ fe=firebug.env;
+
+ if (!fe.popupWin) {
+ scripts = document.getElementsByTagName('script');
+
+ fe.popupWin = window.open("", "_firebug",
+ "status=0,menubar=0,resizable=1,top="+fe.popupTop+",left="+fe.popupLeft+",width=" + fe.popupWidth +
+ ",height=" + fe.popupHeight + ",scrollbars=0,addressbar=0,outerWidth="+fe.popupWidth+",outerHeight="+fe.popupHeight+
+ "toolbar=0,location=0,directories=0,dialog=0");
+
+ if(!fe.popupWin) {
+ alert("Firebug Lite could not open a pop-up window, most likely because of a popup blocker.\nPlease enable popups for this domain");
+ } else {
+ firebug.settings.hide();
+
+ for (i=0,len=scripts.length; i<len; i++) {
+ if (scripts[i].src.indexOf(fe.liteFilename) > -1) {
+ scriptPath = scripts[i].src;
+ break;
+ }
+ }
+
+ if (scriptPath) {
+ script = fe.popupWin.document.createElement('script'), done = false;
+ script.type = 'text/javascript';
+ script.src = scriptPath;
+
+ script[firebug.lib.env.ie?"onreadystatechange":"onload"] = function(){
+ if(!done && (!firebug.lib.env.ie || this.readyState == "complete" || this.readyState=="loaded")){
+ done = true;
+ if(fe.popupWin.firebug) {
+ with(fe.popupWin.firebug) {
+ env.isPopup = true;
+ env.css = fe.css;
+ init();
+ el.button.dock.environment.addStyle({ "display": "block"});
+ el.button.newWindow.environment.addStyle({ "display": "none"});
+ }
+ }
+ }
+ };
+
+ if (!done && firebug.lib.env.webkit) {
+ fe.popupWin.document.write('<html><head></head><body></body></html>');
+ interval = setInterval(function() {
+ if (fe.popupWin.firebug) {
+ clearInterval(interval);
+ done = true;
+ with(fe.popupWin.firebug) {
+ env.isPopup = true;
+ env.css = fe.css;
+ init();
+ el.button.dock.environment.addStyle({ "display": "block"});
+ el.button.newWindow.environment.addStyle({ "display": "none"});
+ }
+ }
+ }, 10);
+ };
+
+ if (!done) {
+ fe.popupWin.document.getElementsByTagName('head')[0].appendChild(script);
+ firebug.el.main.environment.addStyle({"display": "none"});
+ firebug.el.mainiframe.environment.addStyle({"display": "none"});
+ }
+ } else {
+ alert("Unable to detect the following script \"" + fe.liteFilename +
+ "\" ... if the script has been renamed then please set the value of firebug.env.liteFilename to reflect this change");
+ fe.popupWin.close();
+ fe.popupWin=null;
+ }
+ }
+ }
+ },
+ dock: function() {
+ with(opener.firebug) {
+ env.popupWin = null;
+ el.main.environment.addStyle({
+ "display": "block"
+ });
+ el.mainiframe.environment.addStyle({
+ "display": "block"
+ });
+ settings.readCookie();
+ window.close();
+ };
+ },
+ unload: function() {
+ with(firebug){
+ if(env.isPopup) {
+ win.dock();
+ } else if(env.popupWin) {
+ env.popupWin.close();
+ }
+ }
+ },
+ fitToPopup: function() {
+ with(firebug) {
+ var viewport = lib.util.GetViewport(window);
+ win.setHeight((window.innerHeight||viewport.height) - 38);
+ el.main.environment.addStyle({
+ "width": (viewport.width) + "px"
+ });
+ el.mainiframe.environment.addStyle({
+ "width": (viewport.width) + "px"
+ });
+ }
+ },
+ resizer:{
+ y:[], enabled:false,
+ start:function(_event){
+ with(firebug){
+ if(env.minimized)return;
+ win.resizer.y=[el.main.element.offsetHeight,_event.clientY];
+ if(lib.env.ie6){
+ win.resizer.y[3]=parseInt(el.main.environment.getPosition().top);
+ }
+ win.resizer.enabled=true;
+ }
+ },
+ resize:function(_event){
+ with(firebug){
+ if(!win.resizer.enabled)return;
+ win.resizer.y[2]=(win.resizer.y[0]+(win.resizer.y[1]-_event.clientY));
+ el.main.environment.addStyle({ "height":win.resizer.y[2]+"px" });
+ el.mainiframe.environment.addStyle({ "height":win.resizer.y[2]+"px" });
+ if(lib.env.ie6){
+ el.main.environment.addStyle({ "top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px" });
+ el.mainiframe.environment.addStyle({ "top":win.resizer.y[3]-(win.resizer.y[1]-_event.clientY)+"px" });
+ }
+ }
+ },
+ stop:function(_event){
+ with(firebug){
+ if(win.resizer.enabled){
+ win.resizer.enabled=false;
+ win.setHeight(win.resizer.y[2]-35);
+ }
+ }
+ }
+ },
+ setHeight:function(_height){
+ with(firebug){
+ env.height=_height;
+
+ el.left.container.environment.addStyle({ "height":_height+"px" });
+ el.right.container.environment.addStyle({ "height":_height+"px" });
+ el.main.environment.addStyle({ "height":_height+38+"px" });
+ el.mainiframe.environment.addStyle({ "height":_height+38+"px" });
+
+ win.refreshSize();
+
+ // console
+ el.left.console.monitor.element.parentNode.style.height=_height-47+"px";
+ el.left.console.mlButton.environment.addStyle({ "top":_height+19+"px" });
+ el.right.console.mlButton.environment.addStyle({ "top":_height+19+"px" });
+ el.right.console.input.environment.addStyle({ "height":_height-29+"px" });
+
+ // html
+ el.left.html.container.environment.addStyle({"height":_height-23+"px"});
+ el.right.html.content.environment.addStyle({"height":_height-23+"px"});
+
+ // css
+ el.left.css.container.environment.addStyle({"height":_height-33+"px"});
+ el.right.css.input.environment.addStyle({ "height":_height-55+"px" });
+
+ // script
+ el.left.scripts.container.environment.addStyle({"height":_height-23+"px"});
+
+ // dom
+ el.left.dom.container.environment.addStyle({"height":_height-31+"px"});
+
+ // xhr
+ el.left.xhr.container.environment.addStyle({"height":_height-32+"px"});
+
+ // string
+ el.left.str.container.environment.addStyle({"height":_height-32+"px"});
+ }
+ },
+ refreshDOM:function(){
+ with(firebug){
+ d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);
+ if(d.html.nIndex=="dom"){
+ firebug.d.html.navigate("dom")
+ }
+ }
+ },
+ refreshSize:function(){
+ with(firebug){
+ if(!env.init)
+ return;
+
+ var dim = lib.util.GetViewport();
+ el.main.environment.addStyle({ "width":dim.width+"px"});
+ el.mainiframe.environment.addStyle({ "width":dim.width+"px"});
+ if(lib.env.ie6)
+ win.setVerticalPosition(dim);
+ }
+ },
+ setVerticalPosition:function(_dim,_event){
+ with(firebug){
+ var dim = _dim||lib.util.GetViewport();
+ el.main.environment.addStyle({ "top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px" });
+ el.mainiframe.environment.addStyle({ "top":dim.height-el.main.environment.getSize().offsetHeight+Math.max(document.documentElement.scrollTop,document.body.scrollTop)+"px" });
+ }
+ }
+ },
+ d: {
+ clean:function(_element){
+ with(firebug){
+ _element.update("");
+ }
+ },
+ console:{
+ addLine:function(){
+ with (firebug) {
+ return new lib.element("DIV").attribute.addClass("Row").insert(el.left.console.monitor);
+ }
+ },
+ cache:[],
+ clear:function(){
+ with(firebug){
+ d.clean(el.left.console.monitor);
+ d.console.cache = [];
+ }
+ },
+ formatArgs:function(){
+ with(firebug){
+ var content = [];
+ for(var i=0, len=arguments.length; i<len; i++){
+ content.push( d.highlight(arguments[i],false,false,true) );
+ }
+ return content.join(" ");
+ }
+ },
+ history:[], historyIndex:0,
+ openObject:function(_index){
+ with (firebug) {
+ d.dom.open(d.console.cache[_index], el.left.dom.container, lib.env.ie);
+ d.navigate("dom");
+ }
+ },
+ print: function(_cmd,_text){
+ with (firebug){
+ d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);
+ d.console.addLine().update(d.highlight(_text,false,false,true));
+ d.console.scroll();
+ }
+ },
+ printException: function(_exception){
+ with(firebug){
+ var message = _exception.description||_exception.message||_exception;
+ if(_exception.fileName){
+ message+=' ('+(_exception.name&&(_exception.name+', ')||'')+getFileName(_exception.fileName)+', '+_exception.lineNumber+')';
+ }
+ d.console.addLine().attribute.addClass("Error").update("<strong>Error: </strong>"+message,true);
+ }
+ },
+ eval:function(_cmd){
+ var result;
+ with(firebug){
+ if(_cmd.length==0)
+ return;
+
+ el.left.console.input.environment.getElement().value = "";
+ d.console.historyIndex = d.console.history.push(_cmd);
+
+ try {
+ if(_cmd==='console.firebug') {
+ d.console.addLine().attribute.addClass("Arrow").update(firebug.version);
+ } else {
+ result = eval.call(window,_cmd);
+ d.console.print(_cmd,result);
+ }
+ } catch(e){
+ d.console.addLine().attribute.addClass("Arrow").update(">>> "+_cmd);
+ d.console.printException(e);
+ }
+ d.console.scroll();
+ }
+ },
+ scroll:function(){
+ with(firebug){
+ el.left.console.monitor.environment.getElement().parentNode.scrollTop = Math.abs(el.left.console.monitor.environment.getSize().offsetHeight-(el.left.console.monitor.element.parentNode.offsetHeight-11));
+ }
+ },
+ run:function(_command){
+ with(firebug){
+ if(!env.init){
+ d.console.cache.push({ "command":_command, "arg":Array.prototype.slice.call(arguments,1) });
+ } else {
+ d.console.cmd[_command].apply(window,Array.prototype.slice.call(arguments,1));
+ }
+ }
+ },
+ toggleML:function(){
+ with(firebug){
+ var open = !env.ml;
+ env.ml = !env.ml;
+ d.navigateRightColumn("console",open);
+ el[open?"left":"right"].console.mlButton.environment.addStyle({ display:"none" });
+ el[!open?"left":"right"].console.mlButton.environment.addStyle({ display:"block" });
+ el.left.console.mlButton.attribute[(open?"add":"remove")+"Class"]("CloseML");
+ }
+ },
+ countMap:{}, timeMap: {},
+ cmd:{
+ log: function(_value){
+ with(firebug){
+ var args = d.console.formatArgs.apply(window,arguments);
+ d.console.addLine().attribute.addClass("Log").update(args);
+ d.console.scroll();
+ }
+ },
+ warn: function(_value){
+ with(firebug){
+ var args = d.console.formatArgs.apply(window,arguments);
+ d.console.addLine().attribute.addClass("Warn").update(args);
+ d.console.scroll();
+ }
+ },
+ info: function(_value){
+ with(firebug){
+ var args = d.console.formatArgs.apply(window,arguments);
+ d.console.addLine().attribute.addClass("Info").update(args);
+ d.console.scroll();
+ }
+ },
+ debug: function(_value){
+ with(firebug){
+ var args = d.console.formatArgs.apply(window,arguments);
+ d.console.addLine().attribute.addClass("Debug").update(args);
+ d.console.scroll();
+ }
+ },
+ error: function(_value){
+ with(firebug){
+ var args = d.console.formatArgs.apply(window,arguments);
+ d.console.addLine().attribute.addClass("Error").update(args);
+ d.console.scroll();
+ }
+ },
+ trace: function(_value){
+ with(firebug){
+ var stackAmt = 3, f = arguments.caller, isArray = lib.util.IsArray(f); //function that called trace
+
+ if((!isArray&&f)||(isArray&&f.length>0)){
+ d.console.addLine().attribute.addClass("Arrow").update(">>> console.trace(stack)");
+ for(var i=0;i<stackAmt;i++){
+ var func = f.toString(), args = f.arguments;
+ d.dom.open({"function":func, "arguments":args},d.console.addLine());
+ f = f.caller;
+ }
+ }
+ }
+ },
+ dir:function(_value){
+ with(firebug){
+ d.console.addLine().attribute.addClass("Arrow").update(">>> console.dir("+_value+")");
+ d.dom.open(_value,d.console.addLine());
+ }
+ },
+ dirxml: function(){
+ with(firebug){
+ d.console.cmd.log.apply(this, arguments);
+ }
+ },
+ time: function(_name){
+ with(firebug){
+ d.console.timeMap[_name] = new Date().getTime();
+ }
+ },
+ timeEnd: function(_name){
+ with(firebug){
+ if(_name in d.console.timeMap){
+ var delta = new Date().getTime() - d.console.timeMap[_name],
+ args = d.console.formatArgs.apply(window,[_name+":", delta+"ms"]);
+ d.console.addLine().attribute.addClass("log").update(args);
+ delete d.console.timeMap[_name];
+ }
+ }
+ },
+ count: function(_name){
+ with(firebug){
+ if(!d.console.countMap[_name])
+ d.console.countMap[_name] = 0;
+ d.console.countMap[_name]++;
+ d.console.cmd.log.apply(window, [_name, d.console.countMap[_name]]);
+ }
+ },
+ group:function(){
+ with(firebug){
+ d.console.cmd.log.apply(this, ["console.group is not supported"]);
+ }
+ },
+ groupEnd:function(){
+ with(firebug){
+ d.console.cmd.log.apply(this, ["console.groupEnd is not supported"]);
+ }
+ },
+ profile:function(){
+ with(firebug){
+ d.console.cmd.log.apply(this, ["console.profile is not supported"]);
+ }
+ },
+ profileEnd:function(){
+ with(firebug){
+ d.console.cmd.log.apply(this, ["console.profileEnd is not supported"]);
+ }
+ }
+ }
+ },
+ css:{
+ index:-1,
+ open:function(_index){
+ with (firebug) {
+ var item = env.targetWindow.document.styleSheets[_index],
+ uri = item.href;
+ try {
+ var rules = item[lib.env.ie ? "rules" : "cssRules"], str = "";
+ for (var i=0; i<rules.length; i++) {
+ var item = rules[i];
+ var selector = item.selectorText;
+ var cssText = lib.env.ie?item.style.cssText:item.cssText.match(/\{(.*)\}/)[1];
+ str+=d.css.printRule(selector, cssText.split(";"), el.left.css.container);
+ }
+ } catch(e) {
+ str="<em>Access to restricted URI denied</em>";
+ }
+ el.left.css.container.update(str);
+ }
+ },
+ printRule:function(_selector,_css,_layer){
+ with(firebug){
+ var str = "<div class='Selector'>"+_selector+" {</div>";
+ for(var i=0,len=_css.length; i<len; i++){
+ var item = _css[i];
+ str += "<div class='CSSText'>"+item.replace(/(.+\:)(.+)/,"<span class='CSSProperty'>$1</span><span class='CSSValue'>$2;</span>")+"</div>";
+ }
+ str+="<div class='Selector'>}</div>";
+ return str;
+ }
+ },
+ refresh:function(){
+ with(firebug){
+ el.button.css.selectbox.update("");
+ var collection = env.targetWindow.document.styleSheets;
+ for(var i=0,len=collection.length; i<len; i++){
+ var uri = getFileName(collection[i].href);
+ d.css.index=d.css.index<0?i:d.css.index;
+ el.button.css.selectbox.child.add(
+ new lib.element("OPTION").attribute.set("value",i).update(uri)
+ )
+ };
+ d.css.open(d.css.index);
+ }
+ }
+ },
+ dom: {
+ open: function(_object,_layer){
+ with (firebug) {
+ _layer.clean();
+ var container = new lib.element("DIV").attribute.addClass("DOMContent").insert(_layer);
+ d.dom.print(_object, container);
+ }
+ },
+ print:function(_object,_parent, _inTree){
+ with (firebug) {
+ var obj = _object || window, parentElement = _parent;
+ parentElement.update("");
+
+ if(parentElement.opened&&parentElement!=el.left.dom.container){
+ parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.removeClass("Opened");
+ parentElement.opened = false;
+ parentElement.environment.addStyle({ "display":"none" });
+ return;
+ }
+ if(_inTree)
+ parentElement.environment.getParent().lib.child.get()[0].lib.child.get()[0].lib.attribute.addClass("Opened");
+ parentElement.opened = true;
+
+ for (var key in obj) {
+ try {
+ if (env.hideDOMFunctions && typeof(obj[key]) == "function") continue;
+ var value = obj[key], property = key, container = new lib.element("DIV").attribute.addClass("DOMRow").insert(parentElement),
+ left = new lib.element("DIV").attribute.addClass("DOMRowLeft").insert(container), right = new lib.element("DIV").attribute.addClass("DOMRowRight").insert(container);
+
+ container.child.add(
+ new lib.element("DIV").attribute.addClass('Clear')
+ );
+
+ var link = new lib.element("A").attribute.addClass(
+ typeof value=="object"&&Boolean(value)?"Property Object":"Property"
+ ).update(property).insert(left);
+
+ right.update(d.highlight(value,false,true));
+
+ var subContainer = new lib.element("DIV").attribute.addClass("DOMRowSubContainer").insert(container);
+
+ if(typeof value!="object"||Boolean(value)==false)
+ continue;
+
+ link.event.addListener("click",lib.util.Curry(d.dom.print,window,value, subContainer, true));
+ }catch(e){
+ }
+ }
+ parentElement.environment.addStyle({ "display":"block" });
+ }
+ }
+ },
+ highlight:function(_value,_inObject,_inArray,_link){
+ with(firebug){
+ var isArray = false, isHash, isElement = false, vtype=typeof _value, result=[];
+
+ if(vtype=="object"){
+ if(Object.prototype.toString.call(_value) === "[object Date]"){
+ vtype = "date";
+ } else if(Object.prototype.toString.call(_value) === "[object String]"){
+ vtype = "string";
+ } else if(Object.prototype.toString.call(_value) === "[object Boolean]"){
+ vtype = "boolean";
+ } else if(Object.prototype.toString.call(_value) === "[object RegExp]"){
+ vtype = "regexp";
+ }
+ }
+
+ try {
+ isArray = lib.util.IsArray(_value);
+ isHash = lib.util.IsHash(_value);
+ isElement = _value!=undefined&&Boolean(_value.nodeName)&&Boolean(_value.nodeType);
+
+ // number, string, boolean, null, function
+ if(_value==null||vtype=="number"||vtype=="string"||vtype=="boolean"||vtype=="function"||vtype=="regexp"||vtype=="date"){
+ if(_value==null){
+ result.push("<span class='Null'>null</span>");
+ }else if (vtype=="regexp") {
+ result.push("<span class='Maroon'>" + _value + "</span>");
+ }else if (vtype=="date") {
+ result.push("<span class='DarkBlue'>'" + _value + "'</span>");
+ } else if (vtype=="boolean"||vtype=="number") {
+ result.push("<span class='DarkBlue'>" + _value + "</span>");
+ } else if(vtype=="function"){
+ result.push("<span class='"+(_inObject?"Italic Gray":"Green")+"'>function()</span>");
+ } else {
+ result.push("<span class='Red'>\""+( !_inObject&&!_inArray?_value : _value.substring(0,35)+(_value.length>35?" ...":"") ).replace(/\n/g,"\\n").replace(/\s/g,"&nbsp;").replace(/>/g,"&#62;").replace(/</g,"&#60;")+"\"</span>");
+ }
+ }
+ // element
+ else if(isElement){
+
+ if(_value.nodeType==3)
+ result.push(d.highlight(_value.nodeValue));
+ else if(_inObject){
+ result.push("<span class='Gray Italic'>"+_value.nodeName.toLowerCase()+"</span>");
+ } else {
+ result.push("<span class='Blue"+ ( !_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.html.inspect(firebug.d.console.cache[" +( d.console.cache.push( _value ) -1 )+"])'" ) + "'>");
+
+ if(_inArray){
+ result.push(_value.nodeName.toLowerCase());
+ if(_value.getAttribute){
+ if(_value.getAttribute&&_value.getAttribute("id"))
+ result.push("<span class='DarkBlue'>#"+_value.getAttribute("id")+"</span>");
+ var elClass = _value.getAttribute(lib.env.ie&&!lib.env.ie8?"className":"class")||"";
+ result.push(!elClass?"":"<span class='Red'>."+elClass.split(" ")[0]+"</span>");
+ }
+ result.push("</span>");
+ } else {
+ result.push("<span class='DarkBlue'>&#60;<span class='Blue TagName'>"+ _value.nodeName.toLowerCase());
+
+ if(_value.attributes){
+ for(var i=0,len=_value.attributes.length; i<len; i++){
+ var item = _value.attributes[i];
+
+ if(!lib.env.ie||item.nodeValue)
+ result.push(" <span class='DarkBlue'>"+item.nodeName+"=\"<span class='Red'>"+item.nodeValue+"</span>\"</span>");
+ }
+ }
+
+ result.push("</span>&#62;</span>");
+ }
+ }
+ }
+ // array, hash
+ else if(isArray||isHash){
+ if(isArray){
+ if(_inObject){
+ result.push("<span class='Gray Italic'>["+_value.length+"]</span>");
+ } else {
+ result.push("<span class='Strong'>[ ");
+
+ for(var i=0,len=_value.length; i<len; i++){
+ if((_inObject||_inArray)&&i>3){
+ result.push(", <span class='Strong Gray'>"+(len-4)+" More...</span>");
+ break;
+ }
+ result.push( (i > 0 ? ", " : "") + d.highlight(_value[i], false, true, true) );
+ }
+
+ result.push(" ]</span>");
+ }
+ } else if(_inObject){
+ result.push("<span class='Gray Italic'>Object</span>");
+ } else {
+ result.push("<span class='Strong Green"+ ( !_link?"'":" ObjectLink' onmouseover='this.className=this.className.replace(\"ObjectLink\",\"ObjectLinkHover\")' onmouseout='this.className=this.className.replace(\"ObjectLinkHover\",\"ObjectLink\")' onclick='firebug.d.console.openObject(" +( d.console.cache.push( _value ) -1 )+")'" ) + ">Object");
+ var i=0;
+ for(var key in _value){
+ var value = _value[key];
+ if((_inObject||_inArray)&&i>3){
+ result.push(" <span class='Strong Gray'>More...</span>");
+ break;
+ }
+ result.push(" "+key+"="+d.highlight(value,true));
+ i++;
+ }
+ result.push("</span>");
+ }
+ } else {
+ result.push(["<span class'Gray Italic'>"+_value+"</span>"]);
+ }
+ } catch(e){
+ result.push("..");
+ }
+ return result.join("");
+ }
+ },
+ html:{
+ nIndex:"computedStyle",
+ current:null,
+ highlight:function(_element,_clear,_event){
+ with(firebug){
+ if(_element.firebugElement){
+ return;
+ }
+ if(_clear){
+ env.targetWindow.firebug.el.bgInspector.environment.addStyle({ "display":"none" });
+ return;
+ }
+ d.inspector.inspect(_element,true);
+ }
+ },
+ inspect:function(_element){
+ var map = [],
+ parentLayer,
+ t,
+ tagName,
+ parent = _element;
+ while (parent) {
+ map.push(parent);
+ if (parent == firebug.env.targetWindow.document.body) break;
+ parent = parent.parentNode;
+ }
+ map = map.reverse();
+ with(firebug) {
+ if (env.dIndex != "html") {
+ env.targetWindow.firebug.d.navigate("html");
+ }
+
+ env.targetWindow.firebug.d.inspector.toggle(false);
+
+ for (t = 0; t < el.left.html.container.child.get().length; t++) {
+ if (el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0]) {
+ if (el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText) {
+ tagName = el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].innerText;
+ } else {
+ tagName = el.left.html.container.child.get()[t].childNodes[0].childNodes[1].childNodes[0].childNodes[0].textContent;
+ }
+
+ if (/<body/i.test(tagName)) {
+ parentLayer = el.left.html.container.child.get()[t].childNodes[1].lib;
+ break;
+ }
+ }
+ }
+
+ if (!parentLayer) {
+ parentLayer = el.left.html.container.child.get()[3].childNodes[1].lib;
+ }
+
+ for (t = 0, len = map.length; map[t]; t++) {
+ if (t == len - 1) {
+ var link = parentLayer.environment.getElement().previousSibling.lib;
+ link.attribute.addClass("Selected");
+
+ if (d.html.current) {
+ d.html.current[1].attribute.removeClass("Selected");
+ }
+ d.html.current = [_element, link];
+ return;
+ }
+ parentLayer = d.html.openHtmlTree(map[t], parentLayer, map[t + 1]);
+ }
+ }
+ },
+ navigate:function(_index,_element){
+ with(firebug){
+ el.right.html.nav[d.html.nIndex].attribute.removeClass("Selected");
+ el.right.html.nav[_index].attribute.addClass("Selected");
+ d.html.nIndex = _index;
+ d.html.openProperties();
+ }
+ },
+ openHtmlTree:function(_element,_parent,_returnParentElementByElement,_event){
+ with(firebug){
+ var element = _element || env.targetWindow.document.documentElement,
+ parent = _parent || el.left.html.container,
+ returnParentEl = _returnParentElementByElement || null,
+ returnParentVal = null,
+ len = element.childNodes.length,
+ nodeLink;
+
+ if(parent!=el.left.html.container){
+ nodeLink = parent.environment.getParent().lib.child.get()[0].lib;
+ if (d.html.current) {
+ d.html.current[1].attribute.removeClass("Selected");
+ }
+ nodeLink.attribute.addClass("Selected");
+
+ d.html.current = [_element,nodeLink];
+ d.html.openProperties();
+ };
+
+ if(element.childNodes&&(len==0||(len==1&&element.childNodes[0].nodeType==3)))return;
+ parent.clean();
+
+ if(parent.opened&&Boolean(_returnParentElementByElement)==false){
+ parent.opened = false;
+ parent.element.previousSibling.lib.attribute.removeClass("Open");
+ parent.element.lib.attribute.removeClass("OpenSubContainer");
+ return;
+ };
+
+ if (parent != el.left.html.container) {
+ parent.element.previousSibling.lib.attribute.addClass("Open");
+ parent.element.lib.attribute.addClass("OpenSubContainer");
+ parent.opened = true;
+ };
+
+ if(element==document.documentElement){
+ new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;<span class='Blue'>html</span>&#62;").insert(parent);
+ };
+
+ for(var i=0; i<=len; i++){
+ if(i==len){
+ new lib.element("A").attribute.addClass("Block").update("<span class='DarkBlue'>&#60;/<span class='Blue'>"+element.nodeName.toLowerCase()+"</span>&#62;").insert(container);
+ break;
+ }
+ var item = element.childNodes[i];
+
+ if (item.nodeType != 3){
+ var container = new lib.element().attribute.addClass("Block").insert(parent),
+ link = new lib.element("A").attribute.addClass("Link").insert(container),
+ spacer = new lib.element("SPAN").attribute.addClass("Spacer").update("&nbsp;").insert(link),
+ html = new lib.element("SPAN").attribute.addClass("Content").update(d.highlight(item)).insert(link),
+ subContainer = new lib.element("DIV").attribute.addClass("SubContainer").insert(container),
+ view = lib.util.Element.getView(item);
+
+ link.event.addListener("click", lib.util.Curry(d.html.openHtmlTree, window, item, subContainer, false));
+ link.event.addListener("mouseover", lib.util.Curry(d.html.highlight, window, item, false));
+ link.event.addListener("mouseout", lib.util.Curry(d.html.highlight, window, item, true));
+
+ returnParentVal = returnParentEl == item ? subContainer : returnParentVal;
+
+ if(d.html.current==null&&item==document.body){
+ link.attribute.addClass("Selected");
+ d.html.current = [item,link];
+ d.html.openHtmlTree(item,subContainer);
+ }
+
+ if(element.nodeName!="HEAD"&&element!=document.documentElement&&(view.visibility=="hidden"||view.display=="none")){
+ container.attribute.addClass("Unvisible");
+ };
+
+ if (item.childNodes){
+ var childLen = item.childNodes.length;
+ if (childLen == 1 && item.childNodes[0].nodeType == 3) {
+ html.child.add(document.createTextNode(item.childNodes[0].nodeValue.substring(0, 50)));
+ html.child.add(document.createTextNode("</"));
+ html.child.add(new lib.element("span").attribute.addClass("Blue").update(item.nodeName.toLowerCase()).environment.getElement());
+ html.child.add(document.createTextNode(">"));
+ continue;
+ }
+ else
+ if (childLen > 0) {
+ link.attribute.addClass("Parent");
+ }
+ }
+ }
+ };
+ return returnParentVal;
+ }
+ },
+ openProperties:function(){
+ with(firebug){
+ var index = d.html.nIndex;
+ var node = d.html.current[0];
+ d.clean(el.right.html.content);
+ var str = "";
+ switch(index){
+ case "computedStyle":
+ var property = ["opacity","filter","azimuth","background","backgroundAttachment","backgroundColor","backgroundImage","backgroundPosition","backgroundRepeat","border","borderCollapse","borderColor","borderSpacing","borderStyle","borderTop","borderRight","borderBottom","borderLeft","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor","borderTopStyle","borderRightStyle","borderBottomStyle","borderLeftStyle","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderWidth","bottom","captionSide","clear","clip","color","content","counterIncrement","counterReset","cue","cueAfter","cueBefore","cursor","direction","display","elevation","emptyCells","cssFloat","font","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","height","left","letterSpacing","lineHeight","listStyle","listStyleImage","listStylePosition","listStyleType","margin","marginTop","marginRight","marginBottom","marginLeft","markerOffset","marks","maxHeight","maxWidth","minHeight","minWidth","orphans","outline","outlineColor","outlineStyle","outlineWidth","overflow","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","page","pageBreakAfter","pageBreakBefore","pageBreakInside","pause","pauseAfter","pauseBefore","pitch","pitchRange","playDuring","position","quotes","richness","right","size","speak","speakHeader","speakNumeral","speakPunctuation","speechRate","stress","tableLayout","textAlign","textDecoration","textIndent","textShadow","textTransform","top","unicodeBidi","verticalAlign","visibility","voiceFamily","volume","whiteSpace","widows","width","wordSpacing","zIndex"].sort();
+ var view = document.defaultView?document.defaultView.getComputedStyle(node,null):node.currentStyle;
+ for(var i=0,len=property.length; i<len; i++){
+ var item = property[i];
+ if(!view[item])continue;
+ str+="<div class='CSSItem'><div class='CSSProperty'>"+item+"</div><div class='CSSValue'>"+d.highlight(view[item])+"</div></div>";
+ }
+ el.right.html.content.update(str);
+ break;
+ case "dom":
+ d.dom.open(node,el.right.html.content,lib.env.ie);
+ break;
+ }
+ }
+ }
+ },
+ inspector:{
+ enabled:false,
+ el:null,
+ inspect:function(_element,_bgInspector){
+ with(firebug){
+ var pos = env.targetWindow.firebug.lib.util.Element.getPosition(_element);
+
+ env.targetWindow.firebug.el[_bgInspector&&"bgInspector"||"borderInspector"].environment.addStyle({
+ "width":_element.offsetWidth+"px", "height":_element.offsetHeight+"px",
+ "top":pos.offsetTop-(_bgInspector?0:2)+"px", "left":pos.offsetLeft-(_bgInspector?0:2)+"px",
+ "display":"block"
+ });
+9
+ if(!_bgInspector){
+ d.inspector.el = _element;
+ }
+ };
+ },
+ toggle:function(_absoluteValue,_event){
+ with (firebug) {
+ if(_absoluteValue==d.inspector.enabled)
+ return;
+ d.inspector.enabled = _absoluteValue!=undefined&&!_absoluteValue.clientX?_absoluteValue:!d.inspector.enabled;
+ el.button.inspect.attribute[(d.inspector.enabled ? "add" : "remove") + "Class"]("Enabled");
+ if(d.inspector.enabled==false){
+ el.borderInspector.environment.addStyle({ "display":"none" });
+ d.inspector.el = null;
+ } else if(lib.env.dIndex!="html") {
+ if (env.popupWin) {
+ env.popupWin.firebug.d.navigate("html");
+ } else {
+ d.navigate("html");
+ }
+ }
+ }
+ }
+ },
+ scripts:{
+ index:-1,
+ lineNumbers:false,
+ open:function(_index){
+ with(firebug){
+ d.scripts.index = _index;
+ el.left.scripts.container.update("");
+ var script = document.getElementsByTagName("script")[_index],uri = script.src||document.location.href,source;
+ try {
+ if(uri!=document.location.href){
+ source = env.cache[uri]||lib.xhr.get(uri).responseText;
+ env.cache[uri] = source;
+ } else {
+ source = script.innerHTML;
+ }
+ source = source.replace(/<|>/g,function(_ch){
+ return ({"<":"&#60;",">":"&#62;"})[_ch];
+ });
+
+ if(!d.scripts.lineNumbers)
+ el.left.scripts.container.child.add(
+ new lib.element("DIV").attribute.addClass("CodeContainer").update(source)
+ );
+ else {
+ source = source.split("<br />");
+ for (var i = 0; i < source.length; i++) {
+ el.left.scripts.container.child.add(new lib.element("DIV").child.add(new lib.element("DIV").attribute.addClass("LineNumber").update(i + 1), new lib.element("DIV").attribute.addClass("Code").update("&nbsp;" + source[i]), new lib.element("DIV").attribute.addClass('Clear')));
+ };
+ };
+ } catch(e){
+ el.left.scripts.container.child.add(
+ new lib.element("DIV").attribute.addClass("CodeContainer").update("<em>Access to restricted URI denied</em>")
+ );
+ }
+ }
+ },
+ toggleLineNumbers:function(){
+ with(firebug){
+ d.scripts.lineNumbers = !d.scripts.lineNumbers;
+ el.button.scripts.lineNumbers.attribute[(d.scripts.lineNumbers ? "add" : "remove") + "Class"]("Enabled");
+ d.scripts.open( d.scripts.index );
+ }
+ },
+ refresh:function(){
+ with(firebug){
+ el.button.scripts.selectbox.clean();
+ var collection = env.targetWindow.document.getElementsByTagName("script");
+ for(var i=0,len=collection.length; i<len; i++){
+ var item = collection[i],
+ fileName = getFileName(item.src||item.baseURI||"..");
+ d.scripts.index=d.scripts.index<0?i:d.scripts.index;
+ el.button.scripts.selectbox.child.add(
+ new lib.element("OPTION").attribute.set("value",i).update(fileName)
+ );
+ }
+ d.scripts.open( d.scripts.index );
+ }
+ }
+ },
+ str: {
+ open:function(_str){
+ with(firebug){
+ d.navigate("str");
+ el.left.str.container.update(_str.replace(/\n/g,"<br />"))
+ }
+ }
+ },
+ xhr:{
+ objects:[],
+ addObject:function(){
+ with(firebug){
+ for(var i=0,len=arguments.length; i<len; i++){
+ try {
+ var item = arguments[i],
+ val = env.targetWindow.eval(item);
+ d.xhr.objects.push([item, val]);
+ } catch(e){
+ continue;
+ }
+ }
+ }
+ },
+ open:function(){
+ with(firebug){
+ el.left.xhr.container.update("");
+ el.left.xhr.name = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({ "width":"20%" }).insert(el.left.xhr.container));
+ el.left.xhr.nameTitle = new lib.element("STRONG").update("Object Name:").insert(el.left.xhr.name);
+ el.left.xhr.nameContent = new lib.element("DIV").insert(el.left.xhr.name);
+ el.left.xhr.status = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").attribute.addClass("Block").environment.addStyle({ "width":"10%" }).insert(el.left.xhr.container));
+ el.left.xhr.statusTitle = new lib.element("STRONG").update("Status:").insert(el.left.xhr.status);
+ el.left.xhr.statusContent = new lib.element("DIV").insert(el.left.xhr.status);
+ el.left.xhr.readystate = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({ "width":"15%" }).attribute.addClass("Block").insert(el.left.xhr.container));
+ el.left.xhr.readystateTitle =el.left.xhr.nameTitle = new lib.element("STRONG").update("Ready State:").insert(el.left.xhr.readystate);
+ el.left.xhr.readystateContent = new lib.element("DIV").insert(el.left.xhr.readystate);
+ el.left.xhr.response = new lib.element("DIV").attribute.addClass("BlockContent").insert(new lib.element("DIV").environment.addStyle({ "width":(lib.env.ie?"50":"55")+"%" }).attribute.addClass("Block").insert(el.left.xhr.container));
+ el.left.xhr.responseTitle = new lib.element("STRONG").update("Response:").insert(el.left.xhr.response);
+ el.left.xhr.responseContent = new lib.element("DIV").insert(el.left.xhr.response);
+ setTimeout(d.xhr.refresh,500);
+ }
+ },
+ refresh:function(){
+ with(firebug){
+ el.left.xhr.nameContent.update("");
+ el.left.xhr.statusContent.update("");
+ el.left.xhr.readystateContent.update("");
+ el.left.xhr.responseContent.update("");
+ for(var i=0,len=d.xhr.objects.length; i<len; i++){
+ var item = d.xhr.objects[i],
+ response = item[1].responseText;
+ if(Boolean(item[1])==false)continue;
+ el.left.xhr.nameContent.child.add(new lib.element("span").update(item[0]));
+ try {
+ el.left.xhr.statusContent.child.add(new lib.element("span").update(item[1].status));
+ } catch(e){ el.left.xhr.statusContent.child.add(new lib.element("span").update("&nbsp;")); }
+ el.left.xhr.readystateContent.child.add(new lib.element("span").update(item[1].readyState));
+
+ el.left.xhr.responseContent.child.add(new lib.element("span").child.add(
+ new lib.element("A").event.addListener("click",lib.util.Curry(d.str.open,window,response)).update("&nbsp;"+response.substring(0,50))
+ ));
+ };
+ if(env.dIndex=="xhr")
+ setTimeout(d.xhr.refresh,500);
+ }
+ }
+ },
+ navigateRightColumn:function(_index,_open){
+ with(firebug){
+ el.left.container.environment.addStyle({ "width":_open?"70%":"100%" });
+ el.right.container.environment.addStyle({ "display":_open?"block":"none" });
+ }
+ },
+ navigate:function(_index){
+ with(firebug){
+ var open = _index, close = env.dIndex;
+ env.dIndex = open;
+
+ settings.hide();
+
+ el.button[close].container.environment.addStyle({ "display":"none" });
+ el.left[close].container.environment.addStyle({ "display":"none" });
+ el.right[close].container.environment.addStyle({ "display":"none" });
+
+ el.button[open].container.environment.addStyle({ "display":"inline" });
+ el.left[open].container.environment.addStyle({ "display":"block" });
+ el.right[open].container.environment.addStyle({ "display":"block" });
+
+ if(el.nav[close])
+ el.nav[close].attribute.removeClass("Selected");
+ if(el.nav[open])
+ el.nav[open].attribute.addClass("Selected");
+
+ switch(open){
+ case "console":
+ d.navigateRightColumn(_index);
+ break;
+ case "html":
+ d.navigateRightColumn(_index,true);
+ if(!d.html.current){
+ var t=Number(new Date);
+ d.html.openHtmlTree();
+ }
+ break;
+ case "css":
+ d.navigateRightColumn(_index,true);
+ d.css.refresh();
+ break;
+ case "scripts":
+ d.navigateRightColumn(_index);
+ d.scripts.refresh();
+ break;
+ case "dom":
+ d.navigateRightColumn(_index);
+ if(el.left.dom.container.environment.getElement().innerHTML==""){
+ var t=Number(new Date);
+ d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);
+ }
+ break;
+ case "xhr":
+ d.navigateRightColumn(_index);
+ d.xhr.open();
+ break;
+ }
+ }
+ }
+ },
+ getFileName:function(_path){
+ var match = _path&&_path.match(/[\w\-\.\?\=\&]+$/);
+ return match&&match[0]||_path;
+ },
+ cancelEvent:function(_event){
+ if(_event.stopPropagation)
+ _event.stopPropagation();
+ if(_event.preventDefault)
+ _event.preventDefault();
+ },
+ getSelection:function(_el){
+ with(firebug){
+ if(lib.env.ie){
+ var range = document.selection.createRange(),stored = range.duplicate();
+ stored.moveToElementText(_el);
+ stored.setEndPoint('EndToEnd', range);
+ _el.selectionStart = stored.text.length - range.text.length;
+ _el.selectionEnd = _el.selectionStart + range.text.length;
+ }
+ return {
+ start:_el.selectionStart,
+ length:_el.selectionEnd-_el.selectionStart
+ }
+ }
+ },
+ tab:function(_el,_event){
+ with(firebug){
+ if(_event.keyCode==9){
+ if(_el.setSelectionRange){
+ var position = firebug.getSelection(_el);
+ _el.value = _el.value.substring(0,position.start) + String.fromCharCode(9) + _el.value.substring(position.start+position.length,_el.value.length);
+ _el.setSelectionRange(position.start+1,position.start+1);
+ } else if(document.selection) {
+ var range = document.selection.createRange(), isCollapsed = range.text == '';
+ range.text = String.fromCharCode(9);
+ range.moveStart('character', -1);
+ }
+ firebug.cancelEvent(_event);
+ if(lib.env.ie)
+ setTimeout(_el.focus,100);
+ };
+ }
+ },
+ listen: {
+ addXhrObject:function(){
+ with(firebug){
+ d.xhr.addObject.apply(env.targetWindow, el.button.xhr.textbox.environment.getElement().value.split(","));
+ }
+ },
+ consoleTextbox:function(_event){
+ with(firebug){
+ if(_event.keyCode==13&&(env.multilinemode==false||_event.shiftKey==false)){
+ d.console.historyIndex = d.console.history.length;
+ d.console.eval(el.left.console.input.environment.getElement().value);
+ return false;
+ }
+
+ switch(_event.keyCode){
+ case 40:
+ if(d.console.history[d.console.historyIndex+1]){
+ d.console.historyIndex+=1;
+ el.left.console.input.update( d.console.history[d.console.historyIndex] );
+ }
+ break;
+ case 38:
+ if(d.console.history[d.console.historyIndex-1]){
+ d.console.historyIndex-=1;
+ el.left.console.input.update( d.console.history[d.console.historyIndex] );
+ }
+ break;
+ }
+ }
+ },
+ cssSelectbox:function(){
+ with(firebug){
+ d.css.open(el.button.css.selectbox.environment.getElement().selectedIndex);
+ }
+ },
+ domTextbox:function(_event){
+ with(firebug){
+ if(_event.keyCode==13){
+ d.dom.open(eval(el.button.dom.textbox.environment.getElement().value),el.left.dom.container);
+ }
+ }
+ },
+ inspector:function(){
+ with(firebug){
+ if (env.popupWin) {
+ env.popupWin.firebug.d.html.inspect(firebug.d.inspector.el);
+ } else {
+ firebug.d.html.inspect(firebug.d.inspector.el);
+ }
+ }
+ },
+ keyboard:function(_event){
+ with(firebug){
+ if(_event.keyCode==27 && d.inspector.enabled){
+ d.inspector.toggle();
+ } else if(_event.keyCode === 123 && _event.ctrlKey || _event.metaKey) {
+ if(env.isPopup){
+ win.dock();
+ }else {
+ win.newWindow();
+ }
+ } else if(
+ (_event.keyCode === 123 && !_event.ctrlKey && !_event.metaKey) ||
+ (_event.keyCode === 76 && (_event.ctrlKey || _event.metaKey) && _event.shiftKey) ||
+ (_event.keyCode === 13 && _event.shiftKey)) {
+
+ if(env.isPopup){
+ win.dock();
+ } else if (el.main.environment.getStyle("display") === 'none') {
+ win.show();
+ } else {
+ win.hide();
+ }
+ }
+ }
+ },
+ mouse:function(_event){
+ with(firebug){
+ var target;
+
+ if(document.elementFromPoint) {
+ target = document.elementFromPoint(_event.clientX, _event.clientY);
+ } else {
+ if(lib.env.ie) {
+ target = _event.srcElement;
+ } else {
+ target = _event.explicitOriginalTarget || _event.target;
+ }
+ }
+
+ if( d.inspector.enabled&&
+ target!=document.body&&
+ target!=document.firstChild&&
+ target!=document.childNodes[1]&&
+ target!=el.borderInspector.environment.getElement()&&
+ target!=el.main.environment.getElement()&&
+ target.offsetParent!=el.main.environment.getElement() ) {
+ d.inspector.inspect(target);
+ }
+ }
+ },
+ runMultiline:function(){
+ with(firebug){
+ d.console.eval.call(window,el.right.console.input.environment.getElement().value);
+ }
+ },
+ runCSS:function(){
+ with(firebug){
+ var source = el.right.css.input.environment.getElement().value.replace(/\n|\t/g,"").split("}");
+ for(var i=0, len=source.length; i<len; i++){
+ var item = source[i]+"}", rule = !lib.env.ie?item:item.split(/{|}/),
+ styleSheet = document.styleSheets[0];
+ console.log(rule);
+ if(item.match(/.+\{.+\}/)){
+ if(lib.env.ie)
+ styleSheet.addRule(rule[0],rule[1]);
+ else
+ styleSheet.insertRule( rule, styleSheet.cssRules.length );
+ }
+ }
+ }
+ },
+ scriptsSelectbox:function(){
+ with(firebug){
+ d.scripts.open(parseInt(el.button.scripts.selectbox.environment.getElement().value));
+ }
+ },
+ xhrTextbox:function(_event){
+ with(firebug){
+ if(_event.keyCode==13){
+ d.xhr.addObject.apply(env.targetWindow, el.button.xhr.textbox.environment.getElement().value.split(","));
+ }
+ }
+ }
+ }
+};
+
+(function(_scope){
+ _scope.lib = {};
+ var pi = _scope.lib; pi.version = [1.1,2008091000];
+
+ pi.env = {
+ ie: /MSIE/i.test(navigator.userAgent),
+ ie6: /MSIE 6/i.test(navigator.userAgent),
+ ie7: /MSIE 7/i.test(navigator.userAgent),
+ ie8: /MSIE 8/i.test(navigator.userAgent),
+ firefox: /Firefox/i.test(navigator.userAgent),
+ opera: /Opera/i.test(navigator.userAgent),
+ webkit: /Webkit/i.test(navigator.userAgent),
+ camino: /Camino/i.test(navigator.userAgent)
+ };
+
+ pi.get = function(){
+ return document.getElementById(arguments[0]);
+ };
+ pi.get.byTag = function(){
+ return document.getElementsByTagName(arguments[0]);
+ };
+ pi.get.byClass = function(){ return document.getElementsByClassName.apply(document,arguments); };
+
+ pi.util = {
+ Array:{
+ clone:function(_array,_undeep){
+ var tmp = [];
+ Array.prototype.push.apply(tmp,_array);
+ pi.util.Array.forEach(tmp,function(_item,_index,_source){
+ if(_item instanceof Array&&!_undeep)
+ _source[_index] = pi.util.Array.clone(_source[_index]);
+ });
+ return tmp;
+ },
+ count:function(_array,_value){
+ var count = 0;
+ pi.util.Array.forEach(_array,function(){
+ count+=Number(arguments[0]==_value);
+ });
+ return count;
+ },
+ forEach:function(_array,_function){
+ if(_array.forEach)
+ return _array.forEach(_function);
+ for(var i=0,len=_array.length; i<len; i++)
+ _function.apply(_array,[_array[i],i,_array]);
+ },
+ getLatest:function(_array){
+ return _array[_array.length-1];
+ },
+ indexOf:function(_array,_value){
+ if(!pi.env.ie){
+ return _array.indexOf(_value);
+ };
+
+ var index = -1;
+ for(var i=0, len=_array.length; i<len; i++){
+ if(_array[i]==_value){
+ index = i;
+ break;
+ }
+ }
+ return index;
+ },
+ remove:function(_array,_index){
+ var result = _array.slice(0,_index);
+ _array = Array.prototype.push.apply(result,_array.slice(_index+1));
+ return result;
+ }
+ },
+ Curry:function(_fn,_scope){
+ var fn = _fn, scope = _scope||window, args = Array.prototype.slice.call(arguments,2);
+ return function(){
+ return fn.apply(scope,args.concat( Array.prototype.slice.call(arguments,0) ));
+ };
+ },
+ Extend:function(_superClass,_prototype,_skipClonning){
+ var object = new pi.base;
+ if(_prototype["$Init"]){
+ object.init = _prototype["$Init"];
+ delete _prototype["$Init"];
+ };
+
+ object.body = _superClass==pi.base?_prototype:pi.util.Hash.merge(_prototype,_superClass.prototype);
+ object.init=object.init||function(){
+ if(_superClass!=pi.base)
+ _superClass.apply(this,arguments);
+ };
+
+ return object.build(_skipClonning);
+ },
+ IsArray:function(_object){
+ if(_object===null){
+ return false;
+ }
+ if(window.NodeList&&window.NamedNodeMap&&!pi.env.ie8){
+ if(_object instanceof Array||_object instanceof NodeList||_object instanceof NamedNodeMap||(window.HTMLCollection&&_object instanceof HTMLCollection))
+ return true;
+ };
+ if(!_object||_object==window||typeof _object=="function"||typeof _object=="string"||typeof _object.length!="number"){
+ return false
+ };
+ var len = _object.length;
+ if(len>0&&_object[0]!=undefined&&_object[len-1]!=undefined){
+ return true;
+ } else {
+ for(var key in _object){
+ if(key!="item"&&key!="length"&&key!="setNamedItemNS"&&key!="setNamedItem"&&key!="getNamedItem"&&key!="removeNamedItem"&&key!="getNamedItemNS"&&key!="removeNamedItemNS"&&key!="tags"){
+ return false;
+ }
+ }
+ return true
+ };
+ },
+ IsHash:function(_object){
+ return _object && typeof _object=="object"&&(_object==window||_object instanceof Object)&&!_object.nodeName&&!pi.util.IsArray(_object)
+ },
+ Init:[],
+ AddEvent: function(_element,_eventName,_fn,_useCapture){
+ _element[pi.env.ie?"attachEvent":"addEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);
+ return pi.util.Curry(pi.util.AddEvent,this,_element);
+ },
+ RemoveEvent: function(_element,_eventName,_fn,_useCapture){
+ _element[pi.env.ie?"detachEvent":"removeEventListener"]((pi.env.ie?"on":"")+_eventName,_fn,_useCapture||false);
+ return pi.util.Curry(pi.util.RemoveEvent,this,_element);
+ },
+ Element:{
+ addClass:function(_element,_class){
+ if( !pi.util.Element.hasClass(_element,_class) )
+ pi.util.Element.setClass(_element, pi.util.Element.getClass(_element) + " " + _class );
+ },
+ getClass:function(_element){
+ return _element.getAttribute(pi.env.ie&&!pi.env.ie8?"className":"class")||"";
+ },
+ hasClass:function(_element,_class){
+ return pi.util.Array.indexOf(pi.util.Element.getClass(_element).split(" "),_class)>-1;
+ },
+ removeClass:function(_element,_class){
+ if( pi.util.Element.hasClass(_element,_class) ){
+ var names = pi.util.Element.getClass(_element,_class).split(" ");
+ pi.util.Element.setClass(
+ _element,
+ pi.util.Array.remove(names,pi.util.Array.indexOf(names,_class)).join(" ")
+ );
+ }
+ },
+ setClass:function(_element,_value){
+ if(pi.env.ie8){
+ _element.setAttribute("className", _value );
+ _element.setAttribute("class", _value );
+ } else {
+ _element.setAttribute(pi.env.ie?"className":"class", _value );
+ }
+ },
+ toggleClass:function(){
+ if(pi.util.Element.hasClass.apply(this,arguments))
+ pi.util.Element.removeClass.apply(this,arguments);
+ else
+ pi.util.Element.addClass.apply(this,arguments);
+ },
+ getOpacity:function(_styleObject){
+ var styleObject = _styleObject;
+ if(!pi.env.ie)
+ return styleObject["opacity"];
+
+ var alpha = styleObject["filter"].match(/opacity\=(\d+)/i);
+ return alpha?alpha[1]/100:1;
+ },
+ setOpacity:function(_element,_value){
+ if(!pi.env.ie)
+ return pi.util.Element.addStyle(_element,{ "opacity":_value });
+ _value*=100;
+ pi.util.Element.addStyle(_element,{ "filter":"alpha(opacity="+_value+")" });
+ return this._parent_;
+ },
+ getPosition:function(_element){
+ var parent = _element,offsetLeft = document.body.offsetLeft, offsetTop = document.body.offsetTop, view = pi.util.Element.getView(_element);
+ while(parent&&parent!=document.body&&parent!=document.firstChild){
+ offsetLeft +=parseInt(parent.offsetLeft);
+ offsetTop += parseInt(parent.offsetTop);
+ parent = parent.offsetParent;
+ };
+ return {
+ "bottom":view["bottom"],
+ "clientLeft":_element.clientLeft,
+ "clientTop":_element.clientTop,
+ "left":view["left"],
+ "marginTop":view["marginTop"],
+ "marginLeft":view["marginLeft"],
+ "offsetLeft":offsetLeft,
+ "offsetTop":offsetTop,
+ "position":view["position"],
+ "right":view["right"],
+ "top":view["top"],
+ "zIndex":view["zIndex"]
+ };
+ },
+ getSize:function(_element){
+ var view = pi.util.Element.getView(_element);
+ return {
+ "height":view["height"],
+ "clientHeight":_element.clientHeight,
+ "clientWidth":_element.clientWidth,
+ "offsetHeight":_element.offsetHeight,
+ "offsetWidth":_element.offsetWidth,
+ "width":view["width"]
+ }
+ },
+ addStyle:function(_element,_style){
+ for(var key in _style){
+ key = key=="float"?pi.env.ie?"styleFloat":"cssFloat":key;
+ if (key == "opacity" && pi.env.ie) {
+ pi.util.Element.setOpacity(_element,_style[key]);
+ continue;
+ }
+ try {
+ _element.style[key] = _style[key];
+ }catch(e){}
+ }
+ },
+ getStyle:function(_element,_property){
+ _property = _property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;
+ if(_property=="opacity"&&pi.env.ie)
+ return pi.util.Element.getOpacity(_element.style);
+ return typeof _property=="string"?_element.style[_property]:_element.style;
+ },
+ getValue:function(_element){
+ switch(_element.nodeName.toLowerCase()){
+ case "input":
+ case "textarea":
+ return _element.value;
+ case "select":
+ return _element.options[_element.selectedIndex].value;
+ default:
+ return _element.innerHTML;
+ break;
+ }
+ },
+ getView:function(_element,_property){
+ var view = document.defaultView?document.defaultView.getComputedStyle(_element,null):_element.currentStyle;
+ _property = _property=="float"?pi.env.ie?"styleFloat":"cssFloat":_property;
+ if(_property=="opacity"&&pi.env.ie)
+ return pi.util.Element.getOpacity(_element,view);
+ return typeof _property=="string"?view[_property]:view;
+ }
+ },
+ Hash: {
+ clone:function(_hash,_undeep){
+ var tmp = {};
+ for(var key in _hash){
+ if( !_undeep&&pi.util.IsArray( _hash[key] ) ){
+ tmp[key] = pi.util.Array.clone( _hash[key] );
+ } else if( !_undeep&&pi.util.IsHash( _hash[key] ) ){
+ tmp[ key ] = pi.util.Hash.clone(_hash[key]);
+ } else {
+ tmp[key] = _hash[key];
+ }
+ }
+ return tmp;
+ },
+ merge:function(_hash,_source,_undeep){
+ for(var key in _source){
+ var value = _source[key];
+ if (!_undeep&&pi.util.IsArray(_source[key])) {
+ if(pi.util.IsArray( _hash[key] )){
+ Array.prototype.push.apply( _source[key], _hash[key] )
+ }
+ else
+ value = pi.util.Array.clone(_source[key]);
+ }
+ else if (!_undeep&&pi.util.IsHash(_source[key])) {
+ if (pi.util.IsHash(_hash[key])) {
+ value = pi.util.Hash.merge(_hash[key], _source[key]);
+ } else {
+ value = pi.util.Hash.clone( _source[key] );
+ }
+ } else if( _hash[key] )
+ value = _hash[ key ];
+ _hash[key] = value;
+ };
+ return _hash;
+ }
+ },
+ String:{
+ format:function(_str){
+ var values = Array.prototype.slice.call(arguments,1);
+ return _str.replace(/\{(\d)\}/g,function(){
+ return values[arguments[1]];
+ })
+ }
+ },
+ GetViewport:function(){
+ return {
+ height:document.documentElement.clientHeight||document.body.clientHeight,
+ width:document.documentElement.clientWidth||document.body.clientWidth
+ }
+ }
+ };
+
+ pi.base = function(){
+ this.body = {};
+ this.init = null;
+
+ this.build = function(_skipClonning){
+ var base = this, skipClonning = _skipClonning||false, _private = {},
+ fn = function(){
+ var _p = pi.util.Hash.clone(_private);
+ if(!skipClonning){
+ for(var key in this){
+ if(pi.util.IsArray( this[ key ] ) ){
+ this[key] = pi.util.Array.clone( this[key] );
+ } else
+ if( pi.util.IsHash(this[key]) ){
+ this[key] = pi.util.Hash.clone(
+ this[ key ],
+ function(_key,_object){
+ this[ _key ]._parent_ = this;
+ }
+ );
+ //this[key]._parent_ = this;
+ }
+ }
+ };
+ base.createAccessors( _p, this );
+ if(base.init)
+ return base.init.apply(this,arguments);
+ return this;
+ };
+ this.movePrivateMembers(this.body,_private);
+ if(this.init){
+ fn["$Init"] = this.init;
+ };
+ fn.prototype = this.body;
+ return fn;
+ };
+
+ this.createAccessors = function(_p, _branch){
+ var getter = function(_property){ return this[_property]; },
+ setter = function(_property,_value){ this[_property] = _value; return _branch._parent_||_branch; };
+
+ for (var name in _p) {
+ var isPrivate = name.substring(0, 1) == "_", title = name.substring(1, 2).toUpperCase() + name.substring(2);
+
+ if (isPrivate) {
+ _branch[(_branch["get" + title]?"_":"")+"get" + title] = pi.util.Curry(getter,_p,name);
+ _branch[(_branch["set" + title]?"_":"")+"set" + title] = pi.util.Curry(setter,_p,name);
+ }
+ else
+ if (pi.util.IsHash(_p[name])){
+ _branch[name]._parent_ = _branch;
+ if(!_branch[name])
+ _branch[name] = {};
+ this.createAccessors(_p[name], _branch[name]);
+ }
+ };
+ };
+
+ this.movePrivateMembers = function(_object, _branch){
+ for (var name in _object) {
+ var isPrivate = name.substring(0, 1) == "_";
+
+ if (isPrivate) {
+ _branch[name] = _object[name];
+ delete _object[name];
+ }
+ else
+ if (pi.util.IsHash(_object[name])){
+ _branch[name] = {};
+ this.movePrivateMembers(_object[name], _branch[name]);
+ }
+ };
+ };
+ };
+
+ pi.element = new pi.base;
+ pi.element.init = function(_val){
+ this.environment.setElement(
+ typeof _val=="string"||!_val?
+ document.createElement(_val||"DIV"):
+ _val
+ );
+ return this;
+ };
+
+ pi.element.body = {
+ "addStyle":function(){
+ return this.environment.addStyle.apply(this.environment,arguments);
+ },
+ "clean":function(){
+ var childs = this.child.get();
+ while(childs.length){
+ childs[0].parentNode.removeChild(childs[0]);
+ }
+ },
+ "clone":function(_deep){
+ return this.environment.getElement().cloneNode(_deep);
+ },
+ "insert":function(_element){
+ _element = _element.environment?_element.environment.getElement():_element;
+ _element.appendChild(this.environment.getElement());
+ return this;
+ },
+ "insertAfter":function(_referenceElement){
+ _referenceElement = _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;
+ _referenceElement.nextSibling?this.insertBefore(_referenceElement.nextSibling):this.insert(_referenceElement.parentNode);
+ return this;
+ },
+ "insertBefore":function(_referenceElement){
+ _referenceElement = _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement;
+ _referenceElement.parentNode.insertBefore(this.environment.getElement(),_referenceElement);
+ return this;
+ },
+ "query":function(_expression,_resultType,namespaceResolver,_result){
+ return pi.xpath(_expression,_resultType||"ORDERED_NODE_SNAPSHOT_TYPE",this.environment.getElement(),_namespaceResolver,_result);
+ },
+ "remove":function(){
+ if (this.environment.getParent()) {
+ this.environment.getParent().removeChild(this.environment.getElement());
+ }
+ },
+ "update":function(_value){
+ this.element[this.element.nodeName.toLowerCase()=="textarea"||this.element.nodeName.toLowerCase()=="input"?"value":"innerHTML"]=_value;
+ return this;
+ },
+ "attribute":{
+ "getAll":function(){
+ return this._parent_.environment.getElement().attributes;
+ },
+ "clear":function(_name){
+ this.set(_name,"");
+ return this._parent_;
+ },
+ "get":function(_name){
+ return this._parent_.environment.getElement().getAttribute(_name);
+ },
+ "has":function(_name){
+ return pi.env.ie?(this.get(_name)!=null):this._parent_.environment.getElement().hasAttribute(_name);
+ },
+ "remove":function(_name){
+ this._parent_.environment.getElement().removeAttribute(_name);
+ return this._parent_;
+ },
+ "set":function(_name,_value){
+ this._parent_.environment.getElement().setAttribute(_name,_value);
+ return this._parent_;
+ },
+ "addClass":function(_classes){
+ for(var i=0,len=arguments.length; i<len; i++){
+ pi.util.Element.addClass(this._parent_.environment.getElement(),arguments[i]);
+ };
+ return this._parent_;
+ },
+ "clearClass":function(){
+ this.setClass("");
+ this._parent_;
+ },
+ "getClass":function(){
+ return pi.util.Element.getClass( this._parent_.environment.getElement() );
+ },
+ "hasClass":function(_class){
+ return pi.util.Element.hasClass( this._parent_.environment.getElement(), _class );
+ },
+ "setClass":function(_value){
+ return pi.util.Element.setClass( this._parent_.environment.getElement(), _value );
+ },
+ "removeClass":function(_class){
+ pi.util.Element.removeClass( this._parent_.environment.getElement(), _class );
+ return this._parent_;
+ },
+ "toggleClass":function(_class){
+ pi.util.Element.toggleClass( this._parent_.environment.getElement(), _class );
+ }
+ },
+ "child":{
+ "get":function(){
+ return this._parent_.environment.getElement().childNodes;
+ },
+ "add":function(_elements){
+ for (var i = 0; i < arguments.length; i++) {
+ var el = arguments[i];
+ this._parent_.environment.getElement().appendChild(
+ el.environment ? el.environment.getElement() : el
+ );
+ }
+ return this._parent_;
+ },
+ "addAfter":function(_element,_referenceElement){
+ this.addBefore(
+ _element.environment?_element.environment.getElement():_element,
+ (_referenceElement.environment?_referenceElement.environment.getElement():_referenceElement).nextSibling
+ );
+ return this._parent_;
+ },
+ "addBefore":function(_element,_referenceElement){
+ this._parent_.environment.getElement().insertBefore(
+ _element.environment?_element.environment.getElement():_element,
+ _referenceElement.environment?_referenceElement.environment.getElement():_referenceElement
+ );
+ return this._parent_;
+ },
+ "remove":function(_element){
+ this._parent_.environment.getElement().removeChild(_element.environment?_element.environment.getElement():_element);
+ }
+ },
+ "environment":{
+ "_element":null,
+ "setElement":function(_value){
+ this._parent_.element = _value;
+ this._parent_.element.lib = this._parent_;
+ this._parent_.element.firebugElement = true;
+ this._setElement(_value);
+ },
+ "getParent":function(){
+ return this.getElement().parentNode;
+ },
+ "getPosition":function(){
+ return pi.util.Element.getPosition(this.getElement());
+ },
+ "getSize":function(){
+ return pi.util.Element.getSize( this.getElement() );
+ },
+ "addStyle":function(_styleObject){
+ pi.util.Element.addStyle(this.getElement(),_styleObject);
+ return this._parent_;
+ },
+ "getStyle":function(_property){
+ return pi.util.Element.getStyle(this.getElement(),_property);
+ },
+ "getName":function(){
+ return this.getElement().nodeName;
+ },
+ "getType":function(){
+ return this.getElement().nodeType;
+ },
+ "getValue":function(){
+ return pi.util.Element.getValue(this.getElement());
+ },
+ "getView":function(_property){
+ return pi.util.Element.getView(this.getElement(),_property);
+ }
+ },
+ "event":{
+ "addListener":function(_event,_fn,_useCapture){
+ pi.util.AddEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);
+ return this._parent_;
+ },
+ "removeListener":function(_event,_fn,_useCapture){
+ pi.util.RemoveEvent(this._parent_.environment.getElement(),_event,_fn,_useCapture);
+ return this._parent_;
+ }
+ }
+ };
+ pi.element = pi.element.build();
+
+ pi.xhr = new pi.base;
+ pi.xhr.init = function(_url){
+ if(!window.XMLHttpRequest){
+ var names = ["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP"];
+ for (var i = 0; i < names.length; i++) {
+ try {
+ this.environment.setApi(new ActiveXObject(names[i]));
+ break;
+ } catch (e) { continue; }
+ }
+ }
+ else {
+ this.environment.setApi(new XMLHttpRequest());
+ }
+ this.environment.getApi().onreadystatechange=pi.util.Curry(this.event.readystatechange,this);
+ this.environment.setUrl(_url);
+ this.environment.setCallback([]);
+
+ return this;
+ };
+ pi.xhr.body = {
+ "addCallback": function(){
+ return this.environment.addCallback.apply(this.environment,arguments);
+ },
+ "addData": function(){
+ return this.environment.addData.apply(this.environment,arguments);
+ },
+ "abort":function(){
+ this.environment.getApi().abort();
+ return this;
+ },
+ "send":function(){
+ var url = this.environment.getUrl(), data = this.environment.getData(),dataUrl = "";
+
+ if(!this.environment.getCache())
+ data["forceCache"] = Number(new Date);
+
+ for (var key in data)
+ dataUrl += pi.util.String.format("{0}={1}&",key, data[key]);
+
+ if (this.environment.getType()=="GET")
+ url += (url.search("\\?")==-1?"?":"&")+pi.util.String.format("{0}",dataUrl);
+
+ this.api.open(this.environment.getType(),url,this.environment.getAsync());
+ if(this.environment.getType()=="POST"){
+ this.api.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
+ };
+ this.api.send(this.environment.getType()=="GET"?"":dataUrl);
+ return this;
+ }
+ };
+ pi.xhr.body.environment = {
+ "_async":true, "_api":null, "_cache":true, "_callback":null, "_data":{}, "_type":"GET", "_url":"",
+ "setApi":function(_value){
+ this._parent_.api = _value;
+ this._setApi(_value);
+ },
+ "addCallback": function(_readyState,_fn){
+ this.getCallback().push({ "fn":_fn, "readyState":_readyState });
+ return this._parent_;
+ },
+ "addData": function(_key,_value){
+ this.getData()[_key] = _value;
+ return this._parent_;
+ },
+ "setType": function(_value){
+ this._setType(_value);
+ return this._parent_;
+ }
+ };
+ pi.xhr.body.event = {
+ "readystatechange":function(){
+ var readyState = this.environment.getApi().readyState, callback=this.environment.getCallback();
+ for (var i = 0, len=callback.length; i < len; i++) {
+ if(pi.util.Array.indexOf(callback[i].readyState,readyState)>-1){
+ callback[i].fn.apply(this);
+ }
+ }
+ }
+ };
+ pi.xhr = pi.xhr.build();
+
+ /*
+ * xml.xhr.get
+ */
+
+ pi.xhr.get = function(_url,_returnPiObject){
+ var request = new pi.xhr();
+ request.environment.setAsync(false);
+ request.environment.setUrl(_url);
+ request.send();
+ return _returnPiObject?request:request.environment.getApi();
+ };
+
+ /*
+ * registering onload event for init functions
+ */
+ pi.util.AddEvent(
+ pi.env.ie?window:document,
+ pi.env.ie?"load":"DOMContentLoaded",
+ function(){
+ for(var i=0,len=pi.util.Init.length; i<len; i++){
+ pi.util.Init[ i ]();
+ }
+ }
+ );
+})(firebug);
+
+with(firebug){
+ initConsole();
+ lib.util.Init.push(firebug.init);
+}
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/firebug.gif b/shrine-webclient/src/main/html/js-ext/firebug/firebug.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/firebug_logo.png b/shrine-webclient/src/main/html/js-ext/firebug/firebug_logo.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/firebugx.js b/shrine-webclient/src/main/html/js-ext/firebug/firebugx.js
old mode 100755
new mode 100644
index 161a80232..ad7f4852c
--- a/shrine-webclient/src/main/html/js-ext/firebug/firebugx.js
+++ b/shrine-webclient/src/main/html/js-ext/firebug/firebugx.js
@@ -1,9 +1,9 @@
-if (!("console" in window) || !("firebug" in console))
-{
- var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
- "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
-
- window.console = {};
- for (var i = 0; i < names.length; ++i)
- window.console[names[i]] = function() {}
-}
+if (!("console" in window) || !("firebug" in console))
+{
+ var names = ["log", "debug", "info", "warn", "error", "assert", "dir", "dirxml",
+ "group", "groupEnd", "time", "timeEnd", "count", "trace", "profile", "profileEnd"];
+
+ window.console = {};
+ for (var i = 0; i < names.length; ++i)
+ window.console[names[i]] = function() {}
+}
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/infoIcon.png b/shrine-webclient/src/main/html/js-ext/firebug/infoIcon.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/progress.gif b/shrine-webclient/src/main/html/js-ext/firebug/progress.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/spacer.gif b/shrine-webclient/src/main/html/js-ext/firebug/spacer.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/tree_close.gif b/shrine-webclient/src/main/html/js-ext/firebug/tree_close.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/tree_open.gif b/shrine-webclient/src/main/html/js-ext/firebug/tree_open.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/firebug/warningIcon.png b/shrine-webclient/src/main/html/js-ext/firebug/warningIcon.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/idle-timer.js b/shrine-webclient/src/main/html/js-ext/idle-timer.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation.htm b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation.htm
new file mode 100644
index 000000000..81f43903e
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation.htm
@@ -0,0 +1,747 @@
+<!DOCTYPE html>
+<!--[if IE 7 ]> <html class="no-js ie ie7 lte7 lte8 lte9" lang="en-US"> <![endif]-->
+<!--[if IE 8 ]> <html class="no-js ie ie8 lte8 lte9" lang="en-US"> <![endif]-->
+<!--[if IE 9 ]> <html class="no-js ie ie9 lte9>" lang="en-US"> <![endif]-->
+<!--[if (gt IE 9)|!(IE)]><!-->
+<html class="js multiplebgs boxshadow cssgradients wf-klavikaweb-i7-active wf-klavikaweb-n7-active wf-sourcecodepro-n4-active wf-sourcecodepro-n7-active wf-active" lang="en-US"><!--<![endif]--><head data-live-domain="api.jquery.com">
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"><script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/ados" async="" type="text/javascript"></script>
+ <meta charset="utf-8">
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+
+ <title>jQuery.noConflict() | jQuery API Documentation</title>
+
+ <meta name="author" content="jQuery Foundation - jquery.org">
+ <meta name="description" content="jQuery: The Write Less, Do More, JavaScript Library">
+
+ <meta name="viewport" content="width=device-width">
+
+ <link rel="shortcut icon" href="http://api.jquery.com/jquery-wp-content/themes/api.jquery.com/i/favicon.ico">
+
+ <link rel="stylesheet" href="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/base.css">
+ <link rel="stylesheet" href="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/style.css">
+ <!--[if lt IE 7]><link rel="stylesheet" href="css/font-awesome-ie7.min.css"><![endif]-->
+
+ <script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/ga.js" async="" type="text/javascript"></script><script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/modernizr.js"></script>
+
+ <script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/jquery.js"></script>
+ <script>window.jQuery || document.write(unescape('%3Cscript src="//api.jquery.com/jquery-wp-content/themes/jquery/js/jquery-1.9.1.min.js"%3E%3C/script%3E'))</script>
+
+ <script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/plugins.js"></script>
+ <script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/main.js"></script>
+
+ <script src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/wde1aof.js"></script>
+ <style type="text/css">.tk-source-code-pro{font-family:"source-code-pro",sans-serif;}.tk-klavika-web{font-family:"klavika-web",sans-serif;}</style><link href="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/d.css" rel="stylesheet"><script>try{Typekit.load();}catch(e){}</script>
+
+<meta name="generator" content="WordPress 3.9.1">
+
+</head>
+<body class="api jquery single single-post postid-363 single-format-standard single-author singular">
+
+<!--[if lt IE 7]>
+<p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
+<![endif]-->
+
+<header>
+ <section id="global-nav">
+ <nav>
+ <div class="constrain">
+ <ul class="projects">
+ <li class="project jquery"><a href="http://jquery.com/" title="jQuery">jQuery</a></li>
+ <li class="project jquery-ui"><a href="http://jqueryui.com/" title="jQuery UI">jQuery UI</a></li>
+ <li class="project jquery-mobile"><a href="http://jquerymobile.com/" title="jQuery Mobile">jQuery Mobile</a></li>
+ <li class="project sizzlejs"><a href="http://sizzlejs.com/" title="Sizzle">Sizzle</a></li>
+ <li class="project qunitjs"><a href="http://qunitjs.com/" title="QUnit">QUnit</a></li>
+ </ul>
+ <ul class="links l_tinynav1">
+ <li><a href="http://plugins.jquery.com/">Plugins</a></li>
+ <li class="dropdown"><a href="http://contribute.jquery.org/">Contribute</a>
+ <ul>
+ <li><a href="http://contribute.jquery.org/cla/">CLA</a></li>
+ <li><a href="http://contribute.jquery.org/style-guide/">Style Guides</a></li>
+ <li><a href="http://contribute.jquery.org/triage/">Bug Triage</a></li>
+ <li><a href="http://contribute.jquery.org/code/">Code</a></li>
+ <li><a href="http://contribute.jquery.org/documentation/">Documentation</a></li>
+ <li><a href="http://contribute.jquery.org/web-sites/">Web Sites</a></li>
+ </ul>
+ </li>
+ <li class="dropdown"><a href="http://events.jquery.org/">Events</a>
+ <ul class="wide">
+ <li><a href="http://appendto.com/what-we-do/training/schedule/jquery-virtual-training-june-2014/">Jun 17-19 | jQuery Virtual Training</a></li>
+ <li><a href="http://events.jquery.org/2014/chicago/">Sep 12-13 | jQuery Chicago</a></li>
+ <li><a href="http://2014.cssdevconf.com/">Oct 13-15 | CSS Dev Conf 2014</a></li>
+ </ul>
+ </li>
+ <li class="dropdown"><a href="https://jquery.org/support/">Support</a>
+ <ul>
+ <li><a href="http://learn.jquery.com/">Learning Center</a></li>
+ <li><a href="http://try.jquery.com/">Try jQuery</a></li>
+ <li><a href="http://irc.jquery.org/">IRC/Chat</a></li>
+ <li><a href="http://forum.jquery.com/">Forums</a></li>
+ <li><a href="http://stackoverflow.com/tags/jquery/info">Stack Overflow</a></li>
+ <li><a href="https://jquery.org/support/">Commercial Support</a></li>
+ </ul>
+ </li>
+ <li class="dropdown"><a href="https://jquery.org/">jQuery Foundation</a>
+ <ul>
+ <li><a href="https://jquery.org/join/">Join</a></li>
+ <li><a href="https://jquery.org/members/">Members</a></li>
+ <li><a href="https://jquery.org/team/">Team</a></li>
+ <li><a href="http://brand.jquery.org/">Brand Guide</a></li>
+ <li><a href="https://jquery.org/donate/">Donate</a></li>
+ </ul>
+ </li>
+ </ul>
+ </div>
+ </nav>
+ </section>
+</header>
+
+<div id="container">
+ <div id="logo-events" class="constrain clearfix">
+ <h2 class="logo"><a href="http://jquery.com/" title="jQuery API Documentation">jQuery API Documentation</a></h2>
+
+ <aside><div id="broadcast"><a href="http://engine.adzerk.net/r?e=eyJhdiI6MjIyMzYsImF0IjoxMzE0LCJjbSI6MTM3ODc0LCJjaCI6ODM2OCwiY3IiOjQwOTQzOSwiZGkiOiIxMmRjY2UzZmNmMjM0ZGMwYTQ4YTc1M2UzZWZjZTk3NiIsImRtIjoxLCJmYyI6NDk2MTU0LCJmbCI6MjU0NDQwLCJpcCI6IjUwLjE1Ny4yMzEuMjUiLCJudyI6NTQ0OSwicGMiOjAsInByIjoyMTkzNywicnQiOjEsInJmIjoiaHR0cDovL2pxZnVuZGFtZW50YWxzLmNvbS9jaGFwdGVyL2pxdWVyeS1iYXNpY3MiLCJzdCI6NTM4MjksInVrIjoidWUxLWZjNTViZjRhZjk1NzRlMGRhMDEyNjhjMTFjY2Q4Y2JkIiwidHMiOjE0MTA2NTgwNzA3NDksInVyIjoiaHR0cDovLzIwMTQuY3NzZGV2Y29uZi5jb20vP3V0bV9zb3VyY2U9anF1ZXJ5Y29tJnV0bV9tZWRpdW09YmFubmVyJnV0bV9jYW1wYWlnbj1jc3NkZXZjb25mMjAxNCJ9&amp;s=dr6PMnuXSGVPk_nFv33NRb8WkaM" rel="nofollow" target="_blank" title="CSS Dev Conference 2014"><img src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/252d1bca0e21492bbb0d390e8685097e.png" title="CSS Dev Conference 2014" alt="CSS Dev Conference 2014" border="0" height="100" width="400"></a><img src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/i.gif" style="position:absolute;" border="0" height="0px" width="0px"></div></aside>
+ </div>
+
+ <nav id="main" class="constrain clearfix">
+ <div class="menu-top-container">
+ <ul id="menu-top" class="menu l_tinynav2">
+<li class="menu-item"><a href="http://jquery.com/download/">Download</a></li>
+<li class="menu-item current"><a href="http://api.jquery.com/">API Documentation</a></li>
+<li class="menu-item"><a href="http://blog.jquery.com/">Blog</a></li>
+<li class="menu-item"><a href="http://plugins.jquery.com/">Plugins</a></li>
+<li class="menu-item"><a href="http://jquery.com/browser-support/">Browser Support</a></li>
+ </ul><select class="tinynav tinynav2" id="tinynav2"><option selected="selected">Navigate...</option><option value="http://jquery.com/download/">Download</option><option value="http://api.jquery.com/">API Documentation</option><option value="http://blog.jquery.com/">Blog</option><option value="http://plugins.jquery.com/">Plugins</option><option value="http://jquery.com/browser-support/">Browser Support</option></select>
+</div>
+
+ <form method="get" class="searchform" action="//api.jquery.com/">
+ <button type="submit" class="icon-search"><span class="visuallyhidden">search</span></button>
+ <label>
+ <span class="visuallyhidden">Search jQuery API Documentation</span>
+ <input name="s" placeholder="Search" type="text">
+ </label>
+</form>
+ </nav>
+
+ <div id="content-wrapper" class="clearfix row">
+
+<div class="content-right twelve columns">
+ <div id="content">
+
+<article id="post-363" class="post-363 post type-post status-publish format-standard hentry category-core category-setup-methods category-10">
+ <header class="entry-header">
+ <h1 class="entry-title">jQuery.noConflict()</h1>
+ <hr>
+ <div class="entry-meta">
+ Categories: <span class="category"><a href="http://api.jquery.com/category/core/" title="View all posts in Core">Core</a></span><span class="category-divider"> | </span><span class="category"><a href="http://api.jquery.com/category/miscellaneous/" title="View all posts in Miscellaneous">Miscellaneous</a> &gt; <a href="http://api.jquery.com/category/miscellaneous/setup-methods/" title="View all posts in Setup Methods">Setup Methods</a></span> </div><!-- .entry-meta -->
+ </header><!-- .entry-header -->
+
+ <div class="entry-content">
+ <article id="jQuery-noConflict1" class="entry method"><h2 class="section-title">
+<span class="name">jQuery.noConflict( [removeAll ] )</span><span class="returns">Returns: <a href="http://api.jquery.com/Types/#Object">Object</a></span>
+</h2>
+<div class="entry-wrapper">
+<p class="desc"><strong>Description: </strong>Relinquish jQuery's control of the <code>$</code> variable.</p>
+<ul class="signatures"><li class="signature">
+<h4 class="name">
+<span class="version-details">version added: <a href="http://api.jquery.com/category/version/1.0/">1.0</a></span><a id="jQuery-noConflict-removeAll" href="#jQuery-noConflict-removeAll"><span class="icon-link"></span>jQuery.noConflict( [removeAll ] )</a>
+</h4>
+<ul><li>
+<div><strong>removeAll</strong></div>
+<div>Type: <a href="http://api.jquery.com/Types/#Boolean">Boolean</a>
+</div>
+<div>A Boolean indicating whether to remove all jQuery variables from the global scope (including jQuery itself).</div>
+</li></ul>
+</li></ul>
+<div class="longdesc" id="entry-longdesc">
+ <p>Many JavaScript libraries use <code>$</code> as a function or variable name, just as jQuery does. In jQuery's case, <code>$</code> is just an alias for <code>jQuery</code>, so all functionality is available without using <code>$</code>. If you need to use another JavaScript library alongside jQuery, return control of <code>$</code> back to the other library with a call to <code>$.noConflict()</code>. Old references of <code>$</code> are saved during jQuery initialization; <code>noConflict()</code> simply restores them.</p>
+ <p>If for some reason two versions of jQuery are loaded (which is not recommended), calling <code>$.noConflict( true )</code> from the second version will return the globally scoped jQuery variables to those of the first version.</p>
+ <div class="syntaxhighlighter xml nogutter">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ <div class="line n6">6</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"other_lib.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"jquery.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span>&gt;</span><span class="javascript"></span></code></div></div><div class="container"><div class="line"><code>$.noConflict();</code></div></div><div class="container"><div class="line"><code><span class="comment">// Code that uses other library's $ can follow here.</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+ <p>This technique is especially effective in conjunction with the <code>.ready()</code> method's ability to alias the jQuery object, as within callback passed to <code>.ready()</code> you can use <code>$</code> if you wish without fear of conflicts later:</p>
+ <div class="syntaxhighlighter xml nogutter">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ <div class="line n6">6</div>
+
+ <div class="line n7">7</div>
+
+ <div class="line n8">8</div>
+
+ <div class="line n9">9</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"other_lib.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"jquery.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span>&gt;</span><span class="javascript"></span></code></div></div><div class="container"><div class="line"><code>$.noConflict();</code></div></div><div class="container"><div class="line"><code>jQuery( document ).ready(<span class="keyword">function</span>( $ ) {</code></div></div><div class="container"><div class="line"><code> <span class="comment">// Code that uses jQuery's $ can follow here.</span></code></div></div><div class="container"><div class="line"><code>});</code></div></div><div class="container"><div class="line"><code><span class="comment">// Code that uses other library's $ can follow here.</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+ <p>If necessary, you can free up the <code>jQuery</code> name as well by passing <code>true</code>
+ as an argument to the method. This is rarely necessary, and if you must
+ do this (for example, if you need to use multiple versions of the
+jQuery library on the same page), you need to consider that most
+plug-ins rely on the presence of the <code>jQuery</code> variable and may not operate correctly in this situation.</p>
+ </div>
+<section class="entry-examples" id="entry-examples"><header><h2>Examples:</h2></header><div class="entry-example" id="example-0">
+<h4>Example: <span class="desc">Map the original object that was referenced by $ back to $.</span>
+</h4>
+<div class="syntaxhighlighter javascript ">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code>jQuery.noConflict();</code></div></div><div class="container"><div class="line"><code><span class="comment">// Do something with jQuery</span></code></div></div><div class="container"><div class="line"><code>jQuery( <span class="string">"div p"</span> ).hide();</code></div></div><div class="container"><div class="line"><code><span class="comment">// Do something with another library's $()</span></code></div></div><div class="container"><div class="line"><code>$( <span class="string">"content"</span> ).style.display = <span class="string">"none"</span>;</code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+</div>
+<div class="entry-example" id="example-1">
+<h4>Example: <span class="desc">Revert the $ alias and then create and
+execute a function to provide the $ as a jQuery alias inside the
+function's scope. Inside the function the original $ object is not
+available. This works well for most plugins that don't rely on any other
+ library.
+ </span>
+</h4>
+<div class="syntaxhighlighter javascript ">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ <div class="line n6">6</div>
+
+ <div class="line n7">7</div>
+
+ <div class="line n8">8</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code>jQuery.noConflict();</code></div></div><div class="container"><div class="line"><code>(<span class="keyword">function</span>( $ ) {</code></div></div><div class="container"><div class="line"><code> $(<span class="keyword">function</span>() {</code></div></div><div class="container"><div class="line"><code> <span class="comment">// More code using $ as alias to jQuery</span></code></div></div><div class="container"><div class="line"><code> });</code></div></div><div class="container"><div class="line"><code>})(jQuery);</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="comment">// Other code using $ as an alias to the other library</span></code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+</div>
+<div class="entry-example" id="example-2">
+<h4>Example: <span class="desc">Create a different alias instead of jQuery to use in the rest of the script.</span>
+</h4>
+<div class="syntaxhighlighter javascript ">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ <div class="line n6">6</div>
+
+ <div class="line n7">7</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code><span class="keyword">var</span> j = jQuery.noConflict();</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="comment">// Do something with jQuery</span></code></div></div><div class="container"><div class="line"><code>j( <span class="string">"div p"</span> ).hide();</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="comment">// Do something with another library's $()</span></code></div></div><div class="container"><div class="line"><code>$( <span class="string">"content"</span> ).style.display = <span class="string">"none"</span>;</code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+</div>
+<div class="entry-example" id="example-3">
+<h4>Example: <span class="desc">Completely move jQuery to a new namespace in another object.</span>
+</h4>
+<div class="syntaxhighlighter javascript ">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code><span class="keyword">var</span> dom = {};</code></div></div><div class="container"><div class="line"><code>dom.query = jQuery.noConflict( <span class="literal">true</span> );</code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<h4>Result:</h4>
+<div class="syntaxhighlighter javascript nogutter">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ <div class="line n6">6</div>
+
+ <div class="line n7">7</div>
+
+ <div class="line n8">8</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code><span class="comment">// Do something with the new jQuery</span></code></div></div><div class="container"><div class="line"><code>dom.query( <span class="string">"div p"</span> ).hide();</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="comment">// Do something with another library's $()</span></code></div></div><div class="container"><div class="line"><code>$( <span class="string">"content"</span> ).style.display = <span class="string">"none"</span>;</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="comment">// Do something with another version of jQuery</span></code></div></div><div class="container"><div class="line"><code>jQuery( <span class="string">"div &gt; p"</span> ).hide();</code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+</div>
+<div class="entry-example" id="example-4">
+<h4>Example: <span class="desc">Load two versions of jQuery (not recommended). Then, restore jQuery's globally scoped variables to the first loaded jQuery.</span>
+</h4>
+<div class="syntaxhighlighter xml ">
+ <table>
+ <tbody>
+ <tr>
+ <td class="gutter">
+
+ <div class="line n1">1</div>
+
+ <div class="line n2">2</div>
+
+ <div class="line n3">3</div>
+
+ <div class="line n4">4</div>
+
+ <div class="line n5">5</div>
+
+ <div class="line n6">6</div>
+
+ <div class="line n7">7</div>
+
+ <div class="line n8">8</div>
+
+ <div class="line n9">9</div>
+
+ <div class="line n10">10</div>
+
+ <div class="line n11">11</div>
+
+ <div class="line n12">12</div>
+
+ <div class="line n13">13</div>
+
+ <div class="line n14">14</div>
+
+ <div class="line n15">15</div>
+
+ <div class="line n16">16</div>
+
+ <div class="line n17">17</div>
+
+ <div class="line n18">18</div>
+
+ <div class="line n19">19</div>
+
+ <div class="line n20">20</div>
+
+ <div class="line n21">21</div>
+
+ <div class="line n22">22</div>
+
+ <div class="line n23">23</div>
+
+ <div class="line n24">24</div>
+
+ <div class="line n25">25</div>
+
+ <div class="line n26">26</div>
+
+ <div class="line n27">27</div>
+
+ <div class="line n28">28</div>
+
+ <div class="line n29">29</div>
+
+ <div class="line n30">30</div>
+
+ <div class="line n31">31</div>
+
+ </td>
+ <td class="code">
+ <pre><div class="container"><div class="line"><code><span class="doctype">&lt;!doctype html&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">html</span> <span class="attribute">lang</span>=<span class="value">"en"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">head</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> <span class="tag">&lt;<span class="title">meta</span> <span class="attribute">charset</span>=<span class="value">"utf-8"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> <span class="tag">&lt;<span class="title">title</span>&gt;</span>jQuery.noConflict demo<span class="tag">&lt;/<span class="title">title</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> <span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"//code.jquery.com/jquery-1.10.2.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">head</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">body</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">div</span> <span class="attribute">id</span>=<span class="value">"log"</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> <span class="tag">&lt;<span class="title">h3</span>&gt;</span>Before $.noConflict(true)<span class="tag">&lt;/<span class="title">h3</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">div</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span> <span class="attribute">src</span>=<span class="value">"//code.jquery.com/jquery-1.6.2.js"</span>&gt;</span><span class="javascript"></span><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;<span class="title">script</span>&gt;</span><span class="javascript"></span></code></div></div><div class="container"><div class="line"><code><span class="keyword">var</span> $log = $( <span class="string">"#log"</span> );</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code>$log.append( <span class="string">"2nd loaded jQuery version ($): "</span> + $.fn.jquery + <span class="string">"&lt;br&gt;"</span> );</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="comment">// Restore globally scoped jQuery variables to the first version loaded</span></code></div></div><div class="container"><div class="line"><code><span class="comment">// (the newer version)</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code>jq162 = jQuery.noConflict( <span class="literal">true</span> );</code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code>$log.append( <span class="string">"&lt;h3&gt;After $.noConflict(true)&lt;/h3&gt;"</span> );</code></div></div><div class="container"><div class="line"><code>$log.append( <span class="string">"1st loaded jQuery version ($): "</span> + $.fn.jquery + <span class="string">"&lt;br&gt;"</span> );</code></div></div><div class="container"><div class="line"><code>$log.append( <span class="string">"2nd loaded jQuery version (jq162): "</span> + jq162.fn.jquery + <span class="string">"&lt;br&gt;"</span> );</code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">script</span>&gt;</span></code></div></div><div class="container"><div class="line"><code> </code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">body</span>&gt;</span></code></div></div><div class="container"><div class="line"><code><span class="tag">&lt;/<span class="title">html</span>&gt;</span></code></div></div></pre>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+</div>
+
+<h4>Demo:</h4>
+<div class="demo code-demo"><iframe height="250" width="100%"></iframe></div>
+</div></section>
+</div></article> </div><!-- .entry-content -->
+
+</article><!-- #post-363 -->
+ </div>
+
+ <div id="sidebar" class="widget-area" role="complementary">
+ <aside id="categories" class="widget">
+ <ul>
+ <li class="cat-item cat-item-1"><a href="http://api.jquery.com/category/ajax/" title="View all posts filed under Ajax">Ajax</a>
+<ul class="children">
+ <li class="cat-item cat-item-2"><a href="http://api.jquery.com/category/ajax/global-ajax-event-handlers/" title="View all posts filed under Global Ajax Event Handlers">Global Ajax Event Handlers</a>
+</li>
+ <li class="cat-item cat-item-3"><a href="http://api.jquery.com/category/ajax/helper-functions/" title="View all posts filed under Helper Functions">Helper Functions</a>
+</li>
+ <li class="cat-item cat-item-4"><a href="http://api.jquery.com/category/ajax/low-level-interface/" title="View all posts filed under Low-Level Interface">Low-Level Interface</a>
+</li>
+ <li class="cat-item cat-item-5"><a href="http://api.jquery.com/category/ajax/shorthand-methods/" title="View all posts filed under Shorthand Methods">Shorthand Methods</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-6"><a href="http://api.jquery.com/category/attributes/" title="View all posts filed under Attributes">Attributes</a>
+</li>
+ <li class="cat-item cat-item-7"><a href="http://api.jquery.com/category/callbacks-object/" title="View all posts filed under Callbacks Object">Callbacks Object</a>
+</li>
+ <li class="cat-item cat-item-8 current-cat"><a href="http://api.jquery.com/category/core/" title="View all posts filed under Core">Core</a>
+</li>
+ <li class="cat-item cat-item-9"><a href="http://api.jquery.com/category/css/" title="View all posts filed under CSS">CSS</a>
+</li>
+ <li class="cat-item cat-item-10"><a href="http://api.jquery.com/category/data/" title="View all posts filed under Data">Data</a>
+</li>
+ <li class="cat-item cat-item-11"><a href="http://api.jquery.com/category/deferred-object/" title="View all posts filed under Deferred Object">Deferred Object</a>
+</li>
+ <li class="cat-item cat-item-87"><a href="http://api.jquery.com/category/deprecated/" title="View all posts filed under Deprecated">Deprecated</a>
+<ul class="children">
+ <li class="cat-item cat-item-90"><a href="http://api.jquery.com/category/deprecated/deprecated-1.3/" title="View all posts filed under Deprecated 1.3">Deprecated 1.3</a>
+</li>
+ <li class="cat-item cat-item-88"><a href="http://api.jquery.com/category/deprecated/deprecated-1.7/" title="View all posts filed under Deprecated 1.7">Deprecated 1.7</a>
+</li>
+ <li class="cat-item cat-item-89"><a href="http://api.jquery.com/category/deprecated/deprecated-1.8/" title="View all posts filed under Deprecated 1.8">Deprecated 1.8</a>
+</li>
+ <li class="cat-item cat-item-93"><a href="http://api.jquery.com/category/deprecated/deprecated-1.10/" title="View all posts filed under Deprecated 1.10">Deprecated 1.10</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-12"><a href="http://api.jquery.com/category/dimensions/" title="View all posts filed under Dimensions">Dimensions</a>
+</li>
+ <li class="cat-item cat-item-13"><a href="http://api.jquery.com/category/effects/" title="View all posts filed under Effects">Effects</a>
+<ul class="children">
+ <li class="cat-item cat-item-14"><a href="http://api.jquery.com/category/effects/basics/" title="View all posts filed under Basics">Basics</a>
+</li>
+ <li class="cat-item cat-item-15"><a href="http://api.jquery.com/category/effects/custom-effects/" title="View all posts filed under Custom">Custom</a>
+</li>
+ <li class="cat-item cat-item-16"><a href="http://api.jquery.com/category/effects/fading/" title="View all posts filed under Fading">Fading</a>
+</li>
+ <li class="cat-item cat-item-17"><a href="http://api.jquery.com/category/effects/sliding/" title="View all posts filed under Sliding">Sliding</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-18"><a href="http://api.jquery.com/category/events/" title="View all posts filed under Events">Events</a>
+<ul class="children">
+ <li class="cat-item cat-item-19"><a href="http://api.jquery.com/category/events/browser-events/" title="View all posts filed under Browser Events">Browser Events</a>
+</li>
+ <li class="cat-item cat-item-20"><a href="http://api.jquery.com/category/events/document-loading/" title="View all posts filed under Document Loading">Document Loading</a>
+</li>
+ <li class="cat-item cat-item-21"><a href="http://api.jquery.com/category/events/event-handler-attachment/" title="View all posts filed under Event Handler Attachment">Event Handler Attachment</a>
+</li>
+ <li class="cat-item cat-item-22"><a href="http://api.jquery.com/category/events/event-object/" title="View all posts filed under Event Object">Event Object</a>
+</li>
+ <li class="cat-item cat-item-23"><a href="http://api.jquery.com/category/events/form-events/" title="View all posts filed under Form Events">Form Events</a>
+</li>
+ <li class="cat-item cat-item-24"><a href="http://api.jquery.com/category/events/keyboard-events/" title="View all posts filed under Keyboard Events">Keyboard Events</a>
+</li>
+ <li class="cat-item cat-item-25"><a href="http://api.jquery.com/category/events/mouse-events/" title="View all posts filed under Mouse Events">Mouse Events</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-26"><a href="http://api.jquery.com/category/forms/" title="View all posts filed under Forms">Forms</a>
+</li>
+ <li class="cat-item cat-item-27"><a href="http://api.jquery.com/category/internals/" title="View all posts filed under Internals">Internals</a>
+</li>
+ <li class="cat-item cat-item-28"><a href="http://api.jquery.com/category/manipulation/" title="View all posts filed under Manipulation">Manipulation</a>
+<ul class="children">
+ <li class="cat-item cat-item-29"><a href="http://api.jquery.com/category/manipulation/class-attribute/" title="View all posts filed under Class Attribute">Class Attribute</a>
+</li>
+ <li class="cat-item cat-item-30"><a href="http://api.jquery.com/category/manipulation/copying/" title="View all posts filed under Copying">Copying</a>
+</li>
+ <li class="cat-item cat-item-32"><a href="http://api.jquery.com/category/manipulation/dom-insertion-around/" title="View all posts filed under DOM Insertion, Around">DOM Insertion, Around</a>
+</li>
+ <li class="cat-item cat-item-33"><a href="http://api.jquery.com/category/manipulation/dom-insertion-inside/" title="View all posts filed under DOM Insertion, Inside">DOM Insertion, Inside</a>
+</li>
+ <li class="cat-item cat-item-34"><a href="http://api.jquery.com/category/manipulation/dom-insertion-outside/" title="View all posts filed under DOM Insertion, Outside">DOM Insertion, Outside</a>
+</li>
+ <li class="cat-item cat-item-35"><a href="http://api.jquery.com/category/manipulation/dom-removal/" title="View all posts filed under DOM Removal">DOM Removal</a>
+</li>
+ <li class="cat-item cat-item-36"><a href="http://api.jquery.com/category/manipulation/dom-replacement/" title="View all posts filed under DOM Replacement">DOM Replacement</a>
+</li>
+ <li class="cat-item cat-item-37"><a href="http://api.jquery.com/category/manipulation/general-attributes/" title="View all posts filed under General Attributes">General Attributes</a>
+</li>
+ <li class="cat-item cat-item-38"><a href="http://api.jquery.com/category/manipulation/style-properties/" title="View all posts filed under Style Properties">Style Properties</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-39"><a href="http://api.jquery.com/category/miscellaneous/" title="View all posts filed under Miscellaneous">Miscellaneous</a>
+<ul class="children">
+ <li class="cat-item cat-item-40"><a href="http://api.jquery.com/category/miscellaneous/collection-manipulation/" title="View all posts filed under Collection Manipulation">Collection Manipulation</a>
+</li>
+ <li class="cat-item cat-item-41"><a href="http://api.jquery.com/category/miscellaneous/data-storage/" title="View all posts filed under Data Storage">Data Storage</a>
+</li>
+ <li class="cat-item cat-item-42"><a href="http://api.jquery.com/category/miscellaneous/dom-element-methods/" title="View all posts filed under DOM Element Methods">DOM Element Methods</a>
+</li>
+ <li class="cat-item cat-item-43"><a href="http://api.jquery.com/category/miscellaneous/setup-methods/" title="View all posts filed under Setup Methods">Setup Methods</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-44"><a href="http://api.jquery.com/category/offset/" title="View all posts filed under Offset">Offset</a>
+</li>
+ <li class="cat-item cat-item-45"><a href="http://api.jquery.com/category/properties/" title="View all posts filed under Properties">Properties</a>
+<ul class="children">
+ <li class="cat-item cat-item-46"><a href="http://api.jquery.com/category/properties/jquery-object-instance-properties/" title="View all posts filed under Properties of jQuery Object Instances">Properties of jQuery Object Instances</a>
+</li>
+ <li class="cat-item cat-item-47"><a href="http://api.jquery.com/category/properties/global-jquery-object-properties/" title="View all posts filed under Properties of the Global jQuery Object">Properties of the Global jQuery Object</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-92"><a href="http://api.jquery.com/category/removed/" title="View all posts filed under Removed">Removed</a>
+</li>
+ <li class="cat-item cat-item-48"><a href="http://api.jquery.com/category/selectors/" title="View all posts filed under Selectors">Selectors</a>
+<ul class="children">
+ <li class="cat-item cat-item-49"><a href="http://api.jquery.com/category/selectors/attribute-selectors/" title="View all posts filed under Attribute">Attribute</a>
+</li>
+ <li class="cat-item cat-item-50"><a href="http://api.jquery.com/category/selectors/basic-css-selectors/" title="View all posts filed under Basic">Basic</a>
+</li>
+ <li class="cat-item cat-item-51"><a href="http://api.jquery.com/category/selectors/basic-filter-selectors/" title="View all posts filed under Basic Filter">Basic Filter</a>
+</li>
+ <li class="cat-item cat-item-52"><a href="http://api.jquery.com/category/selectors/child-filter-selectors/" title="View all posts filed under Child Filter">Child Filter</a>
+</li>
+ <li class="cat-item cat-item-53"><a href="http://api.jquery.com/category/selectors/content-filter-selector/" title="View all posts filed under Content Filter">Content Filter</a>
+</li>
+ <li class="cat-item cat-item-54"><a href="http://api.jquery.com/category/selectors/form-selectors/" title="View all posts filed under Form">Form</a>
+</li>
+ <li class="cat-item cat-item-55"><a href="http://api.jquery.com/category/selectors/hierarchy-selectors/" title="View all posts filed under Hierarchy">Hierarchy</a>
+</li>
+ <li class="cat-item cat-item-56"><a href="http://api.jquery.com/category/selectors/jquery-selector-extensions/" title="View all posts filed under jQuery Extensions">jQuery Extensions</a>
+</li>
+ <li class="cat-item cat-item-57"><a href="http://api.jquery.com/category/selectors/visibility-filter-selectors/" title="View all posts filed under Visibility Filter">Visibility Filter</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-58"><a href="http://api.jquery.com/category/traversing/" title="View all posts filed under Traversing">Traversing</a>
+<ul class="children">
+ <li class="cat-item cat-item-59"><a href="http://api.jquery.com/category/traversing/filtering/" title="View all posts filed under Filtering">Filtering</a>
+</li>
+ <li class="cat-item cat-item-60"><a href="http://api.jquery.com/category/traversing/miscellaneous-traversal/" title="View all posts filed under Miscellaneous Traversing">Miscellaneous Traversing</a>
+</li>
+ <li class="cat-item cat-item-61"><a href="http://api.jquery.com/category/traversing/tree-traversal/" title="View all posts filed under Tree Traversal">Tree Traversal</a>
+</li>
+</ul>
+</li>
+ <li class="cat-item cat-item-63"><a href="http://api.jquery.com/category/utilities/" title="View all posts filed under Utilities">Utilities</a>
+</li>
+ <li class="cat-item cat-item-64"><a href="http://api.jquery.com/category/version/" title="View all posts filed under Version">Version</a>
+<ul class="children">
+ <li class="cat-item cat-item-65"><a href="http://api.jquery.com/category/version/1.0/" title="View all posts filed under Version 1.0">Version 1.0</a>
+</li>
+ <li class="cat-item cat-item-66"><a href="http://api.jquery.com/category/version/1.0.4/" title="View all posts filed under Version 1.0.4">Version 1.0.4</a>
+</li>
+ <li class="cat-item cat-item-67"><a href="http://api.jquery.com/category/version/1.1/" title="View all posts filed under Version 1.1">Version 1.1</a>
+</li>
+ <li class="cat-item cat-item-68"><a href="http://api.jquery.com/category/version/1.1.2/" title="View all posts filed under Version 1.1.2">Version 1.1.2</a>
+</li>
+ <li class="cat-item cat-item-69"><a href="http://api.jquery.com/category/version/1.1.3/" title="View all posts filed under Version 1.1.3">Version 1.1.3</a>
+</li>
+ <li class="cat-item cat-item-70"><a href="http://api.jquery.com/category/version/1.1.4/" title="View all posts filed under Version 1.1.4">Version 1.1.4</a>
+</li>
+ <li class="cat-item cat-item-71"><a href="http://api.jquery.com/category/version/1.2/" title="View all posts filed under Version 1.2">Version 1.2</a>
+</li>
+ <li class="cat-item cat-item-72"><a href="http://api.jquery.com/category/version/1.2.3/" title="View all posts filed under Version 1.2.3">Version 1.2.3</a>
+</li>
+ <li class="cat-item cat-item-73"><a href="http://api.jquery.com/category/version/1.2.6/" title="View all posts filed under Version 1.2.6">Version 1.2.6</a>
+</li>
+ <li class="cat-item cat-item-74"><a href="http://api.jquery.com/category/version/1.3/" title="View all posts filed under Version 1.3">Version 1.3</a>
+</li>
+ <li class="cat-item cat-item-75"><a href="http://api.jquery.com/category/version/1.4/" title="View all posts filed under Version 1.4">Version 1.4</a>
+</li>
+ <li class="cat-item cat-item-76"><a href="http://api.jquery.com/category/version/1.4.1/" title="View all posts filed under Version 1.4.1">Version 1.4.1</a>
+</li>
+ <li class="cat-item cat-item-77"><a href="http://api.jquery.com/category/version/1.4.2/" title="View all posts filed under Version 1.4.2">Version 1.4.2</a>
+</li>
+ <li class="cat-item cat-item-78"><a href="http://api.jquery.com/category/version/1.4.3/" title="View all posts filed under Version 1.4.3">Version 1.4.3</a>
+</li>
+ <li class="cat-item cat-item-79"><a href="http://api.jquery.com/category/version/1.4.4/" title="View all posts filed under Version 1.4.4">Version 1.4.4</a>
+</li>
+ <li class="cat-item cat-item-80"><a href="http://api.jquery.com/category/version/1.5/" title="View all posts filed under Version 1.5">Version 1.5</a>
+</li>
+ <li class="cat-item cat-item-81"><a href="http://api.jquery.com/category/version/1.5.1/" title="View all posts filed under Version 1.5.1">Version 1.5.1</a>
+</li>
+ <li class="cat-item cat-item-82"><a href="http://api.jquery.com/category/version/1.6/" title="View all posts filed under Version 1.6">Version 1.6</a>
+</li>
+ <li class="cat-item cat-item-83"><a href="http://api.jquery.com/category/version/1.7/" title="View all posts filed under Version 1.7">Version 1.7</a>
+</li>
+ <li class="cat-item cat-item-84"><a href="http://api.jquery.com/category/version/1.8/" title="View all posts filed under Version 1.8">Version 1.8</a>
+</li>
+ <li class="cat-item cat-item-86"><a href="http://api.jquery.com/category/version/1.9/" title="View all posts filed under Version 1.9">Version 1.9</a>
+</li>
+</ul>
+</li>
+ </ul>
+ </aside>
+</div>
+</div>
+ </div>
+</div>
+
+<footer class="clearfix simple">
+ <div class="constrain">
+ <div class="row">
+ <div class="six columns offset-by-three">
+ <h3><span>Books</span></h3>
+ <ul class="books">
+ <li>
+ <a href="http://www.packtpub.com/learning-jquery-with-simple-javascript-techniques-fourth-edition/book">
+ <img src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/learning-jquery-4th-ed.jpg" alt="Learning jQuery 4th Edition by Karl Swedberg and Jonathan Chaffer" height="114" width="92">
+ Learning jQuery Fourth Edition
+ <cite>Karl Swedberg and Jonathan Chaffer</cite>
+ </a>
+ </li>
+ <li>
+ <a href="http://www.manning.com/derosa?a_aid=141d9491&amp;a_bid=bdd5b7ad">
+ <img src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/jquery-in-action.jpg" alt="jQuery in Action by Bear Bibeault, Yehuda Katz, and Aurelio De Rosa" height="114" width="92">
+ jQuery in Action
+ <cite>Bear Bibeault, Yehuda Katz, and Aurelio De Rosa</cite>
+ </a>
+ </li>
+ <li>
+ <a href="http://www.syncfusion.com/resources/techportal/ebooks/jquery?utm_medium=BizDev-jQuery.org0513">
+ <img src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/jquery-succinctly.jpg" alt="jQuery Succinctly by Cody Lindley" height="114" width="92">
+ jQuery Succinctly
+ <cite>Cody Lindley</cite>
+ </a>
+ </li>
+ </ul>
+ </div>
+ </div>
+
+
+<div id="legal">
+ <ul class="footer-site-links">
+ <li><a class="icon-pencil" href="http://learn.jquery.com/">Learning Center</a></li>
+ <li><a class="icon-group" href="http://forum.jquery.com/">Forum</a></li>
+ <li><a class="icon-wrench" href="http://api.jquery.com/">API</a></li>
+ <li><a class="icon-twitter" href="http://twitter.com/jquery">Twitter</a></li>
+ <li><a class="icon-comments" href="http://irc.jquery.org/">IRC</a></li>
+ <li><a class="icon-github" href="https://github.com/jquery">GitHub</a></li>
+ </ul>
+ <p class="copyright">
+ Copyright 2014 <a href="https://jquery.org/team/">The jQuery Foundation</a>.
+ <a href="https://jquery.org/license/">jQuery License</a>
+ <span class="sponsor-line"><a href="http://mediatemple.net/" rel="nofollow" class="mt-link">Web hosting by Media Temple</a> | <a href="http://www.maxcdn.com/" rel="nofollow" class="mc-link">CDN by MaxCDN</a> | <a href="http://wordpress.org/" class="wp-link">Powered by WordPress</a> | Thanks: <a href="https://jquery.org/members/">Members</a>, <a href="https://jquery.org/sponsors/">Sponsors</a></span>
+ </p>
+</div>
+
+ </div>
+</footer>
+
+<script>
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-1076265-1']);
+ _gaq.push(['_setDomainName', 'api.jquery.com']);
+ _gaq.push(['_setAllowLinker', true]);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+ })();
+</script>
+<script type="text/javascript" src="jQuery.noConflict%28%29%20_%20jQuery%20API%20Documentation_files/comment-reply.js"></script>
+
+
+
+<div style="display: none;" id="cboxOverlay"></div><div style="display: none;" class="" id="colorbox"><div id="cboxWrapper"><div><div style="float: left;" id="cboxTopLeft"></div><div style="float: left;" id="cboxTopCenter"></div><div style="float: left;" id="cboxTopRight"></div></div><div style="clear: left;"><div style="float: left;" id="cboxMiddleLeft"></div><div style="float: left;" id="cboxContent"><div style="width: 0px; height: 0px; overflow: hidden; float: left;" id="cboxLoadedContent"></div><div style="float: left;" id="cboxTitle"></div><div style="float: left;" id="cboxCurrent"></div><div style="float: left;" id="cboxNext"></div><div style="float: left;" id="cboxPrevious"></div><div style="float: left;" id="cboxSlideshow"></div><div style="float: left;" id="cboxClose"></div></div><div style="float: left;" id="cboxMiddleRight"></div></div><div style="clear: left;"><div style="float: left;" id="cboxBottomLeft"></div><div style="float: left;" id="cboxBottomCenter"></div><div style="float: left;" id="cboxBottomRight"></div></div></div><div style="position: absolute; width: 9999px; visibility: hidden; display: none;"></div></div></body></html>
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/252d1bca0e21492bbb0d390e8685097e.png b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/252d1bca0e21492bbb0d390e8685097e.png
new file mode 100644
index 000000000..aa556b0f1
Binary files /dev/null and b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/252d1bca0e21492bbb0d390e8685097e.png differ
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/ados b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/ados
new file mode 100644
index 000000000..7d17fb9e9
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/ados
@@ -0,0 +1,8 @@
+var broadcast_html_86506 = '\x3ca\x20href\x3d\x22http\x3a\x2f\x2fengine\x2eadzerk\x2enet\x2fr\x3fe\x3deyJhdiI6MjIyMzYsImF0IjoxMzE0LCJjbSI6MTM3ODc0LCJjaCI6ODM2OCwiY3IiOjQwOTQzOSwiZGkiOiIxMmRjY2UzZmNmMjM0ZGMwYTQ4YTc1M2UzZWZjZTk3NiIsImRtIjoxLCJmYyI6NDk2MTU0LCJmbCI6MjU0NDQwLCJpcCI6IjUwLjE1Ny4yMzEuMjUiLCJudyI6NTQ0OSwicGMiOjAsInByIjoyMTkzNywicnQiOjEsInJmIjoiaHR0cDovL2pxZnVuZGFtZW50YWxzLmNvbS9jaGFwdGVyL2pxdWVyeS1iYXNpY3MiLCJzdCI6NTM4MjksInVrIjoidWUxLWZjNTViZjRhZjk1NzRlMGRhMDEyNjhjMTFjY2Q4Y2JkIiwidHMiOjE0MTA2NTgwNzA3NDksInVyIjoiaHR0cDovLzIwMTQuY3NzZGV2Y29uZi5jb20vP3V0bV9zb3VyY2U9anF1ZXJ5Y29tJnV0bV9tZWRpdW09YmFubmVyJnV0bV9jYW1wYWlnbj1jc3NkZXZjb25mMjAxNCJ9\x26s\x3ddr6PMnuXSGVPk_nFv33NRb8WkaM\x22\x20rel\x3d\x22nofollow\x22\x20target\x3d\x22_blank\x22\x20title\x3d\x22CSS\x20Dev\x20Conference\x202014\x22\x3e\x3cimg\x20src\x3d\x22http\x3a\x2f\x2fstatic\x2eadzerk\x2enet\x2fAdvertisers\x2f252d1bca0e21492bbb0d390e8685097e\x2epng\x22\x20title\x3d\x22CSS\x20Dev\x20Conference\x202014\x22\x20alt\x3d\x22CSS\x20Dev\x20Conference\x202014\x22\x20border\x3d\x220\x22\x20width\x3d\x22400\x22\x20height\x3d\x22100\x22\x3e\x3c\x2fa\x3e';
+var broadcast_html_command_73833 = function() { azHtmlLoad('broadcast', broadcast_html_86506); };
+var broadcast_pixel_27178 = 'http\x3a\x2f\x2fengine\x2eadzerk\x2enet\x2fi\x2egif\x3fe\x3deyJhdiI6MjIyMzYsImF0IjoxMzE0LCJjbSI6MTM3ODc0LCJjaCI6ODM2OCwiY3IiOjQwOTQzOSwiZGkiOiIxMmRjY2UzZmNmMjM0ZGMwYTQ4YTc1M2UzZWZjZTk3NiIsImRtIjoxLCJmYyI6NDk2MTU0LCJmbCI6MjU0NDQwLCJpcCI6IjUwLjE1Ny4yMzEuMjUiLCJudyI6NTQ0OSwicGMiOjAsInByIjoyMTkzNywicnQiOjEsInJmIjoiaHR0cDovL2pxZnVuZGFtZW50YWxzLmNvbS9jaGFwdGVyL2pxdWVyeS1iYXNpY3MiLCJzdCI6NTM4MjksInVrIjoidWUxLWZjNTViZjRhZjk1NzRlMGRhMDEyNjhjMTFjY2Q4Y2JkIiwidHMiOjE0MTA2NTgwNzA3NTB9\x26s\x3d1ipKIBPS23\x2dRMMgPIbSLdeTUKvE';
+var broadcast_pixel_command_44017 = function() { if(ados_writePixel){ ados_writePixel('broadcast', broadcast_pixel_27178); } else { ados_passbackWritePixel('broadcast', broadcast_pixel_27178, 254440) }; };
+setTimeout(function() {
+ azLoad('broadcast', broadcast_html_command_73833);
+ azLoad('broadcast', broadcast_pixel_command_44017);
+}, 100);
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/base.css b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/base.css
new file mode 100644
index 000000000..c032e89bd
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/base.css
@@ -0,0 +1,3894 @@
+/*! Copyright 2014 jQuery Foundation and other contributors
+ * Includes:
+ * - normalize.css v1.0.1 | MIT License | git.io/normalize
+ * - Font Awesome - http://fortawesome.github.com/Font-Awesome - CC BY 3.0
+ */
+
+/* ==========================================================================
+ HTML5 display definitions
+ ========================================================================== */
+
+* {
+ -webkit-box-sizing: border-box;
+ -moz-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+/*
+ * Corrects `block` display not defined in IE 6/7/8/9 and Firefox 3.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+nav,
+section,
+summary {
+ display: block;
+}
+
+/*
+ * Corrects `inline-block` display not defined in IE 6/7/8/9 and Firefox 3.
+ */
+
+audio,
+canvas,
+video {
+ display: inline-block;
+ *display: inline;
+ *zoom: 1;
+}
+
+/*
+ * Prevents modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+ display: none;
+ height: 0;
+}
+
+/* ==========================================================================
+ Base
+ ========================================================================== */
+
+/*
+ * 1. Corrects text resizing oddly in IE 6/7 when body `font-size` is set using
+ * `em` units.
+ * 2. Prevents iOS text size adjust after orientation change, without disabling
+ * user zoom.
+ */
+
+html {
+ font-size: 100%; /* 1 */
+ -webkit-text-size-adjust: 100%; /* 2 */
+ -ms-text-size-adjust: 100%; /* 2 */
+}
+
+/*
+ * Addresses `font-family` inconsistency between `textarea` and other form
+ * elements.
+ */
+
+html,
+button,
+input,
+select,
+textarea {
+ font-family: sans-serif;
+ color: #333;
+}
+
+/*
+ * Addresses margins handled incorrectly in IE 6/7.
+ */
+
+body {
+ margin: 0;
+}
+
+::-moz-selection {
+ background: #b3d4fc;
+ text-shadow: none;
+}
+
+::selection {
+ background: #b3d4fc;
+ text-shadow: none;
+}
+
+.chromeframe {
+ margin: 0.2em 0;
+ background: #ccc;
+ color: #000;
+ padding: 0.2em 0;
+}
+
+@font-face {
+ font-family: 'FontAwesome';
+ src: url('fonts/fontawesome-webfont.eot?v=3.0.2');
+ src: url('fonts/fontawesome-webfont.eot?#iefix&v=3.0.2') format('embedded-opentype'),
+ url('fonts/fontawesome-webfont.woff?v=3.0.2') format('woff'),
+ url('fonts/fontawesome-webfont.ttf?v=3.0.2') format('truetype');
+ font-weight: normal;
+ font-style: normal;
+}
+
+/* ==========================================================================
+ Links
+ ========================================================================== */
+
+/*
+ * Addresses `outline` inconsistency between Chrome and other browsers.
+ */
+
+a:focus {
+ outline: thin dotted;
+}
+
+/*
+ * Improves readability when focused and also mouse hovered in all browsers.
+ */
+
+a:active,
+a:hover {
+ outline: 0;
+}
+
+/* ==========================================================================
+ Typography
+ ========================================================================== */
+
+/*
+ * Addresses font sizes and margins set differently in IE 6/7.
+ * Addresses font sizes within `section` and `article` in Firefox 4+, Safari 5,
+ * and Chrome.
+ */
+
+h1 {
+ font-size: 2em;
+ margin: 0 0 0.33em;
+}
+
+h2 {
+ font-size: 1.5em;
+ margin: 0 0 0.5em;
+}
+
+h3 {
+ font-size: 1.25em;
+ margin: 0 0 0.67em;
+}
+
+h4 {
+ font-size: 1em;
+ margin: 0 0 1em;
+}
+
+h5 {
+ font-size: 0.83em;
+ margin: 0 0 1.33em;
+}
+
+h6 {
+ font-size: 0.75em;
+ margin: 0 0 2em;
+}
+
+h1, h2, h3, h4, h5, h6 {
+ font-weight: 700;
+ font-family: "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif !important;
+}
+/*
+ * Addresses styling not present in IE 7/8/9, Safari 5, and Chrome.
+ */
+
+abbr[title] {
+ border-bottom: 1px dotted;
+}
+
+/*
+ * Addresses style set to `bolder` in Firefox 3+, Safari 4/5, and Chrome.
+ */
+
+b,
+strong {
+ font-weight: bold;
+}
+
+blockquote {
+ margin: 1em 40px;
+}
+
+/*
+ * Addresses styling not present in Safari 5 and Chrome.
+ */
+
+dfn {
+ font-style: italic;
+}
+
+/*
+ * Addresses styling not present in IE 6/7/8/9.
+ */
+
+mark {
+ background: #ff0;
+ color: #000;
+}
+
+/*
+ * Addresses margins set differently in IE 6/7.
+ */
+
+p,
+pre {
+ margin: 1em 0;
+}
+
+/*
+ * Improves readability of pre-formatted text in all browsers.
+ */
+
+pre, code {
+ white-space: pre;
+ white-space: pre-wrap;
+ word-wrap: break-word;
+ word-spacing: 0;
+ font-size: 13px;
+ line-height: 16px;
+}
+code {
+ padding: 0 3px;
+ background-color: #eee; /* support: IE8 */;
+ background-color: rgba( 0, 0, 0, .1 );
+ border-radius: 3px;
+}
+pre code {
+ background-color: transparent;
+ font-size: 16px;
+ font-weight: bold;
+ white-space: pre;
+ word-wrap: normal;
+}
+
+/*
+ * Addresses CSS quotes not supported in IE 6/7.
+ */
+
+q {
+ quotes: none;
+}
+
+/*
+ * Addresses `quotes` property not supported in Safari 4.
+ */
+
+q:before,
+q:after {
+ content: '';
+ content: none;
+}
+
+/*
+ * Prevents `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sup {
+ top: -0.5em;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+/* ==========================================================================
+ Lists
+ ========================================================================== */
+
+/*
+ * Addresses margins set differently in IE 6/7.
+ */
+
+dl,
+menu,
+ol,
+ul {
+ margin: 0 0 1em;
+}
+
+dd {
+ margin: 0 0 0 40px;
+}
+
+/*
+ * Addresses paddings set differently in IE 6/7.
+ */
+
+menu,
+ol,
+ul {
+ padding: 0;
+}
+
+/*
+ * Corrects list images handled incorrectly in IE 7.
+ */
+
+nav ul,
+nav ol {
+ list-style: none;
+ list-style-image: none;
+}
+
+/* ==========================================================================
+ Embedded content
+ ========================================================================== */
+
+/*
+ * 1. Removes border when inside `a` element in IE 6/7/8/9 and Firefox 3.
+ * 2. Improves image quality when scaled in IE 7.
+ */
+
+img {
+ border: 0; /* 1 */
+ -ms-interpolation-mode: bicubic; /* 2 */
+ vertical-align: middle;
+ max-width: 100%;
+}
+
+/* ==========================================================================
+ Figures
+ ========================================================================== */
+
+/*
+ * Addresses margin not present in IE 6/7/8/9, Safari 5, and Opera 11.
+ */
+
+figure {
+ margin: 0;
+}
+
+/* ==========================================================================
+ Forms
+ ========================================================================== */
+
+/*
+ * Corrects margin displayed oddly in IE 6/7.
+ */
+
+form {
+ margin: 0;
+ padding: 10px 0;
+}
+
+/*
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+ border: 0;
+ margin: 0;
+ padding: 0;
+}
+
+/*
+ * 1. Corrects color not being inherited in IE 6/7/8/9.
+ * 2. Corrects text not wrapping in Firefox 3.
+ * 3. Corrects alignment displayed oddly in IE 6/7.
+ */
+
+legend {
+ border: 0; /* 1 */
+ padding: 0;
+ white-space: normal; /* 2 */
+ *margin-left: -7px; /* 3 */
+}
+
+/*
+ * 1. Corrects font size not being inherited in all browsers.
+ * 2. Addresses margins set differently in IE 6/7, Firefox 3+, Safari 5,
+ * and Chrome.
+ * 3. Improves appearance and consistency in all browsers.
+ */
+
+button,
+input,
+select,
+textarea {
+ font-size: 100%; /* 1 */
+ margin: 0; /* 2 */
+ vertical-align: baseline; /* 3 */
+ *vertical-align: middle; /* 3 */
+}
+
+/*
+ * Addresses Firefox 3+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+button,
+input {
+ line-height: normal;
+}
+
+/*
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ * and `video` controls.
+ * 2. Corrects inability to style clickable `input` types in iOS.
+ * 3. Improves usability and consistency of cursor style between image-type
+ * `input` and others.
+ * 4. Removes inner spacing in IE 7 without affecting normal text inputs.
+ * Known issue: inner spacing remains in IE 6.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+ -webkit-appearance: button; /* 2 */
+ cursor: pointer; /* 3 */
+ *overflow: visible; /* 4 */
+}
+
+/*
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+input[disabled] {
+ cursor: default;
+}
+
+/*
+ * 1. Addresses box sizing set to content-box in IE 8/9.
+ * 2. Removes excess padding in IE 8/9.
+ * 3. Removes excess padding in IE 7.
+ * Known issue: excess padding remains in IE 6.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+ box-sizing: border-box; /* 1 */
+ padding: 0; /* 2 */
+ *height: 13px; /* 3 */
+ *width: 13px; /* 3 */
+}
+
+/*
+ * 1. Addresses `appearance` set to `searchfield` in Safari 5 and Chrome.
+ * 2. Addresses `box-sizing` set to `border-box` in Safari 5 and Chrome
+ * (include `-moz` to future-proof).
+ */
+
+input[type="search"] {
+ -webkit-appearance: textfield; /* 1 */
+ -moz-box-sizing: content-box;
+ -webkit-box-sizing: content-box; /* 2 */
+ box-sizing: content-box;
+}
+
+/*
+ * Removes inner padding and search cancel button in Safari 5 and Chrome
+ * on OS X.
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/*
+ * Removes inner padding and border in Firefox 3+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+ border: 0;
+ padding: 0;
+}
+
+/*
+ * 1. Removes default vertical scrollbar in IE 6/7/8/9.
+ * 2. Improves readability and alignment in all browsers.
+ */
+
+textarea {
+ overflow: auto; /* 1 */
+ vertical-align: top; /* 2 */
+ min-height: 150px;
+ resize: vertical;
+}
+
+#content input[type="text"],
+#content input[type="email"],
+#content textarea {
+ color: #666;
+
+ width: 70%;
+ min-width: 300px;
+
+ margin: 5px 0 10px 0;
+ padding: 8px 12px;
+
+ background: rgba(245,245,245,0.37);
+
+ border: 1px solid rgba(192,192,192,0.49);
+ border-radius: 2px;
+
+ -webkit-box-shadow: inset 0 1px 3px rgba(0,0,0,0.17);
+ box-shadow: inset 0 1px 3px rgba(0,0,0,0.17);
+}
+
+/*
+ * 1. :-moz-placeholder has been deprecated in favor of ::-moz-placeholder.
+ * 2. Using :placeholder for completeness.
+ */
+::-webkit-input-placeholder {
+ color: #9A1B1E;
+}
+:-moz-placeholder { /* 1 */
+ color: #9A1B1E;
+}
+::-moz-placeholder {
+ color: #9A1B1E;
+}
+:-ms-placeholder {
+ color: #9A1B1E;
+}
+:placeholder { /* 2 */
+ color: #9A1B1E;
+}
+
+#content input:focus,
+#content input[type="text"]:focus,
+#content input[type="email"]:focus,
+#content textarea:focus {
+ outline: none;
+
+ color: #333;
+ background: #FFF;
+
+ border: 1px solid #B24926;
+
+ -webkit-box-shadow: 0px 0px 6px rgba(23,138,156,0.5),
+ inset 0px 1px 3px rgba(0,0,0,0.2);
+
+ box-shadow: 0px 0px 6px rgba(23,138,156,0.5),
+ inset 0px 1px 3px rgba(0,0,0,0.2);
+}
+
+/**
+ * Radio Buttons
+ */
+
+.radio {
+ margin: 15px 0;
+}
+
+#content .radio ul {
+ margin: 0;
+ padding: 0;
+ float: left;
+}
+
+#content .radio ul li {
+ margin: 0;
+ padding: 0;
+ background: none;
+ list-style-type: none;
+}
+
+.radio label {
+ margin: 5px 0;
+}
+
+input[type=radio] {
+ margin: 0 5px 0 0;
+}
+
+/**
+ * Checkboxes
+ */
+
+input[type="checkbox"] {
+ margin: 0 5px 0 0;
+}
+
+/**
+ * Submit Buttons
+ */
+
+form input[type="submit"] {
+ margin: 40px 0;
+ float: none;
+}
+
+/**
+ * Top aligned labels
+ */
+
+.top-labels label,
+.top-labels .radio label,
+.top-labels input[type="text"],
+.top-labels input[type="email"],
+.top-labels textarea {
+ display: block;
+}
+
+/**
+ * Left aligned labels
+ */
+
+.left-labels label {
+ padding: 5px 0 0 0;
+ display: block;
+}
+
+.left-labels span {
+ margin: 0 10px 0 0;
+ min-width: 100px;
+
+ float: left;
+
+ text-align: left;
+}
+
+.left-labels .radio span {
+ padding-top: 5px;
+}
+
+.left-labels .radio {
+ display: block;
+}
+
+.left-labels .radio li label {
+ margin: 0;
+ padding: 0 0 5px 0;
+
+ border: 0;
+}
+
+/**
+ * Label descriptions
+ */
+
+label .field-description {
+ font-size: 0.8em;
+}
+
+/* ==========================================================================
+ Tables
+ ========================================================================== */
+
+table {
+ border-collapse: collapse;
+ border-spacing: 0;
+}
+
+#content table {
+ margin: 1em 2em;
+}
+
+#content thead tr {
+ border-bottom: 2px solid #666;
+}
+
+#content tbody tr {
+ border-bottom: 1px solid #666;
+}
+
+#content tbody tr:hover {
+ background-color: #eee;
+}
+
+#content th {
+ font-family: "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+}
+
+#content th,
+#content td {
+ padding: .5em;
+}
+
+/* ==========================================================================
+ Font Awesome
+ ========================================================================== */
+
+[class^="icon-"],
+[class*=" icon-"] {
+ font-weight: normal;
+ font-style: normal;
+ text-decoration: inherit;
+ -webkit-font-smoothing: antialiased;
+
+ /* sprites.less reset */
+ display: inline;
+ width: auto;
+ height: auto;
+ line-height: normal;
+ vertical-align: baseline;
+ background-image: none;
+ background-position: 0% 0%;
+ background-repeat: repeat;
+ margin-top: 0;
+}
+
+/* more sprites.less reset*/
+.icon-white,
+.nav-pills > .active > a > [class^="icon-"],
+.nav-pills > .active > a > [class*=" icon-"],
+.nav-list > .active > a > [class^="icon-"],
+.nav-list > .active > a > [class*=" icon-"],
+.navbar-inverse .nav > .active > a > [class^="icon-"],
+.navbar-inverse .nav > .active > a > [class*=" icon-"],
+.dropdown-menu > li > a:hover > [class^="icon-"],
+.dropdown-menu > li > a:hover > [class*=" icon-"],
+.dropdown-menu > .active > a > [class^="icon-"],
+.dropdown-menu > .active > a > [class*=" icon-"],
+.dropdown-submenu:hover > a > [class^="icon-"],
+.dropdown-submenu:hover > a > [class*=" icon-"] {
+ background-image: none;
+}
+[class^="icon-"]:before,
+[class*=" icon-"]:before {
+ text-decoration: inherit;
+ display: inline-block;
+ speak: none;
+}
+/* makes sure icons active on rollover in links */
+a [class^="icon-"],
+a [class*=" icon-"] {
+ display: inline-block;
+}
+/* makes the font 33% larger relative to the icon container */
+.icon-large:before {
+ vertical-align: -10%;
+ font-size: 1.3333333333333333em;
+}
+.btn [class^="icon-"],
+.nav [class^="icon-"],
+.btn [class*=" icon-"],
+.nav [class*=" icon-"] {
+ display: inline;
+ /* keeps button heights with and without icons the same */
+
+}
+.btn [class^="icon-"].icon-large,
+.nav [class^="icon-"].icon-large,
+.btn [class*=" icon-"].icon-large,
+.nav [class*=" icon-"].icon-large {
+ line-height: .9em;
+}
+.btn [class^="icon-"].icon-spin,
+.nav [class^="icon-"].icon-spin,
+.btn [class*=" icon-"].icon-spin,
+.nav [class*=" icon-"].icon-spin {
+ display: inline-block;
+}
+.nav-tabs [class^="icon-"],
+.nav-pills [class^="icon-"],
+.nav-tabs [class*=" icon-"],
+.nav-pills [class*=" icon-"] {
+ /* keeps button heights with and without icons the same */
+
+}
+.nav-tabs [class^="icon-"],
+.nav-pills [class^="icon-"],
+.nav-tabs [class*=" icon-"],
+.nav-pills [class*=" icon-"],
+.nav-tabs [class^="icon-"].icon-large,
+.nav-pills [class^="icon-"].icon-large,
+.nav-tabs [class*=" icon-"].icon-large,
+.nav-pills [class*=" icon-"].icon-large {
+ line-height: .9em;
+}
+li [class^="icon-"],
+.nav li [class^="icon-"],
+li [class*=" icon-"],
+.nav li [class*=" icon-"] {
+ display: inline-block;
+ width: 1.25em;
+ text-align: center;
+}
+li [class^="icon-"].icon-large,
+.nav li [class^="icon-"].icon-large,
+li [class*=" icon-"].icon-large,
+.nav li [class*=" icon-"].icon-large {
+ /* increased font size for icon-large */
+
+ width: 1.5625em;
+}
+ul.icons {
+ list-style-type: none;
+ text-indent: -0.75em;
+}
+ul.icons li [class^="icon-"],
+ul.icons li [class*=" icon-"] {
+ width: .75em;
+}
+.icon-muted {
+ color: #eeeeee;
+}
+.icon-border {
+ border: solid 1px #eeeeee;
+ padding: .2em .25em .15em;
+ -webkit-border-radius: 3px;
+ -moz-border-radius: 3px;
+ border-radius: 3px;
+}
+.icon-2x {
+ font-size: 2em;
+}
+.icon-2x.icon-border {
+ border-width: 2px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+.icon-3x {
+ font-size: 3em;
+}
+.icon-3x.icon-border {
+ border-width: 3px;
+ -webkit-border-radius: 5px;
+ -moz-border-radius: 5px;
+ border-radius: 5px;
+}
+.icon-4x {
+ font-size: 4em;
+}
+.icon-4x.icon-border {
+ border-width: 4px;
+ -webkit-border-radius: 6px;
+ -moz-border-radius: 6px;
+ border-radius: 6px;
+}
+.pull-right {
+ float: right;
+}
+.pull-left {
+ float: left;
+}
+[class^="icon-"].pull-left,
+[class*=" icon-"].pull-left {
+ margin-right: .3em;
+}
+[class^="icon-"].pull-right,
+[class*=" icon-"].pull-right {
+ margin-left: .3em;
+}
+.btn [class^="icon-"].pull-left.icon-2x,
+.btn [class*=" icon-"].pull-left.icon-2x,
+.btn [class^="icon-"].pull-right.icon-2x,
+.btn [class*=" icon-"].pull-right.icon-2x {
+ margin-top: .18em;
+}
+.btn [class^="icon-"].icon-spin.icon-large,
+.btn [class*=" icon-"].icon-spin.icon-large {
+ line-height: .8em;
+}
+.btn.btn-small [class^="icon-"].pull-left.icon-2x,
+.btn.btn-small [class*=" icon-"].pull-left.icon-2x,
+.btn.btn-small [class^="icon-"].pull-right.icon-2x,
+.btn.btn-small [class*=" icon-"].pull-right.icon-2x {
+ margin-top: .25em;
+}
+.btn.btn-large [class^="icon-"],
+.btn.btn-large [class*=" icon-"] {
+ margin-top: 0;
+}
+.btn.btn-large [class^="icon-"].pull-left.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-left.icon-2x,
+.btn.btn-large [class^="icon-"].pull-right.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-right.icon-2x {
+ margin-top: .05em;
+}
+.btn.btn-large [class^="icon-"].pull-left.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-left.icon-2x {
+ margin-right: .2em;
+}
+.btn.btn-large [class^="icon-"].pull-right.icon-2x,
+.btn.btn-large [class*=" icon-"].pull-right.icon-2x {
+ margin-left: .2em;
+}
+.icon-spin {
+ display: inline-block;
+ -moz-animation: spin 2s infinite linear;
+ -o-animation: spin 2s infinite linear;
+ -webkit-animation: spin 2s infinite linear;
+ animation: spin 2s infinite linear;
+}
+@-moz-keyframes spin {
+ 0% { -moz-transform: rotate(0deg); }
+ 100% { -moz-transform: rotate(359deg); }
+}
+@-webkit-keyframes spin {
+ 0% { -webkit-transform: rotate(0deg); }
+ 100% { -webkit-transform: rotate(359deg); }
+}
+@-o-keyframes spin {
+ 0% { -o-transform: rotate(0deg); }
+ 100% { -o-transform: rotate(359deg); }
+}
+@-ms-keyframes spin {
+ 0% { -ms-transform: rotate(0deg); }
+ 100% { -ms-transform: rotate(359deg); }
+}
+@keyframes spin {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(359deg); }
+}
+@-moz-document url-prefix() {
+ .icon-spin {
+ height: .9em;
+ }
+ .btn .icon-spin {
+ height: auto;
+ }
+ .icon-spin.icon-large {
+ height: 1.25em;
+ }
+ .btn .icon-spin.icon-large {
+ height: .75em;
+ }
+}
+/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen
+ readers do not read off random characters that represent icons */
+.icon-glass:before { content: "\f000"; }
+.icon-music:before { content: "\f001"; }
+.icon-search:before { content: "\f002"; }
+.icon-envelope:before { content: "\f003"; }
+.icon-heart:before { content: "\f004"; }
+.icon-star:before { content: "\f005"; }
+.icon-star-empty:before { content: "\f006"; }
+.icon-user:before { content: "\f007"; }
+.icon-film:before { content: "\f008"; }
+.icon-th-large:before { content: "\f009"; }
+.icon-th:before { content: "\f00a"; }
+.icon-th-list:before { content: "\f00b"; }
+.icon-ok:before { content: "\f00c"; }
+.icon-remove:before { content: "\f00d"; }
+.icon-zoom-in:before { content: "\f00e"; }
+
+.icon-zoom-out:before { content: "\f010"; }
+.icon-off:before { content: "\f011"; }
+.icon-signal:before { content: "\f012"; }
+.icon-cog:before { content: "\f013"; }
+.icon-trash:before { content: "\f014"; }
+.icon-home:before { content: "\f015"; }
+.icon-file:before { content: "\f016"; }
+.icon-time:before { content: "\f017"; }
+.icon-road:before { content: "\f018"; }
+.icon-download-alt:before { content: "\f019"; }
+.icon-download:before { content: "\f01a"; }
+.icon-upload:before { content: "\f01b"; }
+.icon-inbox:before { content: "\f01c"; }
+.icon-play-circle:before { content: "\f01d"; }
+.icon-repeat:before { content: "\f01e"; }
+
+/* \f020 doesn't work in Safari. all shifted one down */
+.icon-refresh:before { content: "\f021"; }
+.icon-list-alt:before { content: "\f022"; }
+.icon-lock:before { content: "\f023"; }
+.icon-flag:before { content: "\f024"; }
+.icon-headphones:before { content: "\f025"; }
+.icon-volume-off:before { content: "\f026"; }
+.icon-volume-down:before { content: "\f027"; }
+.icon-volume-up:before { content: "\f028"; }
+.icon-qrcode:before { content: "\f029"; }
+.icon-barcode:before { content: "\f02a"; }
+.icon-tag:before { content: "\f02b"; }
+.icon-tags:before { content: "\f02c"; }
+.icon-book:before { content: "\f02d"; }
+.icon-bookmark:before { content: "\f02e"; }
+.icon-print:before { content: "\f02f"; }
+
+.icon-camera:before { content: "\f030"; }
+.icon-font:before { content: "\f031"; }
+.icon-bold:before { content: "\f032"; }
+.icon-italic:before { content: "\f033"; }
+.icon-text-height:before { content: "\f034"; }
+.icon-text-width:before { content: "\f035"; }
+.icon-align-left:before { content: "\f036"; }
+.icon-align-center:before { content: "\f037"; }
+.icon-align-right:before { content: "\f038"; }
+.icon-align-justify:before { content: "\f039"; }
+.icon-list:before { content: "\f03a"; }
+.icon-indent-left:before { content: "\f03b"; }
+.icon-indent-right:before { content: "\f03c"; }
+.icon-facetime-video:before { content: "\f03d"; }
+.icon-picture:before { content: "\f03e"; }
+
+.icon-pencil:before { content: "\f040"; }
+.icon-map-marker:before { content: "\f041"; }
+.icon-adjust:before { content: "\f042"; }
+.icon-tint:before { content: "\f043"; }
+.icon-edit:before { content: "\f044"; }
+.icon-share:before { content: "\f045"; }
+.icon-check:before { content: "\f046"; }
+.icon-move:before { content: "\f047"; }
+.icon-step-backward:before { content: "\f048"; }
+.icon-fast-backward:before { content: "\f049"; }
+.icon-backward:before { content: "\f04a"; }
+.icon-play:before { content: "\f04b"; }
+.icon-pause:before { content: "\f04c"; }
+.icon-stop:before { content: "\f04d"; }
+.icon-forward:before { content: "\f04e"; }
+
+.icon-fast-forward:before { content: "\f050"; }
+.icon-step-forward:before { content: "\f051"; }
+.icon-eject:before { content: "\f052"; }
+.icon-chevron-left:before { content: "\f053"; }
+.icon-chevron-right:before { content: "\f054"; }
+.icon-plus-sign:before { content: "\f055"; }
+.icon-minus-sign:before { content: "\f056"; }
+.icon-remove-sign:before { content: "\f057"; }
+.icon-ok-sign:before { content: "\f058"; }
+.icon-question-sign:before { content: "\f059"; }
+.icon-info-sign:before { content: "\f05a"; }
+.icon-screenshot:before { content: "\f05b"; }
+.icon-remove-circle:before { content: "\f05c"; }
+.icon-ok-circle:before { content: "\f05d"; }
+.icon-ban-circle:before { content: "\f05e"; }
+
+.icon-arrow-left:before { content: "\f060"; }
+.icon-arrow-right:before { content: "\f061"; }
+.icon-arrow-up:before { content: "\f062"; }
+.icon-arrow-down:before { content: "\f063"; }
+.icon-share-alt:before { content: "\f064"; }
+.icon-resize-full:before { content: "\f065"; }
+.icon-resize-small:before { content: "\f066"; }
+.icon-plus:before { content: "\f067"; }
+.icon-minus:before { content: "\f068"; }
+.icon-asterisk:before { content: "\f069"; }
+.icon-exclamation-sign:before { content: "\f06a"; }
+.icon-gift:before { content: "\f06b"; }
+.icon-leaf:before { content: "\f06c"; }
+.icon-fire:before { content: "\f06d"; }
+.icon-eye-open:before { content: "\f06e"; }
+
+.icon-eye-close:before { content: "\f070"; }
+.icon-warning-sign:before { content: "\f071"; }
+.icon-plane:before { content: "\f072"; }
+.icon-calendar:before { content: "\f073"; }
+.icon-random:before { content: "\f074"; }
+.icon-comment:before { content: "\f075"; }
+.icon-magnet:before { content: "\f076"; }
+.icon-chevron-up:before { content: "\f077"; }
+.icon-chevron-down:before { content: "\f078"; }
+.icon-retweet:before { content: "\f079"; }
+.icon-shopping-cart:before { content: "\f07a"; }
+.icon-folder-close:before { content: "\f07b"; }
+.icon-folder-open:before { content: "\f07c"; }
+.icon-resize-vertical:before { content: "\f07d"; }
+.icon-resize-horizontal:before { content: "\f07e"; }
+
+.icon-bar-chart:before { content: "\f080"; }
+.icon-twitter-sign:before { content: "\f081"; }
+.icon-facebook-sign:before { content: "\f082"; }
+.icon-camera-retro:before { content: "\f083"; }
+.icon-key:before { content: "\f084"; }
+.icon-cogs:before { content: "\f085"; }
+.icon-comments:before { content: "\f086"; }
+.icon-thumbs-up:before { content: "\f087"; }
+.icon-thumbs-down:before { content: "\f088"; }
+.icon-star-half:before { content: "\f089"; }
+.icon-heart-empty:before { content: "\f08a"; }
+.icon-signout:before { content: "\f08b"; }
+.icon-linkedin-sign:before { content: "\f08c"; }
+.icon-pushpin:before { content: "\f08d"; }
+.icon-external-link:before { content: "\f08e"; }
+
+.icon-signin:before { content: "\f090"; }
+.icon-trophy:before { content: "\f091"; }
+.icon-github-sign:before { content: "\f092"; }
+.icon-upload-alt:before { content: "\f093"; }
+.icon-lemon:before { content: "\f094"; }
+.icon-phone:before { content: "\f095"; }
+.icon-check-empty:before { content: "\f096"; }
+.icon-bookmark-empty:before { content: "\f097"; }
+.icon-phone-sign:before { content: "\f098"; }
+.icon-twitter:before { content: "\f099"; }
+.icon-facebook:before { content: "\f09a"; }
+.icon-github:before { content: "\f09b"; }
+.icon-unlock:before { content: "\f09c"; }
+.icon-credit-card:before { content: "\f09d"; }
+.icon-rss:before { content: "\f09e"; }
+
+.icon-hdd:before { content: "\f0a0"; }
+.icon-bullhorn:before { content: "\f0a1"; }
+.icon-bell:before { content: "\f0a2"; }
+.icon-certificate:before { content: "\f0a3"; }
+.icon-hand-right:before { content: "\f0a4"; }
+.icon-hand-left:before { content: "\f0a5"; }
+.icon-hand-up:before { content: "\f0a6"; }
+.icon-hand-down:before { content: "\f0a7"; }
+.icon-circle-arrow-left:before { content: "\f0a8"; }
+.icon-circle-arrow-right:before { content: "\f0a9"; }
+.icon-circle-arrow-up:before { content: "\f0aa"; }
+.icon-circle-arrow-down:before { content: "\f0ab"; }
+.icon-globe:before { content: "\f0ac"; }
+.icon-wrench:before { content: "\f0ad"; }
+.icon-tasks:before { content: "\f0ae"; }
+
+.icon-filter:before { content: "\f0b0"; }
+.icon-briefcase:before { content: "\f0b1"; }
+.icon-fullscreen:before { content: "\f0b2"; }
+
+.icon-group:before { content: "\f0c0"; }
+.icon-link:before { content: "\f0c1"; }
+.icon-cloud:before { content: "\f0c2"; }
+.icon-beaker:before { content: "\f0c3"; }
+.icon-cut:before { content: "\f0c4"; }
+.icon-copy:before { content: "\f0c5"; }
+.icon-paper-clip:before { content: "\f0c6"; }
+.icon-save:before { content: "\f0c7"; }
+.icon-sign-blank:before { content: "\f0c8"; }
+.icon-reorder:before { content: "\f0c9"; }
+.icon-list-ul:before { content: "\f0ca"; }
+.icon-list-ol:before { content: "\f0cb"; }
+.icon-strikethrough:before { content: "\f0cc"; }
+.icon-underline:before { content: "\f0cd"; }
+.icon-table:before { content: "\f0ce"; }
+
+.icon-magic:before { content: "\f0d0"; }
+.icon-truck:before { content: "\f0d1"; }
+.icon-pinterest:before { content: "\f0d2"; }
+.icon-pinterest-sign:before { content: "\f0d3"; }
+.icon-google-plus-sign:before { content: "\f0d4"; }
+.icon-google-plus:before { content: "\f0d5"; }
+.icon-money:before { content: "\f0d6"; }
+.icon-caret-down:before { content: "\f0d7"; }
+.icon-caret-up:before { content: "\f0d8"; }
+.icon-caret-left:before { content: "\f0d9"; }
+.icon-caret-right:before { content: "\f0da"; }
+.icon-columns:before { content: "\f0db"; }
+.icon-sort:before { content: "\f0dc"; }
+.icon-sort-down:before { content: "\f0dd"; }
+.icon-sort-up:before { content: "\f0de"; }
+
+.icon-envelope-alt:before { content: "\f0e0"; }
+.icon-linkedin:before { content: "\f0e1"; }
+.icon-undo:before { content: "\f0e2"; }
+.icon-legal:before { content: "\f0e3"; }
+.icon-dashboard:before { content: "\f0e4"; }
+.icon-comment-alt:before { content: "\f0e5"; }
+.icon-comments-alt:before { content: "\f0e6"; }
+.icon-bolt:before { content: "\f0e7"; }
+.icon-sitemap:before { content: "\f0e8"; }
+.icon-umbrella:before { content: "\f0e9"; }
+.icon-paste:before { content: "\f0ea"; }
+.icon-lightbulb:before { content: "\f0eb"; }
+.icon-exchange:before { content: "\f0ec"; }
+.icon-cloud-download:before { content: "\f0ed"; }
+.icon-cloud-upload:before { content: "\f0ee"; }
+
+.icon-user-md:before { content: "\f0f0"; }
+.icon-stethoscope:before { content: "\f0f1"; }
+.icon-suitcase:before { content: "\f0f2"; }
+.icon-bell-alt:before { content: "\f0f3"; }
+.icon-coffee:before { content: "\f0f4"; }
+.icon-food:before { content: "\f0f5"; }
+.icon-file-alt:before { content: "\f0f6"; }
+.icon-building:before { content: "\f0f7"; }
+.icon-hospital:before { content: "\f0f8"; }
+.icon-ambulance:before { content: "\f0f9"; }
+.icon-medkit:before { content: "\f0fa"; }
+.icon-fighter-jet:before { content: "\f0fb"; }
+.icon-beer:before { content: "\f0fc"; }
+.icon-h-sign:before { content: "\f0fd"; }
+.icon-plus-sign-alt:before { content: "\f0fe"; }
+
+.icon-double-angle-left:before { content: "\f100"; }
+.icon-double-angle-right:before { content: "\f101"; }
+.icon-double-angle-up:before { content: "\f102"; }
+.icon-double-angle-down:before { content: "\f103"; }
+.icon-angle-left:before { content: "\f104"; }
+.icon-angle-right:before { content: "\f105"; }
+.icon-angle-up:before { content: "\f106"; }
+.icon-angle-down:before { content: "\f107"; }
+.icon-desktop:before { content: "\f108"; }
+.icon-laptop:before { content: "\f109"; }
+.icon-tablet:before { content: "\f10a"; }
+.icon-mobile-phone:before { content: "\f10b"; }
+.icon-circle-blank:before { content: "\f10c"; }
+.icon-quote-left:before { content: "\f10d"; }
+.icon-quote-right:before { content: "\f10e"; }
+
+.icon-spinner:before { content: "\f110"; }
+.icon-circle:before { content: "\f111"; }
+.icon-reply:before { content: "\f112"; }
+.icon-github-alt:before { content: "\f113"; }
+.icon-folder-close-alt:before { content: "\f114"; }
+.icon-folder-open-alt:before { content: "\f115"; }
+
+/* Manual Font Awesome Styles */
+[class^="icon-"]::before, [class^="icon-"]::after,
+[class*=" icon-"]::before, [class*=" icon-"]::after {
+ font-family: FontAwesome, "Helvetica Neue", Helvetica, Arial, sans-serif;
+}
+
+#content ul li[class^="icon-"],
+#content ul li[class*=" icon-"] {
+ background: none;
+ padding-left: 0;
+}
+
+h2 [class^="icon-"],
+h2 [class*=" icon-"],
+h3 [class^="icon-"],
+h3 [class*=" icon-"] {
+ margin-right: 7px;
+}
+
+/* Global Structure
+ ========================================================================== */
+
+body {
+ -webkit-font-smoothing: antialiased;
+ color: #333;
+ font: 15px/22.5px "Helvetica Neue", HelveticaNeue, Helvetica, Arial, sans-serif;
+}
+
+iframe {
+ border: 1px solid #bfbfbf;
+ padding: 1px;
+}
+
+#container {
+ background: #0769AD;
+ margin: 0 auto;
+ padding: 0 20px;
+
+}
+
+.jquery-ui #container {
+ background: #B24926;
+}
+
+.jquery-mobile #container {
+ background: #108040;
+}
+
+.sizzlejs #container {
+ background: #9A1B1E;
+}
+
+.qunitjs #container {
+ background: #390F39;
+}
+
+.jquery-foundation #container {
+ background: #333;
+}
+
+.jquery-learn #container {
+ background: url(../images/bg-body-learn.jpg) no-repeat center top #000;
+}
+
+#content-wrapper {
+ background-color: #fff;
+ -webkit-box-shadow: -3px 0 5px -3px rgba(1, 1, 1, 0.87), 3px 0 5px -3px rgba(1, 1, 1, 0.87);
+ box-shadow: -3px 0 5px -3px rgba(1, 1, 1, 0.87), 3px 0 5px -3px rgba(1, 1, 1, 0.87);
+ padding: 20px 0;
+ border-top: 1px solid #333;
+ border-radius: 0 0 10px 10px;
+ position: relative;
+}
+.no-boxshadow #content-wrapper {
+ border: 1px solid #333;
+}
+
+.constrain {
+ max-width: 1240px;
+ margin: 0 auto;
+ padding: 0 20px;
+}
+
+.lte8 .constrain {
+ max-width: 1198px; /* Accomodate for padding + 1px border */
+}
+
+#content {
+ float: left;
+ width: 71%;
+}
+
+.content-right #content {
+ float: right;
+}
+
+.content-full #content {
+ width: 100%;
+ padding-left: 10%;
+ padding-right: 10%;
+}
+
+.content-full.full-width #content {
+ padding-left: 0;
+ padding-right: 0;
+}
+
+#sidebar,
+.sidebar-left,
+.sidebar-right {
+ padding: 20px;
+ width: 29%;
+}
+
+#sidebar,
+.sidebar-right {
+ float: right;
+ margin-right: -25px;
+ position: relative;
+ -webkit-border-image: -webkit-linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 85%, #ffffff);
+ border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 85%, #ffffff);
+ box-shadow: inset 15px 0 5px -16px #e7e7e7;
+ background-image: -webkit-radial-gradient(left, #f2f2f2, #ffffff 80%);
+ background-image: radial-gradient(left, #f2f2f2, #ffffff 80%);
+ border: 0;
+ border-left: 1px solid #efefef;
+}
+
+
+.content-right #sidebar,
+.sidebar-left {
+ float: left;
+ border-left: 0;
+ border-right: 1px solid #e7e7e7;
+ margin: -20px 0 0 -25px;
+ -webkit-border-image: -webkit-linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 85%, #ffffff);
+ border-image: linear-gradient(#ffffff, #e7e7e7 15%, #e7e7e7 85%, #ffffff);
+ box-shadow: inset 15px 0 5px -16px #e7e7e7;
+ background-image: -webkit-radial-gradient(right, #f2f2f2, #ffffff 80%);
+ background-image: radial-gradient(right, #f2f2f2, #ffffff 80%);
+}
+
+.entry-summary p {
+ margin: 0;
+}
+
+
+/* Global Nav
+ ========================================================================== */
+
+#global-nav {
+ background: url(../images/jq-global-nav.png) repeat-x 0 bottom #1b1b1b;
+}
+
+#global-nav nav {
+ height: 34px;
+}
+
+#global-nav nav ul {
+ text-align: left;
+ display: inline;
+ float: left;
+ margin: 0;
+ list-style: none;
+ border-right: 1px solid rgba(255, 255, 255, 0.0976562);
+ border-left: 1px solid rgba(0, 0, 0, 0.347656);
+}
+
+.tinynav-container { display: none }
+.tinynav { display: none }
+
+#global-nav nav ul.links {
+ float: right;
+}
+
+#global-nav nav ul li {
+ font: bold 13px/17px "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ display: inline-block;
+ float: left;
+ position: relative;
+ top: 1px;
+ cursor: pointer;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ text-shadow: 0 0px 2px #000;
+ border-left: 1px solid rgba(255, 255, 255, 0.0976562);
+ border-right: 1px solid rgba(0, 0, 0, 0.347656);
+}
+.ie #global-nav nav ul li {
+ top: 2px;
+}
+
+#global-nav nav ul li:hover {
+ background: url(../images/bg-footer-noise.jpg) #000;
+ color: #fff;
+}
+
+#global-nav nav ul li i {
+ height: 1em;
+}
+
+#global-nav nav ul li a {
+ color: #e6e6e6;
+ font-weight: normal;
+ font-style: normal;
+ text-decoration: none;
+ display: block;
+ padding: 8px 12px;
+}
+
+#global-nav nav ul li ul {
+ padding: 0;
+ position: absolute;
+ top: 32px;
+ left: -2px;
+ width: 120px;
+ display: none;
+ opacity: 0;
+ visibility: hidden;
+ -webkit-transiton: opacity 0.2s;
+ transition: opacity 0.2s;
+ -webkit-box-shadow: 0 43px 5px rgba(0, 0, 0, 0.4);
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.4);
+ z-index: 400;
+}
+
+#global-nav nav ul li ul.wide {
+ width: 260px;
+}
+
+#global-nav nav ul li ul li {
+ background: url(../images/bg-footer-noise.jpg) #000;
+ display: block;
+ color: #fff;
+ float: none;
+}
+
+#global-nav nav ul li ul li:hover { background: #000; }
+#global-nav nav ul li:hover ul {
+ display: block;
+ opacity: 1;
+ visibility: visible;
+}
+
+#global-nav nav ul.projects li.project {
+ width: 42px;
+ padding: 0;
+ height: 33px;
+ text-indent: -9999px;
+ background: url(../images/jq-nav-icons.png) -6px 0;
+ z-index: 10;
+}
+
+#global-nav nav ul.projects li.project a {
+ display: block;
+ height: 33px;
+}
+
+#global-nav nav ul.projects li.jquery-ui {
+ background-position: -57px 0px;
+}
+
+#global-nav nav ul.projects li.jquery-mobile {
+ background-position: -107px 0px;
+}
+
+#global-nav nav ul.projects li.sizzlejs {
+ background-position: -155px 0px;
+}
+
+#global-nav nav ul.projects li.qunitjs {
+ background-position: -204px 0px;
+}
+
+.jquery #global-nav nav ul.projects li.jquery {
+ background-position: 0 bottom;
+ width: 52px;
+ position: relative;
+ margin-top:1px;
+ border: none;
+}
+
+.jquery #global-nav nav ul.projects {
+ border-left: none;
+}
+
+.jquery #global-nav nav ul.projects li.jquery-ui {
+ border-left: none;
+ background-position: -59px 0;
+}
+
+.jquery-ui #global-nav nav ul.projects li.jquery-ui {
+ background-position: -50px bottom;
+ width: 52px;
+ position: relative;
+ margin-top:1px;
+ border: none;
+}
+
+.jquery-ui #global-nav nav ul.projects li.jquery {
+ border-right: none;
+ background-position: -2px 0;
+}
+
+.jquery-ui #global-nav nav ul.projects li.jquery-mobile {
+ border-left: none;
+}
+
+.jquery-mobile #global-nav nav ul.projects li.jquery-mobile {
+ background-position: -100px bottom;
+ width: 52px;
+ position: relative;
+ margin-top:1px;
+ border: none;
+}
+
+.jquery-mobile #global-nav nav ul.projects li.jquery-ui {
+ border-right: none;
+ background-position: -53px 0;
+}
+
+.jquery-mobile #global-nav nav ul.projects li.jquery-mobile {
+ border-right: none;
+}
+
+.jquery-mobile #global-nav nav ul.projects li.sizzlejs{
+ border-left: none;
+ background-position: -157px 0;
+}
+
+
+.sizzlejs #global-nav nav ul.projects li.jquery-mobile {
+ border-right: none;
+ background-position: -102px 0;
+}
+
+.sizzlejs #global-nav nav ul.projects li.sizzlejs {
+ background-position: -148px bottom;
+ width: 52px;
+ position: relative;
+ margin-top:1px;
+ border: none;
+}
+
+.sizzlejs #global-nav nav ul.projects li.qunitjs{
+ border-left: none;
+ background-position: -206px 0;
+}
+
+
+.qunitjs #global-nav nav ul.projects li.sizzlejs {
+ border-right: none;
+}
+
+.qunitjs #global-nav nav ul.projects li.qunitjs {
+ background-position: -202px bottom;
+ width: 52px;
+ position: relative;
+ margin-top:1px;
+ border: none;
+}
+
+.qunitjs #global-nav nav ul.projects {
+ border-right: none;
+}
+
+#container,
+footer {
+ border-top: 1px solid #7ACEF4;
+}
+
+.jquery-ui #container,
+.jquery-ui footer {
+ border-top-color: #FAA523;
+}
+
+.jquery-mobile #container,
+.jquery-mobile footer {
+ border-top-color: #3EB249;
+}
+
+.sizzlejs #container,
+.sizzlejs footer {
+ border-top-color: #FAA523;
+}
+
+.qunitjs #container,
+.qunitjs footer {
+ border-top-color: #9C3493;
+}
+
+.jquery-learn #container,
+.jquery-learn footer {
+ border-top-color: #333;
+}
+
+/* Brand Colors for General Use
+ ========================================================================== */
+.color.black { background-color: #333; }
+.color.primary-blue { background-color: #0769AD; }
+.color.secondary-blue { background-color: #7ACEF4; }
+.color.navy-blue { background-color: #131B28; }
+.color.primary-orange { background-color: #FAA523; }
+.color.secondary-orange { background-color: #B24926; }
+.color.primary-green { background-color: #3EB249; }
+.color.secondary-green { background-color: #108040; }
+.color.sizzle-orange { background-color: #FAA523; }
+.color.sizzle-red { background-color: #9A1B1E; }
+.color.qunit-primary-purple { background-color: #9C3493; }
+.color.qunit-secondary-purple { background-color: #390F39; }
+
+/* Logo & Navigation
+ ========================================================================== */
+
+#logo-events {
+ clear: both;
+ padding: 20px 0;
+}
+
+h2.logo {
+ float: left;
+ margin: 20px 0 0 0;
+ width: 243px;
+}
+
+h2.logo a {
+ float: left;
+ display: block;
+ height: 66px;
+ overflow: hidden;
+ text-indent: -1000px;
+}
+
+.jquery h2.logo a,
+.jquery-learn h2.logo a {
+ width: 243px;
+ background: url(../images/logo-jquery.png) no-repeat;
+}
+
+.jquery-ui h2.logo a {
+ width: 253px;
+ background: url(../images/logo-jquery-ui.png) no-repeat;
+}
+
+.jquery-mobile h2.logo a {
+ width: 268px;
+ background: url(../images/logo-jquery-mobile.png) no-repeat;
+}
+
+.sizzlejs h2.logo a {
+ width: 243px;
+ background: url(../images/logo-sizzle.png) no-repeat;
+}
+
+.qunitjs h2.logo a {
+ width: 243px;
+ background: url(../images/logo-qunit.png) no-repeat;
+}
+
+.jquery-foundation h2.logo a {
+ width: 243px;
+ background: url(../images/logo-jquery-foundation.png) no-repeat;
+}
+
+.logo.small {
+ height: 30px;
+ background: url('../images/projectlogosfull-small.png') no-repeat;
+}
+
+.jquery.logo.small {
+ width:109px;
+ background-position: -0px 0px;
+}
+.jquery-foundation.logo.small {
+ width: 109px;
+ background-position: -109px 0px;
+}
+.jquery-events.logo.small {
+ width: 109px;
+ background-position: -219px 0px;
+}
+.jqueryui.logo.small {
+ width: 114px;
+ background-position: -327px 0px;
+}
+.jquery-mobile.logo.small {
+ width: 122px;
+ background-position: -442px 0px;
+}
+.qunitjs.logo.small {
+ width: 105px;
+ background-position: -564px 0px;
+}
+.sizzlejs.logo.small {
+ width: 105px;
+ background-position: -669px 0px;
+}
+
+#logo-events aside {
+ float: right;
+}
+
+nav#main {
+ background-color: rgba(0, 0, 0, 0.18);
+ border-radius: 10px 10px 0 0;
+ border-right: 1px solid rgba(2, 2, 2, 0.28);
+ border-left: 1px solid rgba(2, 2, 2, 0.28);
+ border-top: 1px solid rgba(250, 250, 250, 0.27);
+ -webkit-box-shadow: rgba(255,255,255,0.3) 0 1px 0, rgba(0,0,0,0.3) 0 -1px 0;
+ box-shadow: rgba(255,255,255,0.3) 0 1px 0, rgba(0,0,0,0.3) 0 -1px 0;
+ -webkit-box-shadow: 0 0 3px rgba(1, 1, 1, 0.7);
+ box-shadow: 0 0 5px rgba(1, 1, 1, 0.7);
+}
+
+.jquery-ui nav#main,
+.sizzlejs nav#main {
+ background-color: rgba(12, 12, 12, 0.06);
+}
+.qunitjs nav#main {
+ background-color: rgba(156, 52, 147, 0.5);
+}
+.jquery-learn nav#main {
+ background-color: rgba(0, 0, 0, 0.4);
+}
+
+.jquery-foundation nav#main {
+ background-color: rgba(102, 102, 102, 0.1);
+}
+
+.no-boxshadow nav#main {
+ border-top: 1px solid #333;
+ border-left: 1px solid #333;
+ border-right: 1px solid #333;
+}
+
+nav#main ul {
+ margin: 0;
+ float: left;
+ width: 70%;
+ padding-top: 10px;
+ padding-bottom: 10px;
+}
+
+nav#main li {
+ float: left;
+ font: normal normal 16px "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ margin-right: 2px;
+}
+
+nav#main li a {
+ color: #fff;
+ text-decoration: none;
+ padding: 6px 10px;
+ display: block;
+ border: 1px solid transparent;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.76);
+}
+
+nav#main li a:hover,
+nav#main li.current a,
+nav#main .searchform {
+ background: none;
+ -webkit-box-shadow: inset 0 0 5px rgba(0,0,0, 0.4), rgba(255,255,255,0.1) 0 1px 0;
+ box-shadow: inset 0 0 5px rgba(0,0,0, 0.4), rgba(255,255,255,0.1) 0 1px 0;
+ border-radius: 4px;
+ border: 1px solid rgba(0,0,0,0.25);
+ color: #fff;
+ text-shadow: rgba(0, 0, 0, 0.796875) 0px -1px 0px, rgba(255, 255, 255, 0.296875) 0px 0px 10px;
+}
+
+nav#main .searchform {
+ float: right;
+ width: 28%;
+ margin-top: 12px;
+ padding: 0;
+ border-radius: 20px;
+ position: relative;
+}
+
+nav#main .searchform input {
+ text-decoration: none;
+ font: 12px/12px "Lucida Grande", Lucida, Verdana, sans-serif;
+ padding: 5px 10px;
+ margin: 0;
+ background-color: transparent;
+ border-style: none;
+ color: #fff;
+ line-height: 1.3;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.76);
+ width: 85%;
+ box-shadow: none;
+}
+
+nav#main .searchform input:focus {
+ outline: none;
+}
+
+.no-boxshadow nav#main .searchform {
+ border: 1px solid #333;
+}
+
+.no-boxshadow nav#main .searchform input {
+ background: #fff;
+ color: #333;
+}
+
+/*
+ * 1. :-moz-placeholder has been deprecated in favor of ::-moz-placeholder.
+ * 2. Using :placeholder for completeness.
+ */
+nav#main .searchform input::-webkit-input-placeholder {
+ color: #fff;
+}
+nav#main .searchform input:-moz-placeholder { /* 1 */
+ color: #fff;
+}
+nav#main .searchform input::-moz-placeholder {
+ color: #fff;
+}
+nav#main .searchform input:-ms-input-placeholder {
+ color: #fff;
+}
+nav#main .searchform input:placeholder { /* 2 */
+ color: #fff;
+}
+
+nav#main .searchform .icon-search {
+ position: absolute;
+ right: 10px;
+ top: 3px;
+ bottom: 3px;
+ border-width: 0;
+ border-left: 1px solid rgba(7, 7, 7, 0.65);
+ background-color: transparent;
+ padding: 0 0 0 7px;
+ opacity: 0.33;
+ color: #fff;
+}
+
+#broadcast {
+ height: 100px;
+}
+
+/* Typography & Global Styles
+ ========================================================================== */
+
+#content a {
+ text-decoration: underline;
+}
+
+#content a:hover {
+ text-decoration: none;
+}
+
+#sidebar a {
+ text-decoration: none;
+}
+
+#sidebar a:hover {
+ text-decoration: underline;
+}
+
+p {
+ margin-bottom: 15px;
+ margin-top: 0;
+}
+
+b, strong {
+ font-weight: bold;
+ color: #1a1a1a;
+}
+
+em, i {
+ color: #6d6d6d;
+ font-style: italic;
+}
+
+hr {
+ background-image: url(../images/gauze.png);
+ height: .75em;
+ border: none;
+ margin: .75em 0;
+}
+
+#content code a {
+ text-decoration: none;
+}
+
+pre strong,
+pre b {
+ color: #fff;
+ font-weight: bold;
+}
+
+#content blockquote {
+ margin: 20px 0;
+}
+
+#content blockquote p {
+ font: italic normal 23px/26px "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ color: #828282;
+ margin-left: 0;
+ margin-bottom: 0;
+ padding: 20px 30px;
+ position: relative;
+ text-shadow: 0 1px 0 #ffffff;
+ background-color: #f2f2f2;
+}
+
+#content ol,
+#content ul {
+ margin: 0 0 20px 20px;
+}
+
+#content ul ul {
+ margin-bottom: 0;
+}
+
+#content ul li {
+ padding-bottom: 5px;
+ padding-top: 5px;
+ padding-left: 20px;
+ line-height: 20px;
+ list-style-type: none;
+ background: url(../images/bullet.png) no-repeat 0 10px;
+}
+
+#content ul.block-grid li {
+ background: none;
+}
+
+#content ol {
+ counter-reset: li; /* Initiate a counter */
+}
+
+#content ol > li {
+ position: relative; /* Give each list item a left margin to make room for the numbers */
+ list-style: none;
+ padding-left: 10px;
+ margin-right: 0;
+ margin-top: 5px;
+ margin-left: 30px;
+}
+#content ol > li:before {
+ content: counter(li); /* Use the counter as content */
+ counter-increment: li; /* Increment the counter by 1 */
+ /* Position and style the number */
+ position: absolute;
+ top: 1px;
+ left: -25px;
+ box-sizing: border-box;
+ width: 20px;
+ /* Some space between the number and the content in browsers that support
+ generated content but not positioning it */
+ color: #fff;
+ text-align: center;
+ background-color: #ababab;
+ height: 19px;
+ width: 19px;
+ padding-top: 0px;
+ font: bold 11px/19px "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ border-radius: 12px;
+}
+
+.lt-ie8 #content ol,
+.lt-ie7 #content ol {
+ margin-left: 20px;
+}
+
+.lt-ie8 #content ol li,
+.lt-ie7 #content ol li {
+ margin-left: 30px;
+ list-style-type: decimal;
+ padding-left: 0px;
+}
+
+#content img.full,
+#content figure.full {
+ display: block;
+ width: 100%;
+ max-width: 100%;
+}
+
+.lt-ie8 #content figure img {
+ position: relative;
+}
+
+.lt-ie7 #content figure.full,
+.lt-ie8 #content figure.full {
+ width: 99%;
+}
+
+#content img.full,
+#content img.left,
+#content img.right,
+#banner img.full {
+ box-shadow: 0 0 5px 1px rgba(0, 0, 0, 0.20);
+}
+
+#content img.noborder,
+#content figure.noborder {
+ box-shadow: none;
+ border: none;
+ background: none;
+}
+
+#content img.full,
+#content img.left,
+#content img.right,
+#content figure.full,
+#content figure.left,
+#content figure.right {
+ margin-bottom: 20px;
+ float: left;
+}
+
+#content img.right,
+#content figure.right {
+ float: right;
+ margin-left: 15px;
+}
+
+.lt-ie8 #content img.right,
+.lt-ie8 #content figure.right,
+.lt-ie7 #content img.right,
+.lt-ie7 #content figure.right {
+ float: left;
+ margin-left: 0px;
+ margin-right: 15px;
+}
+
+#content img.left,
+#content figure.left {
+ margin-right: 15px;
+}
+
+
+#content figure img {
+ margin: 0px !important;
+ margin-bottom: 0px !important;
+}
+
+#content figcaption {
+ box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.20);
+ font: italic 700 12px/20px "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 5px;
+ padding-bottom: 5px;
+ color: #737272;
+ clear: both;
+ margin-top: -10px;
+ background-color: #f2f2f2;
+}
+
+#content figure.noborder figcaption {
+ box-shadow: none;
+ background: none;
+ text-align: center;
+}
+
+#content .embed,
+#content .embed_media {
+ position: relative;
+ padding-bottom: 56.25%; /* 16/9 ratio */
+ padding-top: 30px; /* IE6 workaround*/
+ height: 0;
+ overflow: hidden;
+ box-shadow: 0px 0px 5px 1px rgba(0, 0, 0, 0.20);
+ margin-bottom: 20px;
+}
+
+#portfolio.media #banner .embed {
+ margin-bottom: 40px;
+}
+
+.embed iframe,
+.embed_media iframe,
+.embed object,
+.embed_media object,
+.embed embed,
+.embed_media embed {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+}
+
+#content h1 {
+ font-size: 36px;
+ line-height: 36px;
+}
+
+.content-full #content h1 {
+ text-align: center;
+}
+
+#content h2 {
+ font-size: 24px;
+ line-height: 24px;
+ color: #333;
+ margin-bottom: 10px;
+}
+
+#content h3 {
+ font-size: 20px;
+ line-height: 20px;
+ color: #666;
+}
+
+#content h1.block,
+#content h2.block {
+ padding: 10px 2%;
+ background: url(../images/gauze.png) #ececec;
+ text-shadow: 0 1px 0 #ffffff;
+}
+
+p.author {
+ color: #ababab;
+ font-family: "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ font-weight: 700;
+ margin-top: -20px;
+}
+
+p.author a {
+ color: #ababab;
+}
+
+.meta {
+ padding: 2%;
+ padding-bottom: .5%;
+ margin-bottom: 20px;
+ font: 700 "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ color: #666;
+ background: url(../images-foundation/gauze.png) #f0f0f0;
+ text-shadow: 0 1px 0 #ffffff;
+}
+
+#banner-large-image {
+ text-align: center;
+ margin-bottom: 30px;
+
+}
+
+#banner-large-image .vertically-centered-black-bg {
+ height: 50%;
+ width: 100%;
+ margin-top: 24%;
+ display: block;
+ background-color: rgba(0, 0, 0, 0.68);
+ position: absolute;
+ padding-top: 3.5%;
+}
+
+#banner-large-image h1, #banner-large-image h2 {
+ font: bold 60px/60px "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ margin-bottom: 0;
+ color: #fff;
+ text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
+}
+
+#banner-large-image p {
+ color: #CCCCCC;
+ font: 700 normal 24px/36px "klavika-web", "Helvetica Neue", sans-serif;
+}
+
+#banner-secondary {
+ background-image: url(../images/dark-grey-tile.png);
+ margin: -20px -25px 15px;
+ padding: 20px;
+}
+
+#banner-secondary h1,
+#banner-secondary h2 {
+ margin-bottom: 0;
+ color: #fff;
+ text-shadow: 0 0 4px rgba(0, 0, 0, 0.85);
+}
+
+#banner-secondary h1 {
+ font-size: 48px;
+ line-height: 54px;
+}
+
+#banner-secondary h2 {
+ font-size: 36px;
+ line-height: 42px;
+}
+
+#banner-secondary p {
+ color: #ccc;
+ font: 22px/26px "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ padding-left: 15%;
+ padding-right: 15%;
+}
+
+#banner-secondary a,
+#banner-secondary a:hover {
+ color: #7ACEF4;
+}
+
+#banner-secondary em,
+#banner-secondary i {
+ color: #fff;
+}
+
+#banner-secondary.large-banner {
+ text-align: center;
+ padding-top: 30px;
+ padding-bottom: 30px;
+}
+
+#banner-secondary.large-banner h1,
+#banner-secondary.large-banner h2 {
+ margin-bottom: 10px;
+}
+
+#banner-secondary.large-banner h1 {
+ font-size: 60px;
+ line-height: 60px;
+}
+
+#banner-secondary.large-banner h2 {
+ font-size: 48px;
+ line-height: 48px;
+}
+
+#banner-secondary.large-banner h3 {
+ font-size: 36px;
+ line-height: 36px;
+}
+
+.center-txt {
+ text-align: center !important;
+}
+
+.callout-block {
+ background-image: url(../images/gauze.png);
+ padding: 20px;
+}
+
+/* Buttons
+ ========================================================================== */
+
+a.button,
+#content a.button,
+.button,
+input[type="submit"] {
+ border-radius: 5px;
+ border: 1px solid #999;
+ -webkit-box-shadow:
+ 0 0 5px rgba(0, 0, 0, 0.28),
+ inset 0 1px 0 rgba(255, 255, 255, 0.45),
+ inset 0px -1px 0px rgba(255, 255, 255, 0.45),
+ inset 1px 0px 0px rgba(255, 255, 255, 0.45),
+ inset -1px 1px 0px rgba(255, 255, 255, 0.45);
+ box-shadow:
+ 0 0 5px rgba(0, 0, 0, 0.28),
+ inset 0 1px 0 rgba(255, 255, 255, 0.45),
+ inset 0px -1px 0px rgba(255, 255, 255, 0.45),
+ inset 1px 0px 0px rgba(255, 255, 255, 0.45),
+ inset -1px 1px 0px rgba(255, 255, 255, 0.45);
+ text-decoration: none;
+ color: #fff !important;
+ text-shadow: 0 -1px 1px rgba(0, 0, 0, 0.35);
+ padding: 8px 15px;
+ font: bold 16px/16px "klavika-web", "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+ -webkit-transition: all 0.2s;
+ transition: all 0.2s;
+ background-color: #d18f4f;
+ float: left;
+}
+
+a.button:hover,
+#content a.button:hover,
+.button:hover,
+input[type="submit"]:hover {
+ background-color: #cc8540;
+}
+
+a.button.large,
+#content a.button.large,
+button.large,
+input[type="submit"].large {
+ font-size: 20px;
+ padding: 12px 20px;
+}
+
+a.button.dark,
+#content a.button.dark,
+.button.dark,
+input[type="submit"].dark {
+ background-color: #666;
+}
+
+a.button.dark:hover,
+#content a.button.dark:hover,
+.button.dark:hover,
+input[type="submit"].dark:hover {
+ background-color: #424141;
+}
+
+/* Sidebar
+ ========================================================================== */
+
+#sidebar h3 {
+ font: 20px/18px;
+ background-image: -webkit-linear-gradient(left, #efefef, #f3f3f3);
+ background-image: linear-gradient(to right, #efefef, #f3f3f3);
+ margin-left: -20px;
+ margin-right: -20px;
+ padding: 12px 20px;
+ text-shadow: 0 1px 0 #ffffff;
+}
+
+#sidebar li {
+ padding: 5px 0 5px 20px;
+ list-style-type: none;
+ background: url(../images/bullet.png) no-repeat 0 12px;
+ text-shadow: 0 1px 0 #ffffff;
+}
+
+#sidebar li a {
+ color: #4d4d4d;
+ text-decoration: none;
+ display: block;
+}
+
+#sidebar nav#secondary li {
+ background-image: none;
+ padding-left: 0;
+}
+
+#sidebar nav#secondary li.current {
+ background-color: #eee;
+ margin-left: -35px;
+ margin-right: -20px;
+ padding-left: 35px;
+ font-weight: bold;
+}
+
+/* == Footer
+ ========================================================================== */
+
+footer {
+ background: url(../images/bg-footer-noise.jpg) repeat;
+ margin-top: -20px;
+ padding-top: 40px;
+}
+
+footer.simple {
+ padding-top: 45px;
+ padding-bottom: 10px;
+}
+
+footer a,
+footer strong {
+ color: #fff;
+ text-decoration: none;
+}
+
+footer .download {
+ text-align: center;
+ color: #fff;
+ padding: 10px 2% 15px 2%;
+ line-height: 140%;
+}
+
+footer .download strong { margin-right: 10px; }
+
+footer .download > span { white-space: nowrap; }
+
+footer .download a { margin: 0 10px; }
+
+footer .download a em {
+ font-style: normal;
+ color: #aaa;
+}
+
+footer .download a:hover { border-bottom: solid 1px #888; }
+
+footer .footer-icon-links li {
+ width: 22%;
+ margin-left: 11%;
+ float: left;
+}
+
+footer .footer-icon-links li a {
+ display: block;
+ line-height: inherit;
+ font-size: 18px;
+ float: left;
+ position: relative;
+ width: auto;
+ text-align: left;
+ padding-left: 10px;
+}
+
+footer .footer-icon-links li a:before {
+ position: absolute;
+ left: -35px;
+ top: 10px;
+ font-size: 2em;
+ color: #4d4d4d;
+ text-shadow: 0 -1px 0 #000000;
+}
+
+footer .footer-icon-links li small {
+ display: block;
+ font-size: 14px;
+ color: #777;
+ line-height: 120%;
+}
+
+footer .footer-icon-links li:hover a:before {
+ color: #d1d1d1;
+}
+
+.multiplebgs.cssgradients footer {
+ background-image: -webkit-linear-gradient(rgba(0,0,0,0.3), rgba(0,0,0,0.0)), url(../images/bg-footer-noise.jpg); /* Chrome 10+, Saf6 */
+ background-image: linear-gradient(to bottom, rgba(0,0,0,.3), rgba(0,0,0,0)), url(../images/bg-footer-noise.jpg); /* Firefox 16+, IE 10+, Opera 12.50+ */
+ background-repeat: repeat-x, repeat;
+ background-size: 100px 15px, 140px 140px;
+}
+
+.no-multiplebgs footer, .no-cssgradients footer {
+ background-image: url(../images/bg-footer-noise.jpg);
+ background-repeat: repeat;
+}
+
+footer h3 {
+ color: #777;
+ letter-spacing: normal;
+ text-transform: uppercase;
+ text-shadow: #000 0 1px 0;
+ border: solid 1px #000;
+ text-rendering: optimizeLegibility;
+ border-bottom: none;
+ border-radius: 4px 4px 0 0;
+ position: relative;
+ text-align: center;
+ height: 10px;
+ margin-top: 20px;
+ font-size: 16px;
+}
+
+footer h3 span {
+ display: inline-block;
+ padding: 3px 10px;
+ position: relative;
+ top: -0.8em;
+ background: url(../images/bg-footer-noise.jpg) repeat #212121;
+ z-index: 1;
+}
+
+footer h3:after {
+ content: "";
+ position: absolute;
+ left: 0;
+ top: 0;
+ width: 100%;
+ height: 100%;
+ border: solid 1px #333;
+ border-bottom: none;
+ border-radius: 4px 4px 0 0;
+}
+
+.footer-site-links {
+ float: right;
+ padding: 10px 0 0 0;
+ width: 58%;
+ text-align: right;
+}
+
+footer p.copyright {
+ margin: 10px 0 0 0;
+ float: left;
+ width: 40%;
+ font-size: 11px;
+ line-height: 130%;
+ color: #777;
+}
+
+footer p.copyright a {
+ color: #aaa;
+}
+
+footer p.copyright a:hover {
+ color: #fff;
+}
+
+footer p.copyright span.sponsor-line {
+ display: block;
+ font-size: 10px;
+ margin-top: 1em;
+}
+
+footer p.copyright a.mt-link {
+ background: url(../images/logo-mediatemple.png) left top no-repeat;
+ padding-left: 31px;
+}
+
+footer p.copyright a.mc-link {
+ background: url(../images/logo-maxcdn.png) left top no-repeat;
+ padding-left: 24px;
+}
+
+footer p.copyright a.wp-link {
+ background: url(../images/logo-wordpress.png) left top no-repeat;
+ padding-left: 19px;
+ padding-top: 1px;
+ display: inline-block;
+ height: 16px;
+}
+
+.footer-site-links li {
+ position: relative;
+ background: none;
+ width: auto;
+ height: auto;
+ line-height: 20px;
+ margin: 0 0 10px 20px;
+ font-size: 13px;
+}
+
+.footer-site-links li:first-child {
+ margin-left: 0;
+}
+
+.footer-site-links li a {
+ position: relative;
+ color: #aaa;
+ display: block;
+ padding-left: 30px;
+ width: auto;
+ line-height: inherit;
+}
+
+.footer-site-links li a:before {
+ position: absolute;
+ font-size: 1.5em;
+ color: #4d4d4d;
+ text-shadow: 0 -1px 0 #000000;
+ left: 2px;
+}
+
+.footer-site-links li:hover a,
+.footer-site-links li:hover a:before {
+ color: #e6e6e6;
+}
+
+.footer-site-links li {
+ display: inline-block;
+}
+
+footer ul li {
+ list-style: none;
+ padding: 0;
+ margin: 0;
+ line-height: 30px;
+}
+
+footer #legal {
+ margin-top: 1em;
+ border-top: solid 1px #333;
+ -webkit-box-shadow: #000 0 -1px 0;
+ box-shadow: #000 0 -1px 0;
+}
+
+footer .books li {
+ float: left;
+ width: 30%;
+ min-width: 95px;
+ margin-left: 2.8%;
+ margin-bottom: 15px;
+ line-height: 130%;
+ font-size: 11px;
+ text-align: center;
+}
+
+footer .books li:first-child {
+ margin-left: 2%;
+}
+
+footer .books li a img {
+ display: block;
+ border-radius: 5px;
+ border: solid 1px rgba(255,255,255,0.2);
+ width: 92px;
+ height: 114px;
+ margin: 0 auto 5px;
+}
+
+footer .books li a:hover img {
+ border-color: #fff;
+}
+
+footer .books li a cite {
+ display: block;
+ font-style: normal;
+ font-size: 9px;
+ line-height: 1.5em;
+ color: #aaa;
+}
+
+
+
+/* General Styles
+ ========================================================================== */
+
+#content .entry-title a {
+ text-decoration: none;
+}
+
+.entry-meta {
+ color: #999;
+ font-size: 12px;
+}
+
+.toc-linked {
+ position: relative;
+}
+
+.toc-linked .toc-link {
+ position: absolute;
+ left: -1em;
+ text-decoration: none;
+ opacity: 0;
+}
+/* TODO: Remove (https://github.com/jquery/jquery-wp-content/issues/143) */
+#content .toc-linked .toc-link {
+ text-decoration: none;
+}
+
+.toc-linked:hover .toc-link {
+ opacity: 1;
+}
+
+.post-heirarchy {
+ margin-bottom: 0.75em;
+}
+
+/* Listing Pages (categories, searches, etc.)
+ ========================================================================== */
+
+.listing .hentry {
+ padding: 10px 20px;
+ margin: 15px 0;
+ border: 1px solid rgba( 0, 0, 0, 0.2 );
+ border-radius: 5px;
+ background-color: #eee;
+ position: relative;
+}
+
+.listing #content .entry-title {
+ font-size: 1.3em;
+ margin-bottom: 0;
+ text-shadow: 0 1px 1px #fff;
+}
+
+.listing .entry-meta {
+ float: right;
+}
+
+.listing .entry-meta .category {
+ padding: 4px;
+ background-color: #ddd;
+ border-radius: 5px;
+}
+
+.listing #content .entry-meta .category a {
+ color: #888;
+ text-decoration: none;
+}
+
+.pagination {
+ text-align: center;
+ margin-top: 2em;
+}
+
+.page-numbers {
+ padding: 0 10px;
+}
+
+
+
+/* API Sites
+========================================================================== */
+
+.entry {
+ margin: 15px 0;
+}
+
+.entry-wrapper {
+ border: 1px solid #CCC;
+ border-top: 0;
+ padding: 10px;
+ border-radius: 0 0 5px 5px;
+}
+
+#content .section-title {
+ background: #333;
+ border: 1px solid #111;
+ padding: 8px 15px;
+ font-size: 16px;
+ color: white;
+ text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
+ letter-spacing: 0;
+ border-radius: 5px 5px 0 0;
+ font-weight: normal;
+ margin-bottom: 0;
+ overflow: hidden;
+}
+
+.returns {
+ float: right;
+ font-style: italic;
+}
+
+.api-item .returns {
+ font-size: 16px;
+ color: #333;
+ font-weight: normal;
+}
+
+.api-item .version-details {
+ display: block;
+ padding: 0.5em;
+ margin: 1em 0;
+ background: #fff3a5;
+ border-radius: 5px;
+}
+
+#content .signatures {
+ background: #eee;
+ border: 1px solid #ccc;
+ margin: 0 auto 15px;
+ max-width: 750px;
+ border-radius: 3px;
+ color: #333;
+ text-shadow: 0 1px 0 #fff;
+}
+
+#content .signatures li {
+ list-style: none;
+ background: none;
+ margin: 0;
+ padding: 10px;
+}
+
+#content .signatures > li {
+ padding-bottom: 0;
+}
+
+#content .signature > ul {
+ margin: 0;
+}
+
+.signatures h4 {
+ font-size: 16px;
+ letter-spacing: 0;
+ padding: 8px 10px;
+ margin: -10px -10px 0;
+ color: #fff;
+ text-shadow: 0 1px 0 #444;
+}
+
+.signature:first-child h4 {
+ border-radius: 3px 3px 0 0;
+}
+
+#content .signature h4 a {
+ color: inherit;
+ text-decoration: none;
+}
+
+.signature h4 .icon-link {
+ margin-right: 0.5em;
+}
+
+.signature .event-properties {
+ margin: 15px 0 0 0;
+}
+
+.argument {
+ margin-top: 1em;
+}
+
+#options, #methods, #extension-points, #events, #quick-nav {
+ border: 1px solid #CCC;
+ margin: 0 15px 15px;
+ padding: 10px;
+ overflow: auto;
+}
+
+#options header h2, #methods header h2, #extension-points header h2, #events header h2, #quick-nav h2 {
+ background: #cccccc; /* Old browsers */
+ background: -webkit-linear-gradient(top, #ffffff 0%,#eeeeee 17%,#cccccc 100%); /* Chrome10+,Safari5.1+ */
+ background: linear-gradient(to bottom, #ffffff 0%,#eeeeee 17%,#cccccc 100%); /* W3C */
+ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
+ margin: -10px -10px 10px -10px;
+ padding: 10px;
+}
+
+#quick-nav h2 a {
+ float: right;
+ font-size: 80%;
+ padding-left: 10px;
+}
+
+.quick-nav-section {
+ width: 33%;
+ float: left;
+}
+
+#methods .api-item li,
+#extension-points .api-item li,
+#events .api-item li {
+ margin-bottom: 1em;
+}
+
+#methods .api-item li ul,
+#extension-points .api-item li ul,
+#events .api-item li ul {
+ list-style: none;
+}
+
+.version-details {
+ font-weight: bold;
+}
+
+.section-title .version-details,
+.name .version-details {
+ float: right;
+ clear: right;
+ font-size: 14px;
+ color: #fff;
+}
+
+.api-item {
+ padding: 20px 10px;
+}
+.signature li,
+.api-item {
+ border-top: 1px solid #CCC;
+}
+
+.signature li:first-child,
+.api-item.first-item {
+ border-top: none;
+ padding-top: 10px;
+}
+
+.option-type {
+ font-size: 16px;
+ font-weight: normal;
+ color: #333;
+ float: right;
+}
+
+#options .default {
+ text-align: right;
+ font-size: 13px;
+ margin-top: -10px;
+}
+
+.desc {
+ font-size: 16px;
+ padding: 5px 15px 0;
+ color: #666;
+ font-style: italic;
+}
+
+.desc strong {
+ color: #444;
+ font-style: normal;
+}
+
+.entry-summary p {
+ margin: 0;
+}
+
+.warning, .note {
+ padding: 0.5em 1em;
+ margin: 1em;
+ border-radius: 5px;
+}
+
+.warning {
+ background: #fff3a5;
+}
+
+.note {
+ background: #428bca;
+ color: #fff;
+}
+
+.note a {
+ color: #fff;
+}
+
+/* Media Queries
+ ========================================================================== */
+
+@media only screen and (max-width: 1100px) {
+
+}
+
+@media only screen and (max-width: 940px) {
+
+}
+
+@media only screen and (max-width: 860px) {
+
+}
+
+@media only screen and (max-width: 768px) {
+ #global-nav ul.projects li.toggle-projects {
+ display: none;
+ }
+
+ #sidebar,
+ .content-right #sidebar {
+ width: auto;
+ float: none;
+ clear: both;
+ margin: 0;
+ border-top: 1px solid #e7e7e7;
+ border-left: none;
+ -moz-border-image: none;
+ -webkit-border-image: none;
+ -webkit-border-image: none;
+ -o-border-image: none;
+ border-image: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ background-image: none;
+ background-image: none;
+ background-image: none;
+ background-image: none;
+ background-image: none;
+ background-image: none;
+ }
+
+ .content-full.full-width #content,
+ .content-right #content,
+ .content-left #content {
+ padding-left: 2%;
+ padding-right: 2%;
+ }
+
+ #content {
+ width: 100%;
+ float: none;
+ clear: both;
+ }
+
+ #banner-secondary {
+ margin-left: -15px;
+ margin-right: -15px;
+ }
+
+ footer p.copyright,
+ footer ul.footer-site-links {
+ width: 100%;
+ text-align: center;
+ margin: 0 0 10px 0;
+ }
+}
+
+@media only screen and (max-width: 600px) {
+ #global-nav ul.projects {
+ display: none;
+ }
+
+ #global-nav nav ul.links {
+ float: left;
+ }
+
+ #global-nav nav ul.links li {
+ font-size: 12px;
+ }
+
+ #logo-events {
+ padding-top: 20px;
+ padding-bottom: 10px;
+ }
+
+ #logo-events aside {
+ display: inline-block;
+ position: relative;
+ left: 50%;
+ margin-left: -200px;
+ float: none;
+ padding: 10px 0;
+ }
+
+ #logo-events h2.logo {
+ float: none;
+ margin-left: auto;
+ margin-right: auto;
+ }
+
+ nav#main {
+ background-color: rgba(0, 0, 0, 0.0);
+ border-radius: 10px 10px 0 0;
+ border-right: none;
+ border-left: none;
+ border-top: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ padding-top: 10px;
+ }
+
+ nav#main .searchform {
+ display: block;
+ float: none;
+ width: 100%;
+ margin: 15px auto;
+ clear:both;
+ }
+
+ nav#main ul{
+ width: auto !important;
+ text-align: left !important;
+ float: none;
+ margin: 0px;
+ padding: 0px;
+ }
+
+ nav#main ul li, nav#main ul li a {
+ display: block;
+ text-align: left !important;
+ float: left;
+ margin-right: 0px;
+ padding: 0 4px 4px 0;
+ }
+
+
+ nav#main li a:hover,
+ nav#main li.current a {
+ background: none;
+ -webkit-box-shadow: none;
+ box-shadow: none;
+ border-radius: 4px;
+ border: 1px solid rgba(0,0,0,0.0);
+ }
+
+ nav#main li a {
+ font-size: 14px;
+ }
+
+ #content-wrapper {
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+ }
+
+ #banner-secondary {
+ border-top-left-radius: 9px;
+ border-top-right-radius: 9px;
+ margin-left: -10px;
+ margin-right: -10px;
+ }
+
+ #banner-secondary h2 {
+ font-size: 35px;
+ line-height: 35px;
+ }
+
+ #content h1 {
+ font-size: 26px;
+ line-height: 26px;
+ }
+
+ #banner-secondary.large-banner h1,
+ #banner-secondary.large-banner h2 {
+ font-size: 36px;
+ line-height: 36px;
+ }
+
+ #banner-secondary.large-banner p {
+ font-size: 22px;
+ padding: 0;
+ }
+
+ footer .books li {
+ clear: both;
+ margin-bottom: 10px;
+ float: none;
+ margin-left: auto !important;
+ margin-right: auto;
+ text-align: center;
+ }
+
+ footer .books li span {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+ }
+}
+
+@media only screen and (max-width: 480px) {
+
+ #global-nav {
+ display: none;
+ }
+
+ #logo-events aside {
+ width: 300px;
+ margin-left: -150px;
+ }
+
+ #container {
+ border-top: none !important;
+ }
+
+ .tinynav-container {
+ display: block;
+ }
+
+ #menu-top {
+ display: none;
+ }
+
+ .tinynav {
+ display: block;
+ width: 100%;
+ margin: 0 auto 15px;
+ position: relative;
+ top: 6px;
+ left: 0px;
+ }
+
+ nav#main {
+ margin-top: 15px;
+ padding-top: 0;
+ }
+
+ nav#main .searchform {
+ display: block;
+ float: none;
+ width: 100%;
+ margin: 15px auto;
+ }
+
+ nav#main ul li, nav#main ul li a {
+ float: none;
+ padding: 6px 0px 6px 8px;
+ }
+
+ .constrain,
+ #container {
+ padding-left: 10px;
+ padding-right: 10px;
+ }
+
+ .content-full #content,
+ .content-full.full-width #content,
+ .content-right #content,
+ .content-left #content {
+ padding-left: 0;
+ padding-right: 0;
+ }
+
+ #content-wrapper {
+ padding-left: 25px;
+ padding-right: 25px;
+ }
+
+ #content pre {
+ margin-left: -25px;
+ margin-right: -25px;
+ }
+
+ #content img.left,
+ #content figure.left,
+ #content img.right,
+ #content figure.right {
+ display: block;
+ width: 100%;
+ max-width: 100%;
+ margin-left: 0;
+ margin-right: 0;
+ }
+
+ #banner-secondary {
+ margin-left: -25px;
+ margin-right: -25px;
+ }
+
+ footer .footer-icon-links li a:before {
+ display: none;
+ }
+
+ footer .footer-icon-links li:first-child {
+ margin-left: 0;
+ }
+
+ footer .download > span {
+ white-space: normal;
+ }
+}
+
+@media only screen and (-webkit-device-pixel-ratio: 2){
+ .jquery h2.logo a {
+ background: url(../images/logo-jquery@2x.png) no-repeat;
+ background-size: 243px 66px;
+ }
+
+ .jquery-ui h2.logo a {
+ background: url(../images/logo-jquery-ui@2x.png) no-repeat;
+ background-size: 253px 66px;
+ }
+
+ .jquery-mobile h2.logo a {
+ background: url(../images/logo-jquery-mobile@2x.png) no-repeat;
+ background-size: 268px 66px;
+ }
+
+ .sizzlejs h2.logo a {
+ background: url(../images/logo-sizzle@2x.png) no-repeat;
+ background-size: 243px 66px;
+ }
+
+ .qunitjs h2.logo a {
+ background: url(../images/logo-qunit@2x.png) no-repeat;
+ background-size: 243px 66px;
+ }
+
+ .jquery-foundation h2.logo a {
+ background: url(../images/logo-jquery-foundation@2x.png) no-repeat;
+ background-size: 243px 66px;
+ }
+}
+
+@media only screen and (-webkit-min-device-pixel-ratio: 1.5),
+ only screen and (min-resolution: 144dpi) {
+
+}
+
+ /* Helper classes
+ ========================================================================== */
+
+.ir {
+ background-color: transparent;
+ border: 0;
+ overflow: hidden;
+ *text-indent: -9999px;
+}
+
+.ir:before {
+ content: "";
+ display: block;
+ width: 0;
+ height: 100%;
+}
+
+.hidden {
+ display: none !important;
+ visibility: hidden;
+}
+
+.visuallyhidden {
+ border: 0;
+ clip: rect(0 0 0 0);
+ height: 1px;
+ margin: -1px;
+ overflow: hidden;
+ padding: 0;
+ position: absolute;
+ width: 1px;
+}
+
+.visuallyhidden.focusable:active,
+.visuallyhidden.focusable:focus {
+ clip: auto;
+ height: auto;
+ margin: 0;
+ overflow: visible;
+ position: static;
+ width: auto;
+}
+
+.invisible {
+ visibility: hidden;
+}
+
+.clearfix:before,
+.clearfix:after {
+ content: " ";
+ display: table;
+}
+
+.clearfix:after {
+ clear: both;
+}
+
+.clearfix {
+ *zoom: 1;
+}
+
+/* Print styles
+ ========================================================================== */
+
+@media print {
+ * {
+ background: transparent !important;
+ color: #000 !important; /* Black prints faster: h5bp.com/s */
+ box-shadow:none !important;
+ text-shadow: none !important;
+ }
+
+ a,
+ a:visited {
+ text-decoration: underline;
+ }
+
+ a[href]:after {
+ content: " (" attr(href) ")";
+ }
+
+ abbr[title]:after {
+ content: " (" attr(title) ")";
+ }
+
+ /*
+ * Don't show links for images, or javascript/internal links
+ */
+
+ .ir a:after,
+ a[href^="javascript:"]:after,
+ a[href^="#"]:after {
+ content: "";
+ }
+
+ pre,
+ blockquote {
+ border: 1px solid #999;
+ page-break-inside: avoid;
+ }
+
+ thead {
+ display: table-header-group; /* h5bp.com/t */
+ }
+
+ tr,
+ img {
+ page-break-inside: avoid;
+ }
+
+ img {
+ max-width: 100% !important;
+ }
+
+ @page {
+ margin: 0.5cm;
+ }
+
+ p,
+ h2,
+ h3 {
+ orphans: 3;
+ widows: 3;
+ }
+
+ h2,
+ h3 {
+ page-break-after: avoid;
+ }
+}
+
+/* The Grid ----------------------
+Based on Zurb Foundation's Grid
+*/
+.row { width: 1240px; max-width: 100%; min-width: 768px; margin: 0 auto; }
+.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -25px; }
+.row.collapse .column, .row.collapse .columns { padding: 0; }
+.row .row { width: auto; max-width: none; min-width: 0; margin: 0 -25px; }
+.row .row.collapse { margin: 0; }
+
+.column, .columns { float: left; min-height: 1px; padding: 0 25px; position: relative; }
+.column.centered, .columns.centered { float: none; margin: 0 auto; }
+
+[class*="column"] + [class*="column"]:last-child { float: right; }
+
+[class*="column"] + [class*="column"].end { float: left; }
+
+.one, .row .one { width: 8.33333%; }
+
+.two, .row .two { width: 16.66667%; }
+
+.three, .row .three { width: 25%; }
+
+.four, .row .four { width: 33.33333%; }
+
+.five, .row .five { width: 41.66667%; }
+
+.six, .row .six { width: 50%; }
+
+.seven, .row .seven { width: 58.33333%; }
+
+.eight, .row .eight { width: 66.66667%; }
+
+.nine, .row .nine { width: 75%; }
+
+.ten, .row .ten { width: 83.33333%; }
+
+.eleven, .row .eleven { width: 91.66667%; }
+
+.twelve, .row .twelve { width: 100%; }
+
+.row .offset-by-one { margin-left: 8.33333%; }
+
+.row .offset-by-two { margin-left: 16.66667%; }
+
+.row .offset-by-three { margin-left: 25%; }
+
+.row .offset-by-four { margin-left: 33.33333%; }
+
+.row .offset-by-five { margin-left: 41.66667%; }
+
+.row .offset-by-six { margin-left: 50%; }
+
+.row .offset-by-seven { margin-left: 58.33333%; }
+
+.row .offset-by-eight { margin-left: 66.66667%; }
+
+.row .offset-by-nine { margin-left: 75%; }
+
+.row .offset-by-ten { margin-left: 83.33333%; }
+
+.push-two { left: 16.66667%; }
+
+.pull-two { right: 16.66667%; }
+
+.push-three { left: 25%; }
+
+.pull-three { right: 25%; }
+
+.push-four { left: 33.33333%; }
+
+.pull-four { right: 33.33333%; }
+
+.push-five { left: 41.66667%; }
+
+.pull-five { right: 41.66667%; }
+
+.push-six { left: 50%; }
+
+.pull-six { right: 50%; }
+
+.push-seven { left: 58.33333%; }
+
+.pull-seven { right: 58.33333%; }
+
+.push-eight { left: 66.66667%; }
+
+.pull-eight { right: 66.66667%; }
+
+.push-nine { left: 75%; }
+
+.pull-nine { right: 75%; }
+
+.push-ten { left: 83.33333%; }
+
+.pull-ten { right: 83.33333%; }
+
+img, object, embed { max-width: 100%; height: auto; }
+
+object, embed { height: 100%; }
+
+img { -ms-interpolation-mode: bicubic; }
+
+#map_canvas img, .map_canvas img { max-width: none!important; }
+
+/* Nicolas Gallagher's micro clearfix */
+.row { *zoom: 1; }
+.row:before, .row:after { content: ""; display: table; }
+.row:after { clear: both; }
+
+/* Mobile Grid and Overrides ---------------------- */
+@media only screen and (max-width: 767px) {
+ .row { width: auto; min-width: 0; margin-left: 0 !important; margin-right: 0 !important; }
+ .column, .columns { width: auto !important; float: none; padding-left: 0 !important; padding-right: 0 !important;
+ }
+ .column:last-child, .columns:last-child { float: none; }
+ [class*="column"] + [class*="column"]:last-child { float: none; }
+ .column:before, .columns:before, .column:after, .columns:after { content: ""; display: table; }
+ .column:after, .columns:after { clear: both; }
+ .offset-by-one, .offset-by-two, .offset-by-three, .offset-by-four, .offset-by-five, .offset-by-six, .offset-by-seven, .offset-by-eight, .offset-by-nine, .offset-by-ten { margin-left: 0 !important; }
+ .push-two, .push-three, .push-four, .push-five, .push-six, .push-seven, .push-eight, .push-nine, .push-ten { left: auto; }
+ .pull-two, .pull-three, .pull-four, .pull-five, .pull-six, .pull-seven, .pull-eight, .pull-nine, .pull-ten { right: auto; }
+ /* Mobile 4-column Grid */
+ .row .mobile-one { width: 25% !important; float: left; padding: 0 25px; }
+ .row .mobile-one:last-child { float: right; }
+ .row .mobile-one.end { float: left; }
+ .row.collapse .mobile-one { padding: 0; }
+ .row .mobile-two { width: 50% !important; float: left; padding: 0 25px; }
+ .row .mobile-two:last-child { float: right; }
+ .row .mobile-two.end { float: left; }
+ .row.collapse .mobile-two { padding: 0; }
+ .row .mobile-three { width: 75% !important; float: left; padding: 0 25px; }
+ .row .mobile-three:last-child { float: right; }
+ .row .mobile-three.end { float: left; }
+ .row.collapse .mobile-three { padding: 0; }
+ .row .mobile-four { width: 100% !important; float: left; padding: 0 25px; }
+ .row .mobile-four:last-child { float: right; }
+ .row .mobile-four.end { float: left; }
+ .row.collapse .mobile-four { padding: 0; }
+ .push-one-mobile { left: 25%; }
+ .pull-one-mobile { right: 25%; }
+ .push-two-mobile { left: 50%; }
+ .pull-two-mobile { right: 50%; }
+ .push-three-mobile { left: 75%; }
+ .pull-three-mobile { right: 75%; }
+}
+
+
+/* Block Grids ---------------------- */
+/* These are 2-up, 3-up, 4-up and 5-up ULs, suited
+for repeating blocks of content. Add 'mobile' to
+them to switch them just like the layout grid
+(one item per line) on phones
+
+For IE7/8 compatibility block-grid items need to be
+the same height. You can optionally uncomment the
+lines below to support arbitrary height, but know
+that IE7/8 do not support :nth-child.
+-------------------------------------------------- */
+.block-grid, #content .block-grid { display: block; overflow: hidden; padding: 0; }
+.block-grid > li, #content .block-grid > li { display: block; height: auto; float: left; }
+.block-grid.one-up, #content .block-grid.one-up { margin: 0; }
+.block-grid.one-up > li, #content .block-grid.one-up > li { width: 100%; padding: 0 0 15px; }
+.block-grid.two-up, #content .block-grid.two-up { margin: 0 -15px; }
+.block-grid.two-up > li, #content .block-grid.two-up > li { width: 50%; padding: 0 15px 15px; }
+.block-grid.two-up > li:nth-child(2n+1), #content .block-grid.two-up > li:nth-child(2n+1) { clear: both; }
+.block-grid.three-up, #content .block-grid.three-up { margin: 0 -12px; }
+.block-grid.three-up > li, #content .block-grid.three-up > li { width: 33.33%; padding: 0 12px 12px; }
+.block-grid.three-up > li:nth-child(3n+1), #content .block-grid.three-up > li:nth-child(3n+1) { clear: both; }
+.block-grid.four-up, #content .block-grid.four-up { margin: 0 -10px; }
+.block-grid.four-up > li, #content .block-grid.four-up > li { width: 25%; padding: 0 10px 10px; }
+.block-grid.four-up > li:nth-child(4n+1), #content .block-grid.four-up > li:nth-child(4n+1) { clear: both; }
+.block-grid.five-up, #content .block-grid.five-up { margin: 0 -8px; }
+.block-grid.five-up > li, #content .block-grid.five-up > li { width: 20%; padding: 0 8px 8px; }
+.block-grid.five-up > li:nth-child(5n+1), #content .block-grid.five-up > li:nth-child(5n+1) { clear: both; }
+
+/* Mobile Block Grids */
+@media only screen and (max-width: 767px) {
+ .block-grid.mobile > li { float: none !important; width: 100% !important; margin-left: 0 !important; }
+ .block-grid > li { clear: none !important; }
+ .block-grid.mobile-two-up > li { width: 50% !important; }
+ .block-grid.mobile-two-up > li:nth-child(2n+1) { clear: both; }
+ .block-grid.mobile-three-up > li { width: 33.33% !important; }
+ .block-grid.mobile-three-up > li:nth-child(3n+1) { clear: both !important; }
+ .block-grid.mobile-four-up > li { width: 25% !important; }
+ .block-grid.mobile-four-up > li:nth-child(4n+1) { clear: both; }
+ .block-grid.mobile-five-up > li:nth-child(5n+1) { clear: both; }
+}
+
+/*
+ ColorBox Core Style:
+ The following CSS is consistent between example themes and should not be altered.
+*/
+#colorbox, #cboxOverlay, #cboxWrapper{position:absolute; top:0; left:0; z-index:9999; overflow:hidden;}
+#cboxOverlay{position:fixed; width:100%; height:100%;}
+#cboxMiddleLeft, #cboxBottomLeft{clear:left;}
+#cboxContent{position:relative;}
+#cboxLoadedContent{overflow:auto;}
+#cboxTitle{margin:0;}
+#cboxLoadingOverlay, #cboxLoadingGraphic{position:absolute; top:0; left:0; width:100%; height:100%;}
+#cboxPrevious, #cboxNext, #cboxClose, #cboxSlideshow{cursor:pointer;}
+.cboxPhoto{float:left; margin:auto; border:0; display:block; max-width:none;}
+.cboxIframe{width:100%; height:100%; display:block; border:0;}
+#colorbox, #cboxContent, #cboxLoadedContent{box-sizing:content-box;}
+
+/*
+ User Style:
+ Change the following styles to modify the appearance of ColorBox. They are
+ ordered & tabbed in a way that represents the nesting of the generated HTML.
+*/
+#cboxOverlay{background:url(../images/colorbox/overlay.png) repeat 0 0;}
+#cboxTopLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -101px 0;}
+#cboxTopRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -130px 0;}
+#cboxBottomLeft{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -101px -29px;}
+#cboxBottomRight{width:21px; height:21px; background:url(../images/colorbox/controls.png) no-repeat -130px -29px;}
+#cboxMiddleLeft{width:21px; background:url(../images/colorbox/controls.png) left top repeat-y;}
+#cboxMiddleRight{width:21px; background:url(../images/colorbox/controls.png) right top repeat-y;}
+#cboxTopCenter{height:21px; background:url(../images/colorbox/border.png) 0 0 repeat-x;}
+#cboxBottomCenter{height:21px; background:url(../images/colorbox/border.png) 0 -29px repeat-x;}
+#cboxContent{background:#fff; overflow:hidden;}
+.cboxIframe{background:#fff;}
+#cboxError{padding:50px; border:1px solid #ccc;}
+#cboxLoadedContent{margin-bottom:28px;}
+#cboxTitle{position:absolute; bottom:4px; left:0; text-align:center; width:100%; color:#949494;}
+#cboxCurrent{position:absolute; bottom:4px; left:58px; color:#949494;}
+#cboxSlideshow{position:absolute; bottom:4px; right:30px; color:#0092ef;}
+#cboxPrevious{position:absolute; bottom:0; left:0; background:url(../images/colorbox/controls.png) no-repeat -75px 0; width:25px; height:25px; text-indent:-9999px;}
+#cboxPrevious:hover{background-position:-75px -25px;}
+#cboxNext{position:absolute; bottom:0; left:27px; background:url(../images/colorbox/controls.png) no-repeat -50px 0; width:25px; height:25px; text-indent:-9999px;}
+#cboxNext:hover{background-position:-50px -25px;}
+#cboxLoadingOverlay{background:url(../images/colorbox/loading_background.png) no-repeat center center;}
+#cboxLoadingGraphic{background:url(../images/colorbox/loading.gif) no-repeat center center;}
+#cboxClose{position:absolute; bottom:0; right:0; background:url(../images/colorbox/controls.png) no-repeat -25px 0; width:25px; height:25px; text-indent:-9999px;}
+#cboxClose:hover{background-position:-25px -25px;}
+
+/*
+ The following fixes a problem where IE7 and IE8 replace a PNG's alpha transparency with a black fill
+ when an alpha filter (opacity change) is set on the element or ancestor element. This style is not applied to or needed in IE9.
+ See: http://jacklmoore.com/notes/ie-transparency-problems/
+*/
+.cboxIE #cboxTopLeft,
+.cboxIE #cboxTopCenter,
+.cboxIE #cboxTopRight,
+.cboxIE #cboxBottomLeft,
+.cboxIE #cboxBottomCenter,
+.cboxIE #cboxBottomRight,
+.cboxIE #cboxMiddleLeft,
+.cboxIE #cboxMiddleRight {
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#00FFFFFF,endColorstr=#00FFFFFF);
+}
+
+/*
+ The following provides PNG transparency support for IE6
+ Feel free to remove this and the /ie6/ directory if you have dropped IE6 support.
+*/
+.cboxIE6 #cboxTopLeft{background:url(../images/colorbox/ie6/borderTopLeft.png);}
+.cboxIE6 #cboxTopCenter{background:url(../images/colorbox/ie6/borderTopCenter.png);}
+.cboxIE6 #cboxTopRight{background:url(../images/colorbox/ie6/borderTopRight.png);}
+.cboxIE6 #cboxBottomLeft{background:url(../images/colorbox/ie6/borderBottomLeft.png);}
+.cboxIE6 #cboxBottomCenter{background:url(../images/colorbox/ie6/borderBottomCenter.png);}
+.cboxIE6 #cboxBottomRight{background:url(../images/colorbox/ie6/borderBottomRight.png);}
+.cboxIE6 #cboxMiddleLeft{background:url(../images/colorbox/ie6/borderMiddleLeft.png);}
+.cboxIE6 #cboxMiddleRight{background:url(../images/colorbox/ie6/borderMiddleRight.png);}
+
+.cboxIE6 #cboxTopLeft,
+.cboxIE6 #cboxTopCenter,
+.cboxIE6 #cboxTopRight,
+.cboxIE6 #cboxBottomLeft,
+.cboxIE6 #cboxBottomCenter,
+.cboxIE6 #cboxBottomRight,
+.cboxIE6 #cboxMiddleLeft,
+.cboxIE6 #cboxMiddleRight {
+ _behavior: expression(this.src = this.src ? this.src : this.currentStyle.backgroundImage.split('"')[1], this.style.background = "none", this.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" + this.src + ", sizingMethod='scale')");
+}
+
+
+/* Syntax Highlighting ---------------------- */
+
+pre, code {
+ font-family: "source-code-pro", Consolas, monospace !important;
+ word-spacing: 0;
+}
+pre code {
+ display: block; padding: 0.5em;
+ color: #333;
+ background: #f8f8ff
+}
+
+pre .comment,
+pre .template_comment,
+pre .diff .header,
+pre .javadoc {
+ color: #998;
+ font-style: italic
+}
+
+pre .keyword,
+pre .css .rule .keyword,
+pre .winutils,
+pre .javascript .title,
+pre .nginx .title,
+pre .subst,
+pre .request,
+pre .status {
+ color: #333;
+ font-weight: bold
+}
+
+pre .number,
+pre .hexcolor,
+pre .ruby .constant {
+ color: #099;
+}
+
+pre .string,
+pre .tag .value,
+pre .phpdoc,
+pre .tex .formula {
+ color: #d14
+}
+
+pre .title,
+pre .id {
+ color: #900;
+ font-weight: bold
+}
+
+pre .javascript .title,
+pre .lisp .title,
+pre .clojure .title,
+pre .subst {
+ font-weight: normal
+}
+
+pre .class .title,
+pre .haskell .type,
+pre .vhdl .literal,
+pre .tex .command {
+ color: #458;
+ font-weight: bold
+}
+
+pre .tag,
+pre .tag .title,
+pre .rules .property,
+pre .django .tag .keyword {
+ color: #000080;
+ font-weight: normal
+}
+
+pre .attribute,
+pre .variable,
+pre .lisp .body {
+ color: #008080
+}
+
+pre .regexp {
+ color: #009926
+}
+
+pre .class {
+ color: #458;
+ font-weight: bold
+}
+
+pre .symbol,
+pre .ruby .symbol .string,
+pre .lisp .keyword,
+pre .tex .special,
+pre .prompt {
+ color: #990073
+}
+
+pre .built_in,
+pre .lisp .title,
+pre .clojure .built_in {
+ color: #0086b3
+}
+
+pre .preprocessor,
+pre .pi,
+pre .doctype,
+pre .shebang,
+pre .cdata {
+ color: #999;
+ font-weight: bold
+}
+
+pre .deletion {
+ background: #fdd
+}
+
+pre .addition {
+ background: #dfd
+}
+
+pre .diff .change {
+ background: #0086b3
+}
+
+pre .chunk {
+ color: #aaa
+}
+
+.syntaxhighlighter a,
+.syntaxhighlighter div,
+.syntaxhighlighter pre,
+.syntaxhighlighter code,
+.syntaxhighlighter table,
+.syntaxhighlighter table td,
+.syntaxhighlighter table tr,
+.syntaxhighlighter table tbody,
+.syntaxhighlighter table thead,
+.syntaxhighlighter table caption,
+.syntaxhighlighter textarea {
+ border-radius: 0 0 0 0 !important;
+ background: none !important;
+ bottom: auto !important;
+ float: none !important;
+ height: auto !important;
+ left: auto !important;
+ line-height: 1.1em !important;
+ margin: 0 !important;
+ outline: 0 !important;
+ overflow: visible !important;
+ padding: 0 !important;
+ position: static !important;
+ right: auto !important;
+ text-align: left !important;
+ top: auto !important;
+ vertical-align: baseline !important;
+ width: auto !important;
+ box-sizing: content-box !important;
+ font-family: "source-code-pro", Consolas, monospace !important;
+ font-weight: normal !important;
+ font-style: normal !important;
+ font-size: 1em !important;
+ min-height: inherit !important;
+ min-height: auto !important;
+}
+.syntaxhighlighter {
+ width: 100% !important;
+ margin: 1em 0 1em 0 !important;
+ padding: 1em 0;
+ position: relative !important;
+ overflow: auto !important;
+ font-size: 1em !important;
+ background: #eee;
+}
+.syntaxhighlighter.source {
+ overflow: hidden !important;
+}
+.syntaxhighlighter .line {
+ white-space: pre !important;
+}
+.syntaxhighlighter table {
+ width: 100% !important;
+}
+.syntaxhighlighter table caption {
+ text-align: left !important;
+ padding: .5em 0 0.5em 1em !important;
+}
+.syntaxhighlighter table td.code {
+ width: 100% !important;
+}
+.syntaxhighlighter table td.code .container {
+ position: relative !important;
+}
+.syntaxhighlighter table td.code .container textarea {
+ box-sizing: border-box !important;
+ position: absolute !important;
+ left: 0 !important;
+ top: 0 !important;
+ width: 100% !important;
+ height: 100% !important;
+ border: none !important;
+ background: white !important;
+ padding-left: 1em !important;
+ overflow: hidden !important;
+ white-space: pre !important;
+}
+.syntaxhighlighter table td.gutter .line {
+ text-align: right !important;
+ padding: 0 0.5em 0 1em !important;
+}
+.syntaxhighlighter table td.code .line {
+ padding: 0 0.5em !important;
+}
+.syntaxhighlighter.nogutter td.code .container textarea,
+.syntaxhighlighter.nogutter td.code .line {
+ padding-left: 1em !important;
+}
+
+.syntaxhighlighter table td.gutter {
+ border-right: 2px solid #999;
+}
+
+.syntaxhighlighter {
+ border-radius: 5px;
+}
+
+#content .syntaxhighlighter tr {
+ border-bottom: none;
+}
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/comment-reply.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/comment-reply.js
new file mode 100644
index 000000000..11af308f3
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/comment-reply.js
@@ -0,0 +1 @@
+var addComment={moveForm:function(a,b,c,d){var e,f=this,g=f.I(a),h=f.I(c),i=f.I("cancel-comment-reply-link"),j=f.I("comment_parent"),k=f.I("comment_post_ID");if(g&&h&&i&&j){f.respondId=c,d=d||!1,f.I("wp-temp-form-div")||(e=document.createElement("div"),e.id="wp-temp-form-div",e.style.display="none",h.parentNode.insertBefore(e,h)),g.parentNode.insertBefore(h,g.nextSibling),k&&d&&(k.value=d),j.value=b,i.style.display="",i.onclick=function(){var a=addComment,b=a.I("wp-temp-form-div"),c=a.I(a.respondId);if(b&&c)return a.I("comment_parent").value="0",b.parentNode.insertBefore(c,b),b.parentNode.removeChild(b),this.style.display="none",this.onclick=null,!1};try{f.I("comment").focus()}catch(l){}return!1}},I:function(a){return document.getElementById(a)}};
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/d.css b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/d.css
new file mode 100644
index 000000000..707a70208
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/d.css
@@ -0,0 +1,40 @@
+/*{"c":"2014-09-12T08:50:19Z","s":"prod-origin-be1939cd","v":"30e432"}*/
+/*
+ * The Typekit service used to deliver this font or fonts for use on websites
+ * is provided by Adobe and is subject to these Terms of Use
+ * http://www.adobe.com/products/eulas/tou_typekit. For font license
+ * information, see the list below.
+ *
+ * klavika-web:
+ * - http://typekit.com/eulas/00000000000000000000e3d8
+ * - http://typekit.com/eulas/00000000000000000000e3d7
+ * source-code-pro:
+ * - http://typekit.com/eulas/000000000000000000013297
+ * - http://typekit.com/eulas/000000000000000000013299
+ *
+ * (c) 2009-2014 Adobe Systems Incorporated. All Rights Reserved.
+ */
+
+@font-face {
+font-family:"klavika-web";
+src:url(data:font/opentype;base64,d09GRgABAAAAAFVIABAAAAAApmQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAABVLAAAABwAAAAcWB5yc0dQT1MAAEhUAAAM1wAAGigjnlKhR1NVQgAASCgAAAAsAAAAMLj/uP5PUy8yAAAB6AAAAFkAAABgWfNlhGNtYXAAAARoAAABWwAAAZobgK0kY3Z0IAAAByAAAAAmAAAAJgPsBhFmcGdtAAAFxAAAAQIAAAFzBlmcN2dseWYAAAjoAAA8BQAAe7hLdnOsaGVhZAAAAWwAAAA1AAAANvZy5IxoaGVhAAABpAAAACEAAAAkB0UDR2htdHgAAAJEAAACIQAAAzyOQRjmbG9jYQAAB0gAAAGgAAABoFr3eQJtYXhwAAAByAAAACAAAAAgAuUBxG5hbWUAAETwAAAB1gAAA/bJJdKkcG9zdAAARsgAAAFgAAABzdfWUnBwcmVwAAAGyAAAAFYAAABy3F7GGXjaY2BkYGBgYWQ7IbBWLZ7f5iuDPPMLoAjDyWMX2GH0/63/1Zm/M+cwMDNwMDCBRAFsfQ19AAAAeNpjYGRgYG75dwVI7vq/9X8b83eGFAYhBmRwHgC9CAiQAAAAAAEAAADPAFoABQBGAAQAAQAAAAAACgAAAgABIgACAAF42mNgZvzAtIeBlYGBaQ9TFwMDQw+EZrzLYMTwCyjKzcHGwsDAycCygIFhfQCDghcDFCgAAYMig4KiEtO7/2wMDMwtjDoKDAzzQXKMz5lmgZQwMAEAE8YPKQAAAHjabZLNS1RRGMaf570jZsw0OVzmQ4c+dMxFVNrCgWYIDMoKpoZBEcQwpI+JJIghMNBNQdCyP6BFtIqgTbiRNoFGLQqToDa1qJD8SHAnFZ6euY0xiBee+5x7z3nP+573dziG/dDDgl7z8iQSnEC/PUaKKwh7V9Fn80jjNfqZRxePuxl+wKCFcIwxrT+HNvpIctatWDs6eAcHuYYGLqLBDjjHH2iyRv2fRcx2I80N+MqRZgqwI9hjTeiVd/EbLtscDtm4+2wn4FsMHTYo9yWTzut7UrF7VVebm7ILGi/D9/YhZE81X9Z8seb35K3YpT3ydgOHrYTT3jQKVnaLlkDOupFhDo2qqcKcm+NH9PKFau3BTYsibTsR5yN5TOd6p3xXdDbfbeh8PqNSzE0b/o29vHLpv+1AymJu1ZoVU9LcQ4Q5jk7LKNcXdNsbZLnkVjVu5gxaeBad6ts1nnEv+RaJoPdpt84naLcW7deHk4pNVNdYGCU+R8ULqc4JDPC3alrHUU5hhCPa4xaGAh4PMMpJqQcVy7ifqr/IuGIybo2XcJv3tf4X4t5FDHtj0l2c4lf3J+j5NvIG5FUOfo1DTQGDOtl1tP5nsEX8LgZlWMChXlUO6pMV3Keg59vpvXolDgGDekVrHDa1pHu0yWCrIsjKUeVQryqHKq+AxzP18BXabFh3OaL+RjDEBfmCfFlcRpEV56TubYoJxMUjqrtT/AtjIZw0AAAAeNpjYGBgZoBgGQZGBhCYAuQxgvksDBVAWopBACjCxVDHsIbhP9MdBREFSQU5BSUFNQUrhTWKSv//A9UoMCxgWAeUE1aQUJABy1lC5P4//n/o/8G/Tx+sf7DmwaoHyx8seTDpgeL9NVC7cABGNga4AkYmIMGErgDoZBZWNnYOTi5uHl4+fgFBIWERUTFxCUkpaRlZOXkFRSVlFVU1dQ1NLW0dXT19A0MjYxNTM3MLSytrG1s7ewdHJ2cXVzd3D08vbx9fP/+AwKDgkNCw8IjIqOiY2Lj4hESG1raOrknT5y5auHjpkmUrVq1cvWbd2vUbNm3ZvHX7tt279uxlKExJzTxZviA/+1xpFkP7TIYiBob0MrDrcqoZlu9sSM4DsXNrTiU1tkxjYDh0+NjxI0d3MBxgYDh7+gxQpoLhBENzd1NPZ1//hN4pUxkmz54zi4HhYAFQqhKIAcS0bhgAeNpdkD1OxDAQhcc4LOQGSBaSLSsUK6/oqVI4kVCaQCg8DT/SrkT2DkhpaFxwlqEzXS6GYJKNttjGM+/N6POzE4BrEuRt+BbiC5P4+0zgr38gB/nyvEkgnNZV70m8sjhzbKwNd9LpmmRRPwaLOup4v4261u9vW8qKufJgF/FWE3Sh5/MpGCpRHdsd4h1zsomTzZyITNgvhP1MYMAvL527RpO8acNDoMErKj0qY3RFYxto9Mog8tbqmJTrR3+1ZL7gzKs1N5cHSheoVAQY40FZQ0OMKvI7Fp1gPDEEnBrlYvBPTERZVEkM7TwarFGTYY01nBM93527pgsVJzW4+Qck6mvkAAB42tvBwKDNsIuBkYGJgUmbcRcDM4SxH8hQZ1BkkGIQYuBhYGDg0N7PwMKgiiLCsB+ozZxBl0GZQRKuiAloHIqiXQysDGwM7No7GBgUXGszJVwAnO8MEgAAABQAZQCAAI4AlQAAAAr/TwAK/zEACgHbABYCCAAKApoACgAhAnkAAAAAACoAKgAqACoAUABuAPYBmAJWAwwDHgNUA44D1gQKBCgEPARWBHIFDgUyBZIGMAZmBuAHpAfGCKgJbAmUCcIJ7AoMCjgKnguCC7wMQgy2DRQNTg2CDf4OQA5gDo4Oyg7wD0APhhA2EJIRWhHKEqASzhMuE2ITuhQCFDgUbhSMFKYUxBTkFPYVDhWAFeoWZhbmF4wX7BhuGNYZABk6GWwZhhpIGrYbYhvuHFwcmh0WHYId5B44HtgfKB+aH84gGCAyIH4gsiCyINghQCG8InAiyiLoI4wjviR2JNAk9CUWJa4lwiYkJmomvidCJ14nqCfyKAYoQChcKOApBClaKd4quCsoK1AreiuuK+osECxGLKQtdC2cLcQt+C4eLjguVC58LpYvDC9IL5wv8jBSMLoxDDEwMbYx8DIsMnIyqjLQMzAz4jPuM/o0TDRYNGQ0wDW8Npg2pDawNxI3Hjc4N1Y3fDeYOHI4fjiKOJY48Dj8OQg5UDnaOeY58jo2OkI6TjrUOuA7NDtIO1w7eDuYO8g79jwyPGo8rDzCPNg9dj3ceNqtfQuYHFWVcN2qrq5+v6q6q9+v6nf39GP6Na9kMsnkSRICIYGEjBAgPAIYCARCwCggKEokQEBBRRHExVX8RdGQWV1xXRUVd9b9RXSj/uquoOD+oIgopOc/996q7p6enjD4/UlqunKn6j7OOfe87jmnGZaJMQzKsfczHCMwxS8ipjT2uKBz/mHwi3r++NjjHAu3zBc53Mzj5scFvevNsccRbq86Y8501anEkPGF73yHvf/EhTH2LIZhGRn6DLOPMTxjZMLMUYYtHWWYlWcdZQylwJOMgeGXbnuS0TPsq+XKOBKrnB1VBeVcVLm9suSGw6HDLzyGvK0XHlv+CO7rDPQVdBf0hecnQl8M9KUr0T71pXIFv5qGC1XPyZ9zG1zsY6+//jrD4Hd98OMB9lYmwESYz8G7Irwja3Nx4rk4GfPSbWqDGze4uxp8uMHX1cDjBh5PX20w4gYjbpiG4RBMUpeH9xxPwvDo1aMM5zjKCDP00wyfLHxa4ZOBTzt8OtS2IL6HzzB8RmZgUQKsSFCa5GpWyVUVyCXw8F/WF9onXR05P3IXXPula0MHxAPq//aKrRvuCt2F7jgy9QD8mToydT/8mTpyBKZnmX0feoVDzErm+qPMKgCEozQhwPwdsEoHk4WLm6ITtMIvV8GE/HDvLz3JVBnuVXhUDzceuFK4AR4tw6/LuB9Y8RJGBytefRzgHMcwLk0DbbFMnoAkBn0l4OEEYExWmkWUbnqqg0vZ5lJUrxXZdJGr15pLuXHAZhjJQhEpcRsr2JBbCrNymHNLesHGCf+zR0qNx+OnbfRHJZOO5fSuiC9bi1qMRn9hxaC0R/IX/MHo1qQn6DJyLKt3xQLZWtjM84InM16+7krOZrs6KDhDbotLMNvMJr1J8sf9kcHaiqyou+pq1iDsNxh5m89tcupNVrNJMHv8UY8z588vL4f0mKZ4ZvXsa1yDfRhQ7WPSsOhTmDsZlRrsmBrsjL1NHgg3oK4GDjdwXQSUwQ0ZSkBVeHQCoDXNJOBOR+BmB8CGgJQA9ga48cKVgQvDPgO/WkN/JcCNDFcaLm6qXEkiGXHxIjuOlnLVwTBrRzau2Ugpcb0d6QHujSY6+W/tyL2+9dIHSyNhPW8V5NyyUm4oatJb9O7MRFonhkJ+nYMXw2Evj7Yt4iGZPRQ9sRdNyplaaF2qqTg86WZ0VayedP/aK4re7T5R8rZqJ/st3c/B2dfYP6BXmCBTZn5ylKkAmUUoBUcAGxGg4AisH28+7tVjAOcIwzhdw/AgUJ84Q/e/Bz498CkC+LIaVWeBqrNA1VkC2RQ8kiodY0pqBxp+/RhZ/i5+4MANDoo9HeDMSnDmh57jGs7igLM44CxOesb7pKDhrAA4KwDOCnTXwRxLeOsDqZOdIdsQbAAlnqrXGoAqVB30CI16jeIJ7wyCKgX9s9l2UbicTYiDyq6V9U8f3LSDZcOOC87bdPaxZUE5GuUVxJrl5Ttz+9EBOec2ONy2TdEid96FY5NGt/lTW7dP3uYsOu1++Z91Vs5kTw1iWCPMd5lfEL5rVrkuC3tXBL70bspk4Zny7EXoFvavjMSkpjHzgO2hyxOAOgCgDgAo5ijwuokwBNj6eJ+TtcGW9sjC7XJctvjHzl+7eXRj0RWNXXlfettZWxKnPXjPexubh/buv3FV8771I3g+s9+CsXxkrOI0jMNB12SsXu7FAxw9x7vGFDH7AGaSXgpjp9LNr/WOyf61a9DmVe1BEXMm2oB+xWIpcQp0aCMME0sBYOrA3RD8ZWESx2C9AuMglIaZuRHIBxGGf4yxqL85BnyB3lGJJQtpIY3ZeropN2W04xbzLfWxoZ2VbTeZb62PNc+rsNHxvdFr9if3jF8T3X99iuJkhMmgZ9A/A0bGpzGRYzaRp4PxqlQRZhgsFyn/5dUZUqgYVGFjAipLKnWlXq1X3VW3gkb33HUX/Mvcc9m9916Gx2FmdzPfZB6BdQUZzLTUHrtYGpB8ueLGC7CjDfXQoeieyy9/5PEPwG/izHFUR2fA5KzMNBkfz4BSTrPlbqEz9pO14C2Nx+BgR6l9s7hvlmoHDNEOQOAp9UOhQ488QmjgpdkPoj8Q3utVabKHzZYrAqoiCd18sPWufZzvzecp30gC33Czh8l++8JRZgBeDMA1oMKNIHQGI5XQUwDoKQD0FCD0FHDgLc6BaHPBIy78KrzmhXsvpgX4bULjIgkg+gQQfYK8GJ+hghDL9eJxbY0MnitDWYYVphYm6GGgmzSsmPCFNMwzTf5iXi4DpwbZKGJe7XFLAmfjRCw0MR8QOD1hA7CjflNfMyBxDUNs9Kzxs3dydUNkeNtOhKLJclKocKGsLyaZdSZPqhYWJVQfWJ73bJ20O1o/KqwYkNGzvJX3e1Op1h9cVtlucAXdlN7y8ONG0J/0gFVKBz1q0DEiEjlC1iIQdJVTfnJg8Mc37j2EfjN2xZ4TB2g/PPx4AeCfZ0amMVhhW+BVY0AOtCGTw73mKGS8ABk7eSbnwPKR0MJSDrQF+DeOsLAiOxoRmGABhtWDqhDzR7PxZFCpBGwWnuOjA65cPuu0Dlxeecc7OJ3eKA9kPUok5Pi2u3X1dcFEJOaPl0OuuN8V8HC8XrfXZl+x1OnwRIvFIXgwHLBdT+c/+xr6Ccx/nLl1GrNrkAsq7+mWOyCMVFUuCMKjDm0FwhMK0DrRlwCyZL9giY8X7G6TglEjBSOQghEIwQjd4y7djJfAGhNFuhlGGPVYNgA55FET5IH6H0wbGnT0BDxhROH0FbFcHnCGA+ty0aTbwBkQ8kVvd78/4efhNp4NrY+Y0zsLF5yJWKPOKMUC0QhnNHirW0w6o9Ww22AXbB57njfqJNe1oXCZN7Ky1aS/1GSdaBotxoYnHfUZ7HnF6Sqlx7JARezsLPyQgYZMQO6DDN1s8wBhaTMqi6oxU0ZarsSUZqyJqhwwgmRVRPd/wNv6iQdV/2XladJprVfuK37genRj65q9exFmhkbA019grByzd5pRQCQ7NTw5AU9OgLeT4EmBzgt9MRLAWgbBSBjupJNj5CgjQUe+GWwp9OIES+o0tChiDDR5LIIw9J9y5itVbyS1VQkokonTcdGkoVgb4JejS9w/99VObQQ4iyHSPMOkM1iNV5hsgkN2el16v41lWYT2HzjEmvwDCYtrRXFF3t3hbSzQZpYZZX5+lBkrUf421sXbMOM3UN42AHAYgGcHyPQHYGUxoisFYI/GCLUOqGZIuNSttdP23AzeppTr1TWuVweuVweuVyddVuGRqvrqkr4gtqmkTkFcJgI0AJ9hMjwG9pAG7CEA9hAAe6iLEzao2urRjAQ76qbzpkr+oMmqCtJP6yuzTo4tmBNjZ08qW7OB+KQ/VQzZdNbomHf1ao4VBF9tWxqhgLOct3I+JR/Rm9yJwbA1aPvbsq01j8V2ucFo8ijeVQahPm722/KF1YOB3/KCzmMT19rsHlcgBrTnAkbxMuGV4X6r1hH7EAvCKoo1YwJyoXrrVTf6pLv1Q9Z0w/4TfwS2AvotehNwWWRWMNuY7xxltpeolrsdoMnNqKJ4hopjDiC1WUPCZkDCZkDCZsIoLNDXZgAnQXkFUF4BlFcIfirwVoCIsxD0EwJGpcBvAm01uQStJeh9M9xvgvtNqsA7uy8uvbCmWnuTbNXwthXwthXwtlXFm6rCcmD3dRCo8m1gTEGE78S5yq0MjwsEm2kb16Xw/vTs81jWyNm8qWDIi5BJCFY3jW45mzNxZiniTYVYoyHUPHMr64umQ5inyTFv0M6zQYSC+UjcpWf1IBUzlQRvGl1p8JirrkgoYPPkfGC3DOVG067lS+yOISni91rkfEBvFaoDExkRvWbiXU45UOYNOrtoM1ptTsvfeCPv8LrMTqdojfEmncfuJzwDcPgK4DAHtuGPjzJLAX5NuveagIgmIKJJbBSeIIGqHfCYQ1MYjgH/iTM8IORJoAMVvUVAbxHQW6RiBnsJ4KU4vJSE+yTcF+E+D/d5PB7c1+C+VqKK33gbd1aMOyvFHWYeI2QfVuAuQrBoBSx6NCx6AIsewKKH0FQQHqlQ/RVsRoo8ZQ7L6zJWOEHFV5c8QkuqK3MuvmCJjOxY68oXcvZwdDKcKAQsvB224uRalhUM3tpZKYQ8nnLehlg/3ovsYay0eIJ/W7616uYNFsNlJqvgino3GYTmMrPXmi+vKXt/y5t4ySJu5O28G29HwsUZ5q/oaeI3yszXMLFyzAJk8apZR7e+iRXVYdA5NxG9Ez39COWzWCf+M+nPBCqAal7M1YY66u40PMbCwJriy1FN+WLo8hSqLkO/rSuIygwvhWf/gmbRyzCdUs9MO7amHjfoqdKlw84zgotmPSlbEWyio9nWA+i87Mya507/7Gc3w5sTzG50HN1O1i8z1BbQk6lpdgtMLeYmfyfQR1u7yHX71MVTVGcrz/6Fdc6dk+q96D8n3DtVBJsDqMm7+TI6r/VAFh1trVn32c+e/tyan1I47iK6IAgIJsmcOQ1T48BKVqW0AXaIAXaIgZC5oUuEyXCfbpNxAo+boCCXoE9qdyeI3Y3RKC7lVMfSHEVIsPHE0/iPS5ZHDRxCvCsejK+P2TIXFXft5Fje5ApX1ze2AZLQ+mwp5pd4C2uXLHqzfr/JsnrcGrCHB1JKrqYsU2liAGTvt8EemWBOZV6gvNJH97qP/M3ChVeyyaG5yqi8JXs6BhsrBns6Rh7BPsMRIorTIAtHCD8+rb1gG16wrQvyddxQ7/Is5XFDXgMJAlUVg2RclRt16D2ouSSCwLaDsCeCZOA8sWBUl0QC8JGAGSTIlk9Dh3UyE6znrIV+1oKek1T3OXHeEUFMLBCyy22syqVl/BAW10vZKmEXNkAFKESai2kcFRF6IlqNJuNIp+dNS4ZTy/wRvSFaCFovOnfF7lMyl15V3ztgzr1zzWnXbEjULzi8ffnFq5PewXVVOT/qElmrziLZY2bJGHvBaU0rvE1OBIcH3bYvsr78cHT9maUt+1aed6lP3CD7c+suHJv68KXDifGtg4NnTiSd35XsG1xOq/EqHfHpsbM/hx8r2fsBACZmmQZzHYaorgvEHeYxj/ynsYIIXeFNlVSwM1pU0lUOffQ3Y59Ay54+52PTnwjefDP2kJ9AcYaY7hKM2YQxZRDAJeYA3qA6MIXVneAHyvED/fgJIszwyRNEYHZeaZPFPP9it2yOwm+yRLsyw2eUvI6IO5F9lcrrPNksVTGmCmNErASiRylEGueRgJFJxLB6L+1DwtnrOYs+XUsNIGTRB6sbhy9n5cCFwfPiUZ0dofp1oYuUQT17/2jN4ZpM1FymRoo36yeUkZyM/mTSOV0fD3p+AZZD/pMe1a+Bddgs7COFuWYaw6DjR/LDJvHDJvFTPxJZpAUv0tJ31dh+eJIRqQQzwI0XrgxcmNIZdfGE0kMA+BBQeKhbtQQrG7VVy24vG5DzX5ubaj6WrbpuPFDdUYnlzk3UB41ZFmVyiR0DfOYSky8/phgkC4petMNuO2i05movGFy8EjSaDprtlF9gnG8AnNth2B3TWD6A2qhi3AUYdwGiXGSuAuA5shg8U5y62ziVVZzSXYe9BRoqOeInkK5pNU4pubmaXq5tW3OYS5Sn1lwYTnjMHHt/oDgaEV2tn8WWlkPoX+2WQKi12+yOSARHeO4FmLsZdNO5s+hMy4QbTL3iFU+LJRM0OfDpD+HQMSFGzjjg8zb0kNx62fOG/EYAOTytKfb+m9594703qWOWYUwj0/bBqnuuM6a6TeeIX3iseySFw1ZY7EVmVp4duHsf+ozcegndcmPrTRipTX8jQH85TH+gCZFzHEJ/EaC/CNBf5O3Qn6zRnwz0JwP9yW36i2v0F4fGONBfnNAfTxQn6uQJs0B/HDVtVCNmHAxgG0Lc1btZdtCQWHbOCt9IsyrFpMFaRQpl/DZdllPKcsMd+8BgcZ/prLUmjwlFi2sGA3qjWX9Qb9TrLF7F87zTEYnr+a+0npfkNk7fS3B62oJcTz2yOwkb7Ma60GaDCEMd7Ha4FPSPPy7dve/uEvmJbK0/sve3/ozMJy6EOfhgIjFy/phckK46Q2J1ilM+BN1gZop9gk/MFlEC3rd23p9HI6raayQOQtANoA+wPE4JJmQze809B3RybmnhYpdf9tjYj57YKOcL5WB7vx6CvvE55uoFN+NJSHLesWe5EgBcigoHq3j5d19+470PvoRBcgZa1TrW+py6Jjwu+i4ZN78gTDqD0N1FIIN3093nILOndR709cJN5ByJ4ezQlwU0r4UmrB5jnmQFZtxg1lx+oH8SnzbXvjOod4B3TjEjwDxep8Ke+8i9Q2fe+cCRzX+6e+NhdHnr98jTAtS1TkeP4aWqNPg42eNn9+iZJ4Fwxws9D8LHSK8cmRWv3gFsOG1Kfzr18L4v3bXljn1PoKdbIIBbIfQbMhXVl/IO4APYR/Is2FQlbCFT26qPnzgEz4WAY9PjuBDsbhc5ApXgEQm/2j4/pR6TNPx2goN1pBk0NcET2yqF3b5THS+LC5vgveZaf06DbbWoxmmiwGmiwGmibU6T0zhNDjhNDobJqZym407WJETbn9wl8RA/uqXh58qG9OQFq0fPGg7i25UX70eo0BheYhhQP03hyrK4w47E4vpaKFKdiNvtrZfLp9SC6FkwySJKMdPSW/hwLJ/X9tPZgGtHR/6JmvwTAZoiQFPsI//mEUQH/9iCoCyHekTc1I7DZlzbKaQ0G6r+AgLw+4m797Uuu1jHWg2RobOWX8lN3JC4DnvHue9/n71/4xpz0HJKaVXR23KZB39odAVFzJlmBwldCKCs15mXjjKNErW6G47OcTk+z7dTykjCWpKwliRZS9KBTw0xZVDfMG7pHA9gNJYwZQjE1PLAlYILv1iARwolfKAINn0bGGqYwjyiMPbZDPRYkkYluFVPOqGXDNBLhvylltaTzKBGL4MA0UGgl0FKL/ioPozk9GLp5sOrb97g3XDL2scWRT8/dLj0V3Au1+a3TUegJgCtRJlrpwnzkTU6kgH2MsBeJpqzCz4NRPXF1mT8+OKVexducFEghtokpiO4xCSG1XyqOVMHu6yIqh+e6MmovAsIjZm97BKWtfGuUCFy8NMRFsVTB5SDFUWYmQFaW2eSzJsi1WzE/F/oBwaHzu95OpnC3MsGfMgL9LaS+b0WpzE3HKOGCQZzkBoQSw2AQfhKDfgKPX409ovrwAdRthl6jlmDe/cMJibaHoP7mHqvkR1+pjJDHZD44HppJ8CDQCiGIRTry50WdJjHyAG4SoQFIMICkGChrYNrziS8YTtRId06UW9MyM/cjaGGGC1vKYdSskWnM3oy4dxIwmEwhxtnToqVWs3j91TKBWcgDlucZY2eVKi4JGGHJyMjO0yCxWG80ibqnUGP6DA7LBaDya8MhEL55qq0TScY9dfzRj3HW32S2SVY7BazYPHHsj6HIlXXlXGYEzMGtHgqsR2bCxJXN9vWtbVh7MgVyBGHqDRBS0WpI+/4sozelL/Mem+6CfddBDo4AH37mIvxGUmXXWQB3FsA95YuvXSepibiBnEBBNk1BNkBQXZAkH2OfKhymgOdKEvIMba16eM2372JS9XHqobT7t5siIzvMgVLS2JOJ/ppa9RpC0cHcuj7rXRuXTNK7bo1AJuPwPz1Hat6nvZ0EmBhBQO6IQIcNEkQ3+iO1feWf//J1o9Au/lvNkDlNmI2gI7zF6LjXLMgDgTcIMw3VvpjqYcnYPcWMACiVOjbd0b1DlAIKg+ZIJ4jm4w889X64cQP/yH2g7tB4/lDSwQ1I4D+G19Y5539HcDlY0TvPnvx852n83T0bqrzaNND6qSSQFJcVW5Wkaig+kOPItN779v64c+0Wkc+9uyzaAot+fGPW19sPQHPj8J89sJ8DB08vbUO1o0nHrs0KCSUJsUUyh6JXX/Pui882nruG+hnrR+gWovwtgSMVZ9r080bqyPAqFBHZL9gKUWDBpv0CAW03QTa2fqNB30VtT6Owp7Wxv3o4YPXtbZfT+lCmL0J3cJ5TuYBxc5ZuB49Lm06sEk6znn2nFi3B7971ewH0Y52rAFbmqeH45dF5aqDlx5kHyaBBmh2Bsbb2B4PjyKQ8TQhDNYHvIJPyYNktE8dt7Nf2fMmibmYQFegGfYxmKFPPWtHJO6io8/isMA0jCmg+JENXz9n7w52xX8MI7712wQee3b2ZvS12SdIvA4lVw6PV4+5Efr6uwYHcS9Xsn6UZ78HY5jbkZSwDBKNJ7+WHQ8tqa5j/f7B4Jr6sBpvhf6MXgYeojB7e6LczAvvm27TRNbYjEz+plW5jO0SmchlHOEW1iRCGIAdBokQJrwolqZeRO3Ej0u3fYdEFKABnX99PVPxsoIshIan1qR2Vk/7C2cWA0PepC1sDsREI5eTovLAsuzN+XWNiM3RKh6RHEHpPzjW6gm78Bo9eI3sN2GNCWZH9/m0ahT1X6dxITMfb0CjujSm7W3DMZ1yPJUWsS9Ni7kTaRiDHdEIjh+lzq9ee7gQWZ3JDPp1gmzwDZ27SmcRLaFw0JzxhQMKCDCT2cI+KL3h8nrxmgrrGmF0juQSzFbhtxxdEcYzxttH0CsgH27C/jSu48/o9qdRxVKewTGxPb4N89/jWwtqqA4CJIKA6mDP8V+va00Nc+OePGMtxwdMiaGNteiYO+7KucsZwY+Q35pMJaxWeyZfMI1OiHH3+2sr0naLYa/eEM8d4U06r2A06a40WE3Uj8t4QV5GAZdu0Lzfx1ArrD/NqtrdIonYp63MR9TLNHHrUyL2tYm4ry02n4jH0QJkTJAueBtTG8wpU/zwDScA96mmlLIE7QHFbeZynjAl5FMaEY79pnRi6V2SK+r6KeiXcsRF450B708SvFeYo0eZQVh+lmqCWXIakSUBjlho4LPHwfbpPrYncIumBSYc3UGQCcZEFmmC1mpb+1OPvToQVNVBAjCvdqDgJZsjDReNzcNOZ/UYIg+NeQBTnsCyhF+lprpmYmBlj6PnBTQckhw7kNAKQkJLUVMIVU8diY/lfWJ22YDHL4oOPStIYnGw6gsMvGdi/aT+l0PZVJjXu7xoODdZ9tvDxUiino1aBUHP6+I2yWgXzRcE08vGA9GDjlwwHY7zvBprVkHTQEsKc3qPgtVZ8ryAUAU3KNgUm8YKFmw2bDRogosagKEZ1QmFg7rnbgosjMCUkFyyVeCWr5JWWQRvZkkhvDwUclacXlFnPRi+epK3+dPB68VwMOhCV1+1LDOacpnMe/RGm7jyqtYN/sJAGXbibAvm/wbQQpJpMOcteI6khrgbaTQSSxjFMXI+kSU493ViWef6LKEvYrjiVVVm1FOhTkyxzHWfDjeaaYrFcUQjt1BCY3OSwdc8Z6NYqlTlc4XAwGTFMzQ64vENTxWibv4Cjf0l/SHC/mqU8e0pnlILcQazcOK/srWwRW+2Gs632by+n1BW+CPKCqkf7Q3AoZ+5ahrHnGh80Eiitzm8G8hScHg+M0MlohvHcB1Xwz3784qOM2wuFIkqBFyGsVFpje1BslxOEZtc+xSSU9BFCImmiJKwNQ9dd3hgYCpTybDc2CG0jjdwNqPVKbS+zT4mtVqyv1ayBu2tz7bPD1CE/Q4508Vn0KjU5yAWW4JIdX/pVe1ZbNrZJqd86M7AYcudZx1ivyTdK01ILQfQyTGgkzj0aWWcpE97aZ7T9BgMZ2XspE+neqfScBPTK/SOVvnjkok7484dOntsrHIXDPROye/xutBx6cRfvZlsKcrdBIN2zkE8gBcOMFHto13xvVpwW8mkp95VGFeUweROS/vvvOE3d312+z1nArxOLEV/9Dz/5z9rfkUUImN4uyE1x5UMILn9zhsOkVfVdzgJ9swA8xfq/eNKfahFoxTsFsQJHI6SxlEdXe4gU5ePhyOuF2w9ayEamTl+vgCeVKCLwiK4IdLVkMQNyZPRoBc3eLsaCrihQBuwC4rX5BOPH8NJB2Q1rhkc25FUme8cmp1DvwI9GuuiYvY9KhXbm7ePdAh68w1oeCqXyBiGzs+pZH0KLxCyNrS+074HEkf/6W4EguFA1NemcnXPAg78zHve/p7tz+Te/gZ29dnAwgIbmK63Z6Xt1cHKvKK2f7F8fhHW5gOh9yx1smD/cmHx/mXuJP7lFI4swLs/pfmXU+Qv9i8rM1g4Uf/yQK9/2bygfzmi0UwEaCYCNBNpa3sZTSfKEN03TVyJ2kmqJgZomJBKSG2tr9F8trSq7OUkQ3xk27LKmqIMt5HR7ZMITWaKejBYJrMDepO/MBZzOq8sra36/QMjMafrysKaWgiN8Ca+mU5cRz/I+f3/zKbRawBXrPd9vOfExNyr0XUaJNwgdTlOVTWxnxOQOm58Gjx8AA8fLHlBRRCz6CjFgww3adwK4BHljv6PAyLsSJTV1BvV8/WrjjJokBdUBtHzmjoINgCog9+Q2G/0qINEH06jvwBcsG2za0G4qJqcsU9W24L220JGDsJmmtDsKANcj+Af7bFyBH+3laOKefSK2XJip/RX1czBplvrwTlmDuUTO8E2tXZ8FvMstnn03S0nTXgRdJ+DDFN3eBPtlOORqLsK25pTxqLoSqvoEq2tX8FuXu6O2Kh9ZYF9fAjgWmfOXJCFz3WGon7O0MBCiUK9ztBUusg2mnPCXgU9cYKChvyQM51JOwLBZRkXSYoLZFN5F8IpbxNVZVNYDqzyO0Qzz7KsSXLlBn0cb/DkV5l4g0W42GTnTVajw+eREsl8IA26lNW022BiBYvJaDZbjXIslgllR5NOuu40rPu97BWwzndPk8M/u2ZXcjhKEHMgsjC7o5MtYW97mhmaMrHIXEvVEiVbr5NQibO4pBmcbKCnnEQzCxpEnx7HiZNv5lmbKy0Gw6fnG02EymukNdKd3quD6Jo/mTiTxXCeUy4XeDOP7Ffuk267EvukwG60Ai35mMtwHqeOBH6TdWEVnsU8tMvPqkqPk8xdTS3l+yzmGEgmJ2OmgXJ61QbGiki6s5DmURaES0Kx1e88cz8WLuUsx44c/riJtxttDgGVQHMbCATrRbvfjk6RKG4q8OP/wBqczPk4s4QjriciR7DZKoAcEdp5ZuLxBcMMVaeieUF3rEl1x8I0MVvHREpk4tUrDiUvFHj+Nk4nGD+OnpNa9/zJFbZJHskcdrmL7tZDdJ5NYEzHYJ5x5hkqkrCypLQTJ7AjkHtVi3Im87fC/K0wf2t7/jiV1qyenUkkaM4POoxE+FHi+IKMbh5/mJcCPE+JUrc1Wb0efuMkSrCpfedX73CaGYFDMw2AIcH/GmCUtKDgw4zm101mlj3gvGm0ruf49/O8xXHBQ7n9D+CN+D704vDeZd5B/0sbpNaTz4Qls8/pdydF33C29dzPf77hPVfuqtKcnNn/AfiZAX5mZs+CpriqNZsX7zvmyWp07Tt9+86g3pFD1SZOV6tysvLCrnueuuR945fc+62LDh048OfnpU/d13rj17gn52yG0GGAuYVGdy6Qg4EjOkPHF/Q7qbL5JFJqnq3QEVvHcIwzoYdyJQbMPQ2MXZlHsajqzg9vGEpUJ30Dc4g3N1HNuPaIlWR/KkaAdQZ9Bj3fx4dtPokPG7V92Aj7sMmhD4dzll44KqJ16HffEFtPXIbMV1zWeu1Kjd/uRQ9yHhJ/hBNaEOg32J8sEvmHXQtJogVjeYGzoto5QNwoElSFSwgj7EPBDZ/5YCAD4tMr+mUHlxXk1FB2i5STPXzCUKkUI4YE73LnpC0fOvJbp3ix6PxteijhfKfk+2GpoeOGB37ok94J414yW2Se5jy9OXgqIzFSv7hTueTccznPm15Ks0/BOkbb63CTbAm8jiQ5D+hehzioTZbMnutkNTWLSFvidO86hjP91sF5TrIQAl+ZmUbfQRcSzWYa6JIc8uRpOhJPgznjXTHEYVaVOGjIm0tG7cGIZTI4UXel0wlnKGSe9CyflmQpLRdGV9DPxhoaX/r67CgzC/SyUD0Ec6cegog1kXEEsuwr7XoIzOxjOHAGF0RAjAIy+BMkVm09Ppju8u2GQFaFAMaavaBZBwtGk2RxQ5bawp3UjO4c/LmOWiAk5Y6RQZ3OawykG4pzuyNQds1z18oTUcf2zYbRhhh3Hygsy/v5d2xnTUKP09Ys6qba8T969jDM+xacT4KPL9T1eGE9Xmj3Eo0T+BtJfsOcAHMl+j98doD5v6L+n5lrL/ckHBlUvNJogMAMjafFiTDYQFa0NMM6QJ+Ao+ObwwkpVUHBPsmYEMv68lHXLvsavemiPalzclLs9HghZdB/wXGvQYp5kc3d2niNPZUvyrucTXnqDKv5csEYzXkK9l3ugULGsQ/r5iuZtWyS3QL0P8w8eZQZKeG8KcInq8Anq4CXKvHVskQcapYu22UqjnSd4WvZ7e6u3FS3KlRp4IcadZ4BoGYAqDTwQ8seqXYd9eMhRjFjxhLWqZqoSmkae24BlhiOOLS4QaP81PgHBJp8Wq/EcVYzdfc3sKwACMpNmddLapoqzYsj2SAvcQjJnMFY3zqSaCi+xtYqDw16Z3nrULySDA9tbX0XhWSL22nhRBRxy0kefcdiN5n0tzq9zmVrV5n0y9cudTn1FuHWlG907UqjYXLtn3QGVjKwRqftMl7vNtmCZI8z7DvZW2HZF6g7jy/NM/folre2icTYJhJmBpt3duJ4wgLSqIaTYDXEOUPzFTHwjQQZJAiPxJnh2Fa1hkezmlZWrll1z8qHH330TOfB2qedj0pHpPscd7n3oAPI0vo/KNp6ddvmbfv2bdtM7bYOjxXmclnVfmlzWTfltJjXtnZ+trUT3j19diWaBv7gB+vk0zRSSVEjlWiEEmY4KjEYACoGIAacb0FITwHSU4D0FDVNEoeRYfLrRB/JeAZyFxMZxA2DjIAbZAeWgapBw5HdnFFNgkFyzKeaQWHoIQxmED3mI+cgNGEI7zasAlNTh5jENKNPE9rUakZHohvjRUHP282X25x6gZdSo/nijnDrmf7tbMFgz8dPL209doZz6zd31N6RCRbCDpf5RKN/O8bBVWwWfY2c/wrM6FtFYdKGOZEd+hKN7sDO0XHgnO/fI13xn3Cxn+CvIX+h5wmwO16EMUSAxQTz1WlgBRwpmDJNXF08ubPDnaLxRB9gzAcY8/XHGDa2VrRxdZIIh2lmDMg6QwYowV2dELyJ6NMq/iTAnwSPSG2XzwL443sSPTiSBoKFJc4KKcL/U0uQykzx3g8hzAyIHL13w8Ftlcq2gxu0z6EdE4oysWNI/SydtmzZad6Gy55IBbzeQCphdzVMjal3rV79rqmG9sluTq/Y0ajvmEynJ3fUGztWpFtnTSydWjphNmy0uORzZJdlo4HgdAu6Gt3KHgUYJpkxejIqLOZklByU4woXNF0bSDbdnexGDzzSqnOLuDqAwemROBjLxljWKngzI1lLNBoxVx9EyOYq2oA3xaM8OhCyuZNxi9OyMt2IOzi9oGs9u5PXc0af9d2sN6TWMKqh36MvE/knqp5sQeVi5hIuoCQD76U/ffdtuWjk/FvIz1e/sfq6OyrfID+xnB1kLkbfRldAP8o00Rq0mEnoDlMMXiCnakCwwFg95lTQ6cCcjlyNdJe1XsdRv+egDehbAD9MrzWgoFsxxepUkToMPWWBWxbg/8M08R14TZnwj6VtmlQL3ph7+UenYRg3DDNWTKThtkpmUlXeaWYAgEJzTmskJRkm+xYEKChupV4dBLrDRwa1PHJXB+vImZ0o+XyliWx2Of5cno0Ww3Z7uBiNlCJ2O/yQEyvqcjZrcQeDbrQhOLg8lVpeCQYr+HMwiBqSUvL7S4rbTT+lDzcfLjlC5iVXugrqOfwlbA5dBbJHq4XRHXVy3d8cf2Nv3UFwvB29F10OOhDOC7mEpl7j+hThdtbvAnUpzAS4HDmWV1m6CGQsAhnTY3kzDaOdhkYNkFi8OegsaBYXcWrb2HRcqyUB7PYHjTExPZYdGnNnx7hExhtwBUWTF713rIgPW5cOREcL/u8XM56wzRtxyGGaSsqgZ9gGzMnObH3r6iRdjno1XaR/qRJ6zmghJlN30RI+5o5phUtas+ju1uWfvOfSe++99N9wTsF56F50H1cB4dXO/EzjsdKYzGjWspOMlSZFgJCWMgi6b6PWt3yCDTuWYnvssjcgBqMOHcshhyg1g3ZlXBlegRDP8mbREUx69ttaf0S/tkpur9MXFK0ml07P2owGYYvZPFDUW/Rhi9vjcwQT7i1knh9Cd8A8lzDbmHmm+zSOEyf1QWhGH52xoLrCCItmSBWVDAb2FCUX6uc/BrqjU7V/AcvqIay6OM2kUlfaqaNB07DblSJ+7p8MuUKVqFvk9Mhmv8h6ruRidcjlN3i8HiMvL/GtbrI6AI3H6XNxOt4ZraEPWUxrBcHsVHiWNRvWiTYvz3MWE0IcPhnJpPQWg9fpddn0xqBkdcihjNdEYq1YP5pkv4d9M2rskxHHJYHRJ8OErsqclh/wZDI5L3uBpxo63e71uC3ErvzD7Cjx23mYSbW6W39nggc3eOY7htXzHpGxUAdH29ZRHXJg74jNo+SoR/PGlU9NxG6/5vDHeYGzG60OA3XGyX7d19gHsSnDbJqtsDjfwgS7tdHjobH31prrNKh7gWp2eFfi+l1Yr06r+SpoU3b1zqFT8yvLfhST147XSkMRC7d39z7eju5YdsGk0poIlJe31kojg6ckC2Gvk731xO5AgvChCabFvIge7luT5x043fVhWl/nFbBTvwLE5mdiDNb9cYg+UgUFjsi3HwfgYqW3RMOZKF3Va0oO4eIvQoPumCFbzu6wRGwhn9vokxypUZ9oC/vH/tWorwGZ2Fys49yVXFIqlfDcroO9ej6XBdblVnHPl/qUlfn9GaH7N63exT4RX7+udTnM/xyQ5beBLMKHT4ewLUt5ZnZepYQFeKd9wZo+HLEFVX6qAN0owE+pfqUFyGA9K4f5anKOzyDU4audKge0LgXebbTCGvVbPze2BCEr70kOZ8dHELLw7uRIAeX9IZ0NFfxBHbp6SZ638GvCpahzaQ7fBUsx19OcwCZ88kZegJ/UVvCAfvD8SfSDJMAvDToo/omeX0hB0DE7Zp/hHOxXSZ0WJ/CVdWosgLPU50BDIGoudsNaZrDSi11bli6+bZzBofdONVIgho0gEdcuVNLVphEXp6NIZf/pXOuXhK8cLgxbRj+zJdJyoMcnWht8FNUbVzGzr2/Y8Fjr8+xT6RNL2JUU81iw4LnmYa45pgia69m0ppBN8zPaANc2wLVNDVPp+IsDWiIFPtsvlOa5QbCEQK/iYKQiqd0D0FuMWOC7VoQWJyJaj3cvdf1i5IWpBwyAs1UAh2obZ6cy38ZqPQcaEt6wnYIthJDHgFLGgJDHiDdlJTw0Rv0lc5A8L86g22QYxmUBVOuEuvCoXdCPGmjEwXy6oPIdiykcelaG+zrOTy/hKWlBCH3o5e8VYuwv+1HYmrcv2nqoEUX/HkmHfYFvzlbQu9HzpP7B5dPETpY1G6TbHu+uf9BT96DfCTYWZ+pJrRU6tAIl0/OSTlWEpI1TsyfmHpwt5Ym/EQ2PLo8ZFyiLcEoTl0X4eKYUC0i8metTFaGaWApChKO59NwukliAa+Ko+UNcV1b8zakReYm/kgh1Zcez/yIX3Wv8ueCJg3Py5Nv94fMDfOYLGxJXRhS7+jtDisUS7oHEyly4q0fOahYl2X66P+k88Y1+fe4EPdgLrIPMUZW02PHZPdVfhuKSmPWl3Uo8JopNpTDZPed/tck2u8+83OJ2e2zuin/sxNe7BtLG2QjbJYbj3lE/ZzLXPdx33SHZY3OFzFVpacwVCfgtTrdhzCgFkiu7x/2BzWGL2Iqpks1pA3xKit9+4qvtkXXquJPEvCVYENXqsV1j/U7cK54L113dHf/kcvhz4nOdRWh9XQbSxQ3yLYpXkaKuUWCCxGggKkD3Kj4QzTcqidxgXPQEJE9sDpbT4XItFcwt2S97/F63/8SazlikDgN3OcmPdzFXLz5Vq9uOwHUYTHOqutDIDb2aIU8VGFqDF5/9sa9iSaUlr5LaDTEhJscERQbO3qnhwG6SW59woYT8N/cvPa0vqvUcSKI6njzOIR8lNQxGmT/hUEp6hnwMeKaJ4fITPPMzuPk9XOzURABmidVDEzxnIk+shWsbXJfAdR1ct8F1H1yPwoVdOE9jFj91jGyBYVrYaW7R0mNgEtNf9QQk2Bc+lK7ihqqWt63peYFOlnpv9dJqJ3lrbvXSftogdeSdpKCCHalE9Mu56qJ/x5YFyywoOyq2Xl1y0nDWxEJ1FyxshiqaNOawQPiS2OFKfFcZArRLZUut/9tbkEDjTZfSwgTtGMYC4UvuNleyo+7+Am22NN3TYRdrytIutf4wTwrO40hzpvlEL0tq/e/e+c7jS3lt4pw6zqRaT7vNGbqH+KbKGlo393ZM+MMStTOW5u4TmJqhJxWmAqhBv1BBeQtO1G9D78SF6jtTBG5WeEeDG7zzYBtcY/BWN4ja711E4CP1woe8jkZ74fJ5PPh8UJCkMY70d58KB3MbDqSr5er6X8cd0CXjl1gsK9idJO80iStF4LxTj6Z1eohvNkuqZVHZne6NsrD3LRyMzTFXm2P5CJ9C6vGUSz2ecqixeCTnqKu0R0xUklqhFnzggG3X0ni5u8RH6+XKUvR5XOfDPyVN+WmtD3Qbcs6p9uH5Ai73ccdVR9R6H5QeHyeyS1lIcqF2Uj36xYKCq3WinXDfT261TsxJwudoDj6hKZxr3dEfFpt/fFAlvcXlH7eJ881X3kYGcvc8sQu+2dFLFj3PlW1yv2RRM+1WZ6p/11zx3skxS+frO4ud8o96d9gzi4PxfDWp8nYWoM1/IzkXXb2gHrXYZTy2IK0+tbj19FO/cotfkU5dD+U9hMo1LowWuYZfaxz6l4ubMdXrIoufI85rbqB/QI+oXgVe9Sog1avQJF4FuYlPHf540akXaf8euHjTxdo/Snvs7LfYG9hnSUZUiblKNTgjpbnBdPa+EVcxYHp2csqf0NSOuRXKsuoD2NO9YGI5UUXUAsp4xmoVZXyQKKQRR3OxeJGY92ucdhWaA2sDK0qTWQrQdeU1gRVl9N035REM1tbrr3grcLPCUw1o8BQdW5JbK6MaSEXn1iT679bXpXy+9T+o5ihmgKeSfG6Vt83jbL0Z1x9SGdmX+mZedzGuk+Vgd8Y0Ej7ew6V6xxxtM6Uz+o46hwktZlzKcxbiOL3D/6qXwfx7/7X3YSgnmQynzkXbb/N2W880/kvbXC/0H13dTAuOyNJ8agJzVxfM25nRljaULe0c6W7ILukkTFM5vAZ0DheQ+g5s3+hIMAvROdzAEd2wCdxE58AhCLHF1UzxqQUtpkmIq0zclqRmirBA1ZSvOu+6+m7XpXPqprwrcYDUTdkJKtHujWtMAVtP4RTiU35utsIm2W8ym5nrp5lTYUZRbfZRmEYUl6Yjs492Vac4FRcthftx9X5Le1VFvIjiyaIAO968aWYEFqeQxfE0npojBgquLIFoAUNOcx9xJEyQ67BeHGuAIxLotwegd5rDsZjVY/T6vAZ3QGfxuOI+Hn66PDY+pMgR0cxNkcS8s0ny3tmGYP2MZQNrq8FA1OUx65xB0WvXu7KTJpbX6y5mdRyyyjqDFbopeFzBUMzjifo9FrfH4AqIJ14kSXxnkBQ/ViitKslSohpOrcnIAadZb/SHpbAsmjLLi35Y+uwszdNmv+dKMZNg1uqZFTv7tQvMPuY9ZD8E1ZxnGxh2g127E9Hd+VZp15/zlSRvKZZOrS/7R2KFdy8iC5uVrIpLDDuXy4NKZCgwduKlk+Zlt+f+cHtNTy3prOm1rvbdw9QXSp9/jkQLDzBL5vgpOqebWFl+y/WtV4pLaumcNZjnpaDd6fE7Vi9mieF8rDpaCHuyEdf7w7JNDMt214ntJ88/5xgn8Kaj6BWw38eZ9Sh+lNmAQ7voqcUIrGUEiHmERIIZyYnFhq6s3RXaKcUKMDtWMCnc0K4PjOvFJ0iGA2UNGxcOjFbDiuYltvK9CWlkV2XUODD6TSeiJplF4CM4MKCTEF7U5HER5HER3iuqX1yjOX1pDt3YDC1bjj31y+B+GdYP4PVVWrjJKuh5FfS8iohzsZOFppbIa7sz01rV0cYoajY6HnsZ73OiQWlk0AS+/0ZxUpJPKZ621bPk8jN1bCF5STFQPjg8VYitKihVxTm1cbfARUvR1Yotc+6vco2wuRbJ6H8TiTs87gFRh17xhn2hDcvjY8WIXjbpY17pQn+kFpLd8aJ/89qMwyK7DMJFFvsvdVbR60jGlQ9JfqvHaraLMsnRHyU5+kuRDofWcaq/aOz/o7+IkEYeSCMPpEHTrLEDKU9IIg/QzszggIxjYL9I2mkAwXYIYzt0soSGBm5o9PqOQg5VU+MB6QlAeoKWJsrgCrNTOAjtSRy+QbE6AFgdAKwOnMyBdJKyAR0H0kM9DqQVozqd15QYOrXRr5yAH/DZ60NawY+O4nDVxuqCa159AavIZdXjSuA/JMee8NQ1lNfWmb7t+7ZT/Ze2Y15bZ5bN47X84pPd0c1z2W7ry28j+72X//7n4pPh1bU9R3guXdvuQNsHxvyV/R6pic3gM3O1lMjFd5516BFaTgQdl1qO7poi2HuzibxjVd9Rj/nxS5e2j/rpe3PO+7V3MSxdvZC0I+gKJeaC6J9wrnPPyodw2jP1g6F3qvF9ZnUmaqgenklSDdej82jH7LFMGGDxLLxXBH79Z8qscODBsv45nHOr2ontjGH6/VMpErvsY3gmpVb3xZFPKk8fho07DI8M03DuGRqImyJRVvS8G0dcNWZojGdqzpeMqBvY3lucoX8oIP4emkHCfXzQFGqn9Y1pW3UMtuoYbNWxeSmeYFCRZBeyX4k5AwZWu4qw2Ov2/V5lecbJC4ZAfmLAW5Y5nUs8I77a34wEG7uUEaWsJHRc1OCrnp52xtyynzch5A0nA3qTlKiEpGBmYDzrEowuSQolbKvyo2aHfo8QdFdy2ejpDXvM9eX8ZNGHkEGQQg3YvqI1pJC9SesAYPo9jeoStc6efZHs2dPpXt7Qv33fuzp7+UVCfxkS79SjNy0q9RV9bC6NfnsRqbDztKdfLzI3tr2Wh9trearA9G3fPUDXiH1Z/46eV/fF1DQpXcSoZ730JBeRk9wFtYm5VYDRyaoAV92KEHPHZPj8l5tuuh3d37rw9ptuQs/fsvysFbfQ+TCz/8YaWfotO1XmWrUwQ7i0UL5at/9AYcKkFgMdM6WpIymSVoCj4LFIHGg/hI8+yhrNl4Hmy6QYO/EhpLooXm4fL9OAd70kNImqUa016gIh9DFFRWlqibw0Me50ULQuX11aojyK0GecCmD3AfRphwLoreZHVVw6baujq93VgIrP8MrI0yzPft2eTiCW/ScrSXcG3JF8RUKfZ1G63davXdP3WbWd0u08ql0oCRF9aS6hvtE3KbGXNFu3LZSl2J7fw+157x6l8yY5Y2TeO+h+U/NmSF63Ws/nMEMzHfpnW6ml7ox9zgT7qDDcwqncZJsTarC9VSr3vEzupjg3lfuV4Ipybyb3A3eu603l/rYkz8nk5t4nte6em8vdhtHDbRjtNmgxpjF0lNSsPV0NVTaUFipUrYYL2LViTrwWSDi3JAQ9GcVRkQv4/Vcs6EFl4/N9o3Se+HvhPt/ve+FiQqyJrnG3PoC/GY48x65Y6DnW4j7xKn1uC7oFyexTXXFjuFYaZlZqHWJ8IjKOkEy/b4P9iPr9dNvRXhQkddYW+m47K60NQr6xY7v6bR0fpV/VQWLIb0Evk3FpxWk9SWGlM+XaAa8G9UtfTTPtmZDyPjChl2mXj3TPK6t2T2KB94Id+9i8/jn1C4Tm969OlQRxtGf8SPfEaffkO0zQR8n3+llJFXe9mn77VjWVaZF5jh6mz9CwXPNM+wsA1ZHnDHx5Z1yc8/s1eOhp2KBFnM/QVcfSDkqOHRixvZ2+4O7+7sZmT2T3dKCccLsT5YD6+TV3Akdk43v6SWWGFwD5e/LdgliGbWLe+gsc5omuOfEDM1S3w0DH30nWJF9GRi/87YSoov14hPwh9I7j9gU1Lo/6zfl2tL6vKwAPP4tj+HTznqWRe0jX/TBi7MBDS+xhsCY+ifP/dEzhrfL/aIER+v0jPeHQ7Ur9NK9LJt/LODfDVFTrrKQ7Jc4wO9Q4IR7Kq3aPU3oHZ+i3hdRILpT2DSG4diutb0XOKdV8sK6vCWkQGmoq9U2C7dq92e3ZgD2ZTtkHiwL/KduDlodsn+JRopxYoeiVbbnGppoPsbpTbRstm9D/ym0912a5VifwXCgXWL98fZg3sAG/wXCt2eLNjylGl0Vev5zurU3oh+jfSJ1QiXkfLsuoIwtn6DdKm/vsBvPC9S/nFU1XJYz9rWqk0zharZIBEnCCeBPX6ZTzLA5wdyvoU0peYXOGgXKpaMj/caD+kQa7aursa35w440/eCibZZj/B1DndGoAAAB42rVSXUvcQBQ9iaullC59KxSE+yKsUJOsBip5qisI4kNFRJ/zMeyGjTshM7uQN6H/QvC/+OR7/05f6kmcftlSSqFzSebMzZ1z5p4JgFe4h4fH8R7XDnvYxGeHfTzzthxewzvvxuEBNv0XDq/jpT9xeANv/I8ODzH2v3CXN3jO1XXP0GEPCe4c9jH0Xju8hoX31uEBEu+Tw+vkHDm8gdj/4PAQmX+LQ2jUaNGgxBQzWAhGyLHNeRcRxnwEGSsEp6zS/KZgGIJzZmuuBEfML7FAwYoWATMHqBjyA6/pV91exXnFd4HgUNdtU05nVkb5tuxG40iyVk4bnStj5LytlRzp5aJo2kAOqkr6WiONMqpZqSLACVVSspWYcxZckjfjPOHKMJv3WLOqIDrmOVJi5k+qdFXOU7lUmUxSU+Yy0VUhxzatyhxnpJmypY68OVPTZZU2T/r/2v3PvSdU+ecz9bud686DzgLnQCJ/PHPS2/e/DLnob60j0OxVEPOWI0Z8oRpT6oXEQRTFT9Qftb8r73xT/lWXsr3qTqfqRLvfxtLkBCHDOsPn3GUpn5Prinnl7skQR38ZCns8xf7M2joJQ0uT56UNcn0VKl61CaPfDLVX7D8A7FvDzAAAeNpt0MdvDQAAgPHfey21aqtNa1PjGbVqtVqrtffeo0ZLeahSxJ4hTTgR61JSEhSR4CBiFzESDj0bJUb1Wu8P8CXf+Us+QaoqI5bo43+8ihgQFCVaNdXFqKGmWmqrI1Zd9dTXQEONNNZEnKaaaa6FllpprY224iVop70OOuqksy666iZRdz301EtI70i7r36S9DfAQIMMlmyIoYYZboQUqUZKk26U0cYYa5wMmcabYKJJJptiqmmmm2GmWWabY6555ltgoUUWB4Iu2mufe075bL/jjjijyCWHfbJHod/+OOa0gx4q88tZl/1VodIFxZ567KolljphmeeWe+JZ5M0LL5X6YoW3XnvjmpV+OumDd95b5ZvvDlktyxrrrJXtnBwbrJdro7BNNtviq622yZNvh+3uOG+nArvsVu6Huz667oZbbrupxCMHXHHfg0CUozHh7KxQKCUUnR7OzfkHR3pgFHjaY2BkYGDgYtBh0GNgcnHzCWHgy0ksyWOQYGABijP8/w8kECwgAACeygdreNqlmV1oHNcVx69krSytJY12tZK8irQxWtUVBrWu6kaRP2IFjGPLsesPObZsuaiQ0JDGNhRTQtBTH/voBxuCHxoIfqghhFKXIgoy0spCsruUqoSFopclZFOxBBbCkHSJtr9z7p3ZkRNoShGHmb1zP/7n+5wr02CMiZv95iXTeOz4q1Om4+2f37ph+kwT46ZWM/I9+t7wyzd+dcO0yJtSk2nUZ4tpSL+rMy+befPI/N181tDRUG6MN+5pfK9xz46hHX/YUdhRbGppGm16p+lOUy52MDYTux37R+zfzR80f7zzzZ13dn7WcqZlruU3rXta/9T6Rfyl+Afxz3e9vevDtrm299ovd2Q6Hnl3vE86f51oSexNXE7cSfwu8Tj5YvK15JvJG8lHyU+7TNfBrte73u36MpVJnUidSf2lu697tvv33X/uudHzTs9ve/7Y8ylY3uvd37u5+530aOMeGUnPgr7NeGBvq/kmxV8v1AfFII9fnv66jpyeQK3Mq5hUbZUvWTPBmllIvi7X7psVSGaNmWZGd9aqpp1nR61oPFZ11jZMgmeXnMS3Hs7orZVNmt99Jm2e49nP+ABjGWiQc7M8h1izl2/7oBEzbEZ5HoBeYO4Y68ahg9Ah5h82GXMEzMdYd5x1r0AnoJOgOsX4aXY4y9pz0HnoAuNTPF9jziX2uwxdga4yfg18i2BegnJ8fwytQTtVVl7tNtzcVv6XOXkFWuN3jK9FJ5kCUrmNVG6DqqV2T2XXXnsD7udNNyf0QL3s3seJWZ5DcDHKnAPQGPNfZJfx2kfmYO0h3MXM4dpd3fkk3J1nzSXWTNdyIC6YGd5nGc/V3uLUWdC+xcmzSLGNLylmdfO1h51Fp7tF5rV15O0j37LZC5J94gvs+oKe/oCTi5xcNofQ9mEQH2HuBGPHmHMcNCegk8yd5HmasfMiS0jkeFURVUFUBE0eJHnsRTXPjG5WWO2XntG+oFlH2xXV9n6orm0/om3RdAokJbRcRMsltFwyk9BZEJ9T+ZTMBZ5T0EXoNeZd5imorrFXq2oxySyxxW5ItHBU9VYFsw9mH/9uA6d4QCv266u99jHSDxcT0CJjS2IBIF6B4tiFj13IzmXdebfsLCsiu67JHNPJaJLRLijF7MAidkNpPTVunoP6eb8OgkWeS9AynKxATxjDFpmRVBl65igkqAJv3QWPVYfED6UeIBrgmRGeeZ9l5YBGAg8ftp56n5V5i47xus6KukMaUp3pTkV2KmJraXZLg8FjR6IGY3OcHnjRMt63Aq1JnODbU761OD342Gagg8o2HbQrF3W5llRbPU62aceNXVFlRVXl28mqMt4mtm89bAiJBNY0BoJx7Pog1na4toAXid/76kHL0ArUqjt4WHICkig0ocjKobbXGN9H7Ew5z/4IvtNIr4x20yapMvXwfc8Mwu0QHhBadohFfO0pnl4BTwE8/8TTPTCtIweJYVtY9pb62Xme4lvTvNsYlcKaK8SpuLmJf8+x3yJrlhShROMHZg0cTxnP896GTOJqDWN6WoXTfE4qcxK7OrtZhJac/QypRbSr/uPwVYIva22DjIg8g7gcyHWcMWuFabzTB7+Pd1bhwcc7JeZW8Mgq3ijRy3e8+PCB7JHUdcYXOWcJWub0FfZbEzSM5/luLdrygURVk37IyyHlpxTykFL8MntQufHAWwVvFZwxokgMWceJJDGHOYUUYhr7Z9Xf7C7L0Ap2mmcszY5pJJLW+N/JKskB4idi+0NY2jizDooGQXsUmtA49bVyLLtfUW9Lm5t6gscJHif0cEJG84fEyV26cxKuhphtuavAma/eLbY6G1ndoBr5vuUVO0hqDvXxSJ+sUtSsshct74NGoQPQuPItuoqrt9p8WXb5soyugggq+qqA3ld9XeZ9mvEr0Ax0zWGxnr6B7nLoLqd+az18Q+X2PeslnNZOXrJe8r56yQBjGdEQMzXbk+GtVX0Z8dYHzkNySCLnPORD7LYEKkG0AaIymkvbPKiIfLziFojeB9H7mhMlH4pHPFGPuKXyqm6Tl9i05DfJrrKD9akqO1Sd11d1tfhU0tUBFa1qxK/CXUK7rIK3il1a7YmfTWhWlN2+crGqotZ0S/NBgmeSeDTAaEb0Dzf7tc7BVnmXXY4wLhhPgv8SNA1dAfcMz+tSswR5wnS4quQW3hz7Bt5SBG/lf8L7vGrTxoSyxoRBtdWUi2+VSBVTdJrb0FriMDFO4prWEBoXqlqHTUPidxLPJBfZOBDEsg3Nd0Ec6NScbGNAJeThkMtkNkL6GiG1AgmzZxDXUubH4PecJ48gkXvw8QCp3GPHeXa8z4738eisq0aejXEZrTeth2edhy/AzwL+swBP8/hPjkpklUpkFf4W8KNV/GiBSmQVX8o5X8qBNA/SHPXSKmjX8ad1EBOJmXuT/ef4vgi2Jchmz2E0cA85LGCDeXxrlBogmhuH8JvAuyUP/hBe445XMhE5SuM4T4laA5ybgSyvhTA+jkIHwvo6C78ZdsxGIton8Psv+N2E30343YTfTfjdhN9N+C1FKq+SVl42VohuS463QiTWD7sI+BG8leCtoLz9KKIp8ZKH1uJ4WvTroF/XTkE85ZvoU5F6cRj0KRftii7alcNodxZbOqdZth71LmrkK7mot4WWKmhpS+tHy0nZRT1nqXBguXgIF2UX/UY5uUkzh/gMlou8EzzrOani7Mv5DOPjjEsWsfkpqOwEeWVbXzOpiCuuh7H9yzQnX2HsKmfM8F5HSmbk7CVojW8WYUkzzk+cnDPIWWrAu6CcR853XTRaQM4LIM4g54+/4RG2ExsG9TCoh0E86jxDEP8NxOsgLoC4QCVTBfU68i4g7wLoC8i7AAcF5F2Ai3XXiW246oC4rnU7lU4Y2wtwswo383Azj9z3Ifcscr8LVwW4WoWrw6bL5cSCk7O/Tc71+sR39YmNRVNaj9j4v8jaJeiJ5gbpalu0q63S1frqd53YUkI7WqmwPVcj+64ujZPTKqFd2u7V2uYLoX2mnKY91fSkdqljmoGkO7WdqHQaRZAUI52oIOrS2v5BWBH3gnW39tQlat4CFXqJzqOsdcReVu+DRtBOUAfYXm+eGJ0nRi8Qoxdc9H+o/Z6VUTWUkfTP59UrpH4rO3srqr1JDWd7Y8lk02YHGakxzEZSL7e5r55WLEc1h8XoG5vVu65ppPbCuuaJWKLWDLIiyBanmGl73y1XrWHlWlPFI/WU7ccbVf9i/62ubpRKvGTrXZcbwjXEzX68IMuaEZcXctrzJbSmKoX90iDfsmEszCKjr8IcfNXl4VnmSA67iSbDHtG8DKpRNJdz9ezL2r/FVF4TynnQ4VW1gmpSpHrDADoZadBqJeVq8pjWLxJLpMIMJDTpJBRUmxaT7ZCuR+sZra1jatutikGy+FGX7+tY7Ml5tN28bUb0S4erLWxtntCqytdObsJxEFbTtc9ZVUIKVV0Zj1T0lbD3q8+2HV2eFTFbj2h1Xv/yvOtRJDusutNX9fR6fxs3x5H0K1jkCWgSOg9NQZeknoausMdVaAadzrpOaE41EvQAwy73rmpn9JRveWdXvp4aSHsm0kMti93zjLsZ0XM8Z7HRHiOOfsWen7P6Jdp18kzwjFY6UuUcw7aPQ69AJyCpBes8SR+TcmeJ7lOuLkxxVoqz0pyVhpcNrQt7VQP2xIqTYMVJ0J54TDpQvd1p3FZxWt8Lqs6AkxbtlqROlN0Ttupnd8ncSc1lMdWirV9j3+I73jMZlXjBDsPgyzuJ5BXfSd4vwYndIRbhNv4Mtx548qq5HepxE67OH3E3lAX2LrtYXnY3MtXIHV1wzyD3VNVtt5TSs9Tj+0ik9ohmcc/dV5W3RVOR6WkiwlnGzrnsc4G50iFf1A7f+5a4X0YLKXcr1eTu0yTv2JvaOFlP7nGzjA4zKje6GbNbe1eZMYJ1eUQ6rUfYt09vWO1d25hmAbmFKJIFpFpf1UyY4/djKEn220Biq3pfJfv2MdrvVusNHfmjfm9o6/0jWt/be9Ucvx9DP8BCPK01Oshe2v3oPcstd0eY1vsmyWZW7hnkXgllPsSaUOaQvSeM5tWMq/sy9k5AZV955kY4rTcSp8NbCd92uWpPaewpFdpTUAVIJ5VVe/boYhPQELzu14pzi9O3OLnfVUEZrYIm1Hu+1jpZ7H2S958y/2ztCzT+hZ58gd9TrL0Y9NmKIAOCfhcr0vaWndpY+oE1zn3Cu9T//68cH35HOWadHDPfUY7V/yrHXdvkKJVQ+N+Eb+GzGauOO34yatXCSz98NxIRmvR/L83yfxj23cWvdjMA31nqwh4sfj9zpSIdJG6e4tdpc8a8aM6an8HZ6+YNePgFf6eIG9fNq8T9OWYsEjXOkB//aqb+AziKhrMAAAAAAQAAAADG1C6ZAAAAAMiR0vAAAAAAyLhw6Q==);
+font-style:italic;font-weight:700;
+}
+
+@font-face {
+font-family:"klavika-web";
+src:url(data:font/opentype;base64,d09GRgABAAAAAFG8ABEAAAAAolgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAABRoAAAABwAAAAcWB5xg0dQT1MAAEX4AAALqAAAF2YMqMt8R1NVQgAARcwAAAAsAAAAMLj/uP5PUy8yAAAB+AAAAFYAAABgWfNlfWNtYXAAAARAAAABWwAAAZobgK0kY3Z0IAAABvgAAAAuAAAALgP1CB1mcGdtAAAFnAAAAQIAAAFzBlmcN2dhc3AAAEW8AAAAEAAAABAAFwAJZ2x5ZgAACMgAADnJAAB6lGT9qFNoZWFkAAABgAAAADYAAAA29lfkYGhoZWEAAAG4AAAAHwAAACQHGgM6aG10eAAAAlAAAAHwAAADPI+DIn1sb2NhAAAHKAAAAaAAAAGgR1Vk5m1heHAAAAHYAAAAIAAAACAC5QHAbmFtZQAAQpQAAAHFAAADpeb6FiJwb3N0AABEXAAAAV4AAAHN1+BScHByZXAAAAagAAAAVgAAAHLcYMYZAAEAAAAEAQZE1ezFXw889QAfA+gAAAAAycbP8QAAAADJxs/x/+j/JwOrA2wAAQAIAAIAAAAAAAB42mNgZGBgbvl3BUhu+P/i/zPm1QxAERRwHgC7PghYAAABAAAAzwBSAAUASAAEAAEAAAAAAAoAAAIAASQAAgABeNpjYGb8yLSHgZWBgWkPUxcDA0MPhGa8y2DE8Asoys3BxgKkGFgWMDCsD2BQ8GKAAgUgYABCRSWmd//ZGBiYWxh1FBgY5oPkGJ8zzQIpYWACABJzDyIAAHjabZE/aFNRFMa/c54pNURCnyEakaipQxwC5SFxCUgGSyBYRMQoOHaIIFXRDuJY2sHNxV0QByd1dhEFEdQh7iLUaimCf1p0KPj83ddQQumD733n3HPPPX8+u6Zj4rOz/AbwYU3bXSX+WJP2R42or0lfUktvlNi0ToG8fVTdc9gT4LzqFqttH9TwOv4ib/zl7Bt+oqL95q0xct+q5GVsG94n15uq+r6ME1uhzoB3bynvLbV9L3cvwmUwBjr4i+TV6G9/+tOvYq+rHcXkPyLeJ94Z8gJ8lPolFXxOLZ+RoqfK+Sw9nJSyeqfVpec6XLIBs75IU2vS/zr5Fd5+QD8V4l/BTe58wT/Beeh9PP3lxS07OkMtzn2c3snLci4Tewb3VSTWsg1qv1Rs39nHD+XsnRp2gfgenYPz9l6V7d0/oc4RZuqA45xxxw9w/zn+P3LuUGMKfxP7FXwJzNNz0OMec10HzBfq+iFiod8qPMuM9zmbUjfCjubAPOcr7CnsfBdEPTjoUB7qMAQaHMx0qDFTLd3wG6psa7AD9pm+gx10GEXQIeg1k+mY7AZfg9Eh02AUsTybK043waqtZfNuabATBeoHDvsYQdAh0zno8ZA9fOKN29QrcObwMrwMr7LXK6pHTfwe93rq+gQ6vlb1P+nagzF42mNgYGBmgGAZBkYGEJgC5DGC+SwMFUBaikEAKMLFUMewhuE/0x0FEQVJBTkFJQU1BSuFNYpK//8D1SgwLGBYB5QTVpBQkAHLWULk/j/+f+j/wb9PH6x/sObBqgfLHyx5MOmB4v01ULtwAEY2BrgCRiYgwYSuAOhkFlY2dg5OLm4eXj5+AUEhYRFRMXEJSSlpGVk5eQVFJWUVVTV1DU0tbR1dPX0DQyNjE1MzcwtLK2sbWzt7B0cnZxdXN3cPTy9vH18//4DAoOCQ0LDwiMio6JjYuPiERIbWto6uSdPnLlq4eOmSZStWrVy9Zt3a9Rs2bdm8dfu23bv27GUoTEnNPFm+ID/7XGkWQ/tMhiIGhvQysOtyqhmW72xIzgOxc2tOJTW2TGNgOHT42PEjR3cwHGBgOHv6DFCmguEEQ3N3U09nX/+E3ilTGSbPnjOLgeFgAVCqEogBxLRuGAB42l2QPU7EMBCFxzgs5AZIFpItKxQrr+ipUjiRUJpAKDwNP9KuRPYOSGloXHCWoTNdLoZgko222MYz783o87MTgGsS5G34FuILk/j7TOCvfyAH+fK8SSCc1lXvSbyyOHNsrA130umaZFE/Bos66ni/jbrW729byoq58mAX8VYTdKHn8ykYKlEd2x3iHXOyiZPNnIhM2C+E/UxgwC8vnbtGk7xpw0OgwSsqPSpjdEVjG2j0yiDy1uqYlOtHf7VkvuDMqzU3lwdKF6hUBBjjQVlDQ4wq8jsWnWA8MQScGuVi8E9MRFlUSQztPBqsUZNhjTWcEz3fnbumCxUnNbj5ByTqa+QAAHja28HAoM2wi4GRgYmBSZtxFwMzhLEfyFBnUGSQYhBi4GFgYODQ3s/AwqCKIsKwH6jNnEGXQZlBEq6ICWgciqJdDKwMHAzs2jsYGBRcazMlXACdCQwUAAAAFABlAIAAjgCVAAAACv87ABT/TwAK/3AAAAHnAAoCCAAKAoYACgKaAAoAIQJ5AAAAAAAqACoAKgAqAGAAkAFQAfoCxgNmA34DtAPuBDQEaASQBKQExgTgBVYFiAX0BoQG1AduCAgIMAj2CYoJwAoCCiwKTAp2CsYLlgvODFAMtg0SDVINjA4QDmoOkg7EDwQPLg9+D9YQUBCsEToRpBJEEngS1hMIE2ATqBPmFBYUOBRSFHgUmBSqFMQVaBXyFlIW2hdkF7YYehjeGRoZWhmYGboahBrgG1gb3hxsHLQdWB2yHgwePh6WHtwfJB9UH6ofyCAgIFggWCCWIQQhkCIAImgilCM6I34kOiSWJLok3CXCJdwmTiaWJuonZieAJ+AoMihOKIgoqij8KSIplCoWKvYrYiuKK7Qr5CwiLEYsgCziLXgtoC3GLfQuFi40LlIudi6OLwYvQi+GL8owFjBwMLAw1DFyMaYx2jIUMkIyZjLGM2QzcDN8M9gz5DPwNFI1LjW+Nco11jYqNjY2UDZqNpI2qjdMN1g3ZDdwN743yjfWOBw4vDjIONQ5EjkeOSo5tjnCOgQ6GDosOlY6fjrKOww7WjuSPBg8LjxEPOI9SnjatX0JeFvVmeg990q62rerqyvJkmzpavGixbYsy3ZiO3YWZ99IaAgJS6FQdkgITaEshUJheIChkCm0TOkMpXQ6A92bxHSBTodSoPXwXmlfmxn4vmmHTjvtlA60tI8o7//POfdKsuUk833vBa50fCTdc87//+c//34FUUgJAukVHxEkQRZKXyRCefmXZIv6m8Ev2qzHln9JEqEpfFHCbit2f0m2hd9d/iWC/ZVAKpCvBPQUcfzy+efFR45flBJ3CYIorBEE4VXxKcEqOIQVc4IFbk4ES99hgfgPC7b5w4IF3u383XVMOCyI5cOCsHoXfFruOCLYBOvEWUdgQuJb/QO1fKAS8JFqRb0wOZvcN/vGUyRaf+OpN554QsCxBsnXyDoYC+e/DO4KN7LAZYc7CzCCUD4CY0tv4VhHYELYcuCIAv8ijmwr9w8oFVWvwTV4wQVfueAC8al33nmH3l+Hlw+KdwgdQidJHha64Os+uLpw5nB/V5mtBMd1wQheOoIPWkHaUuEzFX8D309COwltL7Q7od0J7SC0U3Q+uHo3rt4tBCbO4h1+7PA3dTixwyl4zA4vdnibOoLYEWzqELFDRJDyjhh2xLBjTkgAdASKGwFmYoFZJTiOvLAGu0AQXvBXaJ6tBT8Nz7NvR7CPr6tzvn8gq8t6DYBIr4pML1mnl56HXjJ7r/1i+0HrB+TrrddDC//aZ90nH7Bea7/41nvlex999NHzZs97GP7B26PHZ4E0heKJj5IXJCIsE/5+TugFNIdhtnNCElod0JqSgVp6obNXyOHHew8LvSbqYarQlqAtlbH/iDBKkeKeR1AfFkahZ4j1wPfGoHesLODLYSFuEGQHAqujCQNJ7Eiyjg64QRaoFGZhh0YErm64pL39A1qJ5GtJUhmcEKtDJTFfkqpDE2INyDhJNLlE9LRXVENJUUtKasgryqr+rdzaTKx3U3esKyhblFy6Np1x+/NT/fsTox2+9JlFLeGzWpRufXxll82dWlbeb5d83gNun+yPq2os4JZdieLKgb6pYodl/7WiXb7B7rB6o4oa8bkdvlRxvNg33Z+07YdNoJ/4g7RCfFxQgbrzwriwQXgWKUECwkLYqiaUV0NrkLbGoTVB6WQcQLXJpFhOoIoJngx2ZJo6ctiRayK/InYUGfmNAIan6ABd0LLSAfwA1CgQHgVqFIAaBaBGKWqL8NFa9pEMDQ2uPFwIbwJA1NMlcZwAmCuDSVHND+X0tC1BQuHK4HA1q5F89hTfIRf6MhPl8kTW58vie8Z3lRqPh8PxuEpCu+pv7RJXLv2FFzqr+XA4X+1cbzTsWjCo7caXf9WPH8hccZIvCJTXLD/xB/H9gJesMCB8cQ6AZmBEhFYBWkdhpzuFXCA4elQI8NZhIQA8LkXJWATcVEzcaAhorQkVVuywMsgD2dKNj7cUhCy9keZHyubknATIJwHySQp5K3zUwz6SoaHBlYcLP0JWUITtT3TVSzh4h2slwqEcZtROYZyyUkDXqgB0VXz/+ctuWT62taKlCrl4eHDbssmre4PFy8qrImnynvqF3anOgdiFeoH43lYC0eK4Pty/Ugmt0nszE4Wo13mtw1kdiOk/60pZbR9PdCGvgLNAeIieBeoccn26QM7rRc7jBylzR3gToXbiIrJc/DMQfG4OiFiiBEg5ih82gB8QAJ17+Q2cZdzUbBdrXonu3VdSo72a1juaurSjr9Pv7+zreKTnvftuW7/+tn3v7Vle3HXuZZOTl527qwhjOWEsHx2r1DKWAxpRuHrwcNqL1A94QBTiyaLimBMSZSA1ziicxlCXGoOf0xhoeWN4GLObbCafF4FAYIfjSYHbFangsCCX5+ihzCjABjRgpRQg+Rm7F+jxdhTOIvbJUcHHWwBFvVrJ17SaJgM4NTkv5//21o+sHdm0aWTdHbetGd24cZS8tvKa7MGD2WtWXpG57roMgzXM5gfkW4JLmGS4EelmF/lpQ6hEIODM4A+YnaPlYEIe7oB3Kx4zql6FKQAnrahk+f4HHtj/wDMPPnjlQw9dyXB6mTAvPAFrAjjbYByJ3sSG90ew4pkvlBcdjQDnfA3uqh6cGu2ffSh79RNfYDTSLRwjvWQH3MYj4MTZrgGxpJpSu4l47OBB9r0peP0nGBc26hwdlU0eAWo1d6SA4wlMuiFUusFlTM1SWQbPurvJE7D/Jdh6i2ep0FnqSuXvb/nTLQekKOMZtRN/IG+Ks5SX34zsF88uHAT5QQZGd84j7R4BgsYeBGZ2IfcOtOEQyIP5do/Cdo/Cdo9yAj0CzJoziS6YaRfAqIvyYIO/VgMGf+WMNUDZrEreDFd2Tk7urISN9/qryXI5iddncyv6Ozr6V+TISHYKW1PZ+rFcKpUj/mw6naXwwZdJkMVswhTDrdCKW7oECy7B0rSmBtCPMpqiVFwJyPlaJfD0NRPfuJW8Nv6BK45fz/EtkO8CPHPChXNCGsYI0jHSXDpC8sF2tzleszywCIZA5gD0JIBMNUCmAshUGEZlIPMS2Eap6oRUm5CAY+ZQLpDzEyA4hBN4ppELMgPhl+uXd+jJpJbtC8vZ3mCh2OtXyhcWrr1QCmb/XBjVbrohnulMxXoHMqlYMKZKVtnyQbd3w/ZYplwcFjht/YF8FdZVFj4xJ4T4vjgKmJWEEN3gvbwFglIZJR6klgFzlVzMbKyyCzu62FmCdFikYEKhUTZWKsNKZVipDCvFkYqCQO/fBV/KG8SVhw/y9D8EhzI4zIBgYzBIigAEm5wkCXa+55hMhV/qI9Xn+9Ppcmplzte3uTi5vV/p0nuzocpZq0pb8r7sZGEou+4j5MOJVE9nSJavcTiU7Gi2XJwOKyP9lezyXs3huUq2RRKl6g0wfx8sIgS0BbK1cFkzh0LOJM8zTuXinMpnwoXrKw24EOwgDC52zi0MHnYUuB8RbBQIqKC4OTdLVZVKoKJKcoV85976T//4jW2vPfzwXXfddSO5pX7wALnyT3i2Af6+C/MrCF9BEeqw0FdmYm6xaY/7KNb6/ExeD+G3/CjqY68Tdz70ZqE3Bu2SuQYXTtnVtIZO7Ohkawghf6RrsJoDMVXHQ2k7hOCYZ0pRJ/R2G4jtBsR2A1q7GZ0zGVgPpFRdHaRib8IQ2UyckqrNn4x09GT0ELninz0hNeztG0l5QoPvWRUo9Peram57ptL5YiDskQkRCSHX33gnvBIpnBtIzvRNFyOSzWm71m5PdHVQ3RBg9r+B5nWQpz5zWBiEKebhGqQHCW7UI7AdEDYa/JX345qlt44C1VqFToqkytIwanCVOdgsotBHYeSiih+n/yDcKQjrD1L6j8BXOuhdBT9KyBxMGQBTBsCUoWCyNqTTsKElJEiDG+Qb+0MNhYl1ans5UNh2zerwUMTp73ENrikoHUOdO3YGy9un8olEKNoXjDs7h2byb63aNaRaLNeJkjPa0zlglzfv7sutHu76ULKr0Kk47Rv1DsYnQvDyVcpjy6fBUZlaLbKjTFdScCj+y4M/qr9NPi3KNwNDlSgOfk5xUBVmhOfn4I3x7TmEi7CCciHsqVIuZOMt3FlHgUeuEIKcO7EW405RijUbDD1MW1HA6LqltWjOoukJIEHDTW+p8tYSzAiVwiPCKgOZqwCBqwCZqyieas0S7kImBQdgjZ578DlQN8iKNRQWDf5uUwf1gXxCLW8aGdlUVhP5AV0b2r58+fYh7e5UsZiy+FLxRNIn+iVPLByOuMVILhf5n5mRWGwoPZJb1qOqPctyI5lKNFbLVkorehSlZ0VJ7ApHEyl3MOB3ufyBoPsdl9/rsds9Xr+rPwL/KI/uBlz8EHCRAtx+6rDQTyVMZF8Iw36AYXyeSQ85ZruAnsI8O18HFsowDejyrUF3AqgIgJwFO0GGhgZXnu+EMHylx9wJaQPCaYBwGiCc5icBBWsr00f9IkehrplaW606lHvX2AfRYcXuzSrnn7loF4iz5jawSrANihNsE2TXLNwEIpPlyAvUprS+WZozbCQSl1qpuNxGupsDDgKnB/9Ns6wnUXlvFiQ+ooPUJzJ5lY7lFHY1xmI7QeJQYieQIZzju9uUZVutZg0RlY1spyMrODKTb1fM7kIJF0evr6ViLhGSoHdayJvNe57LnA0rUmOIo7AwmyBSKaoGerWHAOnP9dUfI+f1/XD9T3Y++eSZuC7hUvIq+R8UhpqAACEUIDhBwmVoBdiFFa4a+VT9fPIpUjjvvOfOO4/xIeAbYqR1TpwPedpKdqIp2Wn5IqlZ1b195Lz6Y31kznnmk0/u/Ml6Zssjh0EfkoSEsGqhlM4gewSIUHqrHUYVuIG7HUZRP2uWWKiW9vHZO/qHY7bcSHpDLjS0o7zyzEHFkd+yBvC+PVPoiofSGYf8IZcjNjBTKC2vTVf4/hT/FuT/lcI24ZnDwnZA7wBc2/2GjZHqiwOwfQZgpw1QJjVgmhrt0FoGrSkJgLZMIHunrLDVlsFmXiaIe5mp8QyTWD24NE+TcUDCDomttQDr0+haPZTHcmPMMABnGHboMB0ZgbXCMMasgO+vgB2+wpBqKRs01AC+jen2rQ5NsgNNk8OGdcwwhuF2lvDUs/mIjW5ucVA/O7/tI3srpffcsGn9/i094fLaAb3mDI5FMrrkc0yO5abTvS4tomuu2PD20eGzJtPdM+fWcqv1A46MJxCQ/JI74Mk6tYC/sufGDetu3FMtbrig1rt1PJeMuX3dui+4bmgk6PtHRyRf6UBukF997uj4udO6x0WWWWyKd8YX9NkoX3DCyyXiI7BcJyy0dWMobU/HZrqlkHXgYUmJP6XndRm0OakiiZd8MvNa5pMvfu+LD2+89Vbxkfr7iIZnJ/AhMQnjBYU4YPE+1EcsfBO54F2hfMIH7y56oCV467CQKCNRWN5iugpKN8EWnYWrKO2RD3ofCPbs1l1ClN4QzT9hKu9JnGWjtmfTU4FU4/hTpaFcH1FR4dPMlpjce2H950QeWlcMpbt7R56Kd+3dm0xGUsl9e/WBT83sEh8J5YbTqzJDAed0mQTD0Y93hI7F458IZww+QP4N9oQunI+KBogh3KbT1sLFj36qe1mN08cKX7ECbTIDy5JGLuBmnAQ1Tr6BVkFM/Z5dzcQzewrq4J7K5J5licSyPZOVPYNqYQ90q/afhtMRt91+m8uZHN5QJOHihuGk03Wb3e6OpMP8XBEzgE8PTOiSw0KkzIwyEX6a2MpMgfJQzKF0o9CWBz6PmriTcYlyW6sefAg/ClA8WenPGZ5g9zFEqTLiJUDxkokMnzlerxNx/MzhyKHsyO7dI9m/T032J8RHEv0T6Z58b/3q3rxh2wAZ7hEgup1IwRbONR30NBRaFR+lrYQM5wXMmalThlaMbNTB2ChoBSm1AppBSp0if1P/r3feIR7xkduvv/3+243xfwnjO4QN/8/Gbxo1MEU+W//Pd9+FEe+9vV5vnD9uoLtu4WOHhZ4y6k2GVaXH5MdHYM9ZuFUlz81mvQt15na7jCFaM8hQAzLUqMZkMNa0Qbxp6EwD8abpR0yBazDYBoVKTFXgFFytBER37cDY+NnjnZ3wMnZ1XzBcrQ4E41nVblezcS2buCfs9zNCLW0YTnjst0k2q+iNpJVfhNIxn2h5qf48g724iuL+duY0QbOU27SG4HootfLV2+cZYl2McpfmOA7scJyMbTbzJNSkCWObAR3+q9D/yFM/PnTox4eIu/4WMM0/Esfxiyju0P94jPo0a3jKW9ra4k5CL0gblcCaQ+jShPud+N2JovBjCoMaTsXCFWJU4T3HljwHuFws4/1kEBLglsAm/R0pv/XQhpWXhBNqCIj8+Jb+XUOcN+ykc3YI2+aosCQ0cTo+uUW7XlnazWfHDjtbj1IJ6B2kIin61KFDn/vK5+Ze+Bwujuwga+pH63/H99hrML5VqDZgdhqwauwm3E9Th4gdbvzr27nNVxB/Bvd0C+8TWpGqLJQrlTYGlEXrOErvKtHDzmq2nLwFq5TgPIVlKrqL6K84748feuyxQ/H7ndfeQfbV7wUS2UWehEXvq//ctNmKF1C+chsza6BpHO0kItp7TM+xlcrR2HId+/+2Dpg90rUCYNTn7zv8s/uOkK/V18Ocq+RFStbMniEOc7/d3czWGy43W3nR4YmmRgu19xjcSW1n821/fjDfm9jO92Zt2H1laGhw5Ze0+8otfjVxOD5+wZqZ947H4+PvnVlzwXj8UGV0tILXc7l1Y7o+ti5HwkbLky8W8+/ii3FmlvmZeUW7MxPnjqtsnJxoqArO/zfOTWblYo4C4wRFj6INZBi96eBkAk358uv3HSL+8R3VyKFUed++gU5yxznnfF98JFKeKXsz6ReyGYqrrRRXEZDcnmR2pyjan0zbE1otEBEWbr9Arzpik8EZe/0tMhtnJ435R7AjIjjaclBUv+MGIuPwtTggMs79dUeAfjgidQArOoF1Zn4qSQ0cBlCP0WSl1UVqH9te0Qw0+jMj3dU7txnItFvztVV6A5P1XyXGBrvdHxoVb1iE02sBp34hJtyELnb0YaI33XDWIyNDCAT8GOxg4Z5NjD/A3RlfaOs/CRP0YYePIVkzNWM0WoWYcKRzDFMZVtMbIiwp7zpEVMRyqfLpL2XSpQ98oL/rhz9kaN4+eYb6c/LDXNc/6LmGff0dwHdVeOKwMExXRLW1AGyfAGhrAQAwYgcXMwyL6JjHhR9Bt+5bVFErAKEUQFGj6hsoYNyzWjMXyy3uSltHg9tAqBuW6QaEuimum0ztdmhEqD0237Rpc22CFJpFXhahQN4JDZ+7YWxfX7R0zlAiE5It4WLP8nV5T2jorNWFi0Z8o2cUoxi2oBbyKzfm7HOD6wYjWuhab9AW6FDD8aDX4UkU1wwPrimqTvdNTofVGwlGOgIehz9VnKbwcwNN2KluNcVOP7Hp/Fl02DUzV9wwAtNNUCRBTzTKCNWUSnYe+jJ5V1SP/1pUb7+d4Ql97IMwjiocYPstRPk8oiVsxvSg2IY9xHDGtj+DubahtDGSMCZCMRIAjAQA6AEWpxAwmSXIA8w7Jg7Gxs5fM3PeWOxQYXS0AEy/22SLP6kP9xQKPeT7zP8lboa52xraZ8M3uBSomo0keKozw01Kl/CkJA+8+swj99zzCJzZvxWDAo3BEKTP0zP7uiWhz0+yRaLOaQlzzFTDnMqy2XLyFs4MDm86ORRY7N+6+ppvPf7gNdd+fd/VD5I/120AnAw5hpdprxa3Utns7CU5PQ+aOsnZ3FDRj1K/uEwn5eAtwJqi50FZlyparULu+P6jH/7woy889+j11z9KttefOnaMbCdrX3nF8FGKQzAfu7CjQcdHqQJC4FZLcq5Fk27MEX9NuHEL3UUMc+879MNHb7zx0W9/+9vkp/UXSRV1FhjbQuWZ6pKwaHBIY9fIfqYrg/4LClGVoBH/n0m+XiLZ+i/Jt2+44XrymRtuwLVtOHEr6ZPCcL8UGvR4fAUzdso8UIWdo/0DWgA1q4q64fWtW2+SHtx/fPt+5l89cTf5tOnjNuP+GnsLhVVF777lT7eIj7/7BsPxiVuFt+i4PXPoTeSeOZlZXxsmz4bZFcYHFUiHK7R16+s37Ref2v/u5fReOrmKPC0+BSCNNkUDiOVm3zDJy3mYBDnrmmt2/OWeh8lVL7wwRFz1t1EXOHHiNvKNE1+FSbgE9hsJRpOR25Bv3jg4SOVeMUos4oswVZcZaQjLYhFh2iu9q4rD3euzYlTrTexIDGqGbEeeIW+CnlcUvnNYKHE5p8Qtk44yMnLpLRqdkofjIg/HBXdT8Gg2FIBYGBAGGOrQm4L3ssm+4gjieFvzaRtDlQdhRcEc55YEeoYogDYFzhCFDo3naK9hAuwFPtcLc+qlfC6VN2yAw8sIs/GhhVRiokUe3SDMfE/WOHvXRtP9nd41Gy6xBtOJrildCfSVy+rktmJgdrUWCqpaKtCpBbXu4c71k1kl6pdl+XKrw2YJFddU6i887QuFgg47k5GnaDzEc8BtU8LnDwtp9Haamnu6SXNnRlMndcrauWca/aLeeQZ5PHx1BJ6zvFSoZbPk7F3KrIT39wpJ04ymGueCCvBSAV5qy3EcqKnUOqpaw4N4LhvuPvJmYHDPhvzlldnE6u5tq+uv++O+jpRi0xLaQOg7hfUjnXa7+GToP1z+c7a/JLrVROCmSNzvYjQPMDkItNXJbGgSCESNs1XFRahNq+Lc0tTt6GQlGimQR5v5XtQolpAu0YYWbjKhtfoybeqX9UK8FAtma7FlO4ej0eGdy2K1bFAbUQv60Zxusx20y1r/hqGrhjb0a7L9oFUG8Yr5rX4COFUAp08ynMo8DsMI9JRNHU3m3m/B9HzbDUzay62nkWehNcK6MPCWdkhLm2r8DazL0NDgynNjojI0jAuv1gJ63iuh4TtLYWC4rbo3n5lcHZ29xufRu3tDG7aQLmUQkKklohU/GX/PXrvtxdDxibwdZKfdu79plTsjH4slIl7Dj/dNwGccBvs06Ajcr90N6/TP49wNekefNovkMGKUBR4FgLJ2j8kawrjacBM8mn16OTMSC5UKi7FaC3oIYAIWCogwtVmRdp68mtqOJFDizjO2kCCVw7nB9PYuNXVBZdkZQ5FQ/9bx8Y0F/51Wj6bk4jc96+1NuJyXu5X40LrivvzMcGdqZF33RR/2hAPOTEw1/dbXAI1Ehe3IvCSU4PqYDmifZywxOL/A+UGXF+ZH1hzQvIh2K7pQFtSA2kYABUrDE1+RdSpbVqoMu+RcX8YTCDnF/c5LZtev33hW52BCXClZZK/iHr2u/jC5+Lp1G7bZbYw36ScGyI8Ab5PCJuGpw8JmwMdKuDY30fFKqsUakVrdnI7X0x5cy5aF9ibPQhGr0aFjh44GqDl01KCuCWvT/ah0cJ5dACQWAIkF0/A4YyBxBpA4A0icYdTMXDYVVYYTTEXN2EvUEKgGWpKorXEc1aEcKBL5EnD94VquqpkhC0j5Ojn7skhP8OMDNht57/t8do8/ku4IeydG4rUdo8HyUDWiFnZ0jfb7w2pHNBEeHI4EJ57Xk4lMJpEk29edabWuCnq7AsvW7LS6XEFRkiSRWCuThWW6D2M/LnE5XBGvSxThE9GaGkz0BrO7erRoKdLRESlFNdPuQ34DtBJG7VPjIoDWFEfjaAoTPwr4cAoO01/N4ugiiAd3uZVbnORobTAYvJ9AAw/QmDlE472Aphjbx7OR7NWdsUTcPXtv8T29nX0xN5nWZafHVv+W+FSoHoqGe8b0+udNP7X4Depj3Xb6fmp+bHnanvuNCEfqNAYlBd3VYubhh48fI2/UozDuiTdPDAgv0XE9i/3jCz3VvoUuR7mdl5oYXuoJwg2ly2d/lu6ZnVpJh76ss9RFfl0XCztGuP1AAPyhrXRzY/xmefIkvuJWyZhixGrqRZVALaBUZE3PT83e98gtdzxyKwD9+AR54/dvv92I86Rj97aN81wo0XJzcg3ASO/E7yE5gA9kSQbj4xvWO+EYaP9X4zhoBnjNaDzNGlbhdWj8DueKvZSW9zJDn8NkGfFj9Htx+F6cfe81aPDb8IZgNK6mDeOMEGg2A7bwdMgvtDx5Fh6OjY5FMsRJ6L81r8K0OkrGAYuKgYRRY5QlYV5J0y6paLhLNGOr6MYn5p65zFe8rHeio/eiCu6cWdYLG8iGG+ib5I1sOFoOdbAtZHabPAFwEhauOhlPWMAB2oNjEcBOAo42y2thAnRBnAs0LYIzASYLvA7zRpvwR5lNOMptws12xoBpyWYqQqDFJnySCTO/Lz0swnBYhKnygZhxUfsyR1oCkJYApCUWRrHxIJ58yyFALFM7B0OhwZ1Txns+m83D5UyNrMldk50ZSaVGZrLX5NaMpD6Y1T+oZ+kLl+/z5E1YL8qCnzmZfC/TntB8kyTfDPqTUDM3b8htjBemIIhBLRqNFlskCC70KqOfHAR7VUb0SlS0N2JYuWS/QBKsv96QBP8WBcEXQuK3FwuCiPs8+QnAAnWdLzFYOBfIxc3MwZCHDQ3Hye3kjhb4LDoduD4gL0w5o+BoK/wuofIsjH1WuG4QkKssMiSbS3MvJpOQUeMpXVZkGg/patZ4SKZvw0inw3787NCvFqs8fD9vB9h40Q5j4fkWR9H/QpX8BWfSojgnT1vTEPr+PMxE4CV8w0o1jWzvWq/NHnS6UpmMz00u8aQD9R+TN8py0O+R7uR5BLBP74X5VFHyO4l9WFpkH+YRPQUjoscwFDdcBm3txJ62dmKvIfl5AV9ewJfXtBP3GJJfD2CpB7DU0+LcMaW7JjtxUjQUO24nvjfQu2YoVC4Xg1pyY09XUPJ1JQpDMTnQu7bmzfZ0+z1d6xJdIckdDQ8tT8r350a7Q1bZZbvM4VHCbq/LKbsien86X9MDosVmudpm9wdcXqdsdUf1QQpHH8Bxq3g1TPGiOQQaQMbIAUBOHaBh1c2y2aL9vgjlzW55Bw9gZ/K/f5672nNVKvTXVFAADHWGbIzUoms2TU/PXmW/2O91d/kDdrtzdBURrj0Quuva//C5LdYrDJsz+SV5A3SUq1g2KGpi6JVTYAzF9DPaqd8cW+GFNudFmqqnraa6QHdDn2IIjQg19Cry8KvASy1H5SAIdd+kJwuZrkfhZNk5Q3YyOzD5T5jzYlvzIsLynKat+czDDz9wwQUPwICfJWchXILwjadhjCZb8yIlZtF+XASARcbcBgDaO4ztpsuVSA1Ls07OO+eTOz5S2jm7o/SRHZ8kE/XnYKb/ShL0ilLag5d/hvkutjV7lk7Q/W/bmrMa2ppreWprnv7E/Weeef8n/vLenTvvffvtj3707d/fznzr1hPLKH4cwntPH3YcP/LpOamtPAK1f0CrMThJ8uxo6RAi8eGJ736XIbIe/S71f8HL43Q+1SVptzUzhrzVIvynVAkTYRS9RK7+/nz9rhe+R964sv72lVcSF+Of+8h6KQxSzsY5ZFrUzItZkBbBSw8aL7f7YE55wtT0ea6ziwWREIwe6kM7H3pO6bDsIF5GVCab8DDuMO3AE7qPVLtjIf897ymEQoVKBV/fc48/FCPXB/2/eGifor3cXxPFWv/LmrLvoV/4g8MwyNYTJeErMFdJSLdoJ6S8CA/UUB7YeuEr0i/fjQg0T3AfKRjrtHE7xlHYKl6eOOLlnlAbzbwWWvFG1wkyPQ/CtlP/Ka7TWB8sh62Yx6/naAdbMSm0Xeiq4fYrZedaVJgj3yQXgSiPUb4Bbiuagz3N8nmBntOG8ZfKtpQfaV6JDER70h3uaMKxWZseCuYyKa875HdLmx3RdHFOiSjd4eLYKnh3B8POYqyoh6j8t+bEMuFVoDMri5MRzQw/sUnXtRv5OktbSzgzo1vB5jeKDSgaHOqTAKzqYVpsgAhP1f+daLTaALejio+DtHWAZUkzu1HnIv23k+q/wlLusubcqQhMotM0PwXobTpbBDh2S7ncP8BQNtycRG6aEzUQSFT9mW1r127bGyolmE2VWVsTpdDene69u67atcdzzm4i26hddT+1t8o2cbcRq0N+L84KvcKjGOvM9hf1NiggcyggcyhUssuh14oSYq6MRmBMmOnkfQuYYiNFIIUdKcMLT2DRuEyNL1OmcRBcRPTDh34QPvxULknRpBw8jjHgo2ceNyw1LJlBb+hG0OBUDodU2LzowJog1eUkr9fW2lzvvbR8VlEJ9BR6A3rMaXva+TBJJYhaX58cIGeQW6IjsV2bPK5rQNKQkh2xfvViq9OaX9V5ww3aykGr3UrzK4UVYkA8BzSbsrCF5Ux006g3I2ciMM8ysJO0RzJyJdBA7eEBOvHyHOxnwpO5o9Aq0J1BMKlH1uQ8KAh5OV/D1IZavqbB6rSaZg2xzWJkjZCXnc5VOzenu3vSm3aucjhW7dzUWejt2ryz/jOHL+SGzeNIa1qKfFeL35HQVu7cZLfD98KJOzoi8DOHY/PO33gDDlF0BLwXxb3euGD6KzPiHYDjO5v9lZ4F/spF+U+LEgKbE99CJhvA4Cy5JY03RDVTHEEWnJSQnNxuLVN9xEzwzcPFTp2KqssVlew9dO8d6QuXH3j0APw/flH6zoMHD561eS9x1l8jqfof9m4+Cybd4L2yMLjQQmPh2qAV96ZtCW4cJSDXb73wwgtfIZ+unyvOkE/T/MYTq8l/0nieAeEbLJes0JJLRqX5AmC3AIIzs6cWMEBw3ojF5c675u2EXzEoR4Ev57BCSEsO/yLewbcSjfqxU8WeS+0BmFoANk7A3DhLeOYqKL0PN4R3KrsrmF1ua8j5VMz/eCiXVNav1YYGC75A1450XzChBz7UrnP6wQfvHhmdsNldlnPtvu7+G++6e5zMm71Oq9lL95TYS24QH6M4uqB9zRbJrNkiN9VsaRuL2ByeQBbEgiDvZIZFTNWo7Ttvn9h7HfwTqBsM8y1eFT8DZ1dZWCl8fU7oh844pVuBGjexhVUYxgxe2A/I64cu+OJeivAxQPgYIHyMQj0HK1htzpSjqjHTPuzoY1tEMvlBwGSImKxZNZBWBaRVAWlVE5+TBqon4fuTgOpJXvmi4V5BDjLc5G+ztmRglMQa5ylG0gU5R4sFu0MeZSi0fe3a7epQ0OPv98a0+vcHdt+0efNNuweM9/P1FWePjJy9QjfeSU8kLFl3WW1Tk+dMrrBZd1msYa1n5qa9w8N7b5qZuRHfb5yp7l6Vy63aXa2eje9ncx8tuZaMi6DfCllhZg6tEjyzxs1z0GLM/sjORAsvSkKo23KO5tDGeRiXQTCAYyO7hLqbgWE2EoiZsxlh9Kato+TvyxX7VwazPX0ebaKjeyjh2lPweaI+1UWuD/lctXx/dySiOFbLdk+i2PX81Q5P1GYVeI5zhfyCfBWIzQXbl8lzMg8bdcEcJuFQ1mT2Wrz57LPOOvtc+vrWs6N33jn6LH1lOebvJ0fJ1ViJZSGHklleV6M6A+A3VU0FdNDO/o08cJCIV9bfwTSIItlEDgEMFSCRIWE5yRxFF5gg9WGuZB99dyJn6ZvqALoNAd2GgG5DwjBca+A6E66L4LoOrjvgOgTXE3B9Da5/hMuDxoYfQeMXGCmHf/wUbvcrNPjshVs6oBGFqweuUbjWwXUWXJfA9UG47oLrYbg+BxdyuBfg8uxlJN5PhYYKzJbxfyzYM8K9bRPm7unGzdLdJLENYsdgU8codowKPpa0YpCHlQcuzAG6RIAFQhZHqMwbFqelt4Omw9FDxWH0AAzRSMBqMVae7ulZWY7Fyit7eqbLsWXeZKmzs5T0+di792Coe3Ut3FvyKLGYIkq56YF4fGA6l5sejMcHp3Mou4b0YixaSodC6dLg8BP9/qRrfJ8v7+exg2I/6RMxVy62gMsFWJiO4R0p1sX+PXt43auPkJUgrykgH93G6lKF2BkUAmCEADGhJotSV5MhO2acRDEgihgQRcws49KoRMXjJgNGjSgW8e6jnnCy2BPeqL9jGIZYBDCzlZCVij7Y1VXRFUWvdHUN6sqmRLIzkUwmkqIzPpBR1QxCjL/ncvGOfJ7JXgL5gTgMu80nnHnKqiELEoCWLiHCMns9hl7UKCaCQTysoEj9EvKXpMKqitRfvuQSnhNCDpHNUkXICGOsNkTArA2RO7ZYC2eamMr3Np5RdMTFFR9aih2QiJYMfKj+W48S0gKRmFv0h0MTHUp6TSZXSbq94oq4ruza7AmpkUA0EXTblZDHIZ/tdHnjvfGU1sfmeS8ZgXn2C1djcrrUtAuMYlgdpvXpKBUOWGY69g62yfSdAyZDaFIY6t4Nie6IUII14R0EocSC2E+/gAOqnn8X8vi7Av2qWxsL99TSXqUjHfSkRosdy+Ke6JCWUPyh94l3+b3hoN9i2WK1e2PdUS2RCrh64+FoT8Jvt2+1WQN+1e/bhusWo8IJM+5KKjOtSZkgVDsazK7vHi6u6hXfpw0mdiR6NW6bW0Ztc4pwA6uY4CgzGbW1ehzaBd20RbjMj2eVurSdbpEdiNdlk9vkqtH8jBZDHahyy2dNO13uzNxsq5kuqFm+wc+kEwPkh+IjMFQEIx9Qc/NzCcbCbaMoWcaWzsQJYEdgcWA5lYcpxwzAvlZ4BotXlIvp8e39/dvH00eLg5rlSmd6qkaO4N/1yfTy7cf/0FOMh/zi7ccv68j0jA1SW3xd+CeCMX+dbXymrVV1MD26btbDWSa8SflZWmCG0+YdJqONCqOSVGajYm4WMwaBkmCtIg+H3xyY9FcCXk/ap0UCQXvYHVInPbXC/lzBIdcsNrs3YCUkcP5Ke5rGBx4iVqkPQNfZqDFjRgo2RwkqrILMJ3dk7zsDfpTo3r65fhmr4wXyzU44m1XgzTOMN0d4zUDDJxdp8cklTZ9cCuERNtUnlHU6mDe+jU8N/qaFtV7oHe7yeLqGe3vYe08/sJlr1UwxsjZSRK7KG5tKm0vwP53jBqEiSk2yjFBmGpGFl7rK5lETtdJX8hGUYm6u/w19qzSEmWcFSmb6if8ldYtfprVTQkA5dzIfZCODprl+StSMsWPlpQgtwRAy9xalVMS1Vm5bUoUsKqmiUQowSqpg2qrGaYJpkgoy97xcyTKEEY3kxd9c+PW/uH/Zp7ZurSsUf9bN9e9v2bRp01oi/HHbf/31GRyd5Dn9+Ko0KgO4xkFYow2Eq7JwJbMEIFb7m3gFq6QQacrHiVDHillLB1XGUruzSudCLRJYSSjQ9bhN612Nzdx6qqMDVsbI8Y8nPUPqv8fVvsnXOHPyA4X8OwMBypwAg1GAwYCwHHSPlcIJVkmICegVaA3xmkIWXkkI+WgM5fkyE9axmgSCoALtUWgPwfs4YGwCflFhFVcMDWoFfG26vJSxYQo7ppo6KthRYbAco6HQOKce89RCdlJuKlFE2pcoKvNAUFTrqzDBMhdNR4BYx4VpYQX9dAwF1fnTO+wks1oRaSFGCXD1WXr6DQXcodHYwtPPk+xKuBVP1yXiEYNUb91cf3EL+bnfGwn6JTgN5cWn4WaMhwq4E4lN9UtMYhZVikF2VjwHZx3WP/gAykcSVTypMOgAruMAYdBBhUGHv3HwYTrcksecgh0KP9V4XQQ8cZbISGECl4Ll85pjAmlRPbJpiZoJ5I0nnqg/lenriivNVROW1aYqTI+nefnSZdSbinGAJYkGWiuNDHsyo2ZSXcHhxJrs7xq59uJ3XCFF9ezQStq7b5qJ94vvRwUISSZN93Nl1ySGg12pjEoKjRtKPrjVDo+qhFzHxxuZ/I05XggcEp3gMEeCxzyQzcKZPtCRjUazHXkdE0D0LzTN9ntuxetV3BORvo6Ovsi7f24awLj/FjgrUyCfCgSIj5oAeC0xjR6LCO/msa4LJ31exROIOMYCVT2YCAY0V8BvXeUZfqlp3JedLqe701tMVx1ul1sNdRYrxyuNwS187FXUnuNDr55hcGka6xP7du17oOmmP74C/h3vaVqDcZ/LKUvvhDNfIPRMZ+beFoWiaQ33l3t6yngNB/3+IF7E24QRTR8o5fTBQT2gKAG/orz7p2a80JoOUhbkJ5z3h4RTJ9G0SU5uxI02dgDLIGWnO/Mni9wY6J1nZirMD0K/jpW7/VJ0SSk1paVUXQNtBNb2Ml2HuLX+WI5kjxd/cfx5ViCCZcafIJqRq76M1kgYET46h4WoQKNrxHcvShtriE+t0VuNxVWxo8o6lswgg69R+Z/v8hLgrAQflFgEUFthzMwuDC92XvjIcJg8ukhS8w1vqUSa6iwMFAoDWIGhb2uvvEiEW23pqs70NhVe6C/8W6Hfbr/N4SQ5e9qo7UN+Tve22uAUpKkAAekzWUX952YxgmZOYVYmWHQ/hXMKqel+L5uc4pvG3VrYhHk3417II6ILOUTLDK9rYRH1x81ZLuQQ5r0lfm+2R5XGDm2+70HYovV7zJvxHdo0P6widYyu1QN34LDDENHHTZDNHloAKiN3eQ2M7zd/a8KpEthuwmfi0ALAGL/FxLQghUsAx22GC97h1y3geOlQGzDgnaQTb8F9+jkMXNDBYYD3cMPaf3WosWb4AVayEsQJ4A0B4Eb3MTk+yOV4Ms/Mf0HqwDZyBX18b2u0ByUfe4tVZVG2XiOUimlBfm7eYDFTPAFxnqUCR3lR7g7mqaywxOQAq+6hZ1niKiASd1x0mtX1YDU+psl92ZHdu3btHsmSu4kPy3vUv42lPkjoC/nev/jAfbTOB4urvYCeIfrJThDJTFQnH1vyAPkVzWFvd3bU/701r11iee2UNjppHIFxfp8irZyMmWT3/SUTzJvI8fiXT5psvmgeBpWSU8zjzw1ZwLnkPJpJ+8RpzQPpHSsXLpQVTgWVe1q2w61LQ6Z1mxx/5uSp+Oa8kD7KIA2fTMY41RyvXZJuPrH0fNvJIW+ffNIWPme25xNwODZkk1PM8RBwhAuXngzjFL8+BczQr14lnyOf5Vq2tWxUOGYeg5pMFewaegx+d/H2i43/P9nUNvbIP4jD4quwhgys4stMj8LMn0KTVa/brBnk5ZEQCV7VLEl70RJURG7kaS5xv6gUCzcA0SCgJKYMUq3HQYOHuSSQgs9TIAmkqCQQadTBl6GhwZWndfCPggoW5yGTtRIxj39YcJIw3gVEBEBQqHBHFSopfFE8ggAvr0sMLB/qiCISyusT/csPHU6URyuXj1YOR5cnVmcYzP3erZmdidV6/Vf8L/2PpBws5utfKOb/o/5KkNdVH+T72uAune0Ssck2k6M83ZqS3eAiB9omZ5v1281xDO5hbTPO7xocw98yThOX6DnVOIw/tHKH9qu6r4UjfKh1Za1c4PL2o0p8TGMfmbtIazPew7Bz9rYOQnfLePt7iyxnmsIt2ICbYmQ6/4sJrJ0s5bmZlR4305+baoX4gENdw6wOfl7ttrVWiH2eRWz7zHohGDmGz+joOL16Ia1JYwrz0/F6IQCYdhVDDl3fXDFEP+eci8VHLmgqGYJ2UoBxv/gcyEoHDwsz1OBIPToCSiKwkwS62WYWBbkLNIDGyABh9gomM6w1l5PH2efb5r+gmdFI2+axJphZwRxlNpnXumfl59tHAtcmJHJeVy6fnn21tn04pioenyxK7rDSmfZbPPpYESOjvYFgJRAMWzwdWqwzYLM4vC633y6JoVi8K3f8XdH2TKw4me0YTapRv9Nmdfk1f0cmHlcyw5mgaLVZL7PanH6bw6OFwqlEMuQNa9GAElcxDu3ECZY/Lb4YzAmrAAo2YeVk+/4DN5oyB/R/B2S7IWGSUR2NqZLySHunm7x8VWqDrm9IFQJRTfV4VJjR508rm1ncHBtPJsdjy5x+n8/h8Pn8zuO/OXWKs7mex831PFtoXudjZv+lPcw2y/rnqU49JqxeWqc+7TWTSwb6+wcG4fRaHgoEQnhFT2/R+3O1Sm+uVssFw+EgXMc/dTpZ3UzueI68STG1XvjVYWEDz/qYYEQPBL/BbzxrB2v2cgfnKtinq4QcrdnLHlcT4exgxfySbuYSdpTa5sIuirhmfucVlBFMnE6abDePZ6NnaCecoZ0wdif9iD1+htlJZ+Zx/6P92hSp8Jy0tcdPWDMjHcyEWmsTvp4Rc/08u7ayMbbp7GwtG1yIqMrqWGS8uznptv57A2/PhnNRmn4bCnW3wVbAr7ak497EEYfxksto3vmwcCuLqMmZlvv0POarGEgoIEQLTTDnPim5TVJ6a3IrlVFc8FVmMsdwqooB3wrAtwLwrSxMTJeHw2p7AwVZOmFdrhUWWyd2bmibw561p3tbTRMzrr27W7Lacc/SPG7Km9YynjUutO0/cJMZrwT9yLNKwuginnUaadaXLmJX6ZMmXrdhU/WnTpGMbc7/MXP+l6aZ3CLS3MkXae0MAQvGSbwkxtTsEC+KgSmmTYUxmE0k2vIb7s6dmr2dO3TpbxpOXfHE/6G/QTipALZWKMEdrIugEJtty5BZvqt04pdwvwKPVzNmweWfqdl/33fePjoDI7CM1fJ4TnwcyH1I+Cya05DxIE9AblU1C+ZjNAv2GM8CQ79RL49gH1666hCnfKXN3mBVikvUCxOBd4WmFnTChzqPtFzyyQsAoXCi6SFKLEAQc7npvmCmHhTPTcMdObPY836ltHFsakufd+MOnxbSfPHITHF5bKwrPHJOrq8rGkypIS0m/lWxe8dDX85NDya6hlfnkrs3i5LN4uoeU1cXx1w+2z45HqqLHfpqu1Pp7Ikn6R5gOdp4zm1j59ymxt54ne6N7WzPTLfrl4UDwr3mnnmd0gKG0i3cM6dIVDywiFIuWCJzsR39/OtJsxnNOT9uruXZoea1PGb2X9rH9j/Gw/yI+m+QDvcuzLy2c53POb9krmNriXKyoEQ50/HsZmnrbDUFV0X9zh3135K/qv/2jjvv/Mc9ex6+804K1x/AHKOgC2SBc3+dPZMC66QWzYo1DW93j9+o2W88l8Jh5hpHjWdRKOWmiuY8/qh9alHSjEH3La2T4qJyBq3ngNZztGYO6qS9/PeYqcrp2+T7VDNlpFBjZEALGMhhYumZiJQKpY4wor2pfc/Noc58dmM+e3PA6XFPJafj6/MU6/BH53R8XZ5i/ltf8wDa18L1FQ/imOaEUXrdxeh4B8N9az/S8ScMnQ/6kY5zC6lYa5Pkdd8iyg20pn21IdhCm0Swpjk9Zs710tWsn+Yg0bnu4XO9r5GjS2vwdApfa41/aI2qiZjZqQ3raSMnldpNzZyZRclmi2SEhj+d+V3aVqg5Sp9nEjcd7EuU41F4GZ4EMbJ3lZak3anZ2Dp9wxaWuTvbyNcVnwr9yRfdvftjLG+X7DLzdU14PcbhBXBMGfF/XeRaOC+iQpFHYjjKS5Vp56VaaKGspQ1wxLmkgU1MLzajUYf5MfJ3SzznapBcbz7nCr4nTi/1PdHfeB4W+ajwU6ABmzDQnH8r8vxb/gzQxpM4j9JIX4FF1tBHi1UfxgcViM81nsU1SPYLL9LaXaf/bC8fjWJizz7YT598sJ/fEOOQP0q+SOfoEc5nOdFu/nxO4/kwFhqr2pi1m+doYsKem1db9xmrYE9VMx78YBTBoA85nTdXlW1aHCk3lni3sU6M7dxP/pqu0yNsYvOSzOgSb1Mop4c/B2XBHCxmNdOFcyAMEFb2Rtbj8PV/aoDlbhM2tROXkc/S56h5hIv/23NYqhxncxkIkatJLCwIn4VkbZ3dlsbsHmqaHMZPf4MMkRdA2CnNcccxj2JwwtZwAod00iPAaYToWelTWxfH/3a3BJ7CO1m5IBxVMOrwv02f7Ybn7us8ubglU4FWXMHqHaAMstoa3zIaNxuN3xkNP20Y1hu2EejnduOnduOnduMXvLGCNow8YU+bZ48syjJdlNm50E+NtI72MSQU5zw7+iumfHsr/PcE/cd4lVAhbh43xriz1Yx8L9583llnnfeWGee+Ab7ba37XqINXoybvz+NXeSyZkdf9W/p8siMoxVr4E4MVXhlX4ZFEhKaBsffi/JIJZ/wppDzDjqVDsrQkFo4bOnXqWaZR3wItnhpceVrfgoksKKhHeEgTpnKXaG5atbkeu02m7jhVb1LiUd7EeGPdtwW92j2bc8Gw3tUV7C+Qp+EfKfQnpgvB3o15fL7Ali1byBdCWJ1ddt5msUik1LtxemNvyWK/zSknhjeUQhunca8myQ/Ip2nNzpBwFz7Q0ydIRr6pnRcSbF/n49RlrHnYqnKq6tuM13iOsVQuWjRL1muYw0zTmfMszlolkliy95dLA/ay2FX81ED1k+LY5S/dcMNLV5xxx2OPFQqC8H8BToyDhgAAAHjarVFNT9tAEH3rBCoOjXKoqMRpjkEC24FIVD6VIHGBA0IIrvXHKrFispbXSeUb/4Zbf0NP/AF+RaX+iD6brdpGHFqpHtnzZjwzb98sgCGeoPDyfMSDwwq7+O6whzdq6HAPofrscB+76tnhLbz1eg5v4533weEBxt4Xdqn+DqOHbkKLFQ7w1WEPA+U53MMn9d7hPg7Uo8Nb2FPfHN7GyBs6PEDiXeIMBiUaVMgxwxw1BCOk2Kc/QogxX0HCCsEVqwz/aVia4IbZkpHgnPkVlshY0cBn5hQFTX6ba7uo7dX0a34z+GembKp8Nq9llO7LUTgOJWnkqjKptlZumlLLuVkts6rx5bQopKu1Ummrq7XOfFyQJea0HAt6wR3nJvRTRpbZtMOGVdlFEa/zRSx3OpFpbPNUpqbIcM2OGU/fzqmu9WxVxNWG1J9C/5QZcfQ/0Hf1bqVOYKvPyYvk9eNF3VL+g8zbbu1traECwYTXFNImt7qyuVnKxA/DyQbRC80vksMNEnJ0FIcdRXvLNRcVIaDVbmkLdtYkS9l5z7x2u7bE4V+axjEXeDKv6zIKgpprW+S1n5r7QPO6bBC+8ujj7OQHXHWviwAAAHjabdBHbA0AAIDh772WWrXV3rS2Z49aRW2qra32rNFSXqmipJRaIRJORHFBSoIiEhxE7BUj4eCslBjlyouzP/nPf/IL+sefMr39j+cRA4KiRKuiqhjVVFdDTbXEqq2Ouuqpr4GGGonTWBNNNdNcCy210lobbbXTXgcdxUvQSWdddNVNdz30FNIr0u6jr376G2CgQQZLNMRQwww3QpKRRhkt2RhjjTPeBBNNMtkUKaZKlSbdNNPNMNMss80xV4Z55ltgoUWBoDN22e2WYz4qcsh+J5xz1j7vFTrqh58OOm6vuz747qTzfqn022mlHrrvosWWOGypx5Z54FHkzRNPPVNuuVdeeOmSFb454q3X3ljpsy+KrZJptbXWyHJKtvXWybFB2Ea5Nvlksy3y5NtmqxtKFNhuh50qfHXTO5ddcc11V5W5Z48LbrsTiHIgJpyVGQolhaKTwznZfwHJ114fAAAAAAADAAgAAgAQAAH//wADeNpjYGRgYOBi0GHQY2BycfMJYeDLSSzJY5BgYAGKM/z/DyQQLCAAAJ7KB2t42m2YW2gc5xXHP11WUlaX0a5Hile2lkS7VVyBG2McO5adWhQjXxK3viW+JqjQtKDWSQl5NH4sfix+6JMJfSh5cSnGWGBEiYu0sljZXdr6ZTHxy7xsKYPJvAxups32d873ze7KNcvhm53v9j/3c8Z0GWOyZpf5oek+PP/eWTPyq59+/omZML28N82mkfnO565ffvzZJ2ZAnpR6TbeOA6Zr/Ctdec7cMxvma/Nt19+6nnX3dl/r7u3p7fldz72er3q+7ol7/d6p3rneP/U+yvRl5jI/7xvq29v3x74n/Vv7b/T/pf/BwMLAs1dee+Uj6G62mD07WBx8e/DbobvD8yNbRxZH/uPd8H7vfeU9974bfW30zmiY68sN5eZzC7lrubu5J7lv8j/K/zr/Rf4P+WDLni2fbbm35R/+b/0v/Nv+sv8NWK6NzYz9c2xm/DfdvfJm/C6Yh5qR8fm9ajw49/VNwui5N57p503D+NCrpmTmmrFZgNaay2Ydesv08a+fPQPQMM8jzcB4nDrafGpyjFvkBuhVqMC8nLmNcTs02QxNEZpCDyVuKLNmGpqBdnLbbsY90F7W7jMFsx9ks9AB6CD0DmcdZv88a45AR6FjrD1hdpiTjKeg09BZ6APmzoHxPHQRusSdH5qMWQHnKlRh/gG0AQnPMVzcgIMbll9uW4c2+J9hNnCSqCOJ20jitikigYrKc7h5HY6X4fipmeB/idVl0O/keTe79gg3zZvmbcb97JxtLsFR1hzkbDn1GOtPg/Ac44VmFbShor2MhBZ4rjQXufU6aBe5+bp5nVufcmPNjLFjXGQNxq0i6+Z9lXOZndOcMAPt5ORd0F7W7WveAkEAgtAc4KaDIHmH93O8O8yaeeQr8jzOeSf4f5r9Z6GL0CXWLbBuDRmsQ2U03QBBAoIE3gO0HTlth6CIQFF32g1BEHdoN0S7RbRbQLsems1ye4BWA7QaoNUAFIk5zniSO05Bp+H4DONZ3r3P+AH/zzOKZi9DH3L+gGoj71BNQIdUZwmYYzDH+O4Ed/VjqzGIZT7BHmLsIW6t6eOEEOkmZkylak/aDvUzE8M1/sKKdHYNJOtQD7OR7rNrxa/y6kV23XZ334JIyAyJzzW/BMljbO5LVlbsycyOs0NsSXYVoG3qOQGeE+A5BXOINXPQAquv8O4qaFY4ZxVaw4/WoQ3OfMjcI+asdQtX44oh2iSTEUXq8ZTTVUFLp+n9Kf92V8KuhPPtzhDrD+A6UMsvI11rYzVsrI59LWPREVqK1ZLXoHXoFfUojxU5sSSkNNeyrvT8uvk+0cl3HrYMvwWk1TA5xjz/JqEiNIWkyjxNc8eMWlnqcTXncXWwPMHjhsDzd7WJo+p1sXrdBfU2DyuKiA9Z5fIK9CkasZJtINkGyP6sfr/B/Q+ZF8nW+J9V+Y0yioT36Y0xN0Wq7Qu8X4FWoUkQZM2w6jgLLwG8ZNWmpngnsmvzYD1lP+8Ocd+cxj38EzoCHRXfVOwxuJEta1Y4b1UkqJErC86sqfF+0OHLqDWWVTKJYpxlPOCwrjC/Cnm6ssw4zeyMrOT/LKQRi/ECdAkS60t3rbF+XfUhdj3MrV7zGid56Pca9z5Wu7XxIIG7BO7kZM/5f6GDy7jF3Qc8y20X9baC+VRv9LjR48aSs/Nrm7j0VAtldhwCb+ol7V1DirNLpT6t+vBYO4p95VRCcSt6TyMtiVy7GfdA+5V/0UfGIY3QR8PloZBoFYFaIlSkyM9B53kW+7qoegrV968wXuX/CneuQtbiY/SVwa5C7AoMavnDxHuR6Si5I8c4xekl5a70Emu/g7VjMUT1WcjmlzvY4GONpYLmgsbLCO35oAlc/Iiw9OuguQmam6D5HDSLoCmCJsLCryOlUY1lkcr1sNOO7LwqlsPzqosnsuMR5KnXdsYUa3fiG8+d3UXgC9Ub0xpDpQCNsXORnYsaFSdZWdRs8tjtislZseI4BpfnoAvcKDnqsuobGfO8Bgfr0AbnPOT/hMrUel7Y8rxJxiJkLd5WIqn37ROtQ7N6a10jp1QXNjdHetMKZ61qZHsG/oZ63XDbDiXeIrOjrg65rPE/A75Om8yCzze7wYfcsLxh7NpDF6NE0hxjnqw+yXMRmkL3ZSLbi/pv59Kis3wfCdWw0PtY6H0Q3MdCq+TTKvm0Ch/3yadVrPU++bSKxVZAKNG6ho1UyPY10D4mrz4GcRZtV/C/IhqvwfMteL4F8h3OB2+i+Qqar+GLRTLoi5qXuCGa3QWPWRcjiN1ET42CjFbT7IYsjxIrnsPjc3h8Do/PqRl8x2eBE0sdfD51tUMDPhvw2eioGwJXN4TwGcJnAz5DVzMkziMDx1u9I4pKHi2B+rbLo3V4K5kfOC2lUW7JWhNjHilOsqoIaTwn56QxNI14lgPfaWqHiyNS+YSgD10cCUEfgV6sLQR9pDHlfY0rDY0pm9FLPAnalqiRUZAvuXgSKPIyyAu27lAfqDofSLQaLzPzsuwzq1HPa8XmeeiIxugIpJJBI622z7cyacZlpBRZA2RVkFXV0sU/LCqiqpOjp5X3KHil+s4zTmKJRWiKuTI5u+2ZIchC1x8UW/2BtfoUZdVZfVWtXutZrOsklnUKspZfA3UFmdaQadX1CTXNp1p9q4xDZPzUcVKHkwqcLMHJkosttjt4yNwj5iQLUa1IBtXq+P/jiZVf5OQnqBInv0jjyRXNCnVuqGtGfSiVvPZbttdK6LVi9S3rNbH2WWNI1FaMseu3pLeKWtrciZ2lUWLvCzZ4QO3Qo9736KH2aVw/I7W+9krZlje0e6XYfE/rfh+/GOPNuFbSUquG3C79T516tUG9aLPwNO9meCcobA9QB0kdJA3i6xI5q0aMXbI9kcbZW67SiV2lY/ujE0j8tHqA5LLQ2Vug+Uw01aM1ruSAdW61FW8ahSXHtKPtAHWrzMy36qj/kkO6XQ7xbHbUPJLt2GX13aXWMNBRa6Q1faa9lv9lW7myy8a5ZTQWobFldtRbGW2KuRLrbBwrOftoV3jHW3VQ0spwl1pZrmhzN3K1VWqEpiKQ7nIxedllY6pUcsuIqz0LWqnOqb59TvUdz3Kq72olW61anktEc6kIlUuVo634bDcl/I9oNzXfWZWmHaOemnEVddTutNS2o00nJ5tO7n/pzBp7ZHbYdeu26s652uSQ9rEpSseD7hC7TbTnSOv0qNUFtbnNaNVsb52TPqD1NuP8uhXx9dYlta1JbisK/6xqVyJF21EgvYWO+r8zMg86C7VViLW/rKthOnfktV4d1JWHWnbgufO9F87Pu+r2klby2mkQmXKQxWrt7hjvz6n2C5zlu7N8h68Avor2XYk7oeE4bqjkUo5t/eVxktdxkrXOzTYkcbKhWbOz+4k0/8y1ZOYp57amSm3ZdhWSM3Ls3AGWqlpGjjGv+TJx3BQ6MPjKTbs3KdlT2NMHhoyeMKdyS1f45k33LavOHaGLr6Hr9WMXY7P6zUA7YnZsc11x+k1L+wb+t79ndcZdyVfZVseTxl37LStpZQT7LWs3uSohVyVabZ5h3Vme39dvWN5LYrJEP/tNz3ff9HzuGtMvCfabXrfOT4BoWL9dTGhtGpqdUpPpF5lI+2XbKwdE4gaRuMIdAXcE+Pgw8X6CJ/t1KXG7pKavdHxRCrVOluq8wvgAepNoKZaYRba3tK4f1a5/EdnG9rsj+djKtIBMoxdkKrfdbucyd3P7S5LksxJyLSLXoutR/Y5M674RcrZUKye0Ygnc98HY2Y2/2XZdBpa+4Q3bIbpuRDqQN5rfuTxmNfsW/y0KqUZmQFFy2i1oX3OY7GJzmXzX+hco/m1+wnpbn0YOTeS+aQXOm7wOvxzXiHYFKUjtrd0Mz1JrD25CJ3k97aRetjq1AZ8nD0+Q79qD/HrQziQ2UwL9GFa7i3+7yUmvm8PmXfR3wvyYs0+aj+DvZ+Zjc9T8gt9xepgrzF/l9x6etM66DfNXc+Z/eS23fAAAAAEAAAAAxtQumQAAAADIkdIAAAAAAMi4cOk=);
+font-style:normal;font-weight:700;
+}
+
+@font-face {
+font-family:"source-code-pro";
+src:url(data:font/opentype;base64,d09GRgABAAAAAEFQABMAAAAAfdwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCQVNFAABA9AAAAD4AAABQiyWUMUZGVE0AAEE0AAAAHAAAABxg/+AZR0RFRgAAP8QAAAAkAAAAKAEAACZHUE9TAABAvAAAADgAAABIM+4scEdTVUIAAD/oAAAA0gAAAXgDqfm1T1MvMgAAAhwAAABZAAAAYHNO9yxjbWFwAAADmAAAAVkAAAGaLjnKFGN2dCAAAAY8AAAAJgAAACYDOAuSZnBnbQAABPQAAAECAAABcwZZnDdnYXNwAAA/vAAAAAgAAAAI//8AA2dseWYAAAgIAAA0HAAAbIiWu2AwaGVhZAAAAagAAAA0AAAANvvCNwxoaGVhAAAB3AAAAB4AAAAkBjoAzWhtdHgAAAJ4AAABIAAAAaoqpCZMbG9jYQAABmQAAAGkAAABpENtX5JtYXhwAAAB/AAAACAAAAAgAuYBLm5hbWUAADwkAAACEQAABAvPt73/cG9zdAAAPjgAAAGEAAACBi2/RmpwcmVwAAAF+AAAAEEAAABBJrMjsHjaY2BkYGBgZIla+d87KJ7f5iuDPPMLoAjDWfnydTD6/+//bEyhzNlALgcDE0gUAH6wDT942mNgZGBgfvGvgIGBKeL/byAZygAUQQEsAIUABQsAAAABAAAA0QBWAAYAJAACAAEAAAAAAAoAAAIAALIAAgABeNpjYGaKYJzAwMrAwNTFFMHAwOANoRnjGIwYFYCi3KyczCzMTEwsQA47A4MEIwMUOLo4uTI4MCgoKjG9+8/GwMD8gnFCAgPjZJAc4zOmCUBKgYEFAO6YC9sAAAB42kWPvy8DYRjHP7oQUyXGRljapCJxkSpNhyqnHTQIF5c2cqG0iUZa6dIwStgMBjarRYjRH3A7MYlYGM0mw/mm97buk+e9531+vc834jKBvogbGl+csoVDjCQ/PHPMpm6+7J0qBXaxmSfBHCWWWWJRcZ+O8g0OsRinTl63NuekWMVjXT1nOjeYpqaKPfUklZlkmFniLPCpyVWaZHlS3TZr8mzNKcovk+ZA0az80C4Vt/X6DEPkNK9AZ2BQ/Svd7Y+UyZBSpMIVY9zqXUe0eORB/3vu+FZNUXt/SN8FO9Iak6IT7d4nCKSibfAM0a6GHjWmpCIkzj6utvxnRCpsQ9kQ7t/DkZUMljIWb9yoa5QXeZ7017nWLj6vZILfPymSTPd42mNgYGBmgGAZBkYGEJgC5DGC+SwMFUBaikEAKMLFUMfwn2kP0x0FEQVJBTkFJQU1BSuFNYpK//8D1SgwLADLCStIKMiA5Swhcv8f/z/0j+3v8wcbH6x7sObBygfLHkx5oHx/HdQuHICRjQGugJEJSDChKwA6mYWVjZ2Dk4ubh5ePX0BQSFhEVExcQlJKWkZWTl5BUUlZRVVNXUNTS1tHV0/fwNDI2MTUzNzC0sraxtbO3sHRydnF1c3dw9PL28fXzz8gMCg4JDQsPCIyKjomNi4+IZGhrb2ze/KMeYsXLVm2dPnK1avWrF2/bsPGzVu3bNuxfc/uvfsYilJSM09XLCzIvlCWxdAxi6GYgSG9HOy6nBqGFbsak/NA7NzaM0lNrdMZGI4cPXHy2PGdDAcZGM6fPQeUqWQ4xdDS09zb1T9hYt/UaQxT5sydzcBwuBAoVQXEAD+PbfEAAAB42l2QPU7EMBCFxzgs5AZIFpItKxQrr+ipUjiRUJpAKDwNP9KuRPYOSGloXHCWoTNdLoZgko222MYz783o87MTgGsS5G34FuILk/j7TOCvfyAH+fK8SSCc1lXvSbyyOHNsrA130umaZFE/Bos66ni/jbrW729byoq58mAX8VYTdKHn8ykYKlEd2x3iHXOyiZPNnIhM2C+E/UxgwC8vnbtGk7xpw0OgwSsqPSpjdEVjG2j0yiDy1uqYlOtHf7VkvuDMqzU3lwdKF6hUBBjjQVlDQ4wq8jsWnWA8MQScGuVi8E9MRFlUSQztPBqsUZNhjTWcEz3fnbumCxUnNbj5ByTqa+QAALAAKwCyAQECKwGyAgECKwG3AkA2KiEUAAgrALcBTUAyJBcACCsAsgMHByuwACBFfWkYREuwYFJYsAEbsABZsAGOAAAAABQARABWAAAADP8zAAwB5gAMAj4ADAJ+AAwCkAAMAsgADAAhAnkAAAAAACoAKgAqACoAYgBuAOQBTgGiAlQCagKMAqwC4gMGAywDOgNcA3YD2AQQBGIE1AUmBYwGAAY2BrwHMAc8B0gHegeOB8AIEgiICMwJMAmACb4J/AoyCpIKzgsEC0ALkAu2DAwMXAywDPoNbA3ADi4OWg6cDtQPNA+QD84QBBAiEDwQWhCEEJgQphEsEagR+BJwEs4THhPsFEQUghTYFSgVYBXkFjwWkBcKF4IXzhg0GIQY2BkSGYQZ4hpAGnYa2BrsG04bjBuMG7ocJByMHOYdSB1mHfIeGB6gHtge5B76HwgfgB+MH8ggBiAuIGQgciDoIRohJCFEIVghiCGUIc4iEiJuIr4i6CMSI0AjhCPGJAgkYiSwJM4k7CUQJUYlZCWCJaQl2iYqJm4mribwJzYnkCfqKBgooCjOKP4pMil6KaAp5CpgKqwq+itMK7AsFix8LTQtgi3GLgouUi6uLsQu3C74LygvtC/2MDYweDC+MRYxcDGwMjgyYjKMMrwy/jM2M7A0ADQINCw0QDRUNHo0njSqNLY0xDTqNUI1WjVyNfA2RHjanX0JfCNXefi8kWT5lHWPbo00kkb3fdiWJfk+du31HXu9Z9bJZjebY8uScIQkUJKQcG5ggQLNJiEhCYVAAg1JdhuOhOZoAphylGNpaeifo1y/pkChrOX/997MSLJkr02zkWf8JM373nd/3/u+Z4qmXBSFgvRHKRmlpKKPIyrW+zmlXPPr5ONNigu9n5PRcEs9LsPDCjz8OWWT9mLv5xAeT2lcGj6l4Vyo5ecvvEB/dO2oi16iKJr6yfrv0A30WUpBaagI9RRFDS89RaGY9WkKUR3FveJAJx7opGR4oOXCU5TiQjyB+JRSxinT2VTSaNA3cW4faqKn6dauSMjhCOEX3XfwYPmRh7hAgPMEgxRFra9Tb0eH0Xfpz2p9VOt7KXUT1XoKxgGORfihpN9JWSkn9S4JjmY8bTPVVoGjHQ+01wxY8YBVAIwMMHiAwQPn4akI/slD56kmuCrg7imqSf0U1br6FKWClwLuHXDVwIuGeydctfBCcG+Gq2E1nshxmRR5pZTkZeDIi8vBSwc/Hpq6TLewz5RhboPXzKLusgOmrPl2U/b7utu1r3Sf6XkS/us50/3KK68gxZkzeK2IWlh/P03Rv6IS1Cis1Bh7igrDK3ThaYAR/Q5GYH7mwjlYOUOFNNrupyg9QMOon6Yc8P454IMQxZDxEHwyClCiqIxzNxn0DrlBr6KVBi4TRXzOgVLJbCYdlWfS2VwmZXAgBj2ncbr95lQ+Njo7GjPH+vneris43revu7cQG5kbie0d783tcqBfdxg6myM+m8fhCPZG2VzAKn//3YqwvdsaSPicAdYR6A6Xpptve7siaIc1NVG29d/RBaAf5k0d0DBE5SiqhBglUvI5mduXkfiExyD5CLTGrcZtT7oeRr+FH3sLe/YU8IuNRll4/bLu98l/cLxMc/Bj7balqT3z83umlpLdvb2ZTG9vN7I2DAF0QYCzn/5bqgO4ZpQ6LXFaCrNNqobjXXjAVcNYNjxgEwZcaoFUmEQuKgWkOAfik6JchCgaIEoICNYGrxR80kyI2iwxG4zkyYgDRoZhpAgvG9yPYnbTO2ggWg7Ip0I6vZEpygSsIB8McO4onUkXaXgbXwjigNxA1yLKpVRIaWTerHdHLc4eS3zBzQZH1CqD1662ujgfurp/zLPYFR5L2fVc2GRgDN6MqzBg9ict7FzEFlBNaNOe3sxnrRFWYzMFr8jaCihi7XF0Ol1eoz2UXXtJn+P81vign81GeG1ginN1BU1jPWw6FtCnDvL+Q939N6ajGszfvwcZX6E/Cyhqo86BFMopWSie0PGpTsT9D30dbe6i+6+77t+JLKyuT6N/pS9QKvLZJhjDn1XgBWZzjAoBNwAPPX7sTW86Frny0KErI4/N/Mfdd//HTHDhxVtvfXEhiJ/xZnjGnfCMDvIMJVzxMwAngDosBcBdyjeTL+PH3CF+U3gO/v48dT0tp8MAQwz4QRU7B2MqSkGIiYBcckIupagZiPaAazuQqwRSxuRSTI5RMkpe+c5rPq5+uCXe8rD649cE3/jG93xiJJp75plcdOQTjnvvFWWfOkbLYK42yk5VNZSgf5rEGVqwRIPOAZEFXWPgUNsXvjAA/6NQ8bnnis+R5/zjegi9m/oYpSVrbgfMiWvOYTapipXyH4tFWtGiYKNxNhI5MHe/baoXIa/Pyw/nl97kFGBCIVqGjoN0UDqXwbWAPlOeRceL5L0fgn24mboHZjFJstKCJaFFkAQZGIJcjQn4YcztjuHXmC8W8/miUfyMlfXD6Pf08/D8yjNo/Aya6iTiBc9gOJR6dBca23Wf7CjmAWoU5FQD+qQN5JSndkvfa8Lfa6oxABQeoARgmtTYOGBaUXCnJwJqg2s7oaQNdKwbplLUYEfmVtHAYYKapGvVEQqfePObT+CXqytgXBgcXDAGulxmr9cMr/ZH77v/kUfuv+9Ret7RvzJ811//9V3DK/2O8jMc6+Q4J8sJtD4CNk1N3wIwFST4WzG4rTXwi4gA+J+GVRPYgQtagQsUq08DL6PfxRNegysDtjuDhVxDq8uzT9yZmnAUhoaG0HczzYx67XlhvmGYrxVw5qQGqY2GuzqfAw84hPls4nznQFI7KQfBUqcaW1w8a05SPUq+CIbEQRNdU0R5ZHCNz9y8EB4ajUw6Y6GVofhk1h7ac02/vWD/53IpMfb6y+f9uZEIGwtnrImRYGTf5cfztHyUwNgNdG0CGFPUnASjHYNkr4ExjgfiVZycA4m2U3ECX0fsaZBNDLcdIDWSd33wvgreBZixySvSmJhchtxsXECT0uCQ4XUAq/Ir7N4iEJcxdy2VuqeSzGg+Ms2G/UeLkcludqKX7Q6bPaX5+NxJ7jZHVOMIWW0xt7akZcPmWNZjT3MRY6CX79mllyutgawrOBQz5zjiy/DwwwV0bwHe2yutUoMXpalZZQce6BA8FVgRfBPrAU1F31BEEwi6BpuSFriqV4VxHWgIL+YHToU6kQJ0RMaVQSlNCp1ENK3odKsfRfeu7Ck/iUpLK689bylYmBjzg4HHHsuhD5dfj+nQBXRoBRj9oJFEgLQYIG0NhBwe4AQIzdgfJBByFeNnhDe1hCrYY8FelFaUO0wJWaqGAFivKKtshA0Zf7naE8qw7nzYvDDm73KHDeh4+ccaW8Ybnc67+YGFaGg4F9G+TWXVtxt8WdfALr3OhlKjz7SrTInd6fR0zt5pcmoA35OwFiPwVAcwzaK0mggGPrLFaoDDYUXSaqjKaiLiap4GvYNpEFFjmhEZrC7GgXRR0LFEGGoXJJpkBvXbkh7DyIBvPtCy8O/mAY9vJONCvkPx8HjGzvVMhtJ7B7zhXZen84tsRu9NsQPDfOzAYfSvjNXWd3zSFzEndiWiu7MO3+SpycPvWOB5uyDfI8BXeqBZJ0iPuCglXpRyC32oVEseJbYoqaIs58q4DCqZkntVbklO5sqn0ddLs0mj7LJ9H7zjlsHR1Nhtd/3NQYro3yHAqY7g1EL1VbEawI8P1MzXiwd6a/VXAGbVEYy2wYiOYLQNdG8C+CMBVxXED23ALyw2HRXdC95NruIAOmgl9nIykptTJ7pR+n2Lu8YmnNnxYKz4zemBUnbAEi380eRLWPzd9sxYKDaesnb7LVG3ztmzkMsu9ro+lR0qJl0R1qyy9L+tZyTe3xWzB1jzV13poLNdbh5PeXtDJnOk5I1M2eQdDl/K7SlGLZZYH5bnQcBFez1/iexUxYTIcIS/KJG/MFdFKK7CVQKGMM811fEXIk4fJ9gjpaDGclWPr8pnPh6ZvfPB1rlRe8JjGN5rGvD6hjMszR9IhMfTdnd+MpheHvBGdh3G/IWyfPTgYb037RwYfpmx2fqPTfrC9fzlswuxGbH1tEzLU9iNOwrRmYaME19jw3gnWeEbqTj6NX0M+C9PCWtWEpnCGorGMVUMR5GYE+TwrpJgQUksG7xiAg7AL/QaFPDP+0Z0Q/lbKFJ+FzqxNvWy/OWpNYz7Beor4Jt8m8QVxDvRVDwUeFHrRaQr4plPACw/rsCirOjTzWCBJ20BC1JkvPBPgX4MYEQAnBtQRAKGpq4F/Pwb/XdgiwJUUOIDHpOdF8gOpATjjqfl4dGuC4Jvk/MV5Q2WVM7URs6vNWm5MG/J5Xz91oR7f09wKGG18hHAzFEpmP65pyvq54OWYM5pjXBRY6Db40qF/OEUWxNg01Ri/STtpm+i0uBzlAATEDFSXhIDx+BOT+664K6J3OWJp4v5lIaRGMEKDTzZI+g8juckFoQAEhtVwp9CiMLUcacCy3Iuo0K0O6mUG0d5a4zT3/lWjaebj8yWvJ7ifCIyaLfxs8n81dOxyPSJYnoiaV6nQt6urmNLV/TYglp3wjG5R63y9MVtwbmb56ZvvizCGCNWW2rlzOHDpw8nPH2Lqcc4f98tqhxeKws/uujTYGc1VL9EDxWmh6omkqu1s62w3hZCIFVFN3YQ24XzGRB0EXvK4Ng+pePQe5waVi1Xsxrn939TWvjRwR8tobYrctd2d1+bu2LwRfr02kmiK68i9v40aD0b4LqiIURVXIVEhwd0GJJzlAduBC70xARP7BxA56FsZAz7r1YCnQ7uvIKcVPUgwqoghHQkZA4hQ+Xmqr9PzuVd3T1j057+fbnnHpofn5y4bGVh//LiCn1a6yuEElOd8rY9Q/GxuAm9sSeXjX23/E+lwUL3H7EMDYCeC0Js7KK6pTUoMMiKmjWIzhqxL4qKvy35YgClaASVkjLbwCwD4Cb29S7bY5a+YAy8Rnt2MhYZYeP8kVLx+GQYjU3dshSLsxmryzt8pFBcGfH5uFQkGV28VdAFFO0FPLcC7rq3xLLoYguRuxp7NBjCVtEqETwaBfzlRLRpFu774Mf4iZPjD37s5PXXnxyjTz9yz56bFiJD77z55tvW/kg02ymYWwtzt1GTW87chgfaqjMLvitYZ0nfxCTfrq3iZWOVJv07hT5Y/hLqLP8X2l2+nD498vXR34ziud8Bc5sInw9uOXdtUFY7d0vd3NUZNdw70N3lZ1FH+b/nYLJ/HSn/AObKAA8YgAf46jobeKDqSQk8oKpYNROZ1Q5vCtGzPSbkrCS+cND1jJGBOFcjapLQ5Ik+VzbCqWKmYhwMlN2amohzvbq3r7JX9BWPTQSBP25djKkYW2fG4pY4xKD91HD5V2wYMwmipgBXLYRO4zug0znAj0SdlhgOxCTPW74qeCnKVcwxGpcGAjD4yU3NI+38fPk38/Tp8q+Rbu0kypRfhnkPAaH+ROataCI5nka+6byCzwkfqfgETauSxw8GAwd7LgOnSRlchx54AH30gQfKR0dp2cjI2toozDUDdujX9N3Az5m6mLw6lxoPqGv9sha1FE+KiUENeIMa0ad4h33MN9oPKzpqTM0Vuo67PxAO7p5Brxsp90dnerl0txTPDsIa28HaboXbSyx6Y1KXYF8m2mJMB8kqt4iZEBnJtRDsp1BKqeNkSgN3ZF6G9Ae/8bMDX3wdpsCTaPx/y1ejhdtXMXx3AHx2gE9BhbaET2Rmghda1AfYpbhjFg2Xj4NKf1KIU2dIPvo08PLW8l7VheexloFlSx4Hht8uxm+UqBtx9IZn0zGpnA5zE3ZxuU7ExRAHnq2Gm9l/wCVn9+8HSstoWWg5shyWIbmcHoGF/uLqqxEDzPZXehAZ/bvX1t6tz+Sy+vL7MKxzAKuC2J+9W2bwa3keZ53aANeSNsI5p+ZVnEWCqKeS9eoQNRXOiYtwgz+O5UDGc2CCNNzcwncGaLplSrwAmEfuSJxIo3kA9OwdqatS5U8SnyQOOsUPOkUHWiVTlwnp2CRyEWJIQWcL2kNR5wbzUpAvahIU7to/6PUO7u/KHcDXAzlvMWQyhYpesHlwLbTH9946NXXzYjS2ePOeqVv3xsd9oyvFwpEhr3cIq5FRH8B5VLTjKoohmfnNqS46GAST7XAjcG17rJbS7Wq8CVFjtbG50XCSndYcfSm7XOK4vr3ZG+e+uDi3sHCCPq2P7Mpij6h8EY31j4zmyn8W/LkDdIC+B3CXrmbBPBgETw1MFjxgETgxAdRlCCdaKj6OR42zQPjOIu4Y6Ij+rWIRkbQhH5XVopnEIdncHUyo4PMWQgxcMUIZ9IDaY1y81hybzDk8A4D0/QMee3p3RLMr1WluQbsLV4zy/OgVhcLKsNc7vLL2k6bmpcHm3OKNo0CCWGzxlj0jr1/sagmGmuR4jVfAjwDgvRnsx9wO/DgcWQoZH8zXki5ViTZV8OhaRP3NEN4V8Y5kHMid5Efpnrx2cmZm8lqkO3vD3CvJ+YJ7evBhtLfU159e+zwylH9Jn9aFR1KT+zXlV4lOwHGgGfg4VbUtRgyUsQbKxtxVE/xqrESAdjLGwnfi1YwViYBjSEK+6D2RQNiJqgmrG7xHsiMTWjZkPmhOBixs91SseMwTZicTvSMGV9Cw35HhGbb3suzYmyLv80bycTNn1rcFWm3+nMfbF7NEPFm7KxUxuczaFn+7M5Dz8EMpezqC1wbRAx0FGiiruQUxNVldm5hsIKocRwmIYFshZKuxveIQ/T1a/r15eheYqi8QnE0BzrA9Nlef2yBRejygF3CmrFjgDkH3S3wKikfKs0zNG7xJhyPpM8y4embi8dk8SG35aGo0pNeHRlPoo+Vjo0dKNlvpiKDLQ7C2CMDQeQkYqjucksxQYo4fNJ8DMTh7okvJuNDS1RqbVt6i7uxsPr6wCm5a+Wz+ih47REh2dAQHBDgEpOg9YJ9dVdvRoI9ZPMAKEmurhI1sJTPQKe4F4J0/tsLHAiSohFKMcEdgkgmBi1LGtc5l6BaZrM3QOpwfbjG0yWXNsuTU5ft3K9sVsqb25rFl+u7yFcGpQGA68Npr/hl8RX+7dj3S2Xvt8H/51xj+LMDvJjQ7sCUvmPCASZBGCm5oYsWbxDthP6NtFWdupRGTGq/qHBBaGIH1yKRlwIJkOq4SgHH/++T+/R0mtVxlaF9eevKr+1dUVo1cZek4soTmUOERJmS3h5hHyl8qP/64KeVwpEyPY7h9AHeS0LlvOzu4uTpXYleWgObdAJoBGPvC0orOo5frfbpDl12Y/0/00HO+3X7/hO/Z8vJ/wgz9MLcVaN5SzfXL8JNlNVNVPR+JyhTxc2olKYdwjg6BR9KPri8/jp4on0Y3lH1J2jySXPu5wM+vrh9Df6C/CuAyEOErKtE83kui4Y74+MR7fBXpv/Wt8q/or8bX5HFqi70YURbIXgx9AbMZ4lbwXgz9/MWPCt85ht5QmY8S99LPY++B7F6BfcYOK/iTKPPPSF/+1TH6Yvzig3H8yeuRDf2CPgt48W0me/QFvPlAiSxCNr4g8AaPCJgANY99ZGwgIU8MjNFny7c8dvvtjwl50N7119O29fMYtyI8IhQGV4a2ldnhUQFPT9MFdC39TbKvlWK4p5eXS/Q3zwj1BuBD0zL0GshojHortTFAV24a7daVF2C4deI2vCImBOqtlWCYF7ctWimeCIYZviSkQs3wblAgN9yFBIec7OnKhAyRDMenmkrqRdoRzqhkM/zCHQeRypHg4ktuVpvIFdkrLh9UygIraXdvxDKttfOG4Exwz/GS5ZZAIWxrNoddeq+hq92s77h2X/m7A2xUx6V4g13X4uXe2mR08gIuDgAubPSLYJN46u11O23Kev+sc5MQY6MxFD37JkpNlq6HzzQJVQyiVwRfVWN3hcQ9auzJ4DuZiDbMgIYNqXUfjwsuarZ2AE8HZmluMZSYSFk8hekQNwPRwcAsN2phs36j2pX2sOM++sVnD7r9XP++ruKRIY5zZl/ntFgTYxH/QMzC+YA/pmHdVsID9fkO5Y7zHblL5jumQ7tWcr2LjoCj3xccSdisieFgZLfT41/Jdl8+5n+tcGjAHbRnLA5rcjiIk36cJePxu/sPEbr0Qpz3Z0IXT5UuDRCKjnSVLuI+jqy+aobQpRm+qyV0UcFnhChdW6EG9qFsYrmC4KsIq2Y3rJXHu5FV/iRpP2H5vV4gRmTILZsdUsocc5H4ZJdjYffQWL+rxLK5gOm1/KEBj9u+fH6tq88ZcfcfLC4dGX8Nk2UI1juM/SughwP4YHDL9db6unxlV8oi5ncEeN018ArOngvvR1Xo4sXpWPBvh4PDe2Pp2W4Hosu3IXti0B8adds9+/PZQ6MBdOfEkCMXdihe6z00wLl651Md5ha+GDaZDFnGzfUfvGJ8j57v8hBdg3OAA/S3gVaXURvdmgaBUW5CGEE4ZKJwCMUG6koQ1kpKfLBLaEcp7GeBus2RrWqGjjlS7ED3K6/MvOtdh64cG6LfrGoZ7A0Plg+gB4qKwN5rbMJ+ztg6S2cBtxpqmFqgPifB6MUQeGtA8uMBf82AmN+uDgzigUFKsekqBiuraFcLToxhVQiHesho8sLT1AjRjRm4Jgn7ZeCTNviUX423lvCn+IqO9MLdHkJMBvMZ2YMLITcuhlHinLRQJ1LZKGIAO0J2FGsNXEqUR0K2D37XCX62uMfyvpk9waG4Odd1yOBVc9bRAK93OGxmzpke5v3sS3+tsdlTw7wupPdl4tce3OcbuaJ44oYfxvq1jgDDBBzagRlfXGPz6DiTTKEL2O1djLzN52QSOrmuFPb3RcztJW2a5YshpqXFxNqt6aK7GLWNoBPFjDno0GgcQXOmKNizA8A7bUTOr6S2UrYN6riqbDeJ8LH2bSPIbapEfrLK3qykX7GZ0YiSoOEOzMr5pe7Fmdl0r9Hr8RlmQX+eCmRXLi//M+KGB9uMLmP5UaKXlgHos/RLpGYwXwexcpPKBiEyru5qN10AlsCOhgtzsrem6mIZpWdfRbTd67XbfD7007IFPfCw227nOLvdTebOrfNkbgNo7f4t5xYjFQX2tFQbKkIECIwAgU2AQOQVybw0wKOP7cn7xuxWS7fNE7e1bYBOFdmdc+hUhQ6V1p1woidqQQW6Xg0AF4Gu7dS1dTnBS1jVWmlqyJfR8NF2MV9GUc0b8mW06IDUZMx4pYG7elaOmg4+e2H/508BRcsORH2l/MP/vv42IY8I8eyLoJIyW/Jdbc5SUcGkWpqHKH9GKDnScDN/TIX9aYOrx79n5iH6xbXvZGNMsV2ztIheJX4b4CMMOoilHtjSyxDna0CQcpPIqSEUaXBMzgm7RJWIpHlVyL3rKjbOWPFChP0WupJzApcxhaWEqYoKdjyq194+pUybCO7SGtOBVG4qY/HpBnIWj24K/bTPHZz3RSfHyw+ihcu8vvJ94qVG3gEPNfK+lbe1Q3nHu3fGOnmna+RdWEmdvA8p5b4NAo9+OrepvPdi/xDg3ZC/a7DLtRG0uWKJuTpLLITwubrsUy8/sBiPLw7w0nXBGOjmuO6AUboSV8k9cKjQe6jfDQ5SL9kiTQwFg8NJK3hPgh+bInAawaK9vS4zXoVTDMuUm2zLbdRcCsHJbyGOO97J11EtlTwOU9mds1Sy6+7KqoUdOwYHYQLqq65sNeGDueiz2FFy740kdhNHNuyectHciHlgXvRhAw/Sny+yQXBiu4uXD3EuR8lpObpP9GAF2qTQn8maL+UjNkhVg48oZtcUG33Ezk18xM4d+YgpsomR29JHHCEOu5yd2cJHZLNrk59fcoY2+oiIej8sGvuIWmp+S+3fIExi7ZUoKhpRITRV/Cu6RqWJoiKm4EBO3g8U8l0/ZI0yOgtnz10ZBjk5lR9qaRttaS5NlH8iyPQYyIgK4IpUc4MN0WQQDwQ35gaDYlgocdI5ygnfCW7IDVbTsjVxhpGpOjonAwcHBvqG9/oGkw5LajKZO+bxs3si7qitfXZg5ZAtN5Mee1PkRocnzNrCxhYLF7TYU16D15xhbG06i8rBa8x9XY60n4k4cR0hrMVNXwcaEeevcHC7ueDUqqRqFkOmrtbKYn1rFDUSIJfLlJBQ01pXQ/D1u97dNvTb37bb4hzXZdG6pv2ZsZAOe7B33jn4M1fCrWlv7W3X2DO7IjDLJMRFf0I/Be12Zd1uQoNQNzCFbJP9BkF/6jbRn1oCt0sMdnwkCYkrlnJgYP80qJR7F7uXZuZSheBQYHYhBLoTRcs/Gh4MxdAMwJnC+9UAZwdYvq14tQHwappbMLg1aT+S7EvNney0dsg7zJ0np17aD07Ir7yjHDfqRfoy8A/ILkVPw5wu6vU7n1OMVJRbV7/X5j1wkbZLRJaQ0sMxBiOk9LZIUVZTe83zeWW7Qq5UNedHeptVzXJlW1N+z9UrPcr2ZnlTe0vXEVjTzzhQ9oPuixfxdYBD5rLlD9ywlx0K/h7WiIuyGFijuUp/Mc93CY1nxgPmmiVV7dU57A9QZlEOhaycjmSghf3fHF+TDFQyNYv506f2TXbYO+UqW8f44qPnlhc6XWp5p6Nzeunif57QB/X6sP74f/3+pCFqMIYYkhtOrMdoHmC3UfvqulwalHMD7IpNM/Hmym6/Cj+FkIEhmqOEZLWso5Jxbj4338q0pfq0nT+Ze4PK2SnvsLZfvee7Kk+yP+Cxae6QyfMRD/pZ+b/ZXRw37kIda695ihFLaz+GfRTXHwLsjTlO5f8xxzmKJsvfQ2fLn0NL5VQYvWEwXL5rUKgtE3Oc3VSIOg+ShKg0yTniOlQLuWsTs+bnwCtpJdFOPKFIbyz+xVozjwyixqwUz5CdFTIepRElk8na2e5wuJttbzFGR2KFtC9hbW3i02m+qdWa8KULsZGoUWdNRKPmTqtRlVYZrZ3xA2k+5eiItxo4U2hfLJFqkbekEqn5qIkztMY7HAAxUq43oRn6N4AfXKOPc7O4Rh+BYUTKXbvo31w0UZSUX/1xZa14JEdWaBF38oQ8h5+stR2uvEBjaYlSGIwXHkIZMeNBVKxBTEkJG5CZD/kSttYmXzrta2q1JXypQmw4amyRFg94MEaHY4VjeE3R+ZS4pti+kLQmPn0gXsGAORpNWAkOMMQT1Drdjj4I9OEpnJlFYBgw5Bqik3CGRiZKlIZ0V4GqEPwiUugo2gFscCcsYz5HLMAb2g0GbUtG+o0JaJBxJGdhLUqd22IaycKdOy3kL3+yPoZuANuL41FbXeW7UmpZk+PSf4YDQciRkjshxkOzG1vWlg8eREsPewIBD4cL6mjqr9b/Df0v/R7gZS+1n9oYcbThFJRbZEOBXC6yVJeoRCjcciCGZ00xoawfo6AjhgNgYTOWwa1dMWAL0uvihAtp3yIGX2zaApvPa0CGUU9XX6n7y44xPhXZlbE7s7uCqXAf49dHLGzagH7UsTQwuNTRYnHLrjqm8BTmM+m5Xk/T1VfRbmNaa6TLj9BWLabVJCwM1/YGqrVqormsVrOKCrVSLd1GFobU0m6rbLXW+yX1vKtCkxO3KnQs4PYbHlzASq9SZVfTiNM0gjTSunK+VGi+YaXN4MhNxosL9jiTDw4M69qeebTJ6xsdTdoOdVvsaTlbYINDcUuIjTGO/jSbZ7us9syIk+wf91BztIPuBw80TXYocG7XTkjSDndxsjdQQkKqiM8xOG2WY5RCXxCjJH1VvLI+JOmZ1+i0mrnwYrxUTCyG4TedZj68xHQ74NdpHYvLCliddH3rAtPDcXnmssiy17scuYzJc1wPsxDZq9P59v7BkfDodJ6EQ7xiGmQAcI6+BeC8ps5Ot9XXdLVtWkCoqIQjCrLVJiU6cOOi6QK2y1Lpm0HcCrdhoavZ1cJ+GOkvwjVY+CV7536NSyfXurX7Z899/Mknn5x94okn7n+avuVTrkGOG3R9qvzlWH/87Nl4fwz1UXSNfsM9f+fIvpAsJFT1SJqOgZATazus78qZyXIcrRKZ3bf+ZbRGfxokdJSaooTqVD+hGfbydUTXJWFEir2GSHUq3jlPipEuqxZ6V3rhXSGR2Es8TuA+zHqkpBzrPp20ly7H9K46zRvbI6tcik6xXKA4zjq9gdL4vKWLC/qCpfFSMBFQdZqCeU9uP5u0FIKBSLC4qxhM+VUana/Ll5xxfFnlc7vDLrtWHXC6Qi4bOqG3eC1WD6iVQjTea1TzFkfSY/C5Iiab327zOezBQjTSZ4BxS8xjcDMYLx+iJ9CzNK5wgF91NamoVM39KyaHw8Q4nZ+EFwP39ATLMGzti+R8Heu/p3tAd+G4fbihnq9tB5H7U1QE2CgtMBZgt39Vqg3WbRPRM/UyX+PuOwLjK93dK+MB6Rpl83PJ5Fyela4j1mjexSX0brVTH+3KRCw+jYNJ+3CvCBqcuGkhGl24aWLyJlxLctPkwInJYHDyxMDA1ROBwMTVA6GRpMWq51Wa3fmBSb0qqLdaU+MYtw9TF9E5eg+skQPcpoWCe7Eo22hHkpcvNCXgSuaHj16LHLw9bTRbxvylQlpBm7rZUG/JbWZCzMwg2pvpanOEDR2hTutY6TmvzpKMmRiDbrbFS+rm56g0+iP6qtZHfY30On/tVE0PIDqOayopYddWLu7a4m3UBfSZgfIZdLy8/twle/Pk1EkQ45/TL4l5mSJ4ZedxxodUvgu1zg5yl4W7JNHfuOU0AOogCdfYKt50eIpK474MvMGwTY2VTGwoBP8XdIZUO2tAYX44Zce5cn4Ib8UP8c4czzB8zslm/QzjzwYm2JhBE41ygcCg3qRjbKhkT4+Fw2Npu3T1MiBXXB6r0jznyQcZ1Gz3aJ1NcyMjRzWaTu2ggLfH6b3oYfr9wn6ugXv8D3+g398NdP0sehT9Hf0o6TvG+r+14iNK2NhsddV2YxQ2Rzi9nouYzVG3weCOmt3BoNsVDKJHta6Y3RFza7XumMMec2lhGd5o1MtFpXpkoZezE/RTQz2B4AZRFedHfkG4SqWezavChpuwpdh2YWPTpxKoLTV+foFQPV784heLj/cLfZmfQU8BLn4PXgilI42uVU4mlVvwjKf2zDntep+KZ/KebFHnCpvv/C26kN/jsrKMzmUBH1nP8wFjhjzv0+jT6EF4ngeeJypG+EC27sGC0cTa85XOhNXKHQ7yFrvW3+nQFbhYvovlR1LcoJlu0ZqN5pTPxugZXadPbw77c/pmnzMSt1nwXL+kC+heYV8ecbkUCpaWl+nCGQLH5PowHYUYw0+dovBu1FYxbEN858QDzi3Sws5Kz5oNvuQU+kErG/amSqQvZrTB89KkiD+W6kE5hixY0A28DYEB5Sbn0t06n4/Xz9EydZtcqWzX2X0ehYydiXF5PU3TcxDE/mhwuMUU4lDvyjeW9Gq62Jzp6coYWF8+nXIQGzi2/hj6f/RpwIMavMttKpNgQLCoMqnrIo/QmZmZLJtZHvB6SpclQ/TpNRYlzZnZ7vxMyij29CAluhk9plWS3h0dwfGP1kPoRpgVRrwp0SJiEuNME3JmzCbO5M/Ymv0Jl0OWaWadRtbYIQsoGL3e0Ex6toH3Lqd/gXMNSOxK5ZB71hUwJEv02aBC3V7+Bl7fe0Hf/hPoWyyXVKPBEFq/MH+91xLqZnG/pTmMryHLQCIUSuAX+oS/hOsOS37pmunry6T7+/HaLqfSdBPRr18n+vXrRL8qcDqCLoFvJSO94CZ8bkblJIIMLrllBKcnB6JWWUDlzIGcXBbJfi3Z/fEzo8nyQWFVlXMGyvKu2f7x0Pi486Vn0JekpYIuxnP2inOy4FlXZ9xCOmUNE39tE3m9v27+tb9vlF86VYFDQXpPF8RzGPDaC5da+04EPSOBN12Ll+ZLiP/myApeSifQ1E3rvehXEMPhbu9g4+60oNQ1RJd68VEdoEutoDG9RpW81rnAEb+c3xDhXSX0VnXh3qq460DP/JVWPuLRy68KCzFfuEw6q0LmYNaBO6vmx0hfVdJVDQMBm6TXSJYkNUcGoZ5I19Aw9MmDS8OnGnqGZMmT5fGGtqHGZ2JdKGtsQioOLx10NzyUfvbk2vc36UWSnonl3Qxw5lLYXisbYX3w8PThwUH54EObPfrk0FADyNKzU2BjXZjDkRixc1Ign8VnUDTOhI7pWatFpTLKo4qwp+YeNU79glqvBm+4ABerOVosDzXiTS7CESE+MoFkKz+5EZvfNVqtRoPN9mF4GeC+rRGEl8kbRvEDcC33NQAhwXCiCgPa4iyTTfARDqTTAX8m49fZbDq9zXZDIxDnYwF/PO4PxDxWM2OzMWZrOVwHBQ0akKKnwH40QQR0dMu66WpGrmGHWUg2CdkLndgeKPgkqLLBo6y0CJAmOY3QcQ7xPawGucQQEhVk+pA+ij5U/s3Z8UUkR4PPfOADiEYT2ePZN5wf/dKX6NMjXxv9Lcj5wHqI9Jjh41IarY/sktVUaCBbY5uc37t0M1mD6UIfuER3GdZBpMeLyGOnIOHKmuasF0G2n69t0AKxTootWvXfxZKsqPkuOgAyXP7EhvauZ09+XPh29bs4ipYkthPVfP85UVY/UPcEENMKCDCz8BxBLritpaIWst/XyUP5HzZM0SALeQlm0u9UiytZTdMS1oPnpcYlwNPa7VLzEsHVhu8SD7Dmu0TflR+Tvo31nKHy7ep3a3GlrJ1b0mt31jwB8FQFQSY+Y1s81UJVrzfKL1Qe34CjtbfUwKuGHyHSM2Wu9jZcokmqNmhoq2xQyis1CziAMIgBBKkJB1OuEeCtNjQSmdy3e/f9Zz72sbvFpsb3vQ/1BxWIfeSeez5DGhsvxHBPM+kdIjo9tJVGV2zS+oOu20Knl79S1xRUp9Fzm/YIyYQeIcITBBJiX7cJSDGXabfp+8HMl9y+96dhfmKLt2s6wpz69m0AAO67+Oz2AGzAgRK8oFiN7d4GDonjh7cHBQvCDtBRgUXgi9JWnLEthray/Ie3A7WOa9Yi2wMtF2EW5JpAvaVfsA3c9dJ+zXbgNuqAwI5ojsBu34Jeow0Ac4ASqk1wBrUVrkLdBd4yQOKJQHhXXV45dUo4curoRz8alv7/1L1nI/feGzl7b+S++zANI+uv0mH6M/A0A/DTzZL2CWFlE6rRPtUzgc7BJx3imXMGcRPDUdlfbK281yqeSROqdP/iEaOol/BOgIHsBAiJ58hqzck8MSTZdgZJyVgeopNKCWeO+bIhx2IMm52GLhdGsRVN2B0Y78t9mXjJ7sSk2F/Kxl5vsWOs7u3rstgxWg/1odtDp8YwugtT7IHIjeOYAnAr2B3Si0Rk3C7a903bi7BeebmxxQjb+62ajOqeTez/ps8WrNt9mzQwgT+wZQtTzfOVOJqt+AibziHpg7/ZdBbsM2w5kUycR5ChxCV8iE1nbrCST24CQqNPcal1k54egledgNc2VNeZgzH66MbuHOw0PLWxQwc/60qxv1MNtrh7B51gwu5lB3GPZeJeLKmerfZ0VhOhmivnb6w0dc5/SWzqvE4fHc+mJ5OmD/2gb3Q0W76IZX4JcJymvw0wLNfl5Kt1l914oLvGa6+edCkUmuHiLAXlFneAhCT9OQiWrVRaqMSo0W/SwZD12x7SkUZg0Jds6V0xfyFosLltjnAm7GBCvd7gCOuype3BiCOSjjjgnXAwV5qlldGJrN0UyDh8mXDAYgK17snwONtrMvTodTGn3Wc3uyKcOxGJsd7E7t1lhWDfSM8Nyft5sfdPvMaddb68sLxc+uXOu1/ob54p9++0A6YBLuKR7gwu1FVaXi4/+BdAVjiz9ujOe3OqsCnBPuQANsEl2CneEDNyeQlUQenKvwh5Kys7R18FxscgCu3CZ1RVNvaxiyBs6+8Y4E8rQn6tw2xqd7bEam73/QXgD8YLGr0mGytqDJpcOb/jdcjFdQh7b9242mXLyGBni/lB3TZd+d6/YBkNW3rl5M75RlrLv1TXslV+Yqec1IOTFvilt9n08PrOX7AWRyoYTCaDwZTXYTE7HGaL4y+gi4zSwFoW0GtUFCRgiPoEtbFS7hI1fz484KtRomE8EBZ0O95xtpJ9Zpx/CxNFKovh7nGhcukc2Akf1UHGfWq8t4DHApUxnVraGQ1XjnTFdU4DYh3sxu1FpnoEoUvoqhfylaT6wOcVyoE7kZDKjKIYUiHNW96C+Jiln3E6piPxvMo0HPfmvFqaLpdlvXlbzGA39/syY6bAlK93BK03612mWLfiv/xuS9HSrERo/9Tbxhd12WGzukvPdgVjKU9hOqKydEwc0HZkNZZ4KBLd/S/OrpB5dvxu3u/hjBm7Wd0DdnJ6PUT64v5POZrBDfsHL1+6Aa4xR1O4VEscUIr0iBFd7ZbiRNm2bV4vgvn4445avbDleGLbdq9GOCSbcWk4UDc2Fx/eGSSFM2XXdpBU4VACX8Y22odtYDGJpuF1O0UMWIXtUCMX4RF0aPZSMdj22Pphvfp8/84gbdScD22HR6Gn6R5CzxaBqxSkOekXwDnli7grCRCwiNuRxM9+Q/qskOvDn0XLmLrvIh8unPkl+XClX+rHhEYdVQophe90i1S4RZxjZWVR/KKMfO81EZf2S+Xz8JMu1mPrDvLEBmQcrcKF+zpM9A8oPViIyok+aawi0zWeaO0pN3ylEsxeOTczCJ+2E40YFE/gwFGkNGYg8Z9wzcE1viqepdmLz1uTFIhOigSrp2hGkRAVYocVYkIU9ud5HeJmeX8hYLCEe28amHYVl3KxywZ4d2EuGZu3qQrRDzG3WXrdPv8u9zuYLntmLNxmbIv5TOG8G4eRdLDwqTf1rozybGExm5rLs0Hf8JX+ycCQzqVJ64KW4YDYD0368R4jZzdu7s0oN+2oeWxz52WuodFmo49yoLHrRib03BAeYxr13OYlN7i//bVtG2mIhtuumaZh/o36bfP5yT5++Z7tIcCabdt2nhoYxHxYo27bAo4WUaau2QkysFbbFhgJFswTQap4CR/3UoCd3Zw/jmwP5kaf9rPbwisX4T23fS5sO6rW15qV/2Z7cDfRwDuh9wJ1GHzWFIHZCrFYtdpbqD6jLgi9o7hsthOuBlwyU5vWqzlRk8fbLmEMM7wmyU943U8KaV6EBTkcsJjy14Wr45dFgca/oG1ojWrFp/NU82Wi07hZqQmuTHSKvqNRzJfhWhNazJeFxVoTKV8W3pAvY8R8mWtV+LZHzJfh85lyUrdzNV9m3DJh9lKgB+Nd1eHQJe3CHcpYWUyguVLKW3O732cDD8zVw/i0eltyJOjqYhDL7s1hssTz9iK7lMWUglvhXGX0J6IDTGJGfrNGmCdA7XyjrhcG5GrtufqGGKJbNzwTa5VNn4l8oEoO1j8UYudY40Orz1TiKgxJS6BNn6sQVQNaaIR4ZWVTmGXi8wVZCm8tSZuu5MU68dlbP2+DrKz9/WZrJH0jBG+sqI23bvFAUayIH79Uowfg8uInt272EHspSU96TS/lhlP7N21dEcvGFZs0GuLsdrPYV2iAoWbRP5B6Kasdhs2b9VLibbi6U0GYjJRU9gm9lLM0dxk+E8SKWww9Ey6wqBY252f6x9kx39dkH3xpkZwHQlop3fb9HxPOA5leIb2UMhHHAp3Tl9CYW2N+tV5ZfvqSRGikfXRLmqyvU99HB9Ft9HltE/UC2Ts4Sw+ic8QmbW6PtrA3G60JPgeF+h7djFjxPJ0Npwi5ptFT5THEjlGkPOB79NAWn9PT8bVV8XPfBDjfQuPsaRvZ02gTqsFVSFnVz7jmGr0llpG1q5x8kOVTE0P0u6xT6SY/ywVL3bvfIP4NBXHNdc+C5eaaNvyZi+/H8aNYeJQ/OTGI3muZyjTxLBfq6959Iwe4OwTP+S3gzkc9T2rFnj8l1MddBeP/Q8ZfIOMvSOPrTvQ/1Fu0PPXC+nvXvqJWAs5PrX2FwPRh6hT6CvoI7pegsJYX/maJt25TCYUd2YDJFMg6xOspA591ubK8QbqSeh2w013UO8W96JHN/sYGGTDgAUPNQG2LHj4CQHZBOG/DurrxL3Jsdc8G7Ha/324PPA83Afx6wS/c+EvuQACXv7rqruTvjlBpdDv6Kj5fghL6JvHacxmyHfWPH+FvvZX/9vR93CceEs9A+BZ8/gM1n1cIuOJzjEHJo9lb+Y98hL/4Ce6+6fvc5PM9gI8s/U4qUT0zQVx6W30HN9EpftAUspBweEiocpKqXzwB0C0eQuIW8zfC33cyVDqYcb4mKpx1LWRjuEzOl4bYJAc3G/qAgcWb9AYbYlz4hBGs2+msb3/xyDt0fXmE8n2691ydWnIkLHnfrmUV8pW/gxCSramWhkP9jplw4m03huQt2pZmdXNYcePtEVfM4jqymFCqmlt1LfGFwx7gdnr9z+g6eoh+EPjKSs1Q+KSb8/h8Ali7dNqWcNaN5GkYpb8Zsyr4RLpVYdXVv4PSKUZeJnKwlhOlSqSoAf/xKp5jSBEiOU8GeUYjVrklPJpTykeDY3Jl9qXDFw/30g++bnr6deV/uuv4+fPH70JUNrtO/X+zfBhReNqVUstu00AUPXbSIli0IMG2mhUL1Dq2qyhKvUrSLCohNUqk7lgk9jSJYmciexIpW9j1H1jwB4iPYMuX8AcsODMZIiJAKh7ZPnMf5557ZwA8x1d42D19PDjs4RTfHfbxxHvmcA2vvXcO13HqfXL4CB0/dvgYr/yPDp8gqr1klld/yt2DZTDYwxm+Oewz6ofDNbz1Xjhcx5n3weEjvPc+O3yMN37l8Akm/hf0oLDCFiXmmGIGDYEYISK+53scE3WQMXYCSTxiRsVYiYJ/gRsskdJbkst8x9aXIbB5OZfAcF+hsjvJv2TsZhfZU6ttOZ/OtIjDKDw331h0MjWRYrSttCwqcbNMVblS5VjLLBCdPBdDk1CJoaxkuaGRwhTWJE2tTNNcZtGANjVS6zKVoqcyKQalshqmDM+ptxzK6Tofl2w2sC23kFD6Nbo82uSA9xer5cTFIY3LujV5URBGraRz3e0nu9KmMgtfuFp03Xb7/6f5zs6s4iwVZy4O5A5IJf4RYVbC6SvOP7Wezd4XMNt4CzawYLaJuac1J8eEZx+gad+2YbmTZTVXS7FrbjASvxnCMJkpnarlxuyCVpgU44VU+j7I55M4aAbNdhg+fpZ/HZq9QZr37AoNLs2buGLSglo1VZreCtqlI6mIw0etCJfstY3WTOvVVaOhtyu5mOsgVUVDsnLVCP98osu43foJrQbBqQAAAHjaXdBHbM8BAMXxz6/z39p7773qr9Smuuy99y6t0X+1/as9Ys8QiRuxLggSFJHgIGKvGAkHZzsOuNKUg3iX9/J9h5c8MSr0q0xquQX+1/MKGiNWnHgJEoUkSVZJZVVUVU11NdRUS2111FVPfQ001EhjTTTVTHMttNRKa2201U57HXTUSWddpOgqrFv5dnc9pOmpl9766Kuf/gYYKN0gGTJlyZZjsCGGGma4EUYaZbQxxhpnvAkmmmSyKaaaZroZZppltjnmmhfEOGmrbW447L3t9tvjiNNOBbF2e2uLQ0FcEG9fkGCn294FiY4644fvfjrhnPvuOm++BQ5Y6KFc9zzw1COPPfHBIi88K3/rgsW+Oei1l17J88kXuyyRb6nllilwTMQKhYoUiyqxUqmPVlljtbXWW+ea4zbaYJPNPvvqehDyxkWXXHHVZWXu2OGsm24FSfYmRgvyw+GM8F/PDpWURlKKo4XFySV5Rbm5FfFPl5kWihT8A1Izs+JyokWR39drbDcAAAAB//8AAnjaY2BkYGDgA2IJBgUgycTAyMDMcAFIsoB5DAyMEAwAGSYBJ3jadZC/DgFBEIe/u0MhIhc5F1GoRCmh0uguqiu9wLlExUX8qXRqUYqolAq10iN4pTO3u+REFLsz883Mb3YWCygzYIIdjMIx1Vm0TmhREE6a4oixsH9iJ47nC7zpMopprTaLFW3JvLPZrf0CRSp4otihT0mxrrI2gUzVJFHW4cCVB5ZiT6NQldM0WnuO3LirCkdpuPifvEVoesn11gzRNIszjiGyibx8KN6Ok+icudBTdX6uLqua/FHQ1JYdG+K7X1xPqEh+y5qN+hWPOv4L0zQbRAAAeNpjYGRgYOBiMGBwY2BycfMJYeDLSSzJY5BiYAGKM/z/zwCSR2YzFmdWpTJwgMVSGOAAAH0aCbd42mNgZGBg4ABiFgY+BqbMlNT8ovzcPAYmFzefEAa+nMSSPAYVBjYGEGBkYAKq5GFg/B/GANKFVRQApx0JcAAAAAAAAQAAAADG1C6ZAAAAAM0VoH8AAAAAzRYRAA==);
+font-style:normal;font-weight:400;
+}
+
+@font-face {
+font-family:"source-code-pro";
+src:url(data:font/opentype;base64,d09GRgABAAAAAEAgABMAAAAAe4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABCQVNFAAA/xAAAAD4AAABQiyWUMUZGVE0AAEAEAAAAHAAAABxg/+AJR0RFRgAAPpQAAAAkAAAAKAEAACZHUE9TAAA/jAAAADgAAABIM+4scEdTVUIAAD64AAAA0gAAAXgDqfm1T1MvMgAAAiAAAABZAAAAYHR2+RZjbWFwAAADnAAAAVkAAAGaLjnKFGN2dCAAAAZAAAAAJgAAACYDeAvSZnBnbQAABPgAAAECAAABcwZZnDdnYXNwAAA+jAAAAAgAAAAI//8AA2dseWYAAAgMAAAy6AAAaii1Y31gaGVhZAAAAagAAAA1AAAANvu/N3JoaGVhAAAB4AAAACAAAAAkBjcAzGhtdHgAAAJ8AAABHwAAAaokNh6PbG9jYQAABmgAAAGkAAABpBoTNWRtYXhwAAACAAAAACAAAAAgAuYBKW5hbWUAADr0AAACEwAABA4YitLKcG9zdAAAPQgAAAGEAAACBi2/RmpwcmVwAAAF/AAAAEEAAABBCH7mhnjaY2BkYGBgZIkqsb16OZ7f5iuDPPMLoAjDWfnyGzD6/+f/bEyRzLUMjAwcDEwgUQCIeg22AAAAeNpjYGRgYH7xr4CBgSni/+f//5kiGYAiKIAFAK9pBwUAAQAAANEAUQAGACQAAgABAAAAAAAKAAACAACyAAIAAXjaY2BmimDaw8DKwMDUxRTBwMDgDaEZ4xiMGBWAotzsnMwszExMLEAOOwODBCMDFDi6OLkyKDAoKCoxvfvPxsDA/IJxQgID42SQHOMHph4gpcDAAgD7MgvwAAAAeNpNjztLw1AUx38EFyfjA3QyiLGDr/qoVFBLqnLVIFRqkU5FBBEfg0NnwUFwcy/FQXB2Mjg6CGq/gOBX6Ogs8W9yK94fJzn33PP4H6fKCDpONTXe2MUQ0McgHzxyId8QyZ4IWaTMPOOMMs0yBVZYUDyirvcD4dFNhTxFapwxqdqQJdY5VWSVjG6+MueUF9BDl6a46vmu+DF76nijjpuskVWPMjn5JU3b1iRffjaxumbOKuKpfkxfwwlt1ecS9fuq9hVts8E5/TSYUIbhkDua+t9yz6eqZ6T7lReuNLVXDHEk7X/E31JQs4QWJ9mhQ4VhbZHisiXl/3GlI28pWVL9HYysYPH04tHikh0GpKylbX5VX8cxDzwzFX/9AGujQskAeNpjYGBgZoBgGQZGBhCYAuQxgvksDBVAWopBACjCxVDH8J9pD9MdBREFSQU5BSUFNQUrhTWKSv//A9UoMCwAywkrSCjIgOUsIXL/H/8/9I/t7/MHGx+se7DmwcoHyx5MeaB8fx3ULhyAkY0BroCRCUgwoSsAOpmFlY2dg5OLm4eXj19AUEhYRFRMXEJSSlpGVk5eQVFJWUVVTV1DU0tbR1dP38DQyNjE1MzcwtLK2sbWzt7B0cnZxdXN3cPTy9vH188/IDAoOCQ0LDwiMio6JjYuPiGRoa29s3vyjHmLFy1ZtnT5ytWr1qxdv27Dxs1bt2zbsX3P7r37GIpSUjNPVywsyL5QlsXQMYuhmIEhvRzsupwahhW7GpPzQOzc2jNJTa3TGRiOHD1x8tjxnQwHGRjOnz0HlKlkOMXQ0tPc29U/YWLf1GkMU+bMnc3AcLgQKFUFxAA/j23xAAAAeNpdkD1OxDAQhcc4LOQGSBaSLSsUK6/oqVI4kVCaQCg8DT/SrkT2DkhpaFxwlqEzXS6GYJKNttjGM+/N6POzE4BrEuRt+BbiC5P4+0zgr38gB/nyvEkgnNZV70m8sjhzbKwNd9LpmmRRPwaLOup4v4261u9vW8qKufJgF/FWE3Sh5/MpGCpRHdsd4h1zsomTzZyITNgvhP1MYMAvL527RpO8acNDoMErKj0qY3RFYxto9Mog8tbqmJTrR3+1ZL7gzKs1N5cHSheoVAQY40FZQ0OMKvI7Fp1gPDEEnBrlYvBPTERZVEkM7TwarFGTYY01nBM93527pgsVJzW4+Qck6mvkAACwACsAsgEBAisBsgIBAisBtwIlHhgTDAAIKwC3AS4mIBgQAAgrALIDBwcrsAAgRX1pGERLsGBSWLABG7AAWbABjgAAAAAUAHMAlgAAAAz/SAAMAfAADAJCAAwCewAMAowADAK9AAwAIQJ5AAAAAAAqACoAKgAqAGAAbgDkAUgBsAJaAnAClAK2AuwDEAM0A0IDagOEA/QELASABOoFPAWeBhQGSgbOB0QHUAdcB44HogfUCCYIoAjkCUoJlgncChoKUAqsCuYLHAtYC6gLzgwiDHAMug0CDWgNuA4iDk4Ohg68DxwPeA+2D+wQChAkEEIQahB+EIwRChF+EcgSQBKaEuwTshQKFEgUmhTqFSgVrBYCFkwWvhc2F4IX6hg4GIwYxhk4GZYZ9BoqGooanBr8GzYbNhtkG8wcNhyEHOYdBB2IHa4eNh5sHnoekB6eHxQfIh9eH5wfwiAAIA4ggiC0IL4g3iD0ISQhMiFuIbIiFiJoIpIivCLqIy4jcCOyJAwkViRyJJAksiToJQYlJCVGJXwl1iYYJk4mhibCJxInYieQKBAoNChaKIQowijoKSoppinsKjIqfCrcKzormixULJos2C0YLVwttC3KLeIt/i4uLrIu9i8sL2QvoC/yMEIwgjECMSwxVjGEMcYx/jJ2MsYyzjL2MwozHjNEM2gzdjOEM5IzuDQSNCo0QjTANRR42q19CXhb1ZnoPVebbdnapat9u5Ku9u1akhdZ3mPH8RI7zk4WIEBoAqSEJZAAZUmhTFiK2ZpShqFQytayTGlIoDOdUijdXuhMH7Nkpm+mdBvaTnjT6fRNsTz/OfdeSZYsJ+99L/H1uTm6Ouc///n38/83FE35KApF6eOUjFJRyZcRlSq+opLrf5N9Wak4U3xFRsMt9bIMdytw9ysqpeHj4isI9/N6n57j9awPtf7ynXfo44uX+ugtFEVT31n6HbqffpxSUHoqQZ2gqNEtJyiUcrxOIaqjtFXs0OIOLSXDHa1nTlCKM+mMkeNVMlbVmeezFrNJyfpDv1Q8oDDt7uyOxbrxRduOHi3//OlEoZBIdHcvLVEbUIpW0i8aOKpt6QhF6VRUG3WUwn9oag38stB3Uw7KQ/2JBEcLnraFUlfgaMcd7TUdDtzhEAAjHQzuYHDHKRgVwV957BSlhFYBdycope4E1Xb6BKWBSwH3bmj1cNFw74HWABeCexu05tPpTIHN8eTiVeQys+RiC3AZ4df9Exs1M9vN86a9cM1s75jfxWy0XMZs/CfN3o5TO6/c+TT8gebUqVPIduWVeK2IGlh6gFbTv6Li1BisVJ86QXFwhc68DjuLfgc9ML/hzEmA2ECF9IZuwD+GTPc6ZYPPT1JOKkQZSH8InowAlCiJWL/Z5JbDRqjMbC6JuIIb8dl8rjMpz3XmCzne7EYMOsH2R0Zjg+sGY5vmL8rsDQ2kN6YDodjg5GBsy+RFnVMe9E2bLWmwWp2xUqJ/h+ahBxQR3x6Xz2o2O+3OaCk5uKn99ttUMS+sQ0kZln5Hj9N3EXp0UBzVC+uh+hGjQiquIPMn6Vxnieazbtps0tAcBibE+pVmk4Vb5TPDSf5J9CH8mvXmwxZLOO+VWqPLZYTr1036L3kx9Q6t/kr6ncU7rPF+juuLMUysj+P649aZMM8HAjwf/o+mn1CwCgbWM0E/ClRppgap+yUq5DFJ8TXc4MMdvhqic+IOp9Dh0wnbiLePp3ywTSepDniaJxvWARsWg81sgYuHe+OZKhliknPqMDljIuiAu15yZ4PPS5gUTRY+W4Ct1SCjiSkhAWUKDVJZGFUIelkRrfCMgF0LRq4KNr6ECk9mwl4v22/XaBNGZ9DAGK3osDbu5cPsyJrg1gI/nXPoXSHYAEu0GJzYYGHjjLXPa3C2fj2YZNzDAX0Axo+Ykh7GyT1RvIL3tl6vS7n8bn445M3FAtrQmIctpRzrRzx8PGTw9Nq9E3Gg9fdRCt1KvwjIUFMngSPllCxGZIcWsWcUzynYbbTzs5/9DeGLry1Nob+nf0LpyLNK6MPPKvBq8gVGg4DAaSCuuy765Ccvmts6a4oMJOZe3fzBvfd+sHlw86nrei/fvTU2COPcDON8EcbRknFaseCCcZiSDDCG+QIzyc2JgYhpduscHuvq2Nbdl/dedwpGIYMRHqW201Y6T2moFNCBJnUS+jSUgmwigq2Rk61RidKCSBRo22Gb+oH3mALPFBgVo+JUhy78HPNk+3T7k8znLhy45po7vzAyFnvlldjYyBfi994ryIM11E7aAHOpKRdVlVqCTFKKM7TCyEaQQ8DIIH/M7O9femk//CDL3hMn9p4QxnltiUMvUu+D1MDrbhdxzeRzSoEyREmteu02ucrMuQ2DqVLpE3tvT1yIOuwhW6pr++zuO7wYHmShDehmIGPK6DP71qDvlzvRzXvJHCdAXzxBYdxaJf7owNTfIVA/VgyFCmdjpXBC747Z7TG3fqCzc+ByW8xrMHhjtuzwsADzxNJuWkO/DXNVxqPxeDSlJewF4zEs4r99GK09/ITsUkwTVBfwqZe+kzKCzOGpddL32vD32mqUA4U7KAGwNtgzE9kzCu7chEHD0JrIjoZB/iZhKkWdYJL5NTSmOj5bgv4k/DtUQSOKF7YNsOzAtoLUWiNug8EdsUqtNxbzwtUemz8yO3vjhkhkw42zs0fmY7TPlJkrlTbwFgu/oVSay5jK/xxh2Qi+ME7mQBfa6MOwg31N1yYiCdYmaQ3qNF4lbMHp10Eeo9+lM0GzLwc6Pwfcz+tpW7n7qdu7Ztj9119/Pbpqe5vTtPixsAc8zMcAPn3UsDSfHg+vr5nPizu8wnxucb6TxGrwEgzqdVhT41kLhM9AMqm4kkxCpKqEepHZ1zNyYH08nw31O2ZsmUJfMDvX6wsNzicd/bZHyux898WbJv2pDGefsYVsHa7cRDK8YcOGsExxhMAZhX03ApwJaoMEpw2DZauBM4o7olW8nAResFFRAqM6hY0HQaS+DlyCP/XD5+3wKcAtKUyazUn6CJaARFJWmbHg0NBA0tyV3pl457AhPtG1cyobDw34JlL7Sp2bSv6B7uJcZPSC7Nx1weedAS5g9jMde1MhX9Bt3xaKMYmBaHbUItdNleKjKVsmAhvIAu6TsNetQJ1bm2K/ymKnQAohwAaWD/qKHKKIhBBkkBraVmh1p4V+I7YPsARlNUiLFCA7cr4c4vU82iij5bqAfje6af1nyj9Era+sRy373DNuR95x94FHH70E3Vy+B+M9CXg3AYwBaqMEoQ4DpKuBsKoTT4H5hWA9GMKqMjTBhzqyCyadYM/oxD2oYh4wDpTCYZmjkvAuIPyAd20iPzrI62xWu25Qj46W/0ttCVnjM0U2Mrots+Eg95w9mM2ks7KW9tYoGjxyfYvKmp7gc3Pdbj6E7csirMEHtKOlstRmaRUpDHSqZhVB3BEUVgHUDKoYryKow2IEr8IKH6bIKqzQpya4T8GdUeA3IiUI3bhlRmySEcKvLkQSLhYG9RhZh64z6iy6lIw78JSp6HXlInbavyEQHcu5g/1zycwF4/Hk1EW5kUu9F7XbOEcm5vSHeE8HutXgMKcmu3wBWGE2O93lCkxeP7/1tvlIwiPwcwkW7ID90gJniwtT4YWpmshGFaxAQdaCtQxfkhV8OZ9ZI1Ox35QzsZFs+ZvoH4sTUYP8wZmjNxzsP7Jt+Nqb7ttBEVncB3h1Al47ADelKmY5PDxXM18P7uiplVeciDfMoTLKKHIo4PM03higZTCN1Ng0OiOaPoQ3wcwpVI1FFbZ2cpK5I/GpTML2G0OZRMES6fI72M+nk3E2s+ZfjL6YLZzzdq9PpafyrlzIFvcavH3begpbSr5XoykubHHbzB2m7BOxbDARCHLxn7pSIXe73DnGhweTVltikEusscrbPWHeGxpIOWzJAeK/5AAP9nr6EsmpigWR4Ah9USJ9YapKUcEKVQnYCYrytJa+UDZfSMpYopMsKsw0sPqq2VfLMMhOKMsTMBI6u1iiL3YDGx0X6WvHeCw5eXHnyKU+tMnJBoG0BDL7BqavqS5fENNXZqZKX0k3AA1+HLEBaD/4cXpYxLBOiVvoJ/bHsn4tWeU1lAf9nr4B6K+XEtatInyFpRONfa8U9jYxJcjhUxXBhIpoMrjgMyVZvTFoVsDf4DXotvJ/otbyzeiW/zr6JfmXjv6X4D9+EWyW/018EWK16CuWC77Ue9HMXjzzRQDLBxVYVBVZuhIsMFITWJAiF4S/CvQBgNEK4NyGbBIwNHUR4Ocj+jmw5iKgipZzBNl6PUzRRqblYGjfGcHOMYZK8nq1o5EztR723yv1bs5vjXo9aWYucFExtq7gtQbCfpPsCcnrppZ8uajf6zV6PXbTunDWFOmL+NJhfzDmklxxjC/P0hV0iL6DyoOl2w+YwHYfR3zlDNxZyF0P3CnJXQnudIRWaejJEKzQQJd9gtxjObbG+yAqtGI4Ect9GYmqCDMXchpEh6bVcmMx4kj5jezgBd06b9bHruliA72TkUSvKxqdzxev2sSn567o696Qs//KabOw+jXde3gnawnxrnBvxKbSObMc45+4dm764FTQrF9rc6UvfuTSSxd2J0NDWzufYWxG/QXqAOHRVvg1Qx+DVg/+nbgvGrwvmhrvrlbXtlU0maYiI7ELp8c6lQNXjOhUBscCeCOLrtR22Dvk7fYO7TPfDj/8vZe+9xjSFDNX8p1XZIoHP08fW7yGyMx5gCMBcJjBkgpVpYUokquQmHGHGUNyEqSIWaTGYEqyX9uh1036sE3rItCZ4S4k8EvF9hItlxgyEi0bQ2ZjVmjnv89vHgh2OKOuNeOhke25n3w7n8508gPXdfcN0Me0oVLKEg+5VfKOiaHseIpBR2PBoPeh8m+2xrjnBV1TALnXDT6zm+qW1qHAYCtq1mHHHXbRQdBJNphdtMgBUlEpqgSVaRbogyFeSyE9f/Vg/4W+WSbPsj0x6wUTbLd1du5I/4H5DBqavWVLkvduN9td+enMJVd57Vt3x+Zvwns9CL/igON2sP66m2JYjCcJnjzAYyWQtYuRlhocxlBBdAFiSD/48tg1c4nE7IGR158N9SdstkR/yEwfC83cOA+Wfvh6S2Z9b89MylS+SMDRThLbOgZ6bqopJGrcoa5CIlhNoLElGZSSbD11xdLGYo54g9DuRF8p/+zsWRQsj9PHjtx++OEjwtz7YW47ofnhpnO34o7Wxrlb6+aumZHdj+f76KMFmOyRI4vCXHGgBRZoga2us4EWPLjDU08LHpEWTgLePaKXbUthomlOHznwhvWCaImnZq/sH9rhnTVnOW8+zExNG/3qXT/17e/vv2I2iYbmbtlcSyZtbQcOlf/GkyakQnx9Cnx9vD9rz2N/cERB2pXWFHbCJAtcflqwWFTYVwc/HTtf+O/AwisL8EMf++MfF69BuvJZ7PfCnBoyZ0USyfEU8hXnFOxPeKRiHyhPS1Y/WEfYyfOZWT1v9k08+ih669FHy8Uj6MEjR8r7j8BcvbAvcpjLROXqIqsrRXilFbXoJG1XIMYXnkMvGlbc/T1DfHYJPWDr2THs6OnqNJ8a50cQd7g8l944EFTbIyChqBFY4xzhwX1N8brKopeDSjAvE3Uy3gNJO7eKURIZicNgzOt5Iy8zsjKVmR15SPbNJ7/1P7949+RD9LHyfyB1+ePyIWTc81W87/sAPi/Ap6BiTeETCbiCFzI+cMG+BeQvrwORflbwTQeJD30MpHBzHnfhDpegWQw4xlOxPDD8LtGHwxxoITugI6vxIL4f4R3GupXVIjaFWLfMhdjBhSGLzNK/cL1cqZSBpz2YzchlSqX8WvrYL7Zt+8XiNT92zMzP2F/9/OdftcON48cYziFRFhmr3mZDtL+W1nE0Sg14lqQPjkW1nMa6B7yfSjSsQ5RMOH6OYTYyfBL1YahlHOtGAOzQw3d3yRW6e8QGNuPUfZ2f6gYo0ei9+SM9v4CZQkCnWZAfRpABubrIR8cKnosU0cGxHUFSKFYJLKN4z4WjodDohT1SyxeLPFztqS03r19/08ZEYtNNM+tv3pK65eDFF1155UUXHwSYMJ8WAF8a2JOxpjsrGhEEY+1wI1Bme0rYTXNFq1jqtYqZlVTxxG9zO0bDkTUXdG5f+Nn1xV5gHHNmtrd7Pm//RzS3l49+m9gwgaVpegRwpAbLshL5EuPPVXhMuMMkUBoHO6gllObUSXLEJPK24I0HsDVDcCS44UZBqnLL/SripBdQpLOnp5Pv7f2lPu1Jrx9Ma7fsDY3s7u3ZPRLaOasfZrUONW3DyMNIXJxobbcnB0O25++SEHzrsy7W0aKQznxAWwEnM9WIjmh+raSjTwIdtFMdBLdtKWktOFCuEjEsBNZxFMxC6FDArZFjsXAU12H8u3FA7/h3b5pa+EXn9tHwQOcC2n1hOrT4qw8/pI+ZUtM94zuY8h8Ba1mgRw5wnarqBQsGxlIDXRx3xGvjTUr4p4XAaBGtspNgXVuoeF2UKYWSslytZsMb4EHVKNOdwc0xPqWxB63zDj7EsP1bcsUDiXX+oWgsVUzNDK7zD+zsG7o193V3yO/SWvTa1kCbN9YdCI/l3PHoDpvD43S79X7r/GhkbcGXShE55QGcdxOc83Xx1uqaxGABEcHYykcEuwohAo31DPsv36Lt33qQ1h05snhWOtP6HdGh+uq4q3CJZEtLGgxkqkB8erjBjk5uYCGeSiXuPXj9oetAVuzuLZV60RPlqz51552fIvOBZ0mvhfk6VpmvasnXzifoCKMbMXwJFUBTsNrHprWMRq61aqYefutlmO50/pI8/KA0NtixnKboeZjLV5XtDTKzGh89BZwouXfeCp9pxTi+6TTuPUExtVCAfGdq4Kk4Fqz8YTOikazF2JLYGmsxtMhpRBuPzR6PKNtomaxVyT0C0D4dnYvCz9e+Fp6PRjdE0PbFa37gGXS5Bj0/EPbGAPCvAfht1I6me27FHVaByyi4oYmWVYp3wlmE+vRJEuehxVgFXhWO7Ak9sB6ZtAxYECjg6jpOv/p0v9qqlbeb1T2Pv/qNp8Y0Vo283do+8gU0g/oOM7zHwzOHy2+UTxy18243bz9KEY9TkA9asNDOoatWFsUqHCwV2G4ZaGb2X370+JDGrZXr3Nqh4z968Ax66QuhcY4bD32hvP4MnrsL5maJ3VyJwcvwyLKaqaqWibTLFLFDajmmgHAsDYHF0IWy5Q/Rd8v/A+XK5q3oxOGt5bWC7fDu0l50ln6LyMFTmFJFrxufA9FwR+xuYt29i7ivf738d/Rb04sD083OT0Q+IOcnNI4r8IidwOcn9NsfH8ffuRzmu78yHyWejZ/CGp6cPIEeJcaeL4c8ryGu/HcT9F9Of/zUNH5yEzLQNP044CW0Et/R5NiaEklEYG0jtliACD667vM3JBPyRPIG+vHyNYSTEVVcuoB2Ln0X41WERYTA7MvRzrI3Tw7NEXUfXUI30z8jZ1I8w9738NZ99M+eEXIHcAySQR+TeMunqOUGraqyW+JRQdWwNOIOo0ApCnhUCEEqQGlrK8E3fFDgE4OULeJprhm+pCXPYmc7IGy1Dgf6iLEsHMBWojgWs74SHilIkQ9ZX2DmyBY5zwfWRjv5awf2Hjqkloe2pUPFKHNP0OvrsRfGo/q7o/1xh8Ifspl3u0JXXl3+oMvFMZF8zMo4THMyjdkJax+HtUfoN0G/+KjbpbUr8cqUNWuvJYna+H0VGaJiE61sJYnVY97WUUoxao/TKohVKlpbOJcCu3L4Tiaiifg9dbF7nCwhKj3WrxpfkLvWBpLreGegOBVlRz3y9oML5oQp0rU9laDffGHa4Q4M7uge2DMa8Hvz9xi0o1OfTsL+D8M6A7DHzoY4g2oFGSZsiBCfxzFVfWVriLYVLcKa4NRwamZvd+8u70ihMLB+qsQN2YuJK/jePeuifyhdOMSGXNu5ycHBSadxR4hlhy4U6C4FMOkI7tkq7hugEg3YKu4NuMNQg/taC6cFZ30Q3GvgGcETNlQwrqnEeVp00jmcooJ7aX0cdjzraY6QZApH1mI9dsXCIbXMOR5KTRXcj2STtqjJFLFEev/Qt3s44LJOPbs4zDsCgeHd/RMjZtu7Bu0IWS+O9fjJHrDVaMIqu3AKngNZTTShtAsCvN4aeAWrzCeYl+J2BIUwaCE2viPbvaXHLafLr7TMFvx9vnR0b7Znz0QMXZrkw6U2AnFgYDNvCrR2ZfT6LQ4PO7z7mmhnMi3ovjliJ7wLAG2ilofVtPW+r2pFHxTzuOAQa0VHTVsJW2D5hjCkLsSbiaufK0gmHZ3IFNKJ559fuP12e36+J7bOSw8ZownNwfLt6KYrlB2xiYJXpybxwM6lBF0EvGrBY15PvSLB6cdQ+GvAEo8Tqh0B3BGo6RjAHQOUop74yEoGKsEDbCB3iMlO2HkqCAcNZ16nRomsy0ArHHNlxFSooBhWhDl1OIyN7/xwt45sJCN5DjHkx4koqk7hUCZfPZthAEGSacvhVA5LLxLyU/B+G2v8tBeGe4sT8VjJwWqMukNTJrfP7gixPVPRZODdS1o13sK6mDegVofjF1x0WXTyyuH0hqL/V55EwuOJxUpOF2u3amWydibQF5J3hL22rEFuGIwnhhNM+z41a4qVIqa2Fl27ydAzzA2lHFpPGu2LRMLkB+hlHOjFSXj6EqqZ8BT1vmoF4dlgeWJp2iL6LC0VHpBVY59YXsoENaEXqF7Pji+0aNlIxjk/teCNuBP2BRCMuzQOc/v+neUfIk82abeXvybIoBkg8lP0b8lJfG8dxKoVsgUEj7R6aqw8A/IHGwk+TL7BmvyGGbRt4R3UFisUYnChs2UduumNdCTC85FImswdXSqSubG/Pth0btGbUGArSVPJwDBUIDABBHYBAlFjiOqiARxzbutwcp035s5Yctwy0JKJuVLQqL1c08bn0SVVKBE1Sfj/TWDYK+ribKtox2Vh4foYFA2PtosxKIpqWRaDwt5SmxQlwvmCYASrzOzkgvy1P3vje39621rYyfK+73y/fOa7U0LssURyWd4EeZSjzq2sJU9XiioIWJOOWWTYcdKzJcR2MC6tPsT4TH5/iNm56376zcUlxmNsUbXuV7ap5FftQnfC3AHATR/IHS/1xaaWg4iKBmSpVvB8VlDDtekMIva8YnSEFuNd7ZXMnNZK5EtZSYOjRT2HMYrNdyxaJbNKjw0KocFcE7hSLddkYr5EqyYX7ey52+kwftKlManvRmdLnlgk7E9tXFd+Cs0m0+WX4bfVWn5Z0BGE5wEPpirPN7OgVCuEWFaMminFzCK8Em1lJYblK1nG82ABejd0zU+LLI/ODnmTjfyObY4IwLosRtagg2ujuUxF67rqtK4ge6WzdQxHKjq2PZPZPhaV2kd48Q8xg8DyKUnt4CQ2iDB7gQ06TmAyw95W7CDxUKEKk+g+qVawv5dLKYVgkLcSg1wwt1sr5rZAH0bxhEagGXedXcFgZ0lAsbRMrsYE/Qds/Linw8mJTgc2Qke6FOaEMYoNUO6z9JezDjYwBBboxaOB/MWi/YnxPk7rYI2r23oiDaia23qiZlAst/W0K9h62vOy9XgS/C80s/Wig8TAVtrXsCvZem4fv7jlc5M2b52th8/sKWJvG6j5ppK9gUmWM7peZHRlJUCMWUBXx8xC6AsY4JpD7bLg3qIvYnEzQWdyqxdYYH9fb1vbYZUqP1wuC7yK8ywwr9bE5EQ6Up0jJie4d0YRvycBt8a6mFyIa4zIuWlGyicJcdfHNmf5+Nqirz/r8fZuzA1dwQ35x7kUZ/Kn7MGhrNvbt704/Kn0Yw6vxcS49K02Nun294SZmG2LyWEyqg2aDlWbzZ/2+ntitjg+c8/AekL0NUDNOLaEnc+VmaVW3FQjDDJdNQcVRz5NIqpJpK4fCbmiyxyd3FduusN4w49+lM270ha7bzbdO8dbsEF6xx0Hv9Kdamv5RJve270+I+mmDnS2Vi6K9mQDEzcQhWyFeL0gF41N5aJPdFpCJAxIoNbzdAcIRt/6/MbJBXfUGbMvjIUS+3eibPmfs0mrD62RYpoAZwdVbEqrDYDXBwcJTVZDRKznwel2i1quNrdP3/Pas+jsv4YmOW4y9K9lHVWJCcKcPuCU855T3ERV80zyavmCkADtE5ElhNqc0MMIobYaWGuhrgkd3u9WqBQyRVuL5zKfql0hVygV7k9PPedUtCrkMlWL4xl09ufB8VBogn3qKdyOB39e1j3NjoUdI/zTZI1BWGMW1mir7r8Yf1tF4jWEWaq66CTOY6JsIh8K0TKj6IqQM1OuZi0qpmYx7/3Z47za2SFvM7fFjz/5wuPdGpdGrraqM8cR/dv15pjZHDetX/pozhw3m2OWOUwTSyW6F2B3UtvrcuAaxFWD66pYkZitoiOIY6AqEhUBTYOJtB8tCy4SM4wr7DCaYpn2tvcf2KCxtsvbrOq1f/KWIZofS1lCOvu4MuCyo5/+mF3HBdcFf1xWp8ZSVoXigJQPTtEugL0x9qj6v4w9smLscQ2Sf4C+Wv4YtZcjMyh5cLr83kFhrk+IsccCFaNOUTz0dJJYIGhXkJP4Ti1Gs0+C29dGzgJh3Z1CMgSXw8m+JLe8F5nFw/lKsiwRn6Q/9CuZXNbuzYXDOW873G7bPRXxhC2timQ+n1S0WsKeyNTubW2OKMdZO+zmDrQJdZjtHUyYi9ln+6aVOoc5PJ3o5lvlrXx3cjJiduiU030Y/g+XlOgK8EFkJOcdx0tJfQEoxQ9vu43+7cdWMd75b5U1Ei1CVgZ6AHgN3+EzsjBZYzu0nLBGIZuz4sXmheyPnFhWQVSDWSPDLSwVPnjAw1la5XhF8lYLR1YkU+BVRyJ41Qq86gm8lMhkUlxKYjosLGXWHuPCTM3SrRwXdcDSKbIj/wq6+DmAlQP4QaOBDMFQg/wEEsDRFZmY96uVThYE26dG7mMd2+mdT3mSHGs2hzRbpHsTLieZHrY6reFoRGxJXdgcuh/0LPYrnSvFVHEZmBynzDNswcgXhFMb4qyhA8vrwCJHjyJ7be7Z7qX3aTV9H9BtgLqAWs57ahw28okkJ2yRVzxKEUicSuG0YsHdUqaqsYyOFHZkcVoRRgGWpOkMIoEGDzSkKEompKeRUihViNOXUAEVAoEg+zeuEf9sZqbL4+2ZTs1y/ZZht8Mc0KKXdAOJxKB21OZS7NqlDA9uyec29UdaLtwhdzHbrLLyWbmxHccmYVEh+k4qWs3lEtViNfNTFJyVzGI1WRSqnMjKTldtE+Ek3YvLhKBlTwuZ/LjghwNTr1LcUz01lIIrwHd0qOzqHJIdmG9R+4vz2dJWdsYUd6ULLYpnH0DI5jpyZLtpJt+h2aQwhU2pyZwryq03m5NpQ8CwXaVRBTodcuGcmeqnO+kNYHdGySmBX8xWFeRBmMTo+xHhDq7AwLbjehfC+oyKlCJxKmONYxGY9et169duTec7s1vXzvoN+rm125hOeyG57fJsIJDF12fmkoPegmVuYpvNtm1iLjHgKzBzE9vb263bkTqRyyXgqjnDPAwW3P463auuz2lSN4n2Sy6FgjCOFJjAkS7rGaxrpQCFWUzpcWKmqhHy2K4ieVA4Cwlfstf6NE6tHPRS38IXP/Pcc88tPPvss5/5In34qG/ICz9Hy/+wprBmYQF+oSDgtyq3VADMSXIGI4sJGS6SBGPAPQQphuVYeWJ/uQe9LfiAY0sv0Hr6FdBDg9QM7E2M6GopT1NP5FgSevTEtzBCb4zcuaBXsL5cOqF+ows+TZKeLilvCYs1IdNaWaitKqyeSxcsNYWFRDJiYvyWly+5At5snzv4j0yXIx/uG+sLxyLqdlt6PFX4hH+eL3pcXO9oLxcPabQ7NvZc4EWzVp/DprOEoLFqLU+YnJzB4fAmBhLxQasuxPh7otZIbB1vNRqddndiIBUaZvRh+8jGiJXg4QAol1/SfwsUyVCUsSZWxNfc/wUbj7NsLPZ1uFi4p3sTfl8i4fMnpJbEYI1L/0mPgkzCNUWjDflr6hU9a1vFJ2PJXQLIprNSsjd4Gie8V/PXaj3uakUR1plMPT/XyG1jYurS7u5LpxJSO+AB6zyzvtsjtV3OdL+fy5kKakYT5EI+o0OTYgq+UH/Sjkanb9yYSGy8cXr68OZkcvPh6dIefMq5p9S3ZywUGttTio9lHS5Tn7qjL8EXO9QjRsbJr8W4PU59jL5NbwSJ7AfcwkZX85ItLiQZ6pUDLXT8gstkOVPSFvRNhgcnNqpoC+9Id+8x63Wu9nwE7cr1tMW0mmGTde30SZ+B6clqtJr2nMqO88ZjlA3snZ8YOOoHYl3wD8S6YLE2Dt2Mcwgp4URULp6I4iPKNej7+8tPoJvL/+vEqnVrcuoSkPUf0d8j+5sDjuiD0Uxi9reQ5+smd3mc90Fks5vU1p6gsjqhJgFnynRCmyHZMvV5RtXdxAYBJ1bagQ0LMqIgpd2iWGQ87/HkxyNS68lxZjOX83g7cduZ2coCO0aLblfPtE6r1ZpRwZ2fiMcn8m6pzVjCXSzbhUtfhXbR69e7WqaKxT16tVqL4X+SXo9eo1+U8PAkMpV/Tb+4g/DMY+he9Cb9FRI/wnK9rWLnSdhYaXU1WVQJd45jGC7nhtZiwW0wiC90L8DvrV3PmojPG4l4fREp10eoccSnHA1n9YJZQ1WMGfkZoZXSHFtOC4dfwrmL+szyYkgVrFIsiHyJbHpo75e/vPeu/F6Bhh5HJ9DL9MdESojFadLZLOwRb/a9CGAzFovLXnINRIprsp4LwFT+N1M46O0wWtguV6CHZwdcpC70afQCegXGisJYlbKlFevFqgLzh7qEWW9jQy6vyaj3a6PMSMQW8xqtbtZjDmQcnjUsbVUbNFq9oaAxtGt1rSWDtYPxmRw+dVvIaQnatTo7nvvv6RJ6VzgDR2yBR6P7tj5Ml54R48hFeh34DBx1kBLqyVf2SRvCcg3h21oHzitmvWPd0SpW+rmWHY5LEc2Kv44tYgvfgwQBFhIFBQeqky0tsH5XmnmQlslok1ahUho6gtZMd4fcVAqaghokVz6Ezpb/OR/1x1A2vnvHvIcx0FcoVOlkPNGqK15cADpKL71E8mZllA40XLPMH1FKQwdQM85ClAoQehE68sADneHM5qFQaHBTJkofWwwgs6t3c3f/xpxFrG+hfo2eQO8bVDiERf2B4PedJRbdDnIEeoK8uLd4t3HUCKk2mexeV3ogoA6kbH55qoX12IP2DrpXbjJ1mFvw998CGvwUfRb4DfYOvCYctkPmWaPTamnfsI8+NiBTtqhbyt/BvHIUZO9fg+zFPEoZVwnXHnWkij5fMeWQ2k+4vF4XvtCXIwMJhkkMRCIDcYaJQ5vJRKLpNF5fEeRtksjbH4ry9oeivMXWPkXP0keIHYJzfdiaiv4cTj9lBKOnAKxXWYheqtkvKuV+34/4nU8c+jRfXiOtrlKZX9ZaLi71DvX18d95HX2uumQBr/SYOK8Hc1dl1hU5VtYw9Xsr8PCDDRAsvtPA1bS1CogCVoxzlu+qrH94tfWfrwCwSkAO1eBncfGcYmFlxAXPLSto6rKlNej3Yk5MfQ2SSipt0S+rQXKBVA1aNPK6gGFnSc4tc+9uUeg8pAjJm2ZmlxchdcVjXV2xeNdH/s6o3+szeLx200QkawqXGmuQZEI9jixPcn/MQl6PsaGo5u7HZq/d31BXI8sfKq9vKK1pHBPLSVljoc6ma2cf290wKP2NQ4t/u0K9jjQmlgc2gLPAY72uaoT1jt337/5kTp67YaWhD/X1NYAsjT0GuslH4eJv0VVnqw48r0ErrGCfye+ytXeYFOtailzNfaBx6r/Q6DUm2+iw2JRnGvEmF+EYJ7Y0gaSZPd0Iy7sejvPA9YzYDjSC8EbY7Q7XXuW5BiAkGG6qwoBq5q01Qhoxj+J8qcTjS88wer3VuqERiNeJBwlXgTGZGHyV3XVQ0EuLAMMG0C9KykJd2rRGrBp9azgxFgJMQvTCKIZqBNsFVQ5zVJVUelJIphcqs8HHx6vxia4lKsg6nO1OdKD8wXWJR95DRz573XVIhSyZHbEdf3LkoYfoY0duPfKIkJfDkhosPZVeQTvJVqmuQp2bTDafKzPAqtmU1f/jVYqtGrQaurdZ9RWGidQ8ET7UCpytqilWegJ4+mS1YAmYOSuULNV9D3OvouZ7aD/wbfnGmlKnbxx6Tip2qn4Xe9QSl2pRzfePi/z54rIRgDHF6WFWYQyBD9jmXFAL1U/q6L98vGb4BspPV+ElNUC1OJLVFPJguXdCKuYBDC1+QyroafwusQZrvkvkW/mI9G0s19ZUvl39bi2eVLVzS3Ls+ZoRAEtVEGTiGOfEUy1U9XKi/Fhl+AYsLf5lDbw0PocAntSBVNjQtFqq6pnXOhPaSs6NvJJTgB0Ll+hYeISs9oJ+pUo/ssNjo6OvrMH1fus/OXyyWu+3bx9KDCmQtaHq78/GXgOISZ0NkeuxZlJdsUKZDPpkE7lefq6ugKZOqvMN9TQyoZ6G0IiwR1i/ruLaYYqLNqmRwQSYb14n0zAX0buruZGYQp9sMhlQ28ffaD4Z0cnSfMKbp6o6eZU5JaouNJ8WE/kqy6zMK+xroam+Xm3lzTT3pc3AqtvpxVxzAOUifAJfEgib6vFVYKzn1NuagdbIt12r7hui5qkDtJxmAb4IJWR54KhnG7RC/gMO5yOxhgefbMsrb1QSXqc0f++9a++7by35ffK++yfuh5/74DfeG/fS+/Qw/TVQzDqweW+SJEUIC4ZQjaSoergn4Umb+I41nXjAYKuc87VUPmsRc5VClaziFp3w3jgsQxynhW+7xTevhE9LNZOdoRQScMpUCns4cCUqWZEF5jf2IF+k6ZAzwheVqGizY/zO9fLTAw4Xvt3Yn5t+wHPwYr1Psz9w5UXxAOKi+4YwZuNrsztiV6/ByE5PZQFmUoNDeFC0plUNZTWYx/+qWlqDNW99cU3dOEQHN4wjaJira4p0QBM3lOnUjKWqsZy1qGE8iTe/tmxErJkbBpWJYwo0voql2gh1gwZ6oGa6Rk290npITQrBjVHAjRotrywhmPn18vISrIC/VFdiAmPhQGue6DXrKjXqtXpNL+ZTCxrOIkRCwROtqScsiPWEaxe2NxQUXmzGOmpD3n747F4+8hbmR1w70Uu/C/Nvq4t5V/MPu3FHd421W33rIk5QxqyihS/4xRMVIQiOX1ngoDqFbIUaOSOcJyxL9CRHCdKrc8x6ts/Ztak7PZ5kjPDXH/EzlvhgLNrvzzBRbLjjHqPF6LRFQgvo35Lre32uVJ83kOF8RjD8HUE+4C/G7UbDHm0HYzI6rXZ/0ueOh2MuO1vky/bqe2sYEkvzUQnR+jqvyo1HHt6675/Op3qD/tkz5clzVnCsAAux5s4LFjS1b+vD5f3nBU3pmcWnzwlNFRYVbF9GwAuu4Dg/3Pz+yJ59wMT7Np4nfnbtOg8MSTD9ELgkj+0q4zJdKx1unyeIn2ktJQ0em0WtM6nWwb3Rbbe04fvJ84K5f+0anUnHuMbH9EY94y6vO/cGy0X4hXOqHK4Ub2otn9cS3qk70SrfcF6gN5x7lWfOCbwE+9kq7M188vNDP+qs+OlWK/bTf35esAcKqVSBXHaz2Y6vcuo8WAtHiQH+WfQxeMbd1Cj1dF2V8Sp5bKLVIFshq1B4R47w7iYcZ4oTwSdLCbXISiL8dNjiEN/RKlRJnQRdJfXhk/48sSPicFes1AQMi7md+WWYZKoxRbamTEZ65WeQHDwptciEP0qiFNIg3VVXy2wuU7e9M7o+Fi/o7T3xUA9nUtA/bUmz5qAp6xr35sfs3LDfz7MG9H1Fu0lrCyreS2p8GqWSRpnY3VMbLGzAoNttc4d9wUBocHPG5G/j+XbNTsYaZSMBa7jwhjng1GU6P5vW63Wc0ayOCDpyeIkluaN6KrlaPKKxCgsllwXSv9W0KKsxGDGyYpmWTKhZIrLVS/wEUc6vWnb0GIj4X52z9AjL95OrlB81zC3J9VXnRnNYpF947tlLz5SNqxY/VedXUQHshdbK8lVh+KMoxnefDw5Ahp9cFQ65CIcg/zqp3tXl36qQfa9e9F11bhAb5d6bq8Ir1NQ8T/atVYpd4eKYN4AsPsJFMbDqaVwNIz37e+lZIV6Fn0VX423cSp4uPfMfwtPS838ke9IBd+KOCOMjh4j3veIku3aJ08Do8D3aLOLQtVpcCo/063o0XUpGbMDEuipcKZKH/AHIrc7q21rE19VpV/CchNo+4d1Ytsr7EUPwtK0i9QRJqK/06cUTddxmoY3jzCZQIUX8Ki0x29oouUnVdyUmEXaZiLUI/hKKd/Yhe5c332/0xm8fmGEHdxX5bcPhQGkmHhiyajLsQ6FDMX4gtNZ/V2jf5LpWfYvL1lN0J9w69O/FL11dvHQi6i9tLeTnezx2V2Ktd91g0cls1Ueso4O4loHUf2FbI9HU0lCtVL9xfzPDor6wo96GmFmhzkMm1HkQuqrEbmSrnATieugPmhZvEFHVrICjYa7lcqpxLnLuXL60+WxYNDUtF6mZT4rdNMilxjl/K7LG9tXWiEXRuefFexvH9f2r2JHNwLi12SbPNYer3mR8vTmIICsFGP/23PGb1XaoPuepfLA5eCuIx9VwuIZaSxvodQQ+B/gI1UxhIeuJOiPUFOI0TC205jM4n6Qm7FTzNkMZDunH2WSShesa8huuh0gGx8sxvz+Gr/LPhDaG2vaSPfwF4EfdJMaj+n+I8YRE6fT/IcYTbBLjOWv387xMHrBBo0Julw9vw2R/vJB0CrelROGweXZQ79YMmmYHWduvfVsKGPvhXLTLK9xy+RiW06Qmg/CqVYzorlQ0cQzEwWJd3QQwyOJf1RdPUA1jYu5fcUw0BGw/Vj8ouJWOxkGrY6pw0YLE4WilcT8UWRt9uhHgXbsaQZaJYws8Em/OISuu4o061pivn7SBHxa/vdL6SH2BaNsJErN5KQCaxALzntUKAgCPH/9186IAscaO1CUHqvVny96UvmJlsph2rFihIA1HX1vE+jMzdLVUauyEisFqJRo+svRXch0DQo0dPtKpe9MDkxPeSSvka/zDwoLcPRZKTvDOYHEqHCzaZaak0cQ6dPF0MnFCdu1XJh1uqdLOw8z+uUGrDxRCw8NJLGcE/Eo2Y3Mp2Bzrb9cLweOrbkDjvt/UdD+WlqjvIj/6U/p1g5J6h8S1b6X70ftEtzTTK011R72GIOOtp96hW1BefC/KsjfB+NajE+VxlL+KIsfL79AjTZ4z0enF0+JzJwDee2jyVnESd1eTLGOcGV+VxzifF92TK8jb1GE+H+3q27yF3mcdScsy0WRhfnLuprAQwxfXLv4/DXL8fgE8Y75QTRLBFvx3L1epWyMwUHdx0xZ0IHWBLAvjbFwnjAM47ER+0CWvGzjqbTEP6W0hDwk+WwOfBchn74ifvVP9bMlOB6iXhc8W/yB8tijkad1FXYJOo2dw7j2FzxWE/0MiWHfYAVqnGLfZ4kVWbC+xxntYf2/cao33+tmeOGyjbGkJ5MxW6s/FM85xaqXXZS5/T+sKZV2tlbcu4FdAOUBtcDUqsNDkHmWj0Sy+3mu4mY8UCpEVLmFvvkrZ0KPoJ2B7C//fhpKsv5Ajxydffb50yy2lVx84XnjhBfH5v4Tnn615XiHgiyswZhWH+m8pPf986eMXCsfhO+T5BOBkjL6TylTr6cWaNXV9pS+RMWGQFzKwDcKAhpggTU7jfwn1KgFRwwbEulbh/VhMpd4Vx0SSwjuGxXfSsblCqBM8hgLcLCsg5c0+sxMJlRCY9eixyJ4+fstYtn2ggFBhwPbwfn5XcJbp9PJDmsXy/0H/9CPdUIbNM+sTKVf3xq5RuapdBT8jigM3hkMzRmupe8LcolGtK/Q4ScyYXvp39Al6jn4KaMtBzVL4vbancD0ybL309iThXScW0cqwSP9/x2nBHjKeFiwMZSWRFZOEGT6x4jSQ6pse8X8uxLGMGX7lSIIrMl7mN8tN/svm1fJcT16unn9vZnF6N/3UzrGxneW3dx988MGDu3+6efNPKeq/AX/X+HJ42qWSP2vbQBjGH8lOaCmE0ga6HrRDhkSWFIxRBAXbcSFTjA3ZOtjSJTaWfEI6Gzy1dMzX6NIv0K1z136crn1OPpuUUAhUh+5+9/67933vALzETzjYfgPcW3ZwjN+WXTSd15YbeOt8tNzEsfPN8gG67nvLh3jlfrV8hKDxhl5O8zl393UEww5O8Muyi2fOC8sNfHB29k2cOJ8tH+CL88PyId65nywfYep+Rx8KBTYoMccdZtAQCOEj4H+655DURUrbKSR5TI+KthI5V4ErLJFQWzKWmSe1LoVX+2UcAqP9CVW9k1wlbddby74qNuX8bqZF6Af+qZlD0U3VVIrxptIyr8TVMlFlocqJlqknulkmRsahEiNZyXJNIRNTWDFoUqdpiktrGlKmuPY4Z0jHalUmUvRVKsWwVKKnsnSnqzlg6qbwDmIWcEndgPQw+i72NvLZztvaXxuPwPODTty97A3i7YHmPB53Zo6g/Lo3+K+Eb+r+VeyrYv/FX0kPGVn8w8KMmDeheBdJrVnvdR69jTbnHS7obWxuKc0YY8p34KFd/5GJciPLaq6WYlvocCweCHw/nimdqOXa7LyOH+eThVT61svm09Bre+3I95/S0cetqx+R5lO7QItD8zEW9FswRc3kTEk55ZKRM5ZRkf0njQDnLDFCNNO6uGi19KaQi7n2EpW35CqbVC3/8Rech1H0B6VDv6sAeNpd0EdszwEAxfHPr/Pf2nvvveqv1Ka67L33Lq3Rf7X9qz1izxCJG7EuCBIUkeAgYq8YCQdnOw640pSDeJf38n2HlzwxKvSrTGq5Bf7X8woaI1aceAkShSRJVkllVVRVTXU11FRLbXXUVU99DTTUSGNNNNVMcy201EprbbTVTnsddNRJZ12k6CqsW/l2dz2k6amX3vroq5/+Bhgo3SAZMmXJlmOwIYYaZrgRRhpltDHGGme8CSaaZLIppppmuhlmmmW2OeaaF8Q4aattbjjsve322+OI004FsXZ7a4tDQVwQb1+QYKfb3gWJjjrjh+9+OuGc++46b74FDljooVz3PPDUI4898cEiLzwrf+uCxb456LWXXsnzyRe7LJFvqeWWKXBMxAqFihSLKrFSqY9WWWO1tdZb55rjNtpgk80+++p6EPLGRZdccdVlZe7Y4aybbgVJ9iZGC/LD4YzwX88OlZRGUoqjhcXJJXlFubkV8U+XmRaKFPwDUjOz4nKiRZHf12tsNwAAAAH//wACeNpjYGRgYOADYgkGBSDJxMDIwMxwAUiygHkMDIwQDAAZJgEneNp1kL8OAUEQh7+7QyEiFzkXUahEKaHS6C6qK73AuUTFRfypdGpRiqiUCrXSI3ilM7e75EQUuzPzzcxvdhYLKDNggh2MwjHVWbROaFEQTpriiLGwf2InjucLvOkyimmtNosVbcm8s9mt/QJFKnii2KFPSbGusjaBTNUkUdbhwJUHlmJPo1CV0zRae47cuKsKR2m4+J+8RWh6yfXWDNE0izOOIbKJvHwo3o6T6Jy50FN1fq4uq5r8UdDUlh0b4rtfXE+oSH7Lmo36FY86/gvTNBtEAAB42mNgZGBg4GIwYHBjYHJx8wlh4MtJLMljkGJgAYoz/P/PAJJHZjMWZ1alMnCAxVIY4AAAfRoJt3jaY2BkYGDgAGIWBj4GpsyU1Pyi/Nw8BiYXN58QBr6cxJI8BhUGNgYQYGRgAqrkYWD8H8YA0oVVFACnHQlwAAAAAAABAAAAAMbULpkAAAAAzRWgdwAAAADNFhD4);
+font-style:normal;font-weight:700;
+}
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/ga.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/ga.js
new file mode 100644
index 000000000..617289656
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/ga.js
@@ -0,0 +1,67 @@
+(function(){var aa=encodeURIComponent,ba=Infinity,ca=setTimeout,da=isNaN,m=Math,ea=decodeURIComponent;function Ie(a,b){return a.onload=b}function Je(a,b){return a.onerror=b}function ha(a,b){return a.name=b}
+var p="replace",la="floor",ma="charAt",oa="match",pa="port",qa="createElement",g="getTime",u="host",v="toString",y="split",ta="stopPropagation",z="location",va="search",A="protocol",xa="href",ya="apply",n="push",ia="test",ja="slice",ka="load",na="value",q="indexOf",ra="path",r="name",w="length",x="prototype",sa="clientWidth",ua="scope",wa="clientHeight",B="substring",za="navigator",C="join",D="toLowerCase",E;function Aa(a,b){switch(b){case 0:return""+a;case 1:return 1*a;case 2:return!!a;case 3:return 1E3*a}return a}function Ba(a){return"function"==typeof a}function Ca(a){return void 0!=a&&-1<(a.constructor+"")[q]("String")}function F(a,b){return void 0==a||"-"==a&&!b||""==a}function Da(a){if(!a||""==a)return"";for(;a&&-1<" \n\r\t"[q](a[ma](0));)a=a[B](1);for(;a&&-1<" \n\r\t"[q](a[ma](a[w]-1));)a=a[B](0,a[w]-1);return a}function Ea(){return m.round(2147483647*m.random())}function Fa(){}
+function G(a,b){if(aa instanceof Function)return b?encodeURI(a):aa(a);H(68);return escape(a)}function I(a){a=a[y]("+")[C](" ");if(ea instanceof Function)try{return ea(a)}catch(b){H(17)}else H(68);return unescape(a)}var Ga=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,!!d):a.attachEvent&&a.attachEvent("on"+b,c)},Ha=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,!!d):a.detachEvent&&a.detachEvent("on"+b,c)};
+function Ia(a,b){if(a){var c=J[qa]("script");c.type="text/javascript";c.async=!0;c.src=a;c.id=b;var d=J.getElementsByTagName("script")[0];d.parentNode.insertBefore(c,d);return c}}function K(a){return a&&0<a[w]?a[0]:""}function L(a){var b=a?a[w]:0;return 0<b?a[b-1]:""}var Ja=function(){this.prefix="ga.";this.R={}};Ja[x].set=function(a,b){this.R[this.prefix+a]=b};Ja[x].get=function(a){return this.R[this.prefix+a]};Ja[x].contains=function(a){return void 0!==this.get(a)};function Ka(a){0==a[q]("www.")&&(a=a[B](4));return a[D]()}function La(a,b){var c,d={url:a,protocol:"http",host:"",path:"",d:new Ja,anchor:""};if(!a)return d;c=a[q]("://");0<=c&&(d.protocol=a[B](0,c),a=a[B](c+3));c=a[va]("/|\\?|#");if(0<=c)d.host=a[B](0,c)[D](),a=a[B](c);else return d.host=a[D](),d;c=a[q]("#");0<=c&&(d.anchor=a[B](c+1),a=a[B](0,c));c=a[q]("?");0<=c&&(Na(d.d,a[B](c+1)),a=a[B](0,c));d.anchor&&b&&Na(d.d,d.anchor);a&&"/"==a[ma](0)&&(a=a[B](1));d.path=a;return d}
+function Oa(a,b){function c(a){var b=(a.hostname||"")[y](":")[0][D](),c=(a[A]||"")[D](),c=1*a[pa]||("http:"==c?80:"https:"==c?443:"");a=a.pathname||"";0==a[q]("/")||(a="/"+a);return[b,""+c,a]}var d=b||J[qa]("a");d.href=J[z][xa];var e=(d[A]||"")[D](),f=c(d),Be=d[va]||"",k=e+"//"+f[0]+(f[1]?":"+f[1]:"");0==a[q]("//")?a=e+a:0==a[q]("/")?a=k+a:a&&0!=a[q]("?")?0>a[y]("/")[0][q](":")&&(a=k+f[2][B](0,f[2].lastIndexOf("/"))+"/"+a):a=k+f[2]+(a||Be);d.href=a;e=c(d);return{protocol:(d[A]||"")[D](),host:e[0],
+port:e[1],path:e[2],Oa:d[va]||"",url:a||""}}function Na(a,b){function c(b,c){a.contains(b)||a.set(b,[]);a.get(b)[n](c)}for(var d=Da(b)[y]("&"),e=0;e<d[w];e++)if(d[e]){var f=d[e][q]("=");0>f?c(d[e],"1"):c(d[e][B](0,f),d[e][B](f+1))}}function Pa(a,b){if(F(a)||"["==a[ma](0)&&"]"==a[ma](a[w]-1))return"-";var c=J.domain;return a[q](c+(b&&"/"!=b?b:""))==(0==a[q]("http://")?7:0==a[q]("https://")?8:0)?"0":a};var Qa=0;function Ra(a,b,c){1<=Qa||1<=100*m.random()||ld()||(a=["utmt=error","utmerr="+a,"utmwv=5.5.7","utmn="+Ea(),"utmsp=1"],b&&a[n]("api="+b),c&&a[n]("msg="+G(c[B](0,100))),M.w&&a[n]("aip=1"),Sa(a[C]("&")),Qa++)};var Ta=0,Ua={};function N(a){return Va("x"+Ta++,a)}function Va(a,b){Ua[a]=!!b;return a}
+var Wa=N(),Xa=Va("anonymizeIp"),Ya=N(),$a=N(),ab=N(),bb=N(),O=N(),P=N(),cb=N(),db=N(),eb=N(),fb=N(),gb=N(),hb=N(),ib=N(),jb=N(),kb=N(),lb=N(),nb=N(),ob=N(),pb=N(),qb=N(),rb=N(),sb=N(),tb=N(),ub=N(),vb=N(),wb=N(),xb=N(),yb=N(),zb=N(),Ab=N(),Bb=N(),Cb=N(),Db=N(),Eb=N(),Fb=N(!0),Gb=Va("currencyCode"),Hb=Va("page"),Ib=Va("title"),Jb=N(),Kb=N(),Lb=N(),Mb=N(),Nb=N(),Ob=N(),Pb=N(),Qb=N(),Rb=N(),Q=N(!0),Sb=N(!0),Tb=N(!0),Ub=N(!0),Vb=N(!0),Wb=N(!0),Zb=N(!0),$b=N(!0),ac=N(!0),bc=N(!0),cc=N(!0),R=N(!0),dc=N(!0),
+ec=N(!0),fc=N(!0),gc=N(!0),hc=N(!0),ic=N(!0),jc=N(!0),S=N(!0),kc=N(!0),lc=N(!0),mc=N(!0),nc=N(!0),oc=N(!0),pc=N(!0),qc=N(!0),rc=Va("campaignParams"),sc=N(),tc=Va("hitCallback"),uc=N();N();var vc=N(),wc=N(),xc=N(),yc=N(),zc=N(),Ac=N(),Bc=N(),Cc=N(),Dc=N(),Ec=N(),Fc=N(),Gc=N(),Hc=N(),Ic=N();N();var Mc=N(),Nc=N(),Yb=N(),Jc=N(),Kc=N(),Lc=Va("gatCookieName"),Cd=Va("displayFeatures"),Oc=N(),of=Va("gtmid"),Oe=Va("uaName"),Pe=Va("uaDomain"),Qe=Va("uaPath");var Re=function(){function a(a,c,d){T($[x],a,c,d)}a("_createTracker",$[x].r,55);a("_getTracker",$[x].oa,0);a("_getTrackerByName",$[x].u,51);a("_getTrackers",$[x].pa,130);a("_anonymizeIp",$[x].aa,16);a("_forceSSL",$[x].la,125);a("_getPlugin",Pc,120)},Se=function(){function a(a,c,d){T(U[x],a,c,d)}Qc("_getName",$a,58);Qc("_getAccount",Wa,64);Qc("_visitCode",Q,54);Qc("_getClientInfo",ib,53,1);Qc("_getDetectTitle",lb,56,1);Qc("_getDetectFlash",jb,65,1);Qc("_getLocalGifPath",wb,57);Qc("_getServiceMode",
+xb,59);V("_setClientInfo",ib,66,2);V("_setAccount",Wa,3);V("_setNamespace",Ya,48);V("_setAllowLinker",fb,11,2);V("_setDetectFlash",jb,61,2);V("_setDetectTitle",lb,62,2);V("_setLocalGifPath",wb,46,0);V("_setLocalServerMode",xb,92,void 0,0);V("_setRemoteServerMode",xb,63,void 0,1);V("_setLocalRemoteServerMode",xb,47,void 0,2);V("_setSampleRate",vb,45,1);V("_setCampaignTrack",kb,36,2);V("_setAllowAnchor",gb,7,2);V("_setCampNameKey",ob,41);V("_setCampContentKey",tb,38);V("_setCampIdKey",nb,39);V("_setCampMediumKey",
+rb,40);V("_setCampNOKey",ub,42);V("_setCampSourceKey",qb,43);V("_setCampTermKey",sb,44);V("_setCampCIdKey",pb,37);V("_setCookiePath",P,9,0);V("_setMaxCustomVariables",yb,0,1);V("_setVisitorCookieTimeout",cb,28,1);V("_setSessionCookieTimeout",db,26,1);V("_setCampaignCookieTimeout",eb,29,1);V("_setReferrerOverride",Jb,49);V("_setSiteSpeedSampleRate",Dc,132);a("_trackPageview",U[x].Fa,1);a("_trackEvent",U[x].F,4);a("_trackPageLoadTime",U[x].Ea,100);a("_trackSocial",U[x].Ga,104);a("_trackTrans",U[x].Ia,
+18);a("_sendXEvent",U[x].t,78);a("_createEventTracker",U[x].ia,74);a("_getVersion",U[x].qa,60);a("_setDomainName",U[x].B,6);a("_setAllowHash",U[x].va,8);a("_getLinkerUrl",U[x].na,52);a("_link",U[x].link,101);a("_linkByPost",U[x].ua,102);a("_setTrans",U[x].za,20);a("_addTrans",U[x].$,21);a("_addItem",U[x].Y,19);a("_clearTrans",U[x].ea,105);a("_setTransactionDelim",U[x].Aa,82);a("_setCustomVar",U[x].wa,10);a("_deleteCustomVar",U[x].ka,35);a("_getVisitorCustomVar",U[x].ra,50);a("_setXKey",U[x].Ca,83);
+a("_setXValue",U[x].Da,84);a("_getXKey",U[x].sa,76);a("_getXValue",U[x].ta,77);a("_clearXKey",U[x].fa,72);a("_clearXValue",U[x].ga,73);a("_createXObj",U[x].ja,75);a("_addIgnoredOrganic",U[x].W,15);a("_clearIgnoredOrganic",U[x].ba,97);a("_addIgnoredRef",U[x].X,31);a("_clearIgnoredRef",U[x].ca,32);a("_addOrganic",U[x].Z,14);a("_clearOrganic",U[x].da,70);a("_cookiePathCopy",U[x].ha,30);a("_get",U[x].ma,106);a("_set",U[x].xa,107);a("_addEventListener",U[x].addEventListener,108);a("_removeEventListener",
+U[x].removeEventListener,109);a("_addDevId",U[x].V);a("_getPlugin",Pc,122);a("_setPageGroup",U[x].ya,126);a("_trackTiming",U[x].Ha,124);a("_initData",U[x].v,2);a("_setVar",U[x].Ba,22);V("_setSessionTimeout",db,27,3);V("_setCookieTimeout",eb,25,3);V("_setCookiePersistence",cb,24,1);a("_setAutoTrackOutbound",Fa,79);a("_setTrackOutboundSubdomains",Fa,81);a("_setHrefExamineLimit",Fa,80)};function Pc(a){var b=this.plugins_;if(b)return b.get(a)}
+var T=function(a,b,c,d){a[b]=function(){try{return void 0!=d&&H(d),c[ya](this,arguments)}catch(a){throw Ra("exc",b,a&&a[r]),a;}}},Qc=function(a,b,c,d){U[x][a]=function(){try{return H(c),Aa(this.a.get(b),d)}catch(e){throw Ra("exc",a,e&&e[r]),e;}}},V=function(a,b,c,d,e){U[x][a]=function(f){try{H(c),void 0==e?this.a.set(b,Aa(f,d)):this.a.set(b,e)}catch(Be){throw Ra("exc",a,Be&&Be[r]),Be;}}},Te=function(a,b){return{type:b,target:a,stopPropagation:function(){throw"aborted";}}};var Rc=new RegExp(/(^|\.)doubleclick\.net$/i),Sc=function(a,b){return Rc[ia](J[z].hostname)?!0:"/"!==b?!1:0!=a[q]("www.google.")&&0!=a[q](".google.")&&0!=a[q]("google.")||-1<a[q]("google.org")?!1:!0},Tc=function(a){var b=a.get(bb),c=a.c(P,"/");Sc(b,c)&&a[ta]()};var Zc=function(){var a={},b={},c=new Uc;this.g=function(a,b){c.add(a,b)};var d=new Uc;this.e=function(a,b){d.add(a,b)};var e=!1,f=!1,Be=!0;this.T=function(){e=!0};this.j=function(a){this[ka]();this.set(sc,a,!0);a=new Vc(this);e=!1;d.cb(this);e=!0;b={};this.n();a.Ja()};this.load=function(){e&&(e=!1,this.Ka(),Wc(this),f||(f=!0,c.cb(this),Xc(this),Wc(this)),e=!0)};this.n=function(){if(e)if(f)e=!1,Xc(this),e=!0;else this[ka]()};this.get=function(c){Ua[c]&&this[ka]();return void 0!==b[c]?b[c]:a[c]};this.set=
+function(c,d,e){Ua[c]&&this[ka]();e?b[c]=d:a[c]=d;Ua[c]&&this.n()};this.Za=function(b){a[b]=this.b(b,0)+1};this.b=function(a,b){var c=this.get(a);return void 0==c||""===c?b:1*c};this.c=function(a,b){var c=this.get(a);return void 0==c?b:c+""};this.Ka=function(){if(Be){var b=this.c(bb,""),c=this.c(P,"/");Sc(b,c)||(a[O]=a[hb]&&""!=b?Yc(b):1,Be=!1)}}};Zc[x].stopPropagation=function(){throw"aborted";};
+var Vc=function(a){var b=this;this.q=0;var c=a.get(tc);this.Ua=function(){0<b.q&&c&&(b.q--,b.q||c())};this.Ja=function(){!b.q&&c&&ca(c,10)};a.set(uc,b,!0)};function $c(a,b){b=b||[];for(var c=0;c<b[w];c++){var d=b[c];if(""+a==d||0==d[q](a+"."))return d}return"-"}
+var bd=function(a,b,c){c=c?"":a.c(O,"1");b=b[y](".");if(6!==b[w]||ad(b[0],c))return!1;c=1*b[1];var d=1*b[2],e=1*b[3],f=1*b[4];b=1*b[5];if(!(0<=c&&0<d&&0<e&&0<f&&0<=b))return!1;a.set(Q,c);a.set(Vb,d);a.set(Wb,e);a.set(Zb,f);a.set($b,b);return!0},cd=function(a){var b=a.get(Q),c=a.get(Vb),d=a.get(Wb),e=a.get(Zb),f=a.b($b,1);return[a.b(O,1),void 0!=b?b:"-",c||"-",d||"-",e||"-",f][C](".")},dd=function(a){return[a.b(O,1),a.b(cc,0),a.b(R,1),a.b(dc,0)][C](".")},ed=function(a,b,c){c=c?"":a.c(O,"1");var d=
+b[y](".");if(4!==d[w]||ad(d[0],c))d=null;a.set(cc,d?1*d[1]:0);a.set(R,d?1*d[2]:10);a.set(dc,d?1*d[3]:a.get(ab));return null!=d||!ad(b,c)},fd=function(a,b){var c=G(a.c(Tb,"")),d=[],e=a.get(Fb);if(!b&&e){for(var f=0;f<e[w];f++){var Be=e[f];Be&&1==Be[ua]&&d[n](f+"="+G(Be[r])+"="+G(Be[na])+"=1")}0<d[w]&&(c+="|"+d[C]("^"))}return c?a.b(O,1)+"."+c:null},gd=function(a,b,c){c=c?"":a.c(O,"1");b=b[y](".");if(2>b[w]||ad(b[0],c))return!1;b=b[ja](1)[C](".")[y]("|");0<b[w]&&a.set(Tb,I(b[0]));if(1>=b[w])return!0;
+b=b[1][y](-1==b[1][q](",")?"^":",");for(c=0;c<b[w];c++){var d=b[c][y]("=");if(4==d[w]){var e={};ha(e,I(d[1]));e.value=I(d[2]);e.scope=1;a.get(Fb)[d[0]]=e}}return!0},hd=function(a,b){var c=Ue(a,b);return c?[a.b(O,1),a.b(ec,0),a.b(fc,1),a.b(gc,1),c][C]("."):""},Ue=function(a){function b(b,e){if(!F(a.get(b))){var f=a.c(b,""),f=f[y](" ")[C]("%20"),f=f[y]("+")[C]("%20");c[n](e+"="+f)}}var c=[];b(ic,"utmcid");b(nc,"utmcsr");b(S,"utmgclid");b(kc,"utmgclsrc");b(lc,"utmdclid");b(mc,"utmdsid");b(jc,"utmccn");
+b(oc,"utmcmd");b(pc,"utmctr");b(qc,"utmcct");return c[C]("|")},id=function(a,b,c){c=c?"":a.c(O,"1");b=b[y](".");if(5>b[w]||ad(b[0],c))return a.set(ec,void 0),a.set(fc,void 0),a.set(gc,void 0),a.set(ic,void 0),a.set(jc,void 0),a.set(nc,void 0),a.set(oc,void 0),a.set(pc,void 0),a.set(qc,void 0),a.set(S,void 0),a.set(kc,void 0),a.set(lc,void 0),a.set(mc,void 0),!1;a.set(ec,1*b[1]);a.set(fc,1*b[2]);a.set(gc,1*b[3]);Ve(a,b[ja](4)[C]("."));return!0},Ve=function(a,b){function c(a){return(a=b[oa](a+"=(.*?)(?:\\|utm|$)"))&&
+2==a[w]?a[1]:void 0}function d(b,c){c?(c=e?I(c):c[y]("%20")[C](" "),a.set(b,c)):a.set(b,void 0)}-1==b[q]("=")&&(b=I(b));var e="2"==c("utmcvr");d(ic,c("utmcid"));d(jc,c("utmccn"));d(nc,c("utmcsr"));d(oc,c("utmcmd"));d(pc,c("utmctr"));d(qc,c("utmcct"));d(S,c("utmgclid"));d(kc,c("utmgclsrc"));d(lc,c("utmdclid"));d(mc,c("utmdsid"))},ad=function(a,b){return b?a!=b:!/^\d+$/[ia](a)};var Uc=function(){this.filters=[]};Uc[x].add=function(a,b){this.filters[n]({name:a,s:b})};Uc[x].cb=function(a){try{for(var b=0;b<this.filters[w];b++)this.filters[b].s.call(W,a)}catch(c){}};function jd(a){100!=a.get(vb)&&a.get(Q)%1E4>=100*a.get(vb)&&a[ta]()}function kd(a){ld(a.get(Wa))&&a[ta]()}function md(a){"file:"==J[z][A]&&a[ta]()}function Ge(a){He()&&a[ta]()}function nd(a){a.get(Ib)||a.set(Ib,J.title,!0);a.get(Hb)||a.set(Hb,J[z].pathname+J[z][va],!0)}
+function lf(a){a.get(Wa)&&"UA-XXXXX-X"!=a.get(Wa)||a[ta]()};var od=new function(){var a=[];this.set=function(b){a[b]=!0};this.Xa=function(){for(var b=[],c=0;c<a[w];c++)a[c]&&(b[m[la](c/6)]=b[m[la](c/6)]^1<<c%6);for(c=0;c<b[w];c++)b[c]="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"[ma](b[c]||0);return b[C]("")+"~"}};function H(a){od.set(a)};var W=window,J=document,ld=function(a){var b=W._gaUserPrefs;if(b&&b.ioo&&b.ioo()||a&&!0===W["ga-disable-"+a])return!0;try{var c=W.external;if(c&&c._gaUserPrefs&&"oo"==c._gaUserPrefs)return!0}catch(d){}return!1},He=function(){return W[za]&&"preview"==W[za].loadPurpose},We=function(a,b){ca(a,b)},pd=function(a){var b=[],c=J.cookie[y](";");a=new RegExp("^\\s*"+a+"=\\s*(.*?)\\s*$");for(var d=0;d<c[w];d++){var e=c[d][oa](a);e&&b[n](e[1])}return b},X=function(a,b,c,d,e,f){e=ld(e)?!1:Sc(d,c)?!1:He()?!1:!0;
+e&&((b=mf(b))&&2E3<b[w]&&(b=b[B](0,2E3),H(69)),a=a+"="+b+"; path="+c+"; ",f&&(a+="expires="+(new Date((new Date)[g]()+f)).toGMTString()+"; "),d&&(a+="domain="+d+";"),J.cookie=a)},mf=function(a){if(!a)return a;var b=a[q](";");-1!=b&&(a=a[B](0,b),H(141));if(!(0<=W[za].userAgent[q]("Firefox")))return a;a=a[p](/\n|\r/g," ");for(var b=0,c=a[w];b<c;++b){var d=a.charCodeAt(b)&255;if(10==d||13==d)a=a[B](0,b)+"?"+a[B](b+1)}return a};var qd,rd,sd=function(){if(!qd){var a={},b=W[za],c=W.screen;a.Q=c?c.width+"x"+c.height:"-";a.P=c?c.colorDepth+"-bit":"-";a.language=(b&&(b.language||b.browserLanguage)||"-")[D]();a.javaEnabled=b&&b.javaEnabled()?1:0;a.characterSet=J.characterSet||J.charset||"-";try{var d;var e=J.documentElement,f=J.body,Be=f&&f[sa]&&f[wa],b=[];e&&e[sa]&&e[wa]&&("CSS1Compat"===J.compatMode||!Be)?b=[e[sa],e[wa]]:Be&&(b=[f[sa],f[wa]]);d=0>=b[0]||0>=b[1]?"":b[C]("x");a.Wa=d}catch(k){H(135)}qd=a}},td=function(){sd();for(var a=
+qd,b=W[za],a=b.appName+b.version+a.language+b.platform+b.userAgent+a.javaEnabled+a.Q+a.P+(J.cookie?J.cookie:"")+(J.referrer?J.referrer:""),b=a[w],c=W.history[w];0<c;)a+=c--^b++;return Yc(a)},ud=function(a){sd();var b=qd;a.set(Lb,b.Q);a.set(Mb,b.P);a.set(Pb,b.language);a.set(Qb,b.characterSet);a.set(Nb,b.javaEnabled);a.set(Rb,b.Wa);if(a.get(ib)&&a.get(jb)){if(!(b=rd)){var c,d,e;d="ShockwaveFlash";if((b=(b=W[za])?b.plugins:void 0)&&0<b[w])for(c=0;c<b[w]&&!e;c++)d=b[c],-1<d[r][q]("Shockwave Flash")&&
+(e=d.description[y]("Shockwave Flash ")[1]);else{d=d+"."+d;try{c=new ActiveXObject(d+".7"),e=c.GetVariable("$version")}catch(f){}if(!e)try{c=new ActiveXObject(d+".6"),e="WIN 6,0,21,0",c.AllowScriptAccess="always",e=c.GetVariable("$version")}catch(Be){}if(!e)try{c=new ActiveXObject(d),e=c.GetVariable("$version")}catch(k){}e&&(e=e[y](" ")[1][y](","),e=e[0]+"."+e[1]+" r"+e[2])}b=e?e:"-"}rd=b;a.set(Ob,rd)}else a.set(Ob,"-")};var vd=function(a){if(Ba(a))this.s=a;else{var b=a[0],c=b.lastIndexOf(":"),d=b.lastIndexOf(".");this.h=this.i=this.l="";-1==c&&-1==d?this.h=b:-1==c&&-1!=d?(this.i=b[B](0,d),this.h=b[B](d+1)):-1!=c&&-1==d?(this.l=b[B](0,c),this.h=b[B](c+1)):c>d?(this.i=b[B](0,d),this.l=b[B](d+1,c),this.h=b[B](c+1)):(this.i=b[B](0,d),this.h=b[B](d+1));this.k=a[ja](1);this.Ma=!this.l&&"_require"==this.h;this.J=!this.i&&!this.l&&"_provide"==this.h}},Y=function(){T(Y[x],"push",Y[x][n],5);T(Y[x],"_getPlugin",Pc,121);T(Y[x],
+"_createAsyncTracker",Y[x].Sa,33);T(Y[x],"_getAsyncTracker",Y[x].Ta,34);this.I=new Ja;this.p=[]};E=Y[x];E.Na=function(a,b,c){var d=this.I.get(a);if(!Ba(d))return!1;b.plugins_=b.plugins_||new Ja;b.plugins_.set(a,new d(b,c||{}));return!0};E.push=function(a){var b=Z.Va[ya](this,arguments),b=Z.p.concat(b);for(Z.p=[];0<b[w]&&!Z.O(b[0])&&!(b.shift(),0<Z.p[w]););Z.p=Z.p.concat(b);return 0};E.Va=function(a){for(var b=[],c=0;c<arguments[w];c++)try{var d=new vd(arguments[c]);d.J?this.O(d):b[n](d)}catch(e){}return b};
+E.O=function(a){try{if(a.s)a.s[ya](W);else if(a.J)this.I.set(a.k[0],a.k[1]);else{var b="_gat"==a.i?M:"_gaq"==a.i?Z:M.u(a.i);if(a.Ma){if(!this.Na(a.k[0],b,a.k[2])){if(!a.Pa){var c=Oa(""+a.k[1]);var d=c[A],e=J[z][A];var f;if(f="https:"==d||d==e?!0:"http:"!=d?!1:"http:"==e)t:{var Be=Oa(J[z][xa]);if(!(c.Oa||0<=c.url[q]("?")||0<=c[ra][q]("://")||c[u]==Be[u]&&c[pa]==Be[pa]))for(var k="http:"==c[A]?80:443,s=M.S,b=0;b<s[w];b++)if(c[u]==s[b][0]&&(c[pa]||k)==(s[b][1]||k)&&0==c[ra][q](s[b][2])){f=!0;break t}f=
+!1}f&&!ld()&&(a.Pa=Ia(c.url))}return!0}}else a.l&&(b=b.plugins_.get(a.l)),b[a.h][ya](b,a.k)}}catch(t){}};E.Sa=function(a,b){return M.r(a,b||"")};E.Ta=function(a){return M.u(a)};var yd=function(){function a(a,b,c,d){void 0==f[a]&&(f[a]={});void 0==f[a][b]&&(f[a][b]=[]);f[a][b][c]=d}function b(a,b,c){if(void 0!=f[a]&&void 0!=f[a][b])return f[a][b][c]}function c(a,b){if(void 0!=f[a]&&void 0!=f[a][b]){f[a][b]=void 0;var c=!0,d;for(d=0;d<Be[w];d++)if(void 0!=f[a][Be[d]]){c=!1;break}c&&(f[a]=void 0)}}function d(a){var b="",c=!1,d,e;for(d=0;d<Be[w];d++)if(e=a[Be[d]],void 0!=e){c&&(b+=Be[d]);for(var c=[],f=void 0,Bd=void 0,Bd=0;Bd<e[w];Bd++)if(void 0!=e[Bd]){f="";1!=Bd&&void 0==
+e[Bd-1]&&(f+=Bd[v]()+"!");for(var fa=e[Bd],Ke="",Le=void 0,Me=void 0,ga=void 0,Le=0;Le<fa[w];Le++)Me=fa[ma](Le),ga=k[Me],Ke+=void 0!=ga?ga:Me;f+=Ke;c[n](f)}b+="("+c[C]("*")+")";c=!1}else c=!0;return b}var e=this,f=[],Be=["k","v"],k={"'":"'0",")":"'1","*":"'2","!":"'3"};e.Ra=function(a){return void 0!=f[a]};e.A=function(){for(var a="",b=0;b<f[w];b++)void 0!=f[b]&&(a+=b[v]()+d(f[b]));return a};e.Qa=function(a){if(void 0==a)return e.A();for(var b=a.A(),c=0;c<f[w];c++)void 0==f[c]||a.Ra(c)||(b+=c[v]()+
+d(f[c]));return b};e.f=function(b,c,d){if(!wd(d))return!1;a(b,"k",c,d);return!0};e.o=function(b,c,d){if(!xd(d))return!1;a(b,"v",c,d[v]());return!0};e.getKey=function(a,c){return b(a,"k",c)};e.N=function(a,c){return b(a,"v",c)};e.L=function(a){c(a,"k")};e.M=function(a){c(a,"v")};T(e,"_setKey",e.f,89);T(e,"_setValue",e.o,90);T(e,"_getKey",e.getKey,87);T(e,"_getValue",e.N,88);T(e,"_clearKey",e.L,85);T(e,"_clearValue",e.M,86)};function wd(a){return"string"==typeof a}
+function xd(a){return!("number"==typeof a||void 0!=Number&&a instanceof Number)||m.round(a)!=a||da(a)||a==ba?!1:!0};var zd=function(a){var b=W.gaGlobal;a&&!b&&(W.gaGlobal=b={});return b},Ad=function(){var a=zd(!0).hid;null==a&&(a=Ea(),zd(!0).hid=a);return a},Dd=function(a){a.set(Kb,Ad());var b=zd();if(b&&b.dh==a.get(O)){var c=b.sid;c&&(a.get(ac)?H(112):H(132),a.set(Zb,c),a.get(Sb)&&a.set(Wb,c));b=b.vid;a.get(Sb)&&b&&(b=b[y]("."),a.set(Q,1*b[0]),a.set(Vb,1*b[1]))}};var Ed,Fd=function(a,b,c,d){var e=a.c(bb,""),f=a.c(P,"/");d=void 0!=d?d:a.b(cb,0);a=a.c(Wa,"");X(b,c,f,e,a,d)},Xc=function(a){var b=a.c(bb,"");a.b(O,1);var c=a.c(P,"/"),d=a.c(Wa,"");X("__utma",cd(a),c,b,d,a.get(cb));X("__utmb",dd(a),c,b,d,a.get(db));X("__utmc",""+a.b(O,1),c,b,d);var e=hd(a,!0);e?X("__utmz",e,c,b,d,a.get(eb)):X("__utmz","",c,b,"",-1);(e=fd(a,!1))?X("__utmv",e,c,b,d,a.get(cb)):X("__utmv","",c,b,"",-1)},Wc=function(a){var b=a.b(O,1);if(!bd(a,$c(b,pd("__utma"))))return a.set(Ub,!0),!1;
+var c=!ed(a,$c(b,pd("__utmb")));a.set(bc,c);id(a,$c(b,pd("__utmz")));gd(a,$c(b,pd("__utmv")));Ed=!c;return!0},Gd=function(a){Ed||0<pd("__utmb")[w]||(X("__utmd","1",a.c(P,"/"),a.c(bb,""),a.c(Wa,""),1E4),0==pd("__utmd")[w]&&a[ta]())};var h=0,Jd=function(a){void 0==a.get(Q)?Hd(a):a.get(Ub)&&!a.get(Mc)?Hd(a):a.get(bc)&&Id(a)},Kd=function(a){a.get(hc)&&!a.get(ac)&&(Id(a),a.set(fc,a.get($b)))},Hd=function(a){h++;1<h&&H(137);var b=a.get(ab);a.set(Sb,!0);a.set(Q,Ea()^td(a)&2147483647);a.set(Tb,"");a.set(Vb,b);a.set(Wb,b);a.set(Zb,b);a.set($b,1);a.set(ac,!0);a.set(cc,0);a.set(R,10);a.set(dc,b);a.set(Fb,[]);a.set(Ub,!1);a.set(bc,!1)},Id=function(a){h++;1<h&&H(137);a.set(Wb,a.get(Zb));a.set(Zb,a.get(ab));a.Za($b);a.set(ac,!0);a.set(cc,
+0);a.set(R,10);a.set(dc,a.get(ab));a.set(bc,!1)};var Ld="daum:q eniro:search_word naver:query pchome:q images.google:q google:q yahoo:p yahoo:q msn:q bing:q aol:query aol:q lycos:q lycos:query ask:q cnn:query virgilio:qs baidu:wd baidu:word alice:qs yandex:text najdi:q seznam:q rakuten:qt biglobe:q goo.ne:MT search.smt.docomo:MT onet:qt onet:q kvasir:q terra:query rambler:query conduit:q babylon:q search-results:q avg:q comcast:q incredimail:q startsiden:q go.mail.ru:q centrum.cz:q 360.cn:q sogou:query tut.by:query globo:q ukr:q so.com:q auone:q".split(" "),
+Sd=function(a){if(a.get(kb)&&!a.get(Mc)){var b;b=!F(a.get(ic))||!F(a.get(nc))||!F(a.get(S))||!F(a.get(lc));for(var c={},d=0;d<Md[w];d++){var e=Md[d];c[e]=a.get(e)}(d=a.get(rc))?(H(149),e=new Ja,Na(e,d),d=e):d=La(J[z][xa],a.get(gb)).d;if("1"!=L(d.get(a.get(ub)))||!b)if(d=Xe(a,d)||Qd(a),d||b||!a.get(ac)||(Pd(a,void 0,"(direct)",void 0,void 0,void 0,"(direct)","(none)",void 0,void 0),d=!0),d&&(a.set(hc,Rd(a,c)),b="(direct)"==a.get(nc)&&"(direct)"==a.get(jc)&&"(none)"==a.get(oc),a.get(hc)||a.get(ac)&&
+!b))a.set(ec,a.get(ab)),a.set(fc,a.get($b)),a.Za(gc)}},Xe=function(a,b){function c(c,d){d=d||"-";var e=L(b.get(a.get(c)));return e&&"-"!=e?I(e):d}var d=L(b.get(a.get(nb)))||"-",e=L(b.get(a.get(qb)))||"-",f=L(b.get(a.get(pb)))||"-",Be=L(b.get("gclsrc"))||"-",k=L(b.get("dclid"))||"-",s=c(ob,"(not set)"),t=c(rb,"(not set)"),Za=c(sb),Ma=c(tb);if(F(d)&&F(f)&&F(k)&&F(e))return!1;var mb=!F(f)&&!F(Be),mb=F(e)&&(!F(k)||mb),Xb=F(Za);if(mb||Xb){var Bd=Nd(a),Bd=La(Bd,!0);(Bd=Od(a,Bd))&&!F(Bd[1]&&!Bd[2])&&(mb&&
+(e=Bd[0]),Xb&&(Za=Bd[1]))}Pd(a,d,e,f,Be,k,s,t,Za,Ma);return!0},Qd=function(a){var b=Nd(a),c=La(b,!0);(b=!(void 0!=b&&null!=b&&""!=b&&"0"!=b&&"-"!=b&&0<=b[q]("://")))||(b=c&&-1<c[u][q]("google")&&c.d.contains("q")&&"cse"==c[ra]);if(b)return!1;if((b=Od(a,c))&&!b[2])return Pd(a,void 0,b[0],void 0,void 0,void 0,"(organic)","organic",b[1],void 0),!0;if(b||!a.get(ac))return!1;t:{for(var b=a.get(Bb),d=Ka(c[u]),e=0;e<b[w];++e)if(-1<d[q](b[e])){a=!1;break t}Pd(a,void 0,d,void 0,void 0,void 0,"(referral)",
+"referral",void 0,"/"+c[ra]);a=!0}return a},Od=function(a,b){for(var c=a.get(zb),d=0;d<c[w];++d){var e=c[d][y](":");if(-1<b[u][q](e[0][D]())){var f=b.d.get(e[1]);if(f&&(f=K(f),!f&&-1<b[u][q]("google.")&&(f="(not provided)"),!e[3]||-1<b.url[q](e[3]))){f||H(151);t:{for(var c=f,d=a.get(Ab),c=I(c)[D](),Be=0;Be<d[w];++Be)if(c==d[Be]){c=!0;break t}c=!1}return[e[2]||e[0],f,c]}}}return null},Pd=function(a,b,c,d,e,f,Be,k,s,t){a.set(ic,b);a.set(nc,c);a.set(S,d);a.set(kc,e);a.set(lc,f);a.set(jc,Be);a.set(oc,
+k);a.set(pc,s);a.set(qc,t)},Md=[jc,ic,S,lc,nc,oc,pc,qc],Rd=function(a,b){function c(a){a=(""+a)[y]("+")[C]("%20");return a=a[y](" ")[C]("%20")}function d(c){var d=""+(a.get(c)||"");c=""+(b[c]||"");return 0<d[w]&&d==c}if(d(S)||d(lc))return H(131),!1;for(var e=0;e<Md[w];e++){var f=Md[e],Be=b[f]||"-",f=a.get(f)||"-";if(c(Be)!=c(f))return!0}return!1},Td=new RegExp(/^https?:\/\/(www\.)?google(\.com?)?(\.[a-z]{2}t?)?\/?$/i),jf=/^https?:\/\/r\.search\.yahoo\.com\/[^?]*$/i,Nd=function(a){a=Pa(a.get(Jb),a.get(P));
+try{if(Td[ia](a))return H(136),a+"?q=";if(jf[ia](a))return H(150),a+"?p=(not provided)"}catch(b){H(145)}return a};var Ud,Vd,Wd=function(a){Ud=a.c(S,"");Vd=a.c(kc,"")},Xd=function(a){var b=a.c(S,""),c=a.c(kc,"");b!=Ud&&(-1<c[q]("ds")?a.set(mc,void 0):!F(Ud)&&-1<Vd[q]("ds")&&a.set(mc,Ud))};var Zd=function(a){Yd(a,J[z][xa])?(a.set(Mc,!0),H(12)):a.set(Mc,!1)},Yd=function(a,b){if(!a.get(fb))return!1;var c=La(b,a.get(gb)),d=K(c.d.get("__utma")),e=K(c.d.get("__utmb")),f=K(c.d.get("__utmc")),Be=K(c.d.get("__utmx")),k=K(c.d.get("__utmz")),s=K(c.d.get("__utmv")),c=K(c.d.get("__utmk"));if(Yc(""+d+e+f+Be+k+s)!=c){d=I(d);e=I(e);f=I(f);Be=I(Be);f=$d(d+e+f+Be,k,s,c);if(!f)return!1;k=f[0];s=f[1]}if(!bd(a,d,!0))return!1;ed(a,e,!0);id(a,k,!0);gd(a,s,!0);ae(a,Be,!0);return!0},ce=function(a,b,c){var d;
+d=cd(a)||"-";var e=dd(a)||"-",f=""+a.b(O,1)||"-",Be=be(a)||"-",k=hd(a,!1)||"-";a=fd(a,!1)||"-";var s=Yc(""+d+e+f+Be+k+a),t=[];t[n]("__utma="+d);t[n]("__utmb="+e);t[n]("__utmc="+f);t[n]("__utmx="+Be);t[n]("__utmz="+k);t[n]("__utmv="+a);t[n]("__utmk="+s);d=t[C]("&");if(!d)return b;e=b[q]("#");if(c)return 0>e?b+"#"+d:b+"&"+d;c="";f=b[q]("?");0<e&&(c=b[B](e),b=b[B](0,e));return 0>f?b+"?"+d+c:b+"&"+d+c},$d=function(a,b,c,d){for(var e=0;3>e;e++){for(var f=0;3>f;f++){if(d==Yc(a+b+c))return H(127),[b,c];
+var Be=b[p](/ /g,"%20"),k=c[p](/ /g,"%20");if(d==Yc(a+Be+k))return H(128),[Be,k];Be=Be[p](/\+/g,"%20");k=k[p](/\+/g,"%20");if(d==Yc(a+Be+k))return H(129),[Be,k];try{var s=b[oa]("utmctr=(.*?)(?:\\|utm|$)");if(s&&2==s[w]&&(Be=b[p](s[1],G(I(s[1]))),d==Yc(a+Be+c)))return H(139),[Be,c]}catch(t){}b=I(b)}c=I(c)}};var de="|",fe=function(a,b,c,d,e,f,Be,k,s){var t=ee(a,b);t||(t={},a.get(Cb)[n](t));t.id_=b;t.affiliation_=c;t.total_=d;t.tax_=e;t.shipping_=f;t.city_=Be;t.state_=k;t.country_=s;t.items_=t.items_||[];return t},ge=function(a,b,c,d,e,f,Be){a=ee(a,b)||fe(a,b,"",0,0,0,"","","");var k;t:{if(a&&a.items_){k=a.items_;for(var s=0;s<k[w];s++)if(k[s].sku_==c){k=k[s];break t}}k=null}s=k||{};s.transId_=b;s.sku_=c;s.name_=d;s.category_=e;s.price_=f;s.quantity_=Be;k||a.items_[n](s);return s},ee=function(a,b){for(var c=
+a.get(Cb),d=0;d<c[w];d++)if(c[d].id_==b)return c[d];return null};var he,ie=function(a){if(!he){var b;b=J[z].hash;var c=W[r],d=/^#?gaso=([^&]*)/;if(c=(b=(b=b&&b[oa](d)||c&&c[oa](d))?b[1]:K(pd("GASO")))&&b[oa](/^(?:!([-0-9a-z.]{1,40})!)?([-.\w]{10,1200})$/i))Fd(a,"GASO",""+b,0),M._gasoDomain=a.get(bb),M._gasoCPath=a.get(P),a=c[1],Ia("https://www.google.com/analytics/web/inpage/pub/inpage.js?"+(a?"prefix="+a+"&":"")+Ea(),"_gasojs");he=!0}};var ae=function(a,b,c){c&&(b=I(b));c=a.b(O,1);b=b[y](".");2>b[w]||!/^\d+$/[ia](b[0])||(b[0]=""+c,Fd(a,"__utmx",b[C]("."),void 0))},be=function(a,b){var c=$c(a.get(O),pd("__utmx"));"-"==c&&(c="");return b?G(c):c},Ye=function(a){try{var b=La(J[z][xa],!1),c=ea(L(b.d.get("utm_referrer")))||"";c&&a.set(Jb,c);var d=ea(K(b.d.get("utm_expid")))||"";d&&(d=d[y](".")[0],a.set(Oc,""+d))}catch(e){H(146)}},l=function(a){var b=W.gaData&&W.gaData.expId;b&&a.set(Oc,""+b)};var ke=function(a,b){var c=m.min(a.b(Dc,0),100);if(a.b(Q,0)%100>=c)return!1;c=Ze()||$e();if(void 0==c)return!1;var d=c[0];if(void 0==d||d==ba||da(d))return!1;0<d?af(c)?b(je(c)):b(je(c[ja](0,1))):Ga(W,"load",function(){ke(a,b)},!1);return!0},me=function(a,b,c,d){var e=new yd;e.f(14,90,b[B](0,500));e.f(14,91,a[B](0,150));e.f(14,92,""+le(c));void 0!=d&&e.f(14,93,d[B](0,500));e.o(14,90,c);return e},af=function(a){for(var b=1;b<a[w];b++)if(da(a[b])||a[b]==ba||0>a[b])return!1;return!0},le=function(a){return da(a)||
+0>a?0:5E3>a?10*m[la](a/10):5E4>a?100*m[la](a/100):41E5>a?1E3*m[la](a/1E3):41E5},je=function(a){for(var b=new yd,c=0;c<a[w];c++)b.f(14,c+1,""+le(a[c])),b.o(14,c+1,a[c]);return b},Ze=function(){var a=W.performance||W.webkitPerformance;if(a=a&&a.timing){var b=a.navigationStart;if(0==b)H(133);else return[a.loadEventStart-b,a.domainLookupEnd-a.domainLookupStart,a.connectEnd-a.connectStart,a.responseStart-a.requestStart,a.responseEnd-a.responseStart,a.fetchStart-b,a.domInteractive-b,a.domContentLoadedEventStart-
+b]}},$e=function(){if(W.top==W){var a=W.external,b=a&&a.onloadT;a&&!a.isValidLoadTime&&(b=void 0);2147483648<b&&(b=void 0);0<b&&a.setPageReadyTime();return void 0==b?void 0:[b]}};var cf=function(a){if(a.get(Sb))try{var b;t:{var c=pd(a.get(Oe)||"_ga");if(c&&!(1>c[w])){for(var d=[],e=0;e<c[w];e++){var f;var Be=c[e][y]("."),k=Be.shift();if(("GA1"==k||"1"==k)&&1<Be[w]){var s=Be.shift()[y]("-");1==s[w]&&(s[1]="1");s[0]*=1;s[1]*=1;f={Ya:s,$a:Be[C](".")}}else f=void 0;f&&d[n](f)}if(1==d[w]){b=d[0].$a;break t}if(0!=d[w]){var t=a.get(Pe)||a.get(bb),d=bf(d,(0==t[q](".")?t.substr(1):t)[y](".")[w],0);if(1==d[w]){b=d[0].$a;break t}var Za=a.get(Qe)||a.get(P);(c=Za)?(1<c[w]&&"/"==c[ma](c[w]-
+1)&&(c=c.substr(0,c[w]-1)),0!=c[q]("/")&&(c="/"+c),Za=c):Za="/";d=bf(d,"/"==Za?1:Za[y]("/")[w],1);b=d[0].$a;break t}}b=void 0}if(b){var Ma=(""+b)[y](".");2==Ma[w]&&/[0-9.]/[ia](Ma)&&(H(114),a.set(Q,Ma[0]),a.set(Vb,Ma[1]),a.set(Sb,!1))}}catch(mb){H(115)}},bf=function(a,b,c){for(var d=[],e=[],f=128,Be=0;Be<a[w];Be++){var k=a[Be];if(k.Ya[c]==b)d[n](k);else if(k.Ya[c]==f)e[n](k);else k.Ya[c]<f&&(e=[k],f=k.Ya[c])}return 0<d[w]?d:e};var kf=/^gtm\d+$/,hf=function(a){var b;b="page"!=a.get(sc)?!1:(b=a.b(Cd,10))?0==a.b(Q,1)%b:!1;b&&(H(140),b=a.c(Lc,""),b||(b=(b=a.c($a,""))&&"~0"!=b?kf[ia](b)?"_gat_"+G(a.c(Wa,"")):"_gat_"+G(b):"_gat"),0<pd(b)[w]?a.set(Kc,"",!0):(X(b,"1",a.c(P,"/"),a.c(bb,""),a.c(Wa,""),6E5),0<pd(b)[w]&&(a.set(Kc,Ea(),!0),a.set(Yb,1,!0),a.set(Jc,Ne()+"/r/__utm.gif?",!0))))};var U=function(a,b,c){function d(a){return function(b){if((b=b.get(Nc)[a])&&b[w])for(var c=Te(e,a),d=0;d<b[w];d++)b[d].call(e,c)}}var e=this;this.a=new Zc;this.get=function(a){return this.a.get(a)};this.set=function(a,b,c){this.a.set(a,b,c)};this.set(Wa,b||"UA-XXXXX-X");this.set($a,a||"");this.set(Ya,c||"");this.set(ab,m.round((new Date)[g]()/1E3));this.set(P,"/");this.set(cb,63072E6);this.set(eb,15768E6);this.set(db,18E5);this.set(fb,!1);this.set(yb,50);this.set(gb,!1);this.set(hb,!0);this.set(ib,
+!0);this.set(jb,!0);this.set(kb,!0);this.set(lb,!0);this.set(ob,"utm_campaign");this.set(nb,"utm_id");this.set(pb,"gclid");this.set(qb,"utm_source");this.set(rb,"utm_medium");this.set(sb,"utm_term");this.set(tb,"utm_content");this.set(ub,"utm_nooverride");this.set(vb,100);this.set(Dc,1);this.set(Ec,!1);this.set(wb,"/__utm.gif");this.set(xb,1);this.set(Cb,[]);this.set(Fb,[]);this.set(zb,Ld[ja](0));this.set(Ab,[]);this.set(Bb,[]);this.B("auto");this.set(Jb,J.referrer);Ye(this.a);this.set(Nc,{hit:[],
+load:[]});this.a.g("0",Zd);this.a.g("1",Wd);this.a.g("2",Jd);this.a.g("3",cf);this.a.g("4",Sd);this.a.g("5",Xd);this.a.g("6",Kd);this.a.g("7",d("load"));this.a.g("8",ie);this.a.e("A",kd);this.a.e("B",md);this.a.e("C",Ge);this.a.e("D",Jd);this.a.e("E",jd);this.a.e("F",Tc);this.a.e("G",ne);this.a.e("H",lf);this.a.e("I",Gd);this.a.e("J",nd);this.a.e("K",ud);this.a.e("L",Dd);this.a.e("M",l);this.a.e("N",hf);this.a.e("O",d("hit"));this.a.e("P",oe);this.a.e("Q",pe);0===this.get(ab)&&H(111);this.a.T();this.H=
+void 0};E=U[x];E.m=function(){var a=this.get(Db);a||(a=new yd,this.set(Db,a));return a};E.La=function(a){for(var b in a){var c=a[b];a.hasOwnProperty(b)&&this.set(b,c,!0)}};E.K=function(a){if(this.get(Ec))return!1;var b=this,c=ke(this.a,function(c){b.set(Hb,a,!0);b.t(c)});this.set(Ec,c);return c};E.Fa=function(a){a&&Ca(a)?(H(13),this.set(Hb,a,!0)):"object"===typeof a&&null!==a&&this.La(a);this.H=a=this.get(Hb);this.a.j("page");this.K(a)};
+E.F=function(a,b,c,d,e){if(""==a||!wd(a)||""==b||!wd(b)||void 0!=c&&!wd(c)||void 0!=d&&!xd(d))return!1;this.set(wc,a,!0);this.set(xc,b,!0);this.set(yc,c,!0);this.set(zc,d,!0);this.set(vc,!!e,!0);this.a.j("event");return!0};E.Ha=function(a,b,c,d,e){var f=this.a.b(Dc,0);1*e===e&&(f=e);if(this.a.b(Q,0)%100>=f)return!1;c=1*(""+c);if(""==a||!wd(a)||""==b||!wd(b)||!xd(c)||da(c)||0>c||0>f||100<f||void 0!=d&&(""==d||!wd(d)))return!1;this.t(me(a,b,c,d));return!0};
+E.Ga=function(a,b,c,d){if(!a||!b)return!1;this.set(Ac,a,!0);this.set(Bc,b,!0);this.set(Cc,c||J[z][xa],!0);d&&this.set(Hb,d,!0);this.a.j("social");return!0};E.Ea=function(){this.set(Dc,10);this.K(this.H)};E.Ia=function(){this.a.j("trans")};E.t=function(a){this.set(Eb,a,!0);this.a.j("event")};E.ia=function(a){this.v();var b=this;return{_trackEvent:function(c,d,e){H(91);b.F(a,c,d,e)}}};E.ma=function(a){return this.get(a)};
+E.xa=function(a,b){if(a)if(Ca(a))this.set(a,b);else if("object"==typeof a)for(var c in a)a.hasOwnProperty(c)&&this.set(c,a[c])};E.addEventListener=function(a,b){var c=this.get(Nc)[a];c&&c[n](b)};E.removeEventListener=function(a,b){for(var c=this.get(Nc)[a],d=0;c&&d<c[w];d++)if(c[d]==b){c.splice(d,1);break}};E.qa=function(){return"5.5.7"};E.B=function(a){this.get(hb);a="auto"==a?Ka(J.domain):a&&"-"!=a&&"none"!=a?a[D]():"";this.set(bb,a)};E.va=function(a){this.set(hb,!!a)};
+E.na=function(a,b){return ce(this.a,a,b)};E.link=function(a,b){if(this.a.get(fb)&&a){var c=ce(this.a,a,b);J[z].href=c}};E.ua=function(a,b){this.a.get(fb)&&a&&a.action&&(a.action=ce(this.a,a.action,b))};
+E.za=function(){this.v();var a=this.a,b=J.getElementById?J.getElementById("utmtrans"):J.utmform&&J.utmform.utmtrans?J.utmform.utmtrans:null;if(b&&b[na]){a.set(Cb,[]);for(var b=b[na][y]("UTM:"),c=0;c<b[w];c++){b[c]=Da(b[c]);for(var d=b[c][y](de),e=0;e<d[w];e++)d[e]=Da(d[e]);"T"==d[0]?fe(a,d[1],d[2],d[3],d[4],d[5],d[6],d[7],d[8]):"I"==d[0]&&ge(a,d[1],d[2],d[3],d[4],d[5],d[6])}}};E.$=function(a,b,c,d,e,f,Be,k){return fe(this.a,a,b,c,d,e,f,Be,k)};E.Y=function(a,b,c,d,e,f){return ge(this.a,a,b,c,d,e,f)};
+E.Aa=function(a){de=a||"|"};E.ea=function(){this.set(Cb,[])};E.wa=function(a,b,c,d){var e=this.a;if(0>=a||a>e.get(yb))a=!1;else if(!b||!c||128<b[w]+c[w])a=!1;else{1!=d&&2!=d&&(d=3);var f={};ha(f,b);f.value=c;f.scope=d;e.get(Fb)[a]=f;a=!0}a&&this.a.n();return a};E.ka=function(a){this.a.get(Fb)[a]=void 0;this.a.n()};E.ra=function(a){return(a=this.a.get(Fb)[a])&&1==a[ua]?a[na]:void 0};E.Ca=function(a,b,c){this.m().f(a,b,c)};E.Da=function(a,b,c){this.m().o(a,b,c)};
+E.sa=function(a,b){return this.m().getKey(a,b)};E.ta=function(a,b){return this.m().N(a,b)};E.fa=function(a){this.m().L(a)};E.ga=function(a){this.m().M(a)};E.ja=function(){return new yd};E.W=function(a){a&&this.get(Ab)[n](a[D]())};E.ba=function(){this.set(Ab,[])};E.X=function(a){a&&this.get(Bb)[n](a[D]())};E.ca=function(){this.set(Bb,[])};E.Z=function(a,b,c,d,e){if(a&&b){a=[a,b[D]()][C](":");if(d||e)a=[a,d,e][C](":");d=this.get(zb);d.splice(c?0:d[w],0,a)}};E.da=function(){this.set(zb,[])};
+E.ha=function(a){this.a[ka]();var b=this.get(P),c=be(this.a);this.set(P,a);this.a.n();ae(this.a,c);this.set(P,b)};E.ya=function(a,b){if(0<a&&5>=a&&Ca(b)&&""!=b){var c=this.get(Fc)||[];c[a]=b;this.set(Fc,c)}};E.V=function(a){a=""+a;if(a[oa](/^[A-Za-z0-9]{1,5}$/)){var b=this.get(Ic)||[];b[n](a);this.set(Ic,b)}};E.v=function(){this.a[ka]()};E.Ba=function(a){a&&""!=a&&(this.set(Tb,a),this.a.j("var"))};var ne=function(a){"trans"!==a.get(sc)&&500<=a.b(cc,0)&&a[ta]();if("event"===a.get(sc)){var b=(new Date)[g](),c=a.b(dc,0),d=a.b(Zb,0),c=m[la]((b-(c!=d?c:1E3*c))/1E3*1);0<c&&(a.set(dc,b),a.set(R,m.min(10,a.b(R,0)+c)));0>=a.b(R,0)&&a[ta]()}},pe=function(a){"event"===a.get(sc)&&a.set(R,m.max(0,a.b(R,10)-1))};var qe=function(){var a=[];this.add=function(b,c,d){d&&(c=G(""+c));a[n](b+"="+c)};this.toString=function(){return a[C]("&")}},re=function(a,b){(b||2!=a.get(xb))&&a.Za(cc)},se=function(a,b){b.add("utmwv","5.5.7");b.add("utms",a.get(cc));b.add("utmn",Ea());var c=J[z].hostname;F(c)||b.add("utmhn",c,!0);c=a.get(vb);100!=c&&b.add("utmsp",c,!0)},te=function(a,b){b.add("utmht",(new Date)[g]());b.add("utmac",Da(a.get(Wa)));a.get(Oc)&&b.add("utmxkey",a.get(Oc),!0);a.get(vc)&&b.add("utmni",1);a.get(of)&&b.add("utmgtm",
+a.get(of),!0);var c=a.get(Ic);c&&0<c[w]&&b.add("utmdid",c[C]("."));ff(a,b);!1!==a.get(Xa)&&(a.get(Xa)||M.w)&&b.add("aip",1);void 0!==a.get(Kc)&&b.add("utmjid",a.c(Kc,""),!0);a.b(Yb,0)&&b.add("utmredir",a.b(Yb,0),!0);M.bb||(M.bb=a.get(Wa));(1<M.ab()||M.bb!=a.get(Wa))&&b.add("utmmt",1);b.add("utmu",od.Xa())},ue=function(a,b){for(var c=a.get(Fc)||[],d=[],e=1;e<c[w];e++)c[e]&&d[n](e+":"+G(c[e][p](/%/g,"%25")[p](/:/g,"%3A")[p](/,/g,"%2C")));d[w]&&b.add("utmpg",d[C](","))},ff=function(a,b){function c(a,
+b){b&&d[n](a+"="+b+";")}var d=[];c("__utma",cd(a));c("__utmz",hd(a,!1));c("__utmv",fd(a,!0));c("__utmx",be(a));b.add("utmcc",d[C]("+"),!0)},ve=function(a,b){a.get(ib)&&(b.add("utmcs",a.get(Qb),!0),b.add("utmsr",a.get(Lb)),a.get(Rb)&&b.add("utmvp",a.get(Rb)),b.add("utmsc",a.get(Mb)),b.add("utmul",a.get(Pb)),b.add("utmje",a.get(Nb)),b.add("utmfl",a.get(Ob),!0))},we=function(a,b){a.get(lb)&&a.get(Ib)&&b.add("utmdt",a.get(Ib),!0);b.add("utmhid",a.get(Kb));b.add("utmr",Pa(a.get(Jb),a.get(P)),!0);b.add("utmp",
+G(a.get(Hb),!0),!0)},xe=function(a,b){for(var c=a.get(Db),d=a.get(Eb),e=a.get(Fb)||[],f=0;f<e[w];f++){var Be=e[f];Be&&(c||(c=new yd),c.f(8,f,Be[r]),c.f(9,f,Be[na]),3!=Be[ua]&&c.f(11,f,""+Be[ua]))}F(a.get(wc))||F(a.get(xc),!0)||(c||(c=new yd),c.f(5,1,a.get(wc)),c.f(5,2,a.get(xc)),e=a.get(yc),void 0!=e&&c.f(5,3,e),e=a.get(zc),void 0!=e&&c.o(5,1,e));c?b.add("utme",c.Qa(d),!0):d&&b.add("utme",d.A(),!0)},ye=function(a,b,c){var d=new qe;re(a,c);se(a,d);d.add("utmt","tran");d.add("utmtid",b.id_,!0);d.add("utmtst",
+b.affiliation_,!0);d.add("utmtto",b.total_,!0);d.add("utmttx",b.tax_,!0);d.add("utmtsp",b.shipping_,!0);d.add("utmtci",b.city_,!0);d.add("utmtrg",b.state_,!0);d.add("utmtco",b.country_,!0);xe(a,d);ve(a,d);we(a,d);(b=a.get(Gb))&&d.add("utmcu",b,!0);c||(ue(a,d),te(a,d));return d[v]()},ze=function(a,b,c){var d=new qe;re(a,c);se(a,d);d.add("utmt","item");d.add("utmtid",b.transId_,!0);d.add("utmipc",b.sku_,!0);d.add("utmipn",b.name_,!0);d.add("utmiva",b.category_,!0);d.add("utmipr",b.price_,!0);d.add("utmiqt",
+b.quantity_,!0);xe(a,d);ve(a,d);we(a,d);(b=a.get(Gb))&&d.add("utmcu",b,!0);c||(ue(a,d),te(a,d));return d[v]()},Ae=function(a,b){var c=a.get(sc);if("page"==c)c=new qe,re(a,b),se(a,c),xe(a,c),ve(a,c),we(a,c),b||(ue(a,c),te(a,c)),c=[c[v]()];else if("event"==c)c=new qe,re(a,b),se(a,c),c.add("utmt","event"),xe(a,c),ve(a,c),we(a,c),b||(ue(a,c),te(a,c)),c=[c[v]()];else if("var"==c)c=new qe,re(a,b),se(a,c),c.add("utmt","var"),!b&&te(a,c),c=[c[v]()];else if("trans"==c)for(var c=[],d=a.get(Cb),e=0;e<d[w];++e){c[n](ye(a,
+d[e],b));for(var f=d[e].items_,Be=0;Be<f[w];++Be)c[n](ze(a,f[Be],b))}else"social"==c?b?c=[]:(c=new qe,re(a,b),se(a,c),c.add("utmt","social"),c.add("utmsn",a.get(Ac),!0),c.add("utmsa",a.get(Bc),!0),c.add("utmsid",a.get(Cc),!0),xe(a,c),ve(a,c),we(a,c),ue(a,c),te(a,c),c=[c[v]()]):"feedback"==c?b?c=[]:(c=new qe,re(a,b),se(a,c),c.add("utmt","feedback"),c.add("utmfbid",a.get(Gc),!0),c.add("utmfbpr",a.get(Hc),!0),xe(a,c),ve(a,c),we(a,c),ue(a,c),te(a,c),c=[c[v]()]):c=[];return c},oe=function(a){var b,c=a.get(xb),
+d=a.get(uc),e=d&&d.Ua,f=0;if(0==c||2==c){var Be=a.get(wb)+"?";b=Ae(a,!0);for(var k=0,s=b[w];k<s;k++)Sa(b[k],e,Be,!0),f++}if(1==c||2==c)for(b=Ae(a),a=a.c(Jc,""),k=0,s=b[w];k<s;k++)try{Sa(b[k],e,a),f++}catch(t){t&&Ra(t[r],void 0,t.message)}d&&(d.q=f)};var Ne=function(){return"https:"==J[z][A]||M.G?"https://ssl.google-analytics.com":"http://www.google-analytics.com"},Ce=function(a){ha(this,"len");this.message=a+"-8192"},De=function(a){ha(this,"ff2post");this.message=a+"-2036"},Sa=function(a,b,c,d){b=b||Fa;if(d||2036>=a[w])gf(a,b,c);else if(8192>=a[w]){if(0<=W[za].userAgent[q]("Firefox")&&![].reduce)throw new De(a[w]);df(a,b)||ef(a,b)||Ee(a,b)||b()}else throw new Ce(a[w]);},gf=function(a,b,c){c=c||Ne()+"/__utm.gif?";var d=new Image(1,1);d.src=c+
+a;Ie(d,function(){Ie(d,null);Je(d,null);b()});Je(d,function(){Ie(d,null);Je(d,null);b()})},ef=function(a,b){var c;c=W.XDomainRequest;if(!c)return!1;c=new c;c.open("POST",Ne()+"/p/__utm.gif");Je(c,function(){b()});Ie(c,b);c.send(a);return!0},df=function(a,b){var c=W.XMLHttpRequest;if(!c)return!1;var d=new c;if(!("withCredentials"in d))return!1;d.open("POST",Ne()+"/p/__utm.gif",!0);d.withCredentials=!0;d.setRequestHeader("Content-Type","text/plain");d.onreadystatechange=function(){4==d.readyState&&
+(b(),d=null)};d.send(a);return!0},Ee=function(a,b){if(!J.body)return We(function(){Ee(a,b)},100),!0;a=aa(a);try{var c=J[qa]('<iframe name="'+a+'"></iframe>')}catch(d){c=J[qa]("iframe"),ha(c,a)}c.height="0";c.width="0";c.style.display="none";c.style.visibility="hidden";var e=J[z],e=Ne()+"/u/post_iframe.html#"+aa(e[A]+"//"+e[u]+"/favicon.ico"),f=function(){c.src="";c.parentNode&&c.parentNode.removeChild(c)};Ga(W,"beforeunload",f);var Be=!1,k=0,s=function(){if(!Be){try{if(9<k||c.contentWindow[z][u]==
+J[z][u]){Be=!0;f();Ha(W,"beforeunload",f);b();return}}catch(a){}k++;ca(s,200)}};Ga(c,"load",s);J.body.appendChild(c);c.src=e;return!0};var $=function(){this.G=this.w=!1;this.C={};this.D=[];this.U=0;this.S=[["www.google-analytics.com","","/plugins/"]];this._gasoCPath=this._gasoDomain=this.bb=void 0;Re();Se()};E=$[x];E.oa=function(a,b){return this.r(a,void 0,b)};E.r=function(a,b,c){b&&H(23);c&&H(67);void 0==b&&(b="~"+M.U++);a=new U(b,a,c);M.C[b]=a;M.D[n](a);return a};E.u=function(a){a=a||"";return M.C[a]||M.r(void 0,a)};E.pa=function(){return M.D[ja](0)};E.ab=function(){return M.D[w]};E.aa=function(){this.w=!0};
+E.la=function(){this.G=!0};var Fe=function(a){if("prerender"==J.visibilityState)return!1;a();return!0};var M=new $;var nf=W._gat;nf&&Ba(nf._getTracker)?M=nf:W._gat=M;var Z=new Y;(function(a){if(!Fe(a)){H(123);var b=!1,c=function(){!b&&Fe(a)&&(b=!0,Ha(J,"visibilitychange",c))};Ga(J,"visibilitychange",c)}})(function(){var a=W._gaq,b=!1;if(a&&Ba(a[n])&&(b="[object Array]"==Object[x][v].call(Object(a)),!b)){Z=a;return}W._gaq=Z;b&&Z[n][ya](Z,a)});function Yc(a){var b=1,c=0,d;if(a)for(b=0,d=a[w]-1;0<=d;d--)c=a.charCodeAt(d),b=(b<<6&268435455)+c+(c<<14),c=b&266338304,b=0!=c?b^c>>21:b;return b};})();
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/i.gif b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/i.gif
new file mode 100644
index 000000000..3c51d740c
Binary files /dev/null and b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/i.gif differ
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery-in-action.jpg b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery-in-action.jpg
new file mode 100644
index 000000000..b40181129
Binary files /dev/null and b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery-in-action.jpg differ
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery-succinctly.jpg b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery-succinctly.jpg
new file mode 100644
index 000000000..463e09f82
Binary files /dev/null and b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery-succinctly.jpg differ
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery.js
new file mode 100644
index 000000000..006e95310
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/jquery.js
@@ -0,0 +1,5 @@
+/*! jQuery v1.9.1 | (c) 2005, 2012 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery.min.map
+*/(function(e,t){var n,r,i=typeof t,o=e.document,a=e.location,s=e.jQuery,u=e.$,l={},c=[],p="1.9.1",f=c.concat,d=c.push,h=c.slice,g=c.indexOf,m=l.toString,y=l.hasOwnProperty,v=p.trim,b=function(e,t){return new b.fn.init(e,t,r)},x=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,w=/\S+/g,T=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,C=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,k=/^[\],:{}\s]*$/,E=/(?:^|:|,)(?:\s*\[)+/g,S=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,A=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,j=/^-ms-/,D=/-([\da-z])/gi,L=function(e,t){return t.toUpperCase()},H=function(e){(o.addEventListener||"load"===e.type||"complete"===o.readyState)&&(q(),b.ready())},q=function(){o.addEventListener?(o.removeEventListener("DOMContentLoaded",H,!1),e.removeEventListener("load",H,!1)):(o.detachEvent("onreadystatechange",H),e.detachEvent("onload",H))};b.fn=b.prototype={jquery:p,constructor:b,init:function(e,n,r){var i,a;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof b?n[0]:n,b.merge(this,b.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:o,!0)),C.test(i[1])&&b.isPlainObject(n))for(i in n)b.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(a=o.getElementById(i[2]),a&&a.parentNode){if(a.id!==i[2])return r.find(e);this.length=1,this[0]=a}return this.context=o,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):b.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),b.makeArray(e,this))},selector:"",length:0,size:function(){return this.length},toArray:function(){return h.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=b.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return b.each(this,e,t)},ready:function(e){return b.ready.promise().done(e),this},slice:function(){return this.pushStack(h.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(b.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:d,sort:[].sort,splice:[].splice},b.fn.init.prototype=b.fn,b.extend=b.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},u=1,l=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},u=2),"object"==typeof s||b.isFunction(s)||(s={}),l===u&&(s=this,--u);l>u;u++)if(null!=(o=arguments[u]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(b.isPlainObject(r)||(n=b.isArray(r)))?(n?(n=!1,a=e&&b.isArray(e)?e:[]):a=e&&b.isPlainObject(e)?e:{},s[i]=b.extend(c,a,r)):r!==t&&(s[i]=r));return s},b.extend({noConflict:function(t){return e.$===b&&(e.$=u),t&&e.jQuery===b&&(e.jQuery=s),b},isReady:!1,readyWait:1,holdReady:function(e){e?b.readyWait++:b.ready(!0)},ready:function(e){if(e===!0?!--b.readyWait:!b.isReady){if(!o.body)return setTimeout(b.ready);b.isReady=!0,e!==!0&&--b.readyWait>0||(n.resolveWith(o,[b]),b.fn.trigger&&b(o).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===b.type(e)},isArray:Array.isArray||function(e){return"array"===b.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?l[m.call(e)]||"object":typeof e},isPlainObject:function(e){if(!e||"object"!==b.type(e)||e.nodeType||b.isWindow(e))return!1;try{if(e.constructor&&!y.call(e,"constructor")&&!y.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||y.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||o;var r=C.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=b.buildFragment([e],t,i),i&&b(i).remove(),b.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=b.trim(n),n&&k.test(n.replace(S,"@").replace(A,"]").replace(E,"")))?Function("return "+n)():(b.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||b.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&b.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(j,"ms-").replace(D,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:v&&!v.call("\ufeff\u00a0")?function(e){return null==e?"":v.call(e)}:function(e){return null==e?"":(e+"").replace(T,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?b.merge(n,"string"==typeof e?[e]:e):d.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(g)return g.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return f.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),b.isFunction(e)?(r=h.call(arguments,2),i=function(){return e.apply(n||this,r.concat(h.call(arguments)))},i.guid=e.guid=e.guid||b.guid++,i):t},access:function(e,n,r,i,o,a,s){var u=0,l=e.length,c=null==r;if("object"===b.type(r)){o=!0;for(u in r)b.access(e,n,u,r[u],!0,a,s)}else if(i!==t&&(o=!0,b.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(b(e),n)})),n))for(;l>u;u++)n(e[u],r,s?i:i.call(e[u],u,n(e[u],r)));return o?e:c?n.call(e):l?n(e[0],r):a},now:function(){return(new Date).getTime()}}),b.ready.promise=function(t){if(!n)if(n=b.Deferred(),"complete"===o.readyState)setTimeout(b.ready);else if(o.addEventListener)o.addEventListener("DOMContentLoaded",H,!1),e.addEventListener("load",H,!1);else{o.attachEvent("onreadystatechange",H),e.attachEvent("onload",H);var r=!1;try{r=null==e.frameElement&&o.documentElement}catch(i){}r&&r.doScroll&&function a(){if(!b.isReady){try{r.doScroll("left")}catch(e){return setTimeout(a,50)}q(),b.ready()}}()}return n.promise(t)},b.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){l["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=b.type(e);return b.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=b(o);var _={};function F(e){var t=_[e]={};return b.each(e.match(w)||[],function(e,n){t[n]=!0}),t}b.Callbacks=function(e){e="string"==typeof e?_[e]||F(e):b.extend({},e);var n,r,i,o,a,s,u=[],l=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=u.length,n=!0;u&&o>a;a++)if(u[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,u&&(l?l.length&&c(l.shift()):r?u=[]:p.disable())},p={add:function(){if(u){var t=u.length;(function i(t){b.each(t,function(t,n){var r=b.type(n);"function"===r?e.unique&&p.has(n)||u.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=u.length:r&&(s=t,c(r))}return this},remove:function(){return u&&b.each(arguments,function(e,t){var r;while((r=b.inArray(t,u,r))>-1)u.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?b.inArray(e,u)>-1:!(!u||!u.length)},empty:function(){return u=[],this},disable:function(){return u=l=r=t,this},disabled:function(){return!u},lock:function(){return l=t,r||p.disable(),this},locked:function(){return!l},fireWith:function(e,t){return t=t||[],t=[e,t.slice?t.slice():t],!u||i&&!l||(n?l.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},b.extend({Deferred:function(e){var t=[["resolve","done",b.Callbacks("once memory"),"resolved"],["reject","fail",b.Callbacks("once memory"),"rejected"],["notify","progress",b.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return b.Deferred(function(n){b.each(t,function(t,o){var a=o[0],s=b.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&b.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?b.extend(e,r):r}},i={};return r.pipe=r.then,b.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=h.call(arguments),r=n.length,i=1!==r||e&&b.isFunction(e.promise)?r:0,o=1===i?e:b.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?h.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,u,l;if(r>1)for(s=Array(r),u=Array(r),l=Array(r);r>t;t++)n[t]&&b.isFunction(n[t].promise)?n[t].promise().done(a(t,l,n)).fail(o.reject).progress(a(t,u,s)):--i;return i||o.resolveWith(l,n),o.promise()}}),b.support=function(){var t,n,r,a,s,u,l,c,p,f,d=o.createElement("div");if(d.setAttribute("className","t"),d.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*"),r=d.getElementsByTagName("a")[0],!n||!r||!n.length)return{};s=o.createElement("select"),l=s.appendChild(o.createElement("option")),a=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t={getSetAttribute:"t"!==d.className,leadingWhitespace:3===d.firstChild.nodeType,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/top/.test(r.getAttribute("style")),hrefNormalized:"/a"===r.getAttribute("href"),opacity:/^0.5/.test(r.style.opacity),cssFloat:!!r.style.cssFloat,checkOn:!!a.value,optSelected:l.selected,enctype:!!o.createElement("form").enctype,html5Clone:"<:nav></:nav>"!==o.createElement("nav").cloneNode(!0).outerHTML,boxModel:"CSS1Compat"===o.compatMode,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},a.checked=!0,t.noCloneChecked=a.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!l.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}a=o.createElement("input"),a.setAttribute("value",""),t.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),t.radioValue="t"===a.value,a.setAttribute("checked","t"),a.setAttribute("name","t"),u=o.createDocumentFragment(),u.appendChild(a),t.appendChecked=a.checked,t.checkClone=u.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;return d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip,b(function(){var n,r,a,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",u=o.getElementsByTagName("body")[0];u&&(n=o.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",u.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",a=d.getElementsByTagName("td"),a[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===a[0].offsetHeight,a[0].style.display="",a[1].style.display="none",t.reliableHiddenOffsets=p&&0===a[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",t.boxSizing=4===d.offsetWidth,t.doesNotIncludeMarginInBodyOffset=1!==u.offsetTop,e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(o.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(u.style.zoom=1)),u.removeChild(n),n=d=a=r=null)}),n=s=u=l=r=a=null,t}();var O=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,B=/([A-Z])/g;function P(e,n,r,i){if(b.acceptData(e)){var o,a,s=b.expando,u="string"==typeof n,l=e.nodeType,p=l?b.cache:e,f=l?e[s]:e[s]&&s;if(f&&p[f]&&(i||p[f].data)||!u||r!==t)return f||(l?e[s]=f=c.pop()||b.guid++:f=s),p[f]||(p[f]={},l||(p[f].toJSON=b.noop)),("object"==typeof n||"function"==typeof n)&&(i?p[f]=b.extend(p[f],n):p[f].data=b.extend(p[f].data,n)),o=p[f],i||(o.data||(o.data={}),o=o.data),r!==t&&(o[b.camelCase(n)]=r),u?(a=o[n],null==a&&(a=o[b.camelCase(n)])):a=o,a}}function R(e,t,n){if(b.acceptData(e)){var r,i,o,a=e.nodeType,s=a?b.cache:e,u=a?e[b.expando]:b.expando;if(s[u]){if(t&&(o=n?s[u]:s[u].data)){b.isArray(t)?t=t.concat(b.map(t,b.camelCase)):t in o?t=[t]:(t=b.camelCase(t),t=t in o?[t]:t.split(" "));for(r=0,i=t.length;i>r;r++)delete o[t[r]];if(!(n?$:b.isEmptyObject)(o))return}(n||(delete s[u].data,$(s[u])))&&(a?b.cleanData([e],!0):b.support.deleteExpando||s!=s.window?delete s[u]:s[u]=null)}}}b.extend({cache:{},expando:"jQuery"+(p+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(e){return e=e.nodeType?b.cache[e[b.expando]]:e[b.expando],!!e&&!$(e)},data:function(e,t,n){return P(e,t,n)},removeData:function(e,t){return R(e,t)},_data:function(e,t,n){return P(e,t,n,!0)},_removeData:function(e,t){return R(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&b.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),b.fn.extend({data:function(e,n){var r,i,o=this[0],a=0,s=null;if(e===t){if(this.length&&(s=b.data(o),1===o.nodeType&&!b._data(o,"parsedAttrs"))){for(r=o.attributes;r.length>a;a++)i=r[a].name,i.indexOf("data-")||(i=b.camelCase(i.slice(5)),W(o,i,s[i]));b._data(o,"parsedAttrs",!0)}return s}return"object"==typeof e?this.each(function(){b.data(this,e)}):b.access(this,function(n){return n===t?o?W(o,e,b.data(o,e)):null:(this.each(function(){b.data(this,e,n)}),t)},null,n,arguments.length>1,null,!0)},removeData:function(e){return this.each(function(){b.removeData(this,e)})}});function W(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(B,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:O.test(r)?b.parseJSON(r):r}catch(o){}b.data(e,n,r)}else r=t}return r}function $(e){var t;for(t in e)if(("data"!==t||!b.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}b.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=b._data(e,n),r&&(!i||b.isArray(r)?i=b._data(e,n,b.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=b.queue(e,t),r=n.length,i=n.shift(),o=b._queueHooks(e,t),a=function(){b.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),o.cur=i,i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return b._data(e,n)||b._data(e,n,{empty:b.Callbacks("once memory").add(function(){b._removeData(e,t+"queue"),b._removeData(e,n)})})}}),b.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?b.queue(this[0],e):n===t?this:this.each(function(){var t=b.queue(this,e,n);b._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&b.dequeue(this,e)})},dequeue:function(e){return this.each(function(){b.dequeue(this,e)})},delay:function(e,t){return e=b.fx?b.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=b.Deferred(),a=this,s=this.length,u=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=b._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(u));return u(),o.promise(n)}});var I,z,X=/[\t\r\n]/g,U=/\r/g,V=/^(?:input|select|textarea|button|object)$/i,Y=/^(?:a|area)$/i,J=/^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,G=/^(?:checked|selected)$/i,Q=b.support.getSetAttribute,K=b.support.input;b.fn.extend({attr:function(e,t){return b.access(this,b.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){b.removeAttr(this,e)})},prop:function(e,t){return b.access(this,b.prop,e,t,arguments.length>1)},removeProp:function(e){return e=b.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,u="string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).addClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=b.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,u=0===arguments.length||"string"==typeof e&&e;if(b.isFunction(e))return this.each(function(t){b(this).removeClass(e.call(this,t,this.className))});if(u)for(t=(e||"").match(w)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(X," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?b.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e,r="boolean"==typeof t;return b.isFunction(e)?this.each(function(n){b(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var o,a=0,s=b(this),u=t,l=e.match(w)||[];while(o=l[a++])u=r?u:!s.hasClass(o),s[u?"addClass":"removeClass"](o)}else(n===i||"boolean"===n)&&(this.className&&b._data(this,"__className__",this.className),this.className=this.className||e===!1?"":b._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(X," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=b.isFunction(e),this.each(function(n){var o,a=b(this);1===this.nodeType&&(o=i?e.call(this,n,a.val()):e,null==o?o="":"number"==typeof o?o+="":b.isArray(o)&&(o=b.map(o,function(e){return null==e?"":e+""})),r=b.valHooks[this.type]||b.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=b.valHooks[o.type]||b.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(U,""):null==n?"":n)}}}),b.extend({valHooks:{option:{get:function(e){var t=e.attributes.value;return!t||t.specified?e.value:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,u=0>i?s:o?i:0;for(;s>u;u++)if(n=r[u],!(!n.selected&&u!==i||(b.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&b.nodeName(n.parentNode,"optgroup"))){if(t=b(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n=b.makeArray(t);return b(e).find("option").each(function(){this.selected=b.inArray(b(this).val(),n)>=0}),n.length||(e.selectedIndex=-1),n}}},attr:function(e,n,r){var o,a,s,u=e.nodeType;if(e&&3!==u&&8!==u&&2!==u)return typeof e.getAttribute===i?b.prop(e,n,r):(a=1!==u||!b.isXMLDoc(e),a&&(n=n.toLowerCase(),o=b.attrHooks[n]||(J.test(n)?z:I)),r===t?o&&a&&"get"in o&&null!==(s=o.get(e,n))?s:(typeof e.getAttribute!==i&&(s=e.getAttribute(n)),null==s?t:s):null!==r?o&&a&&"set"in o&&(s=o.set(e,r,n))!==t?s:(e.setAttribute(n,r+""),r):(b.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(w);if(o&&1===e.nodeType)while(n=o[i++])r=b.propFix[n]||n,J.test(n)?!Q&&G.test(n)?e[b.camelCase("default-"+n)]=e[r]=!1:e[r]=!1:b.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!b.support.radioValue&&"radio"===t&&b.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!b.isXMLDoc(e),a&&(n=b.propFix[n]||n,o=b.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var n=e.getAttributeNode("tabindex");return n&&n.specified?parseInt(n.value,10):V.test(e.nodeName)||Y.test(e.nodeName)&&e.href?0:t}}}}),z={get:function(e,n){var r=b.prop(e,n),i="boolean"==typeof r&&e.getAttribute(n),o="boolean"==typeof r?K&&Q?null!=i:G.test(n)?e[b.camelCase("default-"+n)]:!!i:e.getAttributeNode(n);return o&&o.value!==!1?n.toLowerCase():t},set:function(e,t,n){return t===!1?b.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&b.propFix[n]||n,n):e[b.camelCase("default-"+n)]=e[n]=!0,n}},K&&Q||(b.attrHooks.value={get:function(e,n){var r=e.getAttributeNode(n);return b.nodeName(e,"input")?e.defaultValue:r&&r.specified?r.value:t},set:function(e,n,r){return b.nodeName(e,"input")?(e.defaultValue=n,t):I&&I.set(e,n,r)}}),Q||(I=b.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&("id"===n||"name"===n||"coords"===n?""!==r.value:r.specified)?r.value:t},set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},b.attrHooks.contenteditable={get:I.get,set:function(e,t,n){I.set(e,""===t?!1:t,n)}},b.each(["width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}})})),b.support.hrefNormalized||(b.each(["href","src","width","height"],function(e,n){b.attrHooks[n]=b.extend(b.attrHooks[n],{get:function(e){var r=e.getAttribute(n,2);return null==r?t:r}})}),b.each(["href","src"],function(e,t){b.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}})),b.support.style||(b.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),b.support.optSelected||(b.propHooks.selected=b.extend(b.propHooks.selected,{get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}})),b.support.enctype||(b.propFix.enctype="encoding"),b.support.checkOn||b.each(["radio","checkbox"],function(){b.valHooks[this]={get:function(e){return null===e.getAttribute("value")?"on":e.value}}}),b.each(["radio","checkbox"],function(){b.valHooks[this]=b.extend(b.valHooks[this],{set:function(e,n){return b.isArray(n)?e.checked=b.inArray(b(e).val(),n)>=0:t}})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}b.event={global:{},add:function(e,n,r,o,a){var s,u,l,c,p,f,d,h,g,m,y,v=b._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=b.guid++),(u=v.events)||(u=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof b===i||e&&b.event.triggered===e.type?t:b.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(w)||[""],l=n.length;while(l--)s=rt.exec(n[l])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),p=b.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=b.event.special[g]||{},d=b.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&b.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=u[g])||(h=u[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),b.event.global[g]=!0;e=null}},remove:function(e,t,n,r,i){var o,a,s,u,l,c,p,f,d,h,g,m=b.hasData(e)&&b._data(e);if(m&&(c=m.events)){t=(t||"").match(w)||[""],l=t.length;while(l--)if(s=rt.exec(t[l])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=b.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),u=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));u&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||b.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)b.event.remove(e,d+t[l],n,r,!0);b.isEmptyObject(c)&&(delete m.handle,b._removeData(e,"events"))}},trigger:function(n,r,i,a){var s,u,l,c,p,f,d,h=[i||o],g=y.call(n,"type")?n.type:n,m=y.call(n,"namespace")?n.namespace.split("."):[];if(l=f=i=i||o,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+b.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),u=0>g.indexOf(":")&&"on"+g,n=n[b.expando]?n:new b.Event(g,"object"==typeof n&&n),n.isTrigger=!0,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:b.makeArray(r,[n]),p=b.event.special[g]||{},a||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!a&&!p.noBubble&&!b.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(l=l.parentNode);l;l=l.parentNode)h.push(l),f=l;f===(i.ownerDocument||o)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((l=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(b._data(l,"events")||{})[n.type]&&b._data(l,"handle"),s&&s.apply(l,r),s=u&&l[u],s&&b.acceptData(l)&&s.apply&&s.apply(l,r)===!1&&n.preventDefault();if(n.type=g,!(a||n.isDefaultPrevented()||p._default&&p._default.apply(i.ownerDocument,r)!==!1||"click"===g&&b.nodeName(i,"a")||!b.acceptData(i)||!u||!i[g]||b.isWindow(i))){f=i[u],f&&(i[u]=null),b.event.triggered=g;try{i[g]()}catch(v){}b.event.triggered=t,f&&(i[u]=f)}return n.result}},dispatch:function(e){e=b.event.fix(e);var n,r,i,o,a,s=[],u=h.call(arguments),l=(b._data(this,"events")||{})[e.type]||[],c=b.event.special[e.type]||{};if(u[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=b.event.handlers.call(this,e,l),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((b.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,u),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],u=n.delegateCount,l=e.target;if(u&&l.nodeType&&(!e.button||"click"!==e.type))for(;l!=this;l=l.parentNode||this)if(1===l.nodeType&&(l.disabled!==!0||"click"!==e.type)){for(o=[],a=0;u>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?b(r,this).index(l)>=0:b.find(r,this,null,[l]).length),o[r]&&o.push(i);o.length&&s.push({elem:l,handlers:o})}return n.length>u&&s.push({elem:this,handlers:n.slice(u)}),s},fix:function(e){if(e[b.expando])return e;var t,n,r,i=e.type,a=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new b.Event(a),t=r.length;while(t--)n=r[t],e[n]=a[n];return e.target||(e.target=a.srcElement||o),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,a):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,a,s=n.button,u=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||o,a=i.documentElement,r=i.body,e.pageX=n.clientX+(a&&a.scrollLeft||r&&r.scrollLeft||0)-(a&&a.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(a&&a.scrollTop||r&&r.scrollTop||0)-(a&&a.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&u&&(e.relatedTarget=u===e.target?n.toElement:u),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},click:{trigger:function(){return b.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t}},focus:{trigger:function(){if(this!==o.activeElement&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===o.activeElement&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=b.extend(new b.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?b.event.trigger(i,null,t):b.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},b.removeEvent=o.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},b.Event=function(e,n){return this instanceof b.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&b.extend(this,n),this.timeStamp=e&&e.timeStamp||b.now(),this[b.expando]=!0,t):new b.Event(e,n)},b.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},b.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){b.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;
+return(!i||i!==r&&!b.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),b.support.submitBubbles||(b.event.special.submit={setup:function(){return b.nodeName(this,"form")?!1:(b.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=b.nodeName(n,"input")||b.nodeName(n,"button")?n.form:t;r&&!b._data(r,"submitBubbles")&&(b.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),b._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&b.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return b.nodeName(this,"form")?!1:(b.event.remove(this,"._submit"),t)}}),b.support.changeBubbles||(b.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(b.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),b.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),b.event.simulate("change",this,e,!0)})),!1):(b.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!b._data(t,"changeBubbles")&&(b.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||b.event.simulate("change",this.parentNode,e,!0)}),b._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return b.event.remove(this,"._change"),!Z.test(this.nodeName)}}),b.support.focusinBubbles||b.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){b.event.simulate(t,e.target,b.event.fix(e),!0)};b.event.special[t]={setup:function(){0===n++&&o.addEventListener(e,r,!0)},teardown:function(){0===--n&&o.removeEventListener(e,r,!0)}}}),b.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return b().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=b.guid++)),this.each(function(){b.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,b(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){b.event.remove(this,e,r,n)})},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},trigger:function(e,t){return this.each(function(){b.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?b.event.trigger(e,n,r,!0):t}}),function(e,t){var n,r,i,o,a,s,u,l,c,p,f,d,h,g,m,y,v,x="sizzle"+-new Date,w=e.document,T={},N=0,C=0,k=it(),E=it(),S=it(),A=typeof t,j=1<<31,D=[],L=D.pop,H=D.push,q=D.slice,M=D.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},_="[\\x20\\t\\r\\n\\f]",F="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=F.replace("w","w#"),B="([*^$|!~]?=)",P="\\["+_+"*("+F+")"+_+"*(?:"+B+_+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+O+")|)|)"+_+"*\\]",R=":("+F+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+P.replace(3,8)+")*)|.*)\\)|)",W=RegExp("^"+_+"+|((?:^|[^\\\\])(?:\\\\.)*)"+_+"+$","g"),$=RegExp("^"+_+"*,"+_+"*"),I=RegExp("^"+_+"*([\\x20\\t\\r\\n\\f>+~])"+_+"*"),z=RegExp(R),X=RegExp("^"+O+"$"),U={ID:RegExp("^#("+F+")"),CLASS:RegExp("^\\.("+F+")"),NAME:RegExp("^\\[name=['\"]?("+F+")['\"]?\\]"),TAG:RegExp("^("+F.replace("w","w*")+")"),ATTR:RegExp("^"+P),PSEUDO:RegExp("^"+R),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+_+"*(even|odd|(([+-]|)(\\d*)n|)"+_+"*(?:([+-]|)"+_+"*(\\d+)|))"+_+"*\\)|)","i"),needsContext:RegExp("^"+_+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+_+"*((?:-\\d)?\\d*)"+_+"*\\)|)(?=[^-]|$)","i")},V=/[\x20\t\r\n\f]*[+~]/,Y=/^[^{]+\{\s*\[native code/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,G=/^(?:input|select|textarea|button)$/i,Q=/^h\d$/i,K=/'|\\/g,Z=/\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,et=/\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,tt=function(e,t){var n="0x"+t-65536;return n!==n?t:0>n?String.fromCharCode(n+65536):String.fromCharCode(55296|n>>10,56320|1023&n)};try{q.call(w.documentElement.childNodes,0)[0].nodeType}catch(nt){q=function(e){var t,n=[];while(t=this[e++])n.push(t);return n}}function rt(e){return Y.test(e+"")}function it(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>i.cacheLength&&delete e[t.shift()],e[n]=r}}function ot(e){return e[x]=!0,e}function at(e){var t=p.createElement("div");try{return e(t)}catch(n){return!1}finally{t=null}}function st(e,t,n,r){var i,o,a,s,u,l,f,g,m,v;if((t?t.ownerDocument||t:w)!==p&&c(t),t=t||p,n=n||[],!e||"string"!=typeof e)return n;if(1!==(s=t.nodeType)&&9!==s)return[];if(!d&&!r){if(i=J.exec(e))if(a=i[1]){if(9===s){if(o=t.getElementById(a),!o||!o.parentNode)return n;if(o.id===a)return n.push(o),n}else if(t.ownerDocument&&(o=t.ownerDocument.getElementById(a))&&y(t,o)&&o.id===a)return n.push(o),n}else{if(i[2])return H.apply(n,q.call(t.getElementsByTagName(e),0)),n;if((a=i[3])&&T.getByClassName&&t.getElementsByClassName)return H.apply(n,q.call(t.getElementsByClassName(a),0)),n}if(T.qsa&&!h.test(e)){if(f=!0,g=x,m=t,v=9===s&&e,1===s&&"object"!==t.nodeName.toLowerCase()){l=ft(e),(f=t.getAttribute("id"))?g=f.replace(K,"\\$&"):t.setAttribute("id",g),g="[id='"+g+"'] ",u=l.length;while(u--)l[u]=g+dt(l[u]);m=V.test(e)&&t.parentNode||t,v=l.join(",")}if(v)try{return H.apply(n,q.call(m.querySelectorAll(v),0)),n}catch(b){}finally{f||t.removeAttribute("id")}}}return wt(e.replace(W,"$1"),t,n,r)}a=st.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},c=st.setDocument=function(e){var n=e?e.ownerDocument||e:w;return n!==p&&9===n.nodeType&&n.documentElement?(p=n,f=n.documentElement,d=a(n),T.tagNameNoComments=at(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),T.attributes=at(function(e){e.innerHTML="<select></select>";var t=typeof e.lastChild.getAttribute("multiple");return"boolean"!==t&&"string"!==t}),T.getByClassName=at(function(e){return e.innerHTML="<div class='hidden e'></div><div class='hidden'></div>",e.getElementsByClassName&&e.getElementsByClassName("e").length?(e.lastChild.className="e",2===e.getElementsByClassName("e").length):!1}),T.getByName=at(function(e){e.id=x+0,e.innerHTML="<a name='"+x+"'></a><div name='"+x+"'></div>",f.insertBefore(e,f.firstChild);var t=n.getElementsByName&&n.getElementsByName(x).length===2+n.getElementsByName(x+0).length;return T.getIdNotName=!n.getElementById(x),f.removeChild(e),t}),i.attrHandle=at(function(e){return e.innerHTML="<a href='#'></a>",e.firstChild&&typeof e.firstChild.getAttribute!==A&&"#"===e.firstChild.getAttribute("href")})?{}:{href:function(e){return e.getAttribute("href",2)},type:function(e){return e.getAttribute("type")}},T.getIdNotName?(i.find.ID=function(e,t){if(typeof t.getElementById!==A&&!d){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){return e.getAttribute("id")===t}}):(i.find.ID=function(e,n){if(typeof n.getElementById!==A&&!d){var r=n.getElementById(e);return r?r.id===e||typeof r.getAttributeNode!==A&&r.getAttributeNode("id").value===e?[r]:t:[]}},i.filter.ID=function(e){var t=e.replace(et,tt);return function(e){var n=typeof e.getAttributeNode!==A&&e.getAttributeNode("id");return n&&n.value===t}}),i.find.TAG=T.tagNameNoComments?function(e,n){return typeof n.getElementsByTagName!==A?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},i.find.NAME=T.getByName&&function(e,n){return typeof n.getElementsByName!==A?n.getElementsByName(name):t},i.find.CLASS=T.getByClassName&&function(e,n){return typeof n.getElementsByClassName===A||d?t:n.getElementsByClassName(e)},g=[],h=[":focus"],(T.qsa=rt(n.querySelectorAll))&&(at(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||h.push("\\["+_+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),e.querySelectorAll(":checked").length||h.push(":checked")}),at(function(e){e.innerHTML="<input type='hidden' i=''/>",e.querySelectorAll("[i^='']").length&&h.push("[*^$]="+_+"*(?:\"\"|'')"),e.querySelectorAll(":enabled").length||h.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),h.push(",.*:")})),(T.matchesSelector=rt(m=f.matchesSelector||f.mozMatchesSelector||f.webkitMatchesSelector||f.oMatchesSelector||f.msMatchesSelector))&&at(function(e){T.disconnectedMatch=m.call(e,"div"),m.call(e,"[s!='']:x"),g.push("!=",R)}),h=RegExp(h.join("|")),g=RegExp(g.join("|")),y=rt(f.contains)||f.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},v=f.compareDocumentPosition?function(e,t){var r;return e===t?(u=!0,0):(r=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t))?1&r||e.parentNode&&11===e.parentNode.nodeType?e===n||y(w,e)?-1:t===n||y(w,t)?1:0:4&r?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return u=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:0;if(o===a)return ut(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?ut(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},u=!1,[0,0].sort(v),T.detectDuplicates=u,p):p},st.matches=function(e,t){return st(e,null,null,t)},st.matchesSelector=function(e,t){if((e.ownerDocument||e)!==p&&c(e),t=t.replace(Z,"='$1']"),!(!T.matchesSelector||d||g&&g.test(t)||h.test(t)))try{var n=m.call(e,t);if(n||T.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(r){}return st(t,p,null,[e]).length>0},st.contains=function(e,t){return(e.ownerDocument||e)!==p&&c(e),y(e,t)},st.attr=function(e,t){var n;return(e.ownerDocument||e)!==p&&c(e),d||(t=t.toLowerCase()),(n=i.attrHandle[t])?n(e):d||T.attributes?e.getAttribute(t):((n=e.getAttributeNode(t))||e.getAttribute(t))&&e[t]===!0?t:n&&n.specified?n.value:null},st.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},st.uniqueSort=function(e){var t,n=[],r=1,i=0;if(u=!T.detectDuplicates,e.sort(v),u){for(;t=e[r];r++)t===e[r-1]&&(i=n.push(r));while(i--)e.splice(n[i],1)}return e};function ut(e,t){var n=t&&e,r=n&&(~t.sourceIndex||j)-(~e.sourceIndex||j);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function lt(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function ct(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function pt(e){return ot(function(t){return t=+t,ot(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}o=st.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=o(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=o(t);return n},i=st.selectors={cacheLength:50,createPseudo:ot,match:U,find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(et,tt),e[3]=(e[4]||e[5]||"").replace(et,tt),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||st.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&st.error(e[0]),e},PSEUDO:function(e){var t,n=!e[5]&&e[2];return U.CHILD.test(e[0])?null:(e[4]?e[2]=e[4]:n&&z.test(n)&&(t=ft(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){return"*"===e?function(){return!0}:(e=e.replace(et,tt).toLowerCase(),function(t){return t.nodeName&&t.nodeName.toLowerCase()===e})},CLASS:function(e){var t=k[e+" "];return t||(t=RegExp("(^|"+_+")"+e+"("+_+"|$)"))&&k(e,function(e){return t.test(e.className||typeof e.getAttribute!==A&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=st.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,u){var l,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!u&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[x]||(m[x]={}),l=c[e]||[],d=l[0]===N&&l[1],f=l[0]===N&&l[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[N,d,f];break}}else if(v&&(l=(t[x]||(t[x]={}))[e])&&l[0]===N)f=l[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[x]||(p[x]={}))[e]=[N,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=i.pseudos[e]||i.setFilters[e.toLowerCase()]||st.error("unsupported pseudo: "+e);return r[x]?r(t):r.length>1?(n=[e,e,"",t],i.setFilters.hasOwnProperty(e.toLowerCase())?ot(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=M.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:ot(function(e){var t=[],n=[],r=s(e.replace(W,"$1"));return r[x]?ot(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:ot(function(e){return function(t){return st(e,t).length>0}}),contains:ot(function(e){return function(t){return(t.textContent||t.innerText||o(t)).indexOf(e)>-1}}),lang:ot(function(e){return X.test(e||"")||st.error("unsupported lang: "+e),e=e.replace(et,tt).toLowerCase(),function(t){var n;do if(n=d?t.getAttribute("xml:lang")||t.getAttribute("lang"):t.lang)return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===p.activeElement&&(!p.hasFocus||p.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!i.pseudos.empty(e)},header:function(e){return Q.test(e.nodeName)},input:function(e){return G.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:pt(function(){return[0]}),last:pt(function(e,t){return[t-1]}),eq:pt(function(e,t,n){return[0>n?n+t:n]}),even:pt(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:pt(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:pt(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:pt(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}};for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})i.pseudos[n]=lt(n);for(n in{submit:!0,reset:!0})i.pseudos[n]=ct(n);function ft(e,t){var n,r,o,a,s,u,l,c=E[e+" "];if(c)return t?0:c.slice(0);s=e,u=[],l=i.preFilter;while(s){(!n||(r=$.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),u.push(o=[])),n=!1,(r=I.exec(s))&&(n=r.shift(),o.push({value:n,type:r[0].replace(W," ")}),s=s.slice(n.length));for(a in i.filter)!(r=U[a].exec(s))||l[a]&&!(r=l[a](r))||(n=r.shift(),o.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?st.error(e):E(e,u).slice(0)}function dt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function ht(e,t,n){var i=t.dir,o=n&&"parentNode"===i,a=C++;return t.first?function(t,n,r){while(t=t[i])if(1===t.nodeType||o)return e(t,n,r)}:function(t,n,s){var u,l,c,p=N+" "+a;if(s){while(t=t[i])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[i])if(1===t.nodeType||o)if(c=t[x]||(t[x]={}),(l=c[i])&&l[0]===p){if((u=l[1])===!0||u===r)return u===!0}else if(l=c[i]=[p],l[1]=e(t,n,s)||r,l[1]===!0)return!0}}function gt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function mt(e,t,n,r,i){var o,a=[],s=0,u=e.length,l=null!=t;for(;u>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),l&&t.push(s));return a}function yt(e,t,n,r,i,o){return r&&!r[x]&&(r=yt(r)),i&&!i[x]&&(i=yt(i,o)),ot(function(o,a,s,u){var l,c,p,f=[],d=[],h=a.length,g=o||xt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:mt(g,f,e,s,u),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,u),r){l=mt(y,d),r(l,[],s,u),c=l.length;while(c--)(p=l[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){l=[],c=y.length;while(c--)(p=y[c])&&l.push(m[c]=p);i(null,y=[],l,u)}c=y.length;while(c--)(p=y[c])&&(l=i?M.call(o,p):f[c])>-1&&(o[l]=!(a[l]=p))}}else y=mt(y===a?y.splice(h,y.length):y),i?i(null,a,y,u):H.apply(a,y)})}function vt(e){var t,n,r,o=e.length,a=i.relative[e[0].type],s=a||i.relative[" "],u=a?1:0,c=ht(function(e){return e===t},s,!0),p=ht(function(e){return M.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==l)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;o>u;u++)if(n=i.relative[e[u].type])f=[ht(gt(f),n)];else{if(n=i.filter[e[u].type].apply(null,e[u].matches),n[x]){for(r=++u;o>r;r++)if(i.relative[e[r].type])break;return yt(u>1&&gt(f),u>1&&dt(e.slice(0,u-1)).replace(W,"$1"),n,r>u&&vt(e.slice(u,r)),o>r&&vt(e=e.slice(r)),o>r&&dt(e))}f.push(n)}return gt(f)}function bt(e,t){var n=0,o=t.length>0,a=e.length>0,s=function(s,u,c,f,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,T=l,C=s||a&&i.find.TAG("*",d&&u.parentNode||u),k=N+=null==T?1:Math.random()||.1;for(w&&(l=u!==p&&u,r=n);null!=(h=C[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,u,c)){f.push(h);break}w&&(N=k,r=++n)}o&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,o&&b!==v){g=0;while(m=t[g++])m(x,y,u,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=L.call(f));y=mt(y)}H.apply(f,y),w&&!s&&y.length>0&&v+t.length>1&&st.uniqueSort(f)}return w&&(N=k,l=T),x};return o?ot(s):s}s=st.compile=function(e,t){var n,r=[],i=[],o=S[e+" "];if(!o){t||(t=ft(e)),n=t.length;while(n--)o=vt(t[n]),o[x]?r.push(o):i.push(o);o=S(e,bt(i,r))}return o};function xt(e,t,n){var r=0,i=t.length;for(;i>r;r++)st(e,t[r],n);return n}function wt(e,t,n,r){var o,a,u,l,c,p=ft(e);if(!r&&1===p.length){if(a=p[0]=p[0].slice(0),a.length>2&&"ID"===(u=a[0]).type&&9===t.nodeType&&!d&&i.relative[a[1].type]){if(t=i.find.ID(u.matches[0].replace(et,tt),t)[0],!t)return n;e=e.slice(a.shift().value.length)}o=U.needsContext.test(e)?0:a.length;while(o--){if(u=a[o],i.relative[l=u.type])break;if((c=i.find[l])&&(r=c(u.matches[0].replace(et,tt),V.test(a[0].type)&&t.parentNode||t))){if(a.splice(o,1),e=r.length&&dt(a),!e)return H.apply(n,q.call(r,0)),n;break}}}return s(e,p)(r,t,d,n,V.test(e)),n}i.pseudos.nth=i.pseudos.eq;function Tt(){}i.filters=Tt.prototype=i.pseudos,i.setFilters=new Tt,c(),st.attr=b.attr,b.find=st,b.expr=st.selectors,b.expr[":"]=b.expr.pseudos,b.unique=st.uniqueSort,b.text=st.getText,b.isXMLDoc=st.isXML,b.contains=st.contains}(e);var at=/Until$/,st=/^(?:parents|prev(?:Until|All))/,ut=/^.[^:#\[\.,]*$/,lt=b.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};b.fn.extend({find:function(e){var t,n,r,i=this.length;if("string"!=typeof e)return r=this,this.pushStack(b(e).filter(function(){for(t=0;i>t;t++)if(b.contains(r[t],this))return!0}));for(n=[],t=0;i>t;t++)b.find(e,this[t],n);return n=this.pushStack(i>1?b.unique(n):n),n.selector=(this.selector?this.selector+" ":"")+e,n},has:function(e){var t,n=b(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(b.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e,!1))},filter:function(e){return this.pushStack(ft(this,e,!0))},is:function(e){return!!e&&("string"==typeof e?lt.test(e)?b(e,this.context).index(this[0])>=0:b.filter(e,this).length>0:this.filter(e).length>0)},closest:function(e,t){var n,r=0,i=this.length,o=[],a=lt.test(e)||"string"!=typeof e?b(e,t||this.context):0;for(;i>r;r++){n=this[r];while(n&&n.ownerDocument&&n!==t&&11!==n.nodeType){if(a?a.index(n)>-1:b.find.matchesSelector(n,e)){o.push(n);break}n=n.parentNode}}return this.pushStack(o.length>1?b.unique(o):o)},index:function(e){return e?"string"==typeof e?b.inArray(this[0],b(e)):b.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?b(e,t):b.makeArray(e&&e.nodeType?[e]:e),r=b.merge(this.get(),n);return this.pushStack(b.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),b.fn.andSelf=b.fn.addBack;function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}b.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return b.dir(e,"parentNode")},parentsUntil:function(e,t,n){return b.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return b.dir(e,"nextSibling")},prevAll:function(e){return b.dir(e,"previousSibling")},nextUntil:function(e,t,n){return b.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return b.dir(e,"previousSibling",n)},siblings:function(e){return b.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return b.sibling(e.firstChild)},contents:function(e){return b.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:b.merge([],e.childNodes)}},function(e,t){b.fn[e]=function(n,r){var i=b.map(this,t,n);return at.test(e)||(r=n),r&&"string"==typeof r&&(i=b.filter(r,i)),i=this.length>1&&!ct[e]?b.unique(i):i,this.length>1&&st.test(e)&&(i=i.reverse()),this.pushStack(i)}}),b.extend({filter:function(e,t,n){return n&&(e=":not("+e+")"),1===t.length?b.find.matchesSelector(t[0],e)?[t[0]]:[]:b.find.matches(e,t)},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!b(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(t=t||0,b.isFunction(t))return b.grep(e,function(e,r){var i=!!t.call(e,r,e);return i===n});if(t.nodeType)return b.grep(e,function(e){return e===t===n});if("string"==typeof t){var r=b.grep(e,function(e){return 1===e.nodeType});if(ut.test(t))return b.filter(t,r,!n);t=b.filter(t,r)}return b.grep(e,function(e){return b.inArray(e,t)>=0===n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Nt=/^(?:checkbox|radio)$/i,Ct=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:b.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(o),Dt=jt.appendChild(o.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,b.fn.extend({text:function(e){return b.access(this,function(e){return e===t?b.text(this):this.empty().append((this[0]&&this[0].ownerDocument||o).createTextNode(e))},null,e,arguments.length)},wrapAll:function(e){if(b.isFunction(e))return this.each(function(t){b(this).wrapAll(e.call(this,t))});if(this[0]){var t=b(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return b.isFunction(e)?this.each(function(t){b(this).wrapInner(e.call(this,t))}):this.each(function(){var t=b(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=b.isFunction(e);return this.each(function(n){b(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){b.nodeName(this,"body")||b(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.appendChild(e)})},prepend:function(){return this.domManip(arguments,!0,function(e){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&this.insertBefore(e,this.firstChild)})},before:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,!1,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=0;for(;null!=(n=this[r]);r++)(!e||b.filter(e,[n]).length>0)&&(t||1!==n.nodeType||b.cleanData(Ot(n)),n.parentNode&&(t&&b.contains(n.ownerDocument,n)&&Mt(Ot(n,"script")),n.parentNode.removeChild(n)));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&b.cleanData(Ot(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&b.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return b.clone(this,e,t)})},html:function(e){return b.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!b.support.htmlSerialize&&mt.test(e)||!b.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(b.cleanData(Ot(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(e){var t=b.isFunction(e);return t||"string"==typeof e||(e=b(e).not(this).detach()),this.domManip([e],!0,function(e){var t=this.nextSibling,n=this.parentNode;n&&(b(this).remove(),n.insertBefore(e,t))})},detach:function(e){return this.remove(e,!0)},domManip:function(e,n,r){e=f.apply([],e);var i,o,a,s,u,l,c=0,p=this.length,d=this,h=p-1,g=e[0],m=b.isFunction(g);if(m||!(1>=p||"string"!=typeof g||b.support.checkClone)&&Ct.test(g))return this.each(function(i){var o=d.eq(i);m&&(e[0]=g.call(this,i,n?o.html():t)),o.domManip(e,n,r)});if(p&&(l=b.buildFragment(e,this[0].ownerDocument,!1,this),i=l.firstChild,1===l.childNodes.length&&(l=i),i)){for(n=n&&b.nodeName(i,"tr"),s=b.map(Ot(l,"script"),Ht),a=s.length;p>c;c++)o=l,c!==h&&(o=b.clone(o,!0,!0),a&&b.merge(s,Ot(o,"script"))),r.call(n&&b.nodeName(this[c],"table")?Lt(this[c],"tbody"):this[c],o,c);if(a)for(u=s[s.length-1].ownerDocument,b.map(s,qt),c=0;a>c;c++)o=s[c],kt.test(o.type||"")&&!b._data(o,"globalEval")&&b.contains(u,o)&&(o.src?b.ajax({url:o.src,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0}):b.globalEval((o.text||o.textContent||o.innerHTML||"").replace(St,"")));l=i=null}return this}});function Lt(e,t){return e.getElementsByTagName(t)[0]||e.appendChild(e.ownerDocument.createElement(t))}function Ht(e){var t=e.getAttributeNode("type");return e.type=(t&&t.specified)+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function Mt(e,t){var n,r=0;for(;null!=(n=e[r]);r++)b._data(n,"globalEval",!t||b._data(t[r],"globalEval"))}function _t(e,t){if(1===t.nodeType&&b.hasData(e)){var n,r,i,o=b._data(e),a=b._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)b.event.add(t,n,s[n][r])}a.data&&(a.data=b.extend({},a.data))}}function Ft(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!b.support.noCloneEvent&&t[b.expando]){i=b._data(t);for(r in i.events)b.removeEvent(t,r,i.handle);t.removeAttribute(b.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),b.support.html5Clone&&e.innerHTML&&!b.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Nt.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}b.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){b.fn[e]=function(e){var n,r=0,i=[],o=b(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),b(o[r])[t](n),d.apply(i,n.get());return this.pushStack(i)}});function Ot(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||b.nodeName(o,n)?s.push(o):b.merge(s,Ot(o,n));return n===t||n&&b.nodeName(e,n)?b.merge([e],s):s}function Bt(e){Nt.test(e.type)&&(e.defaultChecked=e.checked)}b.extend({clone:function(e,t,n){var r,i,o,a,s,u=b.contains(e.ownerDocument,e);if(b.support.html5Clone||b.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(b.support.noCloneEvent&&b.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||b.isXMLDoc(e)))for(r=Ot(o),s=Ot(e),a=0;null!=(i=s[a]);++a)r[a]&&Ft(i,r[a]);if(t)if(n)for(s=s||Ot(e),r=r||Ot(o),a=0;null!=(i=s[a]);a++)_t(i,r[a]);else _t(e,o);return r=Ot(o,"script"),r.length>0&&Mt(r,!u&&Ot(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,u,l,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===b.type(o))b.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),u=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[u]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!b.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!b.support.tbody){o="table"!==u||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)b.nodeName(l=o.childNodes[i],"tbody")&&!l.childNodes.length&&o.removeChild(l)
+}b.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),b.support.appendChecked||b.grep(Ot(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===b.inArray(o,r))&&(a=b.contains(o.ownerDocument,o),s=Ot(f.appendChild(o),"script"),a&&Mt(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,u=b.expando,l=b.cache,p=b.support.deleteExpando,f=b.event.special;for(;null!=(n=e[s]);s++)if((t||b.acceptData(n))&&(o=n[u],a=o&&l[o])){if(a.events)for(r in a.events)f[r]?b.event.remove(n,r):b.removeEvent(n,r,a.handle);l[o]&&(delete l[o],p?delete n[u]:typeof n.removeAttribute!==i?n.removeAttribute(u):n[u]=null,c.push(o))}}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+x+")(.*)$","i"),Yt=RegExp("^("+x+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+x+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===b.css(e,"display")||!b.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=b._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=b._data(r,"olddisplay",un(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&b._data(r,"olddisplay",i?n:b.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}b.fn.extend({css:function(e,n){return b.access(this,function(e,n,r){var i,o,a={},s=0;if(b.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=b.css(e,n[s],!1,o);return a}return r!==t?b.style(e,n,r):b.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){var t="boolean"==typeof e;return this.each(function(){(t?e:nn(this))?b(this).show():b(this).hide()})}}),b.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":b.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,u=b.camelCase(n),l=e.style;if(n=b.cssProps[u]||(b.cssProps[u]=tn(l,u)),s=b.cssHooks[n]||b.cssHooks[u],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:l[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(b.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||b.cssNumber[u]||(r+="px"),b.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(l[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{l[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,u=b.camelCase(n);return n=b.cssProps[u]||(b.cssProps[u]=tn(e.style,u)),s=b.cssHooks[n]||b.cssHooks[u],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||b.isNumeric(o)?o||0:a):a},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s.getPropertyValue(n)||s[n]:t,l=e.style;return s&&(""!==u||b.contains(e.ownerDocument,e)||(u=b.style(e,n)),Yt.test(u)&&Ut.test(n)&&(i=l.width,o=l.minWidth,a=l.maxWidth,l.minWidth=l.maxWidth=l.width=u,u=s.width,l.width=i,l.minWidth=o,l.maxWidth=a)),u}):o.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),u=s?s[n]:t,l=e.style;return null==u&&l&&l[n]&&(u=l[n]),Yt.test(u)&&!zt.test(n)&&(i=l.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),l.left="fontSize"===n?"1em":u,u=l.pixelLeft+"px",l.left=i,a&&(o.left=a)),""===u?"auto":u});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=b.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=b.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=b.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=b.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=b.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(b.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function un(e){var t=o,n=Gt[e];return n||(n=ln(e,t),"none"!==n&&n||(Pt=(Pt||b("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=ln(e,t),Pt.detach()),Gt[e]=n),n}function ln(e,t){var n=b(t.createElement(e)).appendTo(t.body),r=b.css(n[0],"display");return n.remove(),r}b.each(["height","width"],function(e,n){b.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(b.css(e,"display"))?b.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,b.support.boxSizing&&"border-box"===b.css(e,"boxSizing",!1,i),i):0)}}}),b.support.opacity||(b.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=b.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===b.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),b(function(){b.support.reliableMarginRight||(b.cssHooks.marginRight={get:function(e,n){return n?b.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!b.support.pixelPosition&&b.fn.position&&b.each(["top","left"],function(e,n){b.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?b(e).position()[n]+"px":r):t}}})}),b.expr&&b.expr.filters&&(b.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!b.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||b.css(e,"display"))},b.expr.filters.visible=function(e){return!b.expr.filters.hidden(e)}),b.each({margin:"",padding:"",border:"Width"},function(e,t){b.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(b.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;b.fn.extend({serialize:function(){return b.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=b.prop(this,"elements");return e?b.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!b(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Nt.test(e))}).map(function(e,t){var n=b(this).val();return null==n?null:b.isArray(n)?b.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),b.param=function(e,n){var r,i=[],o=function(e,t){t=b.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=b.ajaxSettings&&b.ajaxSettings.traditional),b.isArray(e)||e.jquery&&!b.isPlainObject(e))b.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(b.isArray(t))b.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==b.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}b.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){b.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),b.fn.hover=function(e,t){return this.mouseenter(e).mouseleave(t||e)};var mn,yn,vn=b.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Nn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Cn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=b.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=a.href}catch(Ln){yn=o.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(w)||[];if(b.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(u){var l;return o[u]=!0,b.each(e[u]||[],function(e,u){var c=u(n,r,i);return"string"!=typeof c||a||o[c]?a?!(l=c):t:(n.dataTypes.unshift(c),s(c),!1)}),l}return s(n.dataTypes[0])||!o["*"]&&s("*")}function Mn(e,n){var r,i,o=b.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&b.extend(!0,e,r),e}b.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,u=e.indexOf(" ");return u>=0&&(i=e.slice(u,e.length),e=e.slice(0,u)),b.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&b.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?b("<div>").append(b.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},b.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){b.fn[t]=function(e){return this.on(t,e)}}),b.each(["get","post"],function(e,n){b[n]=function(e,r,i,o){return b.isFunction(r)&&(o=o||i,i=r,r=t),b.ajax({url:e,type:n,dataType:o,data:r,success:i})}}),b.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Nn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":b.parseJSON,"text xml":b.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Mn(Mn(e,b.ajaxSettings),t):Mn(b.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,u,l,c,p=b.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?b(f):b.event,h=b.Deferred(),g=b.Callbacks("once memory"),m=p.statusCode||{},y={},v={},x=0,T="canceled",N={readyState:0,getResponseHeader:function(e){var t;if(2===x){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===x?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return x||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return x||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>x)for(t in e)m[t]=[m[t],e[t]];else N.always(e[N.status]);return this},abort:function(e){var t=e||T;return l&&l.abort(t),k(0,t),this}};if(h.promise(N).complete=g.add,N.success=N.done,N.error=N.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=b.trim(p.dataType||"*").toLowerCase().match(w)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?80:443))==(mn[3]||("http:"===mn[1]?80:443)))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=b.param(p.data,p.traditional)),qn(An,p,n,N),2===x)return N;u=p.global,u&&0===b.active++&&b.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Cn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(b.lastModified[o]&&N.setRequestHeader("If-Modified-Since",b.lastModified[o]),b.etag[o]&&N.setRequestHeader("If-None-Match",b.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&N.setRequestHeader("Content-Type",p.contentType),N.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)N.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,N,p)===!1||2===x))return N.abort();T="abort";for(i in{success:1,error:1,complete:1})N[i](p[i]);if(l=qn(jn,p,n,N)){N.readyState=1,u&&d.trigger("ajaxSend",[N,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){N.abort("timeout")},p.timeout));try{x=1,l.send(y,k)}catch(C){if(!(2>x))throw C;k(-1,C)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,C=n;2!==x&&(x=2,s&&clearTimeout(s),l=t,a=i||"",N.readyState=e>0?4:0,r&&(w=_n(p,N,r)),e>=200&&300>e||304===e?(p.ifModified&&(T=N.getResponseHeader("Last-Modified"),T&&(b.lastModified[o]=T),T=N.getResponseHeader("etag"),T&&(b.etag[o]=T)),204===e?(c=!0,C="nocontent"):304===e?(c=!0,C="notmodified"):(c=Fn(p,w),C=c.state,y=c.data,v=c.error,c=!v)):(v=C,(e||!C)&&(C="error",0>e&&(e=0))),N.status=e,N.statusText=(n||C)+"",c?h.resolveWith(f,[y,C,N]):h.rejectWith(f,[N,C,v]),N.statusCode(m),m=t,u&&d.trigger(c?"ajaxSuccess":"ajaxError",[N,p,c?y:v]),g.fireWith(f,[N,C]),u&&(d.trigger("ajaxComplete",[N,p]),--b.active||b.event.trigger("ajaxStop")))}return N},getScript:function(e,n){return b.get(e,t,n,"script")},getJSON:function(e,t,n){return b.get(e,t,n,"json")}});function _n(e,n,r){var i,o,a,s,u=e.contents,l=e.dataTypes,c=e.responseFields;for(s in c)s in r&&(n[c[s]]=r[s]);while("*"===l[0])l.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in u)if(u[s]&&u[s].test(o)){l.unshift(s);break}if(l[0]in r)a=l[0];else{for(s in r){if(!l[0]||e.converters[s+" "+l[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==l[0]&&l.unshift(a),r[a]):t}function Fn(e,t){var n,r,i,o,a={},s=0,u=e.dataTypes.slice(),l=u[0];if(e.dataFilter&&(t=e.dataFilter(t,e.dataType)),u[1])for(i in e.converters)a[i.toLowerCase()]=e.converters[i];for(;r=u[++s];)if("*"!==r){if("*"!==l&&l!==r){if(i=a[l+" "+r]||a["* "+r],!i)for(n in a)if(o=n.split(" "),o[1]===r&&(i=a[l+" "+o[0]]||a["* "+o[0]])){i===!0?i=a[n]:a[n]!==!0&&(r=o[0],u.splice(s--,0,r));break}if(i!==!0)if(i&&e["throws"])t=i(t);else try{t=i(t)}catch(c){return{state:"parsererror",error:i?c:"No conversion from "+l+" to "+r}}}l=r}return{state:"success",data:t}}b.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return b.globalEval(e),e}}}),b.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),b.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=o.head||b("head")[0]||o.documentElement;return{send:function(t,i){n=o.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var On=[],Bn=/(=)\?(?=&|$)|\?\?/;b.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=On.pop()||b.expando+"_"+vn++;return this[e]=!0,e}}),b.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,u=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return u||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=b.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,u?n[u]=n[u].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||b.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,On.push(o)),s&&b.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}b.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=b.ajaxSettings.xhr(),b.support.cors=!!Rn&&"withCredentials"in Rn,Rn=b.support.ajax=!!Rn,Rn&&b.ajaxTransport(function(n){if(!n.crossDomain||b.support.cors){var r;return{send:function(i,o){var a,s,u=n.xhr();if(n.username?u.open(n.type,n.url,n.async,n.username,n.password):u.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)u[s]=n.xhrFields[s];n.mimeType&&u.overrideMimeType&&u.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)u.setRequestHeader(s,i[s])}catch(l){}u.send(n.hasContent&&n.data||null),r=function(e,i){var s,l,c,p;try{if(r&&(i||4===u.readyState))if(r=t,a&&(u.onreadystatechange=b.noop,$n&&delete Pn[a]),i)4!==u.readyState&&u.abort();else{p={},s=u.status,l=u.getAllResponseHeaders(),"string"==typeof u.responseText&&(p.text=u.responseText);try{c=u.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,l)},n.async?4===u.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},b(e).unload($n)),Pn[a]=r),u.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+x+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n,r,i=this.createTween(e,t),o=Yn.exec(t),a=i.cur(),s=+a||0,u=1,l=20;if(o){if(n=+o[2],r=o[3]||(b.cssNumber[e]?"":"px"),"px"!==r&&s){s=b.css(i.elem,e,!0)||n||1;do u=u||".5",s/=u,b.style(i.elem,e,s+r);while(u!==(u=i.cur()/a)&&1!==u&&--l)}i.unit=r,i.start=s,i.end=o[1]?s+(o[1]+1)*n:n}return i}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=b.now()}function Zn(e,t){b.each(t,function(t,n){var r=(Qn[t]||[]).concat(Qn["*"]),i=0,o=r.length;for(;o>i;i++)if(r[i].call(e,t,n))return})}function er(e,t,n){var r,i,o=0,a=Gn.length,s=b.Deferred().always(function(){delete u.elem}),u=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,l.startTime+l.duration-t),r=n/l.duration||0,o=1-r,a=0,u=l.tweens.length;for(;u>a;a++)l.tweens[a].run(o);return s.notifyWith(e,[l,o,n]),1>o&&u?n:(s.resolveWith(e,[l]),!1)},l=s.promise({elem:e,props:b.extend({},t),opts:b.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=b.Tween(e,l.opts,t,n,l.opts.specialEasing[t]||l.opts.easing);return l.tweens.push(r),r},stop:function(t){var n=0,r=t?l.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)l.tweens[n].run(1);return t?s.resolveWith(e,[l,t]):s.rejectWith(e,[l,t]),this}}),c=l.props;for(tr(c,l.opts.specialEasing);a>o;o++)if(r=Gn[o].call(l,e,c,l.opts))return r;return Zn(l,c),b.isFunction(l.opts.start)&&l.opts.start.call(e,l),b.fx.timer(b.extend(u,{elem:e,anim:l,queue:l.opts.queue})),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always)}function tr(e,t){var n,r,i,o,a;for(i in e)if(r=b.camelCase(i),o=t[r],n=e[i],b.isArray(n)&&(o=n[1],n=e[i]=n[0]),i!==r&&(e[r]=n,delete e[i]),a=b.cssHooks[r],a&&"expand"in a){n=a.expand(n),delete e[r];for(i in n)i in e||(e[i]=n[i],t[i]=o)}else t[r]=o}b.Animation=b.extend(er,{tweener:function(e,t){b.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,u,l,c,p,f=this,d=e.style,h={},g=[],m=e.nodeType&&nn(e);n.queue||(c=b._queueHooks(e,"fx"),null==c.unqueued&&(c.unqueued=0,p=c.empty.fire,c.empty.fire=function(){c.unqueued||p()}),c.unqueued++,f.always(function(){f.always(function(){c.unqueued--,b.queue(e,"fx").length||c.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[d.overflow,d.overflowX,d.overflowY],"inline"===b.css(e,"display")&&"none"===b.css(e,"float")&&(b.support.inlineBlockNeedsLayout&&"inline"!==un(e.nodeName)?d.zoom=1:d.display="inline-block")),n.overflow&&(d.overflow="hidden",b.support.shrinkWrapBlocks||f.always(function(){d.overflow=n.overflow[0],d.overflowX=n.overflow[1],d.overflowY=n.overflow[2]}));for(i in t)if(a=t[i],Vn.exec(a)){if(delete t[i],u=u||"toggle"===a,a===(m?"hide":"show"))continue;g.push(i)}if(o=g.length){s=b._data(e,"fxshow")||b._data(e,"fxshow",{}),"hidden"in s&&(m=s.hidden),u&&(s.hidden=!m),m?b(e).show():f.done(function(){b(e).hide()}),f.done(function(){var t;b._removeData(e,"fxshow");for(t in h)b.style(e,t,h[t])});for(i=0;o>i;i++)r=g[i],l=f.createTween(r,m?s[r]:0),h[r]=s[r]||b.style(e,r),r in s||(s[r]=l.start,m&&(l.end=l.start,l.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}b.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(b.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?b.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=b.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){b.fx.step[e.prop]?b.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[b.cssProps[e.prop]]||b.cssHooks[e.prop])?b.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},b.each(["toggle","show","hide"],function(e,t){var n=b.fn[t];b.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),b.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=b.isEmptyObject(e),o=b.speed(t,n,r),a=function(){var t=er(this,b.extend({},e),o);a.finish=function(){t.stop(!0)},(i||b._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=b.timers,a=b._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&b.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=b._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=b.timers,a=r?r.length:0;for(n.finish=!0,b.queue(this,e,[]),i&&i.cur&&i.cur.finish&&i.cur.finish.call(this),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}b.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){b.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),b.speed=function(e,t,n){var r=e&&"object"==typeof e?b.extend({},e):{complete:n||!n&&t||b.isFunction(e)&&e,duration:e,easing:n&&t||t&&!b.isFunction(t)&&t};return r.duration=b.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in b.fx.speeds?b.fx.speeds[r.duration]:b.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){b.isFunction(r.old)&&r.old.call(this),r.queue&&b.dequeue(this,r.queue)},r},b.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},b.timers=[],b.fx=rr.prototype.init,b.fx.tick=function(){var e,n=b.timers,r=0;for(Xn=b.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||b.fx.stop(),Xn=t},b.fx.timer=function(e){e()&&b.timers.push(e)&&b.fx.start()},b.fx.interval=13,b.fx.start=function(){Un||(Un=setInterval(b.fx.tick,b.fx.interval))},b.fx.stop=function(){clearInterval(Un),Un=null},b.fx.speeds={slow:600,fast:200,_default:400},b.fx.step={},b.expr&&b.expr.filters&&(b.expr.filters.animated=function(e){return b.grep(b.timers,function(t){return e===t.elem}).length}),b.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){b.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,b.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},b.offset={setOffset:function(e,t,n){var r=b.css(e,"position");"static"===r&&(e.style.position="relative");var i=b(e),o=i.offset(),a=b.css(e,"top"),s=b.css(e,"left"),u=("absolute"===r||"fixed"===r)&&b.inArray("auto",[a,s])>-1,l={},c={},p,f;u?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),b.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(l.top=t.top-o.top+p),null!=t.left&&(l.left=t.left-o.left+f),"using"in t?t.using.call(e,l):i.css(l)}},b.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===b.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),b.nodeName(e[0],"html")||(n=e.offset()),n.top+=b.css(e[0],"borderTopWidth",!0),n.left+=b.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-b.css(r,"marginTop",!0),left:t.left-n.left-b.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||o.documentElement;while(e&&!b.nodeName(e,"html")&&"static"===b.css(e,"position"))e=e.offsetParent;return e||o.documentElement})}}),b.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);b.fn[e]=function(i){return b.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?b(a).scrollLeft():o,r?o:b(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return b.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}b.each({Height:"height",Width:"width"},function(e,n){b.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){b.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return b.access(this,function(n,r,i){var o;return b.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?b.css(n,r,s):b.style(n,r,i,s)},n,a?i:t,a,null)}})}),e.jQuery=e.$=b,"function"==typeof define&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return b})})(window);
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/learning-jquery-4th-ed.jpg b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/learning-jquery-4th-ed.jpg
new file mode 100644
index 000000000..1d228d9e2
Binary files /dev/null and b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/learning-jquery-4th-ed.jpg differ
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/main.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/main.js
new file mode 100644
index 000000000..312d371b8
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/main.js
@@ -0,0 +1,391 @@
+/*
+ * All sites
+ */
+$(function() {
+ // copyable auto-select-all
+ $( ".copyable" ).on( "click", function() {
+ if ( typeof this.select === "function" ) {
+ this.select();
+ }
+ });
+
+ /*
+ * Change navigation elements for smaller screens
+ */
+ (function() {
+
+ // Move the global nav to the footer and collapse to a select menu
+ var globalLinks = $( "#global-nav .links" ).tinyNav({ header: "Browse..." }),
+ nav = globalLinks.next(),
+ container = $( "<div class='tinynav-container'></div>" ),
+ header = $( "<h3><span>More jQuery Sites</span></h3>" );
+
+ container.append( header, nav ).insertBefore( "ul.footer-icon-links" );
+
+ // Collapse the site navigation to a select menu
+ $( "#menu-top" ).tinyNav({ header: "Navigate..." });
+ })();
+
+ // Banner ads
+ (function() {
+
+ // Default site id
+ var siteId = 53829,
+
+ // Sites can contain two properties: all and homepage
+ site = ({
+ "jquery.com": {
+ homepage: 32018
+ }
+ })[ $( "head" ).attr( "data-live-domain" ) ];
+
+ if ( site ) {
+ if ( location.pathname === "/" && site.homepage ) {
+ siteId = site.homepage;
+ } else if ( site.all ) {
+ siteId = site.all;
+ }
+ }
+
+ window.ados = {
+ run: [function() {
+ ados_add_placement( 5449, siteId, "broadcast", 1314 );
+ ados_load();
+ }]
+ };
+
+ $.getScript( "//engine.adzerk.net/ados.js" );
+ })();
+});
+
+
+
+
+
+/*
+ * API sites
+ */
+$(function() {
+ $( ".entry-example" ).each(function() {
+ var iframeSrc,
+ src = $( this ).find( ".syntaxhighlighter" ),
+ output = $( this ).find( ".code-demo" );
+
+ if ( !src.length || !output.length ) {
+ return;
+ }
+
+ // Get the original source
+ iframeSrc = src.find( "td.code .line" ).map(function() {
+ // Convert non-breaking spaces from highlighted code to normal spaces
+ return $( this ).text().replace( /\xa0/g, " " );
+ // Restore new lines from original source
+ }).get().join( "\n" );
+
+ iframeSrc = iframeSrc
+ // Insert styling for the live demo that we don't want in the
+ // highlighted code
+ .replace( "</head>",
+ "<style>" +
+ "html, body { border:0; margin:0; padding:0; }" +
+ "body { font-family: 'Helvetica', 'Arial', 'Verdana', 'sans-serif'; }" +
+ "</style>" +
+ "</head>" )
+ // IE <10 executes scripts in the order in which they're loaded,
+ // not the order in which they're written. So we need to defer inline
+ // scripts so that scripts which need to be fetched are executed first.
+ .replace( /<script>([\s\S]+)<\/script>/,
+ "<script>" +
+ "window.onload = function() {" +
+ "$1" +
+ "};" +
+ "</script>" );
+
+ var iframe = document.createElement( "iframe" );
+ iframe.width = "100%";
+ iframe.height = output.attr( "data-height" ) || 250;
+ output.append( iframe );
+
+ var doc = (iframe.contentWindow || iframe.contentDocument).document;
+ doc.write( iframeSrc );
+ doc.close();
+ });
+});
+
+
+
+
+
+/*
+ * jquery.org
+ */
+$(function() {
+ $(".flexslider").flexslider({
+ controlNav: "false"
+ });
+
+ /*
+ * Join page
+ */
+ (function() {
+ function isEmail( str ) {
+ return (/^[a-zA-Z0-9.!#$%&'*+\/=?\^_`{|}~\-]+@[a-zA-Z0-9\-]+(?:\.[a-zA-Z0-9\-]+)*$/).test( str );
+ }
+
+ // Enlarged gifts
+ $(".enlarge").colorbox();
+
+ // Gift forms
+ var gifts = $(".choose-gifts").hide();
+ $(".member-level .join").on( "click", function() {
+ var gift = $( this ).nextAll(".choose-gifts").slideToggle();
+ gifts.not( gift ).slideUp();
+ });
+
+ // Coupon codes
+ var couponDiscount = 0;
+ $( "[name='coupon']" ).each(function() {
+
+ var input = $( this ),
+ payButtons = input.closest( "form" ).find( ".pay" );
+
+ // Hide input by default, replace with a link to show the input
+ input.hide();
+ $( "<a href='#'>" )
+ .text( "Have a coupon code?" )
+ .on( "click", function( event ) {
+ event.preventDefault();
+ $( this ).hide();
+ input.show().focus();
+ })
+ .insertAfter( input );
+
+ // TODO: loading indicator
+ // Verify the coupon code on blur
+ input.on( "blur", function() {
+ var couponId = input.val().toLowerCase();
+
+ // Disable pay buttons while we're verifying the coupon
+ payButtons.prop( "disabled", true );
+
+ // Verify the coupon
+ $.ajax({
+ url: StripeForm.url,
+ dataType: "json",
+ data: {
+ action: "stripe_coupon",
+ coupon: couponId
+ }
+ })
+ .done(function( coupon ) {
+
+ // Adjust payment buttons
+ payButtons.each(function() {
+ var amount,
+ button = $( this );
+
+ // Hide quarterly buttons
+ if ( button.text().match( /Quarterly/ ) ) {
+ button.hide();
+ }
+
+ // Adjust annual buttons
+ if ( button.text().match( /Annual/ ) ) {
+ amount = parseInt( button.data( "amount" ), 10 );
+ if ( coupon.percent_off ) {
+ couponDiscount = amount * (coupon.percent_off / 100);
+ } else if ( coupon.amount_off ) {
+ couponDiscount = coupon.amount_off;
+ }
+
+ // If the coupon is worth more than the membership,
+ // don't show a negative value for the payment button
+ couponDiscount = Math.min( amount, couponDiscount );
+ amount = (amount - couponDiscount) / 100;
+ button.text( "Annual: $" + amount );
+ }
+ });
+ })
+ .fail(function() {
+ couponDiscount = 0;
+
+ // TODO: notify user
+ // Show all payment buttons with standard values
+ payButtons.each(function() {
+ var button = $( this ).show();
+
+ if ( button.text().match( /Annual/ ) ) {
+ amount = parseInt( button.data( "amount" ), 10 ) / 100;
+ button.text( "Annual: $" + amount );
+ }
+ });
+ })
+ .always(function() {
+
+ // Re-enable the pay buttons
+ payButtons.prop( "disabled", false );
+ });
+ });
+ });
+
+ (function() {
+ var couponCode = location.search.match(/[?&]coupon=([^&]+)/);
+ if ( !couponCode ) {
+ return;
+ }
+
+ couponCode = couponCode[ 1 ];
+ $( "[name='coupon']" )
+ .val( couponCode )
+ // TODO: Move the relevant logic into a function we can call
+ .each(function() {
+ // Click the link to reveal the pre-filled coupon code
+ $( this ).next().triggerHandler( "click" );
+ // Tell the form to update based on the pre-filled coupon code
+ $( this ).triggerHandler( "blur" );
+ });
+ })();
+
+ function processMembership( data ) {
+ return $.ajax({
+ url: StripeForm.url,
+ data: $.extend({
+ action: StripeForm.action,
+ nonce: StripeForm.nonce
+ }, data )
+ });
+ }
+
+ $(".member-level .pay").on( "click", function( event ) {
+ event.preventDefault();
+ var button = $( this ),
+ form = $( this.form ),
+ firstName = $.trim( form.find( "[name=first-name]" ).val() ),
+ lastName = $.trim( form.find( "[name=last-name]" ).val() ),
+ email = $.trim( form.find( "[name=email]" ).val() ),
+ address = $.trim( form.find( "[name=address]" ).val() ),
+ coupon = $.trim( form.find( "[name=coupon]" ).val().toLowerCase() ),
+ amount = parseInt( button.data("amount"), 10 ) - couponDiscount,
+ gifts = form.find( "select" ),
+ errors = form.find( ".errors" ).empty().hide(),
+ valid = true;
+
+ function showError( msg ) {
+ $( "<li>" ).text( msg ).appendTo( errors );
+ valid = false;
+ }
+
+ // Verify all fields
+ if ( !firstName ) {
+ showError( "Please provide your first name." );
+ }
+ if ( !lastName ) {
+ showError( "Please provide your last name." );
+ }
+ if ( !isEmail( email ) ) {
+ showError( "Please provide a valid email address" );
+ }
+ if ( address.length < 10 ) {
+ showError( "Please provide your full address." );
+ }
+ if ( gifts.filter(function() { return !$( this ).val(); }).length ) {
+ showError( "Please choose a size for each gift." );
+ }
+
+ if ( !valid ) {
+ errors.slideDown();
+ return;
+ }
+
+ StripeCheckout.open({
+ key: StripeForm.key,
+ image: button.data("image"),
+ name: button.data("name"),
+ description: button.data("description"),
+ panelLabel: ( amount > 0 ? button.data("panel-label") : "Join" ),
+ amount: amount,
+ token: function( stripeData ) {
+ var data = {
+ token: stripeData.id,
+ planId: button.data( "plan-id" ),
+ firstName: firstName,
+ lastName: lastName,
+ email: email,
+ address: address,
+ coupon: coupon
+ };
+ gifts.each(function() {
+ data[ this.name ] = this.value;
+ });
+ processMembership( data )
+ .done(function() {
+ window.location = "/join/thanks/";
+ }).fail(function() {
+ showError(
+ "There was an error processing your payment. " +
+ "Please contact membership@jquery.org."
+ );
+ errors.slideDown();
+ });
+ }
+ });
+ });
+ })();
+});
+
+
+
+
+
+/*
+ * jqueryui.com
+ */
+$(function() {
+ var demoFrame = $( ".demo-frame" ),
+ demoDescription = $( ".demo-description" ),
+ sourceView = $( ".view-source > div" ),
+ demoList = $( ".demo-list" ),
+ currentDemo = location.hash.substring( 1 );
+
+ demoList.on( "click", "a", function( event ) {
+ event.preventDefault();
+
+ var filename = "/" + event.target.pathname.replace( /^\//, "" ),
+ parts = filename.split( "/" ),
+ plugin = parts[ 3 ],
+ demo = parts[ 4 ].substring( 0, parts[ 4 ].length - 5 );
+
+ if ( demoList.is( "[data-full-nav]" ) ) {
+ window.location = "/" + demo;
+ return;
+ }
+
+ $.getJSON( "/resources/demos/demo-list.json" ).then(function( demoList ) {
+ demoDescription.html( $.grep( demoList[ plugin ], function( x ) {
+ return x.filename === demo;
+ })[ 0 ].description );
+ demoFrame.attr( "src", filename );
+ });
+
+ $.get( filename.replace( "demos", "demos-highlight" ) ).then(function( content ) {
+ sourceView.html( content );
+ });
+
+ demoList.find( ".active" ).removeClass( "active" );
+ $( this ).parent().addClass( "active" );
+ location.hash = "#" + demo;
+ });
+
+ $( ".view-source a" ).on( "click", function() {
+ sourceView.animate({
+ opacity: "toggle",
+ height: "toggle"
+ });
+ });
+
+ if ( currentDemo ) {
+ demoList.find( "a" ).filter(function() {
+ return this.pathname.split( "/" )[ 4 ] === (currentDemo + ".html");
+ }).click();
+ }
+});
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/modernizr.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/modernizr.js
new file mode 100644
index 000000000..39a08dec0
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/modernizr.js
@@ -0,0 +1,4 @@
+/* Modernizr 2.6.2 (Custom Build) | MIT & BSD
+ * Build: http://modernizr.com/download/#-boxshadow-multiplebgs-cssgradients-shiv-mq-cssclasses-teststyles-testprop-testallprops-prefixes-domprefixes
+ */
+;window.Modernizr=function(a,b,c){function A(a){j.cssText=a}function B(a,b){return A(m.join(a+";")+(b||""))}function C(a,b){return typeof a===b}function D(a,b){return!!~(""+a).indexOf(b)}function E(a,b){for(var d in a){var e=a[d];if(!D(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function F(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:C(f,"function")?f.bind(d||b):f}return!1}function G(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+o.join(d+" ")+d).split(" ");return C(b,"string")||C(b,"undefined")?E(e,b):(e=(a+" "+p.join(d+" ")+d).split(" "),F(e,b,c))}var d="2.6.2",e={},f=!0,g=b.documentElement,h="modernizr",i=b.createElement(h),j=i.style,k,l={}.toString,m=" -webkit- -moz- -o- -ms- ".split(" "),n="Webkit Moz O ms",o=n.split(" "),p=n.toLowerCase().split(" "),q={},r={},s={},t=[],u=t.slice,v,w=function(a,c,d,e){var f,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:h+(d+1),l.appendChild(j);return f=["&#173;",'<style id="s',h,'">',a,"</style>"].join(""),l.id=h,(m?l:n).innerHTML+=f,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=g.style.overflow,g.style.overflow="hidden",g.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),g.style.overflow=k),!!i},x=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return w("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},y={}.hasOwnProperty,z;!C(y,"undefined")&&!C(y.call,"undefined")?z=function(a,b){return y.call(a,b)}:z=function(a,b){return b in a&&C(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=u.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(u.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(u.call(arguments)))};return e}),q.multiplebgs=function(){return A("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},q.boxshadow=function(){return G("boxShadow")},q.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return A((a+"-webkit- ".split(" ").join(b+a)+m.join(c+a)).slice(0,-a.length)),D(j.backgroundImage,"gradient")};for(var H in q)z(q,H)&&(v=H.toLowerCase(),e[v]=q[H](),t.push((e[v]?"":"no-")+v));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)z(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof f!="undefined"&&f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},A(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function p(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return r.shivMethods?n(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+l().join().replace(/\w+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(r,b.frag)}function q(a){a||(a=b);var c=m(a);return r.shivCSS&&!f&&!c.hasCSS&&(c.hasCSS=!!k(a,"article,aside,figcaption,figure,footer,header,hgroup,nav,section{display:block}mark{background:#FF0;color:#000}")),j||p(a,c),a}var c=a.html5||{},d=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,f,g="_html5shiv",h=0,i={},j;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=m,e._domPrefixes=p,e._cssomPrefixes=o,e.mq=x,e.testProp=function(a){return E([a])},e.testAllProps=G,e.testStyles=w,g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+t.join(" "):""),e}(this,this.document);
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/plugins.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/plugins.js
new file mode 100644
index 000000000..7560541f3
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/plugins.js
@@ -0,0 +1,59 @@
+
+/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas. Dual MIT/BSD license */
+/*! NOTE: If you're already including a window.matchMedia polyfill via Modernizr or otherwise, you don't need this part */
+window.matchMedia=window.matchMedia||(function(e,f){var c,a=e.documentElement,b=a.firstElementChild||a.firstChild,d=e.createElement("body"),g=e.createElement("div");g.id="mq-test-1";g.style.cssText="position:absolute;top:-100em";d.style.background="none";d.appendChild(g);return function(h){g.innerHTML='&shy;<style media="'+h+'"> #mq-test-1 { width: 42px; }</style>';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document);
+
+/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */
+(function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B<y;B++){A=D[B],z=A.href,C=A.media,x=A.rel&&A.rel.toLowerCase()==="stylesheet";if(!!z&&x&&!o[z]){if(A.styleSheet&&A.styleSheet.rawCssText){m(A.styleSheet.rawCssText,z,C);o[z]=true}else{if((!/^([a-zA-Z:]*\/\/)/.test(z)&&!g)||z.replace(RegExp.$1,"").split("/")[0]===e.location.host){d.push({href:z,media:C})}}}}u()},u=function(){if(d.length){var x=d.shift();n(x.href,function(y){m(y,x.href,x.media);o[x.href]=true;u()})}},m=function(I,x,z){var G=I.match(/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi),J=G&&G.length||0,x=x.substring(0,x.lastIndexOf("/")),y=function(K){return K.replace(/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,"$1"+x+"$2$3")},A=!J&&z,D=0,C,E,F,B,H;if(x.length){x+="/"}if(A){J=1}for(;D<J;D++){C=0;if(A){E=z;k.push(y(I))}else{E=G[D].match(/@media *([^\{]+)\{([\S\s]+?)$/)&&RegExp.$1;k.push(RegExp.$2&&y(RegExp.$2))}B=E.split(",");H=B.length;for(;C<H;C++){F=B[C];i.push({media:F.split("(")[0].match(/(only\s+)?([a-zA-Z]+)\s?/)&&RegExp.$2||"all",rules:k.length-1,hasquery:F.indexOf("(")>-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l<h){clearTimeout(r);r=setTimeout(j,h);return}else{l=z}for(var E in i){var K=i[E],C=K.minw,J=K.maxw,A=C===null,L=J===null,y="em";if(!!C){C=parseFloat(C)*(C.indexOf(y)>-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this);
+
+
+/*
+ ColorBox v1.3.23
+ (c) 2013 Jack Moore - jacklmoore.com
+ license: http://www.opensource.org/licenses/mit-license.php
+*/
+(function(e,t,i){function o(i,o,n){var h=t.createElement(i);return o&&(h.id=J+o),n&&(h.style.cssText=n),e(h)}function n(e){var t=b.length,i=(A+e)%t;return 0>i?t+i:i}function h(e,t){return Math.round((/%/.test(e)?("x"===t?T.width():T.height())/100:1)*parseInt(e,10))}function r(e){return _.photo||/\.(gif|png|jp(e|g|eg)|bmp|ico)((#|\?).*)?$/i.test(e)}function l(){var t,i=e.data(j,$);null==i?(_=e.extend({},X),console&&console.log&&console.log("Error: cboxElement missing settings object")):_=e.extend({},i);for(t in _)e.isFunction(_[t])&&"on"!==t.slice(0,2)&&(_[t]=_[t].call(j));_.rel=_.rel||j.rel||e(j).data("rel")||"nofollow",_.href=_.href||e(j).attr("href"),_.title=_.title||j.title,"string"==typeof _.href&&(_.href=e.trim(_.href))}function s(i,o){e(t).trigger(i),e("*",p).trigger(i),o&&o.call(j)}function a(){var e,t,i,o=J+"Slideshow_",n="click."+J;_.slideshow&&b[1]?(t=function(){I.html(_.slideshowStop).unbind(n).bind(Z,function(){(_.loop||b[A+1])&&(e=setTimeout(N.next,_.slideshowSpeed))}).bind(Y,function(){clearTimeout(e)}).one(n+" "+et,i),p.removeClass(o+"off").addClass(o+"on"),e=setTimeout(N.next,_.slideshowSpeed)},i=function(){clearTimeout(e),I.html(_.slideshowStart).unbind([Z,Y,et,n].join(" ")).one(n,function(){N.next(),t()}),p.removeClass(o+"on").addClass(o+"off")},_.slideshowAuto?t():i()):p.removeClass(o+"off "+o+"on")}function d(i){q||(j=i,l(),b=e(j),A=0,"nofollow"!==_.rel&&(b=e("."+U).filter(function(){var t,i=e.data(this,$);return i&&(t=e(this).data("rel")||i.rel||this.rel),t===_.rel}),A=b.index(j),-1===A&&(b=b.add(j),A=b.length-1)),P||(P=R=!0,p.show(),_.returnFocus&&(e(j).blur(),e(t).one(tt,function(){e(j).focus()})),f.css({opacity:+_.opacity,cursor:_.overlayClose?"pointer":"auto"}).show(),_.w=h(_.initialWidth,"x"),_.h=h(_.initialHeight,"y"),N.position(),nt&&T.bind("resize."+ht+" scroll."+ht,function(){f.css({width:T.width(),height:T.height(),top:T.scrollTop(),left:T.scrollLeft()})}).trigger("resize."+ht),s(V,_.onOpen),F.add(k).hide(),S.html(_.close).show()),N.load(!0))}function c(){!p&&t.body&&(Q=!1,T=e(i),p=o(rt).attr({id:$,"class":ot?J+(nt?"IE6":"IE"):""}).hide(),f=o(rt,"Overlay",nt?"position:absolute":"").hide(),H=o(rt,"LoadingOverlay").add(o(rt,"LoadingGraphic")),w=o(rt,"Wrapper"),m=o(rt,"Content").append(C=o(rt,"LoadedContent","width:0; height:0; overflow:hidden"),k=o(rt,"Title"),E=o(rt,"Current"),L=o(rt,"Next"),M=o(rt,"Previous"),I=o(rt,"Slideshow").bind(V,a),S=o(rt,"Close")),w.append(o(rt).append(o(rt,"TopLeft"),g=o(rt,"TopCenter"),o(rt,"TopRight")),o(rt,!1,"clear:left").append(x=o(rt,"MiddleLeft"),m,y=o(rt,"MiddleRight")),o(rt,!1,"clear:left").append(o(rt,"BottomLeft"),v=o(rt,"BottomCenter"),o(rt,"BottomRight"))).find("div div").css({"float":"left"}),W=o(rt,!1,"position:absolute; width:9999px; visibility:hidden; display:none"),F=L.add(M).add(E).add(I),e(t.body).append(f,p.append(w,W)))}function u(){return p?(Q||(Q=!0,K=g.height()+v.height()+m.outerHeight(!0)-m.height(),z=x.width()+y.width()+m.outerWidth(!0)-m.width(),D=C.outerHeight(!0),B=C.outerWidth(!0),L.click(function(){N.next()}),M.click(function(){N.prev()}),S.click(function(){N.close()}),f.click(function(){_.overlayClose&&N.close()}),e(t).bind("keydown."+J,function(e){var t=e.keyCode;P&&_.escKey&&27===t&&(e.preventDefault(),N.close()),P&&_.arrowKey&&b[1]&&(37===t?(e.preventDefault(),M.click()):39===t&&(e.preventDefault(),L.click()))}),e(t).delegate("."+U,"click",function(e){e.which>1||e.shiftKey||e.altKey||e.metaKey||(e.preventDefault(),d(this))})),!0):!1}var f,p,w,m,g,x,y,v,b,T,C,W,H,k,E,I,L,M,S,F,_,K,z,D,B,j,A,O,P,R,q,G,N,Q,X={transition:"elastic",speed:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,inline:!1,html:!1,iframe:!1,fastIframe:!0,photo:!1,href:!1,title:!1,rel:!1,opacity:.9,preloading:!0,current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",open:!1,returnFocus:!0,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0},$="colorbox",J="cbox",U=J+"Element",V=J+"_open",Y=J+"_load",Z=J+"_complete",et=J+"_cleanup",tt=J+"_closed",it=J+"_purge",ot=!e.support.leadingWhitespace,nt=ot&&!i.XMLHttpRequest,ht=J+"_IE6",rt="div";e.colorbox||(e(c),N=e.fn[$]=e[$]=function(t,i){var o=this;if(t=t||{},c(),u()){if(e.isFunction(o))o=e("<a/>"),t.open=!0;else if(!o[0])return o;i&&(t.onComplete=i),o.each(function(){e.data(this,$,e.extend({},e.data(this,$)||X,t))}).addClass(U),(e.isFunction(t.open)&&t.open.call(o)||t.open)&&d(o[0])}return o},N.position=function(e,t){function i(e){g[0].style.width=v[0].style.width=m[0].style.width=parseInt(e.style.width,10)-z+"px",m[0].style.height=x[0].style.height=y[0].style.height=parseInt(e.style.height,10)-K+"px"}var o,n,r,l=0,s=0,a=p.offset();T.unbind("resize."+J),p.css({top:-9e4,left:-9e4}),n=T.scrollTop(),r=T.scrollLeft(),_.fixed&&!nt?(a.top-=n,a.left-=r,p.css({position:"fixed"})):(l=n,s=r,p.css({position:"absolute"})),s+=_.right!==!1?Math.max(T.width()-_.w-B-z-h(_.right,"x"),0):_.left!==!1?h(_.left,"x"):Math.round(Math.max(T.width()-_.w-B-z,0)/2),l+=_.bottom!==!1?Math.max(T.height()-_.h-D-K-h(_.bottom,"y"),0):_.top!==!1?h(_.top,"y"):Math.round(Math.max(T.height()-_.h-D-K,0)/2),p.css({top:a.top,left:a.left}),e=p.width()===_.w+B&&p.height()===_.h+D?0:e||0,w[0].style.width=w[0].style.height="9999px",o={width:_.w+B+z,height:_.h+D+K,top:l,left:s},0===e&&p.css(o),p.dequeue().animate(o,{duration:e,complete:function(){i(this),R=!1,w[0].style.width=_.w+B+z+"px",w[0].style.height=_.h+D+K+"px",_.reposition&&setTimeout(function(){T.bind("resize."+J,N.position)},1),t&&t()},step:function(){i(this)}})},N.resize=function(e){P&&(e=e||{},e.width&&(_.w=h(e.width,"x")-B-z),e.innerWidth&&(_.w=h(e.innerWidth,"x")),C.css({width:_.w}),e.height&&(_.h=h(e.height,"y")-D-K),e.innerHeight&&(_.h=h(e.innerHeight,"y")),e.innerHeight||e.height||(C.css({height:"auto"}),_.h=C.height()),C.css({height:_.h}),N.position("none"===_.transition?0:_.speed))},N.prep=function(i){function h(){return _.w=_.w||C.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function l(){return _.h=_.h||C.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if(P){var a,d="none"===_.transition?0:_.speed;C.remove(),C=o(rt,"LoadedContent").append(i),C.hide().appendTo(W.show()).css({width:h(),overflow:_.scrolling?"auto":"hidden"}).css({height:l()}).prependTo(m),W.hide(),e(O).css({"float":"none"}),a=function(){function i(){ot&&p[0].style.removeAttribute("filter")}var h,l,a=b.length,c="frameBorder",u="allowTransparency";P&&(l=function(){clearTimeout(G),H.detach().hide(),s(Z,_.onComplete)},ot&&O&&C.fadeIn(100),k.html(_.title).add(C).show(),a>1?("string"==typeof _.current&&E.html(_.current.replace("{current}",A+1).replace("{total}",a)).show(),L[_.loop||a-1>A?"show":"hide"]().html(_.next),M[_.loop||A?"show":"hide"]().html(_.previous),_.slideshow&&I.show(),_.preloading&&e.each([n(-1),n(1)],function(){var t,i,o=b[this],n=e.data(o,$);n&&n.href?(t=n.href,e.isFunction(t)&&(t=t.call(o))):t=o.href,r(t)&&(i=new Image,i.src=t)})):F.hide(),_.iframe?(h=o("iframe")[0],c in h&&(h[c]=0),u in h&&(h[u]="true"),_.scrolling||(h.scrolling="no"),e(h).attr({src:_.href,name:(new Date).getTime(),"class":J+"Iframe",allowFullScreen:!0,webkitAllowFullScreen:!0,mozallowfullscreen:!0}).one("load",l).appendTo(C),e(t).one(it,function(){h.src="//about:blank"}),_.fastIframe&&e(h).trigger("load")):l(),"fade"===_.transition?p.fadeTo(d,1,i):i())},"fade"===_.transition?p.fadeTo(d,0,function(){N.position(0,a)}):N.position(d,a)}},N.load=function(i){var n,a,d,c=N.prep;R=!0,O=!1,j=b[A],i||l(),s(it),s(Y,_.onLoad),_.h=_.height?h(_.height,"y")-D-K:_.innerHeight&&h(_.innerHeight,"y"),_.w=_.width?h(_.width,"x")-B-z:_.innerWidth&&h(_.innerWidth,"x"),_.mw=_.w,_.mh=_.h,_.maxWidth&&(_.mw=h(_.maxWidth,"x")-B-z,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.maxHeight&&(_.mh=h(_.maxHeight,"y")-D-K,_.mh=_.h&&_.h<_.mh?_.h:_.mh),n=_.href,G=setTimeout(function(){H.show().appendTo(m)},100),_.inline?(d=o(rt).hide().insertBefore(e(n)[0]),e(t).one(it,function(){d.replaceWith(C.children())}),c(e(n))):_.iframe?c(" "):_.html?c(_.html):r(n)?(e(O=new Image).addClass(J+"Photo").bind("error",function(){_.title=!1,c(o(rt,"Error").html(_.imgError))}).load(function(){var e;O.onload=null,_.scalePhotos&&(a=function(){O.height-=O.height*e,O.width-=O.width*e},_.mw&&O.width>_.mw&&(e=(O.width-_.mw)/O.width,a()),_.mh&&O.height>_.mh&&(e=(O.height-_.mh)/O.height,a())),_.h&&(O.style.marginTop=Math.max(_.h-O.height,0)/2+"px"),b[1]&&(_.loop||b[A+1])&&(O.style.cursor="pointer",O.onclick=function(){N.next()}),ot&&(O.style.msInterpolationMode="bicubic"),setTimeout(function(){c(O)},1)}),setTimeout(function(){O.src=n},1)):n&&W.load(n,_.data,function(t,i){c("error"===i?o(rt,"Error").html(_.xhrError):e(this).contents())})},N.next=function(){!R&&b[1]&&(_.loop||b[A+1])&&(A=n(1),N.load())},N.prev=function(){!R&&b[1]&&(_.loop||A)&&(A=n(-1),N.load())},N.close=function(){P&&!q&&(q=!0,P=!1,s(et,_.onCleanup),T.unbind("."+J+" ."+ht),f.fadeTo(200,0),p.stop().fadeTo(300,0,function(){p.add(f).css({opacity:1,cursor:"auto"}).hide(),s(it),C.remove(),setTimeout(function(){q=!1,s(tt,_.onClosed)},1)}))},N.remove=function(){e([]).add(p).add(f).remove(),p=null,e("."+U).removeData($).removeClass(U),e(t).undelegate("."+U)},N.element=function(){return e(j)},N.settings=X)})(jQuery,document,window);
+
+
+/*
+ * jQuery FlexSlider v2.1
+ * Copyright 2012 WooThemes
+ * Contributing Author: Tyler Smith
+ */
+;(function(d){d.flexslider=function(i,k){var a=d(i),c=d.extend({},d.flexslider.defaults,k),e=c.namespace,p="ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch,t=p?"touchend":"click",l="vertical"===c.direction,m=c.reverse,h=0<c.itemWidth,r="fade"===c.animation,s=""!==c.asNavFor,f={};d.data(i,"flexslider",a);f={init:function(){a.animating=!1;a.currentSlide=c.startAt;a.animatingTo=a.currentSlide;a.atEnd=0===a.currentSlide||a.currentSlide===a.last;a.containerSelector=c.selector.substr(0,
+ c.selector.search(" "));a.slides=d(c.selector,a);a.container=d(a.containerSelector,a);a.count=a.slides.length;a.syncExists=0<d(c.sync).length;"slide"===c.animation&&(c.animation="swing");a.prop=l?"top":"marginLeft";a.args={};a.manualPause=!1;var b=a,g;if(g=!c.video)if(g=!r)if(g=c.useCSS)a:{g=document.createElement("div");var n=["perspectiveProperty","WebkitPerspective","MozPerspective","OPerspective","msPerspective"],e;for(e in n)if(void 0!==g.style[n[e]]){a.pfx=n[e].replace("Perspective","").toLowerCase();
+ a.prop="-"+a.pfx+"-transform";g=!0;break a}g=!1}b.transitions=g;""!==c.controlsContainer&&(a.controlsContainer=0<d(c.controlsContainer).length&&d(c.controlsContainer));""!==c.manualControls&&(a.manualControls=0<d(c.manualControls).length&&d(c.manualControls));c.randomize&&(a.slides.sort(function(){return Math.round(Math.random())-0.5}),a.container.empty().append(a.slides));a.doMath();s&&f.asNav.setup();a.setup("init");c.controlNav&&f.controlNav.setup();c.directionNav&&f.directionNav.setup();c.keyboard&&
+ (1===d(a.containerSelector).length||c.multipleKeyboard)&&d(document).bind("keyup",function(b){b=b.keyCode;if(!a.animating&&(39===b||37===b))b=39===b?a.getTarget("next"):37===b?a.getTarget("prev"):!1,a.flexAnimate(b,c.pauseOnAction)});c.mousewheel&&a.bind("mousewheel",function(b,g){b.preventDefault();var d=0>g?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(d,c.pauseOnAction)});c.pausePlay&&f.pausePlay.setup();c.slideshow&&(c.pauseOnHover&&a.hover(function(){!a.manualPlay&&!a.manualPause&&a.pause()},
+ function(){!a.manualPause&&!a.manualPlay&&a.play()}),0<c.initDelay?setTimeout(a.play,c.initDelay):a.play());p&&c.touch&&f.touch();(!r||r&&c.smoothHeight)&&d(window).bind("resize focus",f.resize);setTimeout(function(){c.start(a)},200)},asNav:{setup:function(){a.asNav=!0;a.animatingTo=Math.floor(a.currentSlide/a.move);a.currentItem=a.currentSlide;a.slides.removeClass(e+"active-slide").eq(a.currentItem).addClass(e+"active-slide");a.slides.click(function(b){b.preventDefault();var b=d(this),g=b.index();
+ !d(c.asNavFor).data("flexslider").animating&&!b.hasClass("active")&&(a.direction=a.currentItem<g?"next":"prev",a.flexAnimate(g,c.pauseOnAction,!1,!0,!0))})}},controlNav:{setup:function(){a.manualControls?f.controlNav.setupManual():f.controlNav.setupPaging()},setupPaging:function(){var b=1,g;a.controlNavScaffold=d('<ol class="'+e+"control-nav "+e+("thumbnails"===c.controlNav?"control-thumbs":"control-paging")+'"></ol>');if(1<a.pagingCount)for(var n=0;n<a.pagingCount;n++)g="thumbnails"===c.controlNav?
+ '<img src="'+a.slides.eq(n).attr("data-thumb")+'"/>':"<a>"+b+"</a>",a.controlNavScaffold.append("<li>"+g+"</li>"),b++;a.controlsContainer?d(a.controlsContainer).append(a.controlNavScaffold):a.append(a.controlNavScaffold);f.controlNav.set();f.controlNav.active();a.controlNavScaffold.delegate("a, img",t,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(a.direction=g>a.currentSlide?"next":"prev",a.flexAnimate(g,c.pauseOnAction))});p&&a.controlNavScaffold.delegate("a",
+ "click touchstart",function(a){a.preventDefault()})},setupManual:function(){a.controlNav=a.manualControls;f.controlNav.active();a.controlNav.live(t,function(b){b.preventDefault();var b=d(this),g=a.controlNav.index(b);b.hasClass(e+"active")||(g>a.currentSlide?a.direction="next":a.direction="prev",a.flexAnimate(g,c.pauseOnAction))});p&&a.controlNav.live("click touchstart",function(a){a.preventDefault()})},set:function(){a.controlNav=d("."+e+"control-nav li "+("thumbnails"===c.controlNav?"img":"a"),
+ a.controlsContainer?a.controlsContainer:a)},active:function(){a.controlNav.removeClass(e+"active").eq(a.animatingTo).addClass(e+"active")},update:function(b,c){1<a.pagingCount&&"add"===b?a.controlNavScaffold.append(d("<li><a>"+a.count+"</a></li>")):1===a.pagingCount?a.controlNavScaffold.find("li").remove():a.controlNav.eq(c).closest("li").remove();f.controlNav.set();1<a.pagingCount&&a.pagingCount!==a.controlNav.length?a.update(c,b):f.controlNav.active()}},directionNav:{setup:function(){var b=d('<ul class="'+
+ e+'direction-nav"><li><a class="'+e+'prev" href="#">'+c.prevText+'</a></li><li><a class="'+e+'next" href="#">'+c.nextText+"</a></li></ul>");a.controlsContainer?(d(a.controlsContainer).append(b),a.directionNav=d("."+e+"direction-nav li a",a.controlsContainer)):(a.append(b),a.directionNav=d("."+e+"direction-nav li a",a));f.directionNav.update();a.directionNav.bind(t,function(b){b.preventDefault();b=d(this).hasClass(e+"next")?a.getTarget("next"):a.getTarget("prev");a.flexAnimate(b,c.pauseOnAction)});
+ p&&a.directionNav.bind("click touchstart",function(a){a.preventDefault()})},update:function(){var b=e+"disabled";1===a.pagingCount?a.directionNav.addClass(b):c.animationLoop?a.directionNav.removeClass(b):0===a.animatingTo?a.directionNav.removeClass(b).filter("."+e+"prev").addClass(b):a.animatingTo===a.last?a.directionNav.removeClass(b).filter("."+e+"next").addClass(b):a.directionNav.removeClass(b)}},pausePlay:{setup:function(){var b=d('<div class="'+e+'pauseplay"><a></a></div>');a.controlsContainer?
+ (a.controlsContainer.append(b),a.pausePlay=d("."+e+"pauseplay a",a.controlsContainer)):(a.append(b),a.pausePlay=d("."+e+"pauseplay a",a));f.pausePlay.update(c.slideshow?e+"pause":e+"play");a.pausePlay.bind(t,function(b){b.preventDefault();d(this).hasClass(e+"pause")?(a.manualPause=!0,a.manualPlay=!1,a.pause()):(a.manualPause=!1,a.manualPlay=!0,a.play())});p&&a.pausePlay.bind("click touchstart",function(a){a.preventDefault()})},update:function(b){"play"===b?a.pausePlay.removeClass(e+"pause").addClass(e+
+ "play").text(c.playText):a.pausePlay.removeClass(e+"play").addClass(e+"pause").text(c.pauseText)}},touch:function(){function b(b){j=l?d-b.touches[0].pageY:d-b.touches[0].pageX;p=l?Math.abs(j)<Math.abs(b.touches[0].pageX-e):Math.abs(j)<Math.abs(b.touches[0].pageY-e);if(!p||500<Number(new Date)-k)b.preventDefault(),!r&&a.transitions&&(c.animationLoop||(j/=0===a.currentSlide&&0>j||a.currentSlide===a.last&&0<j?Math.abs(j)/q+2:1),a.setProps(f+j,"setTouch"))}function g(){i.removeEventListener("touchmove",
+ b,!1);if(a.animatingTo===a.currentSlide&&!p&&null!==j){var h=m?-j:j,l=0<h?a.getTarget("next"):a.getTarget("prev");a.canAdvance(l)&&(550>Number(new Date)-k&&50<Math.abs(h)||Math.abs(h)>q/2)?a.flexAnimate(l,c.pauseOnAction):r||a.flexAnimate(a.currentSlide,c.pauseOnAction,!0)}i.removeEventListener("touchend",g,!1);f=j=e=d=null}var d,e,f,q,j,k,p=!1;i.addEventListener("touchstart",function(j){a.animating?j.preventDefault():1===j.touches.length&&(a.pause(),q=l?a.h:a.w,k=Number(new Date),f=h&&m&&a.animatingTo===
+ a.last?0:h&&m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:h&&a.currentSlide===a.last?a.limit:h?(a.itemW+c.itemMargin)*a.move*a.currentSlide:m?(a.last-a.currentSlide+a.cloneOffset)*q:(a.currentSlide+a.cloneOffset)*q,d=l?j.touches[0].pageY:j.touches[0].pageX,e=l?j.touches[0].pageX:j.touches[0].pageY,i.addEventListener("touchmove",b,!1),i.addEventListener("touchend",g,!1))},!1)},resize:function(){!a.animating&&a.is(":visible")&&(h||a.doMath(),r?f.smoothHeight():h?(a.slides.width(a.computedW),
+ a.update(a.pagingCount),a.setProps()):l?(a.viewport.height(a.h),a.setProps(a.h,"setTotal")):(c.smoothHeight&&f.smoothHeight(),a.newSlides.width(a.computedW),a.setProps(a.computedW,"setTotal")))},smoothHeight:function(b){if(!l||r){var c=r?a:a.viewport;b?c.animate({height:a.slides.eq(a.animatingTo).height()},b):c.height(a.slides.eq(a.animatingTo).height())}},sync:function(b){var g=d(c.sync).data("flexslider"),e=a.animatingTo;switch(b){case "animate":g.flexAnimate(e,c.pauseOnAction,!1,!0);break;case "play":!g.playing&&
+ !g.asNav&&g.play();break;case "pause":g.pause()}}};a.flexAnimate=function(b,g,n,i,k){s&&1===a.pagingCount&&(a.direction=a.currentItem<b?"next":"prev");if(!a.animating&&(a.canAdvance(b,k)||n)&&a.is(":visible")){if(s&&i)if(n=d(c.asNavFor).data("flexslider"),a.atEnd=0===b||b===a.count-1,n.flexAnimate(b,!0,!1,!0,k),a.direction=a.currentItem<b?"next":"prev",n.direction=a.direction,Math.ceil((b+1)/a.visible)-1!==a.currentSlide&&0!==b)a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+
+ "active-slide"),b=Math.floor(b/a.visible);else return a.currentItem=b,a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide"),!1;a.animating=!0;a.animatingTo=b;c.before(a);g&&a.pause();a.syncExists&&!k&&f.sync("animate");c.controlNav&&f.controlNav.active();h||a.slides.removeClass(e+"active-slide").eq(b).addClass(e+"active-slide");a.atEnd=0===b||b===a.last;c.directionNav&&f.directionNav.update();b===a.last&&(c.end(a),c.animationLoop||a.pause());if(r)p?(a.slides.eq(a.currentSlide).css({opacity:0}),
+ a.slides.eq(b).css({opacity:1}),a.animating=!1,a.currentSlide=a.animatingTo):(a.slides.eq(a.currentSlide).fadeOut(c.animationSpeed,c.easing),a.slides.eq(b).fadeIn(c.animationSpeed,c.easing,a.wrapup));else{var q=l?a.slides.filter(":first").height():a.computedW;h?(b=c.itemWidth>a.w?2*c.itemMargin:c.itemMargin,b=(a.itemW+b)*a.move*a.animatingTo,b=b>a.limit&&1!==a.visible?a.limit:b):b=0===a.currentSlide&&b===a.count-1&&c.animationLoop&&"next"!==a.direction?m?(a.count+a.cloneOffset)*q:0:a.currentSlide===
+ a.last&&0===b&&c.animationLoop&&"prev"!==a.direction?m?0:(a.count+1)*q:m?(a.count-1-b+a.cloneOffset)*q:(b+a.cloneOffset)*q;a.setProps(b,"",c.animationSpeed);if(a.transitions){if(!c.animationLoop||!a.atEnd)a.animating=!1,a.currentSlide=a.animatingTo;a.container.unbind("webkitTransitionEnd transitionend");a.container.bind("webkitTransitionEnd transitionend",function(){a.wrapup(q)})}else a.container.animate(a.args,c.animationSpeed,c.easing,function(){a.wrapup(q)})}c.smoothHeight&&f.smoothHeight(c.animationSpeed)}};
+ a.wrapup=function(b){!r&&!h&&(0===a.currentSlide&&a.animatingTo===a.last&&c.animationLoop?a.setProps(b,"jumpEnd"):a.currentSlide===a.last&&(0===a.animatingTo&&c.animationLoop)&&a.setProps(b,"jumpStart"));a.animating=!1;a.currentSlide=a.animatingTo;c.after(a)};a.animateSlides=function(){a.animating||a.flexAnimate(a.getTarget("next"))};a.pause=function(){clearInterval(a.animatedSlides);a.playing=!1;c.pausePlay&&f.pausePlay.update("play");a.syncExists&&f.sync("pause")};a.play=function(){a.animatedSlides=
+ setInterval(a.animateSlides,c.slideshowSpeed);a.playing=!0;c.pausePlay&&f.pausePlay.update("pause");a.syncExists&&f.sync("play")};a.canAdvance=function(b,g){var d=s?a.pagingCount-1:a.last;return g?!0:s&&a.currentItem===a.count-1&&0===b&&"prev"===a.direction?!0:s&&0===a.currentItem&&b===a.pagingCount-1&&"next"!==a.direction?!1:b===a.currentSlide&&!s?!1:c.animationLoop?!0:a.atEnd&&0===a.currentSlide&&b===d&&"next"!==a.direction?!1:a.atEnd&&a.currentSlide===d&&0===b&&"next"===a.direction?!1:!0};a.getTarget=
+ function(b){a.direction=b;return"next"===b?a.currentSlide===a.last?0:a.currentSlide+1:0===a.currentSlide?a.last:a.currentSlide-1};a.setProps=function(b,g,d){var e,f=b?b:(a.itemW+c.itemMargin)*a.move*a.animatingTo;e=-1*function(){if(h)return"setTouch"===g?b:m&&a.animatingTo===a.last?0:m?a.limit-(a.itemW+c.itemMargin)*a.move*a.animatingTo:a.animatingTo===a.last?a.limit:f;switch(g){case "setTotal":return m?(a.count-1-a.currentSlide+a.cloneOffset)*b:(a.currentSlide+a.cloneOffset)*b;case "setTouch":return b;
+ case "jumpEnd":return m?b:a.count*b;case "jumpStart":return m?a.count*b:b;default:return b}}()+"px";a.transitions&&(e=l?"translate3d(0,"+e+",0)":"translate3d("+e+",0,0)",d=void 0!==d?d/1E3+"s":"0s",a.container.css("-"+a.pfx+"-transition-duration",d));a.args[a.prop]=e;(a.transitions||void 0===d)&&a.container.css(a.args)};a.setup=function(b){if(r)a.slides.css({width:"100%","float":"left",marginRight:"-100%",position:"relative"}),"init"===b&&(p?a.slides.css({opacity:0,display:"block",webkitTransition:"opacity "+
+ c.animationSpeed/1E3+"s ease"}).eq(a.currentSlide).css({opacity:1}):a.slides.eq(a.currentSlide).fadeIn(c.animationSpeed,c.easing)),c.smoothHeight&&f.smoothHeight();else{var g,n;"init"===b&&(a.viewport=d('<div class="'+e+'viewport"></div>').css({overflow:"hidden",position:"relative"}).appendTo(a).append(a.container),a.cloneCount=0,a.cloneOffset=0,m&&(n=d.makeArray(a.slides).reverse(),a.slides=d(n),a.container.empty().append(a.slides)));c.animationLoop&&!h&&(a.cloneCount=2,a.cloneOffset=1,"init"!==
+ b&&a.container.find(".clone").remove(),a.container.append(a.slides.first().clone().addClass("clone")).prepend(a.slides.last().clone().addClass("clone")));a.newSlides=d(c.selector,a);g=m?a.count-1-a.currentSlide+a.cloneOffset:a.currentSlide+a.cloneOffset;l&&!h?(a.container.height(200*(a.count+a.cloneCount)+"%").css("position","absolute").width("100%"),setTimeout(function(){a.newSlides.css({display:"block"});a.doMath();a.viewport.height(a.h);a.setProps(g*a.h,"init")},"init"===b?100:0)):(a.container.width(200*
+ (a.count+a.cloneCount)+"%"),a.setProps(g*a.computedW,"init"),setTimeout(function(){a.doMath();a.newSlides.css({width:a.computedW,"float":"left",display:"block"});c.smoothHeight&&f.smoothHeight()},"init"===b?100:0))}h||a.slides.removeClass(e+"active-slide").eq(a.currentSlide).addClass(e+"active-slide")};a.doMath=function(){var b=a.slides.first(),d=c.itemMargin,e=c.minItems,f=c.maxItems;a.w=a.width();a.h=b.height();a.boxPadding=b.outerWidth()-b.width();h?(a.itemT=c.itemWidth+d,a.minW=e?e*a.itemT:a.w,
+ a.maxW=f?f*a.itemT:a.w,a.itemW=a.minW>a.w?(a.w-d*e)/e:a.maxW<a.w?(a.w-d*f)/f:c.itemWidth>a.w?a.w:c.itemWidth,a.visible=Math.floor(a.w/(a.itemW+d)),a.move=0<c.move&&c.move<a.visible?c.move:a.visible,a.pagingCount=Math.ceil((a.count-a.visible)/a.move+1),a.last=a.pagingCount-1,a.limit=1===a.pagingCount?0:c.itemWidth>a.w?(a.itemW+2*d)*a.count-a.w-d:(a.itemW+d)*a.count-a.w-d):(a.itemW=a.w,a.pagingCount=a.count,a.last=a.count-1);a.computedW=a.itemW-a.boxPadding};a.update=function(b,d){a.doMath();h||(b<
+ a.currentSlide?a.currentSlide+=1:b<=a.currentSlide&&0!==b&&(a.currentSlide-=1),a.animatingTo=a.currentSlide);if(c.controlNav&&!a.manualControls)if("add"===d&&!h||a.pagingCount>a.controlNav.length)f.controlNav.update("add");else if("remove"===d&&!h||a.pagingCount<a.controlNav.length)h&&a.currentSlide>a.last&&(a.currentSlide-=1,a.animatingTo-=1),f.controlNav.update("remove",a.last);c.directionNav&&f.directionNav.update()};a.addSlide=function(b,e){var f=d(b);a.count+=1;a.last=a.count-1;l&&m?void 0!==
+ e?a.slides.eq(a.count-e).after(f):a.container.prepend(f):void 0!==e?a.slides.eq(e).before(f):a.container.append(f);a.update(e,"add");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.added(a)};a.removeSlide=function(b){var e=isNaN(b)?a.slides.index(d(b)):b;a.count-=1;a.last=a.count-1;isNaN(b)?d(b,a.slides).remove():l&&m?a.slides.eq(a.last).remove():a.slides.eq(b).remove();a.doMath();a.update(e,"remove");a.slides=d(c.selector+":not(.clone)",a);a.setup();c.removed(a)};f.init()};d.flexslider.defaults=
+ {namespace:"flex-",selector:".slides > li",animation:"fade",easing:"swing",direction:"horizontal",reverse:!1,animationLoop:!0,smoothHeight:!1,startAt:0,slideshow:!0,slideshowSpeed:7E3,animationSpeed:600,initDelay:0,randomize:!1,pauseOnAction:!0,pauseOnHover:!1,useCSS:!0,touch:!0,video:!1,controlNav:!0,directionNav:!0,prevText:"Previous",nextText:"Next",keyboard:!0,multipleKeyboard:!1,mousewheel:!1,pausePlay:!1,pauseText:"Pause",playText:"Play",controlsContainer:"",manualControls:"",sync:"",asNavFor:"",
+ itemWidth:0,itemMargin:0,minItems:0,maxItems:0,move:0,start:function(){},before:function(){},after:function(){},end:function(){},added:function(){},removed:function(){}};d.fn.flexslider=function(i){void 0===i&&(i={});if("object"===typeof i)return this.each(function(){var a=d(this),c=a.find(i.selector?i.selector:".slides > li");1===c.length?(c.fadeIn(400),i.start&&i.start(a)):void 0===a.data("flexslider")&&new d.flexslider(this,i)});var k=d(this).data("flexslider");switch(i){case "play":k.play();break;
+ case "pause":k.pause();break;case "next":k.flexAnimate(k.getTarget("next"),!0);break;case "prev":case "previous":k.flexAnimate(k.getTarget("prev"),!0);break;default:"number"===typeof i&&k.flexAnimate(i,!0)}}})(jQuery);
+
+/*! http://tinynav.viljamis.com v1.1 by @viljamis */
+(function(a,i,g){a.fn.tinyNav=function(j){var b=a.extend({active:"selected",header:"",label:""},j);return this.each(function(){g++;var h=a(this),d="tinynav"+g,f=".l_"+d,e=a("<select/>").attr("id",d).addClass("tinynav "+d);if(h.is("ul,ol")){""!==b.header&&e.append(a("<option/>").text(b.header));var c="";h.addClass("l_"+d).find("a").each(function(){c+='<option value="'+a(this).attr("href")+'">';var b;for(b=0;b<a(this).parents("ul, ol").length-1;b++)c+="- ";c+=a(this).text()+"</option>"});e.append(c);
+b.header||e.find(":eq("+a(f+" li").index(a(f+" li."+b.active))+")").attr("selected",!0);e.change(function(){i.location.href=a(this).val()});a(f).after(e);b.label&&e.before(a("<label/>").attr("for",d).addClass("tinynav_label "+d+"_label").append(b.label))}})}})(jQuery,this,0);
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/style.css b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/style.css
new file mode 100644
index 000000000..209a933da
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/style.css
@@ -0,0 +1,21 @@
+/*
+Theme Name: api-jquery-com
+Template: jquery
+*/
+
+a {
+ color: #0769AD;
+}
+
+.signatures li h4 {
+ background: #25649F;
+}
+
+.version-details a,
+.returns a {
+ color: #7ACEF4;
+}
+
+.versionAdded a {
+ color: #7ACEF4;
+}
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/wde1aof.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/wde1aof.js
new file mode 100644
index 000000000..f15bfed1f
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jQuery.noConflict() _ jQuery API Documentation_files/wde1aof.js
@@ -0,0 +1,73 @@
+/*
+ * For font license information, see the CSS file loaded by this JavaScript.
+ */
+if(!window.Typekit)window.Typekit={};window.Typekit.config={"c":[".tk-source-code-pro","\"source-code-pro\",sans-serif",".tk-klavika-web","\"klavika-web\",sans-serif"],"f":"//use.typekit.net/c/d4d852/klavika-web:i7:n7,source-code-pro:n4:n7.PYh:F:2,PYg:F:2,Y1M:F:2,Y1P:F:2/{format}{/extras*}?3bb2a6e53c9684ffdc9a98f2135b2a6250f2340d8ca0853b7df9676f5fa610fe069f9d29c9b5e67ae7b6312a16ff95d3a73356eed53502d6630d88cb0fe9789e0ac2d9a6c14ac282069f97be80efceecd4f5e0e58b889e8649ff22efc0c4063e9f9f87c7a8920dcab32add3496e6b09e6a94141aaaeb81a4bb1d4a09b8a14ac46d7d0dff3bf6532c044b0313c5ed1d7226c76cac5039645b4082ff59a8953c4e06ef9a344cf9265e8de3ed48ac2f34b281583cbaf6f2f580f7709eba9ea284dc14f4722ed0e264d7faa135466fbba043f093297f0efc92bfcb7b3eb8761407436be31d8029117f1a72aa7b8b6319c956c739e1c25b7a993a45","fn":["klavika-web",["i7","n7"],"source-code-pro",["n4","n7"]],"k":"//use.typekit.net/{id}.js","p":"//p.typekit.net/p.gif?s=1&k=wde1aof&ht=tk&h={host}&f=17451.17454.7080.7079&a=610279&_={_}","w":"wde1aof"};
+/*{"k":"1.2.2","created":"2013-01-21T19:47:29Z"}*/
+;(function(window,document,undefined){
+var g=void 0,k=!0,l=null,m=!1;function n(a){return function(){return this[a]}}var o;function p(a,c,b){var d=2<arguments.length?Array.prototype.slice.call(arguments,2):[];return function(){d.push.apply(d,arguments);return c.apply(a,d)}}function q(a,c){this.qa=c||a;this.j=this.qa.document;this.u=g}
+q.prototype.createElement=function(a,c,b){a=this.j.createElement(a);if(c)for(var d in c)c.hasOwnProperty(d)&&("style"==d?this.ya(a,c[d]):a.setAttribute(d,c[d]));b&&a.appendChild(this.j.createTextNode(b));return a};function r(a,c,b){a=a.j.getElementsByTagName(c)[0];a||(a=document.documentElement);a&&a.lastChild&&a.insertBefore(b,a.lastChild)}function s(a){function c(){document.body?a():setTimeout(c,0)}c()}function t(a){a.parentNode&&a.parentNode.removeChild(a)}
+function u(a,c){for(var b=a.className.split(/\s+/),d=0,e=b.length;d<e;d++)if(b[d]==c)return;b.push(c);a.className=b.join(" ").replace(/^\s+/,"")}function v(a,c){for(var b=a.className.split(/\s+/),d=[],e=0,f=b.length;e<f;e++)b[e]!=c&&d.push(b[e]);a.className=d.join(" ").replace(/^\s+/,"").replace(/\s+$/,"")}function aa(a,c){for(var b=a.className.split(/\s+/),d=0,e=b.length;d<e;d++)if(b[d]==c)return k;return m}q.prototype.ya=function(a,c){this.Z()?a.setAttribute("style",c):a.style.cssText=c};
+q.prototype.Z=function(){if(this.u===g){var a=this.j.createElement("p");a.innerHTML='<a style="top:1px;">w</a>';this.u=/top/.test(a.getElementsByTagName("a")[0].getAttribute("style"))}return this.u};function w(a,c,b,d,e,f,h){this.aa=a;this.Xa=c;this.Fa=b;this.Ea=d;this.Sa=e;this.Ra=f;this.Da=h}o=w.prototype;o.getName=n("aa");o.getVersion=n("Xa");o.getEngine=n("Fa");o.getEngineVersion=n("Ea");o.getPlatform=n("Sa");o.getPlatformVersion=n("Ra");o.getDocumentMode=n("Da");
+function ba(a,c){this.e=a;this.s=c}var ca=new w("Unknown","Unknown","Unknown","Unknown","Unknown","Unknown",g);
+ba.prototype.parse=function(){var a;if(-1!=this.e.indexOf("MSIE")){a=x(this);var c=y(this),b=z(this.e,/(MSIE [\d\w\.]+)/,1);if(""!=b){var d=b.split(" "),b=d[0],d=d[1];B(d);B(c);a=new w(b,d,b,d,a,c,C(this.s))}else a=new w("MSIE","Unknown","MSIE","Unknown",a,c,C(this.s))}else if(-1!=this.e.indexOf("Opera"))a:if(c=a="Unknown",b=z(this.e,/(Presto\/[\d\w\.]+)/,1),""!=b?(c=b.split("/"),a=c[0],c=c[1]):(-1!=this.e.indexOf("Gecko")&&(a="Gecko"),b=z(this.e,/rv:([^\)]+)/,1),""!=b&&(c=b)),-1!=this.e.indexOf("Opera Mini/"))b=
+z(this.e,/Opera Mini\/([\d\.]+)/,1),""==b&&(b="Unknown"),a=new w("OperaMini",b,a,c,x(this),y(this),C(this.s));else{if(-1!=this.e.indexOf("Version/")&&(b=z(this.e,/Version\/([\d\.]+)/,1),""!=b)){a=new w("Opera",b,a,c,x(this),y(this),C(this.s),10<=B(b));break a}b=z(this.e,/Opera[\/ ]([\d\.]+)/,1);a=""!=b?new w("Opera",b,a,c,x(this),y(this),C(this.s),10<=B(b)):new w("Opera","Unknown",a,c,x(this),y(this),C(this.s))}else if(/AppleWeb(K|k)it/.test(this.e)){a=x(this);c=y(this);b=z(this.e,/AppleWeb(?:K|k)it\/([\d\.\+]+)/,
+1);""==b&&(b="Unknown");d="Unknown";-1!=this.e.indexOf("Chrome")||-1!=this.e.indexOf("CrMo")||-1!=this.e.indexOf("CriOS")?d="Chrome":"BlackBerry"==a||"Android"==a?d="BuiltinBrowser":-1!=this.e.indexOf("Safari")?d="Safari":-1!=this.e.indexOf("AdobeAIR")&&(d="AdobeAIR");var e="Unknown";"BuiltinBrowser"==d?e="Unknown":-1!=this.e.indexOf("Version/")?e=z(this.e,/Version\/([\d\.\w]+)/,1):"Chrome"==d?e=z(this.e,/(Chrome|CrMo|CriOS)\/([\d\.]+)/,2):"AdobeAIR"==d&&(e=z(this.e,/AdobeAIR\/([\d\.]+)/,1));"AdobeAIR"==
+d?(z(e,/\d+\.(\d+)/,1),2<B(e)||B(e)):"BlackBerry"!=a&&"Android"!=a&&(z(b,/\d+\.(\d+)/,1),526<=B(b)||B(b));a=new w(d,e,"AppleWebKit",b,a,c,C(this.s))}else if(-1!=this.e.indexOf("Gecko")){c=a="Unknown";d=m;-1!=this.e.indexOf("Firefox")?(a="Firefox",b=z(this.e,/Firefox\/([\d\w\.]+)/,1),""!=b&&(d=z(b,/\d+\.(\d+)/,1),c=b,d=""!=b&&3<=B(b)&&5<=parseInt(d,10))):-1!=this.e.indexOf("Mozilla")&&(a="Mozilla");b=z(this.e,/rv:([^\)]+)/,1);if(""==b)b="Unknown";else if(!d){var d=B(b),e=parseInt(z(b,/\d+\.(\d+)/,
+1),10),f=parseInt(z(b,/\d+\.\d+\.(\d+)/,1),10);1<d||1==d&&9<e||1==d&&9==e&&2<=f||b.match(/1\.9\.1b[123]/)!=l||b.match(/1\.9\.1\.[\d\.]+/)}a=new w(a,c,"Gecko",b,x(this),y(this),C(this.s))}else a=ca;return a};function x(a){var c=z(a.e,/(iPod|iPad|iPhone|Android|Windows Phone|BB\d{2}|BlackBerry)/,1);if(""!=c)return/BB\d{2}/.test(c)&&(c="BlackBerry"),c;a=z(a.e,/(Linux|Mac_PowerPC|Macintosh|Windows|CrOS)/,1);return""!=a?("Mac_PowerPC"==a&&(a="Macintosh"),a):"Unknown"}
+function y(a){var c=z(a.e,/(OS X|Windows NT|Android|CrOS) ([^;)]+)/,2);if(c||(c=z(a.e,/Windows Phone( OS)? ([^;)]+)/,2)))return c;if(c=z(a.e,/(iPhone )?OS ([\d_]+)/,2))return c;if(c=z(a.e,/Linux ([i\d]+)/,1))return c;return(a=z(a.e,/(BB\d{2}|BlackBerry).*?Version\/([^\s]*)/,2))?a:"Unknown"}function B(a){a=z(a,/(\d+)/,1);return""!=a?parseInt(a,10):-1}function z(a,c,b){return(a=a.match(c))&&a[b]?a[b]:""}function C(a){if(a.documentMode)return a.documentMode}
+function da(a,c,b){this.g=a;this.l=c;this.ga=b;this.o="wf";this.m=new ga("-")}function ha(a){v(a.l,a.m.h(a.o,"loading"));aa(a.l,a.m.h(a.o,"active"))||u(a.l,a.m.h(a.o,"inactive"));D(a,"inactive")}function D(a,c,b,d){if(a.ga[c])a.ga[c](b,d)}function E(a,c,b,d,e){this.g=a;this.D=c;this.G=b;this.t=d;this.M=e;this.T=0;this.za=this.oa=m}
+E.prototype.watch=function(a,c,b,d,e){for(var f=a.length,h=0;h<f;h++){var i=a[h];c[i]||(c[i]=["n4"]);this.T+=c[i].length}e&&(this.oa=e);for(h=0;h<f;h++)for(var i=a[h],e=c[i],j=b[i],A=0,Ia=e.length;A<Ia;A++){var ea=e[A],G=this.D,O=i,fa=ea;u(G.l,G.m.h(G.o,O,fa,"loading"));D(G,"fontloading",O,fa);G=p(this,this.Ga);O=p(this,this.Ha);(new d(G,O,this.g,this.G,this.t,this.M,i,ea,j)).start()}};
+E.prototype.Ga=function(a,c){var b=this.D;v(b.l,b.m.h(b.o,a,c,"loading"));v(b.l,b.m.h(b.o,a,c,"inactive"));u(b.l,b.m.h(b.o,a,c,"active"));D(b,"fontactive",a,c);this.za=k;ia(this)};E.prototype.Ha=function(a,c){var b=this.D;v(b.l,b.m.h(b.o,a,c,"loading"));aa(b.l,b.m.h(b.o,a,c,"active"))||u(b.l,b.m.h(b.o,a,c,"inactive"));D(b,"fontinactive",a,c);ia(this)};
+function ia(a){0==--a.T&&a.oa&&(a.za?(a=a.D,v(a.l,a.m.h(a.o,"loading")),v(a.l,a.m.h(a.o,"inactive")),u(a.l,a.m.h(a.o,"active")),D(a,"active")):ha(a.D))}
+function F(a,c,b,d,e,f,h,i,j){this.Ca=a;this.Ma=c;this.g=b;this.G=d;this.t=e;this.M=f;this.Qa=new ja;this.Ja=new ka;this.V=h;this.U=i;this.Ia=j||"BESbswy";this.ra=la(this,"arial,'URW Gothic L',sans-serif");this.ta=la(this,"Georgia,'Century Schoolbook L',serif");this.ma=this.ra;this.na=this.ta;this.ba=H(this,"arial,'URW Gothic L',sans-serif");this.ca=H(this,"Georgia,'Century Schoolbook L',serif")}F.prototype.start=function(){this.Va=this.M();this.ha()};
+F.prototype.ha=function(){var a=this.G.Y(this.ba),c=this.G.Y(this.ca);(this.ra!=a||this.ta!=c)&&this.ma==a&&this.na==c?(a=this.Ca,t(this.ba),t(this.ca),a(this.V,this.U)):5E3<=this.M()-this.Va?(a=this.Ma,t(this.ba),t(this.ca),a(this.V,this.U)):(this.ma=a,this.na=c,ma(this))};function ma(a){a.t(function(a,b){return function(){b.call(a)}}(a,a.ha),25)}function la(a,c){var b=H(a,c,k),d=a.G.Y(b);t(b);return d}
+function H(a,c,b){c=a.g.createElement("span",{style:na(a,c,a.U,b)},a.Ia);r(a.g,"body",c);return c}function na(a,c,b,d){b=a.Ja.expand(b);return"position:absolute;top:-999px;left:-999px;font-size:300px;width:auto;height:auto;line-height:normal;margin:0;padding:0;font-variant:normal;font-family:"+(d?"":a.Qa.quote(a.V)+",")+c+";"+b}function ga(a){this.Oa=a||"-"}ga.prototype.h=function(a){for(var c=[],b=0;b<arguments.length;b++)c.push(arguments[b].replace(/[\W_]+/g,"").toLowerCase());return c.join(this.Oa)};
+function ja(){this.xa="'"}ja.prototype.quote=function(a){for(var c=[],a=a.split(/,\s*/),b=0;b<a.length;b++){var d=a[b].replace(/['"]/g,"");-1==d.indexOf(" ")?c.push(d):c.push(this.xa+d+this.xa)}return c.join(",")};function ka(){this.va=oa;this.J=pa}var oa=["font-style","font-weight"],pa={"font-style":[["n","normal"],["i","italic"],["o","oblique"]],"font-weight":[["1","100"],["2","200"],["3","300"],["4","400"],["5","500"],["6","600"],["7","700"],["8","800"],["9","900"],["4","normal"],["7","bold"]]};
+function qa(a,c,b){this.Na=a;this.Ta=c;this.J=b}qa.prototype.expand=function(a,c){for(var b=0;b<this.J.length;b++)if(c==this.J[b][0]){a[this.Na]=this.Ta+":"+this.J[b][1];break}};ka.prototype.expand=function(a){if(2!=a.length)return l;for(var c=[l,l],b=0,d=this.va.length;b<d;b++){var e=this.va[b];(new qa(b,e,this.J[e])).expand(c,a.substr(b,1))}return c[0]&&c[1]?c.join(";")+";":l};function I(a,c){this.qa=c||a;this.j=document;this.u=g}I.prototype=q.prototype;
+function J(a){return"https:"==a.j.location.protocol}I.prototype.Ka=function(){return this.j.location.hostname};function ra(a,c,b){var d=a.j.getElementsByTagName("head")[0];if(d){var e=a.j.createElement("script");e.src=c;var f=m;e.onload=e.onreadystatechange=function(){if(!f&&(!this.readyState||"loaded"==this.readyState||"complete"==this.readyState))f=k,b&&b(),e.onload=e.onreadystatechange=l,"HEAD"==e.parentNode.tagName&&d.removeChild(e)};d.appendChild(e)}}
+I.prototype.ya=function(a,c){this.Z()?a.setAttribute("style",c):a.style.cssText=c};I.prototype.Z=function(){if(this.u===g){var a=this.j.createElement("p");a.innerHTML='<a style="top:1px;">w</a>';this.u=/top/.test(a.getElementsByTagName("a")[0].getAttribute("style"))}return this.u};function sa(){var a=[{name:"font-family",value:K.c[L+1]}];this.Ua=[K.c[L]];this.ia=a}
+function ta(a){for(var c=a.Ua.join(","),b=[],d=0;d<a.ia.length;d++){var e=a.ia[d];b.push(e.name+":"+e.value+";")}return c+"{"+b.join("")+"}"}function M(a,c){this.F=a;this.L=c;this.ka={};this.ja={}}M.prototype.z=function(a){return a?(this.ka[a.N]||this.L).slice(0):this.L.slice(0)};function ua(a,c,b){for(var d=[],e=a.F.split(",")[0].replace(/"|'/g,""),f=a.z(),h,i=[],j={},A=0;A<f.length;A++)h=f[A],0<h.length&&!j[h]&&(j[h]=k,i.push(h));b=b.wa?b.wa(e,i,d):i;c=c.N;a.ka[c]=b;a.ja[c]=d}
+M.prototype.watch=function(a,c,b){var d=[],e={};va(this,c,d,e);a(d,e,b)};function va(a,c,b,d){b.push(a.F);d[a.F]=a.z(c);a=a.ja[c.N]||[];for(c=0;c<a.length;c++){for(var e=a[c],f=e.F,h=m,i=0;i<b.length;i++)b[i]==f&&(h=k);h||(b.push(f),d[f]=e.z())}}function wa(a,c){this.F=a;this.L=c}wa.prototype.z=n("L");function xa(a){var c=new Image(1,1);c.src=a;c.onload=function(){c.onload=l}}function N(a,c){this.N=a;this.la=c}function ya(){this.ea=this.Ba=this.v=this.H=this.I=k}function P(a){za.Q.push(a)}
+function Aa(a){this.g=a;this.fa=this.r=this.e=this.P=l;this.n=[];this.K=[];this.Aa=this.W=this.R=this.S=l}function Ba(a,c){a.e=c;if(a.P){var b;a:{b=a.P;for(var d=a.e,e=a.fa,f=0;f<b.Q.length;f++){var h=b.Q[f],i=d,j=e;j||(j=new ya);if(h.la&&h.la(i.getName(),i.getVersion(),i.getEngine(),i.getEngineVersion(),i.getPlatform(),i.getPlatformVersion(),i.getDocumentMode(),j)){b=h;break a}}b=l}a.r=b}}o=Aa.prototype;o.supportsConfiguredBrowser=function(){return!!this.r};
+o.init=function(){if(0<this.K.length){for(var a=[],c=0;c<this.K.length;c++)a.push(ta(this.K[c]));var c=this.g,a=a.join(""),b=this.g.j.createElement("style");b.setAttribute("type","text/css");b.styleSheet?b.styleSheet.cssText=a:b.appendChild(document.createTextNode(a));r(c,"head",b)}};
+o.load=function(a,c){var b=this.r.N;if(this.W)for(var d=Ca(this.W,b),e=0;e<this.n.length;e++)ua(this.n[e],this.r,d);this.S&&(d=[],this.R&&(d=new Da(this.g,this.r,this.n),d=Ea(this.R,b,d)),b=this.S.h(J(this.g),Fa(b,d)),r(this.g,"head",this.g.createElement("link",{rel:"stylesheet",href:b})));a&&s(function(a,b,c,e){return function(){for(var d=0;d<a.n.length;d++)a.n[d].watch(b,c,e&&d==a.n.length-1)}}(this,a,this.r,c))};
+o.collectFontFamilies=function(a,c){for(var b=0;b<this.n.length;b++)va(this.n[b],this.r,a,c)};o.performOptionalActions=function(a){this.$&&s(function(a,b,d,e){return function(){var b=a.$;if(b.ua){var h=window.__adobewebfontsappname__,h=h?h.toString().substr(0,20):"";xa(b.ua.h(J(e),{host:encodeURIComponent(e.j.location.hostname),app:encodeURIComponent(h),_:(+new Date).toString()}))}b=a.$;b.da&&(b=b.da.h(d,e),r(e,"body",b))}}(this,a,this.e,this.g))};
+function Q(a,c,b,d){this.Pa=a;this.g=c;this.l=b;this.t=d;this.q=[]}Q.prototype.O=function(a){this.q.push(a)};Q.prototype.load=function(a,c){var b=a,d=c||{};if("string"==typeof b)b=[b];else if(!b||!b.length)d=b||{},b=[];if(b.length)for(var e=this,f=b.length,h=0;h<b.length;h++)Ga(this,b[h],function(){0==--f&&Ha(e,d)});else Ha(this,d)};function Ga(a,c,b){ra(a.g,a.Pa.h(J(a.g),{id:encodeURIComponent(c)}),b)}
+function Ha(a,c){if(0!=a.q.length){for(var b=new da(a.g,a.l,c),d=m,e=0;e<a.q.length;e++)a.q[e].init(),d=d||a.q[e].supportsConfiguredBrowser();d?(u(b.l,b.m.h(b.o,"loading")),D(b,"loading"),Ja(a,b)):ha(b);a.q=[]}}function Ja(a,c){function b(a,b,c){d.watch(a,b,{},F,c)}for(var d=new E(a.g,c,{Y:function(a){return a.offsetWidth}},a.t,function(){return+new Date}),e=0;e<a.q.length;e++){var f=a.q[e];f.supportsConfiguredBrowser()&&(f.load(b,e==a.q.length-1),f.performOptionalActions(window))}}
+function R(a,c){this.A=a;this.t=c;this.q=[]}R.prototype.O=function(a){this.q.push(a)};R.prototype.load=function(){var a=this.A.__webfonttypekitmodule__;if(a)for(var c=0;c<this.q.length;c++){var b=this.q[c],d=a[b.Aa];if(d){var e=this.t;d(function(a,c,d){var c=[],j={};Ba(b,a);b.supportsConfiguredBrowser()&&(b.init(),b.load(l,e),b.collectFontFamilies(c,j),b.performOptionalActions(window));d(b.supportsConfiguredBrowser(),c,j)})}}};function S(a,c){this.aa=a;this.wa=c}S.prototype.getName=n("aa");
+function Ka(a){var c=T;La(c,a.getName())||c.X.push(a)}function La(a,c){for(var b=0;b<a.X.length;b++){var d=a.X[b];if(c===d.getName())return d}return l}function Ca(a,c){var b=a.B[c];return b?La(a,b):l}function Ea(a,c,b){for(var d=[],a=a.C[c]||[],c=0;c<a.length;c++){var e;a:switch(a[c]){case "observeddomain":e=new Ma(b.g);break a;case "fontmask":e=new Na(b.r,b.n);break a;default:e=l}e&&d.push(e)}return d}function Da(a,c,b){this.g=a;this.r=c;this.n=b}function Ma(a){this.g=a}
+Ma.prototype.toString=function(){return encodeURIComponent(this.g.Ka?this.g.j.location.hostname:document.location.hostname)};function Na(a,c){this.r=a;this.n=c}Na.prototype.toString=function(){for(var a=[],c=0;c<this.n.length;c++)for(var b=this.n[c],d=b.z(),b=b.z(this.r),e=0;e<d.length;e++){var f;a:{for(f=0;f<b.length;f++)if(d[e]===b[f]){f=k;break a}f=m}a.push(f?1:0)}a=a.join("");a=a.replace(/^0+/,"");c=[];for(d=a.length;0<d;d-=4)b=a.slice(0>d-4?0:d-4,d),c.unshift(parseInt(b,2).toString(16));return c.join("")};
+function U(a){this.Wa=a}U.prototype.h=function(a,c){var b=c||{},d=this.Wa.replace(/\{\/?([^*}]*)(\*?)\}/g,function(a,c,d){return d&&b[c]?"/"+b[c].join("/"):b[c]||""});d.match(/^\/\//)&&(d=(a?"https:":"http:")+d);return d.replace(/\/*\?*($|\?)/,"$1")};function Fa(a,c){for(var b=[],d=0;d<c.length;d++)b.push(c[d].toString());return{format:a,extras:b}}function Oa(a,c,b,d){this.A=a;this.j=c;this.La=b;this.pa=d}
+Oa.prototype.h=function(a,c){var b=this.j.createElement("img");b.setAttribute("width",62);b.setAttribute("height",25);b.setAttribute("src",this.La.h(J(c)));b.setAttribute("class","typekit-badge");b.setAttribute("alt","Fonts by Typekit");b.setAttribute("title","Information about the fonts used on this site");b.style.position="fixed";b.style.zIndex=2E9;b.style.right=0;b.style.bottom=0;b.style.cursor="pointer";b.style.border=0;"Opera"!=a.getName()&&(b.style.content="none");b.style.display="inline";b.style["float"]=
+"none";b.style.height="25px";b.style.left="auto";b.style.margin=0;b.style.maxHeight="25px";b.style.maxWidth="62px";b.style.minHeight="25px";b.style.minWidth="62px";b.style.orphans=2;b.style.outline="none";b.style.overflow="visible";b.style.padding=0;b.style.pageBreakAfter="auto";b.style.pageBreakBefore="auto";b.style.pageBreakInside="auto";b.style.tableLayout="auto";b.style.textIndent=0;b.style.top="auto";b.style.unicodeBidi="normal";b.style.verticalAlign="baseline";b.style.visibility="visible";b.style.widows=
+2;b.style.width="65px";if(this.pa){var d=this.j,e=this.pa;V(this,b,"click",function(){d.location.href=e})}var f=a.getPlatform();if("MSIE"==a.getName()&&"Windows Phone"!=f){b.style.position="absolute";var h=this,i=function(){var a=Pa(h,"scrollLeft","scrollTop"),c=Pa(h,"clientWidth","clientHeight");b.style.bottom="auto";b.style.right="auto";b.style.top=a[1]+c[1]-25+"px";b.style.left=a[0]+c[0]-3-62+"px"};V(this,this.A,"scroll",i);V(this,this.A,"resize",i)}if("iPhone"==f||"iPod"==f||"iPad"==f||"Android"==
+f||"Windows Phone"==f||"BlackBerry"==f)b.style.display="none";return b};function Pa(a,c,b){var d=0,e=0,a=a.j;if(a.documentElement&&(a.documentElement[c]||a.documentElement[b]))d=a.documentElement[c],e=a.documentElement[b];else if(a.body&&(a.body[c]||a.body[b]))d=a.body[c],e=a.body[b];return[d,e]}function V(a,c,b,d){if(c.attachEvent){var e=a.A;c["e"+b+d]=d;c[b+d]=function(){c["e"+b+d](e.event)};c.attachEvent("on"+b,c[b+d])}else c.addEventListener(b,d,m)}var za=new function(){this.Q=[]};
+P(new N("a",function(a,c,b,d,e,f){if(m||("Windows"==e&&"Unknown"==f?k:m)||("Ubuntu"==e||"Linux"==e?k:m))a:{if("AdobeAIR"==a&&(a=/([0-9]+.[0-9]+)/.exec(c))){a=2.5<=parseFloat(a[1]);break a}a=m}else a=m;return a}));
+P(new N("b",function(a,c,b,d,e,f,h,i){var j;j=m||function(a,b,c,e,d,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==d&&a?(d=parseInt(a[1],10),f=parseInt(a[3],10),10<d||10==d&&4<=f):"Macintosh"==d&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b){if("AdobeAIR"==a){var c=/([0-9]+.[0-9]+)/.exec(b);if(c)return 2.5<=parseFloat(c[1])}return m}(a,c,b,d,e,f,h,i)}));
+P(new N("a",function(a,c,b,d,e,f,h,i){if(!(c=m))f=/([0-9]+).([0-9]+)/.exec(f),i.v&&"Android"==e&&f?(e=parseInt(f[1],10),i=parseInt(f[2],10),c=2==e&&2<=i||3==e&&1>i):c=m;return!c?m:"BuiltinBrowser"==a}));P(new N("f",function(a,c,b,d,e,f,h,i){if(!(c=m))f=/([0-9]+).([0-9]+)/.exec(f),i.v&&"Android"==e&&f?(e=parseInt(f[1],10),i=parseInt(f[2],10),c=3==e&&1<=i||3<e):c=m;return!c?m:"BuiltinBrowser"==a}));P(new N("d",function(a,c,b,d,e,f,h,i){c=m||i.ea&&10<=parseInt(f,10);return!c?m:"BuiltinBrowser"==a}));
+P(new N("a",function(a,c,b,d,e,f,h,i){var j;j=(j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,d,e,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==e&&a?(e=parseInt(a[1],10),a=parseInt(a[2],10),6<e||6==e&&1<=a):m}(a,c,b,d,e,f,h,i))||function(a,b,c,d,e,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==e&&a?(e=parseInt(a[1],10),f=parseInt(a[3],10),10<e||10==e&&4<=f):"Macintosh"==e&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i);return!j&&!("Ubuntu"==
+e||"Linux"==e?k:m)?m:function(a,b){if("Chrome"==a){var c=/([0-9]+.[0-9]+).([0-9]+).([0-9]+)/.exec(b);if(c){var e=parseFloat(c[1]),d=parseInt(c[2],10),c=parseInt(c[3],10);if(!(6<=e)&&(4<e||4==e&&249<d||4==e&&249==d&&4<=c))return k}}return m}(a,c,b,d,e,f,h,i)}));
+P(new N("d",function(a,c,b,d,e,f,h,i){var j;j=(j=(j=(j=(j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,e,d,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==d&&a?(d=parseInt(a[1],10),a=parseInt(a[2],10),6<d||6==d&&1<=a):m}(a,c,b,d,e,f,h,i))||function(a,b,c,e,d,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==d&&a?(d=parseInt(a[1],10),f=parseInt(a[3],10),10<d||10==d&&4<=f):"Macintosh"==d&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i))||("Ubuntu"==
+e||"Linux"==e?k:m)||function(a,b,c,d,e,f,h,i){a=/([0-9]+).([0-9]+)/.exec(f);return i.v&&"Android"==e&&a?(e=parseInt(a[1],10),i=parseInt(a[2],10),3==e&&1<=i||3<e):m}(a,c,b,d,e,f,h,i))||"CrOS"==e||function(a,b,c,e,d,f,i,h){return h.H&&"iPad"==d?(a=/^([0-9]+)_([0-9]+)/.exec(f))?5<=parseInt(a[1],10):m:m}(a,c,b,d,e,f,h,i))||function(a,b,c,e,d,f,h,i){return i.I&&("iPhone"==d||"iPod"==d)?(a=/^([0-9]+)_([0-9]+)/.exec(f))?5<=parseInt(a[1],10):m:m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b){if("Chrome"==a){var c=
+/([0-9]+.[0-9]+).([0-9]+).([0-9]+)/.exec(b);if(c&&6<=parseFloat(c[1]))return k}}(a,c,b,d,e,f,h,i)}));
+P(new N("a",function(a,c,b,d,e,f,h,i){var j;j=(j=m||function(a,b,c,d,e,f,i,h){return h.H&&"iPad"==e&&(a=/^([0-9]+)_([0-9]+)/.exec(f))?(b=parseInt(a[2],10),4==parseInt(a[1],10)&&2<=b):m}(a,c,b,d,e,f,h,i))||function(a,b,c,d,e,f,h,i){if(i.I&&("iPhone"==e||"iPod"==e))if(a=/^([0-9]+)_([0-9]+)/.exec(f))return b=parseInt(a[2],10),4==parseInt(a[1],10)&&2<=b;return m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b){if("Chrome"==a){var c=/([0-9]+.[0-9]+).([0-9]+).([0-9]+)/.exec(b);if(c&&6<=parseFloat(c[1]))return k}}(a,
+c,b,d,e,f,h,i)}));P(new N("a",function(a,c,b,d,e,f,h,i){var j;j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,e,d,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==d&&a?(d=parseInt(a[1],10),a=parseInt(a[2],10),6<d||6==d&&1<=a):m}(a,c,b,d,e,f,h,i);return!j&&!("Ubuntu"==e||"Linux"==e?k:m)?m:function(a,b,c,d){return"Gecko"==c?(a=/1.9.1b[1-3]{1}/,/1.9.1/.test(d)&&!a.test(d)):m}(a,c,b,d,e,f,h,i)}));
+P(new N("b",function(a,c,b,d,e,f,h,i){var j;j=m||function(a,b,c,d,e,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==e&&a?(e=parseInt(a[1],10),f=parseInt(a[3],10),10<e||10==e&&4<=f):"Macintosh"==e&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b,c,d){return"Gecko"==c?(a=/1.9.1b[1-3]{1}/,/1.9.1/.test(d)&&!a.test(d)):m}(a,c,b,d,e,f,h,i)}));
+P(new N("d",function(a,c,b,d,e,f,h,i){var j;j=(j=(j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,d,e,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==e&&a?(e=parseInt(a[1],10),a=parseInt(a[2],10),6<e||6==e&&1<=a):m}(a,c,b,d,e,f,h,i))||function(a,b,c,e,d,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==d&&a?(d=parseInt(a[1],10),f=parseInt(a[3],10),10<d||10==d&&4<=f):"Macintosh"==d&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i))||("Ubuntu"==
+e||"Linux"==e?k:m)||i.v&&"Android"==e;return!j?m:function(a,b,c,d){return"Gecko"==c&&(b=/([0-9]+.[0-9]+)(.([0-9]+)|)/.exec(d))?(a=parseFloat(b[1]),b=parseInt(b[3],10),1.9<a||1.9<=a&&1<b):m}(a,c,b,d,e,f,h,i)}));
+P(new N("i",function(a,c,b,d,e,f,h,i){var j;j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,d,e,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==e&&a?(e=parseInt(a[1],10),a=parseInt(a[2],10),6<e||6==e&&1<=a):m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b,c,d,e,f,i){if("MSIE"==a)return(a=/([0-9]+.[0-9]+)/.exec(b))?6<=parseFloat(a[1])&&(i===g||9>i):m}(a,c,b,d,e,f,h,i)}));
+P(new N("d",function(a,c,b,d,e,f,h){if(!(c=m))b=/^([0-9]+).([0-9]+)/.exec(f),"Windows"==e&&b?(c=parseInt(b[1],10),b=parseInt(b[2],10),c=6<c||6==c&&1<=b):c=m;a=c||("Windows"==e&&"6.0"==f?k:m)?"MSIE"==a?9<=h:g:m;return a}));P(new N("d",function(a,c,b,d,e,f,h,i){if(!(c=m))f=/^([0-9]+)/.exec(f),c=i.Ba&&"Windows Phone"==e&&f?8<=parseInt(f[1],10):m;return!c?m:"MSIE"==a}));
+P(new N("a",function(a,c,b,d,e,f,h,i){var j;j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,d,e,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==e&&a?(e=parseInt(a[1],10),a=parseInt(a[2],10),6<e||6==e&&1<=a):m}(a,c,b,d,e,f,h,i);return!j&&!("Ubuntu"==e||"Linux"==e?k:m)?m:function(a,b){if("Opera"==a){var c=parseFloat(b);return 10.54<=c&&11.1>c}return m}(a,c,b,d,e,f,h,i)}));
+P(new N("b",function(a,c,b,d,e,f,h,i){var j;j=m||function(a,b,c,e,d,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==d&&a?(d=parseInt(a[1],10),f=parseInt(a[3],10),10<d||10==d&&4<=f):"Macintosh"==d&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b){if("Opera"==a){var c=parseFloat(b);return 10.54<=c&&11.1>c}return m}(a,c,b,d,e,f,h,i)}));
+P(new N("d",function(a,c,b,d,e,f,h,i){var j;j=(j=(j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,d,e,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==e&&a?(e=parseInt(a[1],10),a=parseInt(a[2],10),6<e||6==e&&1<=a):m}(a,c,b,d,e,f,h,i))||function(a,b,c,e,d,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==d&&a?(d=parseInt(a[1],10),f=parseInt(a[3],10),10<d||10==d&&4<=f):"Macintosh"==d&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i))||("Ubuntu"==
+e||"Linux"==e?k:m)||i.v&&"Android"==e;return!j?m:"Opera"==a?11.1<=parseFloat(c):m}));P(new N("b",function(a,c,b,d,e,f,h,i){var j;j=m||function(a,b,c,d,e,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==e&&a?(e=parseInt(a[1],10),f=parseInt(a[3],10),10<e||10==e&&4<=f):"Macintosh"==e&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b,c,e){return"Safari"==a&&"AppleWebKit"==c&&(a=/([0-9]+.[0-9]+)/.exec(e))?(a=parseFloat(a[1]),525.13<=a&&534.5>a):m}(a,c,b,d,e,f,h,i)}));
+P(new N("a",function(a,c,b,d,e,f,h,i){var j;j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,e,d,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==d&&a?(d=parseInt(a[1],10),a=parseInt(a[2],10),6<d||6==d&&1<=a):m}(a,c,b,d,e,f,h,i);return!j?m:function(a,b,c,d){return"Safari"==a&&"AppleWebKit"==c&&(a=/([0-9]+.[0-9]+)/.exec(d))?(a=parseFloat(a[1]),525.13<=a&&534.5>a):m}(a,c,b,d,e,f,h,i)}));
+P(new N("d",function(a,c,b,d,e,f,h,i){var j;j=(j=m||("Windows"==e&&"5.1"==f?k:m)||("Windows"==e&&"5.2"==f?k:m)||("Windows"==e&&"6.0"==f?k:m)||function(a,b,c,d,e,f){a=/^([0-9]+).([0-9]+)/.exec(f);return"Windows"==e&&a?(e=parseInt(a[1],10),a=parseInt(a[2],10),6<e||6==e&&1<=a):m}(a,c,b,d,e,f,h,i))||function(a,b,c,e,d,f){a=/^([0-9]+)(_|.)([0-9]+)/.exec(f);return"Macintosh"==d&&a?(d=parseInt(a[1],10),f=parseInt(a[3],10),10<d||10==d&&4<=f):"Macintosh"==d&&"Unknown"==f?k:m}(a,c,b,d,e,f,h,i);return!j?m:function(a,
+b,c,d){return"Safari"==a&&"AppleWebKit"==c&&(a=/([0-9]+.[0-9]+)/.exec(d))?534.5<=parseFloat(a[1]):m}(a,c,b,d,e,f,h,i)}));
+P(new N("a",function(a,c,b,d,e,f,h,i){var j;j=(j=m||function(a,b,c,d,e,f,i,h){return h.H&&"iPad"==e&&(a=/^([0-9]+)_([0-9]+)/.exec(f))?(b=parseInt(a[2],10),4==parseInt(a[1],10)&&2<=b):m}(a,c,b,d,e,f,h,i))||function(a,b,c,d,e,f,i,h){if(h.I&&("iPhone"==e||"iPod"==e))if(a=/^([0-9]+)_([0-9]+)/.exec(f))return b=parseInt(a[2],10),4==parseInt(a[1],10)&&2<=b;return m}(a,c,b,d,e,f,h,i);return!j?m:"Safari"==a&&"AppleWebKit"==b||"Unknown"==a&&"AppleWebKit"==b&&("iPhone"==e||"iPad"==e)?k:m}));
+P(new N("d",function(a,c,b,d,e,f,h,i){var j;j=(j=m||function(a,b,c,d,e,f,i,h){return h.H&&"iPad"==e?(a=/^([0-9]+)_([0-9]+)/.exec(f))?5<=parseInt(a[1],10):m:m}(a,c,b,d,e,f,h,i))||function(a,b,c,d,e,f,i,h){return h.I&&("iPhone"==e||"iPod"==e)?(a=/^([0-9]+)_([0-9]+)/.exec(f))?5<=parseInt(a[1],10):m:m}(a,c,b,d,e,f,h,i);return!j?m:"Safari"==a&&"AppleWebKit"==b||"Unknown"==a&&"AppleWebKit"==b&&("iPhone"==e||"iPad"==e)?k:m}));var T=new function(){this.X=[];this.B={}};Ka(new S("AllFonts",function(a,c){return c}));
+Ka(new S("DefaultFourFontsWithSingleFvdFamilies",function(a,c,b){for(var d=0;d<c.length;d++){var e=c[d],f=a.replace(/(-1|-2)$/,"").slice(0,28)+"-"+e;b.push(new wa(f,[e]))}a={};for(e=0;e<c.length;e++)b=c[e],d=b.charAt(1),(a[d]||(a[d]=[])).push(b);b=[[4,3,2,1,5,6,7,8,9],[7,8,9,6,5,4,3,2,1]];d=[];for(e=0;e<b.length;e++)for(var f=b[e],h=0;h<f.length;h++){var i=f[h];if(a[i]){d=d.concat(a[i]);break}}b=d;d={};a=[];for(e=0;e<b.length;e++)f=b[e],d[f]||(d[f]=k,a.push(f));b=[];for(d=0;d<c.length;d++){e=c[d];
+for(f=0;f<a.length;f++)h=a[f],h==e&&b.push(h)}return b}));T.B.a="AllFonts";T.B.b="AllFonts";T.B.d="AllFonts";T.B.f="AllFonts";T.B.i="DefaultFourFontsWithSingleFvdFamilies";var W=new function(){this.C={}};W.C.a=[];W.C.b=[];W.C.d=[];W.C.f=["observeddomain"];W.C.i=["observeddomain","fontmask"];window.Typekit||(window.Typekit={});
+if(!window.Typekit.load){var Qa=window.Typekit.config||{},Ra=l;Qa.k&&(Ra=new U(Qa.k));var Sa=function(a,c){setTimeout(a,c)},X=new Q(Ra,new I(window),document.documentElement,Sa),Y=new R(window,Sa);window.Typekit.load=function(){X.load.apply(X,arguments)};window.Typekit.addKit=function(){X.O.apply(X,arguments)}}var Ta,Ua=l,Va=l,Wa=l,Xa,Z,$,K=window.Typekit.config||{};K.b&&(Ua=new U(K.b),Va=new Oa(window,document,Ua,K.bu));K.p&&(Wa=new U(K.p));Xa=new function(){var a=Wa;this.da=Va;this.ua=a};$=new Aa(new I(window));
+$.$=Xa;Z=new ya;Z.I=!K.si;Z.H=!K.st;Z.v=!K.sa;Z.Ba=!K.sw;Z.ea=!K.sb;$.fa=Z;K.w&&($.Aa=K.w);K.f&&(Ta=new U(K.f),$.S=Ta);var L;if(K.fn)for(L=0;L<K.fn.length;L+=2)$.n.push(new M(K.fn[L],K.fn[L+1]));if(K.c)for(L=0;L<K.c.length;L+=2)$.K.push(new sa);$.R=W;$.P=za;$.W=T;Y&&Y.A.__webfonttypekitmodule__?(Y.O($),Y.load()):(Ba($,(new ba(navigator.userAgent,document)).parse()),window.Typekit.addKit($));
+})(this,document);
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jquery-1.11.1.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jquery-1.11.1.js
new file mode 100644
index 000000000..d4b67f7e6
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jquery-1.11.1.js
@@ -0,0 +1,10308 @@
+/*!
+ * jQuery JavaScript Library v1.11.1
+ * http://jquery.com/
+ *
+ * Includes Sizzle.js
+ * http://sizzlejs.com/
+ *
+ * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-05-01T17:42Z
+ */
+
+(function( global, factory ) {
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+ // For CommonJS and CommonJS-like environments where a proper window is present,
+ // execute the factory and get jQuery
+ // For environments that do not inherently posses a window with a document
+ // (such as Node.js), expose a jQuery-making factory as module.exports
+ // This accentuates the need for the creation of a real window
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Can't do this because several apps including ASP.NET trace
+// the stack via arguments.caller.callee and Firefox dies if
+// you try to trace through "use strict" call chains. (#13335)
+// Support: Firefox 18+
+//
+
+var deletedIds = [];
+
+var slice = deletedIds.slice;
+
+var concat = deletedIds.concat;
+
+var push = deletedIds.push;
+
+var indexOf = deletedIds.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var support = {};
+
+
+
+var
+ version = "1.11.1",
+
+ // Define a local copy of jQuery
+ jQuery = function( selector, context ) {
+ // The jQuery object is actually just the init constructor 'enhanced'
+ // Need init if jQuery is called (just allow error to be thrown if not included)
+ return new jQuery.fn.init( selector, context );
+ },
+
+ // Support: Android<4.1, IE<9
+ // Make sure we trim BOM and NBSP
+ rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
+
+ // Matches dashed string for camelizing
+ rmsPrefix = /^-ms-/,
+ rdashAlpha = /-([\da-z])/gi,
+
+ // Used by jQuery.camelCase as callback to replace()
+ fcamelCase = function( all, letter ) {
+ return letter.toUpperCase();
+ };
+
+jQuery.fn = jQuery.prototype = {
+ // The current version of jQuery being used
+ jquery: version,
+
+ constructor: jQuery,
+
+ // Start with an empty selector
+ selector: "",
+
+ // The default length of a jQuery object is 0
+ length: 0,
+
+ toArray: function() {
+ return slice.call( this );
+ },
+
+ // Get the Nth element in the matched element set OR
+ // Get the whole matched element set as a clean array
+ get: function( num ) {
+ return num != null ?
+
+ // Return just the one element from the set
+ ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
+
+ // Return all the elements in a clean array
+ slice.call( this );
+ },
+
+ // Take an array of elements and push it onto the stack
+ // (returning the new matched element set)
+ pushStack: function( elems ) {
+
+ // Build a new jQuery matched element set
+ var ret = jQuery.merge( this.constructor(), elems );
+
+ // Add the old object onto the stack (as a reference)
+ ret.prevObject = this;
+ ret.context = this.context;
+
+ // Return the newly-formed element set
+ return ret;
+ },
+
+ // Execute a callback for every element in the matched set.
+ // (You can seed the arguments with an array of args, but this is
+ // only used internally.)
+ each: function( callback, args ) {
+ return jQuery.each( this, callback, args );
+ },
+
+ map: function( callback ) {
+ return this.pushStack( jQuery.map(this, function( elem, i ) {
+ return callback.call( elem, i, elem );
+ }));
+ },
+
+ slice: function() {
+ return this.pushStack( slice.apply( this, arguments ) );
+ },
+
+ first: function() {
+ return this.eq( 0 );
+ },
+
+ last: function() {
+ return this.eq( -1 );
+ },
+
+ eq: function( i ) {
+ var len = this.length,
+ j = +i + ( i < 0 ? len : 0 );
+ return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
+ },
+
+ end: function() {
+ return this.prevObject || this.constructor(null);
+ },
+
+ // For internal use only.
+ // Behaves like an Array's method, not like a jQuery method.
+ push: push,
+ sort: deletedIds.sort,
+ splice: deletedIds.splice
+};
+
+jQuery.extend = jQuery.fn.extend = function() {
+ var src, copyIsArray, copy, name, options, clone,
+ target = arguments[0] || {},
+ i = 1,
+ length = arguments.length,
+ deep = false;
+
+ // Handle a deep copy situation
+ if ( typeof target === "boolean" ) {
+ deep = target;
+
+ // skip the boolean and the target
+ target = arguments[ i ] || {};
+ i++;
+ }
+
+ // Handle case when target is a string or something (possible in deep copy)
+ if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
+ target = {};
+ }
+
+ // extend jQuery itself if only one argument is passed
+ if ( i === length ) {
+ target = this;
+ i--;
+ }
+
+ for ( ; i < length; i++ ) {
+ // Only deal with non-null/undefined values
+ if ( (options = arguments[ i ]) != null ) {
+ // Extend the base object
+ for ( name in options ) {
+ src = target[ name ];
+ copy = options[ name ];
+
+ // Prevent never-ending loop
+ if ( target === copy ) {
+ continue;
+ }
+
+ // Recurse if we're merging plain objects or arrays
+ if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
+ if ( copyIsArray ) {
+ copyIsArray = false;
+ clone = src && jQuery.isArray(src) ? src : [];
+
+ } else {
+ clone = src && jQuery.isPlainObject(src) ? src : {};
+ }
+
+ // Never move original objects, clone them
+ target[ name ] = jQuery.extend( deep, clone, copy );
+
+ // Don't bring in undefined values
+ } else if ( copy !== undefined ) {
+ target[ name ] = copy;
+ }
+ }
+ }
+ }
+
+ // Return the modified object
+ return target;
+};
+
+jQuery.extend({
+ // Unique for each copy of jQuery on the page
+ expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
+
+ // Assume jQuery is ready without the ready module
+ isReady: true,
+
+ error: function( msg ) {
+ throw new Error( msg );
+ },
+
+ noop: function() {},
+
+ // See test/unit/core.js for details concerning isFunction.
+ // Since version 1.3, DOM methods and functions like alert
+ // aren't supported. They return false on IE (#2968).
+ isFunction: function( obj ) {
+ return jQuery.type(obj) === "function";
+ },
+
+ isArray: Array.isArray || function( obj ) {
+ return jQuery.type(obj) === "array";
+ },
+
+ isWindow: function( obj ) {
+ /* jshint eqeqeq: false */
+ return obj != null && obj == obj.window;
+ },
+
+ isNumeric: function( obj ) {
+ // parseFloat NaNs numeric-cast false positives (null|true|false|"")
+ // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
+ // subtraction forces infinities to NaN
+ return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
+ },
+
+ isEmptyObject: function( obj ) {
+ var name;
+ for ( name in obj ) {
+ return false;
+ }
+ return true;
+ },
+
+ isPlainObject: function( obj ) {
+ var key;
+
+ // Must be an Object.
+ // Because of IE, we also have to check the presence of the constructor property.
+ // Make sure that DOM nodes and window objects don't pass through, as well
+ if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ try {
+ // Not own constructor property must be Object
+ if ( obj.constructor &&
+ !hasOwn.call(obj, "constructor") &&
+ !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
+ return false;
+ }
+ } catch ( e ) {
+ // IE8,9 Will throw exceptions on certain host objects #9897
+ return false;
+ }
+
+ // Support: IE<9
+ // Handle iteration over inherited properties before own properties.
+ if ( support.ownLast ) {
+ for ( key in obj ) {
+ return hasOwn.call( obj, key );
+ }
+ }
+
+ // Own properties are enumerated firstly, so to speed up,
+ // if last one is own, then all properties are own.
+ for ( key in obj ) {}
+
+ return key === undefined || hasOwn.call( obj, key );
+ },
+
+ type: function( obj ) {
+ if ( obj == null ) {
+ return obj + "";
+ }
+ return typeof obj === "object" || typeof obj === "function" ?
+ class2type[ toString.call(obj) ] || "object" :
+ typeof obj;
+ },
+
+ // Evaluates a script in a global context
+ // Workarounds based on findings by Jim Driscoll
+ // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
+ globalEval: function( data ) {
+ if ( data && jQuery.trim( data ) ) {
+ // We use execScript on Internet Explorer
+ // We use an anonymous function so that context is window
+ // rather than jQuery in Firefox
+ ( window.execScript || function( data ) {
+ window[ "eval" ].call( window, data );
+ } )( data );
+ }
+ },
+
+ // Convert dashed to camelCase; used by the css and data modules
+ // Microsoft forgot to hump their vendor prefix (#9572)
+ camelCase: function( string ) {
+ return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
+ },
+
+ nodeName: function( elem, name ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
+ },
+
+ // args is for internal usage only
+ each: function( obj, callback, args ) {
+ var value,
+ i = 0,
+ length = obj.length,
+ isArray = isArraylike( obj );
+
+ if ( args ) {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.apply( obj[ i ], args );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+
+ // A special, fast, case for the most common use of each
+ } else {
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ } else {
+ for ( i in obj ) {
+ value = callback.call( obj[ i ], i, obj[ i ] );
+
+ if ( value === false ) {
+ break;
+ }
+ }
+ }
+ }
+
+ return obj;
+ },
+
+ // Support: Android<4.1, IE<9
+ trim: function( text ) {
+ return text == null ?
+ "" :
+ ( text + "" ).replace( rtrim, "" );
+ },
+
+ // results is for internal usage only
+ makeArray: function( arr, results ) {
+ var ret = results || [];
+
+ if ( arr != null ) {
+ if ( isArraylike( Object(arr) ) ) {
+ jQuery.merge( ret,
+ typeof arr === "string" ?
+ [ arr ] : arr
+ );
+ } else {
+ push.call( ret, arr );
+ }
+ }
+
+ return ret;
+ },
+
+ inArray: function( elem, arr, i ) {
+ var len;
+
+ if ( arr ) {
+ if ( indexOf ) {
+ return indexOf.call( arr, elem, i );
+ }
+
+ len = arr.length;
+ i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
+
+ for ( ; i < len; i++ ) {
+ // Skip accessing in sparse arrays
+ if ( i in arr && arr[ i ] === elem ) {
+ return i;
+ }
+ }
+ }
+
+ return -1;
+ },
+
+ merge: function( first, second ) {
+ var len = +second.length,
+ j = 0,
+ i = first.length;
+
+ while ( j < len ) {
+ first[ i++ ] = second[ j++ ];
+ }
+
+ // Support: IE<9
+ // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
+ if ( len !== len ) {
+ while ( second[j] !== undefined ) {
+ first[ i++ ] = second[ j++ ];
+ }
+ }
+
+ first.length = i;
+
+ return first;
+ },
+
+ grep: function( elems, callback, invert ) {
+ var callbackInverse,
+ matches = [],
+ i = 0,
+ length = elems.length,
+ callbackExpect = !invert;
+
+ // Go through the array, only saving the items
+ // that pass the validator function
+ for ( ; i < length; i++ ) {
+ callbackInverse = !callback( elems[ i ], i );
+ if ( callbackInverse !== callbackExpect ) {
+ matches.push( elems[ i ] );
+ }
+ }
+
+ return matches;
+ },
+
+ // arg is for internal usage only
+ map: function( elems, callback, arg ) {
+ var value,
+ i = 0,
+ length = elems.length,
+ isArray = isArraylike( elems ),
+ ret = [];
+
+ // Go through the array, translating each of the items to their new values
+ if ( isArray ) {
+ for ( ; i < length; i++ ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+
+ // Go through every key on the object,
+ } else {
+ for ( i in elems ) {
+ value = callback( elems[ i ], i, arg );
+
+ if ( value != null ) {
+ ret.push( value );
+ }
+ }
+ }
+
+ // Flatten any nested arrays
+ return concat.apply( [], ret );
+ },
+
+ // A global GUID counter for objects
+ guid: 1,
+
+ // Bind a function to a context, optionally partially applying any
+ // arguments.
+ proxy: function( fn, context ) {
+ var args, proxy, tmp;
+
+ if ( typeof context === "string" ) {
+ tmp = fn[ context ];
+ context = fn;
+ fn = tmp;
+ }
+
+ // Quick check to determine if target is callable, in the spec
+ // this throws a TypeError, but we will just return undefined.
+ if ( !jQuery.isFunction( fn ) ) {
+ return undefined;
+ }
+
+ // Simulated bind
+ args = slice.call( arguments, 2 );
+ proxy = function() {
+ return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
+ };
+
+ // Set the guid of unique handler to the same of original handler, so it can be removed
+ proxy.guid = fn.guid = fn.guid || jQuery.guid++;
+
+ return proxy;
+ },
+
+ now: function() {
+ return +( new Date() );
+ },
+
+ // jQuery.support is not used in Core but other projects attach their
+ // properties to it so it needs to exist.
+ support: support
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
+ class2type[ "[object " + name + "]" ] = name.toLowerCase();
+});
+
+function isArraylike( obj ) {
+ var length = obj.length,
+ type = jQuery.type( obj );
+
+ if ( type === "function" || jQuery.isWindow( obj ) ) {
+ return false;
+ }
+
+ if ( obj.nodeType === 1 && length ) {
+ return true;
+ }
+
+ return type === "array" || length === 0 ||
+ typeof length === "number" && length > 0 && ( length - 1 ) in obj;
+}
+var Sizzle =
+/*!
+ * Sizzle CSS Selector Engine v1.10.19
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: 2014-04-18
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ tokenize,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ // Local document vars
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ // Instance-specific data
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ // General-purpose constants
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ // Instance methods
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ // Use a stripped-down indexOf if we can't use a native one
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+ // Regular expressions
+
+ // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ // http://www.w3.org/TR/css3-syntax/#characters
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ // Loosely modeled on CSS identifier characters
+ // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
+ // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
+ // Operator (capture 2)
+ "*([*^$|!~]?=)" + whitespace +
+ // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
+ "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
+ "*\\]",
+
+ pseudos = ":(" + characterEncoding + ")(?:\\((" +
+ // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
+ // 1. quoted (capture 3; capture 4 or capture 5)
+ "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
+ // 2. simple (capture 6)
+ "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
+ // 3. anything else (capture 2)
+ ".*" +
+ ")\\)|)",
+
+ // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ // For use in libraries implementing .is()
+ // We use this for POS matching in `select`
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ // Easily-parseable/retrievable ID or TAG or CLASS selectors
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ // NaN means non-codepoint
+ // Support: Firefox<24
+ // Workaround erroneous numeric interpretation of +"0x"
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ // BMP codepoint
+ String.fromCharCode( high + 0x10000 ) :
+ // Supplemental Plane codepoint (surrogate pair)
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+// Optimize for push.apply( _, NodeList )
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ // Support: Android<4.0
+ // Detect silently failing push.apply
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ // Leverage slice if possible
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ // Support: IE<9
+ // Otherwise append directly
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ // Can't trust NodeList.length
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ // QSA vars
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ // Shortcuts
+ if ( (match = rquickExpr.exec( selector )) ) {
+ // Speed-up: Sizzle("#ID")
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document (jQuery #6963)
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE, Opera, and Webkit return items
+ // by name instead of ID
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ // Context is not a document
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ // Speed-up: Sizzle("TAG")
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ // Speed-up: Sizzle(".CLASS")
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ // QSA path
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ // qSA works strangely on Element-rooted queries
+ // We can work around this by specifying an extra ID on the root
+ // and working up from there (Thanks to Andrew Dupont for the technique)
+ // IE 8 doesn't work on object elements
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ // All others
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ // Only keep the most recent entries
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ // Remove from its parent by default
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ // release memory in IE
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ // Use IE sourceIndex if available on both nodes
+ if ( diff ) {
+ return diff;
+ }
+
+ // Check if b follows a
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ // Match elements found at the specified indexes
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+// Expose support vars for convenience
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ // documentElement is verified for cases where it doesn't yet exist
+ // (such as loading iframes in IE - #4833)
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare,
+ doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ // If no document and documentElement is available, return
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ // Set our document
+ document = doc;
+ docElem = doc.documentElement;
+
+ // Support tests
+ documentIsHTML = !isXML( doc );
+
+ // Support: IE>8
+ // If iframe document is assigned to "document" variable and if iframe has been reloaded,
+ // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
+ // IE6-8 do not support the defaultView property so parent will be undefined
+ if ( parent && parent !== parent.top ) {
+ // IE11 does not have attachEvent, so all must suffer
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", function() {
+ setDocument();
+ }, false );
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", function() {
+ setDocument();
+ });
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ // Support: IE<8
+ // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ // Check if getElementsByTagName("*") returns only elements
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ // Check if getElementsByClassName can be trusted
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
+
+ // Support: Safari<4
+ // Catch class over-caching
+ div.firstChild.className = "i";
+ // Support: Opera<10
+ // Catch gEBCN failure to find non-leading classes
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ // Support: IE<10
+ // Check if getElementById returns elements by name
+ // The broken getElementById methods don't pick up programatically-set names,
+ // so use a roundabout getElementsByName test
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ // ID find and filter
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ return m && m.parentNode ? [ m ] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ // Support: IE6/7
+ // getElementById is not reliable as a find shortcut
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ // Tag
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ // Filter out possible comments
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ // Class
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+ // QSA and matchesSelector support
+
+ // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
+ rbuggyMatches = [];
+
+ // qSa(:focus) reports false when true (Chrome 21)
+ // We allow this because of a bug in IE8/9 that throws an error
+ // whenever `document.activeElement` is accessed on an iframe
+ // So, we allow :focus to pass through QSA all the time to avoid the IE error
+ // See http://bugs.jquery.com/ticket/13378
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ // Build QSA regex
+ // Regex strategy adopted from Diego Perini
+ assert(function( div ) {
+ // Select is set to empty string on purpose
+ // This is to test IE's treatment of not explicitly
+ // setting a boolean content attribute,
+ // since its presence should be enough
+ // http://bugs.jquery.com/ticket/12359
+ div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
+
+ // Support: IE8, Opera 11-12.16
+ // Nothing should be selected when empty strings follow ^= or $= or *=
+ // The test attribute must be unknown in Opera but "safe" for WinRT
+ // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
+ if ( div.querySelectorAll("[msallowclip^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ // Support: IE8
+ // Boolean attributes and "value" are not treated correctly
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ // Webkit/Opera - :checked should return selected option elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+ // Support: Windows 8 Native Apps
+ // The type and name attributes are restricted during .innerHTML assignment
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ // Support: IE8
+ // Enforce case-sensitivity of name attribute
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
+ // IE8 throws error here and will not see later tests
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ // Opera 10-11 does not throw on post-comma invalid pseudos
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
+ docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ // Check to see if it's possible to do matchesSelector
+ // on a disconnected node (IE 9)
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ // This should fail with an exception
+ // Gecko does not error, returns false instead
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ // Element contains another
+ // Purposefully does not implement inclusive descendent
+ // As in, an element does not contain itself
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ // Document order sorting
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ // Flag for duplicate removal
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ // Sort on method existence if only one input has compareDocumentPosition
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ // Calculate position if both inputs belong to the same document
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ // Otherwise we know they are disconnected
+ 1;
+
+ // Disconnected nodes
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ // Choose the first element that is related to our preferred document
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ // Maintain original order
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ // Exit early if the nodes are identical
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ // Parentless nodes are either documents or disconnected
+ if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ // If the nodes are siblings, we can do a quick check
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ // Otherwise we need full lists of their ancestors for comparison
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ // Walk down the tree looking for a discrepancy
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ // Do a sibling check if the nodes have a common ancestor
+ siblingCheck( ap[i], bp[i] ) :
+
+ // Otherwise nodes in our document sort first
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ // Make sure that attribute selectors are quoted
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ // IE 9's matchesSelector returns false on disconnected nodes
+ if ( ret || support.disconnectedMatch ||
+ // As well, disconnected nodes are said to be in a document
+ // fragment in IE 9
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [ elem ] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ // Set document vars if needed
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ // Set document vars if needed
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ // Don't get fooled by Object.prototype properties (jQuery #13807)
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ // Unless we *know* we can detect duplicates, assume their presence
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ // Clear input after sorting to release objects
+ // See https://github.com/jquery/sizzle/pull/225
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ // If no nodeType, this is expected to be an array
+ while ( (node = elem[i++]) ) {
+ // Do not traverse comment nodes
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ // Use textContent for elements
+ // innerText usage removed for consistency of new lines (jQuery #11153)
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ // Traverse its children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+ // Do not include comment or processing instruction nodes
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ // Can be adjusted by the user
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ // Move the given value to match[3] whether quoted or unquoted
+ match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ // nth-* requires argument
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ // numeric x and y parameters for Expr.filter.CHILD
+ // remember that false/true cast respectively to 0/1
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ // other types prohibit arguments
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[6] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ // Accept quoted arguments as-is
+ if ( match[3] ) {
+ match[2] = match[4] || match[5] || "";
+
+ // Strip excess characters from unquoted arguments
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ // Get excess from tokenize (recursively)
+ (excess = tokenize( unquoted, true )) &&
+ // advance to the next closing parenthesis
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ // excess is a negative index
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ // Return only captures needed by the pseudo filter method (type and argument)
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ // Shortcut for :nth-*(n)
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ // :(first|last|only)-(child|of-type)
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ // Reverse direction for :only-* (if we haven't yet done so)
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ // non-xml :nth-child(...) stores cache data on `parent`
+ if ( forward && useCache ) {
+ // Seek `elem` from a previously-cached index
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ // Fallback to seeking `elem` from the start
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ // When found, cache indexes on `parent` and break
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ // Use previously-cached element index if available
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
+ } else {
+ // Use the same loop as above to seek `elem` from the start
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ // Cache the index of each encountered element
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ // Incorporate the offset, then check against cycle size
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ // pseudo-class names are case-insensitive
+ // http://www.w3.org/TR/selectors/#pseudo-classes
+ // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
+ // Remember that setFilters inherits from pseudos
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ // The user may use createPseudo to indicate that
+ // arguments are needed to create the filter function
+ // just as Sizzle does
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ // But maintain support for old signatures
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ // Potentially complex pseudos
+ "not": markFunction(function( selector ) {
+ // Trim the selector passed to compile
+ // to avoid treating leading and trailing
+ // spaces as combinators
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ // Match elements unmatched by `matcher`
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ // "Whether an element is represented by a :lang() selector
+ // is based solely on the element's language value
+ // being equal to the identifier C,
+ // or beginning with the identifier C immediately followed by "-".
+ // The matching of C against the element's language value is performed case-insensitively.
+ // The identifier C does not have to be a valid language name."
+ // http://www.w3.org/TR/selectors/#lang-pseudo
+ "lang": markFunction( function( lang ) {
+ // lang value must be a valid identifier
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ // Miscellaneous
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ // Boolean properties
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ // In CSS3, :checked should return both checked and selected elements
+ // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ // Accessing this property makes selected-by-default
+ // options in Safari work properly
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ // Contents
+ "empty": function( elem ) {
+ // http://www.w3.org/TR/selectors/#empty-pseudo
+ // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
+ // but not by others (comment: 8; processing instruction: 7; etc.)
+ // nodeType < 6 works because attributes (2) do not appear as children
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ // Element/input types
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ // Support: IE<8
+ // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ // Position-in-collection
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+// Add button/input type pseudos
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+// Easy API for creating new setFilters
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ // Comma and first run
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ // Don't consume trailing commas as valid
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ // Combinators
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ // Cast descendant combinators to space
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ // Filters
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ // Return the length of the invalid excess
+ // if we're just parsing
+ // Otherwise, throw an error or return tokens
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ // Cache the tokens
+ tokenCache( selector, groups ).slice( 0 );
+};
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ // Check against closest ancestor/preceding element
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ // Check against all ancestor/preceding elements
+ function( elem, context, xml ) {
+ var oldCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (oldCache = outerCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ // Assign to newCache so results back-propagate to previous elements
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ // Reuse newcache so results back-propagate to previous elements
+ outerCache[ dir ] = newCache;
+
+ // A match means we're done; a fail means we have to keep checking
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ // Get initial elements from seed or context
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ // Prefilter to get matcher input, preserving a map for seed-results synchronization
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ // ...intermediate processing is necessary
+ [] :
+
+ // ...otherwise use results directly
+ results :
+ matcherIn;
+
+ // Find primary matches
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ // Apply postFilter
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ // Un-match failing elements by moving them back to matcherIn
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ // Get the final matcherOut by condensing this intermediate into postFinder contexts
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ // Restore matcherIn since elem is not yet a final match
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ // Move matched elements from seed to results to keep them synchronized
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ // Add elements to results, through postFinder if defined
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ // The foundational matcher ensures that elements are reachable from top-level context(s)
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ // Return special upon seeing a positional matcher
+ if ( matcher[ expando ] ) {
+ // Find the next relative operator (if any) for proper handling
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ // If the preceding token was a descendant combinator, insert an implicit any-element `*`
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ // We must always have either seed elements or outermost context
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ // Use integer dirruns iff this is the outermost matcher
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ }
+
+ // Add elements passing elementMatchers directly to results
+ // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
+ // Support: IE<9, Safari
+ // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ // Track unmatched elements for set filters
+ if ( bySet ) {
+ // They will have gone through all possible matchers
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ // Lengthen the array for every element, matched or not
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ // Apply set filters to unmatched elements
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ // Reintegrate element matches to eliminate the need for sorting
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ // Discard index placeholder values to get only actual matches
+ setMatched = condense( setMatched );
+ }
+
+ // Add matches to results
+ push.apply( results, setMatched );
+
+ // Seedless set matches succeeding multiple successful matchers stipulate sorting
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ // Override manipulation of globals by nested matchers
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ // Generate a function of recursive functions that can be used to check each element
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ // Cache the compiled function
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ // Save selector and tokenization
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ // Try to minimize operations if there is no seed and only one group
+ if ( match.length === 1 ) {
+
+ // Take a shortcut and set the context if the root selector is an ID
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ // Precompiled matchers will still verify ancestry, so step up a level
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ // Fetch a seed set for right-to-left matching
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ // Abort if we hit a combinator
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ // Search, expanding context for leading sibling combinators
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ // If seed is empty or no tokens remain, we can return early
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ // Compile and execute a filtering function if one is not provided
+ // Provide `match` to avoid retokenization if we modified the selector above
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+// One-time assignments
+
+// Sort stability
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+// Support: Chrome<14
+// Always assume duplicates if they aren't passed to the comparison function
+support.detectDuplicates = !!hasDuplicate;
+
+// Initialize against the default document
+setDocument();
+
+// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
+// Detached nodes confoundingly follow *each other*
+support.sortDetached = assert(function( div1 ) {
+ // Should return 1, but returns 4 (following)
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+// Support: IE<8
+// Prevent attribute/property "interpolation"
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+// Support: IE<9
+// Use defaultValue in place of getAttribute("value")
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+// Support: IE<9
+// Use getAttributeNode to fetch booleans when getAttribute lies
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+return Sizzle;
+
+})( window );
+
+
+
+jQuery.find = Sizzle;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[":"] = jQuery.expr.pseudos;
+jQuery.unique = Sizzle.uniqueSort;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
+
+
+var rneedsContext = jQuery.expr.match.needsContext;
+
+var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
+
+
+
+var risSimple = /^.[^:#\[\.,]*$/;
+
+// Implement the identical functionality for filter and not
+function winnow( elements, qualifier, not ) {
+ if ( jQuery.isFunction( qualifier ) ) {
+ return jQuery.grep( elements, function( elem, i ) {
+ /* jshint -W018 */
+ return !!qualifier.call( elem, i, elem ) !== not;
+ });
+
+ }
+
+ if ( qualifier.nodeType ) {
+ return jQuery.grep( elements, function( elem ) {
+ return ( elem === qualifier ) !== not;
+ });
+
+ }
+
+ if ( typeof qualifier === "string" ) {
+ if ( risSimple.test( qualifier ) ) {
+ return jQuery.filter( qualifier, elements, not );
+ }
+
+ qualifier = jQuery.filter( qualifier, elements );
+ }
+
+ return jQuery.grep( elements, function( elem ) {
+ return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
+ });
+}
+
+jQuery.filter = function( expr, elems, not ) {
+ var elem = elems[ 0 ];
+
+ if ( not ) {
+ expr = ":not(" + expr + ")";
+ }
+
+ return elems.length === 1 && elem.nodeType === 1 ?
+ jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
+ jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
+ return elem.nodeType === 1;
+ }));
+};
+
+jQuery.fn.extend({
+ find: function( selector ) {
+ var i,
+ ret = [],
+ self = this,
+ len = self.length;
+
+ if ( typeof selector !== "string" ) {
+ return this.pushStack( jQuery( selector ).filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( self[ i ], this ) ) {
+ return true;
+ }
+ }
+ }) );
+ }
+
+ for ( i = 0; i < len; i++ ) {
+ jQuery.find( selector, self[ i ], ret );
+ }
+
+ // Needed because $( selector, context ) becomes $( context ).find( selector )
+ ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
+ ret.selector = this.selector ? this.selector + " " + selector : selector;
+ return ret;
+ },
+ filter: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], false) );
+ },
+ not: function( selector ) {
+ return this.pushStack( winnow(this, selector || [], true) );
+ },
+ is: function( selector ) {
+ return !!winnow(
+ this,
+
+ // If this is a positional/relative selector, check membership in the returned set
+ // so $("p:first").is("p:last") won't return true for a doc with two "p".
+ typeof selector === "string" && rneedsContext.test( selector ) ?
+ jQuery( selector ) :
+ selector || [],
+ false
+ ).length;
+ }
+});
+
+
+// Initialize a jQuery object
+
+
+// A central reference to the root jQuery(document)
+var rootjQuery,
+
+ // Use the correct document accordingly with window argument (sandbox)
+ document = window.document,
+
+ // A simple way to check for HTML strings
+ // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
+ // Strict HTML recognition (#11290: must start with <)
+ rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
+
+ init = jQuery.fn.init = function( selector, context ) {
+ var match, elem;
+
+ // HANDLE: $(""), $(null), $(undefined), $(false)
+ if ( !selector ) {
+ return this;
+ }
+
+ // Handle HTML strings
+ if ( typeof selector === "string" ) {
+ if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
+ // Assume that strings that start and end with <> are HTML and skip the regex check
+ match = [ null, selector, null ];
+
+ } else {
+ match = rquickExpr.exec( selector );
+ }
+
+ // Match html or make sure no context is specified for #id
+ if ( match && (match[1] || !context) ) {
+
+ // HANDLE: $(html) -> $(array)
+ if ( match[1] ) {
+ context = context instanceof jQuery ? context[0] : context;
+
+ // scripts is true for back-compat
+ // Intentionally let the error be thrown if parseHTML is not present
+ jQuery.merge( this, jQuery.parseHTML(
+ match[1],
+ context && context.nodeType ? context.ownerDocument || context : document,
+ true
+ ) );
+
+ // HANDLE: $(html, props)
+ if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
+ for ( match in context ) {
+ // Properties of context are called as methods if possible
+ if ( jQuery.isFunction( this[ match ] ) ) {
+ this[ match ]( context[ match ] );
+
+ // ...and otherwise set as attributes
+ } else {
+ this.attr( match, context[ match ] );
+ }
+ }
+ }
+
+ return this;
+
+ // HANDLE: $(#id)
+ } else {
+ elem = document.getElementById( match[2] );
+
+ // Check parentNode to catch when Blackberry 4.6 returns
+ // nodes that are no longer in the document #6963
+ if ( elem && elem.parentNode ) {
+ // Handle the case where IE and Opera return items
+ // by name instead of ID
+ if ( elem.id !== match[2] ) {
+ return rootjQuery.find( selector );
+ }
+
+ // Otherwise, we inject the element directly into the jQuery object
+ this.length = 1;
+ this[0] = elem;
+ }
+
+ this.context = document;
+ this.selector = selector;
+ return this;
+ }
+
+ // HANDLE: $(expr, $(...))
+ } else if ( !context || context.jquery ) {
+ return ( context || rootjQuery ).find( selector );
+
+ // HANDLE: $(expr, context)
+ // (which is just equivalent to: $(context).find(expr)
+ } else {
+ return this.constructor( context ).find( selector );
+ }
+
+ // HANDLE: $(DOMElement)
+ } else if ( selector.nodeType ) {
+ this.context = this[0] = selector;
+ this.length = 1;
+ return this;
+
+ // HANDLE: $(function)
+ // Shortcut for document ready
+ } else if ( jQuery.isFunction( selector ) ) {
+ return typeof rootjQuery.ready !== "undefined" ?
+ rootjQuery.ready( selector ) :
+ // Execute immediately if ready is not present
+ selector( jQuery );
+ }
+
+ if ( selector.selector !== undefined ) {
+ this.selector = selector.selector;
+ this.context = selector.context;
+ }
+
+ return jQuery.makeArray( selector, this );
+ };
+
+// Give the init function the jQuery prototype for later instantiation
+init.prototype = jQuery.fn;
+
+// Initialize central reference
+rootjQuery = jQuery( document );
+
+
+var rparentsprev = /^(?:parents|prev(?:Until|All))/,
+ // methods guaranteed to produce a unique set when starting from a unique set
+ guaranteedUnique = {
+ children: true,
+ contents: true,
+ next: true,
+ prev: true
+ };
+
+jQuery.extend({
+ dir: function( elem, dir, until ) {
+ var matched = [],
+ cur = elem[ dir ];
+
+ while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
+ if ( cur.nodeType === 1 ) {
+ matched.push( cur );
+ }
+ cur = cur[dir];
+ }
+ return matched;
+ },
+
+ sibling: function( n, elem ) {
+ var r = [];
+
+ for ( ; n; n = n.nextSibling ) {
+ if ( n.nodeType === 1 && n !== elem ) {
+ r.push( n );
+ }
+ }
+
+ return r;
+ }
+});
+
+jQuery.fn.extend({
+ has: function( target ) {
+ var i,
+ targets = jQuery( target, this ),
+ len = targets.length;
+
+ return this.filter(function() {
+ for ( i = 0; i < len; i++ ) {
+ if ( jQuery.contains( this, targets[i] ) ) {
+ return true;
+ }
+ }
+ });
+ },
+
+ closest: function( selectors, context ) {
+ var cur,
+ i = 0,
+ l = this.length,
+ matched = [],
+ pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
+ jQuery( selectors, context || this.context ) :
+ 0;
+
+ for ( ; i < l; i++ ) {
+ for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
+ // Always skip document fragments
+ if ( cur.nodeType < 11 && (pos ?
+ pos.index(cur) > -1 :
+
+ // Don't pass non-elements to Sizzle
+ cur.nodeType === 1 &&
+ jQuery.find.matchesSelector(cur, selectors)) ) {
+
+ matched.push( cur );
+ break;
+ }
+ }
+ }
+
+ return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
+ },
+
+ // Determine the position of an element within
+ // the matched set of elements
+ index: function( elem ) {
+
+ // No argument, return index in parent
+ if ( !elem ) {
+ return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
+ }
+
+ // index in selector
+ if ( typeof elem === "string" ) {
+ return jQuery.inArray( this[0], jQuery( elem ) );
+ }
+
+ // Locate the position of the desired element
+ return jQuery.inArray(
+ // If it receives a jQuery object, the first element is used
+ elem.jquery ? elem[0] : elem, this );
+ },
+
+ add: function( selector, context ) {
+ return this.pushStack(
+ jQuery.unique(
+ jQuery.merge( this.get(), jQuery( selector, context ) )
+ )
+ );
+ },
+
+ addBack: function( selector ) {
+ return this.add( selector == null ?
+ this.prevObject : this.prevObject.filter(selector)
+ );
+ }
+});
+
+function sibling( cur, dir ) {
+ do {
+ cur = cur[ dir ];
+ } while ( cur && cur.nodeType !== 1 );
+
+ return cur;
+}
+
+jQuery.each({
+ parent: function( elem ) {
+ var parent = elem.parentNode;
+ return parent && parent.nodeType !== 11 ? parent : null;
+ },
+ parents: function( elem ) {
+ return jQuery.dir( elem, "parentNode" );
+ },
+ parentsUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "parentNode", until );
+ },
+ next: function( elem ) {
+ return sibling( elem, "nextSibling" );
+ },
+ prev: function( elem ) {
+ return sibling( elem, "previousSibling" );
+ },
+ nextAll: function( elem ) {
+ return jQuery.dir( elem, "nextSibling" );
+ },
+ prevAll: function( elem ) {
+ return jQuery.dir( elem, "previousSibling" );
+ },
+ nextUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "nextSibling", until );
+ },
+ prevUntil: function( elem, i, until ) {
+ return jQuery.dir( elem, "previousSibling", until );
+ },
+ siblings: function( elem ) {
+ return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
+ },
+ children: function( elem ) {
+ return jQuery.sibling( elem.firstChild );
+ },
+ contents: function( elem ) {
+ return jQuery.nodeName( elem, "iframe" ) ?
+ elem.contentDocument || elem.contentWindow.document :
+ jQuery.merge( [], elem.childNodes );
+ }
+}, function( name, fn ) {
+ jQuery.fn[ name ] = function( until, selector ) {
+ var ret = jQuery.map( this, fn, until );
+
+ if ( name.slice( -5 ) !== "Until" ) {
+ selector = until;
+ }
+
+ if ( selector && typeof selector === "string" ) {
+ ret = jQuery.filter( selector, ret );
+ }
+
+ if ( this.length > 1 ) {
+ // Remove duplicates
+ if ( !guaranteedUnique[ name ] ) {
+ ret = jQuery.unique( ret );
+ }
+
+ // Reverse order for parents* and prev-derivatives
+ if ( rparentsprev.test( name ) ) {
+ ret = ret.reverse();
+ }
+ }
+
+ return this.pushStack( ret );
+ };
+});
+var rnotwhite = (/\S+/g);
+
+
+
+// String to Object options format cache
+var optionsCache = {};
+
+// Convert String-formatted options into Object-formatted ones and store in cache
+function createOptions( options ) {
+ var object = optionsCache[ options ] = {};
+ jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
+ object[ flag ] = true;
+ });
+ return object;
+}
+
+/*
+ * Create a callback list using the following parameters:
+ *
+ * options: an optional list of space-separated options that will change how
+ * the callback list behaves or a more traditional option object
+ *
+ * By default a callback list will act like an event callback list and can be
+ * "fired" multiple times.
+ *
+ * Possible options:
+ *
+ * once: will ensure the callback list can only be fired once (like a Deferred)
+ *
+ * memory: will keep track of previous values and will call any callback added
+ * after the list has been fired right away with the latest "memorized"
+ * values (like a Deferred)
+ *
+ * unique: will ensure a callback can only be added once (no duplicate in the list)
+ *
+ * stopOnFalse: interrupt callings when a callback returns false
+ *
+ */
+jQuery.Callbacks = function( options ) {
+
+ // Convert options from String-formatted to Object-formatted if needed
+ // (we check in cache first)
+ options = typeof options === "string" ?
+ ( optionsCache[ options ] || createOptions( options ) ) :
+ jQuery.extend( {}, options );
+
+ var // Flag to know if list is currently firing
+ firing,
+ // Last fire value (for non-forgettable lists)
+ memory,
+ // Flag to know if list was already fired
+ fired,
+ // End of the loop when firing
+ firingLength,
+ // Index of currently firing callback (modified by remove if needed)
+ firingIndex,
+ // First callback to fire (used internally by add and fireWith)
+ firingStart,
+ // Actual callback list
+ list = [],
+ // Stack of fire calls for repeatable lists
+ stack = !options.once && [],
+ // Fire callbacks
+ fire = function( data ) {
+ memory = options.memory && data;
+ fired = true;
+ firingIndex = firingStart || 0;
+ firingStart = 0;
+ firingLength = list.length;
+ firing = true;
+ for ( ; list && firingIndex < firingLength; firingIndex++ ) {
+ if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
+ memory = false; // To prevent further calls using add
+ break;
+ }
+ }
+ firing = false;
+ if ( list ) {
+ if ( stack ) {
+ if ( stack.length ) {
+ fire( stack.shift() );
+ }
+ } else if ( memory ) {
+ list = [];
+ } else {
+ self.disable();
+ }
+ }
+ },
+ // Actual Callbacks object
+ self = {
+ // Add a callback or a collection of callbacks to the list
+ add: function() {
+ if ( list ) {
+ // First, we save the current length
+ var start = list.length;
+ (function add( args ) {
+ jQuery.each( args, function( _, arg ) {
+ var type = jQuery.type( arg );
+ if ( type === "function" ) {
+ if ( !options.unique || !self.has( arg ) ) {
+ list.push( arg );
+ }
+ } else if ( arg && arg.length && type !== "string" ) {
+ // Inspect recursively
+ add( arg );
+ }
+ });
+ })( arguments );
+ // Do we need to add the callbacks to the
+ // current firing batch?
+ if ( firing ) {
+ firingLength = list.length;
+ // With memory, if we're not firing then
+ // we should call right away
+ } else if ( memory ) {
+ firingStart = start;
+ fire( memory );
+ }
+ }
+ return this;
+ },
+ // Remove a callback from the list
+ remove: function() {
+ if ( list ) {
+ jQuery.each( arguments, function( _, arg ) {
+ var index;
+ while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
+ list.splice( index, 1 );
+ // Handle firing indexes
+ if ( firing ) {
+ if ( index <= firingLength ) {
+ firingLength--;
+ }
+ if ( index <= firingIndex ) {
+ firingIndex--;
+ }
+ }
+ }
+ });
+ }
+ return this;
+ },
+ // Check if a given callback is in the list.
+ // If no argument is given, return whether or not list has callbacks attached.
+ has: function( fn ) {
+ return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
+ },
+ // Remove all callbacks from the list
+ empty: function() {
+ list = [];
+ firingLength = 0;
+ return this;
+ },
+ // Have the list do nothing anymore
+ disable: function() {
+ list = stack = memory = undefined;
+ return this;
+ },
+ // Is it disabled?
+ disabled: function() {
+ return !list;
+ },
+ // Lock the list in its current state
+ lock: function() {
+ stack = undefined;
+ if ( !memory ) {
+ self.disable();
+ }
+ return this;
+ },
+ // Is it locked?
+ locked: function() {
+ return !stack;
+ },
+ // Call all callbacks with the given context and arguments
+ fireWith: function( context, args ) {
+ if ( list && ( !fired || stack ) ) {
+ args = args || [];
+ args = [ context, args.slice ? args.slice() : args ];
+ if ( firing ) {
+ stack.push( args );
+ } else {
+ fire( args );
+ }
+ }
+ return this;
+ },
+ // Call all the callbacks with the given arguments
+ fire: function() {
+ self.fireWith( this, arguments );
+ return this;
+ },
+ // To know if the callbacks have already been called at least once
+ fired: function() {
+ return !!fired;
+ }
+ };
+
+ return self;
+};
+
+
+jQuery.extend({
+
+ Deferred: function( func ) {
+ var tuples = [
+ // action, add listener, listener list, final state
+ [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
+ [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
+ [ "notify", "progress", jQuery.Callbacks("memory") ]
+ ],
+ state = "pending",
+ promise = {
+ state: function() {
+ return state;
+ },
+ always: function() {
+ deferred.done( arguments ).fail( arguments );
+ return this;
+ },
+ then: function( /* fnDone, fnFail, fnProgress */ ) {
+ var fns = arguments;
+ return jQuery.Deferred(function( newDefer ) {
+ jQuery.each( tuples, function( i, tuple ) {
+ var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
+ // deferred[ done | fail | progress ] for forwarding actions to newDefer
+ deferred[ tuple[1] ](function() {
+ var returned = fn && fn.apply( this, arguments );
+ if ( returned && jQuery.isFunction( returned.promise ) ) {
+ returned.promise()
+ .done( newDefer.resolve )
+ .fail( newDefer.reject )
+ .progress( newDefer.notify );
+ } else {
+ newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
+ }
+ });
+ });
+ fns = null;
+ }).promise();
+ },
+ // Get a promise for this deferred
+ // If obj is provided, the promise aspect is added to the object
+ promise: function( obj ) {
+ return obj != null ? jQuery.extend( obj, promise ) : promise;
+ }
+ },
+ deferred = {};
+
+ // Keep pipe for back-compat
+ promise.pipe = promise.then;
+
+ // Add list-specific methods
+ jQuery.each( tuples, function( i, tuple ) {
+ var list = tuple[ 2 ],
+ stateString = tuple[ 3 ];
+
+ // promise[ done | fail | progress ] = list.add
+ promise[ tuple[1] ] = list.add;
+
+ // Handle state
+ if ( stateString ) {
+ list.add(function() {
+ // state = [ resolved | rejected ]
+ state = stateString;
+
+ // [ reject_list | resolve_list ].disable; progress_list.lock
+ }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
+ }
+
+ // deferred[ resolve | reject | notify ]
+ deferred[ tuple[0] ] = function() {
+ deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
+ return this;
+ };
+ deferred[ tuple[0] + "With" ] = list.fireWith;
+ });
+
+ // Make the deferred a promise
+ promise.promise( deferred );
+
+ // Call given func if any
+ if ( func ) {
+ func.call( deferred, deferred );
+ }
+
+ // All done!
+ return deferred;
+ },
+
+ // Deferred helper
+ when: function( subordinate /* , ..., subordinateN */ ) {
+ var i = 0,
+ resolveValues = slice.call( arguments ),
+ length = resolveValues.length,
+
+ // the count of uncompleted subordinates
+ remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
+
+ // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
+ deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
+
+ // Update function for both resolve and progress values
+ updateFunc = function( i, contexts, values ) {
+ return function( value ) {
+ contexts[ i ] = this;
+ values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
+ if ( values === progressValues ) {
+ deferred.notifyWith( contexts, values );
+
+ } else if ( !(--remaining) ) {
+ deferred.resolveWith( contexts, values );
+ }
+ };
+ },
+
+ progressValues, progressContexts, resolveContexts;
+
+ // add listeners to Deferred subordinates; treat others as resolved
+ if ( length > 1 ) {
+ progressValues = new Array( length );
+ progressContexts = new Array( length );
+ resolveContexts = new Array( length );
+ for ( ; i < length; i++ ) {
+ if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
+ resolveValues[ i ].promise()
+ .done( updateFunc( i, resolveContexts, resolveValues ) )
+ .fail( deferred.reject )
+ .progress( updateFunc( i, progressContexts, progressValues ) );
+ } else {
+ --remaining;
+ }
+ }
+ }
+
+ // if we're not waiting on anything, resolve the master
+ if ( !remaining ) {
+ deferred.resolveWith( resolveContexts, resolveValues );
+ }
+
+ return deferred.promise();
+ }
+});
+
+
+// The deferred used on DOM ready
+var readyList;
+
+jQuery.fn.ready = function( fn ) {
+ // Add the callback
+ jQuery.ready.promise().done( fn );
+
+ return this;
+};
+
+jQuery.extend({
+ // Is the DOM ready to be used? Set to true once it occurs.
+ isReady: false,
+
+ // A counter to track how many items to wait for before
+ // the ready event fires. See #6781
+ readyWait: 1,
+
+ // Hold (or release) the ready event
+ holdReady: function( hold ) {
+ if ( hold ) {
+ jQuery.readyWait++;
+ } else {
+ jQuery.ready( true );
+ }
+ },
+
+ // Handle when the DOM is ready
+ ready: function( wait ) {
+
+ // Abort if there are pending holds or we're already ready
+ if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
+ return;
+ }
+
+ // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
+ if ( !document.body ) {
+ return setTimeout( jQuery.ready );
+ }
+
+ // Remember that the DOM is ready
+ jQuery.isReady = true;
+
+ // If a normal DOM Ready event fired, decrement, and wait if need be
+ if ( wait !== true && --jQuery.readyWait > 0 ) {
+ return;
+ }
+
+ // If there are functions bound, to execute
+ readyList.resolveWith( document, [ jQuery ] );
+
+ // Trigger any bound ready events
+ if ( jQuery.fn.triggerHandler ) {
+ jQuery( document ).triggerHandler( "ready" );
+ jQuery( document ).off( "ready" );
+ }
+ }
+});
+
+/**
+ * Clean-up method for dom ready events
+ */
+function detach() {
+ if ( document.addEventListener ) {
+ document.removeEventListener( "DOMContentLoaded", completed, false );
+ window.removeEventListener( "load", completed, false );
+
+ } else {
+ document.detachEvent( "onreadystatechange", completed );
+ window.detachEvent( "onload", completed );
+ }
+}
+
+/**
+ * The ready event handler and self cleanup method
+ */
+function completed() {
+ // readyState === "complete" is good enough for us to call the dom ready in oldIE
+ if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
+ detach();
+ jQuery.ready();
+ }
+}
+
+jQuery.ready.promise = function( obj ) {
+ if ( !readyList ) {
+
+ readyList = jQuery.Deferred();
+
+ // Catch cases where $(document).ready() is called after the browser event has already occurred.
+ // we once tried to use readyState "interactive" here, but it caused issues like the one
+ // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
+ if ( document.readyState === "complete" ) {
+ // Handle it asynchronously to allow scripts the opportunity to delay ready
+ setTimeout( jQuery.ready );
+
+ // Standards-based browsers support DOMContentLoaded
+ } else if ( document.addEventListener ) {
+ // Use the handy event callback
+ document.addEventListener( "DOMContentLoaded", completed, false );
+
+ // A fallback to window.onload, that will always work
+ window.addEventListener( "load", completed, false );
+
+ // If IE event model is used
+ } else {
+ // Ensure firing before onload, maybe late but safe also for iframes
+ document.attachEvent( "onreadystatechange", completed );
+
+ // A fallback to window.onload, that will always work
+ window.attachEvent( "onload", completed );
+
+ // If IE and not a frame
+ // continually check to see if the document is ready
+ var top = false;
+
+ try {
+ top = window.frameElement == null && document.documentElement;
+ } catch(e) {}
+
+ if ( top && top.doScroll ) {
+ (function doScrollCheck() {
+ if ( !jQuery.isReady ) {
+
+ try {
+ // Use the trick by Diego Perini
+ // http://javascript.nwbox.com/IEContentLoaded/
+ top.doScroll("left");
+ } catch(e) {
+ return setTimeout( doScrollCheck, 50 );
+ }
+
+ // detach all dom ready events
+ detach();
+
+ // and execute any waiting functions
+ jQuery.ready();
+ }
+ })();
+ }
+ }
+ }
+ return readyList.promise( obj );
+};
+
+
+var strundefined = typeof undefined;
+
+
+
+// Support: IE<9
+// Iteration over object's inherited properties before its own
+var i;
+for ( i in jQuery( support ) ) {
+ break;
+}
+support.ownLast = i !== "0";
+
+// Note: most support tests are defined in their respective modules.
+// false until the test is run
+support.inlineBlockNeedsLayout = false;
+
+// Execute ASAP in case we need to set body.style.zoom
+jQuery(function() {
+ // Minified: var a,b,c,d
+ var val, div, body, container;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+ // Return for frameset docs that don't have a body
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ if ( typeof div.style.zoom !== strundefined ) {
+ // Support: IE<8
+ // Check if natively block-level elements act like inline-block
+ // elements when setting their display to 'inline' and giving
+ // them layout
+ div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
+
+ support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
+ if ( val ) {
+ // Prevent IE 6 from affecting layout for positioned elements #11048
+ // Prevent IE from shrinking the body in IE 7 mode #12869
+ // Support: IE<8
+ body.style.zoom = 1;
+ }
+ }
+
+ body.removeChild( container );
+});
+
+
+
+
+(function() {
+ var div = document.createElement( "div" );
+
+ // Execute the test only if not already executed in another module.
+ if (support.deleteExpando == null) {
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+})();
+
+
+/**
+ * Determines whether an object can have data
+ */
+jQuery.acceptData = function( elem ) {
+ var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
+ nodeType = +elem.nodeType || 1;
+
+ // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
+ return nodeType !== 1 && nodeType !== 9 ?
+ false :
+
+ // Nodes accept data unless otherwise specified; rejection can be conditional
+ !noData || noData !== true && elem.getAttribute("classid") === noData;
+};
+
+
+var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
+ rmultiDash = /([A-Z])/g;
+
+function dataAttr( elem, key, data ) {
+ // If nothing was found internally, try to fetch any
+ // data from the HTML5 data-* attribute
+ if ( data === undefined && elem.nodeType === 1 ) {
+
+ var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
+
+ data = elem.getAttribute( name );
+
+ if ( typeof data === "string" ) {
+ try {
+ data = data === "true" ? true :
+ data === "false" ? false :
+ data === "null" ? null :
+ // Only convert to a number if it doesn't change the string
+ +data + "" === data ? +data :
+ rbrace.test( data ) ? jQuery.parseJSON( data ) :
+ data;
+ } catch( e ) {}
+
+ // Make sure we set the data so it isn't changed later
+ jQuery.data( elem, key, data );
+
+ } else {
+ data = undefined;
+ }
+ }
+
+ return data;
+}
+
+// checks a cache object for emptiness
+function isEmptyDataObject( obj ) {
+ var name;
+ for ( name in obj ) {
+
+ // if the public data object is empty, the private is still empty
+ if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
+ continue;
+ }
+ if ( name !== "toJSON" ) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var ret, thisCache,
+ internalKey = jQuery.expando,
+
+ // We have to handle DOM nodes and JS objects differently because IE6-7
+ // can't GC object references properly across the DOM-JS boundary
+ isNode = elem.nodeType,
+
+ // Only DOM nodes need the global jQuery cache; JS object data is
+ // attached directly to the object so GC can occur automatically
+ cache = isNode ? jQuery.cache : elem,
+
+ // Only defining an ID for JS objects if its cache already exists allows
+ // the code to shortcut on the same path as a DOM node with no cache
+ id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
+
+ // Avoid doing any more work than we need to when trying to get data on an
+ // object that has no data at all
+ if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
+ return;
+ }
+
+ if ( !id ) {
+ // Only DOM nodes need a new unique ID for each element since their data
+ // ends up in the global cache
+ if ( isNode ) {
+ id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
+ } else {
+ id = internalKey;
+ }
+ }
+
+ if ( !cache[ id ] ) {
+ // Avoid exposing jQuery metadata on plain JS objects when the object
+ // is serialized using JSON.stringify
+ cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
+ }
+
+ // An object can be passed to jQuery.data instead of a key/value pair; this gets
+ // shallow copied over onto the existing cache
+ if ( typeof name === "object" || typeof name === "function" ) {
+ if ( pvt ) {
+ cache[ id ] = jQuery.extend( cache[ id ], name );
+ } else {
+ cache[ id ].data = jQuery.extend( cache[ id ].data, name );
+ }
+ }
+
+ thisCache = cache[ id ];
+
+ // jQuery data() is stored in a separate object inside the object's internal data
+ // cache in order to avoid key collisions between internal data and user-defined
+ // data.
+ if ( !pvt ) {
+ if ( !thisCache.data ) {
+ thisCache.data = {};
+ }
+
+ thisCache = thisCache.data;
+ }
+
+ if ( data !== undefined ) {
+ thisCache[ jQuery.camelCase( name ) ] = data;
+ }
+
+ // Check for both converted-to-camel and non-converted data property names
+ // If a data property was specified
+ if ( typeof name === "string" ) {
+
+ // First Try to find as-is property data
+ ret = thisCache[ name ];
+
+ // Test for null|undefined property data
+ if ( ret == null ) {
+
+ // Try to find the camelCased property
+ ret = thisCache[ jQuery.camelCase( name ) ];
+ }
+ } else {
+ ret = thisCache;
+ }
+
+ return ret;
+}
+
+function internalRemoveData( elem, name, pvt ) {
+ if ( !jQuery.acceptData( elem ) ) {
+ return;
+ }
+
+ var thisCache, i,
+ isNode = elem.nodeType,
+
+ // See jQuery.data for more information
+ cache = isNode ? jQuery.cache : elem,
+ id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
+
+ // If there is already no cache entry for this object, there is no
+ // purpose in continuing
+ if ( !cache[ id ] ) {
+ return;
+ }
+
+ if ( name ) {
+
+ thisCache = pvt ? cache[ id ] : cache[ id ].data;
+
+ if ( thisCache ) {
+
+ // Support array or space separated string names for data keys
+ if ( !jQuery.isArray( name ) ) {
+
+ // try the string as a key before any manipulation
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+
+ // split the camel cased version by spaces unless a key with the spaces exists
+ name = jQuery.camelCase( name );
+ if ( name in thisCache ) {
+ name = [ name ];
+ } else {
+ name = name.split(" ");
+ }
+ }
+ } else {
+ // If "name" is an array of keys...
+ // When data is initially created, via ("key", "val") signature,
+ // keys will be converted to camelCase.
+ // Since there is no way to tell _how_ a key was added, remove
+ // both plain key and camelCase key. #12786
+ // This will only penalize the array argument path.
+ name = name.concat( jQuery.map( name, jQuery.camelCase ) );
+ }
+
+ i = name.length;
+ while ( i-- ) {
+ delete thisCache[ name[i] ];
+ }
+
+ // If there is no data left in the cache, we want to continue
+ // and let the cache object itself get destroyed
+ if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
+ return;
+ }
+ }
+ }
+
+ // See jQuery.data for more information
+ if ( !pvt ) {
+ delete cache[ id ].data;
+
+ // Don't destroy the parent cache unless the internal data object
+ // had been the only thing left in it
+ if ( !isEmptyDataObject( cache[ id ] ) ) {
+ return;
+ }
+ }
+
+ // Destroy the cache
+ if ( isNode ) {
+ jQuery.cleanData( [ elem ], true );
+
+ // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
+ /* jshint eqeqeq: false */
+ } else if ( support.deleteExpando || cache != cache.window ) {
+ /* jshint eqeqeq: true */
+ delete cache[ id ];
+
+ // When all else fails, null
+ } else {
+ cache[ id ] = null;
+ }
+}
+
+jQuery.extend({
+ cache: {},
+
+ // The following elements (space-suffixed to avoid Object.prototype collisions)
+ // throw uncatchable exceptions if you attempt to set expando properties
+ noData: {
+ "applet ": true,
+ "embed ": true,
+ // ...but Flash objects (which have this classid) *can* handle expandos
+ "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
+ },
+
+ hasData: function( elem ) {
+ elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
+ return !!elem && !isEmptyDataObject( elem );
+ },
+
+ data: function( elem, name, data ) {
+ return internalData( elem, name, data );
+ },
+
+ removeData: function( elem, name ) {
+ return internalRemoveData( elem, name );
+ },
+
+ // For internal use only.
+ _data: function( elem, name, data ) {
+ return internalData( elem, name, data, true );
+ },
+
+ _removeData: function( elem, name ) {
+ return internalRemoveData( elem, name, true );
+ }
+});
+
+jQuery.fn.extend({
+ data: function( key, value ) {
+ var i, name, data,
+ elem = this[0],
+ attrs = elem && elem.attributes;
+
+ // Special expections of .data basically thwart jQuery.access,
+ // so implement the relevant behavior ourselves
+
+ // Gets all values
+ if ( key === undefined ) {
+ if ( this.length ) {
+ data = jQuery.data( elem );
+
+ if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
+ i = attrs.length;
+ while ( i-- ) {
+
+ // Support: IE11+
+ // The attrs elements can be null (#14894)
+ if ( attrs[ i ] ) {
+ name = attrs[ i ].name;
+ if ( name.indexOf( "data-" ) === 0 ) {
+ name = jQuery.camelCase( name.slice(5) );
+ dataAttr( elem, name, data[ name ] );
+ }
+ }
+ }
+ jQuery._data( elem, "parsedAttrs", true );
+ }
+ }
+
+ return data;
+ }
+
+ // Sets multiple values
+ if ( typeof key === "object" ) {
+ return this.each(function() {
+ jQuery.data( this, key );
+ });
+ }
+
+ return arguments.length > 1 ?
+
+ // Sets one value
+ this.each(function() {
+ jQuery.data( this, key, value );
+ }) :
+
+ // Gets one value
+ // Try to fetch any internally stored data first
+ elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
+ },
+
+ removeData: function( key ) {
+ return this.each(function() {
+ jQuery.removeData( this, key );
+ });
+ }
+});
+
+
+jQuery.extend({
+ queue: function( elem, type, data ) {
+ var queue;
+
+ if ( elem ) {
+ type = ( type || "fx" ) + "queue";
+ queue = jQuery._data( elem, type );
+
+ // Speed up dequeue by getting out quickly if this is just a lookup
+ if ( data ) {
+ if ( !queue || jQuery.isArray(data) ) {
+ queue = jQuery._data( elem, type, jQuery.makeArray(data) );
+ } else {
+ queue.push( data );
+ }
+ }
+ return queue || [];
+ }
+ },
+
+ dequeue: function( elem, type ) {
+ type = type || "fx";
+
+ var queue = jQuery.queue( elem, type ),
+ startLength = queue.length,
+ fn = queue.shift(),
+ hooks = jQuery._queueHooks( elem, type ),
+ next = function() {
+ jQuery.dequeue( elem, type );
+ };
+
+ // If the fx queue is dequeued, always remove the progress sentinel
+ if ( fn === "inprogress" ) {
+ fn = queue.shift();
+ startLength--;
+ }
+
+ if ( fn ) {
+
+ // Add a progress sentinel to prevent the fx queue from being
+ // automatically dequeued
+ if ( type === "fx" ) {
+ queue.unshift( "inprogress" );
+ }
+
+ // clear up the last queue stop function
+ delete hooks.stop;
+ fn.call( elem, next, hooks );
+ }
+
+ if ( !startLength && hooks ) {
+ hooks.empty.fire();
+ }
+ },
+
+ // not intended for public consumption - generates a queueHooks object, or returns the current one
+ _queueHooks: function( elem, type ) {
+ var key = type + "queueHooks";
+ return jQuery._data( elem, key ) || jQuery._data( elem, key, {
+ empty: jQuery.Callbacks("once memory").add(function() {
+ jQuery._removeData( elem, type + "queue" );
+ jQuery._removeData( elem, key );
+ })
+ });
+ }
+});
+
+jQuery.fn.extend({
+ queue: function( type, data ) {
+ var setter = 2;
+
+ if ( typeof type !== "string" ) {
+ data = type;
+ type = "fx";
+ setter--;
+ }
+
+ if ( arguments.length < setter ) {
+ return jQuery.queue( this[0], type );
+ }
+
+ return data === undefined ?
+ this :
+ this.each(function() {
+ var queue = jQuery.queue( this, type, data );
+
+ // ensure a hooks for this queue
+ jQuery._queueHooks( this, type );
+
+ if ( type === "fx" && queue[0] !== "inprogress" ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ dequeue: function( type ) {
+ return this.each(function() {
+ jQuery.dequeue( this, type );
+ });
+ },
+ clearQueue: function( type ) {
+ return this.queue( type || "fx", [] );
+ },
+ // Get a promise resolved when queues of a certain type
+ // are emptied (fx is the type by default)
+ promise: function( type, obj ) {
+ var tmp,
+ count = 1,
+ defer = jQuery.Deferred(),
+ elements = this,
+ i = this.length,
+ resolve = function() {
+ if ( !( --count ) ) {
+ defer.resolveWith( elements, [ elements ] );
+ }
+ };
+
+ if ( typeof type !== "string" ) {
+ obj = type;
+ type = undefined;
+ }
+ type = type || "fx";
+
+ while ( i-- ) {
+ tmp = jQuery._data( elements[ i ], type + "queueHooks" );
+ if ( tmp && tmp.empty ) {
+ count++;
+ tmp.empty.add( resolve );
+ }
+ }
+ resolve();
+ return defer.promise( obj );
+ }
+});
+var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
+
+var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
+
+var isHidden = function( elem, el ) {
+ // isHidden might be called from jQuery#filter function;
+ // in that case, element will be second argument
+ elem = el || elem;
+ return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
+ };
+
+
+
+// Multifunctional method to get and set values of a collection
+// The value/s can optionally be executed if it's a function
+var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
+ var i = 0,
+ length = elems.length,
+ bulk = key == null;
+
+ // Sets many values
+ if ( jQuery.type( key ) === "object" ) {
+ chainable = true;
+ for ( i in key ) {
+ jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
+ }
+
+ // Sets one value
+ } else if ( value !== undefined ) {
+ chainable = true;
+
+ if ( !jQuery.isFunction( value ) ) {
+ raw = true;
+ }
+
+ if ( bulk ) {
+ // Bulk operations run against the entire set
+ if ( raw ) {
+ fn.call( elems, value );
+ fn = null;
+
+ // ...except when executing function values
+ } else {
+ bulk = fn;
+ fn = function( elem, key, value ) {
+ return bulk.call( jQuery( elem ), value );
+ };
+ }
+ }
+
+ if ( fn ) {
+ for ( ; i < length; i++ ) {
+ fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
+ }
+ }
+ }
+
+ return chainable ?
+ elems :
+
+ // Gets
+ bulk ?
+ fn.call( elems ) :
+ length ? fn( elems[0], key ) : emptyGet;
+};
+var rcheckableType = (/^(?:checkbox|radio)$/i);
+
+
+
+(function() {
+ // Minified: var a,b,c
+ var input = document.createElement( "input" ),
+ div = document.createElement( "div" ),
+ fragment = document.createDocumentFragment();
+
+ // Setup
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+
+ // IE strips leading whitespace when .innerHTML is used
+ support.leadingWhitespace = div.firstChild.nodeType === 3;
+
+ // Make sure that tbody elements aren't automatically inserted
+ // IE will insert them into empty tables
+ support.tbody = !div.getElementsByTagName( "tbody" ).length;
+
+ // Make sure that link elements get serialized correctly by innerHTML
+ // This requires a wrapper element in IE
+ support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
+
+ // Makes sure cloning an html5 element does not cause problems
+ // Where outerHTML is undefined, this still works
+ support.html5Clone =
+ document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
+
+ // Check if a disconnected checkbox will retain its checked
+ // value of true after appended to the DOM (IE6/7)
+ input.type = "checkbox";
+ input.checked = true;
+ fragment.appendChild( input );
+ support.appendChecked = input.checked;
+
+ // Make sure textarea (and checkbox) defaultValue is properly cloned
+ // Support: IE6-IE11+
+ div.innerHTML = "<textarea>x</textarea>";
+ support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
+
+ // #11217 - WebKit loses check when the name is after the checked attribute
+ fragment.appendChild( div );
+ div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
+
+ // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
+ // old WebKit doesn't clone checked state correctly in fragments
+ support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+ // Support: IE<9
+ // Opera does not clone events (and typeof div.attachEvent === undefined).
+ // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
+ support.noCloneEvent = true;
+ if ( div.attachEvent ) {
+ div.attachEvent( "onclick", function() {
+ support.noCloneEvent = false;
+ });
+
+ div.cloneNode( true ).click();
+ }
+
+ // Execute the test only if not already executed in another module.
+ if (support.deleteExpando == null) {
+ // Support: IE<9
+ support.deleteExpando = true;
+ try {
+ delete div.test;
+ } catch( e ) {
+ support.deleteExpando = false;
+ }
+ }
+})();
+
+
+(function() {
+ var i, eventName,
+ div = document.createElement( "div" );
+
+ // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
+ for ( i in { submit: true, change: true, focusin: true }) {
+ eventName = "on" + i;
+
+ if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
+ // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
+ div.setAttribute( eventName, "t" );
+ support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
+ }
+ }
+
+ // Null elements to avoid leaks in IE.
+ div = null;
+})();
+
+
+var rformElems = /^(?:input|select|textarea)$/i,
+ rkeyEvent = /^key/,
+ rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
+ rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
+ rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
+
+function returnTrue() {
+ return true;
+}
+
+function returnFalse() {
+ return false;
+}
+
+function safeActiveElement() {
+ try {
+ return document.activeElement;
+ } catch ( err ) { }
+}
+
+/*
+ * Helper functions for managing events -- not part of the public interface.
+ * Props to Dean Edwards' addEvent library for many of the ideas.
+ */
+jQuery.event = {
+
+ global: {},
+
+ add: function( elem, types, handler, data, selector ) {
+ var tmp, events, t, handleObjIn,
+ special, eventHandle, handleObj,
+ handlers, type, namespaces, origType,
+ elemData = jQuery._data( elem );
+
+ // Don't attach events to noData or text/comment nodes (but allow plain objects)
+ if ( !elemData ) {
+ return;
+ }
+
+ // Caller can pass in an object of custom data in lieu of the handler
+ if ( handler.handler ) {
+ handleObjIn = handler;
+ handler = handleObjIn.handler;
+ selector = handleObjIn.selector;
+ }
+
+ // Make sure that the handler has a unique ID, used to find/remove it later
+ if ( !handler.guid ) {
+ handler.guid = jQuery.guid++;
+ }
+
+ // Init the element's event structure and main handler, if this is the first
+ if ( !(events = elemData.events) ) {
+ events = elemData.events = {};
+ }
+ if ( !(eventHandle = elemData.handle) ) {
+ eventHandle = elemData.handle = function( e ) {
+ // Discard the second event of a jQuery.event.trigger() and
+ // when an event is called after a page has unloaded
+ return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
+ jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
+ undefined;
+ };
+ // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
+ eventHandle.elem = elem;
+ }
+
+ // Handle multiple events separated by a space
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // There *must* be a type, no attaching namespace-only handlers
+ if ( !type ) {
+ continue;
+ }
+
+ // If event changes its type, use the special event handlers for the changed type
+ special = jQuery.event.special[ type ] || {};
+
+ // If selector defined, determine special event api type, otherwise given type
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+
+ // Update special based on newly reset type
+ special = jQuery.event.special[ type ] || {};
+
+ // handleObj is passed to all event handlers
+ handleObj = jQuery.extend({
+ type: type,
+ origType: origType,
+ data: data,
+ handler: handler,
+ guid: handler.guid,
+ selector: selector,
+ needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
+ namespace: namespaces.join(".")
+ }, handleObjIn );
+
+ // Init the event handler queue if we're the first
+ if ( !(handlers = events[ type ]) ) {
+ handlers = events[ type ] = [];
+ handlers.delegateCount = 0;
+
+ // Only use addEventListener/attachEvent if the special events handler returns false
+ if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
+ // Bind the global event handler to the element
+ if ( elem.addEventListener ) {
+ elem.addEventListener( type, eventHandle, false );
+
+ } else if ( elem.attachEvent ) {
+ elem.attachEvent( "on" + type, eventHandle );
+ }
+ }
+ }
+
+ if ( special.add ) {
+ special.add.call( elem, handleObj );
+
+ if ( !handleObj.handler.guid ) {
+ handleObj.handler.guid = handler.guid;
+ }
+ }
+
+ // Add to the element's handler list, delegates in front
+ if ( selector ) {
+ handlers.splice( handlers.delegateCount++, 0, handleObj );
+ } else {
+ handlers.push( handleObj );
+ }
+
+ // Keep track of which events have ever been used, for event optimization
+ jQuery.event.global[ type ] = true;
+ }
+
+ // Nullify elem to prevent memory leaks in IE
+ elem = null;
+ },
+
+ // Detach an event or set of events from an element
+ remove: function( elem, types, handler, selector, mappedTypes ) {
+ var j, handleObj, tmp,
+ origCount, t, events,
+ special, handlers, type,
+ namespaces, origType,
+ elemData = jQuery.hasData( elem ) && jQuery._data( elem );
+
+ if ( !elemData || !(events = elemData.events) ) {
+ return;
+ }
+
+ // Once for each type.namespace in types; type may be omitted
+ types = ( types || "" ).match( rnotwhite ) || [ "" ];
+ t = types.length;
+ while ( t-- ) {
+ tmp = rtypenamespace.exec( types[t] ) || [];
+ type = origType = tmp[1];
+ namespaces = ( tmp[2] || "" ).split( "." ).sort();
+
+ // Unbind all events (on this namespace, if provided) for the element
+ if ( !type ) {
+ for ( type in events ) {
+ jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
+ }
+ continue;
+ }
+
+ special = jQuery.event.special[ type ] || {};
+ type = ( selector ? special.delegateType : special.bindType ) || type;
+ handlers = events[ type ] || [];
+ tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
+
+ // Remove matching events
+ origCount = j = handlers.length;
+ while ( j-- ) {
+ handleObj = handlers[ j ];
+
+ if ( ( mappedTypes || origType === handleObj.origType ) &&
+ ( !handler || handler.guid === handleObj.guid ) &&
+ ( !tmp || tmp.test( handleObj.namespace ) ) &&
+ ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
+ handlers.splice( j, 1 );
+
+ if ( handleObj.selector ) {
+ handlers.delegateCount--;
+ }
+ if ( special.remove ) {
+ special.remove.call( elem, handleObj );
+ }
+ }
+ }
+
+ // Remove generic event handler if we removed something and no more handlers exist
+ // (avoids potential for endless recursion during removal of special event handlers)
+ if ( origCount && !handlers.length ) {
+ if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
+ jQuery.removeEvent( elem, type, elemData.handle );
+ }
+
+ delete events[ type ];
+ }
+ }
+
+ // Remove the expando if it's no longer used
+ if ( jQuery.isEmptyObject( events ) ) {
+ delete elemData.handle;
+
+ // removeData also checks for emptiness and clears the expando if empty
+ // so use it instead of delete
+ jQuery._removeData( elem, "events" );
+ }
+ },
+
+ trigger: function( event, data, elem, onlyHandlers ) {
+ var handle, ontype, cur,
+ bubbleType, special, tmp, i,
+ eventPath = [ elem || document ],
+ type = hasOwn.call( event, "type" ) ? event.type : event,
+ namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
+
+ cur = tmp = elem = elem || document;
+
+ // Don't do events on text and comment nodes
+ if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+ return;
+ }
+
+ // focus/blur morphs to focusin/out; ensure we're not firing them right now
+ if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
+ return;
+ }
+
+ if ( type.indexOf(".") >= 0 ) {
+ // Namespaced trigger; create a regexp to match event type in handle()
+ namespaces = type.split(".");
+ type = namespaces.shift();
+ namespaces.sort();
+ }
+ ontype = type.indexOf(":") < 0 && "on" + type;
+
+ // Caller can pass in a jQuery.Event object, Object, or just an event type string
+ event = event[ jQuery.expando ] ?
+ event :
+ new jQuery.Event( type, typeof event === "object" && event );
+
+ // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
+ event.isTrigger = onlyHandlers ? 2 : 3;
+ event.namespace = namespaces.join(".");
+ event.namespace_re = event.namespace ?
+ new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
+ null;
+
+ // Clean up the event in case it is being reused
+ event.result = undefined;
+ if ( !event.target ) {
+ event.target = elem;
+ }
+
+ // Clone any incoming data and prepend the event, creating the handler arg list
+ data = data == null ?
+ [ event ] :
+ jQuery.makeArray( data, [ event ] );
+
+ // Allow special events to draw outside the lines
+ special = jQuery.event.special[ type ] || {};
+ if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
+ return;
+ }
+
+ // Determine event propagation path in advance, per W3C events spec (#9951)
+ // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
+ if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
+
+ bubbleType = special.delegateType || type;
+ if ( !rfocusMorph.test( bubbleType + type ) ) {
+ cur = cur.parentNode;
+ }
+ for ( ; cur; cur = cur.parentNode ) {
+ eventPath.push( cur );
+ tmp = cur;
+ }
+
+ // Only add window if we got to document (e.g., not plain obj or detached DOM)
+ if ( tmp === (elem.ownerDocument || document) ) {
+ eventPath.push( tmp.defaultView || tmp.parentWindow || window );
+ }
+ }
+
+ // Fire handlers on the event path
+ i = 0;
+ while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
+
+ event.type = i > 1 ?
+ bubbleType :
+ special.bindType || type;
+
+ // jQuery handler
+ handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
+ if ( handle ) {
+ handle.apply( cur, data );
+ }
+
+ // Native handler
+ handle = ontype && cur[ ontype ];
+ if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
+ event.result = handle.apply( cur, data );
+ if ( event.result === false ) {
+ event.preventDefault();
+ }
+ }
+ }
+ event.type = type;
+
+ // If nobody prevented the default action, do it now
+ if ( !onlyHandlers && !event.isDefaultPrevented() ) {
+
+ if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
+ jQuery.acceptData( elem ) ) {
+
+ // Call a native DOM method on the target with the same name name as the event.
+ // Can't use an .isFunction() check here because IE6/7 fails that test.
+ // Don't do default actions on window, that's where global variables be (#6170)
+ if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
+
+ // Don't re-trigger an onFOO event when we call its FOO() method
+ tmp = elem[ ontype ];
+
+ if ( tmp ) {
+ elem[ ontype ] = null;
+ }
+
+ // Prevent re-triggering of the same event, since we already bubbled it above
+ jQuery.event.triggered = type;
+ try {
+ elem[ type ]();
+ } catch ( e ) {
+ // IE<9 dies on focus/blur to hidden element (#1486,#12518)
+ // only reproducible on winXP IE8 native, not IE9 in IE8 mode
+ }
+ jQuery.event.triggered = undefined;
+
+ if ( tmp ) {
+ elem[ ontype ] = tmp;
+ }
+ }
+ }
+ }
+
+ return event.result;
+ },
+
+ dispatch: function( event ) {
+
+ // Make a writable jQuery.Event from the native event object
+ event = jQuery.event.fix( event );
+
+ var i, ret, handleObj, matched, j,
+ handlerQueue = [],
+ args = slice.call( arguments ),
+ handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
+ special = jQuery.event.special[ event.type ] || {};
+
+ // Use the fix-ed jQuery.Event rather than the (read-only) native event
+ args[0] = event;
+ event.delegateTarget = this;
+
+ // Call the preDispatch hook for the mapped type, and let it bail if desired
+ if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
+ return;
+ }
+
+ // Determine handlers
+ handlerQueue = jQuery.event.handlers.call( this, event, handlers );
+
+ // Run delegates first; they may want to stop propagation beneath us
+ i = 0;
+ while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
+ event.currentTarget = matched.elem;
+
+ j = 0;
+ while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
+
+ // Triggered event must either 1) have no namespace, or
+ // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
+ if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
+
+ event.handleObj = handleObj;
+ event.data = handleObj.data;
+
+ ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
+ .apply( matched.elem, args );
+
+ if ( ret !== undefined ) {
+ if ( (event.result = ret) === false ) {
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+ }
+ }
+ }
+
+ // Call the postDispatch hook for the mapped type
+ if ( special.postDispatch ) {
+ special.postDispatch.call( this, event );
+ }
+
+ return event.result;
+ },
+
+ handlers: function( event, handlers ) {
+ var sel, handleObj, matches, i,
+ handlerQueue = [],
+ delegateCount = handlers.delegateCount,
+ cur = event.target;
+
+ // Find delegate handlers
+ // Black-hole SVG <use> instance trees (#13180)
+ // Avoid non-left-click bubbling in Firefox (#3861)
+ if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
+
+ /* jshint eqeqeq: false */
+ for ( ; cur != this; cur = cur.parentNode || this ) {
+ /* jshint eqeqeq: true */
+
+ // Don't check non-elements (#13208)
+ // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
+ if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
+ matches = [];
+ for ( i = 0; i < delegateCount; i++ ) {
+ handleObj = handlers[ i ];
+
+ // Don't conflict with Object.prototype properties (#13203)
+ sel = handleObj.selector + " ";
+
+ if ( matches[ sel ] === undefined ) {
+ matches[ sel ] = handleObj.needsContext ?
+ jQuery( sel, this ).index( cur ) >= 0 :
+ jQuery.find( sel, this, null, [ cur ] ).length;
+ }
+ if ( matches[ sel ] ) {
+ matches.push( handleObj );
+ }
+ }
+ if ( matches.length ) {
+ handlerQueue.push({ elem: cur, handlers: matches });
+ }
+ }
+ }
+ }
+
+ // Add the remaining (directly-bound) handlers
+ if ( delegateCount < handlers.length ) {
+ handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
+ }
+
+ return handlerQueue;
+ },
+
+ fix: function( event ) {
+ if ( event[ jQuery.expando ] ) {
+ return event;
+ }
+
+ // Create a writable copy of the event object and normalize some properties
+ var i, prop, copy,
+ type = event.type,
+ originalEvent = event,
+ fixHook = this.fixHooks[ type ];
+
+ if ( !fixHook ) {
+ this.fixHooks[ type ] = fixHook =
+ rmouseEvent.test( type ) ? this.mouseHooks :
+ rkeyEvent.test( type ) ? this.keyHooks :
+ {};
+ }
+ copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
+
+ event = new jQuery.Event( originalEvent );
+
+ i = copy.length;
+ while ( i-- ) {
+ prop = copy[ i ];
+ event[ prop ] = originalEvent[ prop ];
+ }
+
+ // Support: IE<9
+ // Fix target property (#1925)
+ if ( !event.target ) {
+ event.target = originalEvent.srcElement || document;
+ }
+
+ // Support: Chrome 23+, Safari?
+ // Target should not be a text node (#504, #13143)
+ if ( event.target.nodeType === 3 ) {
+ event.target = event.target.parentNode;
+ }
+
+ // Support: IE<9
+ // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
+ event.metaKey = !!event.metaKey;
+
+ return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
+ },
+
+ // Includes some event props shared by KeyEvent and MouseEvent
+ props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
+
+ fixHooks: {},
+
+ keyHooks: {
+ props: "char charCode key keyCode".split(" "),
+ filter: function( event, original ) {
+
+ // Add which for key events
+ if ( event.which == null ) {
+ event.which = original.charCode != null ? original.charCode : original.keyCode;
+ }
+
+ return event;
+ }
+ },
+
+ mouseHooks: {
+ props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
+ filter: function( event, original ) {
+ var body, eventDoc, doc,
+ button = original.button,
+ fromElement = original.fromElement;
+
+ // Calculate pageX/Y if missing and clientX/Y available
+ if ( event.pageX == null && original.clientX != null ) {
+ eventDoc = event.target.ownerDocument || document;
+ doc = eventDoc.documentElement;
+ body = eventDoc.body;
+
+ event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
+ event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
+ }
+
+ // Add relatedTarget, if necessary
+ if ( !event.relatedTarget && fromElement ) {
+ event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
+ }
+
+ // Add which for click: 1 === left; 2 === middle; 3 === right
+ // Note: button is not normalized, so don't use it
+ if ( !event.which && button !== undefined ) {
+ event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
+ }
+
+ return event;
+ }
+ },
+
+ special: {
+ load: {
+ // Prevent triggered image.load events from bubbling to window.load
+ noBubble: true
+ },
+ focus: {
+ // Fire native event if possible so blur/focus sequence is correct
+ trigger: function() {
+ if ( this !== safeActiveElement() && this.focus ) {
+ try {
+ this.focus();
+ return false;
+ } catch ( e ) {
+ // Support: IE<9
+ // If we error on focus to hidden element (#1486, #12518),
+ // let .trigger() run the handlers
+ }
+ }
+ },
+ delegateType: "focusin"
+ },
+ blur: {
+ trigger: function() {
+ if ( this === safeActiveElement() && this.blur ) {
+ this.blur();
+ return false;
+ }
+ },
+ delegateType: "focusout"
+ },
+ click: {
+ // For checkbox, fire native event so checked state will be right
+ trigger: function() {
+ if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
+ this.click();
+ return false;
+ }
+ },
+
+ // For cross-browser consistency, don't fire native .click() on links
+ _default: function( event ) {
+ return jQuery.nodeName( event.target, "a" );
+ }
+ },
+
+ beforeunload: {
+ postDispatch: function( event ) {
+
+ // Support: Firefox 20+
+ // Firefox doesn't alert if the returnValue field is not set.
+ if ( event.result !== undefined && event.originalEvent ) {
+ event.originalEvent.returnValue = event.result;
+ }
+ }
+ }
+ },
+
+ simulate: function( type, elem, event, bubble ) {
+ // Piggyback on a donor event to simulate a different one.
+ // Fake originalEvent to avoid donor's stopPropagation, but if the
+ // simulated event prevents default then we do the same on the donor.
+ var e = jQuery.extend(
+ new jQuery.Event(),
+ event,
+ {
+ type: type,
+ isSimulated: true,
+ originalEvent: {}
+ }
+ );
+ if ( bubble ) {
+ jQuery.event.trigger( e, null, elem );
+ } else {
+ jQuery.event.dispatch.call( elem, e );
+ }
+ if ( e.isDefaultPrevented() ) {
+ event.preventDefault();
+ }
+ }
+};
+
+jQuery.removeEvent = document.removeEventListener ?
+ function( elem, type, handle ) {
+ if ( elem.removeEventListener ) {
+ elem.removeEventListener( type, handle, false );
+ }
+ } :
+ function( elem, type, handle ) {
+ var name = "on" + type;
+
+ if ( elem.detachEvent ) {
+
+ // #8545, #7054, preventing memory leaks for custom events in IE6-8
+ // detachEvent needed property on element, by name of that event, to properly expose it to GC
+ if ( typeof elem[ name ] === strundefined ) {
+ elem[ name ] = null;
+ }
+
+ elem.detachEvent( name, handle );
+ }
+ };
+
+jQuery.Event = function( src, props ) {
+ // Allow instantiation without the 'new' keyword
+ if ( !(this instanceof jQuery.Event) ) {
+ return new jQuery.Event( src, props );
+ }
+
+ // Event object
+ if ( src && src.type ) {
+ this.originalEvent = src;
+ this.type = src.type;
+
+ // Events bubbling up the document may have been marked as prevented
+ // by a handler lower down the tree; reflect the correct value.
+ this.isDefaultPrevented = src.defaultPrevented ||
+ src.defaultPrevented === undefined &&
+ // Support: IE < 9, Android < 4.0
+ src.returnValue === false ?
+ returnTrue :
+ returnFalse;
+
+ // Event type
+ } else {
+ this.type = src;
+ }
+
+ // Put explicitly provided properties onto the event object
+ if ( props ) {
+ jQuery.extend( this, props );
+ }
+
+ // Create a timestamp if incoming event doesn't have one
+ this.timeStamp = src && src.timeStamp || jQuery.now();
+
+ // Mark it as fixed
+ this[ jQuery.expando ] = true;
+};
+
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+ isDefaultPrevented: returnFalse,
+ isPropagationStopped: returnFalse,
+ isImmediatePropagationStopped: returnFalse,
+
+ preventDefault: function() {
+ var e = this.originalEvent;
+
+ this.isDefaultPrevented = returnTrue;
+ if ( !e ) {
+ return;
+ }
+
+ // If preventDefault exists, run it on the original event
+ if ( e.preventDefault ) {
+ e.preventDefault();
+
+ // Support: IE
+ // Otherwise set the returnValue property of the original event to false
+ } else {
+ e.returnValue = false;
+ }
+ },
+ stopPropagation: function() {
+ var e = this.originalEvent;
+
+ this.isPropagationStopped = returnTrue;
+ if ( !e ) {
+ return;
+ }
+ // If stopPropagation exists, run it on the original event
+ if ( e.stopPropagation ) {
+ e.stopPropagation();
+ }
+
+ // Support: IE
+ // Set the cancelBubble property of the original event to true
+ e.cancelBubble = true;
+ },
+ stopImmediatePropagation: function() {
+ var e = this.originalEvent;
+
+ this.isImmediatePropagationStopped = returnTrue;
+
+ if ( e && e.stopImmediatePropagation ) {
+ e.stopImmediatePropagation();
+ }
+
+ this.stopPropagation();
+ }
+};
+
+// Create mouseenter/leave events using mouseover/out and event-time checks
+jQuery.each({
+ mouseenter: "mouseover",
+ mouseleave: "mouseout",
+ pointerenter: "pointerover",
+ pointerleave: "pointerout"
+}, function( orig, fix ) {
+ jQuery.event.special[ orig ] = {
+ delegateType: fix,
+ bindType: fix,
+
+ handle: function( event ) {
+ var ret,
+ target = this,
+ related = event.relatedTarget,
+ handleObj = event.handleObj;
+
+ // For mousenter/leave call the handler if related is outside the target.
+ // NB: No relatedTarget if the mouse left/entered the browser window
+ if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
+ event.type = handleObj.origType;
+ ret = handleObj.handler.apply( this, arguments );
+ event.type = fix;
+ }
+ return ret;
+ }
+ };
+});
+
+// IE submit delegation
+if ( !support.submitBubbles ) {
+
+ jQuery.event.special.submit = {
+ setup: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Lazy-add a submit handler when a descendant form may potentially be submitted
+ jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
+ // Node name check avoids a VML-related crash in IE (#9807)
+ var elem = e.target,
+ form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
+ if ( form && !jQuery._data( form, "submitBubbles" ) ) {
+ jQuery.event.add( form, "submit._submit", function( event ) {
+ event._submit_bubble = true;
+ });
+ jQuery._data( form, "submitBubbles", true );
+ }
+ });
+ // return undefined since we don't need an event listener
+ },
+
+ postDispatch: function( event ) {
+ // If form was submitted by the user, bubble the event up the tree
+ if ( event._submit_bubble ) {
+ delete event._submit_bubble;
+ if ( this.parentNode && !event.isTrigger ) {
+ jQuery.event.simulate( "submit", this.parentNode, event, true );
+ }
+ }
+ },
+
+ teardown: function() {
+ // Only need this for delegated form submit events
+ if ( jQuery.nodeName( this, "form" ) ) {
+ return false;
+ }
+
+ // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
+ jQuery.event.remove( this, "._submit" );
+ }
+ };
+}
+
+// IE change delegation and checkbox/radio fix
+if ( !support.changeBubbles ) {
+
+ jQuery.event.special.change = {
+
+ setup: function() {
+
+ if ( rformElems.test( this.nodeName ) ) {
+ // IE doesn't fire change on a check/radio until blur; trigger it on click
+ // after a propertychange. Eat the blur-change in special.change.handle.
+ // This still fires onchange a second time for check/radio after blur.
+ if ( this.type === "checkbox" || this.type === "radio" ) {
+ jQuery.event.add( this, "propertychange._change", function( event ) {
+ if ( event.originalEvent.propertyName === "checked" ) {
+ this._just_changed = true;
+ }
+ });
+ jQuery.event.add( this, "click._change", function( event ) {
+ if ( this._just_changed && !event.isTrigger ) {
+ this._just_changed = false;
+ }
+ // Allow triggered, simulated change events (#11500)
+ jQuery.event.simulate( "change", this, event, true );
+ });
+ }
+ return false;
+ }
+ // Delegated event; lazy-add a change handler on descendant inputs
+ jQuery.event.add( this, "beforeactivate._change", function( e ) {
+ var elem = e.target;
+
+ if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
+ jQuery.event.add( elem, "change._change", function( event ) {
+ if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
+ jQuery.event.simulate( "change", this.parentNode, event, true );
+ }
+ });
+ jQuery._data( elem, "changeBubbles", true );
+ }
+ });
+ },
+
+ handle: function( event ) {
+ var elem = event.target;
+
+ // Swallow native change events from checkbox/radio, we already triggered them above
+ if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
+ return event.handleObj.handler.apply( this, arguments );
+ }
+ },
+
+ teardown: function() {
+ jQuery.event.remove( this, "._change" );
+
+ return !rformElems.test( this.nodeName );
+ }
+ };
+}
+
+// Create "bubbling" focus and blur events
+if ( !support.focusinBubbles ) {
+ jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
+
+ // Attach a single capturing handler on the document while someone wants focusin/focusout
+ var handler = function( event ) {
+ jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
+ };
+
+ jQuery.event.special[ fix ] = {
+ setup: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix );
+
+ if ( !attaches ) {
+ doc.addEventListener( orig, handler, true );
+ }
+ jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
+ },
+ teardown: function() {
+ var doc = this.ownerDocument || this,
+ attaches = jQuery._data( doc, fix ) - 1;
+
+ if ( !attaches ) {
+ doc.removeEventListener( orig, handler, true );
+ jQuery._removeData( doc, fix );
+ } else {
+ jQuery._data( doc, fix, attaches );
+ }
+ }
+ };
+ });
+}
+
+jQuery.fn.extend({
+
+ on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
+ var type, origFn;
+
+ // Types can be a map of types/handlers
+ if ( typeof types === "object" ) {
+ // ( types-Object, selector, data )
+ if ( typeof selector !== "string" ) {
+ // ( types-Object, data )
+ data = data || selector;
+ selector = undefined;
+ }
+ for ( type in types ) {
+ this.on( type, selector, data, types[ type ], one );
+ }
+ return this;
+ }
+
+ if ( data == null && fn == null ) {
+ // ( types, fn )
+ fn = selector;
+ data = selector = undefined;
+ } else if ( fn == null ) {
+ if ( typeof selector === "string" ) {
+ // ( types, selector, fn )
+ fn = data;
+ data = undefined;
+ } else {
+ // ( types, data, fn )
+ fn = data;
+ data = selector;
+ selector = undefined;
+ }
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ } else if ( !fn ) {
+ return this;
+ }
+
+ if ( one === 1 ) {
+ origFn = fn;
+ fn = function( event ) {
+ // Can use an empty set, since event contains the info
+ jQuery().off( event );
+ return origFn.apply( this, arguments );
+ };
+ // Use same guid so caller can remove using origFn
+ fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
+ }
+ return this.each( function() {
+ jQuery.event.add( this, types, fn, data, selector );
+ });
+ },
+ one: function( types, selector, data, fn ) {
+ return this.on( types, selector, data, fn, 1 );
+ },
+ off: function( types, selector, fn ) {
+ var handleObj, type;
+ if ( types && types.preventDefault && types.handleObj ) {
+ // ( event ) dispatched jQuery.Event
+ handleObj = types.handleObj;
+ jQuery( types.delegateTarget ).off(
+ handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
+ handleObj.selector,
+ handleObj.handler
+ );
+ return this;
+ }
+ if ( typeof types === "object" ) {
+ // ( types-object [, selector] )
+ for ( type in types ) {
+ this.off( type, selector, types[ type ] );
+ }
+ return this;
+ }
+ if ( selector === false || typeof selector === "function" ) {
+ // ( types [, fn] )
+ fn = selector;
+ selector = undefined;
+ }
+ if ( fn === false ) {
+ fn = returnFalse;
+ }
+ return this.each(function() {
+ jQuery.event.remove( this, types, fn, selector );
+ });
+ },
+
+ trigger: function( type, data ) {
+ return this.each(function() {
+ jQuery.event.trigger( type, data, this );
+ });
+ },
+ triggerHandler: function( type, data ) {
+ var elem = this[0];
+ if ( elem ) {
+ return jQuery.event.trigger( type, data, elem, true );
+ }
+ }
+});
+
+
+function createSafeFragment( document ) {
+ var list = nodeNames.split( "|" ),
+ safeFrag = document.createDocumentFragment();
+
+ if ( safeFrag.createElement ) {
+ while ( list.length ) {
+ safeFrag.createElement(
+ list.pop()
+ );
+ }
+ }
+ return safeFrag;
+}
+
+var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
+ "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
+ rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
+ rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
+ rleadingWhitespace = /^\s+/,
+ rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
+ rtagName = /<([\w:]+)/,
+ rtbody = /<tbody/i,
+ rhtml = /<|&#?\w+;/,
+ rnoInnerhtml = /<(?:script|style|link)/i,
+ // checked="checked" or checked
+ rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+ rscriptType = /^$|\/(?:java|ecma)script/i,
+ rscriptTypeMasked = /^true\/(.*)/,
+ rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
+
+ // We have to close these tags to support XHTML (#13200)
+ wrapMap = {
+ option: [ 1, "<select multiple='multiple'>", "</select>" ],
+ legend: [ 1, "<fieldset>", "</fieldset>" ],
+ area: [ 1, "<map>", "</map>" ],
+ param: [ 1, "<object>", "</object>" ],
+ thead: [ 1, "<table>", "</table>" ],
+ tr: [ 2, "<table><tbody>", "</tbody></table>" ],
+ col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
+ td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
+
+ // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
+ // unless wrapped in a div with non-breaking characters in front of it.
+ _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
+ },
+ safeFragment = createSafeFragment( document ),
+ fragmentDiv = safeFragment.appendChild( document.createElement("div") );
+
+wrapMap.optgroup = wrapMap.option;
+wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
+wrapMap.th = wrapMap.td;
+
+function getAll( context, tag ) {
+ var elems, elem,
+ i = 0,
+ found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
+ typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
+ undefined;
+
+ if ( !found ) {
+ for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
+ if ( !tag || jQuery.nodeName( elem, tag ) ) {
+ found.push( elem );
+ } else {
+ jQuery.merge( found, getAll( elem, tag ) );
+ }
+ }
+ }
+
+ return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
+ jQuery.merge( [ context ], found ) :
+ found;
+}
+
+// Used in buildFragment, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+ if ( rcheckableType.test( elem.type ) ) {
+ elem.defaultChecked = elem.checked;
+ }
+}
+
+// Support: IE<8
+// Manipulating tables requires a tbody
+function manipulationTarget( elem, content ) {
+ return jQuery.nodeName( elem, "table" ) &&
+ jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
+
+ elem.getElementsByTagName("tbody")[0] ||
+ elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
+ elem;
+}
+
+// Replace/restore the type attribute of script elements for safe DOM manipulation
+function disableScript( elem ) {
+ elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
+ return elem;
+}
+function restoreScript( elem ) {
+ var match = rscriptTypeMasked.exec( elem.type );
+ if ( match ) {
+ elem.type = match[1];
+ } else {
+ elem.removeAttribute("type");
+ }
+ return elem;
+}
+
+// Mark scripts as having already been evaluated
+function setGlobalEval( elems, refElements ) {
+ var elem,
+ i = 0;
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
+ }
+}
+
+function cloneCopyEvent( src, dest ) {
+
+ if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+ return;
+ }
+
+ var type, i, l,
+ oldData = jQuery._data( src ),
+ curData = jQuery._data( dest, oldData ),
+ events = oldData.events;
+
+ if ( events ) {
+ delete curData.handle;
+ curData.events = {};
+
+ for ( type in events ) {
+ for ( i = 0, l = events[ type ].length; i < l; i++ ) {
+ jQuery.event.add( dest, type, events[ type ][ i ] );
+ }
+ }
+ }
+
+ // make the cloned public data object a copy from the original
+ if ( curData.data ) {
+ curData.data = jQuery.extend( {}, curData.data );
+ }
+}
+
+function fixCloneNodeIssues( src, dest ) {
+ var nodeName, e, data;
+
+ // We do not need to do anything for non-Elements
+ if ( dest.nodeType !== 1 ) {
+ return;
+ }
+
+ nodeName = dest.nodeName.toLowerCase();
+
+ // IE6-8 copies events bound via attachEvent when using cloneNode.
+ if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
+ data = jQuery._data( dest );
+
+ for ( e in data.events ) {
+ jQuery.removeEvent( dest, e, data.handle );
+ }
+
+ // Event data gets referenced instead of copied if the expando gets copied too
+ dest.removeAttribute( jQuery.expando );
+ }
+
+ // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
+ if ( nodeName === "script" && dest.text !== src.text ) {
+ disableScript( dest ).text = src.text;
+ restoreScript( dest );
+
+ // IE6-10 improperly clones children of object elements using classid.
+ // IE10 throws NoModificationAllowedError if parent is null, #12132.
+ } else if ( nodeName === "object" ) {
+ if ( dest.parentNode ) {
+ dest.outerHTML = src.outerHTML;
+ }
+
+ // This path appears unavoidable for IE9. When cloning an object
+ // element in IE9, the outerHTML strategy above is not sufficient.
+ // If the src has innerHTML and the destination does not,
+ // copy the src.innerHTML into the dest.innerHTML. #10324
+ if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
+ dest.innerHTML = src.innerHTML;
+ }
+
+ } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
+ // IE6-8 fails to persist the checked state of a cloned checkbox
+ // or radio button. Worse, IE6-7 fail to give the cloned element
+ // a checked appearance if the defaultChecked value isn't also set
+
+ dest.defaultChecked = dest.checked = src.checked;
+
+ // IE6-7 get confused and end up setting the value of a cloned
+ // checkbox/radio button to an empty string instead of "on"
+ if ( dest.value !== src.value ) {
+ dest.value = src.value;
+ }
+
+ // IE6-8 fails to return the selected option to the default selected
+ // state when cloning options
+ } else if ( nodeName === "option" ) {
+ dest.defaultSelected = dest.selected = src.defaultSelected;
+
+ // IE6-8 fails to set the defaultValue to the correct value when
+ // cloning other types of input fields
+ } else if ( nodeName === "input" || nodeName === "textarea" ) {
+ dest.defaultValue = src.defaultValue;
+ }
+}
+
+jQuery.extend({
+ clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+ var destElements, node, clone, i, srcElements,
+ inPage = jQuery.contains( elem.ownerDocument, elem );
+
+ if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
+ clone = elem.cloneNode( true );
+
+ // IE<=8 does not properly clone detached, unknown element nodes
+ } else {
+ fragmentDiv.innerHTML = elem.outerHTML;
+ fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
+ }
+
+ if ( (!support.noCloneEvent || !support.noCloneChecked) &&
+ (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
+
+ // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
+ destElements = getAll( clone );
+ srcElements = getAll( elem );
+
+ // Fix all IE cloning issues
+ for ( i = 0; (node = srcElements[i]) != null; ++i ) {
+ // Ensure that the destination node is not null; Fixes #9587
+ if ( destElements[i] ) {
+ fixCloneNodeIssues( node, destElements[i] );
+ }
+ }
+ }
+
+ // Copy the events from the original to the clone
+ if ( dataAndEvents ) {
+ if ( deepDataAndEvents ) {
+ srcElements = srcElements || getAll( elem );
+ destElements = destElements || getAll( clone );
+
+ for ( i = 0; (node = srcElements[i]) != null; i++ ) {
+ cloneCopyEvent( node, destElements[i] );
+ }
+ } else {
+ cloneCopyEvent( elem, clone );
+ }
+ }
+
+ // Preserve script evaluation history
+ destElements = getAll( clone, "script" );
+ if ( destElements.length > 0 ) {
+ setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
+ }
+
+ destElements = srcElements = node = null;
+
+ // Return the cloned set
+ return clone;
+ },
+
+ buildFragment: function( elems, context, scripts, selection ) {
+ var j, elem, contains,
+ tmp, tag, tbody, wrap,
+ l = elems.length,
+
+ // Ensure a safe fragment
+ safe = createSafeFragment( context ),
+
+ nodes = [],
+ i = 0;
+
+ for ( ; i < l; i++ ) {
+ elem = elems[ i ];
+
+ if ( elem || elem === 0 ) {
+
+ // Add nodes directly
+ if ( jQuery.type( elem ) === "object" ) {
+ jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
+
+ // Convert non-html into a text node
+ } else if ( !rhtml.test( elem ) ) {
+ nodes.push( context.createTextNode( elem ) );
+
+ // Convert html into DOM nodes
+ } else {
+ tmp = tmp || safe.appendChild( context.createElement("div") );
+
+ // Deserialize a standard representation
+ tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
+ wrap = wrapMap[ tag ] || wrapMap._default;
+
+ tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
+
+ // Descend through wrappers to the right content
+ j = wrap[0];
+ while ( j-- ) {
+ tmp = tmp.lastChild;
+ }
+
+ // Manually add leading whitespace removed by IE
+ if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
+ nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
+ }
+
+ // Remove IE's autoinserted <tbody> from table fragments
+ if ( !support.tbody ) {
+
+ // String was a <table>, *may* have spurious <tbody>
+ elem = tag === "table" && !rtbody.test( elem ) ?
+ tmp.firstChild :
+
+ // String was a bare <thead> or <tfoot>
+ wrap[1] === "<table>" && !rtbody.test( elem ) ?
+ tmp :
+ 0;
+
+ j = elem && elem.childNodes.length;
+ while ( j-- ) {
+ if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
+ elem.removeChild( tbody );
+ }
+ }
+ }
+
+ jQuery.merge( nodes, tmp.childNodes );
+
+ // Fix #12392 for WebKit and IE > 9
+ tmp.textContent = "";
+
+ // Fix #12392 for oldIE
+ while ( tmp.firstChild ) {
+ tmp.removeChild( tmp.firstChild );
+ }
+
+ // Remember the top-level container for proper cleanup
+ tmp = safe.lastChild;
+ }
+ }
+ }
+
+ // Fix #11356: Clear elements from fragment
+ if ( tmp ) {
+ safe.removeChild( tmp );
+ }
+
+ // Reset defaultChecked for any radios and checkboxes
+ // about to be appended to the DOM in IE 6/7 (#8060)
+ if ( !support.appendChecked ) {
+ jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
+ }
+
+ i = 0;
+ while ( (elem = nodes[ i++ ]) ) {
+
+ // #4087 - If origin and destination elements are the same, and this is
+ // that element, do not do anything
+ if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
+ continue;
+ }
+
+ contains = jQuery.contains( elem.ownerDocument, elem );
+
+ // Append to fragment
+ tmp = getAll( safe.appendChild( elem ), "script" );
+
+ // Preserve script evaluation history
+ if ( contains ) {
+ setGlobalEval( tmp );
+ }
+
+ // Capture executables
+ if ( scripts ) {
+ j = 0;
+ while ( (elem = tmp[ j++ ]) ) {
+ if ( rscriptType.test( elem.type || "" ) ) {
+ scripts.push( elem );
+ }
+ }
+ }
+ }
+
+ tmp = null;
+
+ return safe;
+ },
+
+ cleanData: function( elems, /* internal */ acceptData ) {
+ var elem, type, id, data,
+ i = 0,
+ internalKey = jQuery.expando,
+ cache = jQuery.cache,
+ deleteExpando = support.deleteExpando,
+ special = jQuery.event.special;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+ if ( acceptData || jQuery.acceptData( elem ) ) {
+
+ id = elem[ internalKey ];
+ data = id && cache[ id ];
+
+ if ( data ) {
+ if ( data.events ) {
+ for ( type in data.events ) {
+ if ( special[ type ] ) {
+ jQuery.event.remove( elem, type );
+
+ // This is a shortcut to avoid jQuery.event.remove's overhead
+ } else {
+ jQuery.removeEvent( elem, type, data.handle );
+ }
+ }
+ }
+
+ // Remove cache only if it was not already removed by jQuery.event.remove
+ if ( cache[ id ] ) {
+
+ delete cache[ id ];
+
+ // IE does not allow us to delete expando properties from nodes,
+ // nor does it have a removeAttribute function on Document nodes;
+ // we must handle all of these cases
+ if ( deleteExpando ) {
+ delete elem[ internalKey ];
+
+ } else if ( typeof elem.removeAttribute !== strundefined ) {
+ elem.removeAttribute( internalKey );
+
+ } else {
+ elem[ internalKey ] = null;
+ }
+
+ deletedIds.push( id );
+ }
+ }
+ }
+ }
+ }
+});
+
+jQuery.fn.extend({
+ text: function( value ) {
+ return access( this, function( value ) {
+ return value === undefined ?
+ jQuery.text( this ) :
+ this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
+ }, null, value, arguments.length );
+ },
+
+ append: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.appendChild( elem );
+ }
+ });
+ },
+
+ prepend: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
+ var target = manipulationTarget( this, elem );
+ target.insertBefore( elem, target.firstChild );
+ }
+ });
+ },
+
+ before: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this );
+ }
+ });
+ },
+
+ after: function() {
+ return this.domManip( arguments, function( elem ) {
+ if ( this.parentNode ) {
+ this.parentNode.insertBefore( elem, this.nextSibling );
+ }
+ });
+ },
+
+ remove: function( selector, keepData /* Internal Use Only */ ) {
+ var elem,
+ elems = selector ? jQuery.filter( selector, this ) : this,
+ i = 0;
+
+ for ( ; (elem = elems[i]) != null; i++ ) {
+
+ if ( !keepData && elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem ) );
+ }
+
+ if ( elem.parentNode ) {
+ if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
+ setGlobalEval( getAll( elem, "script" ) );
+ }
+ elem.parentNode.removeChild( elem );
+ }
+ }
+
+ return this;
+ },
+
+ empty: function() {
+ var elem,
+ i = 0;
+
+ for ( ; (elem = this[i]) != null; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ }
+
+ // Remove any remaining nodes
+ while ( elem.firstChild ) {
+ elem.removeChild( elem.firstChild );
+ }
+
+ // If this is a select, ensure that it displays empty (#12336)
+ // Support: IE<9
+ if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
+ elem.options.length = 0;
+ }
+ }
+
+ return this;
+ },
+
+ clone: function( dataAndEvents, deepDataAndEvents ) {
+ dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+ deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+ return this.map(function() {
+ return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
+ });
+ },
+
+ html: function( value ) {
+ return access( this, function( value ) {
+ var elem = this[ 0 ] || {},
+ i = 0,
+ l = this.length;
+
+ if ( value === undefined ) {
+ return elem.nodeType === 1 ?
+ elem.innerHTML.replace( rinlinejQuery, "" ) :
+ undefined;
+ }
+
+ // See if we can take a shortcut and just use innerHTML
+ if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
+ ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
+ ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
+ !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
+
+ value = value.replace( rxhtmlTag, "<$1></$2>" );
+
+ try {
+ for (; i < l; i++ ) {
+ // Remove element nodes and prevent memory leaks
+ elem = this[i] || {};
+ if ( elem.nodeType === 1 ) {
+ jQuery.cleanData( getAll( elem, false ) );
+ elem.innerHTML = value;
+ }
+ }
+
+ elem = 0;
+
+ // If using innerHTML throws an exception, use the fallback method
+ } catch(e) {}
+ }
+
+ if ( elem ) {
+ this.empty().append( value );
+ }
+ }, null, value, arguments.length );
+ },
+
+ replaceWith: function() {
+ var arg = arguments[ 0 ];
+
+ // Make the changes, replacing each context element with the new content
+ this.domManip( arguments, function( elem ) {
+ arg = this.parentNode;
+
+ jQuery.cleanData( getAll( this ) );
+
+ if ( arg ) {
+ arg.replaceChild( elem, this );
+ }
+ });
+
+ // Force removal if there was no new content (e.g., from empty arguments)
+ return arg && (arg.length || arg.nodeType) ? this : this.remove();
+ },
+
+ detach: function( selector ) {
+ return this.remove( selector, true );
+ },
+
+ domManip: function( args, callback ) {
+
+ // Flatten any nested arrays
+ args = concat.apply( [], args );
+
+ var first, node, hasScripts,
+ scripts, doc, fragment,
+ i = 0,
+ l = this.length,
+ set = this,
+ iNoClone = l - 1,
+ value = args[0],
+ isFunction = jQuery.isFunction( value );
+
+ // We can't cloneNode fragments that contain checked, in WebKit
+ if ( isFunction ||
+ ( l > 1 && typeof value === "string" &&
+ !support.checkClone && rchecked.test( value ) ) ) {
+ return this.each(function( index ) {
+ var self = set.eq( index );
+ if ( isFunction ) {
+ args[0] = value.call( this, index, self.html() );
+ }
+ self.domManip( args, callback );
+ });
+ }
+
+ if ( l ) {
+ fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
+ first = fragment.firstChild;
+
+ if ( fragment.childNodes.length === 1 ) {
+ fragment = first;
+ }
+
+ if ( first ) {
+ scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
+ hasScripts = scripts.length;
+
+ // Use the original fragment for the last item instead of the first because it can end up
+ // being emptied incorrectly in certain situations (#8070).
+ for ( ; i < l; i++ ) {
+ node = fragment;
+
+ if ( i !== iNoClone ) {
+ node = jQuery.clone( node, true, true );
+
+ // Keep references to cloned scripts for later restoration
+ if ( hasScripts ) {
+ jQuery.merge( scripts, getAll( node, "script" ) );
+ }
+ }
+
+ callback.call( this[i], node, i );
+ }
+
+ if ( hasScripts ) {
+ doc = scripts[ scripts.length - 1 ].ownerDocument;
+
+ // Reenable scripts
+ jQuery.map( scripts, restoreScript );
+
+ // Evaluate executable scripts on first document insertion
+ for ( i = 0; i < hasScripts; i++ ) {
+ node = scripts[ i ];
+ if ( rscriptType.test( node.type || "" ) &&
+ !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
+
+ if ( node.src ) {
+ // Optional AJAX dependency, but won't run scripts if not present
+ if ( jQuery._evalUrl ) {
+ jQuery._evalUrl( node.src );
+ }
+ } else {
+ jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
+ }
+ }
+ }
+ }
+
+ // Fix #11809: Avoid leaking memory
+ fragment = first = null;
+ }
+ }
+
+ return this;
+ }
+});
+
+jQuery.each({
+ appendTo: "append",
+ prependTo: "prepend",
+ insertBefore: "before",
+ insertAfter: "after",
+ replaceAll: "replaceWith"
+}, function( name, original ) {
+ jQuery.fn[ name ] = function( selector ) {
+ var elems,
+ i = 0,
+ ret = [],
+ insert = jQuery( selector ),
+ last = insert.length - 1;
+
+ for ( ; i <= last; i++ ) {
+ elems = i === last ? this : this.clone(true);
+ jQuery( insert[i] )[ original ]( elems );
+
+ // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
+ push.apply( ret, elems.get() );
+ }
+
+ return this.pushStack( ret );
+ };
+});
+
+
+var iframe,
+ elemdisplay = {};
+
+/**
+ * Retrieve the actual display of a element
+ * @param {String} name nodeName of the element
+ * @param {Object} doc Document object
+ */
+// Called only from within defaultDisplay
+function actualDisplay( name, doc ) {
+ var style,
+ elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
+
+ // getDefaultComputedStyle might be reliably used only on attached element
+ display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
+
+ // Use of this method is a temporary fix (more like optmization) until something better comes along,
+ // since it was removed from specification and supported only in FF
+ style.display : jQuery.css( elem[ 0 ], "display" );
+
+ // We don't have any data stored on the element,
+ // so use "detach" method as fast way to get rid of the element
+ elem.detach();
+
+ return display;
+}
+
+/**
+ * Try to determine the default display value of an element
+ * @param {String} nodeName
+ */
+function defaultDisplay( nodeName ) {
+ var doc = document,
+ display = elemdisplay[ nodeName ];
+
+ if ( !display ) {
+ display = actualDisplay( nodeName, doc );
+
+ // If the simple way fails, read from inside an iframe
+ if ( display === "none" || !display ) {
+
+ // Use the already-created iframe if possible
+ iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
+
+ // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
+ doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
+
+ // Support: IE
+ doc.write();
+ doc.close();
+
+ display = actualDisplay( nodeName, doc );
+ iframe.detach();
+ }
+
+ // Store the correct default display
+ elemdisplay[ nodeName ] = display;
+ }
+
+ return display;
+}
+
+
+(function() {
+ var shrinkWrapBlocksVal;
+
+ support.shrinkWrapBlocks = function() {
+ if ( shrinkWrapBlocksVal != null ) {
+ return shrinkWrapBlocksVal;
+ }
+
+ // Will be changed later if needed.
+ shrinkWrapBlocksVal = false;
+
+ // Minified: var b,c,d
+ var div, body, container;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ // Support: IE6
+ // Check if elements with layout shrink-wrap their children
+ if ( typeof div.style.zoom !== strundefined ) {
+ // Reset CSS: box-sizing; display; margin; border
+ div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;" +
+ "padding:1px;width:1px;zoom:1";
+ div.appendChild( document.createElement( "div" ) ).style.width = "5px";
+ shrinkWrapBlocksVal = div.offsetWidth !== 3;
+ }
+
+ body.removeChild( container );
+
+ return shrinkWrapBlocksVal;
+ };
+
+})();
+var rmargin = (/^margin/);
+
+var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
+
+
+
+var getStyles, curCSS,
+ rposition = /^(top|right|bottom|left)$/;
+
+if ( window.getComputedStyle ) {
+ getStyles = function( elem ) {
+ return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var width, minWidth, maxWidth, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+
+ // getPropertyValue is only needed for .css('filter') in IE9, see #12537
+ ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
+
+ if ( computed ) {
+
+ if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
+ ret = jQuery.style( elem, name );
+ }
+
+ // A tribute to the "awesome hack by Dean Edwards"
+ // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
+ // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
+ // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
+ if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
+
+ // Remember the original values
+ width = style.width;
+ minWidth = style.minWidth;
+ maxWidth = style.maxWidth;
+
+ // Put in the new values to get a computed value out
+ style.minWidth = style.maxWidth = style.width = ret;
+ ret = computed.width;
+
+ // Revert the changed values
+ style.width = width;
+ style.minWidth = minWidth;
+ style.maxWidth = maxWidth;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "";
+ };
+} else if ( document.documentElement.currentStyle ) {
+ getStyles = function( elem ) {
+ return elem.currentStyle;
+ };
+
+ curCSS = function( elem, name, computed ) {
+ var left, rs, rsLeft, ret,
+ style = elem.style;
+
+ computed = computed || getStyles( elem );
+ ret = computed ? computed[ name ] : undefined;
+
+ // Avoid setting ret to empty string here
+ // so we don't default to auto
+ if ( ret == null && style && style[ name ] ) {
+ ret = style[ name ];
+ }
+
+ // From the awesome hack by Dean Edwards
+ // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
+
+ // If we're not dealing with a regular pixel number
+ // but a number that has a weird ending, we need to convert it to pixels
+ // but not position css attributes, as those are proportional to the parent element instead
+ // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
+ if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
+
+ // Remember the original values
+ left = style.left;
+ rs = elem.runtimeStyle;
+ rsLeft = rs && rs.left;
+
+ // Put in the new values to get a computed value out
+ if ( rsLeft ) {
+ rs.left = elem.currentStyle.left;
+ }
+ style.left = name === "fontSize" ? "1em" : ret;
+ ret = style.pixelLeft + "px";
+
+ // Revert the changed values
+ style.left = left;
+ if ( rsLeft ) {
+ rs.left = rsLeft;
+ }
+ }
+
+ // Support: IE
+ // IE returns zIndex value as an integer.
+ return ret === undefined ?
+ ret :
+ ret + "" || "auto";
+ };
+}
+
+
+
+
+function addGetHookIf( conditionFn, hookFn ) {
+ // Define the hook, we'll check on the first run if it's really needed.
+ return {
+ get: function() {
+ var condition = conditionFn();
+
+ if ( condition == null ) {
+ // The test was not ready at this point; screw the hook this time
+ // but check again when needed next time.
+ return;
+ }
+
+ if ( condition ) {
+ // Hook not needed (or it's not possible to use it due to missing dependency),
+ // remove it.
+ // Since there are no other hooks for marginRight, remove the whole object.
+ delete this.get;
+ return;
+ }
+
+ // Hook needed; redefine it so that the support test is not executed again.
+
+ return (this.get = hookFn).apply( this, arguments );
+ }
+ };
+}
+
+
+(function() {
+ // Minified: var b,c,d,e,f,g, h,i
+ var div, style, a, pixelPositionVal, boxSizingReliableVal,
+ reliableHiddenOffsetsVal, reliableMarginRightVal;
+
+ // Setup
+ div = document.createElement( "div" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ a = div.getElementsByTagName( "a" )[ 0 ];
+ style = a && a.style;
+
+ // Finish early in limited (non-browser) environments
+ if ( !style ) {
+ return;
+ }
+
+ style.cssText = "float:left;opacity:.5";
+
+ // Support: IE<9
+ // Make sure that element opacity exists (as opposed to filter)
+ support.opacity = style.opacity === "0.5";
+
+ // Verify style float existence
+ // (IE uses styleFloat instead of cssFloat)
+ support.cssFloat = !!style.cssFloat;
+
+ div.style.backgroundClip = "content-box";
+ div.cloneNode( true ).style.backgroundClip = "";
+ support.clearCloneStyle = div.style.backgroundClip === "content-box";
+
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
+ style.WebkitBoxSizing === "";
+
+ jQuery.extend(support, {
+ reliableHiddenOffsets: function() {
+ if ( reliableHiddenOffsetsVal == null ) {
+ computeStyleTests();
+ }
+ return reliableHiddenOffsetsVal;
+ },
+
+ boxSizingReliable: function() {
+ if ( boxSizingReliableVal == null ) {
+ computeStyleTests();
+ }
+ return boxSizingReliableVal;
+ },
+
+ pixelPosition: function() {
+ if ( pixelPositionVal == null ) {
+ computeStyleTests();
+ }
+ return pixelPositionVal;
+ },
+
+ // Support: Android 2.3
+ reliableMarginRight: function() {
+ if ( reliableMarginRightVal == null ) {
+ computeStyleTests();
+ }
+ return reliableMarginRightVal;
+ }
+ });
+
+ function computeStyleTests() {
+ // Minified: var b,c,d,j
+ var div, body, container, contents;
+
+ body = document.getElementsByTagName( "body" )[ 0 ];
+ if ( !body || !body.style ) {
+ // Test fired too early or in an unsupported environment, exit.
+ return;
+ }
+
+ // Setup
+ div = document.createElement( "div" );
+ container = document.createElement( "div" );
+ container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
+ body.appendChild( container ).appendChild( div );
+
+ div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
+ "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
+ "border:1px;padding:1px;width:4px;position:absolute";
+
+ // Support: IE<9
+ // Assume reasonable values in the absence of getComputedStyle
+ pixelPositionVal = boxSizingReliableVal = false;
+ reliableMarginRightVal = true;
+
+ // Check for getComputedStyle so that this code is not run in IE<9.
+ if ( window.getComputedStyle ) {
+ pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
+ boxSizingReliableVal =
+ ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
+
+ // Support: Android 2.3
+ // Div with explicit width and no margin-right incorrectly
+ // gets computed margin-right based on width of container (#3333)
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ contents = div.appendChild( document.createElement( "div" ) );
+
+ // Reset CSS: box-sizing; display; margin; border; padding
+ contents.style.cssText = div.style.cssText =
+ // Support: Firefox<29, Android 2.3
+ // Vendor-prefix box-sizing
+ "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
+ "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
+ contents.style.marginRight = contents.style.width = "0";
+ div.style.width = "1px";
+
+ reliableMarginRightVal =
+ !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
+ }
+
+ // Support: IE8
+ // Check if table cells still have offsetWidth/Height when they are set
+ // to display:none and there are still other visible table cells in a
+ // table row; if so, offsetWidth/Height are not reliable for use when
+ // determining if an element has been hidden directly using
+ // display:none (it is still safe to use offsets if a parent element is
+ // hidden; don safety goggles and see bug #4512 for more information).
+ div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
+ contents = div.getElementsByTagName( "td" );
+ contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+ if ( reliableHiddenOffsetsVal ) {
+ contents[ 0 ].style.display = "";
+ contents[ 1 ].style.display = "none";
+ reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
+ }
+
+ body.removeChild( container );
+ }
+
+})();
+
+
+// A method for quickly swapping in/out CSS properties to get correct calculations.
+jQuery.swap = function( elem, options, callback, args ) {
+ var ret, name,
+ old = {};
+
+ // Remember the old values, and insert the new ones
+ for ( name in options ) {
+ old[ name ] = elem.style[ name ];
+ elem.style[ name ] = options[ name ];
+ }
+
+ ret = callback.apply( elem, args || [] );
+
+ // Revert the old values
+ for ( name in options ) {
+ elem.style[ name ] = old[ name ];
+ }
+
+ return ret;
+};
+
+
+var
+ ralpha = /alpha\([^)]*\)/i,
+ ropacity = /opacity\s*=\s*([^)]*)/,
+
+ // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
+ // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
+ rdisplayswap = /^(none|table(?!-c[ea]).+)/,
+ rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
+ rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
+
+ cssShow = { position: "absolute", visibility: "hidden", display: "block" },
+ cssNormalTransform = {
+ letterSpacing: "0",
+ fontWeight: "400"
+ },
+
+ cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
+
+
+// return a css property mapped to a potentially vendor prefixed property
+function vendorPropName( style, name ) {
+
+ // shortcut for names that are not vendor prefixed
+ if ( name in style ) {
+ return name;
+ }
+
+ // check for vendor prefixed names
+ var capName = name.charAt(0).toUpperCase() + name.slice(1),
+ origName = name,
+ i = cssPrefixes.length;
+
+ while ( i-- ) {
+ name = cssPrefixes[ i ] + capName;
+ if ( name in style ) {
+ return name;
+ }
+ }
+
+ return origName;
+}
+
+function showHide( elements, show ) {
+ var display, elem, hidden,
+ values = [],
+ index = 0,
+ length = elements.length;
+
+ for ( ; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+
+ values[ index ] = jQuery._data( elem, "olddisplay" );
+ display = elem.style.display;
+ if ( show ) {
+ // Reset the inline display of this element to learn if it is
+ // being hidden by cascaded rules or not
+ if ( !values[ index ] && display === "none" ) {
+ elem.style.display = "";
+ }
+
+ // Set elements which have been overridden with display: none
+ // in a stylesheet to whatever the default browser style is
+ // for such an element
+ if ( elem.style.display === "" && isHidden( elem ) ) {
+ values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
+ }
+ } else {
+ hidden = isHidden( elem );
+
+ if ( display && display !== "none" || !hidden ) {
+ jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
+ }
+ }
+ }
+
+ // Set the display of most of the elements in a second loop
+ // to avoid the constant reflow
+ for ( index = 0; index < length; index++ ) {
+ elem = elements[ index ];
+ if ( !elem.style ) {
+ continue;
+ }
+ if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
+ elem.style.display = show ? values[ index ] || "" : "none";
+ }
+ }
+
+ return elements;
+}
+
+function setPositiveNumber( elem, value, subtract ) {
+ var matches = rnumsplit.exec( value );
+ return matches ?
+ // Guard against undefined "subtract", e.g., when used as in cssHooks
+ Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
+ value;
+}
+
+function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
+ var i = extra === ( isBorderBox ? "border" : "content" ) ?
+ // If we already have the right measurement, avoid augmentation
+ 4 :
+ // Otherwise initialize for horizontal or vertical properties
+ name === "width" ? 1 : 0,
+
+ val = 0;
+
+ for ( ; i < 4; i += 2 ) {
+ // both box models exclude margin, so add it if we want it
+ if ( extra === "margin" ) {
+ val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
+ }
+
+ if ( isBorderBox ) {
+ // border-box includes padding, so remove it if we want content
+ if ( extra === "content" ) {
+ val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+ }
+
+ // at this point, extra isn't border nor margin, so remove border
+ if ( extra !== "margin" ) {
+ val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ } else {
+ // at this point, extra isn't content, so add padding
+ val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
+
+ // at this point, extra isn't content nor padding, so add border
+ if ( extra !== "padding" ) {
+ val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
+ }
+ }
+ }
+
+ return val;
+}
+
+function getWidthOrHeight( elem, name, extra ) {
+
+ // Start with offset property, which is equivalent to the border-box value
+ var valueIsBorderBox = true,
+ val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
+ styles = getStyles( elem ),
+ isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
+
+ // some non-html elements return undefined for offsetWidth, so check for null/undefined
+ // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
+ // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
+ if ( val <= 0 || val == null ) {
+ // Fall back to computed then uncomputed css if necessary
+ val = curCSS( elem, name, styles );
+ if ( val < 0 || val == null ) {
+ val = elem.style[ name ];
+ }
+
+ // Computed unit is not pixels. Stop here and return.
+ if ( rnumnonpx.test(val) ) {
+ return val;
+ }
+
+ // we need the check for style in case a browser which returns unreliable values
+ // for getComputedStyle silently falls back to the reliable elem.style
+ valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
+
+ // Normalize "", auto, and prepare for extra
+ val = parseFloat( val ) || 0;
+ }
+
+ // use the active box-sizing model to add/subtract irrelevant styles
+ return ( val +
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra || ( isBorderBox ? "border" : "content" ),
+ valueIsBorderBox,
+ styles
+ )
+ ) + "px";
+}
+
+jQuery.extend({
+ // Add in style property hooks for overriding the default
+ // behavior of getting and setting a style property
+ cssHooks: {
+ opacity: {
+ get: function( elem, computed ) {
+ if ( computed ) {
+ // We should always get a number back from opacity
+ var ret = curCSS( elem, "opacity" );
+ return ret === "" ? "1" : ret;
+ }
+ }
+ }
+ },
+
+ // Don't automatically add "px" to these possibly-unitless properties
+ cssNumber: {
+ "columnCount": true,
+ "fillOpacity": true,
+ "flexGrow": true,
+ "flexShrink": true,
+ "fontWeight": true,
+ "lineHeight": true,
+ "opacity": true,
+ "order": true,
+ "orphans": true,
+ "widows": true,
+ "zIndex": true,
+ "zoom": true
+ },
+
+ // Add in properties whose names you wish to fix before
+ // setting or getting the value
+ cssProps: {
+ // normalize float css property
+ "float": support.cssFloat ? "cssFloat" : "styleFloat"
+ },
+
+ // Get and set the style property on a DOM Node
+ style: function( elem, name, value, extra ) {
+ // Don't set styles on text and comment nodes
+ if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
+ return;
+ }
+
+ // Make sure that we're working with the right name
+ var ret, type, hooks,
+ origName = jQuery.camelCase( name ),
+ style = elem.style;
+
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // Check if we're setting a value
+ if ( value !== undefined ) {
+ type = typeof value;
+
+ // convert relative number strings (+= or -=) to relative numbers. #7345
+ if ( type === "string" && (ret = rrelNum.exec( value )) ) {
+ value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
+ // Fixes bug #9237
+ type = "number";
+ }
+
+ // Make sure that null and NaN values aren't set. See: #7116
+ if ( value == null || value !== value ) {
+ return;
+ }
+
+ // If a number was passed in, add 'px' to the (except for certain CSS properties)
+ if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
+ value += "px";
+ }
+
+ // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
+ // but it would mean to define eight (for every problematic property) identical functions
+ if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
+ style[ name ] = "inherit";
+ }
+
+ // If a hook was provided, use that value, otherwise just set the specified value
+ if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
+
+ // Support: IE
+ // Swallow errors from 'invalid' CSS values (#5509)
+ try {
+ style[ name ] = value;
+ } catch(e) {}
+ }
+
+ } else {
+ // If a hook was provided get the non-computed value from there
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
+ return ret;
+ }
+
+ // Otherwise just get the value from the style object
+ return style[ name ];
+ }
+ },
+
+ css: function( elem, name, extra, styles ) {
+ var num, val, hooks,
+ origName = jQuery.camelCase( name );
+
+ // Make sure that we're working with the right name
+ name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
+
+ // gets hook for the prefixed version
+ // followed by the unprefixed version
+ hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
+
+ // If a hook was provided get the computed value from there
+ if ( hooks && "get" in hooks ) {
+ val = hooks.get( elem, true, extra );
+ }
+
+ // Otherwise, if a way to get the computed value exists, use that
+ if ( val === undefined ) {
+ val = curCSS( elem, name, styles );
+ }
+
+ //convert "normal" to computed value
+ if ( val === "normal" && name in cssNormalTransform ) {
+ val = cssNormalTransform[ name ];
+ }
+
+ // Return, converting to number if forced or a qualifier was provided and val looks numeric
+ if ( extra === "" || extra ) {
+ num = parseFloat( val );
+ return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
+ }
+ return val;
+ }
+});
+
+jQuery.each([ "height", "width" ], function( i, name ) {
+ jQuery.cssHooks[ name ] = {
+ get: function( elem, computed, extra ) {
+ if ( computed ) {
+ // certain elements can have dimension info if we invisibly show them
+ // however, it must have a current display style that would benefit from this
+ return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
+ jQuery.swap( elem, cssShow, function() {
+ return getWidthOrHeight( elem, name, extra );
+ }) :
+ getWidthOrHeight( elem, name, extra );
+ }
+ },
+
+ set: function( elem, value, extra ) {
+ var styles = extra && getStyles( elem );
+ return setPositiveNumber( elem, value, extra ?
+ augmentWidthOrHeight(
+ elem,
+ name,
+ extra,
+ support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
+ styles
+ ) : 0
+ );
+ }
+ };
+});
+
+if ( !support.opacity ) {
+ jQuery.cssHooks.opacity = {
+ get: function( elem, computed ) {
+ // IE uses filters for opacity
+ return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
+ ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
+ computed ? "1" : "";
+ },
+
+ set: function( elem, value ) {
+ var style = elem.style,
+ currentStyle = elem.currentStyle,
+ opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
+ filter = currentStyle && currentStyle.filter || style.filter || "";
+
+ // IE has trouble with opacity if it does not have layout
+ // Force it by setting the zoom level
+ style.zoom = 1;
+
+ // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
+ // if value === "", then remove inline opacity #12685
+ if ( ( value >= 1 || value === "" ) &&
+ jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
+ style.removeAttribute ) {
+
+ // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
+ // if "filter:" is present at all, clearType is disabled, we want to avoid this
+ // style.removeAttribute is IE Only, but so apparently is this code path...
+ style.removeAttribute( "filter" );
+
+ // if there is no filter style applied in a css rule or unset inline opacity, we are done
+ if ( value === "" || currentStyle && !currentStyle.filter ) {
+ return;
+ }
+ }
+
+ // otherwise, set new filter values
+ style.filter = ralpha.test( filter ) ?
+ filter.replace( ralpha, opacity ) :
+ filter + " " + opacity;
+ }
+ };
+}
+
+jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
+ function( elem, computed ) {
+ if ( computed ) {
+ // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
+ // Work around by temporarily setting element display to inline-block
+ return jQuery.swap( elem, { "display": "inline-block" },
+ curCSS, [ elem, "marginRight" ] );
+ }
+ }
+);
+
+// These hooks are used by animate to expand properties
+jQuery.each({
+ margin: "",
+ padding: "",
+ border: "Width"
+}, function( prefix, suffix ) {
+ jQuery.cssHooks[ prefix + suffix ] = {
+ expand: function( value ) {
+ var i = 0,
+ expanded = {},
+
+ // assumes a single number if not a string
+ parts = typeof value === "string" ? value.split(" ") : [ value ];
+
+ for ( ; i < 4; i++ ) {
+ expanded[ prefix + cssExpand[ i ] + suffix ] =
+ parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
+ }
+
+ return expanded;
+ }
+ };
+
+ if ( !rmargin.test( prefix ) ) {
+ jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
+ }
+});
+
+jQuery.fn.extend({
+ css: function( name, value ) {
+ return access( this, function( elem, name, value ) {
+ var styles, len,
+ map = {},
+ i = 0;
+
+ if ( jQuery.isArray( name ) ) {
+ styles = getStyles( elem );
+ len = name.length;
+
+ for ( ; i < len; i++ ) {
+ map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
+ }
+
+ return map;
+ }
+
+ return value !== undefined ?
+ jQuery.style( elem, name, value ) :
+ jQuery.css( elem, name );
+ }, name, value, arguments.length > 1 );
+ },
+ show: function() {
+ return showHide( this, true );
+ },
+ hide: function() {
+ return showHide( this );
+ },
+ toggle: function( state ) {
+ if ( typeof state === "boolean" ) {
+ return state ? this.show() : this.hide();
+ }
+
+ return this.each(function() {
+ if ( isHidden( this ) ) {
+ jQuery( this ).show();
+ } else {
+ jQuery( this ).hide();
+ }
+ });
+ }
+});
+
+
+function Tween( elem, options, prop, end, easing ) {
+ return new Tween.prototype.init( elem, options, prop, end, easing );
+}
+jQuery.Tween = Tween;
+
+Tween.prototype = {
+ constructor: Tween,
+ init: function( elem, options, prop, end, easing, unit ) {
+ this.elem = elem;
+ this.prop = prop;
+ this.easing = easing || "swing";
+ this.options = options;
+ this.start = this.now = this.cur();
+ this.end = end;
+ this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
+ },
+ cur: function() {
+ var hooks = Tween.propHooks[ this.prop ];
+
+ return hooks && hooks.get ?
+ hooks.get( this ) :
+ Tween.propHooks._default.get( this );
+ },
+ run: function( percent ) {
+ var eased,
+ hooks = Tween.propHooks[ this.prop ];
+
+ if ( this.options.duration ) {
+ this.pos = eased = jQuery.easing[ this.easing ](
+ percent, this.options.duration * percent, 0, 1, this.options.duration
+ );
+ } else {
+ this.pos = eased = percent;
+ }
+ this.now = ( this.end - this.start ) * eased + this.start;
+
+ if ( this.options.step ) {
+ this.options.step.call( this.elem, this.now, this );
+ }
+
+ if ( hooks && hooks.set ) {
+ hooks.set( this );
+ } else {
+ Tween.propHooks._default.set( this );
+ }
+ return this;
+ }
+};
+
+Tween.prototype.init.prototype = Tween.prototype;
+
+Tween.propHooks = {
+ _default: {
+ get: function( tween ) {
+ var result;
+
+ if ( tween.elem[ tween.prop ] != null &&
+ (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
+ return tween.elem[ tween.prop ];
+ }
+
+ // passing an empty string as a 3rd parameter to .css will automatically
+ // attempt a parseFloat and fallback to a string if the parse fails
+ // so, simple values such as "10px" are parsed to Float.
+ // complex values such as "rotate(1rad)" are returned as is.
+ result = jQuery.css( tween.elem, tween.prop, "" );
+ // Empty strings, null, undefined and "auto" are converted to 0.
+ return !result || result === "auto" ? 0 : result;
+ },
+ set: function( tween ) {
+ // use step hook for back compat - use cssHook if its there - use .style if its
+ // available and use plain properties where available
+ if ( jQuery.fx.step[ tween.prop ] ) {
+ jQuery.fx.step[ tween.prop ]( tween );
+ } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
+ jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
+ } else {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+ }
+};
+
+// Support: IE <=9
+// Panic based approach to setting things on disconnected nodes
+
+Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
+ set: function( tween ) {
+ if ( tween.elem.nodeType && tween.elem.parentNode ) {
+ tween.elem[ tween.prop ] = tween.now;
+ }
+ }
+};
+
+jQuery.easing = {
+ linear: function( p ) {
+ return p;
+ },
+ swing: function( p ) {
+ return 0.5 - Math.cos( p * Math.PI ) / 2;
+ }
+};
+
+jQuery.fx = Tween.prototype.init;
+
+// Back Compat <1.8 extension point
+jQuery.fx.step = {};
+
+
+
+
+var
+ fxNow, timerId,
+ rfxtypes = /^(?:toggle|show|hide)$/,
+ rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
+ rrun = /queueHooks$/,
+ animationPrefilters = [ defaultPrefilter ],
+ tweeners = {
+ "*": [ function( prop, value ) {
+ var tween = this.createTween( prop, value ),
+ target = tween.cur(),
+ parts = rfxnum.exec( value ),
+ unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
+
+ // Starting value computation is required for potential unit mismatches
+ start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
+ rfxnum.exec( jQuery.css( tween.elem, prop ) ),
+ scale = 1,
+ maxIterations = 20;
+
+ if ( start && start[ 3 ] !== unit ) {
+ // Trust units reported by jQuery.css
+ unit = unit || start[ 3 ];
+
+ // Make sure we update the tween properties later on
+ parts = parts || [];
+
+ // Iteratively approximate from a nonzero starting point
+ start = +target || 1;
+
+ do {
+ // If previous iteration zeroed out, double until we get *something*
+ // Use a string for doubling factor so we don't accidentally see scale as unchanged below
+ scale = scale || ".5";
+
+ // Adjust and apply
+ start = start / scale;
+ jQuery.style( tween.elem, prop, start + unit );
+
+ // Update scale, tolerating zero or NaN from tween.cur()
+ // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
+ } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
+ }
+
+ // Update tween properties
+ if ( parts ) {
+ start = tween.start = +start || +target || 0;
+ tween.unit = unit;
+ // If a +=/-= token was provided, we're doing a relative animation
+ tween.end = parts[ 1 ] ?
+ start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
+ +parts[ 2 ];
+ }
+
+ return tween;
+ } ]
+ };
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+ setTimeout(function() {
+ fxNow = undefined;
+ });
+ return ( fxNow = jQuery.now() );
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, includeWidth ) {
+ var which,
+ attrs = { height: type },
+ i = 0;
+
+ // if we include width, step value is 1 to do all cssExpand values,
+ // if we don't include width, step value is 2 to skip over Left and Right
+ includeWidth = includeWidth ? 1 : 0;
+ for ( ; i < 4 ; i += 2 - includeWidth ) {
+ which = cssExpand[ i ];
+ attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
+ }
+
+ if ( includeWidth ) {
+ attrs.opacity = attrs.width = type;
+ }
+
+ return attrs;
+}
+
+function createTween( value, prop, animation ) {
+ var tween,
+ collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
+ index = 0,
+ length = collection.length;
+ for ( ; index < length; index++ ) {
+ if ( (tween = collection[ index ].call( animation, prop, value )) ) {
+
+ // we're done with this property
+ return tween;
+ }
+ }
+}
+
+function defaultPrefilter( elem, props, opts ) {
+ /* jshint validthis: true */
+ var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
+ anim = this,
+ orig = {},
+ style = elem.style,
+ hidden = elem.nodeType && isHidden( elem ),
+ dataShow = jQuery._data( elem, "fxshow" );
+
+ // handle queue: false promises
+ if ( !opts.queue ) {
+ hooks = jQuery._queueHooks( elem, "fx" );
+ if ( hooks.unqueued == null ) {
+ hooks.unqueued = 0;
+ oldfire = hooks.empty.fire;
+ hooks.empty.fire = function() {
+ if ( !hooks.unqueued ) {
+ oldfire();
+ }
+ };
+ }
+ hooks.unqueued++;
+
+ anim.always(function() {
+ // doing this makes sure that the complete handler will be called
+ // before this completes
+ anim.always(function() {
+ hooks.unqueued--;
+ if ( !jQuery.queue( elem, "fx" ).length ) {
+ hooks.empty.fire();
+ }
+ });
+ });
+ }
+
+ // height/width overflow pass
+ if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
+ // Make sure that nothing sneaks out
+ // Record all 3 overflow attributes because IE does not
+ // change the overflow attribute when overflowX and
+ // overflowY are set to the same value
+ opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
+
+ // Set display property to inline-block for height/width
+ // animations on inline elements that are having width/height animated
+ display = jQuery.css( elem, "display" );
+
+ // Test default display if display is currently "none"
+ checkDisplay = display === "none" ?
+ jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
+
+ if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
+
+ // inline-level elements accept inline-block;
+ // block-level elements need to be inline with layout
+ if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
+ style.display = "inline-block";
+ } else {
+ style.zoom = 1;
+ }
+ }
+ }
+
+ if ( opts.overflow ) {
+ style.overflow = "hidden";
+ if ( !support.shrinkWrapBlocks() ) {
+ anim.always(function() {
+ style.overflow = opts.overflow[ 0 ];
+ style.overflowX = opts.overflow[ 1 ];
+ style.overflowY = opts.overflow[ 2 ];
+ });
+ }
+ }
+
+ // show/hide pass
+ for ( prop in props ) {
+ value = props[ prop ];
+ if ( rfxtypes.exec( value ) ) {
+ delete props[ prop ];
+ toggle = toggle || value === "toggle";
+ if ( value === ( hidden ? "hide" : "show" ) ) {
+
+ // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
+ if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
+ hidden = true;
+ } else {
+ continue;
+ }
+ }
+ orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
+
+ // Any non-fx value stops us from restoring the original display value
+ } else {
+ display = undefined;
+ }
+ }
+
+ if ( !jQuery.isEmptyObject( orig ) ) {
+ if ( dataShow ) {
+ if ( "hidden" in dataShow ) {
+ hidden = dataShow.hidden;
+ }
+ } else {
+ dataShow = jQuery._data( elem, "fxshow", {} );
+ }
+
+ // store state if its toggle - enables .stop().toggle() to "reverse"
+ if ( toggle ) {
+ dataShow.hidden = !hidden;
+ }
+ if ( hidden ) {
+ jQuery( elem ).show();
+ } else {
+ anim.done(function() {
+ jQuery( elem ).hide();
+ });
+ }
+ anim.done(function() {
+ var prop;
+ jQuery._removeData( elem, "fxshow" );
+ for ( prop in orig ) {
+ jQuery.style( elem, prop, orig[ prop ] );
+ }
+ });
+ for ( prop in orig ) {
+ tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
+
+ if ( !( prop in dataShow ) ) {
+ dataShow[ prop ] = tween.start;
+ if ( hidden ) {
+ tween.end = tween.start;
+ tween.start = prop === "width" || prop === "height" ? 1 : 0;
+ }
+ }
+ }
+
+ // If this is a noop like .hide().hide(), restore an overwritten display value
+ } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
+ style.display = display;
+ }
+}
+
+function propFilter( props, specialEasing ) {
+ var index, name, easing, value, hooks;
+
+ // camelCase, specialEasing and expand cssHook pass
+ for ( index in props ) {
+ name = jQuery.camelCase( index );
+ easing = specialEasing[ name ];
+ value = props[ index ];
+ if ( jQuery.isArray( value ) ) {
+ easing = value[ 1 ];
+ value = props[ index ] = value[ 0 ];
+ }
+
+ if ( index !== name ) {
+ props[ name ] = value;
+ delete props[ index ];
+ }
+
+ hooks = jQuery.cssHooks[ name ];
+ if ( hooks && "expand" in hooks ) {
+ value = hooks.expand( value );
+ delete props[ name ];
+
+ // not quite $.extend, this wont overwrite keys already present.
+ // also - reusing 'index' from above because we have the correct "name"
+ for ( index in value ) {
+ if ( !( index in props ) ) {
+ props[ index ] = value[ index ];
+ specialEasing[ index ] = easing;
+ }
+ }
+ } else {
+ specialEasing[ name ] = easing;
+ }
+ }
+}
+
+function Animation( elem, properties, options ) {
+ var result,
+ stopped,
+ index = 0,
+ length = animationPrefilters.length,
+ deferred = jQuery.Deferred().always( function() {
+ // don't match elem in the :animated selector
+ delete tick.elem;
+ }),
+ tick = function() {
+ if ( stopped ) {
+ return false;
+ }
+ var currentTime = fxNow || createFxNow(),
+ remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
+ // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
+ temp = remaining / animation.duration || 0,
+ percent = 1 - temp,
+ index = 0,
+ length = animation.tweens.length;
+
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( percent );
+ }
+
+ deferred.notifyWith( elem, [ animation, percent, remaining ]);
+
+ if ( percent < 1 && length ) {
+ return remaining;
+ } else {
+ deferred.resolveWith( elem, [ animation ] );
+ return false;
+ }
+ },
+ animation = deferred.promise({
+ elem: elem,
+ props: jQuery.extend( {}, properties ),
+ opts: jQuery.extend( true, { specialEasing: {} }, options ),
+ originalProperties: properties,
+ originalOptions: options,
+ startTime: fxNow || createFxNow(),
+ duration: options.duration,
+ tweens: [],
+ createTween: function( prop, end ) {
+ var tween = jQuery.Tween( elem, animation.opts, prop, end,
+ animation.opts.specialEasing[ prop ] || animation.opts.easing );
+ animation.tweens.push( tween );
+ return tween;
+ },
+ stop: function( gotoEnd ) {
+ var index = 0,
+ // if we are going to the end, we want to run all the tweens
+ // otherwise we skip this part
+ length = gotoEnd ? animation.tweens.length : 0;
+ if ( stopped ) {
+ return this;
+ }
+ stopped = true;
+ for ( ; index < length ; index++ ) {
+ animation.tweens[ index ].run( 1 );
+ }
+
+ // resolve when we played the last frame
+ // otherwise, reject
+ if ( gotoEnd ) {
+ deferred.resolveWith( elem, [ animation, gotoEnd ] );
+ } else {
+ deferred.rejectWith( elem, [ animation, gotoEnd ] );
+ }
+ return this;
+ }
+ }),
+ props = animation.props;
+
+ propFilter( props, animation.opts.specialEasing );
+
+ for ( ; index < length ; index++ ) {
+ result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
+ if ( result ) {
+ return result;
+ }
+ }
+
+ jQuery.map( props, createTween, animation );
+
+ if ( jQuery.isFunction( animation.opts.start ) ) {
+ animation.opts.start.call( elem, animation );
+ }
+
+ jQuery.fx.timer(
+ jQuery.extend( tick, {
+ elem: elem,
+ anim: animation,
+ queue: animation.opts.queue
+ })
+ );
+
+ // attach callbacks from options
+ return animation.progress( animation.opts.progress )
+ .done( animation.opts.done, animation.opts.complete )
+ .fail( animation.opts.fail )
+ .always( animation.opts.always );
+}
+
+jQuery.Animation = jQuery.extend( Animation, {
+ tweener: function( props, callback ) {
+ if ( jQuery.isFunction( props ) ) {
+ callback = props;
+ props = [ "*" ];
+ } else {
+ props = props.split(" ");
+ }
+
+ var prop,
+ index = 0,
+ length = props.length;
+
+ for ( ; index < length ; index++ ) {
+ prop = props[ index ];
+ tweeners[ prop ] = tweeners[ prop ] || [];
+ tweeners[ prop ].unshift( callback );
+ }
+ },
+
+ prefilter: function( callback, prepend ) {
+ if ( prepend ) {
+ animationPrefilters.unshift( callback );
+ } else {
+ animationPrefilters.push( callback );
+ }
+ }
+});
+
+jQuery.speed = function( speed, easing, fn ) {
+ var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
+ complete: fn || !fn && easing ||
+ jQuery.isFunction( speed ) && speed,
+ duration: speed,
+ easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
+ };
+
+ opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
+ opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
+
+ // normalize opt.queue - true/undefined/null -> "fx"
+ if ( opt.queue == null || opt.queue === true ) {
+ opt.queue = "fx";
+ }
+
+ // Queueing
+ opt.old = opt.complete;
+
+ opt.complete = function() {
+ if ( jQuery.isFunction( opt.old ) ) {
+ opt.old.call( this );
+ }
+
+ if ( opt.queue ) {
+ jQuery.dequeue( this, opt.queue );
+ }
+ };
+
+ return opt;
+};
+
+jQuery.fn.extend({
+ fadeTo: function( speed, to, easing, callback ) {
+
+ // show any hidden elements after setting opacity to 0
+ return this.filter( isHidden ).css( "opacity", 0 ).show()
+
+ // animate to the value specified
+ .end().animate({ opacity: to }, speed, easing, callback );
+ },
+ animate: function( prop, speed, easing, callback ) {
+ var empty = jQuery.isEmptyObject( prop ),
+ optall = jQuery.speed( speed, easing, callback ),
+ doAnimation = function() {
+ // Operate on a copy of prop so per-property easing won't be lost
+ var anim = Animation( this, jQuery.extend( {}, prop ), optall );
+
+ // Empty animations, or finishing resolves immediately
+ if ( empty || jQuery._data( this, "finish" ) ) {
+ anim.stop( true );
+ }
+ };
+ doAnimation.finish = doAnimation;
+
+ return empty || optall.queue === false ?
+ this.each( doAnimation ) :
+ this.queue( optall.queue, doAnimation );
+ },
+ stop: function( type, clearQueue, gotoEnd ) {
+ var stopQueue = function( hooks ) {
+ var stop = hooks.stop;
+ delete hooks.stop;
+ stop( gotoEnd );
+ };
+
+ if ( typeof type !== "string" ) {
+ gotoEnd = clearQueue;
+ clearQueue = type;
+ type = undefined;
+ }
+ if ( clearQueue && type !== false ) {
+ this.queue( type || "fx", [] );
+ }
+
+ return this.each(function() {
+ var dequeue = true,
+ index = type != null && type + "queueHooks",
+ timers = jQuery.timers,
+ data = jQuery._data( this );
+
+ if ( index ) {
+ if ( data[ index ] && data[ index ].stop ) {
+ stopQueue( data[ index ] );
+ }
+ } else {
+ for ( index in data ) {
+ if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
+ stopQueue( data[ index ] );
+ }
+ }
+ }
+
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
+ timers[ index ].anim.stop( gotoEnd );
+ dequeue = false;
+ timers.splice( index, 1 );
+ }
+ }
+
+ // start the next in the queue if the last step wasn't forced
+ // timers currently will call their complete callbacks, which will dequeue
+ // but only if they were gotoEnd
+ if ( dequeue || !gotoEnd ) {
+ jQuery.dequeue( this, type );
+ }
+ });
+ },
+ finish: function( type ) {
+ if ( type !== false ) {
+ type = type || "fx";
+ }
+ return this.each(function() {
+ var index,
+ data = jQuery._data( this ),
+ queue = data[ type + "queue" ],
+ hooks = data[ type + "queueHooks" ],
+ timers = jQuery.timers,
+ length = queue ? queue.length : 0;
+
+ // enable finishing flag on private data
+ data.finish = true;
+
+ // empty the queue first
+ jQuery.queue( this, type, [] );
+
+ if ( hooks && hooks.stop ) {
+ hooks.stop.call( this, true );
+ }
+
+ // look for any active animations, and finish them
+ for ( index = timers.length; index--; ) {
+ if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
+ timers[ index ].anim.stop( true );
+ timers.splice( index, 1 );
+ }
+ }
+
+ // look for any animations in the old queue and finish them
+ for ( index = 0; index < length; index++ ) {
+ if ( queue[ index ] && queue[ index ].finish ) {
+ queue[ index ].finish.call( this );
+ }
+ }
+
+ // turn off finishing flag
+ delete data.finish;
+ });
+ }
+});
+
+jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
+ var cssFn = jQuery.fn[ name ];
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return speed == null || typeof speed === "boolean" ?
+ cssFn.apply( this, arguments ) :
+ this.animate( genFx( name, true ), speed, easing, callback );
+ };
+});
+
+// Generate shortcuts for custom animations
+jQuery.each({
+ slideDown: genFx("show"),
+ slideUp: genFx("hide"),
+ slideToggle: genFx("toggle"),
+ fadeIn: { opacity: "show" },
+ fadeOut: { opacity: "hide" },
+ fadeToggle: { opacity: "toggle" }
+}, function( name, props ) {
+ jQuery.fn[ name ] = function( speed, easing, callback ) {
+ return this.animate( props, speed, easing, callback );
+ };
+});
+
+jQuery.timers = [];
+jQuery.fx.tick = function() {
+ var timer,
+ timers = jQuery.timers,
+ i = 0;
+
+ fxNow = jQuery.now();
+
+ for ( ; i < timers.length; i++ ) {
+ timer = timers[ i ];
+ // Checks the timer has not already been removed
+ if ( !timer() && timers[ i ] === timer ) {
+ timers.splice( i--, 1 );
+ }
+ }
+
+ if ( !timers.length ) {
+ jQuery.fx.stop();
+ }
+ fxNow = undefined;
+};
+
+jQuery.fx.timer = function( timer ) {
+ jQuery.timers.push( timer );
+ if ( timer() ) {
+ jQuery.fx.start();
+ } else {
+ jQuery.timers.pop();
+ }
+};
+
+jQuery.fx.interval = 13;
+
+jQuery.fx.start = function() {
+ if ( !timerId ) {
+ timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
+ }
+};
+
+jQuery.fx.stop = function() {
+ clearInterval( timerId );
+ timerId = null;
+};
+
+jQuery.fx.speeds = {
+ slow: 600,
+ fast: 200,
+ // Default speed
+ _default: 400
+};
+
+
+// Based off of the plugin by Clint Helfers, with permission.
+// http://blindsignals.com/index.php/2009/07/jquery-delay/
+jQuery.fn.delay = function( time, type ) {
+ time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
+ type = type || "fx";
+
+ return this.queue( type, function( next, hooks ) {
+ var timeout = setTimeout( next, time );
+ hooks.stop = function() {
+ clearTimeout( timeout );
+ };
+ });
+};
+
+
+(function() {
+ // Minified: var a,b,c,d,e
+ var input, div, select, a, opt;
+
+ // Setup
+ div = document.createElement( "div" );
+ div.setAttribute( "className", "t" );
+ div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
+ a = div.getElementsByTagName("a")[ 0 ];
+
+ // First batch of tests.
+ select = document.createElement("select");
+ opt = select.appendChild( document.createElement("option") );
+ input = div.getElementsByTagName("input")[ 0 ];
+
+ a.style.cssText = "top:1px";
+
+ // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+ support.getSetAttribute = div.className !== "t";
+
+ // Get the style information from getAttribute
+ // (IE uses .cssText instead)
+ support.style = /top/.test( a.getAttribute("style") );
+
+ // Make sure that URLs aren't manipulated
+ // (IE normalizes it by default)
+ support.hrefNormalized = a.getAttribute("href") === "/a";
+
+ // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
+ support.checkOn = !!input.value;
+
+ // Make sure that a selected-by-default option has a working selected property.
+ // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
+ support.optSelected = opt.selected;
+
+ // Tests for enctype support on a form (#6743)
+ support.enctype = !!document.createElement("form").enctype;
+
+ // Make sure that the options inside disabled selects aren't marked as disabled
+ // (WebKit marks them as disabled)
+ select.disabled = true;
+ support.optDisabled = !opt.disabled;
+
+ // Support: IE8 only
+ // Check if we can trust getAttribute("value")
+ input = document.createElement( "input" );
+ input.setAttribute( "value", "" );
+ support.input = input.getAttribute( "value" ) === "";
+
+ // Check if an input maintains its value after becoming a radio
+ input.value = "t";
+ input.setAttribute( "type", "radio" );
+ support.radioValue = input.value === "t";
+})();
+
+
+var rreturn = /\r/g;
+
+jQuery.fn.extend({
+ val: function( value ) {
+ var hooks, ret, isFunction,
+ elem = this[0];
+
+ if ( !arguments.length ) {
+ if ( elem ) {
+ hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
+
+ if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+ return ret;
+ }
+
+ ret = elem.value;
+
+ return typeof ret === "string" ?
+ // handle most common string cases
+ ret.replace(rreturn, "") :
+ // handle cases where value is null/undef or number
+ ret == null ? "" : ret;
+ }
+
+ return;
+ }
+
+ isFunction = jQuery.isFunction( value );
+
+ return this.each(function( i ) {
+ var val;
+
+ if ( this.nodeType !== 1 ) {
+ return;
+ }
+
+ if ( isFunction ) {
+ val = value.call( this, i, jQuery( this ).val() );
+ } else {
+ val = value;
+ }
+
+ // Treat null/undefined as ""; convert numbers to string
+ if ( val == null ) {
+ val = "";
+ } else if ( typeof val === "number" ) {
+ val += "";
+ } else if ( jQuery.isArray( val ) ) {
+ val = jQuery.map( val, function( value ) {
+ return value == null ? "" : value + "";
+ });
+ }
+
+ hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
+
+ // If set returns undefined, fall back to normal setting
+ if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
+ this.value = val;
+ }
+ });
+ }
+});
+
+jQuery.extend({
+ valHooks: {
+ option: {
+ get: function( elem ) {
+ var val = jQuery.find.attr( elem, "value" );
+ return val != null ?
+ val :
+ // Support: IE10-11+
+ // option.text throws exceptions (#14686, #14858)
+ jQuery.trim( jQuery.text( elem ) );
+ }
+ },
+ select: {
+ get: function( elem ) {
+ var value, option,
+ options = elem.options,
+ index = elem.selectedIndex,
+ one = elem.type === "select-one" || index < 0,
+ values = one ? null : [],
+ max = one ? index + 1 : options.length,
+ i = index < 0 ?
+ max :
+ one ? index : 0;
+
+ // Loop through all the selected options
+ for ( ; i < max; i++ ) {
+ option = options[ i ];
+
+ // oldIE doesn't update selected after form reset (#2551)
+ if ( ( option.selected || i === index ) &&
+ // Don't return options that are disabled or in a disabled optgroup
+ ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
+ ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
+
+ // Get the specific value for the option
+ value = jQuery( option ).val();
+
+ // We don't need an array for one selects
+ if ( one ) {
+ return value;
+ }
+
+ // Multi-Selects return an array
+ values.push( value );
+ }
+ }
+
+ return values;
+ },
+
+ set: function( elem, value ) {
+ var optionSet, option,
+ options = elem.options,
+ values = jQuery.makeArray( value ),
+ i = options.length;
+
+ while ( i-- ) {
+ option = options[ i ];
+
+ if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
+
+ // Support: IE6
+ // When new option element is added to select box we need to
+ // force reflow of newly added node in order to workaround delay
+ // of initialization properties
+ try {
+ option.selected = optionSet = true;
+
+ } catch ( _ ) {
+
+ // Will be executed only in IE6
+ option.scrollHeight;
+ }
+
+ } else {
+ option.selected = false;
+ }
+ }
+
+ // Force browsers to behave consistently when non-matching value is set
+ if ( !optionSet ) {
+ elem.selectedIndex = -1;
+ }
+
+ return options;
+ }
+ }
+ }
+});
+
+// Radios and checkboxes getter/setter
+jQuery.each([ "radio", "checkbox" ], function() {
+ jQuery.valHooks[ this ] = {
+ set: function( elem, value ) {
+ if ( jQuery.isArray( value ) ) {
+ return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
+ }
+ }
+ };
+ if ( !support.checkOn ) {
+ jQuery.valHooks[ this ].get = function( elem ) {
+ // Support: Webkit
+ // "" is returned instead of "on" if a value isn't specified
+ return elem.getAttribute("value") === null ? "on" : elem.value;
+ };
+ }
+});
+
+
+
+
+var nodeHook, boolHook,
+ attrHandle = jQuery.expr.attrHandle,
+ ruseDefault = /^(?:checked|selected)$/i,
+ getSetAttribute = support.getSetAttribute,
+ getSetInput = support.input;
+
+jQuery.fn.extend({
+ attr: function( name, value ) {
+ return access( this, jQuery.attr, name, value, arguments.length > 1 );
+ },
+
+ removeAttr: function( name ) {
+ return this.each(function() {
+ jQuery.removeAttr( this, name );
+ });
+ }
+});
+
+jQuery.extend({
+ attr: function( elem, name, value ) {
+ var hooks, ret,
+ nType = elem.nodeType;
+
+ // don't get/set attributes on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ // Fallback to prop when attributes are not supported
+ if ( typeof elem.getAttribute === strundefined ) {
+ return jQuery.prop( elem, name, value );
+ }
+
+ // All attributes are lowercase
+ // Grab necessary hook if one is defined
+ if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
+ name = name.toLowerCase();
+ hooks = jQuery.attrHooks[ name ] ||
+ ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
+ }
+
+ if ( value !== undefined ) {
+
+ if ( value === null ) {
+ jQuery.removeAttr( elem, name );
+
+ } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
+ return ret;
+
+ } else {
+ elem.setAttribute( name, value + "" );
+ return value;
+ }
+
+ } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
+ return ret;
+
+ } else {
+ ret = jQuery.find.attr( elem, name );
+
+ // Non-existent attributes return null, we normalize to undefined
+ return ret == null ?
+ undefined :
+ ret;
+ }
+ },
+
+ removeAttr: function( elem, value ) {
+ var name, propName,
+ i = 0,
+ attrNames = value && value.match( rnotwhite );
+
+ if ( attrNames && elem.nodeType === 1 ) {
+ while ( (name = attrNames[i++]) ) {
+ propName = jQuery.propFix[ name ] || name;
+
+ // Boolean attributes get special treatment (#10870)
+ if ( jQuery.expr.match.bool.test( name ) ) {
+ // Set corresponding property to false
+ if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ elem[ propName ] = false;
+ // Support: IE<9
+ // Also clear defaultChecked/defaultSelected (if appropriate)
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] =
+ elem[ propName ] = false;
+ }
+
+ // See #9699 for explanation of this approach (setting first, then removal)
+ } else {
+ jQuery.attr( elem, name, "" );
+ }
+
+ elem.removeAttribute( getSetAttribute ? name : propName );
+ }
+ }
+ },
+
+ attrHooks: {
+ type: {
+ set: function( elem, value ) {
+ if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
+ // Setting the type on a radio button after the value resets the value in IE6-9
+ // Reset value to default in case type is set after value during creation
+ var val = elem.value;
+ elem.setAttribute( "type", value );
+ if ( val ) {
+ elem.value = val;
+ }
+ return value;
+ }
+ }
+ }
+ }
+});
+
+// Hook for boolean attributes
+boolHook = {
+ set: function( elem, value, name ) {
+ if ( value === false ) {
+ // Remove boolean attributes when set to false
+ jQuery.removeAttr( elem, name );
+ } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
+ // IE<8 needs the *property* name
+ elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
+
+ // Use defaultChecked and defaultSelected for oldIE
+ } else {
+ elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
+ }
+
+ return name;
+ }
+};
+
+// Retrieve booleans specially
+jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
+
+ var getter = attrHandle[ name ] || jQuery.find.attr;
+
+ attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
+ function( elem, name, isXML ) {
+ var ret, handle;
+ if ( !isXML ) {
+ // Avoid an infinite loop by temporarily removing this function from the getter
+ handle = attrHandle[ name ];
+ attrHandle[ name ] = ret;
+ ret = getter( elem, name, isXML ) != null ?
+ name.toLowerCase() :
+ null;
+ attrHandle[ name ] = handle;
+ }
+ return ret;
+ } :
+ function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem[ jQuery.camelCase( "default-" + name ) ] ?
+ name.toLowerCase() :
+ null;
+ }
+ };
+});
+
+// fix oldIE attroperties
+if ( !getSetInput || !getSetAttribute ) {
+ jQuery.attrHooks.value = {
+ set: function( elem, value, name ) {
+ if ( jQuery.nodeName( elem, "input" ) ) {
+ // Does not return so that setAttribute is also used
+ elem.defaultValue = value;
+ } else {
+ // Use nodeHook if defined (#1954); otherwise setAttribute is fine
+ return nodeHook && nodeHook.set( elem, value, name );
+ }
+ }
+ };
+}
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !getSetAttribute ) {
+
+ // Use this for any attribute in IE6/7
+ // This fixes almost every IE6/7 issue
+ nodeHook = {
+ set: function( elem, value, name ) {
+ // Set the existing or create a new attribute node
+ var ret = elem.getAttributeNode( name );
+ if ( !ret ) {
+ elem.setAttributeNode(
+ (ret = elem.ownerDocument.createAttribute( name ))
+ );
+ }
+
+ ret.value = value += "";
+
+ // Break association with cloned elements by also using setAttribute (#9646)
+ if ( name === "value" || value === elem.getAttribute( name ) ) {
+ return value;
+ }
+ }
+ };
+
+ // Some attributes are constructed with empty-string values when not defined
+ attrHandle.id = attrHandle.name = attrHandle.coords =
+ function( elem, name, isXML ) {
+ var ret;
+ if ( !isXML ) {
+ return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
+ ret.value :
+ null;
+ }
+ };
+
+ // Fixing value retrieval on a button requires this module
+ jQuery.valHooks.button = {
+ get: function( elem, name ) {
+ var ret = elem.getAttributeNode( name );
+ if ( ret && ret.specified ) {
+ return ret.value;
+ }
+ },
+ set: nodeHook.set
+ };
+
+ // Set contenteditable to false on removals(#10429)
+ // Setting to empty string throws an error as an invalid value
+ jQuery.attrHooks.contenteditable = {
+ set: function( elem, value, name ) {
+ nodeHook.set( elem, value === "" ? false : value, name );
+ }
+ };
+
+ // Set width and height to auto instead of 0 on empty string( Bug #8150 )
+ // This is for removals
+ jQuery.each([ "width", "height" ], function( i, name ) {
+ jQuery.attrHooks[ name ] = {
+ set: function( elem, value ) {
+ if ( value === "" ) {
+ elem.setAttribute( name, "auto" );
+ return value;
+ }
+ }
+ };
+ });
+}
+
+if ( !support.style ) {
+ jQuery.attrHooks.style = {
+ get: function( elem ) {
+ // Return undefined in the case of empty string
+ // Note: IE uppercases css property names, but if we were to .toLowerCase()
+ // .cssText, that would destroy case senstitivity in URL's, like in "background"
+ return elem.style.cssText || undefined;
+ },
+ set: function( elem, value ) {
+ return ( elem.style.cssText = value + "" );
+ }
+ };
+}
+
+
+
+
+var rfocusable = /^(?:input|select|textarea|button|object)$/i,
+ rclickable = /^(?:a|area)$/i;
+
+jQuery.fn.extend({
+ prop: function( name, value ) {
+ return access( this, jQuery.prop, name, value, arguments.length > 1 );
+ },
+
+ removeProp: function( name ) {
+ name = jQuery.propFix[ name ] || name;
+ return this.each(function() {
+ // try/catch handles cases where IE balks (such as removing a property on window)
+ try {
+ this[ name ] = undefined;
+ delete this[ name ];
+ } catch( e ) {}
+ });
+ }
+});
+
+jQuery.extend({
+ propFix: {
+ "for": "htmlFor",
+ "class": "className"
+ },
+
+ prop: function( elem, name, value ) {
+ var ret, hooks, notxml,
+ nType = elem.nodeType;
+
+ // don't get/set properties on text, comment and attribute nodes
+ if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+ return;
+ }
+
+ notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+ if ( notxml ) {
+ // Fix name and attach hooks
+ name = jQuery.propFix[ name ] || name;
+ hooks = jQuery.propHooks[ name ];
+ }
+
+ if ( value !== undefined ) {
+ return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
+ ret :
+ ( elem[ name ] = value );
+
+ } else {
+ return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
+ ret :
+ elem[ name ];
+ }
+ },
+
+ propHooks: {
+ tabIndex: {
+ get: function( elem ) {
+ // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+ // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+ // Use proper attribute retrieval(#12072)
+ var tabindex = jQuery.find.attr( elem, "tabindex" );
+
+ return tabindex ?
+ parseInt( tabindex, 10 ) :
+ rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
+ 0 :
+ -1;
+ }
+ }
+ }
+});
+
+// Some attributes require a special call on IE
+// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
+if ( !support.hrefNormalized ) {
+ // href/src property should get the full normalized URL (#10299/#12915)
+ jQuery.each([ "href", "src" ], function( i, name ) {
+ jQuery.propHooks[ name ] = {
+ get: function( elem ) {
+ return elem.getAttribute( name, 4 );
+ }
+ };
+ });
+}
+
+// Support: Safari, IE9+
+// mis-reports the default selected property of an option
+// Accessing the parent's selectedIndex property fixes it
+if ( !support.optSelected ) {
+ jQuery.propHooks.selected = {
+ get: function( elem ) {
+ var parent = elem.parentNode;
+
+ if ( parent ) {
+ parent.selectedIndex;
+
+ // Make sure that it also works with optgroups, see #5701
+ if ( parent.parentNode ) {
+ parent.parentNode.selectedIndex;
+ }
+ }
+ return null;
+ }
+ };
+}
+
+jQuery.each([
+ "tabIndex",
+ "readOnly",
+ "maxLength",
+ "cellSpacing",
+ "cellPadding",
+ "rowSpan",
+ "colSpan",
+ "useMap",
+ "frameBorder",
+ "contentEditable"
+], function() {
+ jQuery.propFix[ this.toLowerCase() ] = this;
+});
+
+// IE6/7 call enctype encoding
+if ( !support.enctype ) {
+ jQuery.propFix.enctype = "encoding";
+}
+
+
+
+
+var rclass = /[\t\r\n\f]/g;
+
+jQuery.fn.extend({
+ addClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ i = 0,
+ len = this.length,
+ proceed = typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).addClass( value.call( this, j, this.className ) );
+ });
+ }
+
+ if ( proceed ) {
+ // The disjunction here is for better compressibility (see removeClass)
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ " "
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
+ cur += clazz + " ";
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = jQuery.trim( cur );
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ removeClass: function( value ) {
+ var classes, elem, cur, clazz, j, finalValue,
+ i = 0,
+ len = this.length,
+ proceed = arguments.length === 0 || typeof value === "string" && value;
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( j ) {
+ jQuery( this ).removeClass( value.call( this, j, this.className ) );
+ });
+ }
+ if ( proceed ) {
+ classes = ( value || "" ).match( rnotwhite ) || [];
+
+ for ( ; i < len; i++ ) {
+ elem = this[ i ];
+ // This expression is here for better compressibility (see addClass)
+ cur = elem.nodeType === 1 && ( elem.className ?
+ ( " " + elem.className + " " ).replace( rclass, " " ) :
+ ""
+ );
+
+ if ( cur ) {
+ j = 0;
+ while ( (clazz = classes[j++]) ) {
+ // Remove *all* instances
+ while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
+ cur = cur.replace( " " + clazz + " ", " " );
+ }
+ }
+
+ // only assign if different to avoid unneeded rendering.
+ finalValue = value ? jQuery.trim( cur ) : "";
+ if ( elem.className !== finalValue ) {
+ elem.className = finalValue;
+ }
+ }
+ }
+ }
+
+ return this;
+ },
+
+ toggleClass: function( value, stateVal ) {
+ var type = typeof value;
+
+ if ( typeof stateVal === "boolean" && type === "string" ) {
+ return stateVal ? this.addClass( value ) : this.removeClass( value );
+ }
+
+ if ( jQuery.isFunction( value ) ) {
+ return this.each(function( i ) {
+ jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
+ });
+ }
+
+ return this.each(function() {
+ if ( type === "string" ) {
+ // toggle individual class names
+ var className,
+ i = 0,
+ self = jQuery( this ),
+ classNames = value.match( rnotwhite ) || [];
+
+ while ( (className = classNames[ i++ ]) ) {
+ // check each className given, space separated list
+ if ( self.hasClass( className ) ) {
+ self.removeClass( className );
+ } else {
+ self.addClass( className );
+ }
+ }
+
+ // Toggle whole class name
+ } else if ( type === strundefined || type === "boolean" ) {
+ if ( this.className ) {
+ // store className if set
+ jQuery._data( this, "__className__", this.className );
+ }
+
+ // If the element has a class name or if we're passed "false",
+ // then remove the whole classname (if there was one, the above saved it).
+ // Otherwise bring back whatever was previously saved (if anything),
+ // falling back to the empty string if nothing was stored.
+ this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
+ }
+ });
+ },
+
+ hasClass: function( selector ) {
+ var className = " " + selector + " ",
+ i = 0,
+ l = this.length;
+ for ( ; i < l; i++ ) {
+ if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+});
+
+
+
+
+// Return jQuery for attributes-only inclusion
+
+
+jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
+ "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
+ "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
+
+ // Handle event binding
+ jQuery.fn[ name ] = function( data, fn ) {
+ return arguments.length > 0 ?
+ this.on( name, null, data, fn ) :
+ this.trigger( name );
+ };
+});
+
+jQuery.fn.extend({
+ hover: function( fnOver, fnOut ) {
+ return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
+ },
+
+ bind: function( types, data, fn ) {
+ return this.on( types, null, data, fn );
+ },
+ unbind: function( types, fn ) {
+ return this.off( types, null, fn );
+ },
+
+ delegate: function( selector, types, data, fn ) {
+ return this.on( types, selector, data, fn );
+ },
+ undelegate: function( selector, types, fn ) {
+ // ( namespace ) or ( selector, types [, fn] )
+ return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
+ }
+});
+
+
+var nonce = jQuery.now();
+
+var rquery = (/\?/);
+
+
+
+var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
+
+jQuery.parseJSON = function( data ) {
+ // Attempt to parse using the native JSON parser first
+ if ( window.JSON && window.JSON.parse ) {
+ // Support: Android 2.3
+ // Workaround failure to string-cast null input
+ return window.JSON.parse( data + "" );
+ }
+
+ var requireNonComma,
+ depth = null,
+ str = jQuery.trim( data + "" );
+
+ // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
+ // after removing valid tokens
+ return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
+
+ // Force termination if we see a misplaced comma
+ if ( requireNonComma && comma ) {
+ depth = 0;
+ }
+
+ // Perform no more replacements after returning to outermost depth
+ if ( depth === 0 ) {
+ return token;
+ }
+
+ // Commas must not follow "[", "{", or ","
+ requireNonComma = open || comma;
+
+ // Determine new depth
+ // array/object open ("[" or "{"): depth += true - false (increment)
+ // array/object close ("]" or "}"): depth += false - true (decrement)
+ // other cases ("," or primitive): depth += true - true (numeric cast)
+ depth += !close - !open;
+
+ // Remove this token
+ return "";
+ }) ) ?
+ ( Function( "return " + str ) )() :
+ jQuery.error( "Invalid JSON: " + data );
+};
+
+
+// Cross-browser xml parsing
+jQuery.parseXML = function( data ) {
+ var xml, tmp;
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ try {
+ if ( window.DOMParser ) { // Standard
+ tmp = new DOMParser();
+ xml = tmp.parseFromString( data, "text/xml" );
+ } else { // IE
+ xml = new ActiveXObject( "Microsoft.XMLDOM" );
+ xml.async = "false";
+ xml.loadXML( data );
+ }
+ } catch( e ) {
+ xml = undefined;
+ }
+ if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
+ jQuery.error( "Invalid XML: " + data );
+ }
+ return xml;
+};
+
+
+var
+ // Document location
+ ajaxLocParts,
+ ajaxLocation,
+
+ rhash = /#.*$/,
+ rts = /([?&])_=[^&]*/,
+ rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+ // #7653, #8125, #8152: local protocol detection
+ rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
+ rnoContent = /^(?:GET|HEAD)$/,
+ rprotocol = /^\/\//,
+ rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
+
+ /* Prefilters
+ * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
+ * 2) These are called:
+ * - BEFORE asking for a transport
+ * - AFTER param serialization (s.data is a string if s.processData is true)
+ * 3) key is the dataType
+ * 4) the catchall symbol "*" can be used
+ * 5) execution will start with transport dataType and THEN continue down to "*" if needed
+ */
+ prefilters = {},
+
+ /* Transports bindings
+ * 1) key is the dataType
+ * 2) the catchall symbol "*" can be used
+ * 3) selection will start with transport dataType and THEN go to "*" if needed
+ */
+ transports = {},
+
+ // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
+ allTypes = "*/".concat("*");
+
+// #8138, IE may throw an exception when accessing
+// a field from window.location if document.domain has been set
+try {
+ ajaxLocation = location.href;
+} catch( e ) {
+ // Use the href attribute of an A element
+ // since IE will modify it given document.location
+ ajaxLocation = document.createElement( "a" );
+ ajaxLocation.href = "";
+ ajaxLocation = ajaxLocation.href;
+}
+
+// Segment location into parts
+ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
+
+// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
+function addToPrefiltersOrTransports( structure ) {
+
+ // dataTypeExpression is optional and defaults to "*"
+ return function( dataTypeExpression, func ) {
+
+ if ( typeof dataTypeExpression !== "string" ) {
+ func = dataTypeExpression;
+ dataTypeExpression = "*";
+ }
+
+ var dataType,
+ i = 0,
+ dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
+
+ if ( jQuery.isFunction( func ) ) {
+ // For each dataType in the dataTypeExpression
+ while ( (dataType = dataTypes[i++]) ) {
+ // Prepend if requested
+ if ( dataType.charAt( 0 ) === "+" ) {
+ dataType = dataType.slice( 1 ) || "*";
+ (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
+
+ // Otherwise append
+ } else {
+ (structure[ dataType ] = structure[ dataType ] || []).push( func );
+ }
+ }
+ }
+ };
+}
+
+// Base inspection function for prefilters and transports
+function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
+
+ var inspected = {},
+ seekingTransport = ( structure === transports );
+
+ function inspect( dataType ) {
+ var selected;
+ inspected[ dataType ] = true;
+ jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
+ var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
+ if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
+ options.dataTypes.unshift( dataTypeOrTransport );
+ inspect( dataTypeOrTransport );
+ return false;
+ } else if ( seekingTransport ) {
+ return !( selected = dataTypeOrTransport );
+ }
+ });
+ return selected;
+ }
+
+ return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
+}
+
+// A special extend for ajax options
+// that takes "flat" options (not to be deep extended)
+// Fixes #9887
+function ajaxExtend( target, src ) {
+ var deep, key,
+ flatOptions = jQuery.ajaxSettings.flatOptions || {};
+
+ for ( key in src ) {
+ if ( src[ key ] !== undefined ) {
+ ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
+ }
+ }
+ if ( deep ) {
+ jQuery.extend( true, target, deep );
+ }
+
+ return target;
+}
+
+/* Handles responses to an ajax request:
+ * - finds the right dataType (mediates between content-type and expected dataType)
+ * - returns the corresponding response
+ */
+function ajaxHandleResponses( s, jqXHR, responses ) {
+ var firstDataType, ct, finalDataType, type,
+ contents = s.contents,
+ dataTypes = s.dataTypes;
+
+ // Remove auto dataType and get content-type in the process
+ while ( dataTypes[ 0 ] === "*" ) {
+ dataTypes.shift();
+ if ( ct === undefined ) {
+ ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
+ }
+ }
+
+ // Check if we're dealing with a known content-type
+ if ( ct ) {
+ for ( type in contents ) {
+ if ( contents[ type ] && contents[ type ].test( ct ) ) {
+ dataTypes.unshift( type );
+ break;
+ }
+ }
+ }
+
+ // Check to see if we have a response for the expected dataType
+ if ( dataTypes[ 0 ] in responses ) {
+ finalDataType = dataTypes[ 0 ];
+ } else {
+ // Try convertible dataTypes
+ for ( type in responses ) {
+ if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
+ finalDataType = type;
+ break;
+ }
+ if ( !firstDataType ) {
+ firstDataType = type;
+ }
+ }
+ // Or just use first one
+ finalDataType = finalDataType || firstDataType;
+ }
+
+ // If we found a dataType
+ // We add the dataType to the list if needed
+ // and return the corresponding response
+ if ( finalDataType ) {
+ if ( finalDataType !== dataTypes[ 0 ] ) {
+ dataTypes.unshift( finalDataType );
+ }
+ return responses[ finalDataType ];
+ }
+}
+
+/* Chain conversions given the request and the original response
+ * Also sets the responseXXX fields on the jqXHR instance
+ */
+function ajaxConvert( s, response, jqXHR, isSuccess ) {
+ var conv2, current, conv, tmp, prev,
+ converters = {},
+ // Work with a copy of dataTypes in case we need to modify it for conversion
+ dataTypes = s.dataTypes.slice();
+
+ // Create converters map with lowercased keys
+ if ( dataTypes[ 1 ] ) {
+ for ( conv in s.converters ) {
+ converters[ conv.toLowerCase() ] = s.converters[ conv ];
+ }
+ }
+
+ current = dataTypes.shift();
+
+ // Convert to each sequential dataType
+ while ( current ) {
+
+ if ( s.responseFields[ current ] ) {
+ jqXHR[ s.responseFields[ current ] ] = response;
+ }
+
+ // Apply the dataFilter if provided
+ if ( !prev && isSuccess && s.dataFilter ) {
+ response = s.dataFilter( response, s.dataType );
+ }
+
+ prev = current;
+ current = dataTypes.shift();
+
+ if ( current ) {
+
+ // There's only work to do if current dataType is non-auto
+ if ( current === "*" ) {
+
+ current = prev;
+
+ // Convert response if prev dataType is non-auto and differs from current
+ } else if ( prev !== "*" && prev !== current ) {
+
+ // Seek a direct converter
+ conv = converters[ prev + " " + current ] || converters[ "* " + current ];
+
+ // If none found, seek a pair
+ if ( !conv ) {
+ for ( conv2 in converters ) {
+
+ // If conv2 outputs current
+ tmp = conv2.split( " " );
+ if ( tmp[ 1 ] === current ) {
+
+ // If prev can be converted to accepted input
+ conv = converters[ prev + " " + tmp[ 0 ] ] ||
+ converters[ "* " + tmp[ 0 ] ];
+ if ( conv ) {
+ // Condense equivalence converters
+ if ( conv === true ) {
+ conv = converters[ conv2 ];
+
+ // Otherwise, insert the intermediate dataType
+ } else if ( converters[ conv2 ] !== true ) {
+ current = tmp[ 0 ];
+ dataTypes.unshift( tmp[ 1 ] );
+ }
+ break;
+ }
+ }
+ }
+ }
+
+ // Apply converter (if not an equivalence)
+ if ( conv !== true ) {
+
+ // Unless errors are allowed to bubble, catch and return them
+ if ( conv && s[ "throws" ] ) {
+ response = conv( response );
+ } else {
+ try {
+ response = conv( response );
+ } catch ( e ) {
+ return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
+ }
+ }
+ }
+ }
+ }
+ }
+
+ return { state: "success", data: response };
+}
+
+jQuery.extend({
+
+ // Counter for holding the number of active queries
+ active: 0,
+
+ // Last-Modified header cache for next request
+ lastModified: {},
+ etag: {},
+
+ ajaxSettings: {
+ url: ajaxLocation,
+ type: "GET",
+ isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
+ global: true,
+ processData: true,
+ async: true,
+ contentType: "application/x-www-form-urlencoded; charset=UTF-8",
+ /*
+ timeout: 0,
+ data: null,
+ dataType: null,
+ username: null,
+ password: null,
+ cache: null,
+ throws: false,
+ traditional: false,
+ headers: {},
+ */
+
+ accepts: {
+ "*": allTypes,
+ text: "text/plain",
+ html: "text/html",
+ xml: "application/xml, text/xml",
+ json: "application/json, text/javascript"
+ },
+
+ contents: {
+ xml: /xml/,
+ html: /html/,
+ json: /json/
+ },
+
+ responseFields: {
+ xml: "responseXML",
+ text: "responseText",
+ json: "responseJSON"
+ },
+
+ // Data converters
+ // Keys separate source (or catchall "*") and destination types with a single space
+ converters: {
+
+ // Convert anything to text
+ "* text": String,
+
+ // Text to html (true = no transformation)
+ "text html": true,
+
+ // Evaluate text as a json expression
+ "text json": jQuery.parseJSON,
+
+ // Parse text as xml
+ "text xml": jQuery.parseXML
+ },
+
+ // For options that shouldn't be deep extended:
+ // you can add your own custom options here if
+ // and when you create one that shouldn't be
+ // deep extended (see ajaxExtend)
+ flatOptions: {
+ url: true,
+ context: true
+ }
+ },
+
+ // Creates a full fledged settings object into target
+ // with both ajaxSettings and settings fields.
+ // If target is omitted, writes into ajaxSettings.
+ ajaxSetup: function( target, settings ) {
+ return settings ?
+
+ // Building a settings object
+ ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
+
+ // Extending ajaxSettings
+ ajaxExtend( jQuery.ajaxSettings, target );
+ },
+
+ ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
+ ajaxTransport: addToPrefiltersOrTransports( transports ),
+
+ // Main method
+ ajax: function( url, options ) {
+
+ // If url is an object, simulate pre-1.5 signature
+ if ( typeof url === "object" ) {
+ options = url;
+ url = undefined;
+ }
+
+ // Force options to be an object
+ options = options || {};
+
+ var // Cross-domain detection vars
+ parts,
+ // Loop variable
+ i,
+ // URL without anti-cache param
+ cacheURL,
+ // Response headers as string
+ responseHeadersString,
+ // timeout handle
+ timeoutTimer,
+
+ // To know if global events are to be dispatched
+ fireGlobals,
+
+ transport,
+ // Response headers
+ responseHeaders,
+ // Create the final options object
+ s = jQuery.ajaxSetup( {}, options ),
+ // Callbacks context
+ callbackContext = s.context || s,
+ // Context for global events is callbackContext if it is a DOM node or jQuery collection
+ globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
+ jQuery( callbackContext ) :
+ jQuery.event,
+ // Deferreds
+ deferred = jQuery.Deferred(),
+ completeDeferred = jQuery.Callbacks("once memory"),
+ // Status-dependent callbacks
+ statusCode = s.statusCode || {},
+ // Headers (they are sent all at once)
+ requestHeaders = {},
+ requestHeadersNames = {},
+ // The jqXHR state
+ state = 0,
+ // Default abort message
+ strAbort = "canceled",
+ // Fake xhr
+ jqXHR = {
+ readyState: 0,
+
+ // Builds headers hashtable if needed
+ getResponseHeader: function( key ) {
+ var match;
+ if ( state === 2 ) {
+ if ( !responseHeaders ) {
+ responseHeaders = {};
+ while ( (match = rheaders.exec( responseHeadersString )) ) {
+ responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
+ }
+ }
+ match = responseHeaders[ key.toLowerCase() ];
+ }
+ return match == null ? null : match;
+ },
+
+ // Raw string
+ getAllResponseHeaders: function() {
+ return state === 2 ? responseHeadersString : null;
+ },
+
+ // Caches the header
+ setRequestHeader: function( name, value ) {
+ var lname = name.toLowerCase();
+ if ( !state ) {
+ name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
+ requestHeaders[ name ] = value;
+ }
+ return this;
+ },
+
+ // Overrides response content-type header
+ overrideMimeType: function( type ) {
+ if ( !state ) {
+ s.mimeType = type;
+ }
+ return this;
+ },
+
+ // Status-dependent callbacks
+ statusCode: function( map ) {
+ var code;
+ if ( map ) {
+ if ( state < 2 ) {
+ for ( code in map ) {
+ // Lazy-add the new callback in a way that preserves old ones
+ statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
+ }
+ } else {
+ // Execute the appropriate callbacks
+ jqXHR.always( map[ jqXHR.status ] );
+ }
+ }
+ return this;
+ },
+
+ // Cancel the request
+ abort: function( statusText ) {
+ var finalText = statusText || strAbort;
+ if ( transport ) {
+ transport.abort( finalText );
+ }
+ done( 0, finalText );
+ return this;
+ }
+ };
+
+ // Attach deferreds
+ deferred.promise( jqXHR ).complete = completeDeferred.add;
+ jqXHR.success = jqXHR.done;
+ jqXHR.error = jqXHR.fail;
+
+ // Remove hash character (#7531: and string promotion)
+ // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
+ // Handle falsy url in the settings object (#10093: consistency with old signature)
+ // We also use the url parameter if available
+ s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
+
+ // Alias method option to type as per ticket #12004
+ s.type = options.method || options.type || s.method || s.type;
+
+ // Extract dataTypes list
+ s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
+
+ // A cross-domain request is in order when we have a protocol:host:port mismatch
+ if ( s.crossDomain == null ) {
+ parts = rurl.exec( s.url.toLowerCase() );
+ s.crossDomain = !!( parts &&
+ ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
+ ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
+ ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
+ );
+ }
+
+ // Convert data if not already a string
+ if ( s.data && s.processData && typeof s.data !== "string" ) {
+ s.data = jQuery.param( s.data, s.traditional );
+ }
+
+ // Apply prefilters
+ inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+ // If request was aborted inside a prefilter, stop there
+ if ( state === 2 ) {
+ return jqXHR;
+ }
+
+ // We can fire global events as of now if asked to
+ fireGlobals = s.global;
+
+ // Watch for a new set of requests
+ if ( fireGlobals && jQuery.active++ === 0 ) {
+ jQuery.event.trigger("ajaxStart");
+ }
+
+ // Uppercase the type
+ s.type = s.type.toUpperCase();
+
+ // Determine if request has content
+ s.hasContent = !rnoContent.test( s.type );
+
+ // Save the URL in case we're toying with the If-Modified-Since
+ // and/or If-None-Match header later on
+ cacheURL = s.url;
+
+ // More options handling for requests with no content
+ if ( !s.hasContent ) {
+
+ // If data is available, append data to url
+ if ( s.data ) {
+ cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
+ // #9682: remove data so that it's not used in an eventual retry
+ delete s.data;
+ }
+
+ // Add anti-cache in url if needed
+ if ( s.cache === false ) {
+ s.url = rts.test( cacheURL ) ?
+
+ // If there is already a '_' parameter, set its value
+ cacheURL.replace( rts, "$1_=" + nonce++ ) :
+
+ // Otherwise add one to the end
+ cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
+ }
+ }
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ if ( jQuery.lastModified[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
+ }
+ if ( jQuery.etag[ cacheURL ] ) {
+ jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
+ }
+ }
+
+ // Set the correct header, if data is being sent
+ if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
+ jqXHR.setRequestHeader( "Content-Type", s.contentType );
+ }
+
+ // Set the Accepts header for the server, depending on the dataType
+ jqXHR.setRequestHeader(
+ "Accept",
+ s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
+ s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
+ s.accepts[ "*" ]
+ );
+
+ // Check for headers option
+ for ( i in s.headers ) {
+ jqXHR.setRequestHeader( i, s.headers[ i ] );
+ }
+
+ // Allow custom headers/mimetypes and early abort
+ if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
+ // Abort if not done already and return
+ return jqXHR.abort();
+ }
+
+ // aborting is no longer a cancellation
+ strAbort = "abort";
+
+ // Install callbacks on deferreds
+ for ( i in { success: 1, error: 1, complete: 1 } ) {
+ jqXHR[ i ]( s[ i ] );
+ }
+
+ // Get transport
+ transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
+
+ // If no transport, we auto-abort
+ if ( !transport ) {
+ done( -1, "No Transport" );
+ } else {
+ jqXHR.readyState = 1;
+
+ // Send global event
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
+ }
+ // Timeout
+ if ( s.async && s.timeout > 0 ) {
+ timeoutTimer = setTimeout(function() {
+ jqXHR.abort("timeout");
+ }, s.timeout );
+ }
+
+ try {
+ state = 1;
+ transport.send( requestHeaders, done );
+ } catch ( e ) {
+ // Propagate exception as error if not done
+ if ( state < 2 ) {
+ done( -1, e );
+ // Simply rethrow otherwise
+ } else {
+ throw e;
+ }
+ }
+ }
+
+ // Callback for when everything is done
+ function done( status, nativeStatusText, responses, headers ) {
+ var isSuccess, success, error, response, modified,
+ statusText = nativeStatusText;
+
+ // Called once
+ if ( state === 2 ) {
+ return;
+ }
+
+ // State is "done" now
+ state = 2;
+
+ // Clear timeout if it exists
+ if ( timeoutTimer ) {
+ clearTimeout( timeoutTimer );
+ }
+
+ // Dereference transport for early garbage collection
+ // (no matter how long the jqXHR object will be used)
+ transport = undefined;
+
+ // Cache response headers
+ responseHeadersString = headers || "";
+
+ // Set readyState
+ jqXHR.readyState = status > 0 ? 4 : 0;
+
+ // Determine if successful
+ isSuccess = status >= 200 && status < 300 || status === 304;
+
+ // Get response data
+ if ( responses ) {
+ response = ajaxHandleResponses( s, jqXHR, responses );
+ }
+
+ // Convert no matter what (that way responseXXX fields are always set)
+ response = ajaxConvert( s, response, jqXHR, isSuccess );
+
+ // If successful, handle type chaining
+ if ( isSuccess ) {
+
+ // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
+ if ( s.ifModified ) {
+ modified = jqXHR.getResponseHeader("Last-Modified");
+ if ( modified ) {
+ jQuery.lastModified[ cacheURL ] = modified;
+ }
+ modified = jqXHR.getResponseHeader("etag");
+ if ( modified ) {
+ jQuery.etag[ cacheURL ] = modified;
+ }
+ }
+
+ // if no content
+ if ( status === 204 || s.type === "HEAD" ) {
+ statusText = "nocontent";
+
+ // if not modified
+ } else if ( status === 304 ) {
+ statusText = "notmodified";
+
+ // If we have data, let's convert it
+ } else {
+ statusText = response.state;
+ success = response.data;
+ error = response.error;
+ isSuccess = !error;
+ }
+ } else {
+ // We extract error from statusText
+ // then normalize statusText and status for non-aborts
+ error = statusText;
+ if ( status || !statusText ) {
+ statusText = "error";
+ if ( status < 0 ) {
+ status = 0;
+ }
+ }
+ }
+
+ // Set data for the fake xhr object
+ jqXHR.status = status;
+ jqXHR.statusText = ( nativeStatusText || statusText ) + "";
+
+ // Success/Error
+ if ( isSuccess ) {
+ deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
+ } else {
+ deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
+ }
+
+ // Status-dependent callbacks
+ jqXHR.statusCode( statusCode );
+ statusCode = undefined;
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
+ [ jqXHR, s, isSuccess ? success : error ] );
+ }
+
+ // Complete
+ completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
+
+ if ( fireGlobals ) {
+ globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
+ // Handle the global AJAX counter
+ if ( !( --jQuery.active ) ) {
+ jQuery.event.trigger("ajaxStop");
+ }
+ }
+ }
+
+ return jqXHR;
+ },
+
+ getJSON: function( url, data, callback ) {
+ return jQuery.get( url, data, callback, "json" );
+ },
+
+ getScript: function( url, callback ) {
+ return jQuery.get( url, undefined, callback, "script" );
+ }
+});
+
+jQuery.each( [ "get", "post" ], function( i, method ) {
+ jQuery[ method ] = function( url, data, callback, type ) {
+ // shift arguments if data argument was omitted
+ if ( jQuery.isFunction( data ) ) {
+ type = type || callback;
+ callback = data;
+ data = undefined;
+ }
+
+ return jQuery.ajax({
+ url: url,
+ type: method,
+ dataType: type,
+ data: data,
+ success: callback
+ });
+ };
+});
+
+// Attach a bunch of functions for handling common AJAX events
+jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
+ jQuery.fn[ type ] = function( fn ) {
+ return this.on( type, fn );
+ };
+});
+
+
+jQuery._evalUrl = function( url ) {
+ return jQuery.ajax({
+ url: url,
+ type: "GET",
+ dataType: "script",
+ async: false,
+ global: false,
+ "throws": true
+ });
+};
+
+
+jQuery.fn.extend({
+ wrapAll: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapAll( html.call(this, i) );
+ });
+ }
+
+ if ( this[0] ) {
+ // The elements to wrap the target around
+ var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
+
+ if ( this[0].parentNode ) {
+ wrap.insertBefore( this[0] );
+ }
+
+ wrap.map(function() {
+ var elem = this;
+
+ while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
+ elem = elem.firstChild;
+ }
+
+ return elem;
+ }).append( this );
+ }
+
+ return this;
+ },
+
+ wrapInner: function( html ) {
+ if ( jQuery.isFunction( html ) ) {
+ return this.each(function(i) {
+ jQuery(this).wrapInner( html.call(this, i) );
+ });
+ }
+
+ return this.each(function() {
+ var self = jQuery( this ),
+ contents = self.contents();
+
+ if ( contents.length ) {
+ contents.wrapAll( html );
+
+ } else {
+ self.append( html );
+ }
+ });
+ },
+
+ wrap: function( html ) {
+ var isFunction = jQuery.isFunction( html );
+
+ return this.each(function(i) {
+ jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
+ });
+ },
+
+ unwrap: function() {
+ return this.parent().each(function() {
+ if ( !jQuery.nodeName( this, "body" ) ) {
+ jQuery( this ).replaceWith( this.childNodes );
+ }
+ }).end();
+ }
+});
+
+
+jQuery.expr.filters.hidden = function( elem ) {
+ // Support: Opera <= 12.12
+ // Opera reports offsetWidths and offsetHeights less than zero on some elements
+ return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
+ (!support.reliableHiddenOffsets() &&
+ ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
+};
+
+jQuery.expr.filters.visible = function( elem ) {
+ return !jQuery.expr.filters.hidden( elem );
+};
+
+
+
+
+var r20 = /%20/g,
+ rbracket = /\[\]$/,
+ rCRLF = /\r?\n/g,
+ rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
+ rsubmittable = /^(?:input|select|textarea|keygen)/i;
+
+function buildParams( prefix, obj, traditional, add ) {
+ var name;
+
+ if ( jQuery.isArray( obj ) ) {
+ // Serialize array item.
+ jQuery.each( obj, function( i, v ) {
+ if ( traditional || rbracket.test( prefix ) ) {
+ // Treat each array item as a scalar.
+ add( prefix, v );
+
+ } else {
+ // Item is non-scalar (array or object), encode its numeric index.
+ buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
+ }
+ });
+
+ } else if ( !traditional && jQuery.type( obj ) === "object" ) {
+ // Serialize object item.
+ for ( name in obj ) {
+ buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+ }
+
+ } else {
+ // Serialize scalar item.
+ add( prefix, obj );
+ }
+}
+
+// Serialize an array of form elements or a set of
+// key/values into a query string
+jQuery.param = function( a, traditional ) {
+ var prefix,
+ s = [],
+ add = function( key, value ) {
+ // If value is a function, invoke it and return its value
+ value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
+ s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+ };
+
+ // Set traditional to true for jQuery <= 1.3.2 behavior.
+ if ( traditional === undefined ) {
+ traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
+ }
+
+ // If an array was passed in, assume that it is an array of form elements.
+ if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
+ // Serialize the form elements
+ jQuery.each( a, function() {
+ add( this.name, this.value );
+ });
+
+ } else {
+ // If traditional, encode the "old" way (the way 1.3.2 or older
+ // did it), otherwise encode params recursively.
+ for ( prefix in a ) {
+ buildParams( prefix, a[ prefix ], traditional, add );
+ }
+ }
+
+ // Return the resulting serialization
+ return s.join( "&" ).replace( r20, "+" );
+};
+
+jQuery.fn.extend({
+ serialize: function() {
+ return jQuery.param( this.serializeArray() );
+ },
+ serializeArray: function() {
+ return this.map(function() {
+ // Can add propHook for "elements" to filter or add form elements
+ var elements = jQuery.prop( this, "elements" );
+ return elements ? jQuery.makeArray( elements ) : this;
+ })
+ .filter(function() {
+ var type = this.type;
+ // Use .is(":disabled") so that fieldset[disabled] works
+ return this.name && !jQuery( this ).is( ":disabled" ) &&
+ rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
+ ( this.checked || !rcheckableType.test( type ) );
+ })
+ .map(function( i, elem ) {
+ var val = jQuery( this ).val();
+
+ return val == null ?
+ null :
+ jQuery.isArray( val ) ?
+ jQuery.map( val, function( val ) {
+ return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }) :
+ { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
+ }).get();
+ }
+});
+
+
+// Create the request object
+// (This is still attached to ajaxSettings for backward compatibility)
+jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
+ // Support: IE6+
+ function() {
+
+ // XHR cannot access local files, always use ActiveX for that case
+ return !this.isLocal &&
+
+ // Support: IE7-8
+ // oldIE XHR does not support non-RFC2616 methods (#13240)
+ // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
+ // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
+ // Although this check for six methods instead of eight
+ // since IE also does not support "trace" and "connect"
+ /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
+
+ createStandardXHR() || createActiveXHR();
+ } :
+ // For all other browsers, use the standard XMLHttpRequest object
+ createStandardXHR;
+
+var xhrId = 0,
+ xhrCallbacks = {},
+ xhrSupported = jQuery.ajaxSettings.xhr();
+
+// Support: IE<10
+// Open requests must be manually aborted on unload (#5280)
+if ( window.ActiveXObject ) {
+ jQuery( window ).on( "unload", function() {
+ for ( var key in xhrCallbacks ) {
+ xhrCallbacks[ key ]( undefined, true );
+ }
+ });
+}
+
+// Determine support properties
+support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
+xhrSupported = support.ajax = !!xhrSupported;
+
+// Create transport if the browser can provide an xhr
+if ( xhrSupported ) {
+
+ jQuery.ajaxTransport(function( options ) {
+ // Cross domain only allowed if supported through XMLHttpRequest
+ if ( !options.crossDomain || support.cors ) {
+
+ var callback;
+
+ return {
+ send: function( headers, complete ) {
+ var i,
+ xhr = options.xhr(),
+ id = ++xhrId;
+
+ // Open the socket
+ xhr.open( options.type, options.url, options.async, options.username, options.password );
+
+ // Apply custom fields if provided
+ if ( options.xhrFields ) {
+ for ( i in options.xhrFields ) {
+ xhr[ i ] = options.xhrFields[ i ];
+ }
+ }
+
+ // Override mime type if needed
+ if ( options.mimeType && xhr.overrideMimeType ) {
+ xhr.overrideMimeType( options.mimeType );
+ }
+
+ // X-Requested-With header
+ // For cross-domain requests, seeing as conditions for a preflight are
+ // akin to a jigsaw puzzle, we simply never set it to be sure.
+ // (it can always be set on a per-request basis or even using ajaxSetup)
+ // For same-domain requests, won't change header if already provided.
+ if ( !options.crossDomain && !headers["X-Requested-With"] ) {
+ headers["X-Requested-With"] = "XMLHttpRequest";
+ }
+
+ // Set headers
+ for ( i in headers ) {
+ // Support: IE<9
+ // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
+ // request header to a null-value.
+ //
+ // To keep consistent with other XHR implementations, cast the value
+ // to string and ignore `undefined`.
+ if ( headers[ i ] !== undefined ) {
+ xhr.setRequestHeader( i, headers[ i ] + "" );
+ }
+ }
+
+ // Do send the request
+ // This may raise an exception which is actually
+ // handled in jQuery.ajax (so no try/catch here)
+ xhr.send( ( options.hasContent && options.data ) || null );
+
+ // Listener
+ callback = function( _, isAbort ) {
+ var status, statusText, responses;
+
+ // Was never called and is aborted or complete
+ if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
+ // Clean up
+ delete xhrCallbacks[ id ];
+ callback = undefined;
+ xhr.onreadystatechange = jQuery.noop;
+
+ // Abort manually if needed
+ if ( isAbort ) {
+ if ( xhr.readyState !== 4 ) {
+ xhr.abort();
+ }
+ } else {
+ responses = {};
+ status = xhr.status;
+
+ // Support: IE<10
+ // Accessing binary-data responseText throws an exception
+ // (#11426)
+ if ( typeof xhr.responseText === "string" ) {
+ responses.text = xhr.responseText;
+ }
+
+ // Firefox throws an exception when accessing
+ // statusText for faulty cross-domain requests
+ try {
+ statusText = xhr.statusText;
+ } catch( e ) {
+ // We normalize with Webkit giving an empty statusText
+ statusText = "";
+ }
+
+ // Filter status for non standard behaviors
+
+ // If the request is local and we have data: assume a success
+ // (success with no data won't get notified, that's the best we
+ // can do given current implementations)
+ if ( !status && options.isLocal && !options.crossDomain ) {
+ status = responses.text ? 200 : 404;
+ // IE - #1450: sometimes returns 1223 when it should be 204
+ } else if ( status === 1223 ) {
+ status = 204;
+ }
+ }
+ }
+
+ // Call complete if needed
+ if ( responses ) {
+ complete( status, statusText, responses, xhr.getAllResponseHeaders() );
+ }
+ };
+
+ if ( !options.async ) {
+ // if we're in sync mode we fire the callback
+ callback();
+ } else if ( xhr.readyState === 4 ) {
+ // (IE6 & IE7) if it's in cache and has been
+ // retrieved directly we need to fire the callback
+ setTimeout( callback );
+ } else {
+ // Add to the list of active xhr callbacks
+ xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
+ }
+ },
+
+ abort: function() {
+ if ( callback ) {
+ callback( undefined, true );
+ }
+ }
+ };
+ }
+ });
+}
+
+// Functions to create xhrs
+function createStandardXHR() {
+ try {
+ return new window.XMLHttpRequest();
+ } catch( e ) {}
+}
+
+function createActiveXHR() {
+ try {
+ return new window.ActiveXObject( "Microsoft.XMLHTTP" );
+ } catch( e ) {}
+}
+
+
+
+
+// Install script dataType
+jQuery.ajaxSetup({
+ accepts: {
+ script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
+ },
+ contents: {
+ script: /(?:java|ecma)script/
+ },
+ converters: {
+ "text script": function( text ) {
+ jQuery.globalEval( text );
+ return text;
+ }
+ }
+});
+
+// Handle cache's special case and global
+jQuery.ajaxPrefilter( "script", function( s ) {
+ if ( s.cache === undefined ) {
+ s.cache = false;
+ }
+ if ( s.crossDomain ) {
+ s.type = "GET";
+ s.global = false;
+ }
+});
+
+// Bind script tag hack transport
+jQuery.ajaxTransport( "script", function(s) {
+
+ // This transport only deals with cross domain requests
+ if ( s.crossDomain ) {
+
+ var script,
+ head = document.head || jQuery("head")[0] || document.documentElement;
+
+ return {
+
+ send: function( _, callback ) {
+
+ script = document.createElement("script");
+
+ script.async = true;
+
+ if ( s.scriptCharset ) {
+ script.charset = s.scriptCharset;
+ }
+
+ script.src = s.url;
+
+ // Attach handlers for all browsers
+ script.onload = script.onreadystatechange = function( _, isAbort ) {
+
+ if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
+
+ // Handle memory leak in IE
+ script.onload = script.onreadystatechange = null;
+
+ // Remove the script
+ if ( script.parentNode ) {
+ script.parentNode.removeChild( script );
+ }
+
+ // Dereference the script
+ script = null;
+
+ // Callback if not abort
+ if ( !isAbort ) {
+ callback( 200, "success" );
+ }
+ }
+ };
+
+ // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
+ // Use native DOM manipulation to avoid our domManip AJAX trickery
+ head.insertBefore( script, head.firstChild );
+ },
+
+ abort: function() {
+ if ( script ) {
+ script.onload( undefined, true );
+ }
+ }
+ };
+ }
+});
+
+
+
+
+var oldCallbacks = [],
+ rjsonp = /(=)\?(?=&|$)|\?\?/;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+ jsonp: "callback",
+ jsonpCallback: function() {
+ var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
+ this[ callback ] = true;
+ return callback;
+ }
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+ var callbackName, overwritten, responseContainer,
+ jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
+ "url" :
+ typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
+ );
+
+ // Handle iff the expected data type is "jsonp" or we have a parameter to set
+ if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
+
+ // Get callback name, remembering preexisting value associated with it
+ callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
+ s.jsonpCallback() :
+ s.jsonpCallback;
+
+ // Insert callback into url or form data
+ if ( jsonProp ) {
+ s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
+ } else if ( s.jsonp !== false ) {
+ s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
+ }
+
+ // Use data converter to retrieve json after script execution
+ s.converters["script json"] = function() {
+ if ( !responseContainer ) {
+ jQuery.error( callbackName + " was not called" );
+ }
+ return responseContainer[ 0 ];
+ };
+
+ // force json dataType
+ s.dataTypes[ 0 ] = "json";
+
+ // Install callback
+ overwritten = window[ callbackName ];
+ window[ callbackName ] = function() {
+ responseContainer = arguments;
+ };
+
+ // Clean-up function (fires after converters)
+ jqXHR.always(function() {
+ // Restore preexisting value
+ window[ callbackName ] = overwritten;
+
+ // Save back as free
+ if ( s[ callbackName ] ) {
+ // make sure that re-using the options doesn't screw things around
+ s.jsonpCallback = originalSettings.jsonpCallback;
+
+ // save the callback name for future use
+ oldCallbacks.push( callbackName );
+ }
+
+ // Call if it was a function and we have a response
+ if ( responseContainer && jQuery.isFunction( overwritten ) ) {
+ overwritten( responseContainer[ 0 ] );
+ }
+
+ responseContainer = overwritten = undefined;
+ });
+
+ // Delegate to script
+ return "script";
+ }
+});
+
+
+
+
+// data: string of html
+// context (optional): If specified, the fragment will be created in this context, defaults to document
+// keepScripts (optional): If true, will include scripts passed in the html string
+jQuery.parseHTML = function( data, context, keepScripts ) {
+ if ( !data || typeof data !== "string" ) {
+ return null;
+ }
+ if ( typeof context === "boolean" ) {
+ keepScripts = context;
+ context = false;
+ }
+ context = context || document;
+
+ var parsed = rsingleTag.exec( data ),
+ scripts = !keepScripts && [];
+
+ // Single tag
+ if ( parsed ) {
+ return [ context.createElement( parsed[1] ) ];
+ }
+
+ parsed = jQuery.buildFragment( [ data ], context, scripts );
+
+ if ( scripts && scripts.length ) {
+ jQuery( scripts ).remove();
+ }
+
+ return jQuery.merge( [], parsed.childNodes );
+};
+
+
+// Keep a copy of the old load method
+var _load = jQuery.fn.load;
+
+/**
+ * Load a url into a page
+ */
+jQuery.fn.load = function( url, params, callback ) {
+ if ( typeof url !== "string" && _load ) {
+ return _load.apply( this, arguments );
+ }
+
+ var selector, response, type,
+ self = this,
+ off = url.indexOf(" ");
+
+ if ( off >= 0 ) {
+ selector = jQuery.trim( url.slice( off, url.length ) );
+ url = url.slice( 0, off );
+ }
+
+ // If it's a function
+ if ( jQuery.isFunction( params ) ) {
+
+ // We assume that it's the callback
+ callback = params;
+ params = undefined;
+
+ // Otherwise, build a param string
+ } else if ( params && typeof params === "object" ) {
+ type = "POST";
+ }
+
+ // If we have elements to modify, make the request
+ if ( self.length > 0 ) {
+ jQuery.ajax({
+ url: url,
+
+ // if "type" variable is undefined, then "GET" method will be used
+ type: type,
+ dataType: "html",
+ data: params
+ }).done(function( responseText ) {
+
+ // Save response for use in complete callback
+ response = arguments;
+
+ self.html( selector ?
+
+ // If a selector was specified, locate the right elements in a dummy div
+ // Exclude scripts to avoid IE 'Permission Denied' errors
+ jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
+
+ // Otherwise use the full result
+ responseText );
+
+ }).complete( callback && function( jqXHR, status ) {
+ self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
+ });
+ }
+
+ return this;
+};
+
+
+
+
+jQuery.expr.filters.animated = function( elem ) {
+ return jQuery.grep(jQuery.timers, function( fn ) {
+ return elem === fn.elem;
+ }).length;
+};
+
+
+
+
+
+var docElem = window.document.documentElement;
+
+/**
+ * Gets a window from an element
+ */
+function getWindow( elem ) {
+ return jQuery.isWindow( elem ) ?
+ elem :
+ elem.nodeType === 9 ?
+ elem.defaultView || elem.parentWindow :
+ false;
+}
+
+jQuery.offset = {
+ setOffset: function( elem, options, i ) {
+ var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
+ position = jQuery.css( elem, "position" ),
+ curElem = jQuery( elem ),
+ props = {};
+
+ // set position first, in-case top/left are set even on static elem
+ if ( position === "static" ) {
+ elem.style.position = "relative";
+ }
+
+ curOffset = curElem.offset();
+ curCSSTop = jQuery.css( elem, "top" );
+ curCSSLeft = jQuery.css( elem, "left" );
+ calculatePosition = ( position === "absolute" || position === "fixed" ) &&
+ jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
+
+ // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
+ if ( calculatePosition ) {
+ curPosition = curElem.position();
+ curTop = curPosition.top;
+ curLeft = curPosition.left;
+ } else {
+ curTop = parseFloat( curCSSTop ) || 0;
+ curLeft = parseFloat( curCSSLeft ) || 0;
+ }
+
+ if ( jQuery.isFunction( options ) ) {
+ options = options.call( elem, i, curOffset );
+ }
+
+ if ( options.top != null ) {
+ props.top = ( options.top - curOffset.top ) + curTop;
+ }
+ if ( options.left != null ) {
+ props.left = ( options.left - curOffset.left ) + curLeft;
+ }
+
+ if ( "using" in options ) {
+ options.using.call( elem, props );
+ } else {
+ curElem.css( props );
+ }
+ }
+};
+
+jQuery.fn.extend({
+ offset: function( options ) {
+ if ( arguments.length ) {
+ return options === undefined ?
+ this :
+ this.each(function( i ) {
+ jQuery.offset.setOffset( this, options, i );
+ });
+ }
+
+ var docElem, win,
+ box = { top: 0, left: 0 },
+ elem = this[ 0 ],
+ doc = elem && elem.ownerDocument;
+
+ if ( !doc ) {
+ return;
+ }
+
+ docElem = doc.documentElement;
+
+ // Make sure it's not a disconnected DOM node
+ if ( !jQuery.contains( docElem, elem ) ) {
+ return box;
+ }
+
+ // If we don't have gBCR, just use 0,0 rather than error
+ // BlackBerry 5, iOS 3 (original iPhone)
+ if ( typeof elem.getBoundingClientRect !== strundefined ) {
+ box = elem.getBoundingClientRect();
+ }
+ win = getWindow( doc );
+ return {
+ top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
+ left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
+ };
+ },
+
+ position: function() {
+ if ( !this[ 0 ] ) {
+ return;
+ }
+
+ var offsetParent, offset,
+ parentOffset = { top: 0, left: 0 },
+ elem = this[ 0 ];
+
+ // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
+ if ( jQuery.css( elem, "position" ) === "fixed" ) {
+ // we assume that getBoundingClientRect is available when computed position is fixed
+ offset = elem.getBoundingClientRect();
+ } else {
+ // Get *real* offsetParent
+ offsetParent = this.offsetParent();
+
+ // Get correct offsets
+ offset = this.offset();
+ if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
+ parentOffset = offsetParent.offset();
+ }
+
+ // Add offsetParent borders
+ parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
+ parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
+ }
+
+ // Subtract parent offsets and element margins
+ // note: when an element has margin: auto the offsetLeft and marginLeft
+ // are the same in Safari causing offset.left to incorrectly be 0
+ return {
+ top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
+ left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
+ };
+ },
+
+ offsetParent: function() {
+ return this.map(function() {
+ var offsetParent = this.offsetParent || docElem;
+
+ while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
+ offsetParent = offsetParent.offsetParent;
+ }
+ return offsetParent || docElem;
+ });
+ }
+});
+
+// Create scrollLeft and scrollTop methods
+jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
+ var top = /Y/.test( prop );
+
+ jQuery.fn[ method ] = function( val ) {
+ return access( this, function( elem, method, val ) {
+ var win = getWindow( elem );
+
+ if ( val === undefined ) {
+ return win ? (prop in win) ? win[ prop ] :
+ win.document.documentElement[ method ] :
+ elem[ method ];
+ }
+
+ if ( win ) {
+ win.scrollTo(
+ !top ? val : jQuery( win ).scrollLeft(),
+ top ? val : jQuery( win ).scrollTop()
+ );
+
+ } else {
+ elem[ method ] = val;
+ }
+ }, method, val, arguments.length, null );
+ };
+});
+
+// Add the top/left cssHooks using jQuery.fn.position
+// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
+// getComputedStyle returns percent when specified for top/left/bottom/right
+// rather than make the css module depend on the offset module, we just check for it here
+jQuery.each( [ "top", "left" ], function( i, prop ) {
+ jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
+ function( elem, computed ) {
+ if ( computed ) {
+ computed = curCSS( elem, prop );
+ // if curCSS returns percentage, fallback to offset
+ return rnumnonpx.test( computed ) ?
+ jQuery( elem ).position()[ prop ] + "px" :
+ computed;
+ }
+ }
+ );
+});
+
+
+// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
+jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
+ jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
+ // margin is only for outerHeight, outerWidth
+ jQuery.fn[ funcName ] = function( margin, value ) {
+ var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
+ extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
+
+ return access( this, function( elem, type, value ) {
+ var doc;
+
+ if ( jQuery.isWindow( elem ) ) {
+ // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
+ // isn't a whole lot we can do. See pull request at this URL for discussion:
+ // https://github.com/jquery/jquery/pull/764
+ return elem.document.documentElement[ "client" + name ];
+ }
+
+ // Get document width or height
+ if ( elem.nodeType === 9 ) {
+ doc = elem.documentElement;
+
+ // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
+ // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
+ return Math.max(
+ elem.body[ "scroll" + name ], doc[ "scroll" + name ],
+ elem.body[ "offset" + name ], doc[ "offset" + name ],
+ doc[ "client" + name ]
+ );
+ }
+
+ return value === undefined ?
+ // Get width or height on the element, requesting but not forcing parseFloat
+ jQuery.css( elem, type, extra ) :
+
+ // Set width or height on the element
+ jQuery.style( elem, type, value, extra );
+ }, type, chainable ? margin : undefined, chainable, null );
+ };
+ });
+});
+
+
+// The number of elements contained in the matched element set
+jQuery.fn.size = function() {
+ return this.length;
+};
+
+jQuery.fn.andSelf = jQuery.fn.addBack;
+
+
+
+
+// Register as a named AMD module, since jQuery can be concatenated with other
+// files that may use define, but not via a proper concatenation script that
+// understands anonymous AMD modules. A named AMD is safest and most robust
+// way to register. Lowercase jquery is used because AMD module names are
+// derived from file names, and jQuery is normally delivered in a lowercase
+// file name. Do this after creating the global so that if an AMD module wants
+// to call noConflict to hide this version of jQuery, it will work.
+
+// Note that for maximum portability, libraries that are not jQuery should
+// declare themselves as anonymous modules, and avoid setting a global if an
+// AMD loader is present. jQuery is a special case. For more information, see
+// https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
+
+if ( typeof define === "function" && define.amd ) {
+ define( "jquery", [], function() {
+ return jQuery;
+ });
+}
+
+
+
+
+var
+ // Map over jQuery in case of overwrite
+ _jQuery = window.jQuery,
+
+ // Map over the $ in case of overwrite
+ _$ = window.$;
+
+jQuery.noConflict = function( deep ) {
+ if ( window.$ === jQuery ) {
+ window.$ = _$;
+ }
+
+ if ( deep && window.jQuery === jQuery ) {
+ window.jQuery = _jQuery;
+ }
+
+ return jQuery;
+};
+
+// Expose jQuery and $ identifiers, even in
+// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
+// and CommonJS for browser emulators (#13566)
+if ( typeof noGlobal === strundefined ) {
+ window.jQuery = window.$ = jQuery;
+}
+
+
+
+
+return jQuery;
+
+}));
diff --git a/shrine-webclient/src/main/html/js-ext/jquerycode/jquery-1.11.1.min.js b/shrine-webclient/src/main/html/js-ext/jquerycode/jquery-1.11.1.min.js
new file mode 100644
index 000000000..ab28a2472
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/jquerycode/jquery-1.11.1.min.js
@@ -0,0 +1,4 @@
+/*! jQuery v1.11.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
+!function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l="1.11.1",m=function(a,b){return new m.fn.init(a,b)},n=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,o=/^-ms-/,p=/-([\da-z])/gi,q=function(a,b){return b.toUpperCase()};m.fn=m.prototype={jquery:l,constructor:m,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=m.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return m.each(this,a,b)},map:function(a){return this.pushStack(m.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},m.extend=m.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||m.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(e=arguments[h]))for(d in e)a=g[d],c=e[d],g!==c&&(j&&c&&(m.isPlainObject(c)||(b=m.isArray(c)))?(b?(b=!1,f=a&&m.isArray(a)?a:[]):f=a&&m.isPlainObject(a)?a:{},g[d]=m.extend(j,f,c)):void 0!==c&&(g[d]=c));return g},m.extend({expando:"jQuery"+(l+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===m.type(a)},isArray:Array.isArray||function(a){return"array"===m.type(a)},isWindow:function(a){return null!=a&&a==a.window},isNumeric:function(a){return!m.isArray(a)&&a-parseFloat(a)>=0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},isPlainObject:function(a){var b;if(!a||"object"!==m.type(a)||a.nodeType||m.isWindow(a))return!1;try{if(a.constructor&&!j.call(a,"constructor")&&!j.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}if(k.ownLast)for(b in a)return j.call(a,b);for(b in a);return void 0===b||j.call(a,b)},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(b){b&&m.trim(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(o,"ms-").replace(p,q)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=r(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(n,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(r(Object(a))?m.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){var d;if(b){if(g)return g.call(b,a,c);for(d=b.length,c=c?0>c?Math.max(0,d+c):c:0;d>c;c++)if(c in b&&b[c]===a)return c}return-1},merge:function(a,b){var c=+b.length,d=0,e=a.length;while(c>d)a[e++]=b[d++];if(c!==c)while(void 0!==b[d])a[e++]=b[d++];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=r(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(f=a[b],b=a,a=f),m.isFunction(a)?(c=d.call(arguments,2),e=function(){return a.apply(b||this,c.concat(d.call(arguments)))},e.guid=a.guid=a.guid||m.guid++,e):void 0},now:function(){return+new Date},support:k}),m.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function r(a){var b=a.length,c=m.type(a);return"function"===c||m.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var s=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);m.find=s,m.expr=s.selectors,m.expr[":"]=m.expr.pseudos,m.unique=s.uniqueSort,m.text=s.getText,m.isXMLDoc=s.isXML,m.contains=s.contains;var t=m.expr.match.needsContext,u=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,v=/^.[^:#\[\.,]*$/;function w(a,b,c){if(m.isFunction(b))return m.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return m.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(v.test(b))return m.filter(b,a,c);b=m.filter(b,a)}return m.grep(a,function(a){return m.inArray(a,b)>=0!==c})}m.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?m.find.matchesSelector(d,a)?[d]:[]:m.find.matches(a,m.grep(b,function(a){return 1===a.nodeType}))},m.fn.extend({find:function(a){var b,c=[],d=this,e=d.length;if("string"!=typeof a)return this.pushStack(m(a).filter(function(){for(b=0;e>b;b++)if(m.contains(d[b],this))return!0}));for(b=0;e>b;b++)m.find(a,d[b],c);return c=this.pushStack(e>1?m.unique(c):c),c.selector=this.selector?this.selector+" "+a:a,c},filter:function(a){return this.pushStack(w(this,a||[],!1))},not:function(a){return this.pushStack(w(this,a||[],!0))},is:function(a){return!!w(this,"string"==typeof a&&t.test(a)?m(a):a||[],!1).length}});var x,y=a.document,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=m.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a.charAt(0)&&">"===a.charAt(a.length-1)&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||x).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof m?b[0]:b,m.merge(this,m.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:y,!0)),u.test(c[1])&&m.isPlainObject(b))for(c in b)m.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}if(d=y.getElementById(c[2]),d&&d.parentNode){if(d.id!==c[2])return x.find(a);this.length=1,this[0]=d}return this.context=y,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):m.isFunction(a)?"undefined"!=typeof x.ready?x.ready(a):a(m):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),m.makeArray(a,this))};A.prototype=m.fn,x=m(y);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};m.extend({dir:function(a,b,c){var d=[],e=a[b];while(e&&9!==e.nodeType&&(void 0===c||1!==e.nodeType||!m(e).is(c)))1===e.nodeType&&d.push(e),e=e[b];return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),m.fn.extend({has:function(a){var b,c=m(a,this),d=c.length;return this.filter(function(){for(b=0;d>b;b++)if(m.contains(this,c[b]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=t.test(a)||"string"!=typeof a?m(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&m.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?m.unique(f):f)},index:function(a){return a?"string"==typeof a?m.inArray(this[0],m(a)):m.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(m.unique(m.merge(this.get(),m(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){do a=a[b];while(a&&1!==a.nodeType);return a}m.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return m.dir(a,"parentNode")},parentsUntil:function(a,b,c){return m.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return m.dir(a,"nextSibling")},prevAll:function(a){return m.dir(a,"previousSibling")},nextUntil:function(a,b,c){return m.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return m.dir(a,"previousSibling",c)},siblings:function(a){return m.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return m.sibling(a.firstChild)},contents:function(a){return m.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:m.merge([],a.childNodes)}},function(a,b){m.fn[a]=function(c,d){var e=m.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=m.filter(d,e)),this.length>1&&(C[a]||(e=m.unique(e)),B.test(a)&&(e=e.reverse())),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return m.each(a.match(E)||[],function(a,c){b[c]=!0}),b}m.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):m.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(c=a.memory&&l,d=!0,f=g||0,g=0,e=h.length,b=!0;h&&e>f;f++)if(h[f].apply(l[0],l[1])===!1&&a.stopOnFalse){c=!1;break}b=!1,h&&(i?i.length&&j(i.shift()):c?h=[]:k.disable())},k={add:function(){if(h){var d=h.length;!function f(b){m.each(b,function(b,c){var d=m.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&f(c)})}(arguments),b?e=h.length:c&&(g=d,j(c))}return this},remove:function(){return h&&m.each(arguments,function(a,c){var d;while((d=m.inArray(c,h,d))>-1)h.splice(d,1),b&&(e>=d&&e--,f>=d&&f--)}),this},has:function(a){return a?m.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],e=0,this},disable:function(){return h=i=c=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,c||k.disable(),this},locked:function(){return!i},fireWith:function(a,c){return!h||d&&!i||(c=c||[],c=[a,c.slice?c.slice():c],b?i.push(c):j(c)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!d}};return k},m.extend({Deferred:function(a){var b=[["resolve","done",m.Callbacks("once memory"),"resolved"],["reject","fail",m.Callbacks("once memory"),"rejected"],["notify","progress",m.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return m.Deferred(function(c){m.each(b,function(b,f){var g=m.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&m.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?m.extend(a,d):d}},e={};return d.pipe=d.then,m.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&m.isFunction(a.promise)?e:0,g=1===f?a:m.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&m.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;m.fn.ready=function(a){return m.ready.promise().done(a),this},m.extend({isReady:!1,readyWait:1,holdReady:function(a){a?m.readyWait++:m.ready(!0)},ready:function(a){if(a===!0?!--m.readyWait:!m.isReady){if(!y.body)return setTimeout(m.ready);m.isReady=!0,a!==!0&&--m.readyWait>0||(H.resolveWith(y,[m]),m.fn.triggerHandler&&(m(y).triggerHandler("ready"),m(y).off("ready")))}}});function I(){y.addEventListener?(y.removeEventListener("DOMContentLoaded",J,!1),a.removeEventListener("load",J,!1)):(y.detachEvent("onreadystatechange",J),a.detachEvent("onload",J))}function J(){(y.addEventListener||"load"===event.type||"complete"===y.readyState)&&(I(),m.ready())}m.ready.promise=function(b){if(!H)if(H=m.Deferred(),"complete"===y.readyState)setTimeout(m.ready);else if(y.addEventListener)y.addEventListener("DOMContentLoaded",J,!1),a.addEventListener("load",J,!1);else{y.attachEvent("onreadystatechange",J),a.attachEvent("onload",J);var c=!1;try{c=null==a.frameElement&&y.documentElement}catch(d){}c&&c.doScroll&&!function e(){if(!m.isReady){try{c.doScroll("left")}catch(a){return setTimeout(e,50)}I(),m.ready()}}()}return H.promise(b)};var K="undefined",L;for(L in m(k))break;k.ownLast="0"!==L,k.inlineBlockNeedsLayout=!1,m(function(){var a,b,c,d;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1",k.inlineBlockNeedsLayout=a=3===b.offsetWidth,a&&(c.style.zoom=1)),c.removeChild(d))}),function(){var a=y.createElement("div");if(null==k.deleteExpando){k.deleteExpando=!0;try{delete a.test}catch(b){k.deleteExpando=!1}}a=null}(),m.acceptData=function(a){var b=m.noData[(a.nodeName+" ").toLowerCase()],c=+a.nodeType||1;return 1!==c&&9!==c?!1:!b||b!==!0&&a.getAttribute("classid")===b};var M=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,N=/([A-Z])/g;function O(a,b,c){if(void 0===c&&1===a.nodeType){var d="data-"+b.replace(N,"-$1").toLowerCase();if(c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:M.test(c)?m.parseJSON(c):c}catch(e){}m.data(a,b,c)}else c=void 0}return c}function P(a){var b;for(b in a)if(("data"!==b||!m.isEmptyObject(a[b]))&&"toJSON"!==b)return!1;return!0}function Q(a,b,d,e){if(m.acceptData(a)){var f,g,h=m.expando,i=a.nodeType,j=i?m.cache:a,k=i?a[h]:a[h]&&h;
+if(k&&j[k]&&(e||j[k].data)||void 0!==d||"string"!=typeof b)return k||(k=i?a[h]=c.pop()||m.guid++:h),j[k]||(j[k]=i?{}:{toJSON:m.noop}),("object"==typeof b||"function"==typeof b)&&(e?j[k]=m.extend(j[k],b):j[k].data=m.extend(j[k].data,b)),g=j[k],e||(g.data||(g.data={}),g=g.data),void 0!==d&&(g[m.camelCase(b)]=d),"string"==typeof b?(f=g[b],null==f&&(f=g[m.camelCase(b)])):f=g,f}}function R(a,b,c){if(m.acceptData(a)){var d,e,f=a.nodeType,g=f?m.cache:a,h=f?a[m.expando]:m.expando;if(g[h]){if(b&&(d=c?g[h]:g[h].data)){m.isArray(b)?b=b.concat(m.map(b,m.camelCase)):b in d?b=[b]:(b=m.camelCase(b),b=b in d?[b]:b.split(" ")),e=b.length;while(e--)delete d[b[e]];if(c?!P(d):!m.isEmptyObject(d))return}(c||(delete g[h].data,P(g[h])))&&(f?m.cleanData([a],!0):k.deleteExpando||g!=g.window?delete g[h]:g[h]=null)}}}m.extend({cache:{},noData:{"applet ":!0,"embed ":!0,"object ":"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(a){return a=a.nodeType?m.cache[a[m.expando]]:a[m.expando],!!a&&!P(a)},data:function(a,b,c){return Q(a,b,c)},removeData:function(a,b){return R(a,b)},_data:function(a,b,c){return Q(a,b,c,!0)},_removeData:function(a,b){return R(a,b,!0)}}),m.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=m.data(f),1===f.nodeType&&!m._data(f,"parsedAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=m.camelCase(d.slice(5)),O(f,d,e[d])));m._data(f,"parsedAttrs",!0)}return e}return"object"==typeof a?this.each(function(){m.data(this,a)}):arguments.length>1?this.each(function(){m.data(this,a,b)}):f?O(f,a,m.data(f,a)):void 0},removeData:function(a){return this.each(function(){m.removeData(this,a)})}}),m.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=m._data(a,b),c&&(!d||m.isArray(c)?d=m._data(a,b,m.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=m.queue(a,b),d=c.length,e=c.shift(),f=m._queueHooks(a,b),g=function(){m.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return m._data(a,c)||m._data(a,c,{empty:m.Callbacks("once memory").add(function(){m._removeData(a,b+"queue"),m._removeData(a,c)})})}}),m.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?m.queue(this[0],a):void 0===b?this:this.each(function(){var c=m.queue(this,a,b);m._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&m.dequeue(this,a)})},dequeue:function(a){return this.each(function(){m.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=m.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=m._data(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var S=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=["Top","Right","Bottom","Left"],U=function(a,b){return a=b||a,"none"===m.css(a,"display")||!m.contains(a.ownerDocument,a)},V=m.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===m.type(c)){e=!0;for(h in c)m.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,m.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(m(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f},W=/^(?:checkbox|radio)$/i;!function(){var a=y.createElement("input"),b=y.createElement("div"),c=y.createDocumentFragment();if(b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",k.leadingWhitespace=3===b.firstChild.nodeType,k.tbody=!b.getElementsByTagName("tbody").length,k.htmlSerialize=!!b.getElementsByTagName("link").length,k.html5Clone="<:nav></:nav>"!==y.createElement("nav").cloneNode(!0).outerHTML,a.type="checkbox",a.checked=!0,c.appendChild(a),k.appendChecked=a.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue,c.appendChild(b),b.innerHTML="<input type='radio' checked='checked' name='t'/>",k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,k.noCloneEvent=!0,b.attachEvent&&(b.attachEvent("onclick",function(){k.noCloneEvent=!1}),b.cloneNode(!0).click()),null==k.deleteExpando){k.deleteExpando=!0;try{delete b.test}catch(d){k.deleteExpando=!1}}}(),function(){var b,c,d=y.createElement("div");for(b in{submit:!0,change:!0,focusin:!0})c="on"+b,(k[b+"Bubbles"]=c in a)||(d.setAttribute(c,"t"),k[b+"Bubbles"]=d.attributes[c].expando===!1);d=null}();var X=/^(?:input|select|textarea)$/i,Y=/^key/,Z=/^(?:mouse|pointer|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=/^([^.]*)(?:\.(.+)|)$/;function ab(){return!0}function bb(){return!1}function cb(){try{return y.activeElement}catch(a){}}m.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m._data(a);if(r){c.handler&&(i=c,c=i.handler,e=i.selector),c.guid||(c.guid=m.guid++),(g=r.events)||(g=r.events={}),(k=r.handle)||(k=r.handle=function(a){return typeof m===K||a&&m.event.triggered===a.type?void 0:m.event.dispatch.apply(k.elem,arguments)},k.elem=a),b=(b||"").match(E)||[""],h=b.length;while(h--)f=_.exec(b[h])||[],o=q=f[1],p=(f[2]||"").split(".").sort(),o&&(j=m.event.special[o]||{},o=(e?j.delegateType:j.bindType)||o,j=m.event.special[o]||{},l=m.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&m.expr.match.needsContext.test(e),namespace:p.join(".")},i),(n=g[o])||(n=g[o]=[],n.delegateCount=0,j.setup&&j.setup.call(a,d,p,k)!==!1||(a.addEventListener?a.addEventListener(o,k,!1):a.attachEvent&&a.attachEvent("on"+o,k))),j.add&&(j.add.call(a,l),l.handler.guid||(l.handler.guid=c.guid)),e?n.splice(n.delegateCount++,0,l):n.push(l),m.event.global[o]=!0);a=null}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,n,o,p,q,r=m.hasData(a)&&m._data(a);if(r&&(k=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=_.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=m.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,n=k[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),i=f=n.length;while(f--)g=n[f],!e&&q!==g.origType||c&&c.guid!==g.guid||h&&!h.test(g.namespace)||d&&d!==g.selector&&("**"!==d||!g.selector)||(n.splice(f,1),g.selector&&n.delegateCount--,l.remove&&l.remove.call(a,g));i&&!n.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||m.removeEvent(a,o,r.handle),delete k[o])}else for(o in k)m.event.remove(a,o+b[j],c,d,!0);m.isEmptyObject(k)&&(delete r.handle,m._removeData(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,l,n,o=[d||y],p=j.call(b,"type")?b.type:b,q=j.call(b,"namespace")?b.namespace.split("."):[];if(h=l=d=d||y,3!==d.nodeType&&8!==d.nodeType&&!$.test(p+m.event.triggered)&&(p.indexOf(".")>=0&&(q=p.split("."),p=q.shift(),q.sort()),g=p.indexOf(":")<0&&"on"+p,b=b[m.expando]?b:new m.Event(p,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=q.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:m.makeArray(c,[b]),k=m.event.special[p]||{},e||!k.trigger||k.trigger.apply(d,c)!==!1)){if(!e&&!k.noBubble&&!m.isWindow(d)){for(i=k.delegateType||p,$.test(i+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),l=h;l===(d.ownerDocument||y)&&o.push(l.defaultView||l.parentWindow||a)}n=0;while((h=o[n++])&&!b.isPropagationStopped())b.type=n>1?i:k.bindType||p,f=(m._data(h,"events")||{})[b.type]&&m._data(h,"handle"),f&&f.apply(h,c),f=g&&h[g],f&&f.apply&&m.acceptData(h)&&(b.result=f.apply(h,c),b.result===!1&&b.preventDefault());if(b.type=p,!e&&!b.isDefaultPrevented()&&(!k._default||k._default.apply(o.pop(),c)===!1)&&m.acceptData(d)&&g&&d[p]&&!m.isWindow(d)){l=d[g],l&&(d[g]=null),m.event.triggered=p;try{d[p]()}catch(r){}m.event.triggered=void 0,l&&(d[g]=l)}return b.result}},dispatch:function(a){a=m.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(m._data(this,"events")||{})[a.type]||[],k=m.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=m.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,g=0;while((e=f.handlers[g++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(e.namespace))&&(a.handleObj=e,a.data=e.data,c=((m.event.special[e.origType]||{}).handle||e.handler).apply(f.elem,i),void 0!==c&&(a.result=c)===!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(1===i.nodeType&&(i.disabled!==!0||"click"!==a.type)){for(e=[],f=0;h>f;f++)d=b[f],c=d.selector+" ",void 0===e[c]&&(e[c]=d.needsContext?m(c,this).index(i)>=0:m.find(c,this,null,[i]).length),e[c]&&e.push(d);e.length&&g.push({elem:i,handlers:e})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},fix:function(a){if(a[m.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=Z.test(e)?this.mouseHooks:Y.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new m.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=f.srcElement||y),3===a.target.nodeType&&(a.target=a.target.parentNode),a.metaKey=!!a.metaKey,g.filter?g.filter(a,f):a},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button,g=b.fromElement;return null==a.pageX&&null!=b.clientX&&(d=a.target.ownerDocument||y,e=d.documentElement,c=d.body,a.pageX=b.clientX+(e&&e.scrollLeft||c&&c.scrollLeft||0)-(e&&e.clientLeft||c&&c.clientLeft||0),a.pageY=b.clientY+(e&&e.scrollTop||c&&c.scrollTop||0)-(e&&e.clientTop||c&&c.clientTop||0)),!a.relatedTarget&&g&&(a.relatedTarget=g===a.target?b.toElement:g),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==cb()&&this.focus)try{return this.focus(),!1}catch(a){}},delegateType:"focusin"},blur:{trigger:function(){return this===cb()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return m.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):void 0},_default:function(a){return m.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=m.extend(new m.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?m.event.trigger(e,null,b):m.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},m.removeEvent=y.removeEventListener?function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)}:function(a,b,c){var d="on"+b;a.detachEvent&&(typeof a[d]===K&&(a[d]=null),a.detachEvent(d,c))},m.Event=function(a,b){return this instanceof m.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?ab:bb):this.type=a,b&&m.extend(this,b),this.timeStamp=a&&a.timeStamp||m.now(),void(this[m.expando]=!0)):new m.Event(a,b)},m.Event.prototype={isDefaultPrevented:bb,isPropagationStopped:bb,isImmediatePropagationStopped:bb,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=ab,a&&(a.preventDefault?a.preventDefault():a.returnValue=!1)},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=ab,a&&(a.stopPropagation&&a.stopPropagation(),a.cancelBubble=!0)},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=ab,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},m.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){m.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!m.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.submitBubbles||(m.event.special.submit={setup:function(){return m.nodeName(this,"form")?!1:void m.event.add(this,"click._submit keypress._submit",function(a){var b=a.target,c=m.nodeName(b,"input")||m.nodeName(b,"button")?b.form:void 0;c&&!m._data(c,"submitBubbles")&&(m.event.add(c,"submit._submit",function(a){a._submit_bubble=!0}),m._data(c,"submitBubbles",!0))})},postDispatch:function(a){a._submit_bubble&&(delete a._submit_bubble,this.parentNode&&!a.isTrigger&&m.event.simulate("submit",this.parentNode,a,!0))},teardown:function(){return m.nodeName(this,"form")?!1:void m.event.remove(this,"._submit")}}),k.changeBubbles||(m.event.special.change={setup:function(){return X.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(m.event.add(this,"propertychange._change",function(a){"checked"===a.originalEvent.propertyName&&(this._just_changed=!0)}),m.event.add(this,"click._change",function(a){this._just_changed&&!a.isTrigger&&(this._just_changed=!1),m.event.simulate("change",this,a,!0)})),!1):void m.event.add(this,"beforeactivate._change",function(a){var b=a.target;X.test(b.nodeName)&&!m._data(b,"changeBubbles")&&(m.event.add(b,"change._change",function(a){!this.parentNode||a.isSimulated||a.isTrigger||m.event.simulate("change",this.parentNode,a,!0)}),m._data(b,"changeBubbles",!0))})},handle:function(a){var b=a.target;return this!==b||a.isSimulated||a.isTrigger||"radio"!==b.type&&"checkbox"!==b.type?a.handleObj.handler.apply(this,arguments):void 0},teardown:function(){return m.event.remove(this,"._change"),!X.test(this.nodeName)}}),k.focusinBubbles||m.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){m.event.simulate(b,a.target,m.event.fix(a),!0)};m.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=m._data(d,b);e||d.addEventListener(a,c,!0),m._data(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=m._data(d,b)-1;e?m._data(d,b,e):(d.removeEventListener(a,c,!0),m._removeData(d,b))}}}),m.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(f in a)this.on(f,b,c,a[f],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=bb;else if(!d)return this;return 1===e&&(g=d,d=function(a){return m().off(a),g.apply(this,arguments)},d.guid=g.guid||(g.guid=m.guid++)),this.each(function(){m.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,m(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=bb),this.each(function(){m.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){m.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?m.event.trigger(a,b,c,!0):void 0}});function db(a){var b=eb.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}var eb="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",fb=/ jQuery\d+="(?:null|\d+)"/g,gb=new RegExp("<(?:"+eb+")[\\s/>]","i"),hb=/^\s+/,ib=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,jb=/<([\w:]+)/,kb=/<tbody/i,lb=/<|&#?\w+;/,mb=/<(?:script|style|link)/i,nb=/checked\s*(?:[^=]|=\s*.checked.)/i,ob=/^$|\/(?:java|ecma)script/i,pb=/^true\/(.*)/,qb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,rb={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:k.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},sb=db(y),tb=sb.appendChild(y.createElement("div"));rb.optgroup=rb.option,rb.tbody=rb.tfoot=rb.colgroup=rb.caption=rb.thead,rb.th=rb.td;function ub(a,b){var c,d,e=0,f=typeof a.getElementsByTagName!==K?a.getElementsByTagName(b||"*"):typeof a.querySelectorAll!==K?a.querySelectorAll(b||"*"):void 0;if(!f)for(f=[],c=a.childNodes||a;null!=(d=c[e]);e++)!b||m.nodeName(d,b)?f.push(d):m.merge(f,ub(d,b));return void 0===b||b&&m.nodeName(a,b)?m.merge([a],f):f}function vb(a){W.test(a.type)&&(a.defaultChecked=a.checked)}function wb(a,b){return m.nodeName(a,"table")&&m.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function xb(a){return a.type=(null!==m.find.attr(a,"type"))+"/"+a.type,a}function yb(a){var b=pb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function zb(a,b){for(var c,d=0;null!=(c=a[d]);d++)m._data(c,"globalEval",!b||m._data(b[d],"globalEval"))}function Ab(a,b){if(1===b.nodeType&&m.hasData(a)){var c,d,e,f=m._data(a),g=m._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;e>d;d++)m.event.add(b,c,h[c][d])}g.data&&(g.data=m.extend({},g.data))}}function Bb(a,b){var c,d,e;if(1===b.nodeType){if(c=b.nodeName.toLowerCase(),!k.noCloneEvent&&b[m.expando]){e=m._data(b);for(d in e.events)m.removeEvent(b,d,e.handle);b.removeAttribute(m.expando)}"script"===c&&b.text!==a.text?(xb(b).text=a.text,yb(b)):"object"===c?(b.parentNode&&(b.outerHTML=a.outerHTML),k.html5Clone&&a.innerHTML&&!m.trim(b.innerHTML)&&(b.innerHTML=a.innerHTML)):"input"===c&&W.test(a.type)?(b.defaultChecked=b.checked=a.checked,b.value!==a.value&&(b.value=a.value)):"option"===c?b.defaultSelected=b.selected=a.defaultSelected:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}}m.extend({clone:function(a,b,c){var d,e,f,g,h,i=m.contains(a.ownerDocument,a);if(k.html5Clone||m.isXMLDoc(a)||!gb.test("<"+a.nodeName+">")?f=a.cloneNode(!0):(tb.innerHTML=a.outerHTML,tb.removeChild(f=tb.firstChild)),!(k.noCloneEvent&&k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||m.isXMLDoc(a)))for(d=ub(f),h=ub(a),g=0;null!=(e=h[g]);++g)d[g]&&Bb(e,d[g]);if(b)if(c)for(h=h||ub(a),d=d||ub(f),g=0;null!=(e=h[g]);g++)Ab(e,d[g]);else Ab(a,f);return d=ub(f,"script"),d.length>0&&zb(d,!i&&ub(a,"script")),d=h=e=null,f},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,l,n=a.length,o=db(b),p=[],q=0;n>q;q++)if(f=a[q],f||0===f)if("object"===m.type(f))m.merge(p,f.nodeType?[f]:f);else if(lb.test(f)){h=h||o.appendChild(b.createElement("div")),i=(jb.exec(f)||["",""])[1].toLowerCase(),l=rb[i]||rb._default,h.innerHTML=l[1]+f.replace(ib,"<$1></$2>")+l[2],e=l[0];while(e--)h=h.lastChild;if(!k.leadingWhitespace&&hb.test(f)&&p.push(b.createTextNode(hb.exec(f)[0])),!k.tbody){f="table"!==i||kb.test(f)?"<table>"!==l[1]||kb.test(f)?0:h:h.firstChild,e=f&&f.childNodes.length;while(e--)m.nodeName(j=f.childNodes[e],"tbody")&&!j.childNodes.length&&f.removeChild(j)}m.merge(p,h.childNodes),h.textContent="";while(h.firstChild)h.removeChild(h.firstChild);h=o.lastChild}else p.push(b.createTextNode(f));h&&o.removeChild(h),k.appendChecked||m.grep(ub(p,"input"),vb),q=0;while(f=p[q++])if((!d||-1===m.inArray(f,d))&&(g=m.contains(f.ownerDocument,f),h=ub(o.appendChild(f),"script"),g&&zb(h),c)){e=0;while(f=h[e++])ob.test(f.type||"")&&c.push(f)}return h=null,o},cleanData:function(a,b){for(var d,e,f,g,h=0,i=m.expando,j=m.cache,l=k.deleteExpando,n=m.event.special;null!=(d=a[h]);h++)if((b||m.acceptData(d))&&(f=d[i],g=f&&j[f])){if(g.events)for(e in g.events)n[e]?m.event.remove(d,e):m.removeEvent(d,e,g.handle);j[f]&&(delete j[f],l?delete d[i]:typeof d.removeAttribute!==K?d.removeAttribute(i):d[i]=null,c.push(f))}}}),m.fn.extend({text:function(a){return V(this,function(a){return void 0===a?m.text(this):this.empty().append((this[0]&&this[0].ownerDocument||y).createTextNode(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=wb(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=wb(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?m.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||m.cleanData(ub(c)),c.parentNode&&(b&&m.contains(c.ownerDocument,c)&&zb(ub(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++){1===a.nodeType&&m.cleanData(ub(a,!1));while(a.firstChild)a.removeChild(a.firstChild);a.options&&m.nodeName(a,"select")&&(a.options.length=0)}return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return m.clone(this,a,b)})},html:function(a){return V(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a)return 1===b.nodeType?b.innerHTML.replace(fb,""):void 0;if(!("string"!=typeof a||mb.test(a)||!k.htmlSerialize&&gb.test(a)||!k.leadingWhitespace&&hb.test(a)||rb[(jb.exec(a)||["",""])[1].toLowerCase()])){a=a.replace(ib,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(m.cleanData(ub(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,m.cleanData(ub(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,n=this,o=l-1,p=a[0],q=m.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&nb.test(p))return this.each(function(c){var d=n.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(i=m.buildFragment(a,this[0].ownerDocument,!1,this),c=i.firstChild,1===i.childNodes.length&&(i=c),c)){for(g=m.map(ub(i,"script"),xb),f=g.length;l>j;j++)d=i,j!==o&&(d=m.clone(d,!0,!0),f&&m.merge(g,ub(d,"script"))),b.call(this[j],d,j);if(f)for(h=g[g.length-1].ownerDocument,m.map(g,yb),j=0;f>j;j++)d=g[j],ob.test(d.type||"")&&!m._data(d,"globalEval")&&m.contains(h,d)&&(d.src?m._evalUrl&&m._evalUrl(d.src):m.globalEval((d.text||d.textContent||d.innerHTML||"").replace(qb,"")));i=c=null}return this}}),m.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){m.fn[a]=function(a){for(var c,d=0,e=[],g=m(a),h=g.length-1;h>=d;d++)c=d===h?this:this.clone(!0),m(g[d])[b](c),f.apply(e,c.get());return this.pushStack(e)}});var Cb,Db={};function Eb(b,c){var d,e=m(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:m.css(e[0],"display");return e.detach(),f}function Fb(a){var b=y,c=Db[a];return c||(c=Eb(a,b),"none"!==c&&c||(Cb=(Cb||m("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=(Cb[0].contentWindow||Cb[0].contentDocument).document,b.write(),b.close(),c=Eb(a,b),Cb.detach()),Db[a]=c),c}!function(){var a;k.shrinkWrapBlocks=function(){if(null!=a)return a;a=!1;var b,c,d;return c=y.getElementsByTagName("body")[0],c&&c.style?(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),typeof b.style.zoom!==K&&(b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:1px;width:1px;zoom:1",b.appendChild(y.createElement("div")).style.width="5px",a=3!==b.offsetWidth),c.removeChild(d),a):void 0}}();var Gb=/^margin/,Hb=new RegExp("^("+S+")(?!px)[a-z%]+$","i"),Ib,Jb,Kb=/^(top|right|bottom|left)$/;a.getComputedStyle?(Ib=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c.getPropertyValue(b)||c[b]:void 0,c&&(""!==g||m.contains(a.ownerDocument,a)||(g=m.style(a,b)),Hb.test(g)&&Gb.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0===g?g:g+""}):y.documentElement.currentStyle&&(Ib=function(a){return a.currentStyle},Jb=function(a,b,c){var d,e,f,g,h=a.style;return c=c||Ib(a),g=c?c[b]:void 0,null==g&&h&&h[b]&&(g=h[b]),Hb.test(g)&&!Kb.test(b)&&(d=h.left,e=a.runtimeStyle,f=e&&e.left,f&&(e.left=a.currentStyle.left),h.left="fontSize"===b?"1em":g,g=h.pixelLeft+"px",h.left=d,f&&(e.left=f)),void 0===g?g:g+""||"auto"});function Lb(a,b){return{get:function(){var c=a();if(null!=c)return c?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d,e,f,g,h;if(b=y.createElement("div"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=d&&d.style){c.cssText="float:left;opacity:.5",k.opacity="0.5"===c.opacity,k.cssFloat=!!c.cssFloat,b.style.backgroundClip="content-box",b.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===b.style.backgroundClip,k.boxSizing=""===c.boxSizing||""===c.MozBoxSizing||""===c.WebkitBoxSizing,m.extend(k,{reliableHiddenOffsets:function(){return null==g&&i(),g},boxSizingReliable:function(){return null==f&&i(),f},pixelPosition:function(){return null==e&&i(),e},reliableMarginRight:function(){return null==h&&i(),h}});function i(){var b,c,d,i;c=y.getElementsByTagName("body")[0],c&&c.style&&(b=y.createElement("div"),d=y.createElement("div"),d.style.cssText="position:absolute;border:0;width:0;height:0;top:0;left:-9999px",c.appendChild(d).appendChild(b),b.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",e=f=!1,h=!0,a.getComputedStyle&&(e="1%"!==(a.getComputedStyle(b,null)||{}).top,f="4px"===(a.getComputedStyle(b,null)||{width:"4px"}).width,i=b.appendChild(y.createElement("div")),i.style.cssText=b.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",i.style.marginRight=i.style.width="0",b.style.width="1px",h=!parseFloat((a.getComputedStyle(i,null)||{}).marginRight)),b.innerHTML="<table><tr><td></td><td>t</td></tr></table>",i=b.getElementsByTagName("td"),i[0].style.cssText="margin:0;border:0;padding:0;display:none",g=0===i[0].offsetHeight,g&&(i[0].style.display="",i[1].style.display="none",g=0===i[0].offsetHeight),c.removeChild(d))}}}(),m.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var Mb=/alpha\([^)]*\)/i,Nb=/opacity\s*=\s*([^)]*)/,Ob=/^(none|table(?!-c[ea]).+)/,Pb=new RegExp("^("+S+")(.*)$","i"),Qb=new RegExp("^([+-])=("+S+")","i"),Rb={position:"absolute",visibility:"hidden",display:"block"},Sb={letterSpacing:"0",fontWeight:"400"},Tb=["Webkit","O","Moz","ms"];function Ub(a,b){if(b in a)return b;var c=b.charAt(0).toUpperCase()+b.slice(1),d=b,e=Tb.length;while(e--)if(b=Tb[e]+c,b in a)return b;return d}function Vb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=m._data(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&U(d)&&(f[g]=m._data(d,"olddisplay",Fb(d.nodeName)))):(e=U(d),(c&&"none"!==c||!e)&&m._data(d,"olddisplay",e?c:m.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}function Wb(a,b,c){var d=Pb.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Xb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=m.css(a,c+T[f],!0,e)),d?("content"===c&&(g-=m.css(a,"padding"+T[f],!0,e)),"margin"!==c&&(g-=m.css(a,"border"+T[f]+"Width",!0,e))):(g+=m.css(a,"padding"+T[f],!0,e),"padding"!==c&&(g+=m.css(a,"border"+T[f]+"Width",!0,e)));return g}function Yb(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=Ib(a),g=k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=Jb(a,b,f),(0>e||null==e)&&(e=a.style[b]),Hb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Xb(a,b,c||(g?"border":"content"),d,f)+"px"}m.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=Jb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":k.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=m.camelCase(b),i=a.style;if(b=m.cssProps[h]||(m.cssProps[h]=Ub(i,h)),g=m.cssHooks[b]||m.cssHooks[h],void 0===c)return g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b];if(f=typeof c,"string"===f&&(e=Qb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(m.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||m.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),!(g&&"set"in g&&void 0===(c=g.set(a,c,d)))))try{i[b]=c}catch(j){}}},css:function(a,b,c,d){var e,f,g,h=m.camelCase(b);return b=m.cssProps[h]||(m.cssProps[h]=Ub(a.style,h)),g=m.cssHooks[b]||m.cssHooks[h],g&&"get"in g&&(f=g.get(a,!0,c)),void 0===f&&(f=Jb(a,b,d)),"normal"===f&&b in Sb&&(f=Sb[b]),""===c||c?(e=parseFloat(f),c===!0||m.isNumeric(e)?e||0:f):f}}),m.each(["height","width"],function(a,b){m.cssHooks[b]={get:function(a,c,d){return c?Ob.test(m.css(a,"display"))&&0===a.offsetWidth?m.swap(a,Rb,function(){return Yb(a,b,d)}):Yb(a,b,d):void 0},set:function(a,c,d){var e=d&&Ib(a);return Wb(a,c,d?Xb(a,b,d,k.boxSizing&&"border-box"===m.css(a,"boxSizing",!1,e),e):0)}}}),k.opacity||(m.cssHooks.opacity={get:function(a,b){return Nb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=m.isNumeric(b)?"alpha(opacity="+100*b+")":"",f=d&&d.filter||c.filter||"";c.zoom=1,(b>=1||""===b)&&""===m.trim(f.replace(Mb,""))&&c.removeAttribute&&(c.removeAttribute("filter"),""===b||d&&!d.filter)||(c.filter=Mb.test(f)?f.replace(Mb,e):f+" "+e)}}),m.cssHooks.marginRight=Lb(k.reliableMarginRight,function(a,b){return b?m.swap(a,{display:"inline-block"},Jb,[a,"marginRight"]):void 0}),m.each({margin:"",padding:"",border:"Width"},function(a,b){m.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+T[d]+b]=f[d]||f[d-2]||f[0];return e}},Gb.test(a)||(m.cssHooks[a+b].set=Wb)}),m.fn.extend({css:function(a,b){return V(this,function(a,b,c){var d,e,f={},g=0;if(m.isArray(b)){for(d=Ib(a),e=b.length;e>g;g++)f[b[g]]=m.css(a,b[g],!1,d);return f}return void 0!==c?m.style(a,b,c):m.css(a,b)},a,b,arguments.length>1)},show:function(){return Vb(this,!0)},hide:function(){return Vb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){U(this)?m(this).show():m(this).hide()})}});function Zb(a,b,c,d,e){return new Zb.prototype.init(a,b,c,d,e)}m.Tween=Zb,Zb.prototype={constructor:Zb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(m.cssNumber[c]?"":"px")
+},cur:function(){var a=Zb.propHooks[this.prop];return a&&a.get?a.get(this):Zb.propHooks._default.get(this)},run:function(a){var b,c=Zb.propHooks[this.prop];return this.pos=b=this.options.duration?m.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Zb.propHooks._default.set(this),this}},Zb.prototype.init.prototype=Zb.prototype,Zb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=m.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){m.fx.step[a.prop]?m.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[m.cssProps[a.prop]]||m.cssHooks[a.prop])?m.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Zb.propHooks.scrollTop=Zb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},m.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},m.fx=Zb.prototype.init,m.fx.step={};var $b,_b,ac=/^(?:toggle|show|hide)$/,bc=new RegExp("^(?:([+-])=|)("+S+")([a-z%]*)$","i"),cc=/queueHooks$/,dc=[ic],ec={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=bc.exec(b),f=e&&e[3]||(m.cssNumber[a]?"":"px"),g=(m.cssNumber[a]||"px"!==f&&+d)&&bc.exec(m.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,m.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function fc(){return setTimeout(function(){$b=void 0}),$b=m.now()}function gc(a,b){var c,d={height:a},e=0;for(b=b?1:0;4>e;e+=2-b)c=T[e],d["margin"+c]=d["padding"+c]=a;return b&&(d.opacity=d.width=a),d}function hc(a,b,c){for(var d,e=(ec[b]||[]).concat(ec["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function ic(a,b,c){var d,e,f,g,h,i,j,l,n=this,o={},p=a.style,q=a.nodeType&&U(a),r=m._data(a,"fxshow");c.queue||(h=m._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,n.always(function(){n.always(function(){h.unqueued--,m.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[p.overflow,p.overflowX,p.overflowY],j=m.css(a,"display"),l="none"===j?m._data(a,"olddisplay")||Fb(a.nodeName):j,"inline"===l&&"none"===m.css(a,"float")&&(k.inlineBlockNeedsLayout&&"inline"!==Fb(a.nodeName)?p.zoom=1:p.display="inline-block")),c.overflow&&(p.overflow="hidden",k.shrinkWrapBlocks()||n.always(function(){p.overflow=c.overflow[0],p.overflowX=c.overflow[1],p.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],ac.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(q?"hide":"show")){if("show"!==e||!r||void 0===r[d])continue;q=!0}o[d]=r&&r[d]||m.style(a,d)}else j=void 0;if(m.isEmptyObject(o))"inline"===("none"===j?Fb(a.nodeName):j)&&(p.display=j);else{r?"hidden"in r&&(q=r.hidden):r=m._data(a,"fxshow",{}),f&&(r.hidden=!q),q?m(a).show():n.done(function(){m(a).hide()}),n.done(function(){var b;m._removeData(a,"fxshow");for(b in o)m.style(a,b,o[b])});for(d in o)g=hc(q?r[d]:0,d,n),d in r||(r[d]=g.start,q&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function jc(a,b){var c,d,e,f,g;for(c in a)if(d=m.camelCase(c),e=b[d],f=a[c],m.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=m.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function kc(a,b,c){var d,e,f=0,g=dc.length,h=m.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=$b||fc(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:m.extend({},b),opts:m.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:$b||fc(),duration:c.duration,tweens:[],createTween:function(b,c){var d=m.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(jc(k,j.opts.specialEasing);g>f;f++)if(d=dc[f].call(j,a,k,j.opts))return d;return m.map(k,hc,j),m.isFunction(j.opts.start)&&j.opts.start.call(a,j),m.fx.timer(m.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}m.Animation=m.extend(kc,{tweener:function(a,b){m.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],ec[c]=ec[c]||[],ec[c].unshift(b)},prefilter:function(a,b){b?dc.unshift(a):dc.push(a)}}),m.speed=function(a,b,c){var d=a&&"object"==typeof a?m.extend({},a):{complete:c||!c&&b||m.isFunction(a)&&a,duration:a,easing:c&&b||b&&!m.isFunction(b)&&b};return d.duration=m.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in m.fx.speeds?m.fx.speeds[d.duration]:m.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){m.isFunction(d.old)&&d.old.call(this),d.queue&&m.dequeue(this,d.queue)},d},m.fn.extend({fadeTo:function(a,b,c,d){return this.filter(U).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=m.isEmptyObject(a),f=m.speed(b,c,d),g=function(){var b=kc(this,m.extend({},a),f);(e||m._data(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=m.timers,g=m._data(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&cc.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&m.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=m._data(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=m.timers,g=d?d.length:0;for(c.finish=!0,m.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),m.each(["toggle","show","hide"],function(a,b){var c=m.fn[b];m.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(gc(b,!0),a,d,e)}}),m.each({slideDown:gc("show"),slideUp:gc("hide"),slideToggle:gc("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){m.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),m.timers=[],m.fx.tick=function(){var a,b=m.timers,c=0;for($b=m.now();c<b.length;c++)a=b[c],a()||b[c]!==a||b.splice(c--,1);b.length||m.fx.stop(),$b=void 0},m.fx.timer=function(a){m.timers.push(a),a()?m.fx.start():m.timers.pop()},m.fx.interval=13,m.fx.start=function(){_b||(_b=setInterval(m.fx.tick,m.fx.interval))},m.fx.stop=function(){clearInterval(_b),_b=null},m.fx.speeds={slow:600,fast:200,_default:400},m.fn.delay=function(a,b){return a=m.fx?m.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a,b,c,d,e;b=y.createElement("div"),b.setAttribute("className","t"),b.innerHTML=" <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",d=b.getElementsByTagName("a")[0],c=y.createElement("select"),e=c.appendChild(y.createElement("option")),a=b.getElementsByTagName("input")[0],d.style.cssText="top:1px",k.getSetAttribute="t"!==b.className,k.style=/top/.test(d.getAttribute("style")),k.hrefNormalized="/a"===d.getAttribute("href"),k.checkOn=!!a.value,k.optSelected=e.selected,k.enctype=!!y.createElement("form").enctype,c.disabled=!0,k.optDisabled=!e.disabled,a=y.createElement("input"),a.setAttribute("value",""),k.input=""===a.getAttribute("value"),a.value="t",a.setAttribute("type","radio"),k.radioValue="t"===a.value}();var lc=/\r/g;m.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=m.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,m(this).val()):a,null==e?e="":"number"==typeof e?e+="":m.isArray(e)&&(e=m.map(e,function(a){return null==a?"":a+""})),b=m.valHooks[this.type]||m.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=m.valHooks[e.type]||m.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(lc,""):null==c?"":c)}}}),m.extend({valHooks:{option:{get:function(a){var b=m.find.attr(a,"value");return null!=b?b:m.trim(m.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&m.nodeName(c.parentNode,"optgroup"))){if(b=m(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=m.makeArray(b),g=e.length;while(g--)if(d=e[g],m.inArray(m.valHooks.option.get(d),f)>=0)try{d.selected=c=!0}catch(h){d.scrollHeight}else d.selected=!1;return c||(a.selectedIndex=-1),e}}}}),m.each(["radio","checkbox"],function(){m.valHooks[this]={set:function(a,b){return m.isArray(b)?a.checked=m.inArray(m(a).val(),b)>=0:void 0}},k.checkOn||(m.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var mc,nc,oc=m.expr.attrHandle,pc=/^(?:checked|selected)$/i,qc=k.getSetAttribute,rc=k.input;m.fn.extend({attr:function(a,b){return V(this,m.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){m.removeAttr(this,a)})}}),m.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===K?m.prop(a,b,c):(1===f&&m.isXMLDoc(a)||(b=b.toLowerCase(),d=m.attrHooks[b]||(m.expr.match.bool.test(b)?nc:mc)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=m.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void m.removeAttr(a,b))},removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=m.propFix[c]||c,m.expr.match.bool.test(c)?rc&&qc||!pc.test(c)?a[d]=!1:a[m.camelCase("default-"+c)]=a[d]=!1:m.attr(a,c,""),a.removeAttribute(qc?c:d)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&m.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),nc={set:function(a,b,c){return b===!1?m.removeAttr(a,c):rc&&qc||!pc.test(c)?a.setAttribute(!qc&&m.propFix[c]||c,c):a[m.camelCase("default-"+c)]=a[c]=!0,c}},m.each(m.expr.match.bool.source.match(/\w+/g),function(a,b){var c=oc[b]||m.find.attr;oc[b]=rc&&qc||!pc.test(b)?function(a,b,d){var e,f;return d||(f=oc[b],oc[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,oc[b]=f),e}:function(a,b,c){return c?void 0:a[m.camelCase("default-"+b)]?b.toLowerCase():null}}),rc&&qc||(m.attrHooks.value={set:function(a,b,c){return m.nodeName(a,"input")?void(a.defaultValue=b):mc&&mc.set(a,b,c)}}),qc||(mc={set:function(a,b,c){var d=a.getAttributeNode(c);return d||a.setAttributeNode(d=a.ownerDocument.createAttribute(c)),d.value=b+="","value"===c||b===a.getAttribute(c)?b:void 0}},oc.id=oc.name=oc.coords=function(a,b,c){var d;return c?void 0:(d=a.getAttributeNode(b))&&""!==d.value?d.value:null},m.valHooks.button={get:function(a,b){var c=a.getAttributeNode(b);return c&&c.specified?c.value:void 0},set:mc.set},m.attrHooks.contenteditable={set:function(a,b,c){mc.set(a,""===b?!1:b,c)}},m.each(["width","height"],function(a,b){m.attrHooks[b]={set:function(a,c){return""===c?(a.setAttribute(b,"auto"),c):void 0}}})),k.style||(m.attrHooks.style={get:function(a){return a.style.cssText||void 0},set:function(a,b){return a.style.cssText=b+""}});var sc=/^(?:input|select|textarea|button|object)$/i,tc=/^(?:a|area)$/i;m.fn.extend({prop:function(a,b){return V(this,m.prop,a,b,arguments.length>1)},removeProp:function(a){return a=m.propFix[a]||a,this.each(function(){try{this[a]=void 0,delete this[a]}catch(b){}})}}),m.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!m.isXMLDoc(a),f&&(b=m.propFix[b]||b,e=m.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=m.find.attr(a,"tabindex");return b?parseInt(b,10):sc.test(a.nodeName)||tc.test(a.nodeName)&&a.href?0:-1}}}}),k.hrefNormalized||m.each(["href","src"],function(a,b){m.propHooks[b]={get:function(a){return a.getAttribute(b,4)}}}),k.optSelected||(m.propHooks.selected={get:function(a){var b=a.parentNode;return b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex),null}}),m.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){m.propFix[this.toLowerCase()]=this}),k.enctype||(m.propFix.enctype="encoding");var uc=/[\t\r\n\f]/g;m.fn.extend({addClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j="string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).addClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=m.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0,i=this.length,j=0===arguments.length||"string"==typeof a&&a;if(m.isFunction(a))return this.each(function(b){m(this).removeClass(a.call(this,b,this.className))});if(j)for(b=(a||"").match(E)||[];i>h;h++)if(c=this[h],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(uc," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?m.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(m.isFunction(a)?function(c){m(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=m(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===K||"boolean"===c)&&(this.className&&m._data(this,"__className__",this.className),this.className=this.className||a===!1?"":m._data(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(uc," ").indexOf(b)>=0)return!0;return!1}}),m.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){m.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),m.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var vc=m.now(),wc=/\?/,xc=/(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;m.parseJSON=function(b){if(a.JSON&&a.JSON.parse)return a.JSON.parse(b+"");var c,d=null,e=m.trim(b+"");return e&&!m.trim(e.replace(xc,function(a,b,e,f){return c&&b&&(d=0),0===d?a:(c=e||b,d+=!f-!e,"")}))?Function("return "+e)():m.error("Invalid JSON: "+b)},m.parseXML=function(b){var c,d;if(!b||"string"!=typeof b)return null;try{a.DOMParser?(d=new DOMParser,c=d.parseFromString(b,"text/xml")):(c=new ActiveXObject("Microsoft.XMLDOM"),c.async="false",c.loadXML(b))}catch(e){c=void 0}return c&&c.documentElement&&!c.getElementsByTagName("parsererror").length||m.error("Invalid XML: "+b),c};var yc,zc,Ac=/#.*$/,Bc=/([?&])_=[^&]*/,Cc=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Dc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Ec=/^(?:GET|HEAD)$/,Fc=/^\/\//,Gc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Hc={},Ic={},Jc="*/".concat("*");try{zc=location.href}catch(Kc){zc=y.createElement("a"),zc.href="",zc=zc.href}yc=Gc.exec(zc.toLowerCase())||[];function Lc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(m.isFunction(c))while(d=f[e++])"+"===d.charAt(0)?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Mc(a,b,c,d){var e={},f=a===Ic;function g(h){var i;return e[h]=!0,m.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Nc(a,b){var c,d,e=m.ajaxSettings.flatOptions||{};for(d in b)void 0!==b[d]&&((e[d]?a:c||(c={}))[d]=b[d]);return c&&m.extend(!0,a,c),a}function Oc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===e&&(e=a.mimeType||b.getResponseHeader("Content-Type"));if(e)for(g in h)if(h[g]&&h[g].test(e)){i.unshift(g);break}if(i[0]in c)f=i[0];else{for(g in c){if(!i[0]||a.converters[g+" "+i[0]]){f=g;break}d||(d=g)}f=f||d}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function Pc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}m.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:zc,type:"GET",isLocal:Dc.test(yc[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Jc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":m.parseJSON,"text xml":m.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Nc(Nc(a,m.ajaxSettings),b):Nc(m.ajaxSettings,a)},ajaxPrefilter:Lc(Hc),ajaxTransport:Lc(Ic),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=m.ajaxSetup({},b),l=k.context||k,n=k.context&&(l.nodeType||l.jquery)?m(l):m.event,o=m.Deferred(),p=m.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!j){j={};while(b=Cc.exec(f))j[b[1].toLowerCase()]=b[2]}b=j[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?f:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return i&&i.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||zc)+"").replace(Ac,"").replace(Fc,yc[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=m.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(c=Gc.exec(k.url.toLowerCase()),k.crossDomain=!(!c||c[1]===yc[1]&&c[2]===yc[2]&&(c[3]||("http:"===c[1]?"80":"443"))===(yc[3]||("http:"===yc[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=m.param(k.data,k.traditional)),Mc(Hc,k,b,v),2===t)return v;h=k.global,h&&0===m.active++&&m.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!Ec.test(k.type),e=k.url,k.hasContent||(k.data&&(e=k.url+=(wc.test(e)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=Bc.test(e)?e.replace(Bc,"$1_="+vc++):e+(wc.test(e)?"&":"?")+"_="+vc++)),k.ifModified&&(m.lastModified[e]&&v.setRequestHeader("If-Modified-Since",m.lastModified[e]),m.etag[e]&&v.setRequestHeader("If-None-Match",m.etag[e])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+Jc+"; q=0.01":""):k.accepts["*"]);for(d in k.headers)v.setRequestHeader(d,k.headers[d]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(d in{success:1,error:1,complete:1})v[d](k[d]);if(i=Mc(Ic,k,b,v)){v.readyState=1,h&&n.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,i.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,c,d){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),i=void 0,f=d||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,c&&(u=Oc(k,v,c)),u=Pc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(m.lastModified[e]=w),w=v.getResponseHeader("etag"),w&&(m.etag[e]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,h&&n.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),h&&(n.trigger("ajaxComplete",[v,k]),--m.active||m.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return m.get(a,b,c,"json")},getScript:function(a,b){return m.get(a,void 0,b,"script")}}),m.each(["get","post"],function(a,b){m[b]=function(a,c,d,e){return m.isFunction(c)&&(e=e||d,d=c,c=void 0),m.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),m.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){m.fn[b]=function(a){return this.on(b,a)}}),m._evalUrl=function(a){return m.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},m.fn.extend({wrapAll:function(a){if(m.isFunction(a))return this.each(function(b){m(this).wrapAll(a.call(this,b))});if(this[0]){var b=m(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&1===a.firstChild.nodeType)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return this.each(m.isFunction(a)?function(b){m(this).wrapInner(a.call(this,b))}:function(){var b=m(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=m.isFunction(a);return this.each(function(c){m(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){m.nodeName(this,"body")||m(this).replaceWith(this.childNodes)}).end()}}),m.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0||!k.reliableHiddenOffsets()&&"none"===(a.style&&a.style.display||m.css(a,"display"))},m.expr.filters.visible=function(a){return!m.expr.filters.hidden(a)};var Qc=/%20/g,Rc=/\[\]$/,Sc=/\r?\n/g,Tc=/^(?:submit|button|image|reset|file)$/i,Uc=/^(?:input|select|textarea|keygen)/i;function Vc(a,b,c,d){var e;if(m.isArray(b))m.each(b,function(b,e){c||Rc.test(a)?d(a,e):Vc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==m.type(b))d(a,b);else for(e in b)Vc(a+"["+e+"]",b[e],c,d)}m.param=function(a,b){var c,d=[],e=function(a,b){b=m.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=m.ajaxSettings&&m.ajaxSettings.traditional),m.isArray(a)||a.jquery&&!m.isPlainObject(a))m.each(a,function(){e(this.name,this.value)});else for(c in a)Vc(c,a[c],b,e);return d.join("&").replace(Qc,"+")},m.fn.extend({serialize:function(){return m.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=m.prop(this,"elements");return a?m.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!m(this).is(":disabled")&&Uc.test(this.nodeName)&&!Tc.test(a)&&(this.checked||!W.test(a))}).map(function(a,b){var c=m(this).val();return null==c?null:m.isArray(c)?m.map(c,function(a){return{name:b.name,value:a.replace(Sc,"\r\n")}}):{name:b.name,value:c.replace(Sc,"\r\n")}}).get()}}),m.ajaxSettings.xhr=void 0!==a.ActiveXObject?function(){return!this.isLocal&&/^(get|post|head|put|delete|options)$/i.test(this.type)&&Zc()||$c()}:Zc;var Wc=0,Xc={},Yc=m.ajaxSettings.xhr();a.ActiveXObject&&m(a).on("unload",function(){for(var a in Xc)Xc[a](void 0,!0)}),k.cors=!!Yc&&"withCredentials"in Yc,Yc=k.ajax=!!Yc,Yc&&m.ajaxTransport(function(a){if(!a.crossDomain||k.cors){var b;return{send:function(c,d){var e,f=a.xhr(),g=++Wc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)void 0!==c[e]&&f.setRequestHeader(e,c[e]+"");f.send(a.hasContent&&a.data||null),b=function(c,e){var h,i,j;if(b&&(e||4===f.readyState))if(delete Xc[g],b=void 0,f.onreadystatechange=m.noop,e)4!==f.readyState&&f.abort();else{j={},h=f.status,"string"==typeof f.responseText&&(j.text=f.responseText);try{i=f.statusText}catch(k){i=""}h||!a.isLocal||a.crossDomain?1223===h&&(h=204):h=j.text?200:404}j&&d(h,i,j,f.getAllResponseHeaders())},a.async?4===f.readyState?setTimeout(b):f.onreadystatechange=Xc[g]=b:b()},abort:function(){b&&b(void 0,!0)}}}});function Zc(){try{return new a.XMLHttpRequest}catch(b){}}function $c(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}m.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return m.globalEval(a),a}}}),m.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),m.ajaxTransport("script",function(a){if(a.crossDomain){var b,c=y.head||m("head")[0]||y.documentElement;return{send:function(d,e){b=y.createElement("script"),b.async=!0,a.scriptCharset&&(b.charset=a.scriptCharset),b.src=a.url,b.onload=b.onreadystatechange=function(a,c){(c||!b.readyState||/loaded|complete/.test(b.readyState))&&(b.onload=b.onreadystatechange=null,b.parentNode&&b.parentNode.removeChild(b),b=null,c||e(200,"success"))},c.insertBefore(b,c.firstChild)},abort:function(){b&&b.onload(void 0,!0)}}}});var _c=[],ad=/(=)\?(?=&|$)|\?\?/;m.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=_c.pop()||m.expando+"_"+vc++;return this[a]=!0,a}}),m.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(ad.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&ad.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=m.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(ad,"$1"+e):b.jsonp!==!1&&(b.url+=(wc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||m.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,_c.push(e)),g&&m.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),m.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||y;var d=u.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=m.buildFragment([a],b,e),e&&e.length&&m(e).remove(),m.merge([],d.childNodes))};var bd=m.fn.load;m.fn.load=function(a,b,c){if("string"!=typeof a&&bd)return bd.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=m.trim(a.slice(h,a.length)),a=a.slice(0,h)),m.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(f="POST"),g.length>0&&m.ajax({url:a,type:f,dataType:"html",data:b}).done(function(a){e=arguments,g.html(d?m("<div>").append(m.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,e||[a.responseText,b,a])}),this},m.expr.filters.animated=function(a){return m.grep(m.timers,function(b){return a===b.elem}).length};var cd=a.document.documentElement;function dd(a){return m.isWindow(a)?a:9===a.nodeType?a.defaultView||a.parentWindow:!1}m.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=m.css(a,"position"),l=m(a),n={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=m.css(a,"top"),i=m.css(a,"left"),j=("absolute"===k||"fixed"===k)&&m.inArray("auto",[f,i])>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),m.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(n.top=b.top-h.top+g),null!=b.left&&(n.left=b.left-h.left+e),"using"in b?b.using.call(a,n):l.css(n)}},m.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){m.offset.setOffset(this,a,b)});var b,c,d={top:0,left:0},e=this[0],f=e&&e.ownerDocument;if(f)return b=f.documentElement,m.contains(b,e)?(typeof e.getBoundingClientRect!==K&&(d=e.getBoundingClientRect()),c=dd(f),{top:d.top+(c.pageYOffset||b.scrollTop)-(b.clientTop||0),left:d.left+(c.pageXOffset||b.scrollLeft)-(b.clientLeft||0)}):d},position:function(){if(this[0]){var a,b,c={top:0,left:0},d=this[0];return"fixed"===m.css(d,"position")?b=d.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),m.nodeName(a[0],"html")||(c=a.offset()),c.top+=m.css(a[0],"borderTopWidth",!0),c.left+=m.css(a[0],"borderLeftWidth",!0)),{top:b.top-c.top-m.css(d,"marginTop",!0),left:b.left-c.left-m.css(d,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||cd;while(a&&!m.nodeName(a,"html")&&"static"===m.css(a,"position"))a=a.offsetParent;return a||cd})}}),m.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,b){var c=/Y/.test(b);m.fn[a]=function(d){return V(this,function(a,d,e){var f=dd(a);return void 0===e?f?b in f?f[b]:f.document.documentElement[d]:a[d]:void(f?f.scrollTo(c?m(f).scrollLeft():e,c?e:m(f).scrollTop()):a[d]=e)},a,d,arguments.length,null)}}),m.each(["top","left"],function(a,b){m.cssHooks[b]=Lb(k.pixelPosition,function(a,c){return c?(c=Jb(a,b),Hb.test(c)?m(a).position()[b]+"px":c):void 0})}),m.each({Height:"height",Width:"width"},function(a,b){m.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){m.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return V(this,function(b,c,d){var e;return m.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?m.css(b,c,g):m.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),m.fn.size=function(){return this.length},m.fn.andSelf=m.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return m});var ed=a.jQuery,fd=a.$;return m.noConflict=function(b){return a.$===m&&(a.$=fd),b&&a.jQuery===m&&(a.jQuery=ed),m},typeof b===K&&(a.jQuery=a.$=m),m});
diff --git a/shrine-webclient/src/main/html/js-ext/moment.min.js b/shrine-webclient/src/main/html/js-ext/moment.min.js
new file mode 100644
index 000000000..05199bd3b
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-ext/moment.min.js
@@ -0,0 +1,7 @@
+//! moment.js
+//! version : 2.10.3
+//! authors : Tim Wood, Iskren Chernev, Moment.js contributors
+//! license : MIT
+//! momentjs.com
+!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return Dc.apply(null,arguments)}function b(a){Dc=a}function c(a){return"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c<a.length;++c)d.push(b(a[c],c));return d}function f(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function g(a,b){for(var c in b)f(b,c)&&(a[c]=b[c]);return f(b,"toString")&&(a.toString=b.toString),f(b,"valueOf")&&(a.valueOf=b.valueOf),a}function h(a,b,c,d){return za(a,b,c,d,!0).utc()}function i(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1}}function j(a){return null==a._pf&&(a._pf=i()),a._pf}function k(a){if(null==a._isValid){var b=j(a);a._isValid=!isNaN(a._d.getTime())&&b.overflow<0&&!b.empty&&!b.invalidMonth&&!b.nullInput&&!b.invalidFormat&&!b.userInvalidated,a._strict&&(a._isValid=a._isValid&&0===b.charsLeftOver&&0===b.unusedTokens.length&&void 0===b.bigHour)}return a._isValid}function l(a){var b=h(0/0);return null!=a?g(j(b),a):j(b).userInvalidated=!0,b}function m(a,b){var c,d,e;if("undefined"!=typeof b._isAMomentObject&&(a._isAMomentObject=b._isAMomentObject),"undefined"!=typeof b._i&&(a._i=b._i),"undefined"!=typeof b._f&&(a._f=b._f),"undefined"!=typeof b._l&&(a._l=b._l),"undefined"!=typeof b._strict&&(a._strict=b._strict),"undefined"!=typeof b._tzm&&(a._tzm=b._tzm),"undefined"!=typeof b._isUTC&&(a._isUTC=b._isUTC),"undefined"!=typeof b._offset&&(a._offset=b._offset),"undefined"!=typeof b._pf&&(a._pf=j(b)),"undefined"!=typeof b._locale&&(a._locale=b._locale),Fc.length>0)for(c in Fc)d=Fc[c],e=b[d],"undefined"!=typeof e&&(a[d]=e);return a}function n(b){m(this,b),this._d=new Date(+b._d),Gc===!1&&(Gc=!0,a.updateOffset(this),Gc=!1)}function o(a){return a instanceof n||null!=a&&null!=a._isAMomentObject}function p(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=b>=0?Math.floor(b):Math.ceil(b)),c}function q(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&p(a[d])!==p(b[d]))&&g++;return g+f}function r(){}function s(a){return a?a.toLowerCase().replace("_","-"):a}function t(a){for(var b,c,d,e,f=0;f<a.length;){for(e=s(a[f]).split("-"),b=e.length,c=s(a[f+1]),c=c?c.split("-"):null;b>0;){if(d=u(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&q(e,c,!0)>=b-1)break;b--}f++}return null}function u(a){var b=null;if(!Hc[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=Ec._abbr,require("./locale/"+a),v(b)}catch(c){}return Hc[a]}function v(a,b){var c;return a&&(c="undefined"==typeof b?x(a):w(a,b),c&&(Ec=c)),Ec._abbr}function w(a,b){return null!==b?(b.abbr=a,Hc[a]||(Hc[a]=new r),Hc[a].set(b),v(a),Hc[a]):(delete Hc[a],null)}function x(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return Ec;if(!c(a)){if(b=u(a))return b;a=[a]}return t(a)}function y(a,b){var c=a.toLowerCase();Ic[c]=Ic[c+"s"]=Ic[b]=a}function z(a){return"string"==typeof a?Ic[a]||Ic[a.toLowerCase()]:void 0}function A(a){var b,c,d={};for(c in a)f(a,c)&&(b=z(c),b&&(d[b]=a[c]));return d}function B(b,c){return function(d){return null!=d?(D(this,b,d),a.updateOffset(this,c),this):C(this,b)}}function C(a,b){return a._d["get"+(a._isUTC?"UTC":"")+b]()}function D(a,b,c){return a._d["set"+(a._isUTC?"UTC":"")+b](c)}function E(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=z(a),"function"==typeof this[a])return this[a](b);return this}function F(a,b,c){for(var d=""+Math.abs(a),e=a>=0;d.length<b;)d="0"+d;return(e?c?"+":"":"-")+d}function G(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(Mc[a]=e),b&&(Mc[b[0]]=function(){return F(e.apply(this,arguments),b[1],b[2])}),c&&(Mc[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function H(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function I(a){var b,c,d=a.match(Jc);for(b=0,c=d.length;c>b;b++)Mc[d[b]]?d[b]=Mc[d[b]]:d[b]=H(d[b]);return function(e){var f="";for(b=0;c>b;b++)f+=d[b]instanceof Function?d[b].call(e,a):d[b];return f}}function J(a,b){return a.isValid()?(b=K(b,a.localeData()),Lc[b]||(Lc[b]=I(b)),Lc[b](a)):a.localeData().invalidDate()}function K(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(Kc.lastIndex=0;d>=0&&Kc.test(a);)a=a.replace(Kc,c),Kc.lastIndex=0,d-=1;return a}function L(a,b,c){_c[a]="function"==typeof b?b:function(a){return a&&c?c:b}}function M(a,b){return f(_c,a)?_c[a](b._strict,b._locale):new RegExp(N(a))}function N(a){return a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function O(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=p(a)}),c=0;c<a.length;c++)ad[a[c]]=d}function P(a,b){O(a,function(a,c,d,e){d._w=d._w||{},b(a,d._w,d,e)})}function Q(a,b,c){null!=b&&f(ad,a)&&ad[a](b,c._a,c,a)}function R(a,b){return new Date(Date.UTC(a,b+1,0)).getUTCDate()}function S(a){return this._months[a.month()]}function T(a){return this._monthsShort[a.month()]}function U(a,b,c){var d,e,f;for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function V(a,b){var c;return"string"==typeof b&&(b=a.localeData().monthsParse(b),"number"!=typeof b)?a:(c=Math.min(a.date(),R(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a)}function W(b){return null!=b?(V(this,b),a.updateOffset(this,!0),this):C(this,"Month")}function X(){return R(this.year(),this.month())}function Y(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[cd]<0||c[cd]>11?cd:c[dd]<1||c[dd]>R(c[bd],c[cd])?dd:c[ed]<0||c[ed]>24||24===c[ed]&&(0!==c[fd]||0!==c[gd]||0!==c[hd])?ed:c[fd]<0||c[fd]>59?fd:c[gd]<0||c[gd]>59?gd:c[hd]<0||c[hd]>999?hd:-1,j(a)._overflowDayOfYear&&(bd>b||b>dd)&&(b=dd),j(a).overflow=b),a}function Z(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function $(a,b){var c=!0,d=a+"\n"+(new Error).stack;return g(function(){return c&&(Z(d),c=!1),b.apply(this,arguments)},b)}function _(a,b){kd[a]||(Z(b),kd[a]=!0)}function aa(a){var b,c,d=a._i,e=ld.exec(d);if(e){for(j(a).iso=!0,b=0,c=md.length;c>b;b++)if(md[b][1].exec(d)){a._f=md[b][0]+(e[6]||" ");break}for(b=0,c=nd.length;c>b;b++)if(nd[b][1].exec(d)){a._f+=nd[b][0];break}d.match(Yc)&&(a._f+="Z"),ta(a)}else a._isValid=!1}function ba(b){var c=od.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(aa(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function ca(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 1970>a&&h.setFullYear(a),h}function da(a){var b=new Date(Date.UTC.apply(null,arguments));return 1970>a&&b.setUTCFullYear(a),b}function ea(a){return fa(a)?366:365}function fa(a){return a%4===0&&a%100!==0||a%400===0}function ga(){return fa(this.year())}function ha(a,b,c){var d,e=c-b,f=c-a.day();return f>e&&(f-=7),e-7>f&&(f+=7),d=Aa(a).add(f,"d"),{week:Math.ceil(d.dayOfYear()/7),year:d.year()}}function ia(a){return ha(a,this._week.dow,this._week.doy).week}function ja(){return this._week.dow}function ka(){return this._week.doy}function la(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function ma(a){var b=ha(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function na(a,b,c,d,e){var f,g,h=da(a,0,1).getUTCDay();return h=0===h?7:h,c=null!=c?c:e,f=e-h+(h>d?7:0)-(e>h?7:0),g=7*(b-1)+(c-e)+f+1,{year:g>0?a:a-1,dayOfYear:g>0?g:ea(a-1)+g}}function oa(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function pa(a,b,c){return null!=a?a:null!=b?b:c}function qa(a){var b=new Date;return a._useUTC?[b.getUTCFullYear(),b.getUTCMonth(),b.getUTCDate()]:[b.getFullYear(),b.getMonth(),b.getDate()]}function ra(a){var b,c,d,e,f=[];if(!a._d){for(d=qa(a),a._w&&null==a._a[dd]&&null==a._a[cd]&&sa(a),a._dayOfYear&&(e=pa(a._a[bd],d[bd]),a._dayOfYear>ea(e)&&(j(a)._overflowDayOfYear=!0),c=da(e,0,a._dayOfYear),a._a[cd]=c.getUTCMonth(),a._a[dd]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[ed]&&0===a._a[fd]&&0===a._a[gd]&&0===a._a[hd]&&(a._nextDay=!0,a._a[ed]=0),a._d=(a._useUTC?da:ca).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[ed]=24)}}function sa(a){var b,c,d,e,f,g,h;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=pa(b.GG,a._a[bd],ha(Aa(),1,4).year),d=pa(b.W,1),e=pa(b.E,1)):(f=a._locale._week.dow,g=a._locale._week.doy,c=pa(b.gg,a._a[bd],ha(Aa(),f,g).year),d=pa(b.w,1),null!=b.d?(e=b.d,f>e&&++d):e=null!=b.e?b.e+f:f),h=na(c,d,e,g,f),a._a[bd]=h.year,a._dayOfYear=h.dayOfYear}function ta(b){if(b._f===a.ISO_8601)return void aa(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=K(b._f,b._locale).match(Jc)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(M(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),Mc[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),Q(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[ed]<=12&&b._a[ed]>0&&(j(b).bigHour=void 0),b._a[ed]=ua(b._locale,b._a[ed],b._meridiem),ra(b),Y(b)}function ua(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function va(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(0/0));for(e=0;e<a._f.length;e++)f=0,b=m({},a),null!=a._useUTC&&(b._useUTC=a._useUTC),b._f=a._f[e],ta(b),k(b)&&(f+=j(b).charsLeftOver,f+=10*j(b).unusedTokens.length,j(b).score=f,(null==d||d>f)&&(d=f,c=b));g(a,c||b)}function wa(a){if(!a._d){var b=A(a._i);a._a=[b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],ra(a)}}function xa(a){var b,e=a._i,f=a._f;return a._locale=a._locale||x(a._l),null===e||void 0===f&&""===e?l({nullInput:!0}):("string"==typeof e&&(a._i=e=a._locale.preparse(e)),o(e)?new n(Y(e)):(c(f)?va(a):f?ta(a):d(e)?a._d=e:ya(a),b=new n(Y(a)),b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b))}function ya(b){var f=b._i;void 0===f?b._d=new Date:d(f)?b._d=new Date(+f):"string"==typeof f?ba(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),ra(b)):"object"==typeof f?wa(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function za(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,xa(f)}function Aa(a,b,c,d){return za(a,b,c,d,!1)}function Ba(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Aa();for(d=b[0],e=1;e<b.length;++e)b[e][a](d)&&(d=b[e]);return d}function Ca(){var a=[].slice.call(arguments,0);return Ba("isBefore",a)}function Da(){var a=[].slice.call(arguments,0);return Ba("isAfter",a)}function Ea(a){var b=A(a),c=b.year||0,d=b.quarter||0,e=b.month||0,f=b.week||0,g=b.day||0,h=b.hour||0,i=b.minute||0,j=b.second||0,k=b.millisecond||0;this._milliseconds=+k+1e3*j+6e4*i+36e5*h,this._days=+g+7*f,this._months=+e+3*d+12*c,this._data={},this._locale=x(),this._bubble()}function Fa(a){return a instanceof Ea}function Ga(a,b){G(a,0,0,function(){var a=this.utcOffset(),c="+";return 0>a&&(a=-a,c="-"),c+F(~~(a/60),2)+b+F(~~a%60,2)})}function Ha(a){var b=(a||"").match(Yc)||[],c=b[b.length-1]||[],d=(c+"").match(td)||["-",0,0],e=+(60*d[1])+p(d[2]);return"+"===d[0]?e:-e}function Ia(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(o(b)||d(b)?+b:+Aa(b))-+e,e._d.setTime(+e._d+f),a.updateOffset(e,!1),e):Aa(b).local();return c._isUTC?Aa(b).zone(c._offset||0):Aa(b).local()}function Ja(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ka(b,c){var d,e=this._offset||0;return null!=b?("string"==typeof b&&(b=Ha(b)),Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ja(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?$a(this,Va(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ja(this)}function La(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Ma(a){return this.utcOffset(0,a)}function Na(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ja(this),"m")),this}function Oa(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ha(this._i)),this}function Pa(a){return a=a?Aa(a).utcOffset():0,(this.utcOffset()-a)%60===0}function Qa(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Ra(){if(this._a){var a=this._isUTC?h(this._a):Aa(this._a);return this.isValid()&&q(this._a,a.toArray())>0}return!1}function Sa(){return!this._isUTC}function Ta(){return this._isUTC}function Ua(){return this._isUTC&&0===this._offset}function Va(a,b){var c,d,e,g=a,h=null;return Fa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=ud.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:p(h[dd])*c,h:p(h[ed])*c,m:p(h[fd])*c,s:p(h[gd])*c,ms:p(h[hd])*c}):(h=vd.exec(a))?(c="-"===h[1]?-1:1,g={y:Wa(h[2],c),M:Wa(h[3],c),d:Wa(h[4],c),h:Wa(h[5],c),m:Wa(h[6],c),s:Wa(h[7],c),w:Wa(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=Ya(Aa(g.from),Aa(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Ea(g),Fa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function Wa(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function Xa(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function Ya(a,b){var c;return b=Ia(b,a),a.isBefore(b)?c=Xa(a,b):(c=Xa(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c}function Za(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(_(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=Va(c,d),$a(this,e,a),this}}function $a(b,c,d,e){var f=c._milliseconds,g=c._days,h=c._months;e=null==e?!0:e,f&&b._d.setTime(+b._d+f*d),g&&D(b,"Date",C(b,"Date")+g*d),h&&V(b,C(b,"Month")+h*d),e&&a.updateOffset(b,g||h)}function _a(a){var b=a||Aa(),c=Ia(b,this).startOf("day"),d=this.diff(c,"days",!0),e=-6>d?"sameElse":-1>d?"lastWeek":0>d?"lastDay":1>d?"sameDay":2>d?"nextDay":7>d?"nextWeek":"sameElse";return this.format(this.localeData().calendar(e,this,Aa(b)))}function ab(){return new n(this)}function bb(a,b){var c;return b=z("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Aa(a),+this>+a):(c=o(a)?+a:+Aa(a),c<+this.clone().startOf(b))}function cb(a,b){var c;return b=z("undefined"!=typeof b?b:"millisecond"),"millisecond"===b?(a=o(a)?a:Aa(a),+a>+this):(c=o(a)?+a:+Aa(a),+this.clone().endOf(b)<c)}function db(a,b,c){return this.isAfter(a,c)&&this.isBefore(b,c)}function eb(a,b){var c;return b=z(b||"millisecond"),"millisecond"===b?(a=o(a)?a:Aa(a),+this===+a):(c=+Aa(a),+this.clone().startOf(b)<=c&&c<=+this.clone().endOf(b))}function fb(a){return 0>a?Math.ceil(a):Math.floor(a)}function gb(a,b,c){var d,e,f=Ia(a,this),g=6e4*(f.utcOffset()-this.utcOffset());return b=z(b),"year"===b||"month"===b||"quarter"===b?(e=hb(this,f),"quarter"===b?e/=3:"year"===b&&(e/=12)):(d=this-f,e="second"===b?d/1e3:"minute"===b?d/6e4:"hour"===b?d/36e5:"day"===b?(d-g)/864e5:"week"===b?(d-g)/6048e5:d),c?e:fb(e)}function hb(a,b){var c,d,e=12*(b.year()-a.year())+(b.month()-a.month()),f=a.clone().add(e,"months");return 0>b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)}function ib(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function jb(){var a=this.clone().utc();return 0<a.year()&&a.year()<=9999?"function"==typeof Date.prototype.toISOString?this.toDate().toISOString():J(a,"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]"):J(a,"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]")}function kb(b){var c=J(this,b||a.defaultFormat);return this.localeData().postformat(c)}function lb(a,b){return this.isValid()?Va({to:this,from:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function mb(a){return this.from(Aa(),a)}function nb(a,b){return this.isValid()?Va({from:this,to:a}).locale(this.locale()).humanize(!b):this.localeData().invalidDate()}function ob(a){return this.to(Aa(),a)}function pb(a){var b;return void 0===a?this._locale._abbr:(b=x(a),null!=b&&(this._locale=b),this)}function qb(){return this._locale}function rb(a){switch(a=z(a)){case"year":this.month(0);case"quarter":case"month":this.date(1);case"week":case"isoWeek":case"day":this.hours(0);case"hour":this.minutes(0);case"minute":this.seconds(0);case"second":this.milliseconds(0)}return"week"===a&&this.weekday(0),"isoWeek"===a&&this.isoWeekday(1),"quarter"===a&&this.month(3*Math.floor(this.month()/3)),this}function sb(a){return a=z(a),void 0===a||"millisecond"===a?this:this.startOf(a).add(1,"isoWeek"===a?"week":a).subtract(1,"ms")}function tb(){return+this._d-6e4*(this._offset||0)}function ub(){return Math.floor(+this/1e3)}function vb(){return this._offset?new Date(+this):this._d}function wb(){var a=this;return[a.year(),a.month(),a.date(),a.hour(),a.minute(),a.second(),a.millisecond()]}function xb(){return k(this)}function yb(){return g({},j(this))}function zb(){return j(this).overflow}function Ab(a,b){G(0,[a,a.length],0,b)}function Bb(a,b,c){return ha(Aa([a,11,31+b-c]),b,c).week}function Cb(a){var b=ha(this,this.localeData()._week.dow,this.localeData()._week.doy).year;return null==a?b:this.add(a-b,"y")}function Db(a){var b=ha(this,1,4).year;return null==a?b:this.add(a-b,"y")}function Eb(){return Bb(this.year(),1,4)}function Fb(){var a=this.localeData()._week;return Bb(this.year(),a.dow,a.doy)}function Gb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Hb(a,b){if("string"==typeof a)if(isNaN(a)){if(a=b.weekdaysParse(a),"number"!=typeof a)return null}else a=parseInt(a,10);return a}function Ib(a){return this._weekdays[a.day()]}function Jb(a){return this._weekdaysShort[a.day()]}function Kb(a){return this._weekdaysMin[a.day()]}function Lb(a){var b,c,d;for(this._weekdaysParse||(this._weekdaysParse=[]),b=0;7>b;b++)if(this._weekdaysParse[b]||(c=Aa([2e3,1]).day(b),d="^"+this.weekdays(c,"")+"|^"+this.weekdaysShort(c,"")+"|^"+this.weekdaysMin(c,""),this._weekdaysParse[b]=new RegExp(d.replace(".",""),"i")),this._weekdaysParse[b].test(a))return b}function Mb(a){var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=Hb(a,this.localeData()),this.add(a-b,"d")):b}function Nb(a){var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function Ob(a){return null==a?this.day()||7:this.day(this.day()%7?a:a-7)}function Pb(a,b){G(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function Qb(a,b){return b._meridiemParse}function Rb(a){return"p"===(a+"").toLowerCase().charAt(0)}function Sb(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function Tb(a){G(0,[a,3],0,"millisecond")}function Ub(){return this._isUTC?"UTC":""}function Vb(){return this._isUTC?"Coordinated Universal Time":""}function Wb(a){return Aa(1e3*a)}function Xb(){return Aa.apply(null,arguments).parseZone()}function Yb(a,b,c){var d=this._calendar[a];return"function"==typeof d?d.call(b,c):d}function Zb(a){var b=this._longDateFormat[a];return!b&&this._longDateFormat[a.toUpperCase()]&&(b=this._longDateFormat[a.toUpperCase()].replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a]=b),b}function $b(){return this._invalidDate}function _b(a){return this._ordinal.replace("%d",a)}function ac(a){return a}function bc(a,b,c,d){var e=this._relativeTime[c];return"function"==typeof e?e(a,b,c,d):e.replace(/%d/i,a)}function cc(a,b){var c=this._relativeTime[a>0?"future":"past"];return"function"==typeof c?c(b):c.replace(/%s/i,b)}function dc(a){var b,c;for(c in a)b=a[c],"function"==typeof b?this[c]=b:this["_"+c]=b;this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function ec(a,b,c,d){var e=x(),f=h().set(d,b);return e[c](f,a)}function fc(a,b,c,d,e){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return ec(a,b,c,e);var f,g=[];for(f=0;d>f;f++)g[f]=ec(a,f,c,e);return g}function gc(a,b){return fc(a,b,"months",12,"month")}function hc(a,b){return fc(a,b,"monthsShort",12,"month")}function ic(a,b){return fc(a,b,"weekdays",7,"day")}function jc(a,b){return fc(a,b,"weekdaysShort",7,"day")}function kc(a,b){return fc(a,b,"weekdaysMin",7,"day")}function lc(){var a=this._data;return this._milliseconds=Rd(this._milliseconds),this._days=Rd(this._days),this._months=Rd(this._months),a.milliseconds=Rd(a.milliseconds),a.seconds=Rd(a.seconds),a.minutes=Rd(a.minutes),a.hours=Rd(a.hours),a.months=Rd(a.months),a.years=Rd(a.years),this}function mc(a,b,c,d){var e=Va(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function nc(a,b){return mc(this,a,b,1)}function oc(a,b){return mc(this,a,b,-1)}function pc(){var a,b,c,d=this._milliseconds,e=this._days,f=this._months,g=this._data,h=0;return g.milliseconds=d%1e3,a=fb(d/1e3),g.seconds=a%60,b=fb(a/60),g.minutes=b%60,c=fb(b/60),g.hours=c%24,e+=fb(c/24),h=fb(qc(e)),e-=fb(rc(h)),f+=fb(e/30),e%=30,h+=fb(f/12),f%=12,g.days=e,g.months=f,g.years=h,this}function qc(a){return 400*a/146097}function rc(a){return 146097*a/400}function sc(a){var b,c,d=this._milliseconds;if(a=z(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+12*qc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(rc(this._months/12)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function tc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*p(this._months/12)}function uc(a){return function(){return this.as(a)}}function vc(a){return a=z(a),this[a+"s"]()}function wc(a){return function(){return this._data[a]}}function xc(){return fb(this.days()/7)}function yc(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function zc(a,b,c){var d=Va(a).abs(),e=fe(d.as("s")),f=fe(d.as("m")),g=fe(d.as("h")),h=fe(d.as("d")),i=fe(d.as("M")),j=fe(d.as("y")),k=e<ge.s&&["s",e]||1===f&&["m"]||f<ge.m&&["mm",f]||1===g&&["h"]||g<ge.h&&["hh",g]||1===h&&["d"]||h<ge.d&&["dd",h]||1===i&&["M"]||i<ge.M&&["MM",i]||1===j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,yc.apply(null,k)}function Ac(a,b){return void 0===ge[a]?!1:void 0===b?ge[a]:(ge[a]=b,!0)}function Bc(a){var b=this.localeData(),c=zc(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function Cc(){var a=he(this.years()),b=he(this.months()),c=he(this.days()),d=he(this.hours()),e=he(this.minutes()),f=he(this.seconds()+this.milliseconds()/1e3),g=this.asSeconds();return g?(0>g?"-":"")+"P"+(a?a+"Y":"")+(b?b+"M":"")+(c?c+"D":"")+(d||e||f?"T":"")+(d?d+"H":"")+(e?e+"M":"")+(f?f+"S":""):"P0D"}var Dc,Ec,Fc=a.momentProperties=[],Gc=!1,Hc={},Ic={},Jc=/(\[[^\[]*\])|(\\)?(Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Q|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,4}|x|X|zz?|ZZ?|.)/g,Kc=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Lc={},Mc={},Nc=/\d/,Oc=/\d\d/,Pc=/\d{3}/,Qc=/\d{4}/,Rc=/[+-]?\d{6}/,Sc=/\d\d?/,Tc=/\d{1,3}/,Uc=/\d{1,4}/,Vc=/[+-]?\d{1,6}/,Wc=/\d+/,Xc=/[+-]?\d+/,Yc=/Z|[+-]\d\d:?\d\d/gi,Zc=/[+-]?\d+(\.\d{1,3})?/,$c=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,_c={},ad={},bd=0,cd=1,dd=2,ed=3,fd=4,gd=5,hd=6;G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(a){return this.localeData().monthsShort(this,a)}),G("MMMM",0,0,function(a){return this.localeData().months(this,a)}),y("month","M"),L("M",Sc),L("MM",Sc,Oc),L("MMM",$c),L("MMMM",$c),O(["M","MM"],function(a,b){b[cd]=p(a)-1}),O(["MMM","MMMM"],function(a,b,c,d){var e=c._locale.monthsParse(a,d,c._strict);null!=e?b[cd]=e:j(c).invalidMonth=a});var id="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),jd="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),kd={};a.suppressDeprecationWarnings=!1;var ld=/^\s*(?:[+-]\d{6}|\d{4})-(?:(\d\d-\d\d)|(W\d\d$)|(W\d\d-\d)|(\d\d\d))((T| )(\d\d(:\d\d(:\d\d(\.\d+)?)?)?)?([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,md=[["YYYYYY-MM-DD",/[+-]\d{6}-\d{2}-\d{2}/],["YYYY-MM-DD",/\d{4}-\d{2}-\d{2}/],["GGGG-[W]WW-E",/\d{4}-W\d{2}-\d/],["GGGG-[W]WW",/\d{4}-W\d{2}/],["YYYY-DDD",/\d{4}-\d{3}/]],nd=[["HH:mm:ss.SSSS",/(T| )\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss",/(T| )\d\d:\d\d:\d\d/],["HH:mm",/(T| )\d\d:\d\d/],["HH",/(T| )\d\d/]],od=/^\/?Date\((\-?\d+)/i;a.createFromInputFallback=$("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(a){a._d=new Date(a._i+(a._useUTC?" UTC":""))}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),y("year","y"),L("Y",Xc),L("YY",Sc,Oc),L("YYYY",Uc,Qc),L("YYYYY",Vc,Rc),L("YYYYYY",Vc,Rc),O(["YYYY","YYYYY","YYYYYY"],bd),O("YY",function(b,c){c[bd]=a.parseTwoDigitYear(b)}),a.parseTwoDigitYear=function(a){return p(a)+(p(a)>68?1900:2e3)};var pd=B("FullYear",!1);G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),y("week","w"),y("isoWeek","W"),L("w",Sc),L("ww",Sc,Oc),L("W",Sc),L("WW",Sc,Oc),P(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=p(a)});var qd={dow:0,doy:6};G("DDD",["DDDD",3],"DDDo","dayOfYear"),y("dayOfYear","DDD"),L("DDD",Tc),L("DDDD",Pc),O(["DDD","DDDD"],function(a,b,c){c._dayOfYear=p(a)}),a.ISO_8601=function(){};var rd=$("moment().min is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Aa.apply(null,arguments);return this>a?this:a}),sd=$("moment().max is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Aa.apply(null,arguments);return a>this?this:a});Ga("Z",":"),Ga("ZZ",""),L("Z",Yc),L("ZZ",Yc),O(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ha(a)});var td=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var ud=/(\-)?(?:(\d*)\.)?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?)?/,vd=/^(-)?P(?:(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?|([0-9,.]*)W)$/;Va.fn=Ea.prototype;var wd=Za(1,"add"),xd=Za(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var yd=$("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ab("gggg","weekYear"),Ab("ggggg","weekYear"),Ab("GGGG","isoWeekYear"),Ab("GGGGG","isoWeekYear"),y("weekYear","gg"),y("isoWeekYear","GG"),L("G",Xc),L("g",Xc),L("GG",Sc,Oc),L("gg",Sc,Oc),L("GGGG",Uc,Qc),L("gggg",Uc,Qc),L("GGGGG",Vc,Rc),L("ggggg",Vc,Rc),P(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=p(a)}),P(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),G("Q",0,0,"quarter"),y("quarter","Q"),L("Q",Nc),O("Q",function(a,b){b[cd]=3*(p(a)-1)}),G("D",["DD",2],"Do","date"),y("date","D"),L("D",Sc),L("DD",Sc,Oc),L("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),O(["D","DD"],dd),O("Do",function(a,b){b[dd]=p(a.match(Sc)[0],10)});var zd=B("Date",!0);G("d",0,"do","day"),G("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),G("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),G("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),y("day","d"),y("weekday","e"),y("isoWeekday","E"),L("d",Sc),L("e",Sc),L("E",Sc),L("dd",$c),L("ddd",$c),L("dddd",$c),P(["dd","ddd","dddd"],function(a,b,c){var d=c._locale.weekdaysParse(a);null!=d?b.d=d:j(c).invalidWeekday=a}),P(["d","e","E"],function(a,b,c,d){b[d]=p(a)});var Ad="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Bd="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Cd="Su_Mo_Tu_We_Th_Fr_Sa".split("_");G("H",["HH",2],0,"hour"),G("h",["hh",2],0,function(){return this.hours()%12||12}),Pb("a",!0),Pb("A",!1),y("hour","h"),L("a",Qb),L("A",Qb),L("H",Sc),L("h",Sc),L("HH",Sc,Oc),L("hh",Sc,Oc),O(["H","HH"],ed),O(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),O(["h","hh"],function(a,b,c){b[ed]=p(a),j(c).bigHour=!0});var Dd=/[ap]\.?m?\.?/i,Ed=B("Hours",!0);G("m",["mm",2],0,"minute"),y("minute","m"),L("m",Sc),L("mm",Sc,Oc),O(["m","mm"],fd);var Fd=B("Minutes",!1);G("s",["ss",2],0,"second"),y("second","s"),L("s",Sc),L("ss",Sc,Oc),O(["s","ss"],gd);var Gd=B("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Tb("SSS"),Tb("SSSS"),y("millisecond","ms"),L("S",Tc,Nc),L("SS",Tc,Oc),L("SSS",Tc,Pc),L("SSSS",Wc),O(["S","SS","SSS","SSSS"],function(a,b){b[hd]=p(1e3*("0."+a))});var Hd=B("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var Id=n.prototype;Id.add=wd,Id.calendar=_a,Id.clone=ab,Id.diff=gb,Id.endOf=sb,Id.format=kb,Id.from=lb,Id.fromNow=mb,Id.to=nb,Id.toNow=ob,Id.get=E,Id.invalidAt=zb,Id.isAfter=bb,Id.isBefore=cb,Id.isBetween=db,Id.isSame=eb,Id.isValid=xb,Id.lang=yd,Id.locale=pb,Id.localeData=qb,Id.max=sd,Id.min=rd,Id.parsingFlags=yb,Id.set=E,Id.startOf=rb,Id.subtract=xd,Id.toArray=wb,Id.toDate=vb,Id.toISOString=jb,Id.toJSON=jb,Id.toString=ib,Id.unix=ub,Id.valueOf=tb,Id.year=pd,Id.isLeapYear=ga,Id.weekYear=Cb,Id.isoWeekYear=Db,Id.quarter=Id.quarters=Gb,Id.month=W,Id.daysInMonth=X,Id.week=Id.weeks=la,Id.isoWeek=Id.isoWeeks=ma,Id.weeksInYear=Fb,Id.isoWeeksInYear=Eb,Id.date=zd,Id.day=Id.days=Mb,Id.weekday=Nb,Id.isoWeekday=Ob,Id.dayOfYear=oa,Id.hour=Id.hours=Ed,Id.minute=Id.minutes=Fd,Id.second=Id.seconds=Gd,Id.millisecond=Id.milliseconds=Hd,Id.utcOffset=Ka,Id.utc=Ma,Id.local=Na,Id.parseZone=Oa,Id.hasAlignedHourOffset=Pa,Id.isDST=Qa,Id.isDSTShifted=Ra,Id.isLocal=Sa,Id.isUtcOffset=Ta,Id.isUtc=Ua,Id.isUTC=Ua,Id.zoneAbbr=Ub,Id.zoneName=Vb,Id.dates=$("dates accessor is deprecated. Use date instead.",zd),Id.months=$("months accessor is deprecated. Use month instead",W),Id.years=$("years accessor is deprecated. Use year instead",pd),Id.zone=$("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",La);var Jd=Id,Kd={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Ld={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY LT",LLLL:"dddd, MMMM D, YYYY LT"},Md="Invalid date",Nd="%d",Od=/\d{1,2}/,Pd={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",
+hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Qd=r.prototype;Qd._calendar=Kd,Qd.calendar=Yb,Qd._longDateFormat=Ld,Qd.longDateFormat=Zb,Qd._invalidDate=Md,Qd.invalidDate=$b,Qd._ordinal=Nd,Qd.ordinal=_b,Qd._ordinalParse=Od,Qd.preparse=ac,Qd.postformat=ac,Qd._relativeTime=Pd,Qd.relativeTime=bc,Qd.pastFuture=cc,Qd.set=dc,Qd.months=S,Qd._months=id,Qd.monthsShort=T,Qd._monthsShort=jd,Qd.monthsParse=U,Qd.week=ia,Qd._week=qd,Qd.firstDayOfYear=ka,Qd.firstDayOfWeek=ja,Qd.weekdays=Ib,Qd._weekdays=Ad,Qd.weekdaysMin=Kb,Qd._weekdaysMin=Cd,Qd.weekdaysShort=Jb,Qd._weekdaysShort=Bd,Qd.weekdaysParse=Lb,Qd.isPM=Rb,Qd._meridiemParse=Dd,Qd.meridiem=Sb,v("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===p(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=$("moment.lang is deprecated. Use moment.locale instead.",v),a.langData=$("moment.langData is deprecated. Use moment.localeData instead.",x);var Rd=Math.abs,Sd=uc("ms"),Td=uc("s"),Ud=uc("m"),Vd=uc("h"),Wd=uc("d"),Xd=uc("w"),Yd=uc("M"),Zd=uc("y"),$d=wc("milliseconds"),_d=wc("seconds"),ae=wc("minutes"),be=wc("hours"),ce=wc("days"),de=wc("months"),ee=wc("years"),fe=Math.round,ge={s:45,m:45,h:22,d:26,M:11},he=Math.abs,ie=Ea.prototype;ie.abs=lc,ie.add=nc,ie.subtract=oc,ie.as=sc,ie.asMilliseconds=Sd,ie.asSeconds=Td,ie.asMinutes=Ud,ie.asHours=Vd,ie.asDays=Wd,ie.asWeeks=Xd,ie.asMonths=Yd,ie.asYears=Zd,ie.valueOf=tc,ie._bubble=pc,ie.get=vc,ie.milliseconds=$d,ie.seconds=_d,ie.minutes=ae,ie.hours=be,ie.days=ce,ie.weeks=xc,ie.months=de,ie.years=ee,ie.humanize=Bc,ie.toISOString=Cc,ie.toString=Cc,ie.toJSON=Cc,ie.locale=pb,ie.localeData=qb,ie.toIsoString=$("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Cc),ie.lang=yd,G("X",0,0,"unix"),G("x",0,0,"valueOf"),L("x",Xc),L("X",Zc),O("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),O("x",function(a,b,c){c._d=new Date(p(a))}),a.version="2.10.3",b(Aa),a.fn=Jd,a.min=Ca,a.max=Da,a.utc=h,a.unix=Wb,a.months=gc,a.isDate=d,a.locale=v,a.invalid=l,a.duration=Va,a.isMoment=o,a.weekdays=ic,a.parseZone=Xb,a.localeData=x,a.isDuration=Fa,a.monthsShort=hc,a.weekdaysMin=kc,a.defineLocale=w,a.weekdaysShort=jc,a.normalizeUnits=z,a.relativeTimeThreshold=Ac;var je=a;return je});
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/prototype-License.txt b/shrine-webclient/src/main/html/js-ext/prototype-License.txt
old mode 100755
new mode 100644
index 8b21dd554..69517cd28
--- a/shrine-webclient/src/main/html/js-ext/prototype-License.txt
+++ b/shrine-webclient/src/main/html/js-ext/prototype-License.txt
@@ -1,16 +1,16 @@
-License
-
-Prototype is Copyright © 2005-2007 Sam Stephenson. It is freely distributable under the terms of an MIT-style license.
-
- Copyright (c) 2005-2007 Sam Stephenson
-
- 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 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
+License
+
+Prototype is Copyright © 2005-2007 Sam Stephenson. It is freely distributable under the terms of an MIT-style license.
+
+ Copyright (c) 2005-2007 Sam Stephenson
+
+ 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 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/shrine-webclient/src/main/html/js-ext/prototype.js b/shrine-webclient/src/main/html/js-ext/prototype.js
old mode 100755
new mode 100644
index 08c246446..5c7ed2bd4
--- a/shrine-webclient/src/main/html/js-ext/prototype.js
+++ b/shrine-webclient/src/main/html/js-ext/prototype.js
@@ -1,4184 +1,7510 @@
-/* Prototype JavaScript framework, version 1.6.0
- * (c) 2005-2007 Sam Stephenson
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://www.prototypejs.org/
- *
- *--------------------------------------------------------------------------*/
-
-var Prototype = {
- Version: '1.6.0',
-
- Browser: {
- IE: !!(window.attachEvent && !window.opera),
- Opera: !!window.opera,
- WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
- Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
- MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
- },
-
- BrowserFeatures: {
- XPath: !!document.evaluate,
- ElementExtensions: !!window.HTMLElement,
- SpecificElementExtensions:
- document.createElement('div').__proto__ &&
- document.createElement('div').__proto__ !==
- document.createElement('form').__proto__
- },
-
- ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
- JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
-
- emptyFunction: function() { },
- K: function(x) { return x }
-};
-
-if (Prototype.Browser.MobileSafari)
- Prototype.BrowserFeatures.SpecificElementExtensions = false;
-
-if (Prototype.Browser.WebKit)
- Prototype.BrowserFeatures.XPath = false;
-
-/* Based on Alex Arnell's inheritance implementation. */
-var Class = {
- create: function() {
- var parent = null, properties = $A(arguments);
- if (Object.isFunction(properties[0]))
- parent = properties.shift();
-
- function klass() {
- this.initialize.apply(this, arguments);
- }
-
- Object.extend(klass, Class.Methods);
- klass.superclass = parent;
- klass.subclasses = [];
-
- if (parent) {
- var subclass = function() { };
- subclass.prototype = parent.prototype;
- klass.prototype = new subclass;
- parent.subclasses.push(klass);
- }
-
- for (var i = 0; i < properties.length; i++)
- klass.addMethods(properties[i]);
-
- if (!klass.prototype.initialize)
- klass.prototype.initialize = Prototype.emptyFunction;
-
- klass.prototype.constructor = klass;
-
- return klass;
- }
-};
-
-Class.Methods = {
- addMethods: function(source) {
- var ancestor = this.superclass && this.superclass.prototype;
- var properties = Object.keys(source);
-
- if (!Object.keys({ toString: true }).length)
- properties.push("toString", "valueOf");
-
- for (var i = 0, length = properties.length; i < length; i++) {
- var property = properties[i], value = source[property];
- if (ancestor && Object.isFunction(value) &&
- value.argumentNames().first() == "$super") {
- var method = value, value = Object.extend((function(m) {
- return function() { return ancestor[m].apply(this, arguments) };
- })(property).wrap(method), {
- valueOf: function() { return method },
- toString: function() { return method.toString() }
- });
- }
- this.prototype[property] = value;
- }
-
- return this;
- }
-};
-
-var Abstract = { };
-
-Object.extend = function(destination, source) {
- for (var property in source)
- destination[property] = source[property];
- return destination;
-};
-
-Object.extend(Object, {
- inspect: function(object) {
- try {
- if (object === undefined) return 'undefined';
- if (object === null) return 'null';
- return object.inspect ? object.inspect() : object.toString();
- } catch (e) {
- if (e instanceof RangeError) return '...';
- throw e;
- }
- },
-
- toJSON: function(object) {
- var type = typeof object;
- switch (type) {
- case 'undefined':
- case 'function':
- case 'unknown': return;
- case 'boolean': return object.toString();
- }
-
- if (object === null) return 'null';
- if (object.toJSON) return object.toJSON();
- if (Object.isElement(object)) return;
-
- var results = [];
- for (var property in object) {
- var value = Object.toJSON(object[property]);
- if (value !== undefined)
- results.push(property.toJSON() + ': ' + value);
- }
-
- return '{' + results.join(', ') + '}';
- },
-
- toQueryString: function(object) {
- return $H(object).toQueryString();
- },
-
- toHTML: function(object) {
- return object && object.toHTML ? object.toHTML() : String.interpret(object);
- },
-
- keys: function(object) {
- var keys = [];
- for (var property in object)
- keys.push(property);
- return keys;
- },
-
- values: function(object) {
- var values = [];
- for (var property in object)
- values.push(object[property]);
- return values;
- },
-
- clone: function(object) {
- return Object.extend({ }, object);
- },
-
- isElement: function(object) {
- return object && object.nodeType == 1;
- },
-
- isArray: function(object) {
- return object && object.constructor === Array;
- },
-
- isHash: function(object) {
- return object instanceof Hash;
- },
-
- isFunction: function(object) {
- return typeof object == "function";
- },
-
- isString: function(object) {
- return typeof object == "string";
- },
-
- isNumber: function(object) {
- return typeof object == "number";
- },
-
- isUndefined: function(object) {
- return typeof object == "undefined";
- }
-});
-
-Object.extend(Function.prototype, {
- argumentNames: function() {
- var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
- return names.length == 1 && !names[0] ? [] : names;
- },
-
- bind: function() {
- if (arguments.length < 2 && arguments[0] === undefined) return this;
- var __method = this, args = $A(arguments), object = args.shift();
- return function() {
- return __method.apply(object, args.concat($A(arguments)));
- }
- },
-
- bindAsEventListener: function() {
- var __method = this, args = $A(arguments), object = args.shift();
- return function(event) {
- return __method.apply(object, [event || window.event].concat(args));
- }
- },
-
- curry: function() {
- if (!arguments.length) return this;
- var __method = this, args = $A(arguments);
- return function() {
- return __method.apply(this, args.concat($A(arguments)));
- }
- },
-
- delay: function() {
- var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
- return window.setTimeout(function() {
- return __method.apply(__method, args);
- }, timeout);
- },
-
- wrap: function(wrapper) {
- var __method = this;
- return function() {
- return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
- }
- },
-
- methodize: function() {
- if (this._methodized) return this._methodized;
- var __method = this;
- return this._methodized = function() {
- return __method.apply(null, [this].concat($A(arguments)));
- };
- }
-});
-
-Function.prototype.defer = Function.prototype.delay.curry(0.01);
-
-Date.prototype.toJSON = function() {
- return '"' + this.getUTCFullYear() + '-' +
- (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
- this.getUTCDate().toPaddedString(2) + 'T' +
- this.getUTCHours().toPaddedString(2) + ':' +
- this.getUTCMinutes().toPaddedString(2) + ':' +
- this.getUTCSeconds().toPaddedString(2) + 'Z"';
-};
-
-var Try = {
- these: function() {
- var returnValue;
-
- for (var i = 0, length = arguments.length; i < length; i++) {
- var lambda = arguments[i];
- try {
- returnValue = lambda();
- break;
- } catch (e) { }
- }
-
- return returnValue;
- }
-};
-
-RegExp.prototype.match = RegExp.prototype.test;
-
-RegExp.escape = function(str) {
- return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
-};
-
-/*--------------------------------------------------------------------------*/
-
-var PeriodicalExecuter = Class.create({
- initialize: function(callback, frequency) {
- this.callback = callback;
- this.frequency = frequency;
- this.currentlyExecuting = false;
-
- this.registerCallback();
- },
-
- registerCallback: function() {
- this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
- },
-
- execute: function() {
- this.callback(this);
- },
-
- stop: function() {
- if (!this.timer) return;
- clearInterval(this.timer);
- this.timer = null;
- },
-
- onTimerEvent: function() {
- if (!this.currentlyExecuting) {
- try {
- this.currentlyExecuting = true;
- this.execute();
- } finally {
- this.currentlyExecuting = false;
- }
- }
- }
-});
-Object.extend(String, {
- interpret: function(value) {
- return value == null ? '' : String(value);
- },
- specialChar: {
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '\\': '\\\\'
- }
-});
-
-Object.extend(String.prototype, {
- gsub: function(pattern, replacement) {
- var result = '', source = this, match;
- replacement = arguments.callee.prepareReplacement(replacement);
-
- while (source.length > 0) {
- if (match = source.match(pattern)) {
- result += source.slice(0, match.index);
- result += String.interpret(replacement(match));
- source = source.slice(match.index + match[0].length);
- } else {
- result += source, source = '';
- }
- }
- return result;
- },
-
- sub: function(pattern, replacement, count) {
- replacement = this.gsub.prepareReplacement(replacement);
- count = count === undefined ? 1 : count;
-
- return this.gsub(pattern, function(match) {
- if (--count < 0) return match[0];
- return replacement(match);
- });
- },
-
- scan: function(pattern, iterator) {
- this.gsub(pattern, iterator);
- return String(this);
- },
-
- truncate: function(length, truncation) {
- length = length || 30;
- truncation = truncation === undefined ? '...' : truncation;
- return this.length > length ?
- this.slice(0, length - truncation.length) + truncation : String(this);
- },
-
- strip: function() {
- return this.replace(/^\s+/, '').replace(/\s+$/, '');
- },
-
- stripTags: function() {
- return this.replace(/<\/?[^>]+>/gi, '');
- },
-
- stripScripts: function() {
- return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
- },
-
- extractScripts: function() {
- var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
- var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
- return (this.match(matchAll) || []).map(function(scriptTag) {
- return (scriptTag.match(matchOne) || ['', ''])[1];
- });
- },
-
- evalScripts: function() {
- return this.extractScripts().map(function(script) { return eval(script) });
- },
-
- escapeHTML: function() {
- var self = arguments.callee;
- self.text.data = this;
- return self.div.innerHTML;
- },
-
- unescapeHTML: function() {
- var div = new Element('div');
- div.innerHTML = this.stripTags();
- return div.childNodes[0] ? (div.childNodes.length > 1 ?
- $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
- div.childNodes[0].nodeValue) : '';
- },
-
- toQueryParams: function(separator) {
- var match = this.strip().match(/([^?#]*)(#.*)?$/);
- if (!match) return { };
-
- return match[1].split(separator || '&').inject({ }, function(hash, pair) {
- if ((pair = pair.split('='))[0]) {
- var key = decodeURIComponent(pair.shift());
- var value = pair.length > 1 ? pair.join('=') : pair[0];
- if (value != undefined) value = decodeURIComponent(value);
-
- if (key in hash) {
- if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
- hash[key].push(value);
- }
- else hash[key] = value;
- }
- return hash;
- });
- },
-
- toArray: function() {
- return this.split('');
- },
-
- succ: function() {
- return this.slice(0, this.length - 1) +
- String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
- },
-
- times: function(count) {
- return count < 1 ? '' : new Array(count + 1).join(this);
- },
-
- camelize: function() {
- var parts = this.split('-'), len = parts.length;
- if (len == 1) return parts[0];
-
- var camelized = this.charAt(0) == '-'
- ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
- : parts[0];
-
- for (var i = 1; i < len; i++)
- camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
-
- return camelized;
- },
-
- capitalize: function() {
- return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
- },
-
- underscore: function() {
- return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
- },
-
- dasherize: function() {
- return this.gsub(/_/,'-');
- },
-
- inspect: function(useDoubleQuotes) {
- var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
- var character = String.specialChar[match[0]];
- return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
- });
- if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
- return "'" + escapedString.replace(/'/g, '\\\'') + "'";
- },
-
- toJSON: function() {
- return this.inspect(true);
- },
-
- unfilterJSON: function(filter) {
- return this.sub(filter || Prototype.JSONFilter, '#{1}');
- },
-
- isJSON: function() {
- var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
- return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
- },
-
- evalJSON: function(sanitize) {
- var json = this.unfilterJSON();
- try {
- if (!sanitize || json.isJSON()) return eval('(' + json + ')');
- } catch (e) { }
- throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
- },
-
- include: function(pattern) {
- return this.indexOf(pattern) > -1;
- },
-
- startsWith: function(pattern) {
- return this.indexOf(pattern) === 0;
- },
-
- endsWith: function(pattern) {
- var d = this.length - pattern.length;
- return d >= 0 && this.lastIndexOf(pattern) === d;
- },
-
- empty: function() {
- return this == '';
- },
-
- blank: function() {
- return /^\s*$/.test(this);
- },
-
- interpolate: function(object, pattern) {
- return new Template(this, pattern).evaluate(object);
- }
-});
-
-if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
- escapeHTML: function() {
- return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
- },
- unescapeHTML: function() {
- return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
- }
-});
-
-String.prototype.gsub.prepareReplacement = function(replacement) {
- if (Object.isFunction(replacement)) return replacement;
- var template = new Template(replacement);
- return function(match) { return template.evaluate(match) };
-};
-
-String.prototype.parseQuery = String.prototype.toQueryParams;
-
-Object.extend(String.prototype.escapeHTML, {
- div: document.createElement('div'),
- text: document.createTextNode('')
-});
-
-with (String.prototype.escapeHTML) div.appendChild(text);
-
-var Template = Class.create({
- initialize: function(template, pattern) {
- this.template = template.toString();
- this.pattern = pattern || Template.Pattern;
- },
-
- evaluate: function(object) {
- if (Object.isFunction(object.toTemplateReplacements))
- object = object.toTemplateReplacements();
-
- return this.template.gsub(this.pattern, function(match) {
- if (object == null) return '';
-
- var before = match[1] || '';
- if (before == '\\') return match[2];
-
- var ctx = object, expr = match[3];
- var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr);
- if (match == null) return before;
-
- while (match != null) {
- var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
- ctx = ctx[comp];
- if (null == ctx || '' == match[3]) break;
- expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
- match = pattern.exec(expr);
- }
-
- return before + String.interpret(ctx);
- }.bind(this));
- }
-});
-Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
-
-var $break = { };
-
-var Enumerable = {
- each: function(iterator, context) {
- var index = 0;
- iterator = iterator.bind(context);
- try {
- this._each(function(value) {
- iterator(value, index++);
- });
- } catch (e) {
- if (e != $break) throw e;
- }
- return this;
- },
-
- eachSlice: function(number, iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var index = -number, slices = [], array = this.toArray();
- while ((index += number) < array.length)
- slices.push(array.slice(index, index+number));
- return slices.collect(iterator, context);
- },
-
- all: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result = true;
- this.each(function(value, index) {
- result = result && !!iterator(value, index);
- if (!result) throw $break;
- });
- return result;
- },
-
- any: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result = false;
- this.each(function(value, index) {
- if (result = !!iterator(value, index))
- throw $break;
- });
- return result;
- },
-
- collect: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var results = [];
- this.each(function(value, index) {
- results.push(iterator(value, index));
- });
- return results;
- },
-
- detect: function(iterator, context) {
- iterator = iterator.bind(context);
- var result;
- this.each(function(value, index) {
- if (iterator(value, index)) {
- result = value;
- throw $break;
- }
- });
- return result;
- },
-
- findAll: function(iterator, context) {
- iterator = iterator.bind(context);
- var results = [];
- this.each(function(value, index) {
- if (iterator(value, index))
- results.push(value);
- });
- return results;
- },
-
- grep: function(filter, iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var results = [];
-
- if (Object.isString(filter))
- filter = new RegExp(filter);
-
- this.each(function(value, index) {
- if (filter.match(value))
- results.push(iterator(value, index));
- });
- return results;
- },
-
- include: function(object) {
- if (Object.isFunction(this.indexOf))
- if (this.indexOf(object) != -1) return true;
-
- var found = false;
- this.each(function(value) {
- if (value == object) {
- found = true;
- throw $break;
- }
- });
- return found;
- },
-
- inGroupsOf: function(number, fillWith) {
- fillWith = fillWith === undefined ? null : fillWith;
- return this.eachSlice(number, function(slice) {
- while(slice.length < number) slice.push(fillWith);
- return slice;
- });
- },
-
- inject: function(memo, iterator, context) {
- iterator = iterator.bind(context);
- this.each(function(value, index) {
- memo = iterator(memo, value, index);
- });
- return memo;
- },
-
- invoke: function(method) {
- var args = $A(arguments).slice(1);
- return this.map(function(value) {
- return value[method].apply(value, args);
- });
- },
-
- max: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result;
- this.each(function(value, index) {
- value = iterator(value, index);
- if (result == undefined || value >= result)
- result = value;
- });
- return result;
- },
-
- min: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result;
- this.each(function(value, index) {
- value = iterator(value, index);
- if (result == undefined || value < result)
- result = value;
- });
- return result;
- },
-
- partition: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var trues = [], falses = [];
- this.each(function(value, index) {
- (iterator(value, index) ?
- trues : falses).push(value);
- });
- return [trues, falses];
- },
-
- pluck: function(property) {
- var results = [];
- this.each(function(value) {
- results.push(value[property]);
- });
- return results;
- },
-
- reject: function(iterator, context) {
- iterator = iterator.bind(context);
- var results = [];
- this.each(function(value, index) {
- if (!iterator(value, index))
- results.push(value);
- });
- return results;
- },
-
- sortBy: function(iterator, context) {
- iterator = iterator.bind(context);
- return this.map(function(value, index) {
- return {value: value, criteria: iterator(value, index)};
- }).sort(function(left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- }).pluck('value');
- },
-
- toArray: function() {
- return this.map();
- },
-
- zip: function() {
- var iterator = Prototype.K, args = $A(arguments);
- if (Object.isFunction(args.last()))
- iterator = args.pop();
-
- var collections = [this].concat(args).map($A);
- return this.map(function(value, index) {
- return iterator(collections.pluck(index));
- });
- },
-
- size: function() {
- return this.toArray().length;
- },
-
- inspect: function() {
- return '#<Enumerable:' + this.toArray().inspect() + '>';
- }
-};
-
-Object.extend(Enumerable, {
- map: Enumerable.collect,
- find: Enumerable.detect,
- select: Enumerable.findAll,
- filter: Enumerable.findAll,
- member: Enumerable.include,
- entries: Enumerable.toArray,
- every: Enumerable.all,
- some: Enumerable.any
-});
-function $A(iterable) {
- if (!iterable) return [];
- if (iterable.toArray) return iterable.toArray();
- var length = iterable.length, results = new Array(length);
- while (length--) results[length] = iterable[length];
- return results;
-}
-
-if (Prototype.Browser.WebKit) {
- function $A(iterable) {
- if (!iterable) return [];
- if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
- iterable.toArray) return iterable.toArray();
- var length = iterable.length, results = new Array(length);
- while (length--) results[length] = iterable[length];
- return results;
- }
-}
-
-Array.from = $A;
-
-Object.extend(Array.prototype, Enumerable);
-
-if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
-
-Object.extend(Array.prototype, {
- _each: function(iterator) {
- for (var i = 0, length = this.length; i < length; i++)
- iterator(this[i]);
- },
-
- clear: function() {
- this.length = 0;
- return this;
- },
-
- first: function() {
- return this[0];
- },
-
- last: function() {
- return this[this.length - 1];
- },
-
- compact: function() {
- return this.select(function(value) {
- return value != null;
- });
- },
-
- flatten: function() {
- return this.inject([], function(array, value) {
- return array.concat(Object.isArray(value) ?
- value.flatten() : [value]);
- });
- },
-
- without: function() {
- var values = $A(arguments);
- return this.select(function(value) {
- return !values.include(value);
- });
- },
-
- reverse: function(inline) {
- return (inline !== false ? this : this.toArray())._reverse();
- },
-
- reduce: function() {
- return this.length > 1 ? this : this[0];
- },
-
- uniq: function(sorted) {
- return this.inject([], function(array, value, index) {
- if (0 == index || (sorted ? array.last() != value : !array.include(value)))
- array.push(value);
- return array;
- });
- },
-
- intersect: function(array) {
- return this.uniq().findAll(function(item) {
- return array.detect(function(value) { return item === value });
- });
- },
-
- clone: function() {
- return [].concat(this);
- },
-
- size: function() {
- return this.length;
- },
-
- inspect: function() {
- return '[' + this.map(Object.inspect).join(', ') + ']';
- },
-
- toJSON: function() {
- var results = [];
- this.each(function(object) {
- var value = Object.toJSON(object);
- if (value !== undefined) results.push(value);
- });
- return '[' + results.join(', ') + ']';
- }
-});
-
-// use native browser JS 1.6 implementation if available
-if (Object.isFunction(Array.prototype.forEach))
- Array.prototype._each = Array.prototype.forEach;
-
-if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
- i || (i = 0);
- var length = this.length;
- if (i < 0) i = length + i;
- for (; i < length; i++)
- if (this[i] === item) return i;
- return -1;
-};
-
-if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
- i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
- var n = this.slice(0, i).reverse().indexOf(item);
- return (n < 0) ? n : i - n - 1;
-};
-
-Array.prototype.toArray = Array.prototype.clone;
-
-function $w(string) {
- if (!Object.isString(string)) return [];
- string = string.strip();
- return string ? string.split(/\s+/) : [];
-}
-
-if (Prototype.Browser.Opera){
- Array.prototype.concat = function() {
- var array = [];
- for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
- for (var i = 0, length = arguments.length; i < length; i++) {
- if (Object.isArray(arguments[i])) {
- for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
- array.push(arguments[i][j]);
- } else {
- array.push(arguments[i]);
- }
- }
- return array;
- };
-}
-Object.extend(Number.prototype, {
- toColorPart: function() {
- return this.toPaddedString(2, 16);
- },
-
- succ: function() {
- return this + 1;
- },
-
- times: function(iterator) {
- $R(0, this, true).each(iterator);
- return this;
- },
-
- toPaddedString: function(length, radix) {
- var string = this.toString(radix || 10);
- return '0'.times(length - string.length) + string;
- },
-
- toJSON: function() {
- return isFinite(this) ? this.toString() : 'null';
- }
-});
-
-$w('abs round ceil floor').each(function(method){
- Number.prototype[method] = Math[method].methodize();
-});
-function $H(object) {
- return new Hash(object);
-};
-
-var Hash = Class.create(Enumerable, (function() {
- if (function() {
- var i = 0, Test = function(value) { this.key = value };
- Test.prototype.key = 'foo';
- for (var property in new Test('bar')) i++;
- return i > 1;
- }()) {
- function each(iterator) {
- var cache = [];
- for (var key in this._object) {
- var value = this._object[key];
- if (cache.include(key)) continue;
- cache.push(key);
- var pair = [key, value];
- pair.key = key;
- pair.value = value;
- iterator(pair);
- }
- }
- } else {
- function each(iterator) {
- for (var key in this._object) {
- var value = this._object[key], pair = [key, value];
- pair.key = key;
- pair.value = value;
- iterator(pair);
- }
- }
- }
-
- function toQueryPair(key, value) {
- if (Object.isUndefined(value)) return key;
- return key + '=' + encodeURIComponent(String.interpret(value));
- }
-
- return {
- initialize: function(object) {
- this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
- },
-
- _each: each,
-
- set: function(key, value) {
- return this._object[key] = value;
- },
-
- get: function(key) {
- return this._object[key];
- },
-
- unset: function(key) {
- var value = this._object[key];
- delete this._object[key];
- return value;
- },
-
- toObject: function() {
- return Object.clone(this._object);
- },
-
- keys: function() {
- return this.pluck('key');
- },
-
- values: function() {
- return this.pluck('value');
- },
-
- index: function(value) {
- var match = this.detect(function(pair) {
- return pair.value === value;
- });
- return match && match.key;
- },
-
- merge: function(object) {
- return this.clone().update(object);
- },
-
- update: function(object) {
- return new Hash(object).inject(this, function(result, pair) {
- result.set(pair.key, pair.value);
- return result;
- });
- },
-
- toQueryString: function() {
- return this.map(function(pair) {
- var key = encodeURIComponent(pair.key), values = pair.value;
-
- if (values && typeof values == 'object') {
- if (Object.isArray(values))
- return values.map(toQueryPair.curry(key)).join('&');
- }
- return toQueryPair(key, values);
- }).join('&');
- },
-
- inspect: function() {
- return '#<Hash:{' + this.map(function(pair) {
- return pair.map(Object.inspect).join(': ');
- }).join(', ') + '}>';
- },
-
- toJSON: function() {
- return Object.toJSON(this.toObject());
- },
-
- clone: function() {
- return new Hash(this);
- }
- }
-})());
-
-Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
-Hash.from = $H;
-var ObjectRange = Class.create(Enumerable, {
- initialize: function(start, end, exclusive) {
- this.start = start;
- this.end = end;
- this.exclusive = exclusive;
- },
-
- _each: function(iterator) {
- var value = this.start;
- while (this.include(value)) {
- iterator(value);
- value = value.succ();
- }
- },
-
- include: function(value) {
- if (value < this.start)
- return false;
- if (this.exclusive)
- return value < this.end;
- return value <= this.end;
- }
-});
-
-var $R = function(start, end, exclusive) {
- return new ObjectRange(start, end, exclusive);
-};
-
-var Ajax = {
- getTransport: function() {
- return Try.these(
- function() {return new XMLHttpRequest()},
- function() {return new ActiveXObject('Msxml2.XMLHTTP')},
- function() {return new ActiveXObject('Microsoft.XMLHTTP')}
- ) || false;
- },
-
- activeRequestCount: 0
-};
-
-Ajax.Responders = {
- responders: [],
-
- _each: function(iterator) {
- this.responders._each(iterator);
- },
-
- register: function(responder) {
- if (!this.include(responder))
- this.responders.push(responder);
- },
-
- unregister: function(responder) {
- this.responders = this.responders.without(responder);
- },
-
- dispatch: function(callback, request, transport, json) {
- this.each(function(responder) {
- if (Object.isFunction(responder[callback])) {
- try {
- responder[callback].apply(responder, [request, transport, json]);
- } catch (e) { }
- }
- });
- }
-};
-
-Object.extend(Ajax.Responders, Enumerable);
-
-Ajax.Responders.register({
- onCreate: function() { Ajax.activeRequestCount++ },
- onComplete: function() { Ajax.activeRequestCount-- }
-});
-
-Ajax.Base = Class.create({
- initialize: function(options) {
- this.options = {
- method: 'post',
- asynchronous: true,
- contentType: 'application/x-www-form-urlencoded',
- encoding: 'UTF-8',
- parameters: '',
- evalJSON: true,
- evalJS: true
- };
- Object.extend(this.options, options || { });
-
- this.options.method = this.options.method.toLowerCase();
- if (Object.isString(this.options.parameters))
- this.options.parameters = this.options.parameters.toQueryParams();
- }
-});
-
-Ajax.Request = Class.create(Ajax.Base, {
- _complete: false,
-
- initialize: function($super, url, options) {
- $super(options);
- this.transport = Ajax.getTransport();
- this.request(url);
- },
-
- request: function(url) {
- this.url = url;
- this.method = this.options.method;
- var params = Object.clone(this.options.parameters);
-
- if (!['get', 'post'].include(this.method)) {
- // simulate other verbs over post
- params['_method'] = this.method;
- this.method = 'post';
- }
-
- this.parameters = params;
-
- if (params = Object.toQueryString(params)) {
- // when GET, append parameters to URL
- if (this.method == 'get')
- this.url += (this.url.include('?') ? '&' : '?') + params;
- else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
- params += '&_=';
- }
-
- try {
- var response = new Ajax.Response(this);
- if (this.options.onCreate) this.options.onCreate(response);
- Ajax.Responders.dispatch('onCreate', this, response);
-
- this.transport.open(this.method.toUpperCase(), this.url,
- this.options.asynchronous);
-
- if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
-
- this.transport.onreadystatechange = this.onStateChange.bind(this);
- this.setRequestHeaders();
-
- this.body = this.method == 'post' ? (this.options.postBody || params) : null;
- this.transport.send(this.body);
-
- /* Force Firefox to handle ready state 4 for synchronous requests */
- if (!this.options.asynchronous && this.transport.overrideMimeType)
- this.onStateChange();
-
- }
- catch (e) {
- this.dispatchException(e);
- }
- },
-
- onStateChange: function() {
- var readyState = this.transport.readyState;
- if (readyState > 1 && !((readyState == 4) && this._complete))
- this.respondToReadyState(this.transport.readyState);
- },
-
- setRequestHeaders: function() {
- var headers = {
- 'X-Requested-With': 'XMLHttpRequest',
- 'X-Prototype-Version': Prototype.Version,
- 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
- };
-
- if (this.method == 'post') {
- headers['Content-type'] = this.options.contentType +
- (this.options.encoding ? '; charset=' + this.options.encoding : '');
-
- /* Force "Connection: close" for older Mozilla browsers to work
- * around a bug where XMLHttpRequest sends an incorrect
- * Content-length header. See Mozilla Bugzilla #246651.
- */
- if (this.transport.overrideMimeType &&
- (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
- headers['Connection'] = 'close';
- }
-
- // user-defined headers
- if (typeof this.options.requestHeaders == 'object') {
- var extras = this.options.requestHeaders;
-
- if (Object.isFunction(extras.push))
- for (var i = 0, length = extras.length; i < length; i += 2)
- headers[extras[i]] = extras[i+1];
- else
- $H(extras).each(function(pair) { headers[pair.key] = pair.value });
- }
-
- for (var name in headers)
- this.transport.setRequestHeader(name, headers[name]);
- },
-
- success: function() {
- var status = this.getStatus();
- return !status || (status >= 200 && status < 300);
- },
-
- getStatus: function() {
- try {
- return this.transport.status || 0;
- } catch (e) { return 0 }
- },
-
- respondToReadyState: function(readyState) {
- var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
-
- if (state == 'Complete') {
- try {
- this._complete = true;
- (this.options['on' + response.status]
- || this.options['on' + (this.success() ? 'Success' : 'Failure')]
- || Prototype.emptyFunction)(response, response.headerJSON);
- } catch (e) {
- this.dispatchException(e);
- }
-
- var contentType = response.getHeader('Content-type');
- if (this.options.evalJS == 'force'
- || (this.options.evalJS && contentType
- && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
- this.evalResponse();
- }
-
- try {
- (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
- Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
- } catch (e) {
- this.dispatchException(e);
- }
-
- if (state == 'Complete') {
- // avoid memory leak in MSIE: clean up
- this.transport.onreadystatechange = Prototype.emptyFunction;
- }
- },
-
- getHeader: function(name) {
- try {
- return this.transport.getResponseHeader(name);
- } catch (e) { return null }
- },
-
- evalResponse: function() {
- try {
- return eval((this.transport.responseText || '').unfilterJSON());
- } catch (e) {
- this.dispatchException(e);
- }
- },
-
- dispatchException: function(exception) {
- (this.options.onException || Prototype.emptyFunction)(this, exception);
- Ajax.Responders.dispatch('onException', this, exception);
- }
-});
-
-Ajax.Request.Events =
- ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
-
-Ajax.Response = Class.create({
- initialize: function(request){
- this.request = request;
- var transport = this.transport = request.transport,
- readyState = this.readyState = transport.readyState;
-
- if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
- this.status = this.getStatus();
- this.statusText = this.getStatusText();
- this.responseText = String.interpret(transport.responseText);
- this.headerJSON = this._getHeaderJSON();
- }
-
- if(readyState == 4) {
- var xml = transport.responseXML;
- this.responseXML = xml === undefined ? null : xml;
- this.responseJSON = this._getResponseJSON();
- }
- },
-
- status: 0,
- statusText: '',
-
- getStatus: Ajax.Request.prototype.getStatus,
-
- getStatusText: function() {
- try {
- return this.transport.statusText || '';
- } catch (e) { return '' }
- },
-
- getHeader: Ajax.Request.prototype.getHeader,
-
- getAllHeaders: function() {
- try {
- return this.getAllResponseHeaders();
- } catch (e) { return null }
- },
-
- getResponseHeader: function(name) {
- return this.transport.getResponseHeader(name);
- },
-
- getAllResponseHeaders: function() {
- return this.transport.getAllResponseHeaders();
- },
-
- _getHeaderJSON: function() {
- var json = this.getHeader('X-JSON');
- if (!json) return null;
- json = decodeURIComponent(escape(json));
- try {
- return json.evalJSON(this.request.options.sanitizeJSON);
- } catch (e) {
- this.request.dispatchException(e);
- }
- },
-
- _getResponseJSON: function() {
- var options = this.request.options;
- if (!options.evalJSON || (options.evalJSON != 'force' &&
- !(this.getHeader('Content-type') || '').include('application/json')))
- return null;
- try {
- return this.transport.responseText.evalJSON(options.sanitizeJSON);
- } catch (e) {
- this.request.dispatchException(e);
- }
- }
-});
-
-Ajax.Updater = Class.create(Ajax.Request, {
- initialize: function($super, container, url, options) {
- this.container = {
- success: (container.success || container),
- failure: (container.failure || (container.success ? null : container))
- };
-
- options = options || { };
- var onComplete = options.onComplete;
- options.onComplete = (function(response, param) {
- this.updateContent(response.responseText);
- if (Object.isFunction(onComplete)) onComplete(response, param);
- }).bind(this);
-
- $super(url, options);
- },
-
- updateContent: function(responseText) {
- var receiver = this.container[this.success() ? 'success' : 'failure'],
- options = this.options;
-
- if (!options.evalScripts) responseText = responseText.stripScripts();
-
- if (receiver = $(receiver)) {
- if (options.insertion) {
- if (Object.isString(options.insertion)) {
- var insertion = { }; insertion[options.insertion] = responseText;
- receiver.insert(insertion);
- }
- else options.insertion(receiver, responseText);
- }
- else receiver.update(responseText);
- }
-
- if (this.success()) {
- if (this.onComplete) this.onComplete.bind(this).defer();
- }
- }
-});
-
-Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
- initialize: function($super, container, url, options) {
- $super(options);
- this.onComplete = this.options.onComplete;
-
- this.frequency = (this.options.frequency || 2);
- this.decay = (this.options.decay || 1);
-
- this.updater = { };
- this.container = container;
- this.url = url;
-
- this.start();
- },
-
- start: function() {
- this.options.onComplete = this.updateComplete.bind(this);
- this.onTimerEvent();
- },
-
- stop: function() {
- this.updater.options.onComplete = undefined;
- clearTimeout(this.timer);
- (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
- },
-
- updateComplete: function(response) {
- if (this.options.decay) {
- this.decay = (response.responseText == this.lastText ?
- this.decay * this.options.decay : 1);
-
- this.lastText = response.responseText;
- }
- this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
- },
-
- onTimerEvent: function() {
- this.updater = new Ajax.Updater(this.container, this.url, this.options);
- }
-});
-function $(element) {
- if (arguments.length > 1) {
- for (var i = 0, elements = [], length = arguments.length; i < length; i++)
- elements.push($(arguments[i]));
- return elements;
- }
- if (Object.isString(element))
- element = document.getElementById(element);
- return Element.extend(element);
-}
-
-if (Prototype.BrowserFeatures.XPath) {
- document._getElementsByXPath = function(expression, parentElement) {
- var results = [];
- var query = document.evaluate(expression, $(parentElement) || document,
- null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
- for (var i = 0, length = query.snapshotLength; i < length; i++)
- results.push(Element.extend(query.snapshotItem(i)));
- return results;
- };
-}
-
-/*--------------------------------------------------------------------------*/
-
-if (!window.Node) var Node = { };
-
-if (!Node.ELEMENT_NODE) {
- // DOM level 2 ECMAScript Language Binding
- Object.extend(Node, {
- ELEMENT_NODE: 1,
- ATTRIBUTE_NODE: 2,
- TEXT_NODE: 3,
- CDATA_SECTION_NODE: 4,
- ENTITY_REFERENCE_NODE: 5,
- ENTITY_NODE: 6,
- PROCESSING_INSTRUCTION_NODE: 7,
- COMMENT_NODE: 8,
- DOCUMENT_NODE: 9,
- DOCUMENT_TYPE_NODE: 10,
- DOCUMENT_FRAGMENT_NODE: 11,
- NOTATION_NODE: 12
- });
-}
-
-(function() {
- var element = this.Element;
- this.Element = function(tagName, attributes) {
- attributes = attributes || { };
- tagName = tagName.toLowerCase();
- var cache = Element.cache;
- if (Prototype.Browser.IE && attributes.name) {
- tagName = '<' + tagName + ' name="' + attributes.name + '">';
- delete attributes.name;
- return Element.writeAttribute(document.createElement(tagName), attributes);
- }
- if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
- return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
- };
- Object.extend(this.Element, element || { });
-}).call(window);
-
-Element.cache = { };
-
-Element.Methods = {
- visible: function(element) {
- return $(element).style.display != 'none';
- },
-
- toggle: function(element) {
- element = $(element);
- Element[Element.visible(element) ? 'hide' : 'show'](element);
- return element;
- },
-
- hide: function(element) {
- $(element).style.display = 'none';
- return element;
- },
-
- show: function(element) {
- $(element).style.display = '';
- return element;
- },
-
- remove: function(element) {
- element = $(element);
- element.parentNode.removeChild(element);
- return element;
- },
-
- update: function(element, content) {
- element = $(element);
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) return element.update().insert(content);
- content = Object.toHTML(content);
- element.innerHTML = content.stripScripts();
- content.evalScripts.bind(content).defer();
- return element;
- },
-
- replace: function(element, content) {
- element = $(element);
- if (content && content.toElement) content = content.toElement();
- else if (!Object.isElement(content)) {
- content = Object.toHTML(content);
- var range = element.ownerDocument.createRange();
- range.selectNode(element);
- content.evalScripts.bind(content).defer();
- content = range.createContextualFragment(content.stripScripts());
- }
- element.parentNode.replaceChild(content, element);
- return element;
- },
-
- insert: function(element, insertions) {
- element = $(element);
-
- if (Object.isString(insertions) || Object.isNumber(insertions) ||
- Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
- insertions = {bottom:insertions};
-
- var content, t, range;
-
- for (position in insertions) {
- content = insertions[position];
- position = position.toLowerCase();
- t = Element._insertionTranslations[position];
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) {
- t.insert(element, content);
- continue;
- }
-
- content = Object.toHTML(content);
-
- range = element.ownerDocument.createRange();
- t.initializeRange(element, range);
- t.insert(element, range.createContextualFragment(content.stripScripts()));
-
- content.evalScripts.bind(content).defer();
- }
-
- return element;
- },
-
- wrap: function(element, wrapper, attributes) {
- element = $(element);
- if (Object.isElement(wrapper))
- $(wrapper).writeAttribute(attributes || { });
- else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
- else wrapper = new Element('div', wrapper);
- if (element.parentNode)
- element.parentNode.replaceChild(wrapper, element);
- wrapper.appendChild(element);
- return wrapper;
- },
-
- inspect: function(element) {
- element = $(element);
- var result = '<' + element.tagName.toLowerCase();
- $H({'id': 'id', 'className': 'class'}).each(function(pair) {
- var property = pair.first(), attribute = pair.last();
- var value = (element[property] || '').toString();
- if (value) result += ' ' + attribute + '=' + value.inspect(true);
- });
- return result + '>';
- },
-
- recursivelyCollect: function(element, property) {
- element = $(element);
- var elements = [];
- while (element = element[property])
- if (element.nodeType == 1)
- elements.push(Element.extend(element));
- return elements;
- },
-
- ancestors: function(element) {
- return $(element).recursivelyCollect('parentNode');
- },
-
- descendants: function(element) {
- return $A($(element).getElementsByTagName('*')).each(Element.extend);
- },
-
- firstDescendant: function(element) {
- element = $(element).firstChild;
- while (element && element.nodeType != 1) element = element.nextSibling;
- return $(element);
- },
-
- immediateDescendants: function(element) {
- if (!(element = $(element).firstChild)) return [];
- while (element && element.nodeType != 1) element = element.nextSibling;
- if (element) return [element].concat($(element).nextSiblings());
- return [];
- },
-
- previousSiblings: function(element) {
- return $(element).recursivelyCollect('previousSibling');
- },
-
- nextSiblings: function(element) {
- return $(element).recursivelyCollect('nextSibling');
- },
-
- siblings: function(element) {
- element = $(element);
- return element.previousSiblings().reverse().concat(element.nextSiblings());
- },
-
- match: function(element, selector) {
- if (Object.isString(selector))
- selector = new Selector(selector);
- return selector.match($(element));
- },
-
- up: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return $(element.parentNode);
- var ancestors = element.ancestors();
- return expression ? Selector.findElement(ancestors, expression, index) :
- ancestors[index || 0];
- },
-
- down: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return element.firstDescendant();
- var descendants = element.descendants();
- return expression ? Selector.findElement(descendants, expression, index) :
- descendants[index || 0];
- },
-
- previous: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
- var previousSiblings = element.previousSiblings();
- return expression ? Selector.findElement(previousSiblings, expression, index) :
- previousSiblings[index || 0];
- },
-
- next: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
- var nextSiblings = element.nextSiblings();
- return expression ? Selector.findElement(nextSiblings, expression, index) :
- nextSiblings[index || 0];
- },
-
- select: function() {
- var args = $A(arguments), element = $(args.shift());
- return Selector.findChildElements(element, args);
- },
-
- adjacent: function() {
- var args = $A(arguments), element = $(args.shift());
- return Selector.findChildElements(element.parentNode, args).without(element);
- },
-
- identify: function(element) {
- element = $(element);
- var id = element.readAttribute('id'), self = arguments.callee;
- if (id) return id;
- do { id = 'anonymous_element_' + self.counter++ } while ($(id));
- element.writeAttribute('id', id);
- return id;
- },
-
- readAttribute: function(element, name) {
- element = $(element);
- if (Prototype.Browser.IE) {
- var t = Element._attributeTranslations.read;
- if (t.values[name]) return t.values[name](element, name);
- if (t.names[name]) name = t.names[name];
- if (name.include(':')) {
- return (!element.attributes || !element.attributes[name]) ? null :
- element.attributes[name].value;
- }
- }
- return element.getAttribute(name);
- },
-
- writeAttribute: function(element, name, value) {
- element = $(element);
- var attributes = { }, t = Element._attributeTranslations.write;
-
- if (typeof name == 'object') attributes = name;
- else attributes[name] = value === undefined ? true : value;
-
- for (var attr in attributes) {
- var name = t.names[attr] || attr, value = attributes[attr];
- if (t.values[attr]) name = t.values[attr](element, value);
- if (value === false || value === null)
- element.removeAttribute(name);
- else if (value === true)
- element.setAttribute(name, name);
- else element.setAttribute(name, value);
- }
- return element;
- },
-
- getHeight: function(element) {
- return $(element).getDimensions().height;
- },
-
- getWidth: function(element) {
- return $(element).getDimensions().width;
- },
-
- classNames: function(element) {
- return new Element.ClassNames(element);
- },
-
- hasClassName: function(element, className) {
- if (!(element = $(element))) return;
- var elementClassName = element.className;
- return (elementClassName.length > 0 && (elementClassName == className ||
- new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
- },
-
- addClassName: function(element, className) {
- if (!(element = $(element))) return;
- if (!element.hasClassName(className))
- element.className += (element.className ? ' ' : '') + className;
- return element;
- },
-
- removeClassName: function(element, className) {
- if (!(element = $(element))) return;
- element.className = element.className.replace(
- new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
- return element;
- },
-
- toggleClassName: function(element, className) {
- if (!(element = $(element))) return;
- return element[element.hasClassName(className) ?
- 'removeClassName' : 'addClassName'](className);
- },
-
- // removes whitespace-only text node children
- cleanWhitespace: function(element) {
- element = $(element);
- var node = element.firstChild;
- while (node) {
- var nextNode = node.nextSibling;
- if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
- element.removeChild(node);
- node = nextNode;
- }
- return element;
- },
-
- empty: function(element) {
- return $(element).innerHTML.blank();
- },
-
- descendantOf: function(element, ancestor) {
- element = $(element), ancestor = $(ancestor);
-
- if (element.compareDocumentPosition)
- return (element.compareDocumentPosition(ancestor) & 8) === 8;
-
- if (element.sourceIndex && !Prototype.Browser.Opera) {
- var e = element.sourceIndex, a = ancestor.sourceIndex,
- nextAncestor = ancestor.nextSibling;
- if (!nextAncestor) {
- do { ancestor = ancestor.parentNode; }
- while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode);
- }
- if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex);
- }
-
- while (element = element.parentNode)
- if (element == ancestor) return true;
- return false;
- },
-
- scrollTo: function(element) {
- element = $(element);
- var pos = element.cumulativeOffset();
- window.scrollTo(pos[0], pos[1]);
- return element;
- },
-
- getStyle: function(element, style) {
- element = $(element);
- style = style == 'float' ? 'cssFloat' : style.camelize();
- var value = element.style[style];
- if (!value) {
- var css = document.defaultView.getComputedStyle(element, null);
- value = css ? css[style] : null;
- }
- if (style == 'opacity') return value ? parseFloat(value) : 1.0;
- return value == 'auto' ? null : value;
- },
-
- getOpacity: function(element) {
- return $(element).getStyle('opacity');
- },
-
- setStyle: function(element, styles) {
- element = $(element);
- var elementStyle = element.style, match;
- if (Object.isString(styles)) {
- element.style.cssText += ';' + styles;
- return styles.include('opacity') ?
- element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
- }
- for (var property in styles)
- if (property == 'opacity') element.setOpacity(styles[property]);
- else
- elementStyle[(property == 'float' || property == 'cssFloat') ?
- (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
- property] = styles[property];
-
- return element;
- },
-
- setOpacity: function(element, value) {
- element = $(element);
- element.style.opacity = (value == 1 || value === '') ? '' :
- (value < 0.00001) ? 0 : value;
- return element;
- },
-
- getDimensions: function(element) {
- element = $(element);
- var display = $(element).getStyle('display');
- if (display != 'none' && display != null) // Safari bug
- return {width: element.offsetWidth, height: element.offsetHeight};
-
- // All *Width and *Height properties give 0 on elements with display none,
- // so enable the element temporarily
- var els = element.style;
- var originalVisibility = els.visibility;
- var originalPosition = els.position;
- var originalDisplay = els.display;
- els.visibility = 'hidden';
- els.position = 'absolute';
- els.display = 'block';
- var originalWidth = element.clientWidth;
- var originalHeight = element.clientHeight;
- els.display = originalDisplay;
- els.position = originalPosition;
- els.visibility = originalVisibility;
- return {width: originalWidth, height: originalHeight};
- },
-
- makePositioned: function(element) {
- element = $(element);
- var pos = Element.getStyle(element, 'position');
- if (pos == 'static' || !pos) {
- element._madePositioned = true;
- element.style.position = 'relative';
- // Opera returns the offset relative to the positioning context, when an
- // element is position relative but top and left have not been defined
- if (window.opera) {
- element.style.top = 0;
- element.style.left = 0;
- }
- }
- return element;
- },
-
- undoPositioned: function(element) {
- element = $(element);
- if (element._madePositioned) {
- element._madePositioned = undefined;
- element.style.position =
- element.style.top =
- element.style.left =
- element.style.bottom =
- element.style.right = '';
- }
- return element;
- },
-
- makeClipping: function(element) {
- element = $(element);
- if (element._overflow) return element;
- element._overflow = Element.getStyle(element, 'overflow') || 'auto';
- if (element._overflow !== 'hidden')
- element.style.overflow = 'hidden';
- return element;
- },
-
- undoClipping: function(element) {
- element = $(element);
- if (!element._overflow) return element;
- element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
- element._overflow = null;
- return element;
- },
-
- cumulativeOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- element = element.offsetParent;
- } while (element);
- return Element._returnOffset(valueL, valueT);
- },
-
- positionedOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- element = element.offsetParent;
- if (element) {
- if (element.tagName == 'BODY') break;
- var p = Element.getStyle(element, 'position');
- if (p == 'relative' || p == 'absolute') break;
- }
- } while (element);
- return Element._returnOffset(valueL, valueT);
- },
-
- absolutize: function(element) {
- element = $(element);
- if (element.getStyle('position') == 'absolute') return;
- // Position.prepare(); // To be done manually by Scripty when it needs it.
-
- var offsets = element.positionedOffset();
- var top = offsets[1];
- var left = offsets[0];
- var width = element.clientWidth;
- var height = element.clientHeight;
-
- element._originalLeft = left - parseFloat(element.style.left || 0);
- element._originalTop = top - parseFloat(element.style.top || 0);
- element._originalWidth = element.style.width;
- element._originalHeight = element.style.height;
-
- element.style.position = 'absolute';
- element.style.top = top + 'px';
- element.style.left = left + 'px';
- element.style.width = width + 'px';
- element.style.height = height + 'px';
- return element;
- },
-
- relativize: function(element) {
- element = $(element);
- if (element.getStyle('position') == 'relative') return;
- // Position.prepare(); // To be done manually by Scripty when it needs it.
-
- element.style.position = 'relative';
- var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
- var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
-
- element.style.top = top + 'px';
- element.style.left = left + 'px';
- element.style.height = element._originalHeight;
- element.style.width = element._originalWidth;
- return element;
- },
-
- cumulativeScrollOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.scrollTop || 0;
- valueL += element.scrollLeft || 0;
- element = element.parentNode;
- } while (element);
- return Element._returnOffset(valueL, valueT);
- },
-
- getOffsetParent: function(element) {
- if (element.offsetParent) return $(element.offsetParent);
- if (element == document.body) return $(element);
-
- while ((element = element.parentNode) && element != document.body)
- if (Element.getStyle(element, 'position') != 'static')
- return $(element);
-
- return $(document.body);
- },
-
- viewportOffset: function(forElement) {
- var valueT = 0, valueL = 0;
-
- var element = forElement;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
-
- // Safari fix
- if (element.offsetParent == document.body &&
- Element.getStyle(element, 'position') == 'absolute') break;
-
- } while (element = element.offsetParent);
-
- element = forElement;
- do {
- if (!Prototype.Browser.Opera || element.tagName == 'BODY') {
- valueT -= element.scrollTop || 0;
- valueL -= element.scrollLeft || 0;
- }
- } while (element = element.parentNode);
-
- return Element._returnOffset(valueL, valueT);
- },
-
- clonePosition: function(element, source) {
- var options = Object.extend({
- setLeft: true,
- setTop: true,
- setWidth: true,
- setHeight: true,
- offsetTop: 0,
- offsetLeft: 0
- }, arguments[2] || { });
-
- // find page position of source
- source = $(source);
- var p = source.viewportOffset();
-
- // find coordinate system to use
- element = $(element);
- var delta = [0, 0];
- var parent = null;
- // delta [0,0] will do fine with position: fixed elements,
- // position:absolute needs offsetParent deltas
- if (Element.getStyle(element, 'position') == 'absolute') {
- parent = element.getOffsetParent();
- delta = parent.viewportOffset();
- }
-
- // correct by body offsets (fixes Safari)
- if (parent == document.body) {
- delta[0] -= document.body.offsetLeft;
- delta[1] -= document.body.offsetTop;
- }
-
- // set position
- if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
- if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
- if (options.setWidth) element.style.width = source.offsetWidth + 'px';
- if (options.setHeight) element.style.height = source.offsetHeight + 'px';
- return element;
- }
-};
-
-Element.Methods.identify.counter = 1;
-
-Object.extend(Element.Methods, {
- getElementsBySelector: Element.Methods.select,
- childElements: Element.Methods.immediateDescendants
-});
-
-Element._attributeTranslations = {
- write: {
- names: {
- className: 'class',
- htmlFor: 'for'
- },
- values: { }
- }
-};
-
-
-if (!document.createRange || Prototype.Browser.Opera) {
- Element.Methods.insert = function(element, insertions) {
- element = $(element);
-
- if (Object.isString(insertions) || Object.isNumber(insertions) ||
- Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
- insertions = { bottom: insertions };
-
- var t = Element._insertionTranslations, content, position, pos, tagName;
-
- for (position in insertions) {
- content = insertions[position];
- position = position.toLowerCase();
- pos = t[position];
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) {
- pos.insert(element, content);
- continue;
- }
-
- content = Object.toHTML(content);
- tagName = ((position == 'before' || position == 'after')
- ? element.parentNode : element).tagName.toUpperCase();
-
- if (t.tags[tagName]) {
- var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
- if (position == 'top' || position == 'after') fragments.reverse();
- fragments.each(pos.insert.curry(element));
- }
- else element.insertAdjacentHTML(pos.adjacency, content.stripScripts());
-
- content.evalScripts.bind(content).defer();
- }
-
- return element;
- };
-}
-
-if (Prototype.Browser.Opera) {
- Element.Methods._getStyle = Element.Methods.getStyle;
- Element.Methods.getStyle = function(element, style) {
- switch(style) {
- case 'left':
- case 'top':
- case 'right':
- case 'bottom':
- if (Element._getStyle(element, 'position') == 'static') return null;
- default: return Element._getStyle(element, style);
- }
- };
- Element.Methods._readAttribute = Element.Methods.readAttribute;
- Element.Methods.readAttribute = function(element, attribute) {
- if (attribute == 'title') return element.title;
- return Element._readAttribute(element, attribute);
- };
-}
-
-else if (Prototype.Browser.IE) {
- $w('positionedOffset getOffsetParent viewportOffset').each(function(method) {
- Element.Methods[method] = Element.Methods[method].wrap(
- function(proceed, element) {
- element = $(element);
- var position = element.getStyle('position');
- if (position != 'static') return proceed(element);
- element.setStyle({ position: 'relative' });
- var value = proceed(element);
- element.setStyle({ position: position });
- return value;
- }
- );
- });
-
- Element.Methods.getStyle = function(element, style) {
- element = $(element);
- style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
- var value = element.style[style];
- if (!value && element.currentStyle) value = element.currentStyle[style];
-
- if (style == 'opacity') {
- if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
- if (value[1]) return parseFloat(value[1]) / 100;
- return 1.0;
- }
-
- if (value == 'auto') {
- if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
- return element['offset' + style.capitalize()] + 'px';
- return null;
- }
- return value;
- };
-
- Element.Methods.setOpacity = function(element, value) {
- function stripAlpha(filter){
- return filter.replace(/alpha\([^\)]*\)/gi,'');
- }
- element = $(element);
- var currentStyle = element.currentStyle;
- if ((currentStyle && !currentStyle.hasLayout) ||
- (!currentStyle && element.style.zoom == 'normal'))
- element.style.zoom = 1;
-
- var filter = element.getStyle('filter'), style = element.style;
- if (value == 1 || value === '') {
- (filter = stripAlpha(filter)) ?
- style.filter = filter : style.removeAttribute('filter');
- return element;
- } else if (value < 0.00001) value = 0;
- style.filter = stripAlpha(filter) +
- 'alpha(opacity=' + (value * 100) + ')';
- return element;
- };
-
- Element._attributeTranslations = {
- read: {
- names: {
- 'class': 'className',
- 'for': 'htmlFor'
- },
- values: {
- _getAttr: function(element, attribute) {
- return element.getAttribute(attribute, 2);
- },
- _getAttrNode: function(element, attribute) {
- var node = element.getAttributeNode(attribute);
- return node ? node.value : "";
- },
- _getEv: function(element, attribute) {
- var attribute = element.getAttribute(attribute);
- return attribute ? attribute.toString().slice(23, -2) : null;
- },
- _flag: function(element, attribute) {
- return $(element).hasAttribute(attribute) ? attribute : null;
- },
- style: function(element) {
- return element.style.cssText.toLowerCase();
- },
- title: function(element) {
- return element.title;
- }
- }
- }
- };
-
- Element._attributeTranslations.write = {
- names: Object.clone(Element._attributeTranslations.read.names),
- values: {
- checked: function(element, value) {
- element.checked = !!value;
- },
-
- style: function(element, value) {
- element.style.cssText = value ? value : '';
- }
- }
- };
-
- Element._attributeTranslations.has = {};
-
- $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
- 'encType maxLength readOnly longDesc').each(function(attr) {
- Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
- Element._attributeTranslations.has[attr.toLowerCase()] = attr;
- });
-
- (function(v) {
- Object.extend(v, {
- href: v._getAttr,
- src: v._getAttr,
- type: v._getAttr,
- action: v._getAttrNode,
- disabled: v._flag,
- checked: v._flag,
- readonly: v._flag,
- multiple: v._flag,
- onload: v._getEv,
- onunload: v._getEv,
- onclick: v._getEv,
- ondblclick: v._getEv,
- onmousedown: v._getEv,
- onmouseup: v._getEv,
- onmouseover: v._getEv,
- onmousemove: v._getEv,
- onmouseout: v._getEv,
- onfocus: v._getEv,
- onblur: v._getEv,
- onkeypress: v._getEv,
- onkeydown: v._getEv,
- onkeyup: v._getEv,
- onsubmit: v._getEv,
- onreset: v._getEv,
- onselect: v._getEv,
- onchange: v._getEv
- });
- })(Element._attributeTranslations.read.values);
-}
-
-else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
- Element.Methods.setOpacity = function(element, value) {
- element = $(element);
- element.style.opacity = (value == 1) ? 0.999999 :
- (value === '') ? '' : (value < 0.00001) ? 0 : value;
- return element;
- };
-}
-
-else if (Prototype.Browser.WebKit) {
- Element.Methods.setOpacity = function(element, value) {
- element = $(element);
- element.style.opacity = (value == 1 || value === '') ? '' :
- (value < 0.00001) ? 0 : value;
-
- if (value == 1)
- if(element.tagName == 'IMG' && element.width) {
- element.width++; element.width--;
- } else try {
- var n = document.createTextNode(' ');
- element.appendChild(n);
- element.removeChild(n);
- } catch (e) { }
-
- return element;
- };
-
- // Safari returns margins on body which is incorrect if the child is absolutely
- // positioned. For performance reasons, redefine Position.cumulativeOffset for
- // KHTML/WebKit only.
- Element.Methods.cumulativeOffset = function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- if (element.offsetParent == document.body)
- if (Element.getStyle(element, 'position') == 'absolute') break;
-
- element = element.offsetParent;
- } while (element);
-
- return Element._returnOffset(valueL, valueT);
- };
-}
-
-if (Prototype.Browser.IE || Prototype.Browser.Opera) {
- // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
- Element.Methods.update = function(element, content) {
- element = $(element);
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) return element.update().insert(content);
-
- content = Object.toHTML(content);
- var tagName = element.tagName.toUpperCase();
-
- if (tagName in Element._insertionTranslations.tags) {
- $A(element.childNodes).each(function(node) { element.removeChild(node) });
- Element._getContentFromAnonymousElement(tagName, content.stripScripts())
- .each(function(node) { element.appendChild(node) });
- }
- else element.innerHTML = content.stripScripts();
-
- content.evalScripts.bind(content).defer();
- return element;
- };
-}
-
-if (document.createElement('div').outerHTML) {
- Element.Methods.replace = function(element, content) {
- element = $(element);
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) {
- element.parentNode.replaceChild(content, element);
- return element;
- }
-
- content = Object.toHTML(content);
- var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
-
- if (Element._insertionTranslations.tags[tagName]) {
- var nextSibling = element.next();
- var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
- parent.removeChild(element);
- if (nextSibling)
- fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
- else
- fragments.each(function(node) { parent.appendChild(node) });
- }
- else element.outerHTML = content.stripScripts();
-
- content.evalScripts.bind(content).defer();
- return element;
- };
-}
-
-Element._returnOffset = function(l, t) {
- var result = [l, t];
- result.left = l;
- result.top = t;
- return result;
-};
-
-Element._getContentFromAnonymousElement = function(tagName, html) {
- var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
- div.innerHTML = t[0] + html + t[1];
- t[2].times(function() { div = div.firstChild });
- return $A(div.childNodes);
-};
-
-Element._insertionTranslations = {
- before: {
- adjacency: 'beforeBegin',
- insert: function(element, node) {
- element.parentNode.insertBefore(node, element);
- },
- initializeRange: function(element, range) {
- range.setStartBefore(element);
- }
- },
- top: {
- adjacency: 'afterBegin',
- insert: function(element, node) {
- element.insertBefore(node, element.firstChild);
- },
- initializeRange: function(element, range) {
- range.selectNodeContents(element);
- range.collapse(true);
- }
- },
- bottom: {
- adjacency: 'beforeEnd',
- insert: function(element, node) {
- element.appendChild(node);
- }
- },
- after: {
- adjacency: 'afterEnd',
- insert: function(element, node) {
- element.parentNode.insertBefore(node, element.nextSibling);
- },
- initializeRange: function(element, range) {
- range.setStartAfter(element);
- }
- },
- tags: {
- TABLE: ['<table>', '</table>', 1],
- TBODY: ['<table><tbody>', '</tbody></table>', 2],
- TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
- TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
- SELECT: ['<select>', '</select>', 1]
- }
-};
-
-(function() {
- this.bottom.initializeRange = this.top.initializeRange;
- Object.extend(this.tags, {
- THEAD: this.tags.TBODY,
- TFOOT: this.tags.TBODY,
- TH: this.tags.TD
- });
-}).call(Element._insertionTranslations);
-
-Element.Methods.Simulated = {
- hasAttribute: function(element, attribute) {
- attribute = Element._attributeTranslations.has[attribute] || attribute;
- var node = $(element).getAttributeNode(attribute);
- return node && node.specified;
- }
-};
-
-Element.Methods.ByTag = { };
-
-Object.extend(Element, Element.Methods);
-
-if (!Prototype.BrowserFeatures.ElementExtensions &&
- document.createElement('div').__proto__) {
- window.HTMLElement = { };
- window.HTMLElement.prototype = document.createElement('div').__proto__;
- Prototype.BrowserFeatures.ElementExtensions = true;
-}
-
-Element.extend = (function() {
- if (Prototype.BrowserFeatures.SpecificElementExtensions)
- return Prototype.K;
-
- var Methods = { }, ByTag = Element.Methods.ByTag;
-
- var extend = Object.extend(function(element) {
- if (!element || element._extendedByPrototype ||
- element.nodeType != 1 || element == window) return element;
-
- var methods = Object.clone(Methods),
- tagName = element.tagName, property, value;
-
- // extend methods for specific tags
- if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
-
- for (property in methods) {
- value = methods[property];
- if (Object.isFunction(value) && !(property in element))
- element[property] = value.methodize();
- }
-
- element._extendedByPrototype = Prototype.emptyFunction;
- return element;
-
- }, {
- refresh: function() {
- // extend methods for all tags (Safari doesn't need this)
- if (!Prototype.BrowserFeatures.ElementExtensions) {
- Object.extend(Methods, Element.Methods);
- Object.extend(Methods, Element.Methods.Simulated);
- }
- }
- });
-
- extend.refresh();
- return extend;
-})();
-
-Element.hasAttribute = function(element, attribute) {
- if (element.hasAttribute) return element.hasAttribute(attribute);
- return Element.Methods.Simulated.hasAttribute(element, attribute);
-};
-
-Element.addMethods = function(methods) {
- var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
-
- if (!methods) {
- Object.extend(Form, Form.Methods);
- Object.extend(Form.Element, Form.Element.Methods);
- Object.extend(Element.Methods.ByTag, {
- "FORM": Object.clone(Form.Methods),
- "INPUT": Object.clone(Form.Element.Methods),
- "SELECT": Object.clone(Form.Element.Methods),
- "TEXTAREA": Object.clone(Form.Element.Methods)
- });
- }
-
- if (arguments.length == 2) {
- var tagName = methods;
- methods = arguments[1];
- }
-
- if (!tagName) Object.extend(Element.Methods, methods || { });
- else {
- if (Object.isArray(tagName)) tagName.each(extend);
- else extend(tagName);
- }
-
- function extend(tagName) {
- tagName = tagName.toUpperCase();
- if (!Element.Methods.ByTag[tagName])
- Element.Methods.ByTag[tagName] = { };
- Object.extend(Element.Methods.ByTag[tagName], methods);
- }
-
- function copy(methods, destination, onlyIfAbsent) {
- onlyIfAbsent = onlyIfAbsent || false;
- for (var property in methods) {
- var value = methods[property];
- if (!Object.isFunction(value)) continue;
- if (!onlyIfAbsent || !(property in destination))
- destination[property] = value.methodize();
- }
- }
-
- function findDOMClass(tagName) {
- var klass;
- var trans = {
- "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
- "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
- "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
- "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
- "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
- "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
- "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
- "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
- "FrameSet", "IFRAME": "IFrame"
- };
- if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
- if (window[klass]) return window[klass];
- klass = 'HTML' + tagName + 'Element';
- if (window[klass]) return window[klass];
- klass = 'HTML' + tagName.capitalize() + 'Element';
- if (window[klass]) return window[klass];
-
- window[klass] = { };
- window[klass].prototype = document.createElement(tagName).__proto__;
- return window[klass];
- }
-
- if (F.ElementExtensions) {
- copy(Element.Methods, HTMLElement.prototype);
- copy(Element.Methods.Simulated, HTMLElement.prototype, true);
- }
-
- if (F.SpecificElementExtensions) {
- for (var tag in Element.Methods.ByTag) {
- var klass = findDOMClass(tag);
- if (Object.isUndefined(klass)) continue;
- copy(T[tag], klass.prototype);
- }
- }
-
- Object.extend(Element, Element.Methods);
- delete Element.ByTag;
-
- if (Element.extend.refresh) Element.extend.refresh();
- Element.cache = { };
-};
-
-document.viewport = {
- getDimensions: function() {
- var dimensions = { };
- $w('width height').each(function(d) {
- var D = d.capitalize();
- dimensions[d] = self['inner' + D] ||
- (document.documentElement['client' + D] || document.body['client' + D]);
- });
- return dimensions;
- },
-
- getWidth: function() {
- return this.getDimensions().width;
- },
-
- getHeight: function() {
- return this.getDimensions().height;
- },
-
- getScrollOffsets: function() {
- return Element._returnOffset(
- window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
- window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
- }
-};
-/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
- * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
- * license. Please see http://www.yui-ext.com/ for more information. */
-
-var Selector = Class.create({
- initialize: function(expression) {
- this.expression = expression.strip();
- this.compileMatcher();
- },
-
- compileMatcher: function() {
- // Selectors with namespaced attributes can't use the XPath version
- if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression))
- return this.compileXPathMatcher();
-
- var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
- c = Selector.criteria, le, p, m;
-
- if (Selector._cache[e]) {
- this.matcher = Selector._cache[e];
- return;
- }
-
- this.matcher = ["this.matcher = function(root) {",
- "var r = root, h = Selector.handlers, c = false, n;"];
-
- while (e && le != e && (/\S/).test(e)) {
- le = e;
- for (var i in ps) {
- p = ps[i];
- if (m = e.match(p)) {
- this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
- new Template(c[i]).evaluate(m));
- e = e.replace(m[0], '');
- break;
- }
- }
- }
-
- this.matcher.push("return h.unique(n);\n}");
- eval(this.matcher.join('\n'));
- Selector._cache[this.expression] = this.matcher;
- },
-
- compileXPathMatcher: function() {
- var e = this.expression, ps = Selector.patterns,
- x = Selector.xpath, le, m;
-
- if (Selector._cache[e]) {
- this.xpath = Selector._cache[e]; return;
- }
-
- this.matcher = ['.//*'];
- while (e && le != e && (/\S/).test(e)) {
- le = e;
- for (var i in ps) {
- if (m = e.match(ps[i])) {
- this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
- new Template(x[i]).evaluate(m));
- e = e.replace(m[0], '');
- break;
- }
- }
- }
-
- this.xpath = this.matcher.join('');
- Selector._cache[this.expression] = this.xpath;
- },
-
- findElements: function(root) {
- root = root || document;
- if (this.xpath) return document._getElementsByXPath(this.xpath, root);
- return this.matcher(root);
- },
-
- match: function(element) {
- this.tokens = [];
-
- var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
- var le, p, m;
-
- while (e && le !== e && (/\S/).test(e)) {
- le = e;
- for (var i in ps) {
- p = ps[i];
- if (m = e.match(p)) {
- // use the Selector.assertions methods unless the selector
- // is too complex.
- if (as[i]) {
- this.tokens.push([i, Object.clone(m)]);
- e = e.replace(m[0], '');
- } else {
- // reluctantly do a document-wide search
- // and look for a match in the array
- return this.findElements(document).include(element);
- }
- }
- }
- }
-
- var match = true, name, matches;
- for (var i = 0, token; token = this.tokens[i]; i++) {
- name = token[0], matches = token[1];
- if (!Selector.assertions[name](element, matches)) {
- match = false; break;
- }
- }
-
- return match;
- },
-
- toString: function() {
- return this.expression;
- },
-
- inspect: function() {
- return "#<Selector:" + this.expression.inspect() + ">";
- }
-});
-
-Object.extend(Selector, {
- _cache: { },
-
- xpath: {
- descendant: "//*",
- child: "/*",
- adjacent: "/following-sibling::*[1]",
- laterSibling: '/following-sibling::*',
- tagName: function(m) {
- if (m[1] == '*') return '';
- return "[local-name()='" + m[1].toLowerCase() +
- "' or local-name()='" + m[1].toUpperCase() + "']";
- },
- className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
- id: "[@id='#{1}']",
- attrPresence: "[@#{1}]",
- attr: function(m) {
- m[3] = m[5] || m[6];
- return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
- },
- pseudo: function(m) {
- var h = Selector.xpath.pseudos[m[1]];
- if (!h) return '';
- if (Object.isFunction(h)) return h(m);
- return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
- },
- operators: {
- '=': "[@#{1}='#{3}']",
- '!=': "[@#{1}!='#{3}']",
- '^=': "[starts-with(@#{1}, '#{3}')]",
- '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
- '*=': "[contains(@#{1}, '#{3}')]",
- '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
- '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
- },
- pseudos: {
- 'first-child': '[not(preceding-sibling::*)]',
- 'last-child': '[not(following-sibling::*)]',
- 'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
- 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
- 'checked': "[@checked]",
- 'disabled': "[@disabled]",
- 'enabled': "[not(@disabled)]",
- 'not': function(m) {
- var e = m[6], p = Selector.patterns,
- x = Selector.xpath, le, m, v;
-
- var exclusion = [];
- while (e && le != e && (/\S/).test(e)) {
- le = e;
- for (var i in p) {
- if (m = e.match(p[i])) {
- v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
- exclusion.push("(" + v.substring(1, v.length - 1) + ")");
- e = e.replace(m[0], '');
- break;
- }
- }
- }
- return "[not(" + exclusion.join(" and ") + ")]";
- },
- 'nth-child': function(m) {
- return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
- },
- 'nth-last-child': function(m) {
- return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
- },
- 'nth-of-type': function(m) {
- return Selector.xpath.pseudos.nth("position() ", m);
- },
- 'nth-last-of-type': function(m) {
- return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
- },
- 'first-of-type': function(m) {
- m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
- },
- 'last-of-type': function(m) {
- m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
- },
- 'only-of-type': function(m) {
- var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
- },
- nth: function(fragment, m) {
- var mm, formula = m[6], predicate;
- if (formula == 'even') formula = '2n+0';
- if (formula == 'odd') formula = '2n+1';
- if (mm = formula.match(/^(\d+)$/)) // digit only
- return '[' + fragment + "= " + mm[1] + ']';
- if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
- if (mm[1] == "-") mm[1] = -1;
- var a = mm[1] ? Number(mm[1]) : 1;
- var b = mm[2] ? Number(mm[2]) : 0;
- predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
- "((#{fragment} - #{b}) div #{a} >= 0)]";
- return new Template(predicate).evaluate({
- fragment: fragment, a: a, b: b });
- }
- }
- }
- },
-
- criteria: {
- tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
- className: 'n = h.className(n, r, "#{1}", c); c = false;',
- id: 'n = h.id(n, r, "#{1}", c); c = false;',
- attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;',
- attr: function(m) {
- m[3] = (m[5] || m[6]);
- return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
- },
- pseudo: function(m) {
- if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
- return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
- },
- descendant: 'c = "descendant";',
- child: 'c = "child";',
- adjacent: 'c = "adjacent";',
- laterSibling: 'c = "laterSibling";'
- },
-
- patterns: {
- // combinators must be listed first
- // (and descendant needs to be last combinator)
- laterSibling: /^\s*~\s*/,
- child: /^\s*>\s*/,
- adjacent: /^\s*\+\s*/,
- descendant: /^\s/,
-
- // selectors follow
- tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
- id: /^#([\w\-\*]+)(\b|$)/,
- className: /^\.([\w\-\*]+)(\b|$)/,
- pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,
- attrPresence: /^\[([\w]+)\]/,
- attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
- },
-
- // for Selector.match and Element#match
- assertions: {
- tagName: function(element, matches) {
- return matches[1].toUpperCase() == element.tagName.toUpperCase();
- },
-
- className: function(element, matches) {
- return Element.hasClassName(element, matches[1]);
- },
-
- id: function(element, matches) {
- return element.id === matches[1];
- },
-
- attrPresence: function(element, matches) {
- return Element.hasAttribute(element, matches[1]);
- },
-
- attr: function(element, matches) {
- var nodeValue = Element.readAttribute(element, matches[1]);
- return Selector.operators[matches[2]](nodeValue, matches[3]);
- }
- },
-
- handlers: {
- // UTILITY FUNCTIONS
- // joins two collections
- concat: function(a, b) {
- for (var i = 0, node; node = b[i]; i++)
- a.push(node);
- return a;
- },
-
- // marks an array of nodes for counting
- mark: function(nodes) {
- for (var i = 0, node; node = nodes[i]; i++)
- node._counted = true;
- return nodes;
- },
-
- unmark: function(nodes) {
- for (var i = 0, node; node = nodes[i]; i++)
- node._counted = undefined;
- return nodes;
- },
-
- // mark each child node with its position (for nth calls)
- // "ofType" flag indicates whether we're indexing for nth-of-type
- // rather than nth-child
- index: function(parentNode, reverse, ofType) {
- parentNode._counted = true;
- if (reverse) {
- for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
- var node = nodes[i];
- if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
- }
- } else {
- for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
- if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
- }
- },
-
- // filters out duplicates and extends all nodes
- unique: function(nodes) {
- if (nodes.length == 0) return nodes;
- var results = [], n;
- for (var i = 0, l = nodes.length; i < l; i++)
- if (!(n = nodes[i])._counted) {
- n._counted = true;
- results.push(Element.extend(n));
- }
- return Selector.handlers.unmark(results);
- },
-
- // COMBINATOR FUNCTIONS
- descendant: function(nodes) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- h.concat(results, node.getElementsByTagName('*'));
- return results;
- },
-
- child: function(nodes) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- for (var j = 0, children = [], child; child = node.childNodes[j]; j++)
- if (child.nodeType == 1 && child.tagName != '!') results.push(child);
- }
- return results;
- },
-
- adjacent: function(nodes) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- var next = this.nextElementSibling(node);
- if (next) results.push(next);
- }
- return results;
- },
-
- laterSibling: function(nodes) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- h.concat(results, Element.nextSiblings(node));
- return results;
- },
-
- nextElementSibling: function(node) {
- while (node = node.nextSibling)
- if (node.nodeType == 1) return node;
- return null;
- },
-
- previousElementSibling: function(node) {
- while (node = node.previousSibling)
- if (node.nodeType == 1) return node;
- return null;
- },
-
- // TOKEN FUNCTIONS
- tagName: function(nodes, root, tagName, combinator) {
- tagName = tagName.toUpperCase();
- var results = [], h = Selector.handlers;
- if (nodes) {
- if (combinator) {
- // fastlane for ordinary descendant combinators
- if (combinator == "descendant") {
- for (var i = 0, node; node = nodes[i]; i++)
- h.concat(results, node.getElementsByTagName(tagName));
- return results;
- } else nodes = this[combinator](nodes);
- if (tagName == "*") return nodes;
- }
- for (var i = 0, node; node = nodes[i]; i++)
- if (node.tagName.toUpperCase() == tagName) results.push(node);
- return results;
- } else return root.getElementsByTagName(tagName);
- },
-
- id: function(nodes, root, id, combinator) {
- var targetNode = $(id), h = Selector.handlers;
- if (!targetNode) return [];
- if (!nodes && root == document) return [targetNode];
- if (nodes) {
- if (combinator) {
- if (combinator == 'child') {
- for (var i = 0, node; node = nodes[i]; i++)
- if (targetNode.parentNode == node) return [targetNode];
- } else if (combinator == 'descendant') {
- for (var i = 0, node; node = nodes[i]; i++)
- if (Element.descendantOf(targetNode, node)) return [targetNode];
- } else if (combinator == 'adjacent') {
- for (var i = 0, node; node = nodes[i]; i++)
- if (Selector.handlers.previousElementSibling(targetNode) == node)
- return [targetNode];
- } else nodes = h[combinator](nodes);
- }
- for (var i = 0, node; node = nodes[i]; i++)
- if (node == targetNode) return [targetNode];
- return [];
- }
- return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
- },
-
- className: function(nodes, root, className, combinator) {
- if (nodes && combinator) nodes = this[combinator](nodes);
- return Selector.handlers.byClassName(nodes, root, className);
- },
-
- byClassName: function(nodes, root, className) {
- if (!nodes) nodes = Selector.handlers.descendant([root]);
- var needle = ' ' + className + ' ';
- for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
- nodeClassName = node.className;
- if (nodeClassName.length == 0) continue;
- if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
- results.push(node);
- }
- return results;
- },
-
- attrPresence: function(nodes, root, attr) {
- if (!nodes) nodes = root.getElementsByTagName("*");
- var results = [];
- for (var i = 0, node; node = nodes[i]; i++)
- if (Element.hasAttribute(node, attr)) results.push(node);
- return results;
- },
-
- attr: function(nodes, root, attr, value, operator) {
- if (!nodes) nodes = root.getElementsByTagName("*");
- var handler = Selector.operators[operator], results = [];
- for (var i = 0, node; node = nodes[i]; i++) {
- var nodeValue = Element.readAttribute(node, attr);
- if (nodeValue === null) continue;
- if (handler(nodeValue, value)) results.push(node);
- }
- return results;
- },
-
- pseudo: function(nodes, name, value, root, combinator) {
- if (nodes && combinator) nodes = this[combinator](nodes);
- if (!nodes) nodes = root.getElementsByTagName("*");
- return Selector.pseudos[name](nodes, value, root);
- }
- },
-
- pseudos: {
- 'first-child': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- if (Selector.handlers.previousElementSibling(node)) continue;
- results.push(node);
- }
- return results;
- },
- 'last-child': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- if (Selector.handlers.nextElementSibling(node)) continue;
- results.push(node);
- }
- return results;
- },
- 'only-child': function(nodes, value, root) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
- results.push(node);
- return results;
- },
- 'nth-child': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root);
- },
- 'nth-last-child': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root, true);
- },
- 'nth-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root, false, true);
- },
- 'nth-last-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root, true, true);
- },
- 'first-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, "1", root, false, true);
- },
- 'last-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, "1", root, true, true);
- },
- 'only-of-type': function(nodes, formula, root) {
- var p = Selector.pseudos;
- return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
- },
-
- // handles the an+b logic
- getIndices: function(a, b, total) {
- if (a == 0) return b > 0 ? [b] : [];
- return $R(1, total).inject([], function(memo, i) {
- if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
- return memo;
- });
- },
-
- // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
- nth: function(nodes, formula, root, reverse, ofType) {
- if (nodes.length == 0) return [];
- if (formula == 'even') formula = '2n+0';
- if (formula == 'odd') formula = '2n+1';
- var h = Selector.handlers, results = [], indexed = [], m;
- h.mark(nodes);
- for (var i = 0, node; node = nodes[i]; i++) {
- if (!node.parentNode._counted) {
- h.index(node.parentNode, reverse, ofType);
- indexed.push(node.parentNode);
- }
- }
- if (formula.match(/^\d+$/)) { // just a number
- formula = Number(formula);
- for (var i = 0, node; node = nodes[i]; i++)
- if (node.nodeIndex == formula) results.push(node);
- } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
- if (m[1] == "-") m[1] = -1;
- var a = m[1] ? Number(m[1]) : 1;
- var b = m[2] ? Number(m[2]) : 0;
- var indices = Selector.pseudos.getIndices(a, b, nodes.length);
- for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
- for (var j = 0; j < l; j++)
- if (node.nodeIndex == indices[j]) results.push(node);
- }
- }
- h.unmark(nodes);
- h.unmark(indexed);
- return results;
- },
-
- 'empty': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- // IE treats comments as element nodes
- if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
- results.push(node);
- }
- return results;
- },
-
- 'not': function(nodes, selector, root) {
- var h = Selector.handlers, selectorType, m;
- var exclusions = new Selector(selector).findElements(root);
- h.mark(exclusions);
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (!node._counted) results.push(node);
- h.unmark(exclusions);
- return results;
- },
-
- 'enabled': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (!node.disabled) results.push(node);
- return results;
- },
-
- 'disabled': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (node.disabled) results.push(node);
- return results;
- },
-
- 'checked': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (node.checked) results.push(node);
- return results;
- }
- },
-
- operators: {
- '=': function(nv, v) { return nv == v; },
- '!=': function(nv, v) { return nv != v; },
- '^=': function(nv, v) { return nv.startsWith(v); },
- '$=': function(nv, v) { return nv.endsWith(v); },
- '*=': function(nv, v) { return nv.include(v); },
- '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
- '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
- },
-
- matchElements: function(elements, expression) {
- var matches = new Selector(expression).findElements(), h = Selector.handlers;
- h.mark(matches);
- for (var i = 0, results = [], element; element = elements[i]; i++)
- if (element._counted) results.push(element);
- h.unmark(matches);
- return results;
- },
-
- findElement: function(elements, expression, index) {
- if (Object.isNumber(expression)) {
- index = expression; expression = false;
- }
- return Selector.matchElements(elements, expression || '*')[index || 0];
- },
-
- findChildElements: function(element, expressions) {
- var exprs = expressions.join(','), expressions = [];
- exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
- expressions.push(m[1].strip());
- });
- var results = [], h = Selector.handlers;
- for (var i = 0, l = expressions.length, selector; i < l; i++) {
- selector = new Selector(expressions[i].strip());
- h.concat(results, selector.findElements(element));
- }
- return (l > 1) ? h.unique(results) : results;
- }
-});
-
-function $$() {
- return Selector.findChildElements(document, $A(arguments));
-}
-var Form = {
- reset: function(form) {
- $(form).reset();
- return form;
- },
-
- serializeElements: function(elements, options) {
- if (typeof options != 'object') options = { hash: !!options };
- else if (options.hash === undefined) options.hash = true;
- var key, value, submitted = false, submit = options.submit;
-
- var data = elements.inject({ }, function(result, element) {
- if (!element.disabled && element.name) {
- key = element.name; value = $(element).getValue();
- if (value != null && (element.type != 'submit' || (!submitted &&
- submit !== false && (!submit || key == submit) && (submitted = true)))) {
- if (key in result) {
- // a key is already present; construct an array of values
- if (!Object.isArray(result[key])) result[key] = [result[key]];
- result[key].push(value);
- }
- else result[key] = value;
- }
- }
- return result;
- });
-
- return options.hash ? data : Object.toQueryString(data);
- }
-};
-
-Form.Methods = {
- serialize: function(form, options) {
- return Form.serializeElements(Form.getElements(form), options);
- },
-
- getElements: function(form) {
- return $A($(form).getElementsByTagName('*')).inject([],
- function(elements, child) {
- if (Form.Element.Serializers[child.tagName.toLowerCase()])
- elements.push(Element.extend(child));
- return elements;
- }
- );
- },
-
- getInputs: function(form, typeName, name) {
- form = $(form);
- var inputs = form.getElementsByTagName('input');
-
- if (!typeName && !name) return $A(inputs).map(Element.extend);
-
- for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
- var input = inputs[i];
- if ((typeName && input.type != typeName) || (name && input.name != name))
- continue;
- matchingInputs.push(Element.extend(input));
- }
-
- return matchingInputs;
- },
-
- disable: function(form) {
- form = $(form);
- Form.getElements(form).invoke('disable');
- return form;
- },
-
- enable: function(form) {
- form = $(form);
- Form.getElements(form).invoke('enable');
- return form;
- },
-
- findFirstElement: function(form) {
- var elements = $(form).getElements().findAll(function(element) {
- return 'hidden' != element.type && !element.disabled;
- });
- var firstByIndex = elements.findAll(function(element) {
- return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
- }).sortBy(function(element) { return element.tabIndex }).first();
-
- return firstByIndex ? firstByIndex : elements.find(function(element) {
- return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
- });
- },
-
- focusFirstElement: function(form) {
- form = $(form);
- form.findFirstElement().activate();
- return form;
- },
-
- request: function(form, options) {
- form = $(form), options = Object.clone(options || { });
-
- var params = options.parameters, action = form.readAttribute('action') || '';
- if (action.blank()) action = window.location.href;
- options.parameters = form.serialize(true);
-
- if (params) {
- if (Object.isString(params)) params = params.toQueryParams();
- Object.extend(options.parameters, params);
- }
-
- if (form.hasAttribute('method') && !options.method)
- options.method = form.method;
-
- return new Ajax.Request(action, options);
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-Form.Element = {
- focus: function(element) {
- $(element).focus();
- return element;
- },
-
- select: function(element) {
- $(element).select();
- return element;
- }
-};
-
-Form.Element.Methods = {
- serialize: function(element) {
- element = $(element);
- if (!element.disabled && element.name) {
- var value = element.getValue();
- if (value != undefined) {
- var pair = { };
- pair[element.name] = value;
- return Object.toQueryString(pair);
- }
- }
- return '';
- },
-
- getValue: function(element) {
- element = $(element);
- var method = element.tagName.toLowerCase();
- return Form.Element.Serializers[method](element);
- },
-
- setValue: function(element, value) {
- element = $(element);
- var method = element.tagName.toLowerCase();
- Form.Element.Serializers[method](element, value);
- return element;
- },
-
- clear: function(element) {
- $(element).value = '';
- return element;
- },
-
- present: function(element) {
- return $(element).value != '';
- },
-
- activate: function(element) {
- element = $(element);
- try {
- element.focus();
- if (element.select && (element.tagName.toLowerCase() != 'input' ||
- !['button', 'reset', 'submit'].include(element.type)))
- element.select();
- } catch (e) { }
- return element;
- },
-
- disable: function(element) {
- element = $(element);
- element.blur();
- element.disabled = true;
- return element;
- },
-
- enable: function(element) {
- element = $(element);
- element.disabled = false;
- return element;
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-var Field = Form.Element;
-var $F = Form.Element.Methods.getValue;
-
-/*--------------------------------------------------------------------------*/
-
-Form.Element.Serializers = {
- input: function(element, value) {
- switch (element.type.toLowerCase()) {
- case 'checkbox':
- case 'radio':
- return Form.Element.Serializers.inputSelector(element, value);
- default:
- return Form.Element.Serializers.textarea(element, value);
- }
- },
-
- inputSelector: function(element, value) {
- if (value === undefined) return element.checked ? element.value : null;
- else element.checked = !!value;
- },
-
- textarea: function(element, value) {
- if (value === undefined) return element.value;
- else element.value = value;
- },
-
- select: function(element, index) {
- if (index === undefined)
- return this[element.type == 'select-one' ?
- 'selectOne' : 'selectMany'](element);
- else {
- var opt, value, single = !Object.isArray(index);
- for (var i = 0, length = element.length; i < length; i++) {
- opt = element.options[i];
- value = this.optionValue(opt);
- if (single) {
- if (value == index) {
- opt.selected = true;
- return;
- }
- }
- else opt.selected = index.include(value);
- }
- }
- },
-
- selectOne: function(element) {
- var index = element.selectedIndex;
- return index >= 0 ? this.optionValue(element.options[index]) : null;
- },
-
- selectMany: function(element) {
- var values, length = element.length;
- if (!length) return null;
-
- for (var i = 0, values = []; i < length; i++) {
- var opt = element.options[i];
- if (opt.selected) values.push(this.optionValue(opt));
- }
- return values;
- },
-
- optionValue: function(opt) {
- // extend element because hasAttribute may not be native
- return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
- initialize: function($super, element, frequency, callback) {
- $super(callback, frequency);
- this.element = $(element);
- this.lastValue = this.getValue();
- },
-
- execute: function() {
- var value = this.getValue();
- if (Object.isString(this.lastValue) && Object.isString(value) ?
- this.lastValue != value : String(this.lastValue) != String(value)) {
- this.callback(this.element, value);
- this.lastValue = value;
- }
- }
-});
-
-Form.Element.Observer = Class.create(Abstract.TimedObserver, {
- getValue: function() {
- return Form.Element.getValue(this.element);
- }
-});
-
-Form.Observer = Class.create(Abstract.TimedObserver, {
- getValue: function() {
- return Form.serialize(this.element);
- }
-});
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.EventObserver = Class.create({
- initialize: function(element, callback) {
- this.element = $(element);
- this.callback = callback;
-
- this.lastValue = this.getValue();
- if (this.element.tagName.toLowerCase() == 'form')
- this.registerFormCallbacks();
- else
- this.registerCallback(this.element);
- },
-
- onElementEvent: function() {
- var value = this.getValue();
- if (this.lastValue != value) {
- this.callback(this.element, value);
- this.lastValue = value;
- }
- },
-
- registerFormCallbacks: function() {
- Form.getElements(this.element).each(this.registerCallback, this);
- },
-
- registerCallback: function(element) {
- if (element.type) {
- switch (element.type.toLowerCase()) {
- case 'checkbox':
- case 'radio':
- Event.observe(element, 'click', this.onElementEvent.bind(this));
- break;
- default:
- Event.observe(element, 'change', this.onElementEvent.bind(this));
- break;
- }
- }
- }
-});
-
-Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
- getValue: function() {
- return Form.Element.getValue(this.element);
- }
-});
-
-Form.EventObserver = Class.create(Abstract.EventObserver, {
- getValue: function() {
- return Form.serialize(this.element);
- }
-});
-if (!window.Event) var Event = { };
-
-Object.extend(Event, {
- KEY_BACKSPACE: 8,
- KEY_TAB: 9,
- KEY_RETURN: 13,
- KEY_ESC: 27,
- KEY_LEFT: 37,
- KEY_UP: 38,
- KEY_RIGHT: 39,
- KEY_DOWN: 40,
- KEY_DELETE: 46,
- KEY_HOME: 36,
- KEY_END: 35,
- KEY_PAGEUP: 33,
- KEY_PAGEDOWN: 34,
- KEY_INSERT: 45,
-
- cache: { },
-
- relatedTarget: function(event) {
- var element;
- switch(event.type) {
- case 'mouseover': element = event.fromElement; break;
- case 'mouseout': element = event.toElement; break;
- default: return null;
- }
- return Element.extend(element);
- }
-});
-
-Event.Methods = (function() {
- var isButton;
-
- if (Prototype.Browser.IE) {
- var buttonMap = { 0: 1, 1: 4, 2: 2 };
- isButton = function(event, code) {
- return event.button == buttonMap[code];
- };
-
- } else if (Prototype.Browser.WebKit) {
- isButton = function(event, code) {
- switch (code) {
- case 0: return event.which == 1 && !event.metaKey;
- case 1: return event.which == 1 && event.metaKey;
- default: return false;
- }
- };
-
- } else {
- isButton = function(event, code) {
- return event.which ? (event.which === code + 1) : (event.button === code);
- };
- }
-
- return {
- isLeftClick: function(event) { return isButton(event, 0) },
- isMiddleClick: function(event) { return isButton(event, 1) },
- isRightClick: function(event) { return isButton(event, 2) },
-
- element: function(event) {
- var node = Event.extend(event).target;
- return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node);
- },
-
- findElement: function(event, expression) {
- var element = Event.element(event);
- return element.match(expression) ? element : element.up(expression);
- },
-
- pointer: function(event) {
- return {
- x: event.pageX || (event.clientX +
- (document.documentElement.scrollLeft || document.body.scrollLeft)),
- y: event.pageY || (event.clientY +
- (document.documentElement.scrollTop || document.body.scrollTop))
- };
- },
-
- pointerX: function(event) { return Event.pointer(event).x },
- pointerY: function(event) { return Event.pointer(event).y },
-
- stop: function(event) {
- Event.extend(event);
- event.preventDefault();
- event.stopPropagation();
- event.stopped = true;
- }
- };
-})();
-
-Event.extend = (function() {
- var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
- m[name] = Event.Methods[name].methodize();
- return m;
- });
-
- if (Prototype.Browser.IE) {
- Object.extend(methods, {
- stopPropagation: function() { this.cancelBubble = true },
- preventDefault: function() { this.returnValue = false },
- inspect: function() { return "[object Event]" }
- });
-
- return function(event) {
- if (!event) return false;
- if (event._extendedByPrototype) return event;
-
- event._extendedByPrototype = Prototype.emptyFunction;
- var pointer = Event.pointer(event);
- Object.extend(event, {
- target: event.srcElement,
- relatedTarget: Event.relatedTarget(event),
- pageX: pointer.x,
- pageY: pointer.y
- });
- return Object.extend(event, methods);
- };
-
- } else {
- Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__;
- Object.extend(Event.prototype, methods);
- return Prototype.K;
- }
-})();
-
-Object.extend(Event, (function() {
- var cache = Event.cache;
-
- function getEventID(element) {
- if (element._eventID) return element._eventID;
- arguments.callee.id = arguments.callee.id || 1;
- return element._eventID = ++arguments.callee.id;
- }
-
- function getDOMEventName(eventName) {
- if (eventName && eventName.include(':')) return "dataavailable";
- return eventName;
- }
-
- function getCacheForID(id) {
- return cache[id] = cache[id] || { };
- }
-
- function getWrappersForEventName(id, eventName) {
- var c = getCacheForID(id);
- return c[eventName] = c[eventName] || [];
- }
-
- function createWrapper(element, eventName, handler) {
- var id = getEventID(element);
- var c = getWrappersForEventName(id, eventName);
- if (c.pluck("handler").include(handler)) return false;
-
- var wrapper = function(event) {
- if (!Event || !Event.extend ||
- (event.eventName && event.eventName != eventName))
- return false;
-
- Event.extend(event);
- handler.call(element, event)
- };
-
- wrapper.handler = handler;
- c.push(wrapper);
- return wrapper;
- }
-
- function findWrapper(id, eventName, handler) {
- var c = getWrappersForEventName(id, eventName);
- return c.find(function(wrapper) { return wrapper.handler == handler });
- }
-
- function destroyWrapper(id, eventName, handler) {
- var c = getCacheForID(id);
- if (!c[eventName]) return false;
- c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
- }
-
- function destroyCache() {
- for (var id in cache)
- for (var eventName in cache[id])
- cache[id][eventName] = null;
- }
-
- if (window.attachEvent) {
- window.attachEvent("onunload", destroyCache);
- }
-
- return {
- observe: function(element, eventName, handler) {
- element = $(element);
- var name = getDOMEventName(eventName);
-
- var wrapper = createWrapper(element, eventName, handler);
- if (!wrapper) return element;
-
- if (element.addEventListener) {
- element.addEventListener(name, wrapper, false);
- } else {
- element.attachEvent("on" + name, wrapper);
- }
-
- return element;
- },
-
- stopObserving: function(element, eventName, handler) {
- element = $(element);
- var id = getEventID(element), name = getDOMEventName(eventName);
-
- if (!handler && eventName) {
- getWrappersForEventName(id, eventName).each(function(wrapper) {
- element.stopObserving(eventName, wrapper.handler);
- });
- return element;
-
- } else if (!eventName) {
- Object.keys(getCacheForID(id)).each(function(eventName) {
- element.stopObserving(eventName);
- });
- return element;
- }
-
- var wrapper = findWrapper(id, eventName, handler);
- if (!wrapper) return element;
-
- if (element.removeEventListener) {
- element.removeEventListener(name, wrapper, false);
- } else {
- element.detachEvent("on" + name, wrapper);
- }
-
- destroyWrapper(id, eventName, handler);
-
- return element;
- },
-
- fire: function(element, eventName, memo) {
- element = $(element);
- if (element == document && document.createEvent && !element.dispatchEvent)
- element = document.documentElement;
-
- if (document.createEvent) {
- var event = document.createEvent("HTMLEvents");
- event.initEvent("dataavailable", true, true);
- } else {
- var event = document.createEventObject();
- event.eventType = "ondataavailable";
- }
-
- event.eventName = eventName;
- event.memo = memo || { };
-
- if (document.createEvent) {
- element.dispatchEvent(event);
- } else {
- element.fireEvent(event.eventType, event);
- }
-
- return event;
- }
- };
-})());
-
-Object.extend(Event, Event.Methods);
-
-Element.addMethods({
- fire: Event.fire,
- observe: Event.observe,
- stopObserving: Event.stopObserving
-});
-
-Object.extend(document, {
- fire: Element.Methods.fire.methodize(),
- observe: Element.Methods.observe.methodize(),
- stopObserving: Element.Methods.stopObserving.methodize()
-});
-
-(function() {
- /* Support for the DOMContentLoaded event is based on work by Dan Webb,
- Matthias Miller, Dean Edwards and John Resig. */
-
- var timer, fired = false;
-
- function fireContentLoadedEvent() {
- if (fired) return;
- if (timer) window.clearInterval(timer);
- document.fire("dom:loaded");
- fired = true;
- }
-
- if (document.addEventListener) {
- if (Prototype.Browser.WebKit) {
- timer = window.setInterval(function() {
- if (/loaded|complete/.test(document.readyState))
- fireContentLoadedEvent();
- }, 0);
-
- Event.observe(window, "load", fireContentLoadedEvent);
-
- } else {
- document.addEventListener("DOMContentLoaded",
- fireContentLoadedEvent, false);
- }
-
- } else {
- document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
- $("__onDOMContentLoaded").onreadystatechange = function() {
- if (this.readyState == "complete") {
- this.onreadystatechange = null;
- fireContentLoadedEvent();
- }
- };
- }
-})();
-/*------------------------------- DEPRECATED -------------------------------*/
-
-Hash.toQueryString = Object.toQueryString;
-
-var Toggle = { display: Element.toggle };
-
-Element.Methods.childOf = Element.Methods.descendantOf;
-
-var Insertion = {
- Before: function(element, content) {
- return Element.insert(element, {before:content});
- },
-
- Top: function(element, content) {
- return Element.insert(element, {top:content});
- },
-
- Bottom: function(element, content) {
- return Element.insert(element, {bottom:content});
- },
-
- After: function(element, content) {
- return Element.insert(element, {after:content});
- }
-};
-
-var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
-
-// This should be moved to script.aculo.us; notice the deprecated methods
-// further below, that map to the newer Element methods.
-var Position = {
- // set to true if needed, warning: firefox performance problems
- // NOT neeeded for page scrolling, only if draggable contained in
- // scrollable elements
- includeScrollOffsets: false,
-
- // must be called before calling withinIncludingScrolloffset, every time the
- // page is scrolled
- prepare: function() {
- this.deltaX = window.pageXOffset
- || document.documentElement.scrollLeft
- || document.body.scrollLeft
- || 0;
- this.deltaY = window.pageYOffset
- || document.documentElement.scrollTop
- || document.body.scrollTop
- || 0;
- },
-
- // caches x/y coordinate pair to use with overlap
- within: function(element, x, y) {
- if (this.includeScrollOffsets)
- return this.withinIncludingScrolloffsets(element, x, y);
- this.xcomp = x;
- this.ycomp = y;
- this.offset = Element.cumulativeOffset(element);
-
- return (y >= this.offset[1] &&
- y < this.offset[1] + element.offsetHeight &&
- x >= this.offset[0] &&
- x < this.offset[0] + element.offsetWidth);
- },
-
- withinIncludingScrolloffsets: function(element, x, y) {
- var offsetcache = Element.cumulativeScrollOffset(element);
-
- this.xcomp = x + offsetcache[0] - this.deltaX;
- this.ycomp = y + offsetcache[1] - this.deltaY;
- this.offset = Element.cumulativeOffset(element);
-
- return (this.ycomp >= this.offset[1] &&
- this.ycomp < this.offset[1] + element.offsetHeight &&
- this.xcomp >= this.offset[0] &&
- this.xcomp < this.offset[0] + element.offsetWidth);
- },
-
- // within must be called directly before
- overlap: function(mode, element) {
- if (!mode) return 0;
- if (mode == 'vertical')
- return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
- element.offsetHeight;
- if (mode == 'horizontal')
- return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
- element.offsetWidth;
- },
-
- // Deprecation layer -- use newer Element methods now (1.5.2).
-
- cumulativeOffset: Element.Methods.cumulativeOffset,
-
- positionedOffset: Element.Methods.positionedOffset,
-
- absolutize: function(element) {
- Position.prepare();
- return Element.absolutize(element);
- },
-
- relativize: function(element) {
- Position.prepare();
- return Element.relativize(element);
- },
-
- realOffset: Element.Methods.cumulativeScrollOffset,
-
- offsetParent: Element.Methods.getOffsetParent,
-
- page: Element.Methods.viewportOffset,
-
- clone: function(source, target, options) {
- options = options || { };
- return Element.clonePosition(target, source, options);
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
- function iter(name) {
- return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
- }
-
- instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
- function(element, className) {
- className = className.toString().strip();
- var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
- return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
- } : function(element, className) {
- className = className.toString().strip();
- var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
- if (!classNames && !className) return elements;
-
- var nodes = $(element).getElementsByTagName('*');
- className = ' ' + className + ' ';
-
- for (var i = 0, child, cn; child = nodes[i]; i++) {
- if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
- (classNames && classNames.all(function(name) {
- return !name.toString().blank() && cn.include(' ' + name + ' ');
- }))))
- elements.push(Element.extend(child));
- }
- return elements;
- };
-
- return function(className, parentElement) {
- return $(parentElement || document.body).getElementsByClassName(className);
- };
-}(Element.Methods);
-
-/*--------------------------------------------------------------------------*/
-
-Element.ClassNames = Class.create();
-Element.ClassNames.prototype = {
- initialize: function(element) {
- this.element = $(element);
- },
-
- _each: function(iterator) {
- this.element.className.split(/\s+/).select(function(name) {
- return name.length > 0;
- })._each(iterator);
- },
-
- set: function(className) {
- this.element.className = className;
- },
-
- add: function(classNameToAdd) {
- if (this.include(classNameToAdd)) return;
- this.set($A(this).concat(classNameToAdd).join(' '));
- },
-
- remove: function(classNameToRemove) {
- if (!this.include(classNameToRemove)) return;
- this.set($A(this).without(classNameToRemove).join(' '));
- },
-
- toString: function() {
- return $A(this).join(' ');
- }
-};
-
-Object.extend(Element.ClassNames.prototype, Enumerable);
-
-/*--------------------------------------------------------------------------*/
-
-Element.addMethods();
\ No newline at end of file
+/* Prototype JavaScript framework, version 1.7.2
+ * (c) 2005-2010 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+
+ Version: '1.7.2',
+
+ Browser: (function(){
+ var ua = navigator.userAgent;
+ var isOpera = Object.prototype.toString.call(window.opera) == '[object Opera]';
+ return {
+ IE: !!window.attachEvent && !isOpera,
+ Opera: isOpera,
+ WebKit: ua.indexOf('AppleWebKit/') > -1,
+ Gecko: ua.indexOf('Gecko') > -1 && ua.indexOf('KHTML') === -1,
+ MobileSafari: /Apple.*Mobile/.test(ua)
+ }
+ })(),
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+
+ SelectorsAPI: !!document.querySelector,
+
+ ElementExtensions: (function() {
+ var constructor = window.Element || window.HTMLElement;
+ return !!(constructor && constructor.prototype);
+ })(),
+ SpecificElementExtensions: (function() {
+ if (typeof window.HTMLDivElement !== 'undefined')
+ return true;
+
+ var div = document.createElement('div'),
+ form = document.createElement('form'),
+ isSupported = false;
+
+ if (div['__proto__'] && (div['__proto__'] !== form['__proto__'])) {
+ isSupported = true;
+ }
+
+ div = form = null;
+
+ return isSupported;
+ })()
+ },
+
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script\\s*>',
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+ emptyFunction: function() { },
+
+ K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
+/* Based on Alex Arnell's inheritance implementation. */
+
+var Class = (function() {
+
+ var IS_DONTENUM_BUGGY = (function(){
+ for (var p in { toString: 1 }) {
+ if (p === 'toString') return false;
+ }
+ return true;
+ })();
+
+ function subclass() {};
+ function create() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = Prototype.emptyFunction;
+
+ klass.prototype.constructor = klass;
+ return klass;
+ }
+
+ function addMethods(source) {
+ var ancestor = this.superclass && this.superclass.prototype,
+ properties = Object.keys(source);
+
+ if (IS_DONTENUM_BUGGY) {
+ if (source.toString != Object.prototype.toString)
+ properties.push("toString");
+ if (source.valueOf != Object.prototype.valueOf)
+ properties.push("valueOf");
+ }
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames()[0] == "$super") {
+ var method = value;
+ value = (function(m) {
+ return function() { return ancestor[m].apply(this, arguments); };
+ })(property).wrap(method);
+
+ value.valueOf = (function(method) {
+ return function() { return method.valueOf.call(method); };
+ })(method);
+
+ value.toString = (function(method) {
+ return function() { return method.toString.call(method); };
+ })(method);
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+
+ return {
+ create: create,
+ Methods: {
+ addMethods: addMethods
+ }
+ };
+})();
+(function() {
+
+ var _toString = Object.prototype.toString,
+ _hasOwnProperty = Object.prototype.hasOwnProperty,
+ NULL_TYPE = 'Null',
+ UNDEFINED_TYPE = 'Undefined',
+ BOOLEAN_TYPE = 'Boolean',
+ NUMBER_TYPE = 'Number',
+ STRING_TYPE = 'String',
+ OBJECT_TYPE = 'Object',
+ FUNCTION_CLASS = '[object Function]',
+ BOOLEAN_CLASS = '[object Boolean]',
+ NUMBER_CLASS = '[object Number]',
+ STRING_CLASS = '[object String]',
+ ARRAY_CLASS = '[object Array]',
+ DATE_CLASS = '[object Date]',
+ NATIVE_JSON_STRINGIFY_SUPPORT = window.JSON &&
+ typeof JSON.stringify === 'function' &&
+ JSON.stringify(0) === '0' &&
+ typeof JSON.stringify(Prototype.K) === 'undefined';
+
+
+
+ var DONT_ENUMS = ['toString', 'toLocaleString', 'valueOf',
+ 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'];
+
+ var IS_DONTENUM_BUGGY = (function(){
+ for (var p in { toString: 1 }) {
+ if (p === 'toString') return false;
+ }
+ return true;
+ })();
+
+ function Type(o) {
+ switch(o) {
+ case null: return NULL_TYPE;
+ case (void 0): return UNDEFINED_TYPE;
+ }
+ var type = typeof o;
+ switch(type) {
+ case 'boolean': return BOOLEAN_TYPE;
+ case 'number': return NUMBER_TYPE;
+ case 'string': return STRING_TYPE;
+ }
+ return OBJECT_TYPE;
+ }
+
+ function extend(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+ }
+
+ function inspect(object) {
+ try {
+ if (isUndefined(object)) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : String(object);
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ }
+
+ function toJSON(value) {
+ return Str('', { '': value }, []);
+ }
+
+ function Str(key, holder, stack) {
+ var value = holder[key];
+ if (Type(value) === OBJECT_TYPE && typeof value.toJSON === 'function') {
+ value = value.toJSON(key);
+ }
+
+ var _class = _toString.call(value);
+
+ switch (_class) {
+ case NUMBER_CLASS:
+ case BOOLEAN_CLASS:
+ case STRING_CLASS:
+ value = value.valueOf();
+ }
+
+ switch (value) {
+ case null: return 'null';
+ case true: return 'true';
+ case false: return 'false';
+ }
+
+ var type = typeof value;
+ switch (type) {
+ case 'string':
+ return value.inspect(true);
+ case 'number':
+ return isFinite(value) ? String(value) : 'null';
+ case 'object':
+
+ for (var i = 0, length = stack.length; i < length; i++) {
+ if (stack[i] === value) {
+ throw new TypeError("Cyclic reference to '" + value + "' in object");
+ }
+ }
+ stack.push(value);
+
+ var partial = [];
+ if (_class === ARRAY_CLASS) {
+ for (var i = 0, length = value.length; i < length; i++) {
+ var str = Str(i, value, stack);
+ partial.push(typeof str === 'undefined' ? 'null' : str);
+ }
+ partial = '[' + partial.join(',') + ']';
+ } else {
+ var keys = Object.keys(value);
+ for (var i = 0, length = keys.length; i < length; i++) {
+ var key = keys[i], str = Str(key, value, stack);
+ if (typeof str !== "undefined") {
+ partial.push(key.inspect(true)+ ':' + str);
+ }
+ }
+ partial = '{' + partial.join(',') + '}';
+ }
+ stack.pop();
+ return partial;
+ }
+ }
+
+ function stringify(object) {
+ return JSON.stringify(object);
+ }
+
+ function toQueryString(object) {
+ return $H(object).toQueryString();
+ }
+
+ function toHTML(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ }
+
+ function keys(object) {
+ if (Type(object) !== OBJECT_TYPE) { throw new TypeError(); }
+ var results = [];
+ for (var property in object) {
+ if (_hasOwnProperty.call(object, property))
+ results.push(property);
+ }
+
+ if (IS_DONTENUM_BUGGY) {
+ for (var i = 0; property = DONT_ENUMS[i]; i++) {
+ if (_hasOwnProperty.call(object, property))
+ results.push(property);
+ }
+ }
+
+ return results;
+ }
+
+ function values(object) {
+ var results = [];
+ for (var property in object)
+ results.push(object[property]);
+ return results;
+ }
+
+ function clone(object) {
+ return extend({ }, object);
+ }
+
+ function isElement(object) {
+ return !!(object && object.nodeType == 1);
+ }
+
+ function isArray(object) {
+ return _toString.call(object) === ARRAY_CLASS;
+ }
+
+ var hasNativeIsArray = (typeof Array.isArray == 'function')
+ && Array.isArray([]) && !Array.isArray({});
+
+ if (hasNativeIsArray) {
+ isArray = Array.isArray;
+ }
+
+ function isHash(object) {
+ return object instanceof Hash;
+ }
+
+ function isFunction(object) {
+ return _toString.call(object) === FUNCTION_CLASS;
+ }
+
+ function isString(object) {
+ return _toString.call(object) === STRING_CLASS;
+ }
+
+ function isNumber(object) {
+ return _toString.call(object) === NUMBER_CLASS;
+ }
+
+ function isDate(object) {
+ return _toString.call(object) === DATE_CLASS;
+ }
+
+ function isUndefined(object) {
+ return typeof object === "undefined";
+ }
+
+ extend(Object, {
+ extend: extend,
+ inspect: inspect,
+ toJSON: NATIVE_JSON_STRINGIFY_SUPPORT ? stringify : toJSON,
+ toQueryString: toQueryString,
+ toHTML: toHTML,
+ keys: Object.keys || keys,
+ values: values,
+ clone: clone,
+ isElement: isElement,
+ isArray: isArray,
+ isHash: isHash,
+ isFunction: isFunction,
+ isString: isString,
+ isNumber: isNumber,
+ isDate: isDate,
+ isUndefined: isUndefined
+ });
+})();
+Object.extend(Function.prototype, (function() {
+ var slice = Array.prototype.slice;
+
+ function update(array, args) {
+ var arrayLength = array.length, length = args.length;
+ while (length--) array[arrayLength + length] = args[length];
+ return array;
+ }
+
+ function merge(array, args) {
+ array = slice.call(array, 0);
+ return update(array, args);
+ }
+
+ function argumentNames() {
+ var names = this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1]
+ .replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g, '')
+ .replace(/\s+/g, '').split(',');
+ return names.length == 1 && !names[0] ? [] : names;
+ }
+
+
+ function bind(context) {
+ if (arguments.length < 2 && Object.isUndefined(arguments[0]))
+ return this;
+
+ if (!Object.isFunction(this))
+ throw new TypeError("The object is not callable.");
+
+ var nop = function() {};
+ var __method = this, args = slice.call(arguments, 1);
+
+ var bound = function() {
+ var a = merge(args, arguments);
+ var c = this instanceof bound ? this : context;
+ return __method.apply(c, a);
+ };
+
+ nop.prototype = this.prototype;
+ bound.prototype = new nop();
+
+ return bound;
+ }
+
+ function bindAsEventListener(context) {
+ var __method = this, args = slice.call(arguments, 1);
+ return function(event) {
+ var a = update([event || window.event], args);
+ return __method.apply(context, a);
+ }
+ }
+
+ function curry() {
+ if (!arguments.length) return this;
+ var __method = this, args = slice.call(arguments, 0);
+ return function() {
+ var a = merge(args, arguments);
+ return __method.apply(this, a);
+ }
+ }
+
+ function delay(timeout) {
+ var __method = this, args = slice.call(arguments, 1);
+ timeout = timeout * 1000;
+ return window.setTimeout(function() {
+ return __method.apply(__method, args);
+ }, timeout);
+ }
+
+ function defer() {
+ var args = update([0.01], arguments);
+ return this.delay.apply(this, args);
+ }
+
+ function wrap(wrapper) {
+ var __method = this;
+ return function() {
+ var a = update([__method.bind(this)], arguments);
+ return wrapper.apply(this, a);
+ }
+ }
+
+ function methodize() {
+ if (this._methodized) return this._methodized;
+ var __method = this;
+ return this._methodized = function() {
+ var a = update([this], arguments);
+ return __method.apply(null, a);
+ };
+ }
+
+ var extensions = {
+ argumentNames: argumentNames,
+ bindAsEventListener: bindAsEventListener,
+ curry: curry,
+ delay: delay,
+ defer: defer,
+ wrap: wrap,
+ methodize: methodize
+ };
+
+ if (!Function.prototype.bind)
+ extensions.bind = bind;
+
+ return extensions;
+})());
+
+
+
+(function(proto) {
+
+
+ function toISOString() {
+ return this.getUTCFullYear() + '-' +
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+ this.getUTCDate().toPaddedString(2) + 'T' +
+ this.getUTCHours().toPaddedString(2) + ':' +
+ this.getUTCMinutes().toPaddedString(2) + ':' +
+ this.getUTCSeconds().toPaddedString(2) + 'Z';
+ }
+
+
+ function toJSON() {
+ return this.toISOString();
+ }
+
+ if (!proto.toISOString) proto.toISOString = toISOString;
+ if (!proto.toJSON) proto.toJSON = toJSON;
+
+})(Date.prototype);
+
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+var PeriodicalExecuter = Class.create({
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ execute: function() {
+ this.callback(this);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.execute();
+ this.currentlyExecuting = false;
+ } catch(e) {
+ this.currentlyExecuting = false;
+ throw e;
+ }
+ }
+ }
+});
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, (function() {
+ var NATIVE_JSON_PARSE_SUPPORT = window.JSON &&
+ typeof JSON.parse === 'function' &&
+ JSON.parse('{"test": true}').test;
+
+ function prepareReplacement(replacement) {
+ if (Object.isFunction(replacement)) return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+ }
+
+ function isNonEmptyRegExp(regexp) {
+ return regexp.source && regexp.source !== '(?:)';
+ }
+
+
+ function gsub(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = prepareReplacement(replacement);
+
+ if (Object.isString(pattern))
+ pattern = RegExp.escape(pattern);
+
+ if (!(pattern.length || isNonEmptyRegExp(pattern))) {
+ replacement = replacement('');
+ return replacement + source.split('').join(replacement) + replacement;
+ }
+
+ while (source.length > 0) {
+ match = source.match(pattern)
+ if (match && match[0].length > 0) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ }
+
+ function sub(pattern, replacement, count) {
+ replacement = prepareReplacement(replacement);
+ count = Object.isUndefined(count) ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ }
+
+ function scan(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return String(this);
+ }
+
+ function truncate(length, truncation) {
+ length = length || 30;
+ truncation = Object.isUndefined(truncation) ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : String(this);
+ }
+
+ function strip() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ }
+
+ function stripTags() {
+ return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi, '');
+ }
+
+ function stripScripts() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ }
+
+ function extractScripts() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img'),
+ matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ }
+
+ function evalScripts() {
+ return this.extractScripts().map(function(script) { return eval(script); });
+ }
+
+ function escapeHTML() {
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ }
+
+ function unescapeHTML() {
+ return this.stripTags().replace(/&lt;/g,'<').replace(/&gt;/g,'>').replace(/&amp;/g,'&');
+ }
+
+
+ function toQueryParams(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return { };
+
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift()),
+ value = pair.length > 1 ? pair.join('=') : pair[0];
+
+ if (value != undefined) {
+ value = value.gsub('+', ' ');
+ value = decodeURIComponent(value);
+ }
+
+ if (key in hash) {
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ }
+
+ function toArray() {
+ return this.split('');
+ }
+
+ function succ() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ }
+
+ function times(count) {
+ return count < 1 ? '' : new Array(count + 1).join(this);
+ }
+
+ function camelize() {
+ return this.replace(/-+(.)?/g, function(match, chr) {
+ return chr ? chr.toUpperCase() : '';
+ });
+ }
+
+ function capitalize() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ }
+
+ function underscore() {
+ return this.replace(/::/g, '/')
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
+ .replace(/([a-z\d])([A-Z])/g, '$1_$2')
+ .replace(/-/g, '_')
+ .toLowerCase();
+ }
+
+ function dasherize() {
+ return this.replace(/_/g, '-');
+ }
+
+ function inspect(useDoubleQuotes) {
+ var escapedString = this.replace(/[\x00-\x1f\\]/g, function(character) {
+ if (character in String.specialChar) {
+ return String.specialChar[character];
+ }
+ return '\\u00' + character.charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ }
+
+ function unfilterJSON(filter) {
+ return this.replace(filter || Prototype.JSONFilter, '$1');
+ }
+
+ function isJSON() {
+ var str = this;
+ if (str.blank()) return false;
+ str = str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, '@');
+ str = str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, ']');
+ str = str.replace(/(?:^|:|,)(?:\s*\[)+/g, '');
+ return (/^[\],:{}\s]*$/).test(str);
+ }
+
+ function evalJSON(sanitize) {
+ var json = this.unfilterJSON(),
+ cx = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
+ if (cx.test(json)) {
+ json = json.replace(cx, function (a) {
+ return '\\u' + ('0000' + a.charCodeAt(0).toString(16)).slice(-4);
+ });
+ }
+ try {
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ }
+
+ function parseJSON() {
+ var json = this.unfilterJSON();
+ return JSON.parse(json);
+ }
+
+ function include(pattern) {
+ return this.indexOf(pattern) > -1;
+ }
+
+ function startsWith(pattern, position) {
+ position = Object.isNumber(position) ? position : 0;
+ return this.lastIndexOf(pattern, position) === position;
+ }
+
+ function endsWith(pattern, position) {
+ pattern = String(pattern);
+ position = Object.isNumber(position) ? position : this.length;
+ if (position < 0) position = 0;
+ if (position > this.length) position = this.length;
+ var d = position - pattern.length;
+ return d >= 0 && this.indexOf(pattern, d) === d;
+ }
+
+ function empty() {
+ return this == '';
+ }
+
+ function blank() {
+ return /^\s*$/.test(this);
+ }
+
+ function interpolate(object, pattern) {
+ return new Template(this, pattern).evaluate(object);
+ }
+
+ return {
+ gsub: gsub,
+ sub: sub,
+ scan: scan,
+ truncate: truncate,
+ strip: String.prototype.trim || strip,
+ stripTags: stripTags,
+ stripScripts: stripScripts,
+ extractScripts: extractScripts,
+ evalScripts: evalScripts,
+ escapeHTML: escapeHTML,
+ unescapeHTML: unescapeHTML,
+ toQueryParams: toQueryParams,
+ parseQuery: toQueryParams,
+ toArray: toArray,
+ succ: succ,
+ times: times,
+ camelize: camelize,
+ capitalize: capitalize,
+ underscore: underscore,
+ dasherize: dasherize,
+ inspect: inspect,
+ unfilterJSON: unfilterJSON,
+ isJSON: isJSON,
+ evalJSON: NATIVE_JSON_PARSE_SUPPORT ? parseJSON : evalJSON,
+ include: include,
+ startsWith: String.prototype.startsWith || startsWith,
+ endsWith: String.prototype.endsWith || endsWith,
+ empty: empty,
+ blank: blank,
+ interpolate: interpolate
+ };
+})());
+
+var Template = Class.create({
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ if (object && Object.isFunction(object.toTemplateReplacements))
+ object = object.toTemplateReplacements();
+
+ return this.template.gsub(this.pattern, function(match) {
+ if (object == null) return (match[1] + '');
+
+ var before = match[1] || '';
+ if (before == '\\') return match[2];
+
+ var ctx = object, expr = match[3],
+ pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;
+
+ match = pattern.exec(expr);
+ if (match == null) return before;
+
+ while (match != null) {
+ var comp = match[1].startsWith('[') ? match[2].replace(/\\\\]/g, ']') : match[1];
+ ctx = ctx[comp];
+ if (null == ctx || '' == match[3]) break;
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+ match = pattern.exec(expr);
+ }
+
+ return before + String.interpret(ctx);
+ });
+ }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = (function() {
+ function each(iterator, context) {
+ try {
+ this._each(iterator, context);
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ }
+
+ function eachSlice(number, iterator, context) {
+ var index = -number, slices = [], array = this.toArray();
+ if (number < 1) return array;
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.collect(iterator, context);
+ }
+
+ function all(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!iterator.call(context, value, index, this);
+ if (!result) throw $break;
+ }, this);
+ return result;
+ }
+
+ function any(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!iterator.call(context, value, index, this))
+ throw $break;
+ }, this);
+ return result;
+ }
+
+ function collect(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator.call(context, value, index, this));
+ }, this);
+ return results;
+ }
+
+ function detect(iterator, context) {
+ var result;
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index, this)) {
+ result = value;
+ throw $break;
+ }
+ }, this);
+ return result;
+ }
+
+ function findAll(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator.call(context, value, index, this))
+ results.push(value);
+ }, this);
+ return results;
+ }
+
+ function grep(filter, iterator, context) {
+ iterator = iterator || Prototype.K;
+ var results = [];
+
+ if (Object.isString(filter))
+ filter = new RegExp(RegExp.escape(filter));
+
+ this.each(function(value, index) {
+ if (filter.match(value))
+ results.push(iterator.call(context, value, index, this));
+ }, this);
+ return results;
+ }
+
+ function include(object) {
+ if (Object.isFunction(this.indexOf) && this.indexOf(object) != -1)
+ return true;
+
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ }
+
+ function inGroupsOf(number, fillWith) {
+ fillWith = Object.isUndefined(fillWith) ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ }
+
+ function inject(memo, iterator, context) {
+ this.each(function(value, index) {
+ memo = iterator.call(context, memo, value, index, this);
+ }, this);
+ return memo;
+ }
+
+ function invoke(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ }
+
+ function max(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index, this);
+ if (result == null || value >= result)
+ result = value;
+ }, this);
+ return result;
+ }
+
+ function min(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator.call(context, value, index, this);
+ if (result == null || value < result)
+ result = value;
+ }, this);
+ return result;
+ }
+
+ function partition(iterator, context) {
+ iterator = iterator || Prototype.K;
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ (iterator.call(context, value, index, this) ?
+ trues : falses).push(value);
+ }, this);
+ return [trues, falses];
+ }
+
+ function pluck(property) {
+ var results = [];
+ this.each(function(value) {
+ results.push(value[property]);
+ });
+ return results;
+ }
+
+ function reject(iterator, context) {
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator.call(context, value, index, this))
+ results.push(value);
+ }, this);
+ return results;
+ }
+
+ function sortBy(iterator, context) {
+ return this.map(function(value, index) {
+ return {
+ value: value,
+ criteria: iterator.call(context, value, index, this)
+ };
+ }, this).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ }
+
+ function toArray() {
+ return this.map();
+ }
+
+ function zip() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (Object.isFunction(args.last()))
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ }
+
+ function size() {
+ return this.toArray().length;
+ }
+
+ function inspect() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+
+
+
+
+
+
+
+
+
+ return {
+ each: each,
+ eachSlice: eachSlice,
+ all: all,
+ every: all,
+ any: any,
+ some: any,
+ collect: collect,
+ map: collect,
+ detect: detect,
+ findAll: findAll,
+ select: findAll,
+ filter: findAll,
+ grep: grep,
+ include: include,
+ member: include,
+ inGroupsOf: inGroupsOf,
+ inject: inject,
+ invoke: invoke,
+ max: max,
+ min: min,
+ partition: partition,
+ pluck: pluck,
+ reject: reject,
+ sortBy: sortBy,
+ toArray: toArray,
+ entries: toArray,
+ zip: zip,
+ size: size,
+ inspect: inspect,
+ find: detect
+ };
+})();
+
+function $A(iterable) {
+ if (!iterable) return [];
+ if ('toArray' in Object(iterable)) return iterable.toArray();
+ var length = iterable.length || 0, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+
+function $w(string) {
+ if (!Object.isString(string)) return [];
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+Array.from = $A;
+
+
+(function() {
+ var arrayProto = Array.prototype,
+ slice = arrayProto.slice,
+ _each = arrayProto.forEach; // use native browser JS 1.6 implementation if available
+
+ function each(iterator, context) {
+ for (var i = 0, length = this.length >>> 0; i < length; i++) {
+ if (i in this) iterator.call(context, this[i], i, this);
+ }
+ }
+ if (!_each) _each = each;
+
+ function clear() {
+ this.length = 0;
+ return this;
+ }
+
+ function first() {
+ return this[0];
+ }
+
+ function last() {
+ return this[this.length - 1];
+ }
+
+ function compact() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ }
+
+ function flatten() {
+ return this.inject([], function(array, value) {
+ if (Object.isArray(value))
+ return array.concat(value.flatten());
+ array.push(value);
+ return array;
+ });
+ }
+
+ function without() {
+ var values = slice.call(arguments, 0);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ }
+
+ function reverse(inline) {
+ return (inline === false ? this.toArray() : this)._reverse();
+ }
+
+ function uniq(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ }
+
+ function intersect(array) {
+ return this.uniq().findAll(function(item) {
+ return array.indexOf(item) !== -1;
+ });
+ }
+
+
+ function clone() {
+ return slice.call(this, 0);
+ }
+
+ function size() {
+ return this.length;
+ }
+
+ function inspect() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ }
+
+ function indexOf(item, i) {
+ if (this == null) throw new TypeError();
+
+ var array = Object(this), length = array.length >>> 0;
+ if (length === 0) return -1;
+
+ i = Number(i);
+ if (isNaN(i)) {
+ i = 0;
+ } else if (i !== 0 && isFinite(i)) {
+ i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
+ }
+
+ if (i > length) return -1;
+
+ var k = i >= 0 ? i : Math.max(length - Math.abs(i), 0);
+ for (; k < length; k++)
+ if (k in array && array[k] === item) return k;
+ return -1;
+ }
+
+
+ function lastIndexOf(item, i) {
+ if (this == null) throw new TypeError();
+
+ var array = Object(this), length = array.length >>> 0;
+ if (length === 0) return -1;
+
+ if (!Object.isUndefined(i)) {
+ i = Number(i);
+ if (isNaN(i)) {
+ i = 0;
+ } else if (i !== 0 && isFinite(i)) {
+ i = (i > 0 ? 1 : -1) * Math.floor(Math.abs(i));
+ }
+ } else {
+ i = length;
+ }
+
+ var k = i >= 0 ? Math.min(i, length - 1) :
+ length - Math.abs(i);
+
+ for (; k >= 0; k--)
+ if (k in array && array[k] === item) return k;
+ return -1;
+ }
+
+ function concat(_) {
+ var array = [], items = slice.call(arguments, 0), item, n = 0;
+ items.unshift(this);
+ for (var i = 0, length = items.length; i < length; i++) {
+ item = items[i];
+ if (Object.isArray(item) && !('callee' in item)) {
+ for (var j = 0, arrayLength = item.length; j < arrayLength; j++) {
+ if (j in item) array[n] = item[j];
+ n++;
+ }
+ } else {
+ array[n++] = item;
+ }
+ }
+ array.length = n;
+ return array;
+ }
+
+
+ function wrapNative(method) {
+ return function() {
+ if (arguments.length === 0) {
+ return method.call(this, Prototype.K);
+ } else if (arguments[0] === undefined) {
+ var args = slice.call(arguments, 1);
+ args.unshift(Prototype.K);
+ return method.apply(this, args);
+ } else {
+ return method.apply(this, arguments);
+ }
+ };
+ }
+
+
+ function map(iterator) {
+ if (this == null) throw new TypeError();
+ iterator = iterator || Prototype.K;
+
+ var object = Object(this);
+ var results = [], context = arguments[1], n = 0;
+
+ for (var i = 0, length = object.length >>> 0; i < length; i++) {
+ if (i in object) {
+ results[n] = iterator.call(context, object[i], i, object);
+ }
+ n++;
+ }
+ results.length = n;
+ return results;
+ }
+
+ if (arrayProto.map) {
+ map = wrapNative(Array.prototype.map);
+ }
+
+ function filter(iterator) {
+ if (this == null || !Object.isFunction(iterator))
+ throw new TypeError();
+
+ var object = Object(this);
+ var results = [], context = arguments[1], value;
+
+ for (var i = 0, length = object.length >>> 0; i < length; i++) {
+ if (i in object) {
+ value = object[i];
+ if (iterator.call(context, value, i, object)) {
+ results.push(value);
+ }
+ }
+ }
+ return results;
+ }
+
+ if (arrayProto.filter) {
+ filter = Array.prototype.filter;
+ }
+
+ function some(iterator) {
+ if (this == null) throw new TypeError();
+ iterator = iterator || Prototype.K;
+ var context = arguments[1];
+
+ var object = Object(this);
+ for (var i = 0, length = object.length >>> 0; i < length; i++) {
+ if (i in object && iterator.call(context, object[i], i, object)) {
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ if (arrayProto.some) {
+ var some = wrapNative(Array.prototype.some);
+ }
+
+
+ function every(iterator) {
+ if (this == null) throw new TypeError();
+ iterator = iterator || Prototype.K;
+ var context = arguments[1];
+
+ var object = Object(this);
+ for (var i = 0, length = object.length >>> 0; i < length; i++) {
+ if (i in object && !iterator.call(context, object[i], i, object)) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ if (arrayProto.every) {
+ var every = wrapNative(Array.prototype.every);
+ }
+
+ var _reduce = arrayProto.reduce;
+ function inject(memo, iterator) {
+ iterator = iterator || Prototype.K;
+ var context = arguments[2];
+ return _reduce.call(this, iterator.bind(context), memo);
+ }
+
+ if (!arrayProto.reduce) {
+ var inject = Enumerable.inject;
+ }
+
+ Object.extend(arrayProto, Enumerable);
+
+ if (!arrayProto._reverse)
+ arrayProto._reverse = arrayProto.reverse;
+
+ Object.extend(arrayProto, {
+ _each: _each,
+
+ map: map,
+ collect: map,
+ select: filter,
+ filter: filter,
+ findAll: filter,
+ some: some,
+ any: some,
+ every: every,
+ all: every,
+ inject: inject,
+
+ clear: clear,
+ first: first,
+ last: last,
+ compact: compact,
+ flatten: flatten,
+ without: without,
+ reverse: reverse,
+ uniq: uniq,
+ intersect: intersect,
+ clone: clone,
+ toArray: clone,
+ size: size,
+ inspect: inspect
+ });
+
+ var CONCAT_ARGUMENTS_BUGGY = (function() {
+ return [].concat(arguments)[0][0] !== 1;
+ })(1,2);
+
+ if (CONCAT_ARGUMENTS_BUGGY) arrayProto.concat = concat;
+
+ if (!arrayProto.indexOf) arrayProto.indexOf = indexOf;
+ if (!arrayProto.lastIndexOf) arrayProto.lastIndexOf = lastIndexOf;
+})();
+function $H(object) {
+ return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+ function initialize(object) {
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+ }
+
+
+ function _each(iterator, context) {
+ var i = 0;
+ for (var key in this._object) {
+ var value = this._object[key], pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator.call(context, pair, i);
+ i++;
+ }
+ }
+
+ function set(key, value) {
+ return this._object[key] = value;
+ }
+
+ function get(key) {
+ if (this._object[key] !== Object.prototype[key])
+ return this._object[key];
+ }
+
+ function unset(key) {
+ var value = this._object[key];
+ delete this._object[key];
+ return value;
+ }
+
+ function toObject() {
+ return Object.clone(this._object);
+ }
+
+
+
+ function keys() {
+ return this.pluck('key');
+ }
+
+ function values() {
+ return this.pluck('value');
+ }
+
+ function index(value) {
+ var match = this.detect(function(pair) {
+ return pair.value === value;
+ });
+ return match && match.key;
+ }
+
+ function merge(object) {
+ return this.clone().update(object);
+ }
+
+ function update(object) {
+ return new Hash(object).inject(this, function(result, pair) {
+ result.set(pair.key, pair.value);
+ return result;
+ });
+ }
+
+ function toQueryPair(key, value) {
+ if (Object.isUndefined(value)) return key;
+
+ value = String.interpret(value);
+
+ value = value.gsub(/(\r)?\n/, '\r\n');
+ value = encodeURIComponent(value);
+ value = value.gsub(/%20/, '+');
+ return key + '=' + value;
+ }
+
+ function toQueryString() {
+ return this.inject([], function(results, pair) {
+ var key = encodeURIComponent(pair.key), values = pair.value;
+
+ if (values && typeof values == 'object') {
+ if (Object.isArray(values)) {
+ var queryValues = [];
+ for (var i = 0, len = values.length, value; i < len; i++) {
+ value = values[i];
+ queryValues.push(toQueryPair(key, value));
+ }
+ return results.concat(queryValues);
+ }
+ } else results.push(toQueryPair(key, values));
+ return results;
+ }).join('&');
+ }
+
+ function inspect() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ }
+
+ function clone() {
+ return new Hash(this);
+ }
+
+ return {
+ initialize: initialize,
+ _each: _each,
+ set: set,
+ get: get,
+ unset: unset,
+ toObject: toObject,
+ toTemplateReplacements: toObject,
+ keys: keys,
+ values: values,
+ index: index,
+ merge: merge,
+ update: update,
+ toQueryString: toQueryString,
+ inspect: inspect,
+ toJSON: toObject,
+ clone: clone
+ };
+})());
+
+Hash.from = $H;
+Object.extend(Number.prototype, (function() {
+ function toColorPart() {
+ return this.toPaddedString(2, 16);
+ }
+
+ function succ() {
+ return this + 1;
+ }
+
+ function times(iterator, context) {
+ $R(0, this, true).each(iterator, context);
+ return this;
+ }
+
+ function toPaddedString(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ }
+
+ function abs() {
+ return Math.abs(this);
+ }
+
+ function round() {
+ return Math.round(this);
+ }
+
+ function ceil() {
+ return Math.ceil(this);
+ }
+
+ function floor() {
+ return Math.floor(this);
+ }
+
+ return {
+ toColorPart: toColorPart,
+ succ: succ,
+ times: times,
+ toPaddedString: toPaddedString,
+ abs: abs,
+ round: round,
+ ceil: ceil,
+ floor: floor
+ };
+})());
+
+function $R(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+}
+
+var ObjectRange = Class.create(Enumerable, (function() {
+ function initialize(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ }
+
+ function _each(iterator, context) {
+ var value = this.start, i;
+ for (i = 0; this.include(value); i++) {
+ iterator.call(context, value, i);
+ value = value.succ();
+ }
+ }
+
+ function include(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+
+ return {
+ initialize: initialize,
+ _each: _each,
+ include: include
+ };
+})());
+
+
+
+var Abstract = { };
+
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) { }
+ }
+
+ return returnValue;
+ }
+};
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+};
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator, context) {
+ this.responders._each(iterator, context);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (Object.isFunction(responder[callback])) {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) { }
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() { Ajax.activeRequestCount++ },
+ onComplete: function() { Ajax.activeRequestCount-- }
+});
+Ajax.Base = Class.create({
+ initialize: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: '',
+ evalJSON: true,
+ evalJS: true
+ };
+ Object.extend(this.options, options || { });
+
+ this.options.method = this.options.method.toLowerCase();
+
+ if (Object.isHash(this.options.parameters))
+ this.options.parameters = this.options.parameters.toObject();
+ }
+});
+Ajax.Request = Class.create(Ajax.Base, {
+ _complete: false,
+
+ initialize: function($super, url, options) {
+ $super(options);
+ this.transport = Ajax.getTransport();
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.isString(this.options.parameters) ?
+ this.options.parameters :
+ Object.toQueryString(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ params += (params ? '&' : '') + "_method=" + this.method;
+ this.method = 'post';
+ }
+
+ if (params && this.method === 'get') {
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ }
+
+ this.parameters = params.toQueryParams();
+
+ try {
+ var response = new Ajax.Response(this);
+ if (this.options.onCreate) this.options.onCreate(response);
+ Ajax.Responders.dispatch('onCreate', this, response);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (Object.isFunction(extras.push))
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ if (headers[name] != null)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ var status = this.getStatus();
+ return !status || (status >= 200 && status < 300) || status == 304;
+ },
+
+ getStatus: function() {
+ try {
+ if (this.transport.status === 1223) return 204;
+ return this.transport.status || 0;
+ } catch (e) { return 0 }
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + response.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && this.isSameOrigin() && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ isSameOrigin: function() {
+ var m = this.url.match(/^\s*https?:\/\/[^\/]*/);
+ return !m || (m[0] == '#{protocol}//#{domain}#{port}'.interpolate({
+ protocol: location.protocol,
+ domain: document.domain,
+ port: location.port ? ':' + location.port : ''
+ }));
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name) || null;
+ } catch (e) { return null; }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+
+
+
+
+
+
+
+Ajax.Response = Class.create({
+ initialize: function(request){
+ this.request = request;
+ var transport = this.transport = request.transport,
+ readyState = this.readyState = transport.readyState;
+
+ if ((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+ this.status = this.getStatus();
+ this.statusText = this.getStatusText();
+ this.responseText = String.interpret(transport.responseText);
+ this.headerJSON = this._getHeaderJSON();
+ }
+
+ if (readyState == 4) {
+ var xml = transport.responseXML;
+ this.responseXML = Object.isUndefined(xml) ? null : xml;
+ this.responseJSON = this._getResponseJSON();
+ }
+ },
+
+ status: 0,
+
+ statusText: '',
+
+ getStatus: Ajax.Request.prototype.getStatus,
+
+ getStatusText: function() {
+ try {
+ return this.transport.statusText || '';
+ } catch (e) { return '' }
+ },
+
+ getHeader: Ajax.Request.prototype.getHeader,
+
+ getAllHeaders: function() {
+ try {
+ return this.getAllResponseHeaders();
+ } catch (e) { return null }
+ },
+
+ getResponseHeader: function(name) {
+ return this.transport.getResponseHeader(name);
+ },
+
+ getAllResponseHeaders: function() {
+ return this.transport.getAllResponseHeaders();
+ },
+
+ _getHeaderJSON: function() {
+ var json = this.getHeader('X-JSON');
+ if (!json) return null;
+
+ try {
+ json = decodeURIComponent(escape(json));
+ } catch(e) {
+ }
+
+ try {
+ return json.evalJSON(this.request.options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ },
+
+ _getResponseJSON: function() {
+ var options = this.request.options;
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
+ !(this.getHeader('Content-type') || '').include('application/json')) ||
+ this.responseText.blank())
+ return null;
+ try {
+ return this.responseText.evalJSON(options.sanitizeJSON ||
+ !this.request.isSameOrigin());
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+ initialize: function($super, container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ };
+
+ options = Object.clone(options);
+ var onComplete = options.onComplete;
+ options.onComplete = (function(response, json) {
+ this.updateContent(response.responseText);
+ if (Object.isFunction(onComplete)) onComplete(response, json);
+ }).bind(this);
+
+ $super(url, options);
+ },
+
+ updateContent: function(responseText) {
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
+ options = this.options;
+
+ if (!options.evalScripts) responseText = responseText.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (options.insertion) {
+ if (Object.isString(options.insertion)) {
+ var insertion = { }; insertion[options.insertion] = responseText;
+ receiver.insert(insertion);
+ }
+ else options.insertion(receiver, responseText);
+ }
+ else receiver.update(responseText);
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+ initialize: function($super, container, url, options) {
+ $super(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = { };
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(response) {
+ if (this.options.decay) {
+ this.decay = (response.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = response.responseText;
+ }
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+
+(function(GLOBAL) {
+
+ var UNDEFINED;
+ var SLICE = Array.prototype.slice;
+
+ var DIV = document.createElement('div');
+
+
+ function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+
+ if (Object.isString(element))
+ element = document.getElementById(element);
+ return Element.extend(element);
+ }
+
+ GLOBAL.$ = $;
+
+
+ if (!GLOBAL.Node) GLOBAL.Node = {};
+
+ if (!GLOBAL.Node.ELEMENT_NODE) {
+ Object.extend(GLOBAL.Node, {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ });
+ }
+
+ var ELEMENT_CACHE = {};
+
+ function shouldUseCreationCache(tagName, attributes) {
+ if (tagName === 'select') return false;
+ if ('type' in attributes) return false;
+ return true;
+ }
+
+ var HAS_EXTENDED_CREATE_ELEMENT_SYNTAX = (function(){
+ try {
+ var el = document.createElement('<input name="x">');
+ return el.tagName.toLowerCase() === 'input' && el.name === 'x';
+ }
+ catch(err) {
+ return false;
+ }
+ })();
+
+
+ var oldElement = GLOBAL.Element;
+ function Element(tagName, attributes) {
+ attributes = attributes || {};
+ tagName = tagName.toLowerCase();
+
+ if (HAS_EXTENDED_CREATE_ELEMENT_SYNTAX && attributes.name) {
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
+ delete attributes.name;
+ return Element.writeAttribute(document.createElement(tagName), attributes);
+ }
+
+ if (!ELEMENT_CACHE[tagName])
+ ELEMENT_CACHE[tagName] = Element.extend(document.createElement(tagName));
+
+ var node = shouldUseCreationCache(tagName, attributes) ?
+ ELEMENT_CACHE[tagName].cloneNode(false) : document.createElement(tagName);
+
+ return Element.writeAttribute(node, attributes);
+ }
+
+ GLOBAL.Element = Element;
+
+ Object.extend(GLOBAL.Element, oldElement || {});
+ if (oldElement) GLOBAL.Element.prototype = oldElement.prototype;
+
+ Element.Methods = { ByTag: {}, Simulated: {} };
+
+ var methods = {};
+
+ var INSPECT_ATTRIBUTES = { id: 'id', className: 'class' };
+ function inspect(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+
+ var attribute, value;
+ for (var property in INSPECT_ATTRIBUTES) {
+ attribute = INSPECT_ATTRIBUTES[property];
+ value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ }
+
+ return result + '>';
+ }
+
+ methods.inspect = inspect;
+
+
+ function visible(element) {
+ return $(element).style.display !== 'none';
+ }
+
+ function toggle(element, bool) {
+ element = $(element);
+ if (Object.isUndefined(bool))
+ bool = !Element.visible(element);
+ Element[bool ? 'show' : 'hide'](element);
+
+ return element;
+ }
+
+ function hide(element) {
+ element = $(element);
+ element.style.display = 'none';
+ return element;
+ }
+
+ function show(element) {
+ element = $(element);
+ element.style.display = '';
+ return element;
+ }
+
+
+ Object.extend(methods, {
+ visible: visible,
+ toggle: toggle,
+ hide: hide,
+ show: show
+ });
+
+
+ function remove(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ }
+
+ var SELECT_ELEMENT_INNERHTML_BUGGY = (function(){
+ var el = document.createElement("select"),
+ isBuggy = true;
+ el.innerHTML = "<option value=\"test\">test</option>";
+ if (el.options && el.options[0]) {
+ isBuggy = el.options[0].nodeName.toUpperCase() !== "OPTION";
+ }
+ el = null;
+ return isBuggy;
+ })();
+
+ var TABLE_ELEMENT_INNERHTML_BUGGY = (function(){
+ try {
+ var el = document.createElement("table");
+ if (el && el.tBodies) {
+ el.innerHTML = "<tbody><tr><td>test</td></tr></tbody>";
+ var isBuggy = typeof el.tBodies[0] == "undefined";
+ el = null;
+ return isBuggy;
+ }
+ } catch (e) {
+ return true;
+ }
+ })();
+
+ var LINK_ELEMENT_INNERHTML_BUGGY = (function() {
+ try {
+ var el = document.createElement('div');
+ el.innerHTML = "<link />";
+ var isBuggy = (el.childNodes.length === 0);
+ el = null;
+ return isBuggy;
+ } catch(e) {
+ return true;
+ }
+ })();
+
+ var ANY_INNERHTML_BUGGY = SELECT_ELEMENT_INNERHTML_BUGGY ||
+ TABLE_ELEMENT_INNERHTML_BUGGY || LINK_ELEMENT_INNERHTML_BUGGY;
+
+ var SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING = (function () {
+ var s = document.createElement("script"),
+ isBuggy = false;
+ try {
+ s.appendChild(document.createTextNode(""));
+ isBuggy = !s.firstChild ||
+ s.firstChild && s.firstChild.nodeType !== 3;
+ } catch (e) {
+ isBuggy = true;
+ }
+ s = null;
+ return isBuggy;
+ })();
+
+ function update(element, content) {
+ element = $(element);
+
+ var descendants = element.getElementsByTagName('*'),
+ i = descendants.length;
+ while (i--) purgeElement(descendants[i]);
+
+ if (content && content.toElement)
+ content = content.toElement();
+
+ if (Object.isElement(content))
+ return element.update().insert(content);
+
+
+ content = Object.toHTML(content);
+ var tagName = element.tagName.toUpperCase();
+
+ if (tagName === 'SCRIPT' && SCRIPT_ELEMENT_REJECTS_TEXTNODE_APPENDING) {
+ element.text = content;
+ return element;
+ }
+
+ if (ANY_INNERHTML_BUGGY) {
+ if (tagName in INSERTION_TRANSLATIONS.tags) {
+ while (element.firstChild)
+ element.removeChild(element.firstChild);
+
+ var nodes = getContentFromAnonymousElement(tagName, content.stripScripts());
+ for (var i = 0, node; node = nodes[i]; i++)
+ element.appendChild(node);
+
+ } else if (LINK_ELEMENT_INNERHTML_BUGGY && Object.isString(content) && content.indexOf('<link') > -1) {
+ while (element.firstChild)
+ element.removeChild(element.firstChild);
+
+ var nodes = getContentFromAnonymousElement(tagName,
+ content.stripScripts(), true);
+
+ for (var i = 0, node; node = nodes[i]; i++)
+ element.appendChild(node);
+ } else {
+ element.innerHTML = content.stripScripts();
+ }
+ } else {
+ element.innerHTML = content.stripScripts();
+ }
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ }
+
+ function replace(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) {
+ content = content.toElement();
+ } else if (!Object.isElement(content)) {
+ content = Object.toHTML(content);
+ var range = element.ownerDocument.createRange();
+ range.selectNode(element);
+ content.evalScripts.bind(content).defer();
+ content = range.createContextualFragment(content.stripScripts());
+ }
+
+ element.parentNode.replaceChild(content, element);
+ return element;
+ }
+
+ var INSERTION_TRANSLATIONS = {
+ before: function(element, node) {
+ element.parentNode.insertBefore(node, element);
+ },
+ top: function(element, node) {
+ element.insertBefore(node, element.firstChild);
+ },
+ bottom: function(element, node) {
+ element.appendChild(node);
+ },
+ after: function(element, node) {
+ element.parentNode.insertBefore(node, element.nextSibling);
+ },
+
+ tags: {
+ TABLE: ['<table>', '</table>', 1],
+ TBODY: ['<table><tbody>', '</tbody></table>', 2],
+ TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
+ TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+ SELECT: ['<select>', '</select>', 1]
+ }
+ };
+
+ var tags = INSERTION_TRANSLATIONS.tags;
+
+ Object.extend(tags, {
+ THEAD: tags.TBODY,
+ TFOOT: tags.TBODY,
+ TH: tags.TD
+ });
+
+ function replace_IE(element, content) {
+ element = $(element);
+ if (content && content.toElement)
+ content = content.toElement();
+ if (Object.isElement(content)) {
+ element.parentNode.replaceChild(content, element);
+ return element;
+ }
+
+ content = Object.toHTML(content);
+ var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+ if (tagName in INSERTION_TRANSLATIONS.tags) {
+ var nextSibling = Element.next(element);
+ var fragments = getContentFromAnonymousElement(
+ tagName, content.stripScripts());
+
+ parent.removeChild(element);
+
+ var iterator;
+ if (nextSibling)
+ iterator = function(node) { parent.insertBefore(node, nextSibling) };
+ else
+ iterator = function(node) { parent.appendChild(node); }
+
+ fragments.each(iterator);
+ } else {
+ element.outerHTML = content.stripScripts();
+ }
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ }
+
+ if ('outerHTML' in document.documentElement)
+ replace = replace_IE;
+
+ function isContent(content) {
+ if (Object.isUndefined(content) || content === null) return false;
+
+ if (Object.isString(content) || Object.isNumber(content)) return true;
+ if (Object.isElement(content)) return true;
+ if (content.toElement || content.toHTML) return true;
+
+ return false;
+ }
+
+ function insertContentAt(element, content, position) {
+ position = position.toLowerCase();
+ var method = INSERTION_TRANSLATIONS[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ method(element, content);
+ return element;
+ }
+
+ content = Object.toHTML(content);
+ var tagName = ((position === 'before' || position === 'after') ?
+ element.parentNode : element).tagName.toUpperCase();
+
+ var childNodes = getContentFromAnonymousElement(tagName, content.stripScripts());
+
+ if (position === 'top' || position === 'after') childNodes.reverse();
+
+ for (var i = 0, node; node = childNodes[i]; i++)
+ method(element, node);
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ function insert(element, insertions) {
+ element = $(element);
+
+ if (isContent(insertions))
+ insertions = { bottom: insertions };
+
+ for (var position in insertions)
+ insertContentAt(element, insertions[position], position);
+
+ return element;
+ }
+
+ function wrap(element, wrapper, attributes) {
+ element = $(element);
+
+ if (Object.isElement(wrapper)) {
+ $(wrapper).writeAttribute(attributes || {});
+ } else if (Object.isString(wrapper)) {
+ wrapper = new Element(wrapper, attributes);
+ } else {
+ wrapper = new Element('div', wrapper);
+ }
+
+ if (element.parentNode)
+ element.parentNode.replaceChild(wrapper, element);
+
+ wrapper.appendChild(element);
+
+ return wrapper;
+ }
+
+ function cleanWhitespace(element) {
+ element = $(element);
+ var node = element.firstChild;
+
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType === Node.TEXT_NODE && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ }
+
+ function empty(element) {
+ return $(element).innerHTML.blank();
+ }
+
+ function getContentFromAnonymousElement(tagName, html, force) {
+ var t = INSERTION_TRANSLATIONS.tags[tagName], div = DIV;
+
+ var workaround = !!t;
+ if (!workaround && force) {
+ workaround = true;
+ t = ['', '', 0];
+ }
+
+ if (workaround) {
+ div.innerHTML = '&#160;' + t[0] + html + t[1];
+ div.removeChild(div.firstChild);
+ for (var i = t[2]; i--; )
+ div = div.firstChild;
+ } else {
+ div.innerHTML = html;
+ }
+
+ return $A(div.childNodes);
+ }
+
+ function clone(element, deep) {
+ if (!(element = $(element))) return;
+ var clone = element.cloneNode(deep);
+ if (!HAS_UNIQUE_ID_PROPERTY) {
+ clone._prototypeUID = UNDEFINED;
+ if (deep) {
+ var descendants = Element.select(clone, '*'),
+ i = descendants.length;
+ while (i--)
+ descendants[i]._prototypeUID = UNDEFINED;
+ }
+ }
+ return Element.extend(clone);
+ }
+
+ function purgeElement(element) {
+ var uid = getUniqueElementID(element);
+ if (uid) {
+ Element.stopObserving(element);
+ if (!HAS_UNIQUE_ID_PROPERTY)
+ element._prototypeUID = UNDEFINED;
+ delete Element.Storage[uid];
+ }
+ }
+
+ function purgeCollection(elements) {
+ var i = elements.length;
+ while (i--)
+ purgeElement(elements[i]);
+ }
+
+ function purgeCollection_IE(elements) {
+ var i = elements.length, element, uid;
+ while (i--) {
+ element = elements[i];
+ uid = getUniqueElementID(element);
+ delete Element.Storage[uid];
+ delete Event.cache[uid];
+ }
+ }
+
+ if (HAS_UNIQUE_ID_PROPERTY) {
+ purgeCollection = purgeCollection_IE;
+ }
+
+
+ function purge(element) {
+ if (!(element = $(element))) return;
+ purgeElement(element);
+
+ var descendants = element.getElementsByTagName('*'),
+ i = descendants.length;
+
+ while (i--) purgeElement(descendants[i]);
+
+ return null;
+ }
+
+ Object.extend(methods, {
+ remove: remove,
+ update: update,
+ replace: replace,
+ insert: insert,
+ wrap: wrap,
+ cleanWhitespace: cleanWhitespace,
+ empty: empty,
+ clone: clone,
+ purge: purge
+ });
+
+
+
+ function recursivelyCollect(element, property, maximumLength) {
+ element = $(element);
+ maximumLength = maximumLength || -1;
+ var elements = [];
+
+ while (element = element[property]) {
+ if (element.nodeType === Node.ELEMENT_NODE)
+ elements.push(Element.extend(element));
+
+ if (elements.length === maximumLength) break;
+ }
+
+ return elements;
+ }
+
+
+ function ancestors(element) {
+ return recursivelyCollect(element, 'parentNode');
+ }
+
+ function descendants(element) {
+ return Element.select(element, '*');
+ }
+
+ function firstDescendant(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType !== Node.ELEMENT_NODE)
+ element = element.nextSibling;
+
+ return $(element);
+ }
+
+ function immediateDescendants(element) {
+ var results = [], child = $(element).firstChild;
+
+ while (child) {
+ if (child.nodeType === Node.ELEMENT_NODE)
+ results.push(Element.extend(child));
+
+ child = child.nextSibling;
+ }
+
+ return results;
+ }
+
+ function previousSiblings(element) {
+ return recursivelyCollect(element, 'previousSibling');
+ }
+
+ function nextSiblings(element) {
+ return recursivelyCollect(element, 'nextSibling');
+ }
+
+ function siblings(element) {
+ element = $(element);
+ var previous = previousSiblings(element),
+ next = nextSiblings(element);
+ return previous.reverse().concat(next);
+ }
+
+ function match(element, selector) {
+ element = $(element);
+
+ if (Object.isString(selector))
+ return Prototype.Selector.match(element, selector);
+
+ return selector.match(element);
+ }
+
+
+ function _recursivelyFind(element, property, expression, index) {
+ element = $(element), expression = expression || 0, index = index || 0;
+ if (Object.isNumber(expression)) {
+ index = expression, expression = null;
+ }
+
+ while (element = element[property]) {
+ if (element.nodeType !== 1) continue;
+ if (expression && !Prototype.Selector.match(element, expression))
+ continue;
+ if (--index >= 0) continue;
+
+ return Element.extend(element);
+ }
+ }
+
+
+ function up(element, expression, index) {
+ element = $(element);
+
+ if (arguments.length === 1) return $(element.parentNode);
+ return _recursivelyFind(element, 'parentNode', expression, index);
+ }
+
+ function down(element, expression, index) {
+ if (arguments.length === 1) return firstDescendant(element);
+ element = $(element), expression = expression || 0, index = index || 0;
+
+ if (Object.isNumber(expression))
+ index = expression, expression = '*';
+
+ var node = Prototype.Selector.select(expression, element)[index];
+ return Element.extend(node);
+ }
+
+ function previous(element, expression, index) {
+ return _recursivelyFind(element, 'previousSibling', expression, index);
+ }
+
+ function next(element, expression, index) {
+ return _recursivelyFind(element, 'nextSibling', expression, index);
+ }
+
+ function select(element) {
+ element = $(element);
+ var expressions = SLICE.call(arguments, 1).join(', ');
+ return Prototype.Selector.select(expressions, element);
+ }
+
+ function adjacent(element) {
+ element = $(element);
+ var expressions = SLICE.call(arguments, 1).join(', ');
+ var siblings = Element.siblings(element), results = [];
+ for (var i = 0, sibling; sibling = siblings[i]; i++) {
+ if (Prototype.Selector.match(sibling, expressions))
+ results.push(sibling);
+ }
+
+ return results;
+ }
+
+ function descendantOf_DOM(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+ while (element = element.parentNode)
+ if (element === ancestor) return true;
+ return false;
+ }
+
+ function descendantOf_contains(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+ if (!ancestor.contains) return descendantOf_DOM(element, ancestor);
+ return ancestor.contains(element) && ancestor !== element;
+ }
+
+ function descendantOf_compareDocumentPosition(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+ return (element.compareDocumentPosition(ancestor) & 8) === 8;
+ }
+
+ var descendantOf;
+ if (DIV.compareDocumentPosition) {
+ descendantOf = descendantOf_compareDocumentPosition;
+ } else if (DIV.contains) {
+ descendantOf = descendantOf_contains;
+ } else {
+ descendantOf = descendantOf_DOM;
+ }
+
+
+ Object.extend(methods, {
+ recursivelyCollect: recursivelyCollect,
+ ancestors: ancestors,
+ descendants: descendants,
+ firstDescendant: firstDescendant,
+ immediateDescendants: immediateDescendants,
+ previousSiblings: previousSiblings,
+ nextSiblings: nextSiblings,
+ siblings: siblings,
+ match: match,
+ up: up,
+ down: down,
+ previous: previous,
+ next: next,
+ select: select,
+ adjacent: adjacent,
+ descendantOf: descendantOf,
+
+ getElementsBySelector: select,
+
+ childElements: immediateDescendants
+ });
+
+
+ var idCounter = 1;
+ function identify(element) {
+ element = $(element);
+ var id = Element.readAttribute(element, 'id');
+ if (id) return id;
+
+ do { id = 'anonymous_element_' + idCounter++ } while ($(id));
+
+ Element.writeAttribute(element, 'id', id);
+ return id;
+ }
+
+
+ function readAttribute(element, name) {
+ return $(element).getAttribute(name);
+ }
+
+ function readAttribute_IE(element, name) {
+ element = $(element);
+
+ var table = ATTRIBUTE_TRANSLATIONS.read;
+ if (table.values[name])
+ return table.values[name](element, name);
+
+ if (table.names[name]) name = table.names[name];
+
+ if (name.include(':')) {
+ if (!element.attributes || !element.attributes[name]) return null;
+ return element.attributes[name].value;
+ }
+
+ return element.getAttribute(name);
+ }
+
+ function readAttribute_Opera(element, name) {
+ if (name === 'title') return element.title;
+ return element.getAttribute(name);
+ }
+
+ var PROBLEMATIC_ATTRIBUTE_READING = (function() {
+ DIV.setAttribute('onclick', []);
+ var value = DIV.getAttribute('onclick');
+ var isFunction = Object.isArray(value);
+ DIV.removeAttribute('onclick');
+ return isFunction;
+ })();
+
+ if (PROBLEMATIC_ATTRIBUTE_READING) {
+ readAttribute = readAttribute_IE;
+ } else if (Prototype.Browser.Opera) {
+ readAttribute = readAttribute_Opera;
+ }
+
+
+ function writeAttribute(element, name, value) {
+ element = $(element);
+ var attributes = {}, table = ATTRIBUTE_TRANSLATIONS.write;
+
+ if (typeof name === 'object') {
+ attributes = name;
+ } else {
+ attributes[name] = Object.isUndefined(value) ? true : value;
+ }
+
+ for (var attr in attributes) {
+ name = table.names[attr] || attr;
+ value = attributes[attr];
+ if (table.values[attr])
+ name = table.values[attr](element, value) || name;
+ if (value === false || value === null)
+ element.removeAttribute(name);
+ else if (value === true)
+ element.setAttribute(name, name);
+ else element.setAttribute(name, value);
+ }
+
+ return element;
+ }
+
+ var PROBLEMATIC_HAS_ATTRIBUTE_WITH_CHECKBOXES = (function () {
+ if (!HAS_EXTENDED_CREATE_ELEMENT_SYNTAX) {
+ return false;
+ }
+ var checkbox = document.createElement('<input type="checkbox">');
+ checkbox.checked = true;
+ var node = checkbox.getAttributeNode('checked');
+ return !node || !node.specified;
+ })();
+
+ function hasAttribute(element, attribute) {
+ attribute = ATTRIBUTE_TRANSLATIONS.has[attribute] || attribute;
+ var node = $(element).getAttributeNode(attribute);
+ return !!(node && node.specified);
+ }
+
+ function hasAttribute_IE(element, attribute) {
+ if (attribute === 'checked') {
+ return element.checked;
+ }
+ return hasAttribute(element, attribute);
+ }
+
+ GLOBAL.Element.Methods.Simulated.hasAttribute =
+ PROBLEMATIC_HAS_ATTRIBUTE_WITH_CHECKBOXES ?
+ hasAttribute_IE : hasAttribute;
+
+ function classNames(element) {
+ return new Element.ClassNames(element);
+ }
+
+ var regExpCache = {};
+ function getRegExpForClassName(className) {
+ if (regExpCache[className]) return regExpCache[className];
+
+ var re = new RegExp("(^|\\s+)" + className + "(\\s+|$)");
+ regExpCache[className] = re;
+ return re;
+ }
+
+ function hasClassName(element, className) {
+ if (!(element = $(element))) return;
+
+ var elementClassName = element.className;
+
+ if (elementClassName.length === 0) return false;
+ if (elementClassName === className) return true;
+
+ return getRegExpForClassName(className).test(elementClassName);
+ }
+
+ function addClassName(element, className) {
+ if (!(element = $(element))) return;
+
+ if (!hasClassName(element, className))
+ element.className += (element.className ? ' ' : '') + className;
+
+ return element;
+ }
+
+ function removeClassName(element, className) {
+ if (!(element = $(element))) return;
+
+ element.className = element.className.replace(
+ getRegExpForClassName(className), ' ').strip();
+
+ return element;
+ }
+
+ function toggleClassName(element, className, bool) {
+ if (!(element = $(element))) return;
+
+ if (Object.isUndefined(bool))
+ bool = !hasClassName(element, className);
+
+ var method = Element[bool ? 'addClassName' : 'removeClassName'];
+ return method(element, className);
+ }
+
+ var ATTRIBUTE_TRANSLATIONS = {};
+
+ var classProp = 'className', forProp = 'for';
+
+ DIV.setAttribute(classProp, 'x');
+ if (DIV.className !== 'x') {
+ DIV.setAttribute('class', 'x');
+ if (DIV.className === 'x')
+ classProp = 'class';
+ }
+
+ var LABEL = document.createElement('label');
+ LABEL.setAttribute(forProp, 'x');
+ if (LABEL.htmlFor !== 'x') {
+ LABEL.setAttribute('htmlFor', 'x');
+ if (LABEL.htmlFor === 'x')
+ forProp = 'htmlFor';
+ }
+ LABEL = null;
+
+ function _getAttr(element, attribute) {
+ return element.getAttribute(attribute);
+ }
+
+ function _getAttr2(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ }
+
+ function _getAttrNode(element, attribute) {
+ var node = element.getAttributeNode(attribute);
+ return node ? node.value : '';
+ }
+
+ function _getFlag(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ }
+
+ DIV.onclick = Prototype.emptyFunction;
+ var onclickValue = DIV.getAttribute('onclick');
+
+ var _getEv;
+
+ if (String(onclickValue).indexOf('{') > -1) {
+ _getEv = function(element, attribute) {
+ var value = element.getAttribute(attribute);
+ if (!value) return null;
+ value = value.toString();
+ value = value.split('{')[1];
+ value = value.split('}')[0];
+ return value.strip();
+ };
+ }
+ else if (onclickValue === '') {
+ _getEv = function(element, attribute) {
+ var value = element.getAttribute(attribute);
+ if (!value) return null;
+ return value.strip();
+ };
+ }
+
+ ATTRIBUTE_TRANSLATIONS.read = {
+ names: {
+ 'class': classProp,
+ 'className': classProp,
+ 'for': forProp,
+ 'htmlFor': forProp
+ },
+
+ values: {
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ return element.title;
+ }
+ }
+ };
+
+ ATTRIBUTE_TRANSLATIONS.write = {
+ names: {
+ className: 'class',
+ htmlFor: 'for',
+ cellpadding: 'cellPadding',
+ cellspacing: 'cellSpacing'
+ },
+
+ values: {
+ checked: function(element, value) {
+ element.checked = !!value;
+ },
+
+ style: function(element, value) {
+ element.style.cssText = value ? value : '';
+ }
+ }
+ };
+
+ ATTRIBUTE_TRANSLATIONS.has = { names: {} };
+
+ Object.extend(ATTRIBUTE_TRANSLATIONS.write.names,
+ ATTRIBUTE_TRANSLATIONS.read.names);
+
+ var CAMEL_CASED_ATTRIBUTE_NAMES = $w('colSpan rowSpan vAlign dateTime ' +
+ 'accessKey tabIndex encType maxLength readOnly longDesc frameBorder');
+
+ for (var i = 0, attr; attr = CAMEL_CASED_ATTRIBUTE_NAMES[i]; i++) {
+ ATTRIBUTE_TRANSLATIONS.write.names[attr.toLowerCase()] = attr;
+ ATTRIBUTE_TRANSLATIONS.has.names[attr.toLowerCase()] = attr;
+ }
+
+ Object.extend(ATTRIBUTE_TRANSLATIONS.read.values, {
+ href: _getAttr2,
+ src: _getAttr2,
+ type: _getAttr,
+ action: _getAttrNode,
+ disabled: _getFlag,
+ checked: _getFlag,
+ readonly: _getFlag,
+ multiple: _getFlag,
+ onload: _getEv,
+ onunload: _getEv,
+ onclick: _getEv,
+ ondblclick: _getEv,
+ onmousedown: _getEv,
+ onmouseup: _getEv,
+ onmouseover: _getEv,
+ onmousemove: _getEv,
+ onmouseout: _getEv,
+ onfocus: _getEv,
+ onblur: _getEv,
+ onkeypress: _getEv,
+ onkeydown: _getEv,
+ onkeyup: _getEv,
+ onsubmit: _getEv,
+ onreset: _getEv,
+ onselect: _getEv,
+ onchange: _getEv
+ });
+
+
+ Object.extend(methods, {
+ identify: identify,
+ readAttribute: readAttribute,
+ writeAttribute: writeAttribute,
+ classNames: classNames,
+ hasClassName: hasClassName,
+ addClassName: addClassName,
+ removeClassName: removeClassName,
+ toggleClassName: toggleClassName
+ });
+
+
+ function normalizeStyleName(style) {
+ if (style === 'float' || style === 'styleFloat')
+ return 'cssFloat';
+ return style.camelize();
+ }
+
+ function normalizeStyleName_IE(style) {
+ if (style === 'float' || style === 'cssFloat')
+ return 'styleFloat';
+ return style.camelize();
+ }
+
+ function setStyle(element, styles) {
+ element = $(element);
+ var elementStyle = element.style, match;
+
+ if (Object.isString(styles)) {
+ elementStyle.cssText += ';' + styles;
+ if (styles.include('opacity')) {
+ var opacity = styles.match(/opacity:\s*(\d?\.?\d*)/)[1];
+ Element.setOpacity(element, opacity);
+ }
+ return element;
+ }
+
+ for (var property in styles) {
+ if (property === 'opacity') {
+ Element.setOpacity(element, styles[property]);
+ } else {
+ var value = styles[property];
+ if (property === 'float' || property === 'cssFloat') {
+ property = Object.isUndefined(elementStyle.styleFloat) ?
+ 'cssFloat' : 'styleFloat';
+ }
+ elementStyle[property] = value;
+ }
+ }
+
+ return element;
+ }
+
+
+ function getStyle(element, style) {
+ element = $(element);
+ style = normalizeStyleName(style);
+
+ var value = element.style[style];
+ if (!value || value === 'auto') {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+
+ if (style === 'opacity') return value ? parseFloat(value) : 1.0;
+ return value === 'auto' ? null : value;
+ }
+
+ function getStyle_Opera(element, style) {
+ switch (style) {
+ case 'height': case 'width':
+ if (!Element.visible(element)) return null;
+
+ var dim = parseInt(getStyle(element, style), 10);
+
+ if (dim !== element['offset' + style.capitalize()])
+ return dim + 'px';
+
+ return Element.measure(element, style);
+
+ default: return getStyle(element, style);
+ }
+ }
+
+ function getStyle_IE(element, style) {
+ element = $(element);
+ style = normalizeStyleName_IE(style);
+
+ var value = element.style[style];
+ if (!value && element.currentStyle) {
+ value = element.currentStyle[style];
+ }
+
+ if (style === 'opacity' && !STANDARD_CSS_OPACITY_SUPPORTED)
+ return getOpacity_IE(element);
+
+ if (value === 'auto') {
+ if ((style === 'width' || style === 'height') && Element.visible(element))
+ return Element.measure(element, style) + 'px';
+ return null;
+ }
+
+ return value;
+ }
+
+ function stripAlphaFromFilter_IE(filter) {
+ return (filter || '').replace(/alpha\([^\)]*\)/gi, '');
+ }
+
+ function hasLayout_IE(element) {
+ if (!element.currentStyle || !element.currentStyle.hasLayout)
+ element.style.zoom = 1;
+ return element;
+ }
+
+ var STANDARD_CSS_OPACITY_SUPPORTED = (function() {
+ DIV.style.cssText = "opacity:.55";
+ return /^0.55/.test(DIV.style.opacity);
+ })();
+
+ function setOpacity(element, value) {
+ element = $(element);
+ if (value == 1 || value === '') value = '';
+ else if (value < 0.00001) value = 0;
+ element.style.opacity = value;
+ return element;
+ }
+
+ function setOpacity_IE(element, value) {
+ if (STANDARD_CSS_OPACITY_SUPPORTED)
+ return setOpacity(element, value);
+
+ element = hasLayout_IE($(element));
+ var filter = Element.getStyle(element, 'filter'),
+ style = element.style;
+
+ if (value == 1 || value === '') {
+ filter = stripAlphaFromFilter_IE(filter);
+ if (filter) style.filter = filter;
+ else style.removeAttribute('filter');
+ return element;
+ }
+
+ if (value < 0.00001) value = 0;
+
+ style.filter = stripAlphaFromFilter_IE(filter) +
+ 'alpha(opacity=' + (value * 100) + ')';
+
+ return element;
+ }
+
+
+ function getOpacity(element) {
+ return Element.getStyle(element, 'opacity');
+ }
+
+ function getOpacity_IE(element) {
+ if (STANDARD_CSS_OPACITY_SUPPORTED)
+ return getOpacity(element);
+
+ var filter = Element.getStyle(element, 'filter');
+ if (filter.length === 0) return 1.0;
+ var match = (filter || '').match(/alpha\(opacity=(.*)\)/);
+ if (match && match[1]) return parseFloat(match[1]) / 100;
+ return 1.0;
+ }
+
+
+ Object.extend(methods, {
+ setStyle: setStyle,
+ getStyle: getStyle,
+ setOpacity: setOpacity,
+ getOpacity: getOpacity
+ });
+
+ if ('styleFloat' in DIV.style) {
+ methods.getStyle = getStyle_IE;
+ methods.setOpacity = setOpacity_IE;
+ methods.getOpacity = getOpacity_IE;
+ }
+
+ var UID = 0;
+
+ GLOBAL.Element.Storage = { UID: 1 };
+
+ function getUniqueElementID(element) {
+ if (element === window) return 0;
+
+ if (typeof element._prototypeUID === 'undefined')
+ element._prototypeUID = Element.Storage.UID++;
+ return element._prototypeUID;
+ }
+
+ function getUniqueElementID_IE(element) {
+ if (element === window) return 0;
+ if (element == document) return 1;
+ return element.uniqueID;
+ }
+
+ var HAS_UNIQUE_ID_PROPERTY = ('uniqueID' in DIV);
+ if (HAS_UNIQUE_ID_PROPERTY)
+ getUniqueElementID = getUniqueElementID_IE;
+
+ function getStorage(element) {
+ if (!(element = $(element))) return;
+
+ var uid = getUniqueElementID(element);
+
+ if (!Element.Storage[uid])
+ Element.Storage[uid] = $H();
+
+ return Element.Storage[uid];
+ }
+
+ function store(element, key, value) {
+ if (!(element = $(element))) return;
+ var storage = getStorage(element);
+ if (arguments.length === 2) {
+ storage.update(key);
+ } else {
+ storage.set(key, value);
+ }
+ return element;
+ }
+
+ function retrieve(element, key, defaultValue) {
+ if (!(element = $(element))) return;
+ var storage = getStorage(element), value = storage.get(key);
+
+ if (Object.isUndefined(value)) {
+ storage.set(key, defaultValue);
+ value = defaultValue;
+ }
+
+ return value;
+ }
+
+
+ Object.extend(methods, {
+ getStorage: getStorage,
+ store: store,
+ retrieve: retrieve
+ });
+
+
+ var Methods = {}, ByTag = Element.Methods.ByTag,
+ F = Prototype.BrowserFeatures;
+
+ if (!F.ElementExtensions && ('__proto__' in DIV)) {
+ GLOBAL.HTMLElement = {};
+ GLOBAL.HTMLElement.prototype = DIV['__proto__'];
+ F.ElementExtensions = true;
+ }
+
+ function checkElementPrototypeDeficiency(tagName) {
+ if (typeof window.Element === 'undefined') return false;
+ if (!HAS_EXTENDED_CREATE_ELEMENT_SYNTAX) return false;
+ var proto = window.Element.prototype;
+ if (proto) {
+ var id = '_' + (Math.random() + '').slice(2),
+ el = document.createElement(tagName);
+ proto[id] = 'x';
+ var isBuggy = (el[id] !== 'x');
+ delete proto[id];
+ el = null;
+ return isBuggy;
+ }
+
+ return false;
+ }
+
+ var HTMLOBJECTELEMENT_PROTOTYPE_BUGGY =
+ checkElementPrototypeDeficiency('object');
+
+ function extendElementWith(element, methods) {
+ for (var property in methods) {
+ var value = methods[property];
+ if (Object.isFunction(value) && !(property in element))
+ element[property] = value.methodize();
+ }
+ }
+
+ var EXTENDED = {};
+ function elementIsExtended(element) {
+ var uid = getUniqueElementID(element);
+ return (uid in EXTENDED);
+ }
+
+ function extend(element) {
+ if (!element || elementIsExtended(element)) return element;
+ if (element.nodeType !== Node.ELEMENT_NODE || element == window)
+ return element;
+
+ var methods = Object.clone(Methods),
+ tagName = element.tagName.toUpperCase();
+
+ if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+ extendElementWith(element, methods);
+ EXTENDED[getUniqueElementID(element)] = true;
+ return element;
+ }
+
+ function extend_IE8(element) {
+ if (!element || elementIsExtended(element)) return element;
+
+ var t = element.tagName;
+ if (t && (/^(?:object|applet|embed)$/i.test(t))) {
+ extendElementWith(element, Element.Methods);
+ extendElementWith(element, Element.Methods.Simulated);
+ extendElementWith(element, Element.Methods.ByTag[t.toUpperCase()]);
+ }
+
+ return element;
+ }
+
+ if (F.SpecificElementExtensions) {
+ extend = HTMLOBJECTELEMENT_PROTOTYPE_BUGGY ? extend_IE8 : Prototype.K;
+ }
+
+ function addMethodsToTagName(tagName, methods) {
+ tagName = tagName.toUpperCase();
+ if (!ByTag[tagName]) ByTag[tagName] = {};
+ Object.extend(ByTag[tagName], methods);
+ }
+
+ function mergeMethods(destination, methods, onlyIfAbsent) {
+ if (Object.isUndefined(onlyIfAbsent)) onlyIfAbsent = false;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!Object.isFunction(value)) continue;
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = value.methodize();
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ var element = document.createElement(tagName),
+ proto = element['__proto__'] || element.constructor.prototype;
+
+ element = null;
+ return proto;
+ }
+
+ function addMethods(methods) {
+ if (arguments.length === 0) addFormMethods();
+
+ if (arguments.length === 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) {
+ Object.extend(Element.Methods, methods || {});
+ } else {
+ if (Object.isArray(tagName)) {
+ for (var i = 0, tag; tag = tagName[i]; i++)
+ addMethodsToTagName(tag, methods);
+ } else {
+ addMethodsToTagName(tagName, methods);
+ }
+ }
+
+ var ELEMENT_PROTOTYPE = window.HTMLElement ? HTMLElement.prototype :
+ Element.prototype;
+
+ if (F.ElementExtensions) {
+ mergeMethods(ELEMENT_PROTOTYPE, Element.Methods);
+ mergeMethods(ELEMENT_PROTOTYPE, Element.Methods.Simulated, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (Object.isUndefined(klass)) continue;
+ mergeMethods(klass.prototype, ByTag[tag]);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ Object.extend(Element, Element.Methods.Simulated);
+ delete Element.ByTag;
+ delete Element.Simulated;
+
+ Element.extend.refresh();
+
+ ELEMENT_CACHE = {};
+ }
+
+ Object.extend(GLOBAL.Element, {
+ extend: extend,
+ addMethods: addMethods
+ });
+
+ if (extend === Prototype.K) {
+ GLOBAL.Element.extend.refresh = Prototype.emptyFunction;
+ } else {
+ GLOBAL.Element.extend.refresh = function() {
+ if (Prototype.BrowserFeatures.ElementExtensions) return;
+ Object.extend(Methods, Element.Methods);
+ Object.extend(Methods, Element.Methods.Simulated);
+
+ EXTENDED = {};
+ };
+ }
+
+ function addFormMethods() {
+ Object.extend(Form, Form.Methods);
+ Object.extend(Form.Element, Form.Element.Methods);
+ Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods),
+ "BUTTON": Object.clone(Form.Element.Methods)
+ });
+ }
+
+ Element.addMethods(methods);
+
+ function destroyCache_IE() {
+ DIV = null;
+ ELEMENT_CACHE = null;
+ }
+
+ if (window.attachEvent)
+ window.attachEvent('onunload', destroyCache_IE);
+
+})(this);
+(function() {
+
+ function toDecimal(pctString) {
+ var match = pctString.match(/^(\d+)%?$/i);
+ if (!match) return null;
+ return (Number(match[1]) / 100);
+ }
+
+ function getRawStyle(element, style) {
+ element = $(element);
+
+ var value = element.style[style];
+ if (!value || value === 'auto') {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+
+ if (style === 'opacity') return value ? parseFloat(value) : 1.0;
+ return value === 'auto' ? null : value;
+ }
+
+ function getRawStyle_IE(element, style) {
+ var value = element.style[style];
+ if (!value && element.currentStyle) {
+ value = element.currentStyle[style];
+ }
+ return value;
+ }
+
+ function getContentWidth(element, context) {
+ var boxWidth = element.offsetWidth;
+
+ var bl = getPixelValue(element, 'borderLeftWidth', context) || 0;
+ var br = getPixelValue(element, 'borderRightWidth', context) || 0;
+ var pl = getPixelValue(element, 'paddingLeft', context) || 0;
+ var pr = getPixelValue(element, 'paddingRight', context) || 0;
+
+ return boxWidth - bl - br - pl - pr;
+ }
+
+ if ('currentStyle' in document.documentElement) {
+ getRawStyle = getRawStyle_IE;
+ }
+
+
+ function getPixelValue(value, property, context) {
+ var element = null;
+ if (Object.isElement(value)) {
+ element = value;
+ value = getRawStyle(element, property);
+ }
+
+ if (value === null || Object.isUndefined(value)) {
+ return null;
+ }
+
+ if ((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(value)) {
+ return window.parseFloat(value);
+ }
+
+ var isPercentage = value.include('%'), isViewport = (context === document.viewport);
+
+ if (/\d/.test(value) && element && element.runtimeStyle && !(isPercentage && isViewport)) {
+ var style = element.style.left, rStyle = element.runtimeStyle.left;
+ element.runtimeStyle.left = element.currentStyle.left;
+ element.style.left = value || 0;
+ value = element.style.pixelLeft;
+ element.style.left = style;
+ element.runtimeStyle.left = rStyle;
+
+ return value;
+ }
+
+ if (element && isPercentage) {
+ context = context || element.parentNode;
+ var decimal = toDecimal(value), whole = null;
+
+ var isHorizontal = property.include('left') || property.include('right') ||
+ property.include('width');
+
+ var isVertical = property.include('top') || property.include('bottom') ||
+ property.include('height');
+
+ if (context === document.viewport) {
+ if (isHorizontal) {
+ whole = document.viewport.getWidth();
+ } else if (isVertical) {
+ whole = document.viewport.getHeight();
+ }
+ } else {
+ if (isHorizontal) {
+ whole = $(context).measure('width');
+ } else if (isVertical) {
+ whole = $(context).measure('height');
+ }
+ }
+
+ return (whole === null) ? 0 : whole * decimal;
+ }
+
+ return 0;
+ }
+
+ function toCSSPixels(number) {
+ if (Object.isString(number) && number.endsWith('px'))
+ return number;
+ return number + 'px';
+ }
+
+ function isDisplayed(element) {
+ while (element && element.parentNode) {
+ var display = element.getStyle('display');
+ if (display === 'none') {
+ return false;
+ }
+ element = $(element.parentNode);
+ }
+ return true;
+ }
+
+ var hasLayout = Prototype.K;
+ if ('currentStyle' in document.documentElement) {
+ hasLayout = function(element) {
+ if (!element.currentStyle.hasLayout) {
+ element.style.zoom = 1;
+ }
+ return element;
+ };
+ }
+
+ function cssNameFor(key) {
+ if (key.include('border')) key = key + '-width';
+ return key.camelize();
+ }
+
+ Element.Layout = Class.create(Hash, {
+ initialize: function($super, element, preCompute) {
+ $super();
+ this.element = $(element);
+
+ Element.Layout.PROPERTIES.each( function(property) {
+ this._set(property, null);
+ }, this);
+
+ if (preCompute) {
+ this._preComputing = true;
+ this._begin();
+ Element.Layout.PROPERTIES.each( this._compute, this );
+ this._end();
+ this._preComputing = false;
+ }
+ },
+
+ _set: function(property, value) {
+ return Hash.prototype.set.call(this, property, value);
+ },
+
+ set: function(property, value) {
+ throw "Properties of Element.Layout are read-only.";
+ },
+
+ get: function($super, property) {
+ var value = $super(property);
+ return value === null ? this._compute(property) : value;
+ },
+
+ _begin: function() {
+ if (this._isPrepared()) return;
+
+ var element = this.element;
+ if (isDisplayed(element)) {
+ this._setPrepared(true);
+ return;
+ }
+
+
+ var originalStyles = {
+ position: element.style.position || '',
+ width: element.style.width || '',
+ visibility: element.style.visibility || '',
+ display: element.style.display || ''
+ };
+
+ element.store('prototype_original_styles', originalStyles);
+
+ var position = getRawStyle(element, 'position'), width = element.offsetWidth;
+
+ if (width === 0 || width === null) {
+ element.style.display = 'block';
+ width = element.offsetWidth;
+ }
+
+ var context = (position === 'fixed') ? document.viewport :
+ element.parentNode;
+
+ var tempStyles = {
+ visibility: 'hidden',
+ display: 'block'
+ };
+
+ if (position !== 'fixed') tempStyles.position = 'absolute';
+
+ element.setStyle(tempStyles);
+
+ var positionedWidth = element.offsetWidth, newWidth;
+ if (width && (positionedWidth === width)) {
+ newWidth = getContentWidth(element, context);
+ } else if (position === 'absolute' || position === 'fixed') {
+ newWidth = getContentWidth(element, context);
+ } else {
+ var parent = element.parentNode, pLayout = $(parent).getLayout();
+
+ newWidth = pLayout.get('width') -
+ this.get('margin-left') -
+ this.get('border-left') -
+ this.get('padding-left') -
+ this.get('padding-right') -
+ this.get('border-right') -
+ this.get('margin-right');
+ }
+
+ element.setStyle({ width: newWidth + 'px' });
+
+ this._setPrepared(true);
+ },
+
+ _end: function() {
+ var element = this.element;
+ var originalStyles = element.retrieve('prototype_original_styles');
+ element.store('prototype_original_styles', null);
+ element.setStyle(originalStyles);
+ this._setPrepared(false);
+ },
+
+ _compute: function(property) {
+ var COMPUTATIONS = Element.Layout.COMPUTATIONS;
+ if (!(property in COMPUTATIONS)) {
+ throw "Property not found.";
+ }
+
+ return this._set(property, COMPUTATIONS[property].call(this, this.element));
+ },
+
+ _isPrepared: function() {
+ return this.element.retrieve('prototype_element_layout_prepared', false);
+ },
+
+ _setPrepared: function(bool) {
+ return this.element.store('prototype_element_layout_prepared', bool);
+ },
+
+ toObject: function() {
+ var args = $A(arguments);
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+ args.join(' ').split(' ');
+ var obj = {};
+ keys.each( function(key) {
+ if (!Element.Layout.PROPERTIES.include(key)) return;
+ var value = this.get(key);
+ if (value != null) obj[key] = value;
+ }, this);
+ return obj;
+ },
+
+ toHash: function() {
+ var obj = this.toObject.apply(this, arguments);
+ return new Hash(obj);
+ },
+
+ toCSS: function() {
+ var args = $A(arguments);
+ var keys = (args.length === 0) ? Element.Layout.PROPERTIES :
+ args.join(' ').split(' ');
+ var css = {};
+
+ keys.each( function(key) {
+ if (!Element.Layout.PROPERTIES.include(key)) return;
+ if (Element.Layout.COMPOSITE_PROPERTIES.include(key)) return;
+
+ var value = this.get(key);
+ if (value != null) css[cssNameFor(key)] = value + 'px';
+ }, this);
+ return css;
+ },
+
+ inspect: function() {
+ return "#<Element.Layout>";
+ }
+ });
+
+ Object.extend(Element.Layout, {
+ PROPERTIES: $w('height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height'),
+
+ COMPOSITE_PROPERTIES: $w('padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height'),
+
+ COMPUTATIONS: {
+ 'height': function(element) {
+ if (!this._preComputing) this._begin();
+
+ var bHeight = this.get('border-box-height');
+ if (bHeight <= 0) {
+ if (!this._preComputing) this._end();
+ return 0;
+ }
+
+ var bTop = this.get('border-top'),
+ bBottom = this.get('border-bottom');
+
+ var pTop = this.get('padding-top'),
+ pBottom = this.get('padding-bottom');
+
+ if (!this._preComputing) this._end();
+
+ return bHeight - bTop - bBottom - pTop - pBottom;
+ },
+
+ 'width': function(element) {
+ if (!this._preComputing) this._begin();
+
+ var bWidth = this.get('border-box-width');
+ if (bWidth <= 0) {
+ if (!this._preComputing) this._end();
+ return 0;
+ }
+
+ var bLeft = this.get('border-left'),
+ bRight = this.get('border-right');
+
+ var pLeft = this.get('padding-left'),
+ pRight = this.get('padding-right');
+
+ if (!this._preComputing) this._end();
+ return bWidth - bLeft - bRight - pLeft - pRight;
+ },
+
+ 'padding-box-height': function(element) {
+ var height = this.get('height'),
+ pTop = this.get('padding-top'),
+ pBottom = this.get('padding-bottom');
+
+ return height + pTop + pBottom;
+ },
+
+ 'padding-box-width': function(element) {
+ var width = this.get('width'),
+ pLeft = this.get('padding-left'),
+ pRight = this.get('padding-right');
+
+ return width + pLeft + pRight;
+ },
+
+ 'border-box-height': function(element) {
+ if (!this._preComputing) this._begin();
+ var height = element.offsetHeight;
+ if (!this._preComputing) this._end();
+ return height;
+ },
+
+ 'border-box-width': function(element) {
+ if (!this._preComputing) this._begin();
+ var width = element.offsetWidth;
+ if (!this._preComputing) this._end();
+ return width;
+ },
+
+ 'margin-box-height': function(element) {
+ var bHeight = this.get('border-box-height'),
+ mTop = this.get('margin-top'),
+ mBottom = this.get('margin-bottom');
+
+ if (bHeight <= 0) return 0;
+
+ return bHeight + mTop + mBottom;
+ },
+
+ 'margin-box-width': function(element) {
+ var bWidth = this.get('border-box-width'),
+ mLeft = this.get('margin-left'),
+ mRight = this.get('margin-right');
+
+ if (bWidth <= 0) return 0;
+
+ return bWidth + mLeft + mRight;
+ },
+
+ 'top': function(element) {
+ var offset = element.positionedOffset();
+ return offset.top;
+ },
+
+ 'bottom': function(element) {
+ var offset = element.positionedOffset(),
+ parent = element.getOffsetParent(),
+ pHeight = parent.measure('height');
+
+ var mHeight = this.get('border-box-height');
+
+ return pHeight - mHeight - offset.top;
+ },
+
+ 'left': function(element) {
+ var offset = element.positionedOffset();
+ return offset.left;
+ },
+
+ 'right': function(element) {
+ var offset = element.positionedOffset(),
+ parent = element.getOffsetParent(),
+ pWidth = parent.measure('width');
+
+ var mWidth = this.get('border-box-width');
+
+ return pWidth - mWidth - offset.left;
+ },
+
+ 'padding-top': function(element) {
+ return getPixelValue(element, 'paddingTop');
+ },
+
+ 'padding-bottom': function(element) {
+ return getPixelValue(element, 'paddingBottom');
+ },
+
+ 'padding-left': function(element) {
+ return getPixelValue(element, 'paddingLeft');
+ },
+
+ 'padding-right': function(element) {
+ return getPixelValue(element, 'paddingRight');
+ },
+
+ 'border-top': function(element) {
+ return getPixelValue(element, 'borderTopWidth');
+ },
+
+ 'border-bottom': function(element) {
+ return getPixelValue(element, 'borderBottomWidth');
+ },
+
+ 'border-left': function(element) {
+ return getPixelValue(element, 'borderLeftWidth');
+ },
+
+ 'border-right': function(element) {
+ return getPixelValue(element, 'borderRightWidth');
+ },
+
+ 'margin-top': function(element) {
+ return getPixelValue(element, 'marginTop');
+ },
+
+ 'margin-bottom': function(element) {
+ return getPixelValue(element, 'marginBottom');
+ },
+
+ 'margin-left': function(element) {
+ return getPixelValue(element, 'marginLeft');
+ },
+
+ 'margin-right': function(element) {
+ return getPixelValue(element, 'marginRight');
+ }
+ }
+ });
+
+ if ('getBoundingClientRect' in document.documentElement) {
+ Object.extend(Element.Layout.COMPUTATIONS, {
+ 'right': function(element) {
+ var parent = hasLayout(element.getOffsetParent());
+ var rect = element.getBoundingClientRect(),
+ pRect = parent.getBoundingClientRect();
+
+ return (pRect.right - rect.right).round();
+ },
+
+ 'bottom': function(element) {
+ var parent = hasLayout(element.getOffsetParent());
+ var rect = element.getBoundingClientRect(),
+ pRect = parent.getBoundingClientRect();
+
+ return (pRect.bottom - rect.bottom).round();
+ }
+ });
+ }
+
+ Element.Offset = Class.create({
+ initialize: function(left, top) {
+ this.left = left.round();
+ this.top = top.round();
+
+ this[0] = this.left;
+ this[1] = this.top;
+ },
+
+ relativeTo: function(offset) {
+ return new Element.Offset(
+ this.left - offset.left,
+ this.top - offset.top
+ );
+ },
+
+ inspect: function() {
+ return "#<Element.Offset left: #{left} top: #{top}>".interpolate(this);
+ },
+
+ toString: function() {
+ return "[#{left}, #{top}]".interpolate(this);
+ },
+
+ toArray: function() {
+ return [this.left, this.top];
+ }
+ });
+
+ function getLayout(element, preCompute) {
+ return new Element.Layout(element, preCompute);
+ }
+
+ function measure(element, property) {
+ return $(element).getLayout().get(property);
+ }
+
+ function getHeight(element) {
+ return Element.getDimensions(element).height;
+ }
+
+ function getWidth(element) {
+ return Element.getDimensions(element).width;
+ }
+
+ function getDimensions(element) {
+ element = $(element);
+ var display = Element.getStyle(element, 'display');
+
+ if (display && display !== 'none') {
+ return { width: element.offsetWidth, height: element.offsetHeight };
+ }
+
+ var style = element.style;
+ var originalStyles = {
+ visibility: style.visibility,
+ position: style.position,
+ display: style.display
+ };
+
+ var newStyles = {
+ visibility: 'hidden',
+ display: 'block'
+ };
+
+ if (originalStyles.position !== 'fixed')
+ newStyles.position = 'absolute';
+
+ Element.setStyle(element, newStyles);
+
+ var dimensions = {
+ width: element.offsetWidth,
+ height: element.offsetHeight
+ };
+
+ Element.setStyle(element, originalStyles);
+
+ return dimensions;
+ }
+
+ function getOffsetParent(element) {
+ element = $(element);
+
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+ return $(document.body);
+
+ var isInline = (Element.getStyle(element, 'display') === 'inline');
+ if (!isInline && element.offsetParent) return $(element.offsetParent);
+
+ while ((element = element.parentNode) && element !== document.body) {
+ if (Element.getStyle(element, 'position') !== 'static') {
+ return isHtml(element) ? $(document.body) : $(element);
+ }
+ }
+
+ return $(document.body);
+ }
+
+
+ function cumulativeOffset(element) {
+ element = $(element);
+ var valueT = 0, valueL = 0;
+ if (element.parentNode) {
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ }
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function positionedOffset(element) {
+ element = $(element);
+
+ var layout = element.getLayout();
+
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if (isBody(element)) break;
+ var p = Element.getStyle(element, 'position');
+ if (p !== 'static') break;
+ }
+ } while (element);
+
+ valueL -= layout.get('margin-top');
+ valueT -= layout.get('margin-left');
+
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function cumulativeScrollOffset(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ if (element === document.body) {
+ var bodyScrollNode = document.documentElement || document.body.parentNode || document.body;
+ valueT += !Object.isUndefined(window.pageYOffset) ? window.pageYOffset : bodyScrollNode.scrollTop || 0;
+ valueL += !Object.isUndefined(window.pageXOffset) ? window.pageXOffset : bodyScrollNode.scrollLeft || 0;
+ break;
+ } else {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ }
+ } while (element);
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function viewportOffset(forElement) {
+ var valueT = 0, valueL = 0, docBody = document.body;
+
+ forElement = $(forElement);
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == docBody &&
+ Element.getStyle(element, 'position') == 'absolute') break;
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (element != docBody) {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+ return new Element.Offset(valueL, valueT);
+ }
+
+ function absolutize(element) {
+ element = $(element);
+
+ if (Element.getStyle(element, 'position') === 'absolute') {
+ return element;
+ }
+
+ var offsetParent = getOffsetParent(element);
+ var eOffset = element.viewportOffset(),
+ pOffset = offsetParent.viewportOffset();
+
+ var offset = eOffset.relativeTo(pOffset);
+ var layout = element.getLayout();
+
+ element.store('prototype_absolutize_original_styles', {
+ position: element.getStyle('position'),
+ left: element.getStyle('left'),
+ top: element.getStyle('top'),
+ width: element.getStyle('width'),
+ height: element.getStyle('height')
+ });
+
+ element.setStyle({
+ position: 'absolute',
+ top: offset.top + 'px',
+ left: offset.left + 'px',
+ width: layout.get('width') + 'px',
+ height: layout.get('height') + 'px'
+ });
+
+ return element;
+ }
+
+ function relativize(element) {
+ element = $(element);
+ if (Element.getStyle(element, 'position') === 'relative') {
+ return element;
+ }
+
+ var originalStyles =
+ element.retrieve('prototype_absolutize_original_styles');
+
+ if (originalStyles) element.setStyle(originalStyles);
+ return element;
+ }
+
+
+ function scrollTo(element) {
+ element = $(element);
+ var pos = Element.cumulativeOffset(element);
+ window.scrollTo(pos.left, pos.top);
+ return element;
+ }
+
+
+ function makePositioned(element) {
+ element = $(element);
+ var position = Element.getStyle(element, 'position'), styles = {};
+ if (position === 'static' || !position) {
+ styles.position = 'relative';
+ if (Prototype.Browser.Opera) {
+ styles.top = 0;
+ styles.left = 0;
+ }
+ Element.setStyle(element, styles);
+ Element.store(element, 'prototype_made_positioned', true);
+ }
+ return element;
+ }
+
+ function undoPositioned(element) {
+ element = $(element);
+ var storage = Element.getStorage(element),
+ madePositioned = storage.get('prototype_made_positioned');
+
+ if (madePositioned) {
+ storage.unset('prototype_made_positioned');
+ Element.setStyle(element, {
+ position: '',
+ top: '',
+ bottom: '',
+ left: '',
+ right: ''
+ });
+ }
+ return element;
+ }
+
+ function makeClipping(element) {
+ element = $(element);
+
+ var storage = Element.getStorage(element),
+ madeClipping = storage.get('prototype_made_clipping');
+
+ if (Object.isUndefined(madeClipping)) {
+ var overflow = Element.getStyle(element, 'overflow');
+ storage.set('prototype_made_clipping', overflow);
+ if (overflow !== 'hidden')
+ element.style.overflow = 'hidden';
+ }
+
+ return element;
+ }
+
+ function undoClipping(element) {
+ element = $(element);
+ var storage = Element.getStorage(element),
+ overflow = storage.get('prototype_made_clipping');
+
+ if (!Object.isUndefined(overflow)) {
+ storage.unset('prototype_made_clipping');
+ element.style.overflow = overflow || '';
+ }
+
+ return element;
+ }
+
+ function clonePosition(element, source, options) {
+ options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, options || {});
+
+ source = $(source);
+ element = $(element);
+ var p, delta, layout, styles = {};
+
+ if (options.setLeft || options.setTop) {
+ p = Element.viewportOffset(source);
+ delta = [0, 0];
+ if (Element.getStyle(element, 'position') === 'absolute') {
+ var parent = Element.getOffsetParent(element);
+ if (parent !== document.body) delta = Element.viewportOffset(parent);
+ }
+ }
+
+ if (options.setWidth || options.setHeight) {
+ layout = Element.getLayout(source);
+ }
+
+ if (options.setLeft)
+ styles.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if (options.setTop)
+ styles.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+
+ if (options.setWidth)
+ styles.width = layout.get('border-box-width') + 'px';
+ if (options.setHeight)
+ styles.height = layout.get('border-box-height') + 'px';
+
+ return Element.setStyle(element, styles);
+ }
+
+
+ if (Prototype.Browser.IE) {
+ getOffsetParent = getOffsetParent.wrap(
+ function(proceed, element) {
+ element = $(element);
+
+ if (isDocument(element) || isDetached(element) || isBody(element) || isHtml(element))
+ return $(document.body);
+
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ }
+ );
+
+ positionedOffset = positionedOffset.wrap(function(proceed, element) {
+ element = $(element);
+ if (!element.parentNode) return new Element.Offset(0, 0);
+ var position = element.getStyle('position');
+ if (position !== 'static') return proceed(element);
+
+ var offsetParent = element.getOffsetParent();
+ if (offsetParent && offsetParent.getStyle('position') === 'fixed')
+ hasLayout(offsetParent);
+
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ });
+ } else if (Prototype.Browser.Webkit) {
+ cumulativeOffset = function(element) {
+ element = $(element);
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body) {
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+ }
+
+ element = element.offsetParent;
+ } while (element);
+
+ return new Element.Offset(valueL, valueT);
+ };
+ }
+
+
+ Element.addMethods({
+ getLayout: getLayout,
+ measure: measure,
+ getWidth: getWidth,
+ getHeight: getHeight,
+ getDimensions: getDimensions,
+ getOffsetParent: getOffsetParent,
+ cumulativeOffset: cumulativeOffset,
+ positionedOffset: positionedOffset,
+ cumulativeScrollOffset: cumulativeScrollOffset,
+ viewportOffset: viewportOffset,
+ absolutize: absolutize,
+ relativize: relativize,
+ scrollTo: scrollTo,
+ makePositioned: makePositioned,
+ undoPositioned: undoPositioned,
+ makeClipping: makeClipping,
+ undoClipping: undoClipping,
+ clonePosition: clonePosition
+ });
+
+ function isBody(element) {
+ return element.nodeName.toUpperCase() === 'BODY';
+ }
+
+ function isHtml(element) {
+ return element.nodeName.toUpperCase() === 'HTML';
+ }
+
+ function isDocument(element) {
+ return element.nodeType === Node.DOCUMENT_NODE;
+ }
+
+ function isDetached(element) {
+ return element !== document.body &&
+ !Element.descendantOf(element, document.body);
+ }
+
+ if ('getBoundingClientRect' in document.documentElement) {
+ Element.addMethods({
+ viewportOffset: function(element) {
+ element = $(element);
+ if (isDetached(element)) return new Element.Offset(0, 0);
+
+ var rect = element.getBoundingClientRect(),
+ docEl = document.documentElement;
+ return new Element.Offset(rect.left - docEl.clientLeft,
+ rect.top - docEl.clientTop);
+ }
+ });
+ }
+
+
+})();
+
+(function() {
+
+ var IS_OLD_OPERA = Prototype.Browser.Opera &&
+ (window.parseFloat(window.opera.version()) < 9.5);
+ var ROOT = null;
+ function getRootElement() {
+ if (ROOT) return ROOT;
+ ROOT = IS_OLD_OPERA ? document.body : document.documentElement;
+ return ROOT;
+ }
+
+ function getDimensions() {
+ return { width: this.getWidth(), height: this.getHeight() };
+ }
+
+ function getWidth() {
+ return getRootElement().clientWidth;
+ }
+
+ function getHeight() {
+ return getRootElement().clientHeight;
+ }
+
+ function getScrollOffsets() {
+ var x = window.pageXOffset || document.documentElement.scrollLeft ||
+ document.body.scrollLeft;
+ var y = window.pageYOffset || document.documentElement.scrollTop ||
+ document.body.scrollTop;
+
+ return new Element.Offset(x, y);
+ }
+
+ document.viewport = {
+ getDimensions: getDimensions,
+ getWidth: getWidth,
+ getHeight: getHeight,
+ getScrollOffsets: getScrollOffsets
+ };
+
+})();
+window.$$ = function() {
+ var expression = $A(arguments).join(', ');
+ return Prototype.Selector.select(expression, document);
+};
+
+Prototype.Selector = (function() {
+
+ function select() {
+ throw new Error('Method "Prototype.Selector.select" must be defined.');
+ }
+
+ function match() {
+ throw new Error('Method "Prototype.Selector.match" must be defined.');
+ }
+
+ function find(elements, expression, index) {
+ index = index || 0;
+ var match = Prototype.Selector.match, length = elements.length, matchIndex = 0, i;
+
+ for (i = 0; i < length; i++) {
+ if (match(elements[i], expression) && index == matchIndex++) {
+ return Element.extend(elements[i]);
+ }
+ }
+ }
+
+ function extendElements(elements) {
+ for (var i = 0, length = elements.length; i < length; i++) {
+ Element.extend(elements[i]);
+ }
+ return elements;
+ }
+
+
+ var K = Prototype.K;
+
+ return {
+ select: select,
+ match: match,
+ find: find,
+ extendElements: (Element.extend === K) ? K : extendElements,
+ extendElement: Element.extend
+ };
+})();
+Prototype._original_property = window.Sizzle;
+/*!
+ * Sizzle CSS Selector Engine v@VERSION
+ * http://sizzlejs.com/
+ *
+ * Copyright 2013 jQuery Foundation, Inc. and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ *
+ * Date: @DATE
+ */
+(function( window ) {
+
+var i,
+ support,
+ Expr,
+ getText,
+ isXML,
+ compile,
+ select,
+ outermostContext,
+ sortInput,
+ hasDuplicate,
+
+ setDocument,
+ document,
+ docElem,
+ documentIsHTML,
+ rbuggyQSA,
+ rbuggyMatches,
+ matches,
+ contains,
+
+ expando = "sizzle" + -(new Date()),
+ preferredDoc = window.document,
+ dirruns = 0,
+ done = 0,
+ classCache = createCache(),
+ tokenCache = createCache(),
+ compilerCache = createCache(),
+ sortOrder = function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ }
+ return 0;
+ },
+
+ strundefined = typeof undefined,
+ MAX_NEGATIVE = 1 << 31,
+
+ hasOwn = ({}).hasOwnProperty,
+ arr = [],
+ pop = arr.pop,
+ push_native = arr.push,
+ push = arr.push,
+ slice = arr.slice,
+ indexOf = arr.indexOf || function( elem ) {
+ var i = 0,
+ len = this.length;
+ for ( ; i < len; i++ ) {
+ if ( this[i] === elem ) {
+ return i;
+ }
+ }
+ return -1;
+ },
+
+ booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
+
+
+ whitespace = "[\\x20\\t\\r\\n\\f]",
+ characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
+
+ identifier = characterEncoding.replace( "w", "w#" ),
+
+ attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
+ "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
+
+ pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
+
+ rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
+
+ rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
+ rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
+
+ rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
+
+ rpseudo = new RegExp( pseudos ),
+ ridentifier = new RegExp( "^" + identifier + "$" ),
+
+ matchExpr = {
+ "ID": new RegExp( "^#(" + characterEncoding + ")" ),
+ "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
+ "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
+ "ATTR": new RegExp( "^" + attributes ),
+ "PSEUDO": new RegExp( "^" + pseudos ),
+ "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
+ "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
+ "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
+ "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
+ "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
+ whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
+ },
+
+ rinputs = /^(?:input|select|textarea|button)$/i,
+ rheader = /^h\d$/i,
+
+ rnative = /^[^{]+\{\s*\[native \w/,
+
+ rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
+
+ rsibling = /[+~]/,
+ rescape = /'|\\/g,
+
+ runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
+ funescape = function( _, escaped, escapedWhitespace ) {
+ var high = "0x" + escaped - 0x10000;
+ return high !== high || escapedWhitespace ?
+ escaped :
+ high < 0 ?
+ String.fromCharCode( high + 0x10000 ) :
+ String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
+ };
+
+try {
+ push.apply(
+ (arr = slice.call( preferredDoc.childNodes )),
+ preferredDoc.childNodes
+ );
+ arr[ preferredDoc.childNodes.length ].nodeType;
+} catch ( e ) {
+ push = { apply: arr.length ?
+
+ function( target, els ) {
+ push_native.apply( target, slice.call(els) );
+ } :
+
+ function( target, els ) {
+ var j = target.length,
+ i = 0;
+ while ( (target[j++] = els[i++]) ) {}
+ target.length = j - 1;
+ }
+ };
+}
+
+function Sizzle( selector, context, results, seed ) {
+ var match, elem, m, nodeType,
+ i, groups, old, nid, newContext, newSelector;
+
+ if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
+ setDocument( context );
+ }
+
+ context = context || document;
+ results = results || [];
+
+ if ( !selector || typeof selector !== "string" ) {
+ return results;
+ }
+
+ if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
+ return [];
+ }
+
+ if ( documentIsHTML && !seed ) {
+
+ if ( (match = rquickExpr.exec( selector )) ) {
+ if ( (m = match[1]) ) {
+ if ( nodeType === 9 ) {
+ elem = context.getElementById( m );
+ if ( elem && elem.parentNode ) {
+ if ( elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ } else {
+ return results;
+ }
+ } else {
+ if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
+ contains( context, elem ) && elem.id === m ) {
+ results.push( elem );
+ return results;
+ }
+ }
+
+ } else if ( match[2] ) {
+ push.apply( results, context.getElementsByTagName( selector ) );
+ return results;
+
+ } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
+ push.apply( results, context.getElementsByClassName( m ) );
+ return results;
+ }
+ }
+
+ if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
+ nid = old = expando;
+ newContext = context;
+ newSelector = nodeType === 9 && selector;
+
+ if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+ groups = tokenize( selector );
+
+ if ( (old = context.getAttribute("id")) ) {
+ nid = old.replace( rescape, "\\$&" );
+ } else {
+ context.setAttribute( "id", nid );
+ }
+ nid = "[id='" + nid + "'] ";
+
+ i = groups.length;
+ while ( i-- ) {
+ groups[i] = nid + toSelector( groups[i] );
+ }
+ newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
+ newSelector = groups.join(",");
+ }
+
+ if ( newSelector ) {
+ try {
+ push.apply( results,
+ newContext.querySelectorAll( newSelector )
+ );
+ return results;
+ } catch(qsaError) {
+ } finally {
+ if ( !old ) {
+ context.removeAttribute("id");
+ }
+ }
+ }
+ }
+ }
+
+ return select( selector.replace( rtrim, "$1" ), context, results, seed );
+}
+
+/**
+ * Create key-value caches of limited size
+ * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
+ * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
+ * deleting the oldest entry
+ */
+function createCache() {
+ var keys = [];
+
+ function cache( key, value ) {
+ if ( keys.push( key + " " ) > Expr.cacheLength ) {
+ delete cache[ keys.shift() ];
+ }
+ return (cache[ key + " " ] = value);
+ }
+ return cache;
+}
+
+/**
+ * Mark a function for special use by Sizzle
+ * @param {Function} fn The function to mark
+ */
+function markFunction( fn ) {
+ fn[ expando ] = true;
+ return fn;
+}
+
+/**
+ * Support testing using an element
+ * @param {Function} fn Passed the created div and expects a boolean result
+ */
+function assert( fn ) {
+ var div = document.createElement("div");
+
+ try {
+ return !!fn( div );
+ } catch (e) {
+ return false;
+ } finally {
+ if ( div.parentNode ) {
+ div.parentNode.removeChild( div );
+ }
+ div = null;
+ }
+}
+
+/**
+ * Adds the same handler for all of the specified attrs
+ * @param {String} attrs Pipe-separated list of attributes
+ * @param {Function} handler The method that will be applied
+ */
+function addHandle( attrs, handler ) {
+ var arr = attrs.split("|"),
+ i = attrs.length;
+
+ while ( i-- ) {
+ Expr.attrHandle[ arr[i] ] = handler;
+ }
+}
+
+/**
+ * Checks document order of two siblings
+ * @param {Element} a
+ * @param {Element} b
+ * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
+ */
+function siblingCheck( a, b ) {
+ var cur = b && a,
+ diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
+ ( ~b.sourceIndex || MAX_NEGATIVE ) -
+ ( ~a.sourceIndex || MAX_NEGATIVE );
+
+ if ( diff ) {
+ return diff;
+ }
+
+ if ( cur ) {
+ while ( (cur = cur.nextSibling) ) {
+ if ( cur === b ) {
+ return -1;
+ }
+ }
+ }
+
+ return a ? 1 : -1;
+}
+
+/**
+ * Returns a function to use in pseudos for input types
+ * @param {String} type
+ */
+function createInputPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for buttons
+ * @param {String} type
+ */
+function createButtonPseudo( type ) {
+ return function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return (name === "input" || name === "button") && elem.type === type;
+ };
+}
+
+/**
+ * Returns a function to use in pseudos for positionals
+ * @param {Function} fn
+ */
+function createPositionalPseudo( fn ) {
+ return markFunction(function( argument ) {
+ argument = +argument;
+ return markFunction(function( seed, matches ) {
+ var j,
+ matchIndexes = fn( [], seed.length, argument ),
+ i = matchIndexes.length;
+
+ while ( i-- ) {
+ if ( seed[ (j = matchIndexes[i]) ] ) {
+ seed[j] = !(matches[j] = seed[j]);
+ }
+ }
+ });
+ });
+}
+
+/**
+ * Checks a node for validity as a Sizzle context
+ * @param {Element|Object=} context
+ * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
+ */
+function testContext( context ) {
+ return context && typeof context.getElementsByTagName !== strundefined && context;
+}
+
+support = Sizzle.support = {};
+
+/**
+ * Detects XML nodes
+ * @param {Element|Object} elem An element or a document
+ * @returns {Boolean} True iff elem is a non-HTML XML node
+ */
+isXML = Sizzle.isXML = function( elem ) {
+ var documentElement = elem && (elem.ownerDocument || elem).documentElement;
+ return documentElement ? documentElement.nodeName !== "HTML" : false;
+};
+
+/**
+ * Sets document-related variables once based on the current document
+ * @param {Element|Object} [doc] An element or document object to use to set the document
+ * @returns {Object} Returns the current document
+ */
+setDocument = Sizzle.setDocument = function( node ) {
+ var hasCompare,
+ doc = node ? node.ownerDocument || node : preferredDoc,
+ parent = doc.defaultView;
+
+ if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
+ return document;
+ }
+
+ document = doc;
+ docElem = doc.documentElement;
+
+ documentIsHTML = !isXML( doc );
+
+ if ( parent && parent !== parent.top ) {
+ if ( parent.addEventListener ) {
+ parent.addEventListener( "unload", function() {
+ setDocument();
+ }, false );
+ } else if ( parent.attachEvent ) {
+ parent.attachEvent( "onunload", function() {
+ setDocument();
+ });
+ }
+ }
+
+ /* Attributes
+ ---------------------------------------------------------------------- */
+
+ support.attributes = assert(function( div ) {
+ div.className = "i";
+ return !div.getAttribute("className");
+ });
+
+ /* getElement(s)By*
+ ---------------------------------------------------------------------- */
+
+ support.getElementsByTagName = assert(function( div ) {
+ div.appendChild( doc.createComment("") );
+ return !div.getElementsByTagName("*").length;
+ });
+
+ support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
+ div.innerHTML = "<div class='a'></div><div class='a i'></div>";
+
+ div.firstChild.className = "i";
+ return div.getElementsByClassName("i").length === 2;
+ });
+
+ support.getById = assert(function( div ) {
+ docElem.appendChild( div ).id = expando;
+ return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
+ });
+
+ if ( support.getById ) {
+ Expr.find["ID"] = function( id, context ) {
+ if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
+ var m = context.getElementById( id );
+ return m && m.parentNode ? [m] : [];
+ }
+ };
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ return elem.getAttribute("id") === attrId;
+ };
+ };
+ } else {
+ delete Expr.find["ID"];
+
+ Expr.filter["ID"] = function( id ) {
+ var attrId = id.replace( runescape, funescape );
+ return function( elem ) {
+ var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
+ return node && node.value === attrId;
+ };
+ };
+ }
+
+ Expr.find["TAG"] = support.getElementsByTagName ?
+ function( tag, context ) {
+ if ( typeof context.getElementsByTagName !== strundefined ) {
+ return context.getElementsByTagName( tag );
+ }
+ } :
+ function( tag, context ) {
+ var elem,
+ tmp = [],
+ i = 0,
+ results = context.getElementsByTagName( tag );
+
+ if ( tag === "*" ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem.nodeType === 1 ) {
+ tmp.push( elem );
+ }
+ }
+
+ return tmp;
+ }
+ return results;
+ };
+
+ Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
+ if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
+ return context.getElementsByClassName( className );
+ }
+ };
+
+ /* QSA/matchesSelector
+ ---------------------------------------------------------------------- */
+
+
+ rbuggyMatches = [];
+
+ rbuggyQSA = [];
+
+ if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
+ assert(function( div ) {
+ div.innerHTML = "<select t=''><option selected=''></option></select>";
+
+ if ( div.querySelectorAll("[t^='']").length ) {
+ rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
+ }
+
+ if ( !div.querySelectorAll("[selected]").length ) {
+ rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
+ }
+
+ if ( !div.querySelectorAll(":checked").length ) {
+ rbuggyQSA.push(":checked");
+ }
+ });
+
+ assert(function( div ) {
+ var input = doc.createElement("input");
+ input.setAttribute( "type", "hidden" );
+ div.appendChild( input ).setAttribute( "name", "D" );
+
+ if ( div.querySelectorAll("[name=d]").length ) {
+ rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
+ }
+
+ if ( !div.querySelectorAll(":enabled").length ) {
+ rbuggyQSA.push( ":enabled", ":disabled" );
+ }
+
+ div.querySelectorAll("*,:x");
+ rbuggyQSA.push(",.*:");
+ });
+ }
+
+ if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector ||
+ docElem.mozMatchesSelector ||
+ docElem.oMatchesSelector ||
+ docElem.msMatchesSelector) )) ) {
+
+ assert(function( div ) {
+ support.disconnectedMatch = matches.call( div, "div" );
+
+ matches.call( div, "[s!='']:x" );
+ rbuggyMatches.push( "!=", pseudos );
+ });
+ }
+
+ rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
+ rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
+
+ /* Contains
+ ---------------------------------------------------------------------- */
+ hasCompare = rnative.test( docElem.compareDocumentPosition );
+
+ contains = hasCompare || rnative.test( docElem.contains ) ?
+ function( a, b ) {
+ var adown = a.nodeType === 9 ? a.documentElement : a,
+ bup = b && b.parentNode;
+ return a === bup || !!( bup && bup.nodeType === 1 && (
+ adown.contains ?
+ adown.contains( bup ) :
+ a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
+ ));
+ } :
+ function( a, b ) {
+ if ( b ) {
+ while ( (b = b.parentNode) ) {
+ if ( b === a ) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+
+ /* Sorting
+ ---------------------------------------------------------------------- */
+
+ sortOrder = hasCompare ?
+ function( a, b ) {
+
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
+ if ( compare ) {
+ return compare;
+ }
+
+ compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
+ a.compareDocumentPosition( b ) :
+
+ 1;
+
+ if ( compare & 1 ||
+ (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
+
+ if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
+ return -1;
+ }
+ if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
+ return 1;
+ }
+
+ return sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+ }
+
+ return compare & 4 ? -1 : 1;
+ } :
+ function( a, b ) {
+ if ( a === b ) {
+ hasDuplicate = true;
+ return 0;
+ }
+
+ var cur,
+ i = 0,
+ aup = a.parentNode,
+ bup = b.parentNode,
+ ap = [ a ],
+ bp = [ b ];
+
+ if ( !aup || !bup ) {
+ return a === doc ? -1 :
+ b === doc ? 1 :
+ aup ? -1 :
+ bup ? 1 :
+ sortInput ?
+ ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
+ 0;
+
+ } else if ( aup === bup ) {
+ return siblingCheck( a, b );
+ }
+
+ cur = a;
+ while ( (cur = cur.parentNode) ) {
+ ap.unshift( cur );
+ }
+ cur = b;
+ while ( (cur = cur.parentNode) ) {
+ bp.unshift( cur );
+ }
+
+ while ( ap[i] === bp[i] ) {
+ i++;
+ }
+
+ return i ?
+ siblingCheck( ap[i], bp[i] ) :
+
+ ap[i] === preferredDoc ? -1 :
+ bp[i] === preferredDoc ? 1 :
+ 0;
+ };
+
+ return doc;
+};
+
+Sizzle.matches = function( expr, elements ) {
+ return Sizzle( expr, null, null, elements );
+};
+
+Sizzle.matchesSelector = function( elem, expr ) {
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ expr = expr.replace( rattributeQuotes, "='$1']" );
+
+ if ( support.matchesSelector && documentIsHTML &&
+ ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
+ ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
+
+ try {
+ var ret = matches.call( elem, expr );
+
+ if ( ret || support.disconnectedMatch ||
+ elem.document && elem.document.nodeType !== 11 ) {
+ return ret;
+ }
+ } catch(e) {}
+ }
+
+ return Sizzle( expr, document, null, [elem] ).length > 0;
+};
+
+Sizzle.contains = function( context, elem ) {
+ if ( ( context.ownerDocument || context ) !== document ) {
+ setDocument( context );
+ }
+ return contains( context, elem );
+};
+
+Sizzle.attr = function( elem, name ) {
+ if ( ( elem.ownerDocument || elem ) !== document ) {
+ setDocument( elem );
+ }
+
+ var fn = Expr.attrHandle[ name.toLowerCase() ],
+ val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
+ fn( elem, name, !documentIsHTML ) :
+ undefined;
+
+ return val !== undefined ?
+ val :
+ support.attributes || !documentIsHTML ?
+ elem.getAttribute( name ) :
+ (val = elem.getAttributeNode(name)) && val.specified ?
+ val.value :
+ null;
+};
+
+Sizzle.error = function( msg ) {
+ throw new Error( "Syntax error, unrecognized expression: " + msg );
+};
+
+/**
+ * Document sorting and removing duplicates
+ * @param {ArrayLike} results
+ */
+Sizzle.uniqueSort = function( results ) {
+ var elem,
+ duplicates = [],
+ j = 0,
+ i = 0;
+
+ hasDuplicate = !support.detectDuplicates;
+ sortInput = !support.sortStable && results.slice( 0 );
+ results.sort( sortOrder );
+
+ if ( hasDuplicate ) {
+ while ( (elem = results[i++]) ) {
+ if ( elem === results[ i ] ) {
+ j = duplicates.push( i );
+ }
+ }
+ while ( j-- ) {
+ results.splice( duplicates[ j ], 1 );
+ }
+ }
+
+ sortInput = null;
+
+ return results;
+};
+
+/**
+ * Utility function for retrieving the text value of an array of DOM nodes
+ * @param {Array|Element} elem
+ */
+getText = Sizzle.getText = function( elem ) {
+ var node,
+ ret = "",
+ i = 0,
+ nodeType = elem.nodeType;
+
+ if ( !nodeType ) {
+ while ( (node = elem[i++]) ) {
+ ret += getText( node );
+ }
+ } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
+ if ( typeof elem.textContent === "string" ) {
+ return elem.textContent;
+ } else {
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ ret += getText( elem );
+ }
+ }
+ } else if ( nodeType === 3 || nodeType === 4 ) {
+ return elem.nodeValue;
+ }
+
+ return ret;
+};
+
+Expr = Sizzle.selectors = {
+
+ cacheLength: 50,
+
+ createPseudo: markFunction,
+
+ match: matchExpr,
+
+ attrHandle: {},
+
+ find: {},
+
+ relative: {
+ ">": { dir: "parentNode", first: true },
+ " ": { dir: "parentNode" },
+ "+": { dir: "previousSibling", first: true },
+ "~": { dir: "previousSibling" }
+ },
+
+ preFilter: {
+ "ATTR": function( match ) {
+ match[1] = match[1].replace( runescape, funescape );
+
+ match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
+
+ if ( match[2] === "~=" ) {
+ match[3] = " " + match[3] + " ";
+ }
+
+ return match.slice( 0, 4 );
+ },
+
+ "CHILD": function( match ) {
+ /* matches from matchExpr["CHILD"]
+ 1 type (only|nth|...)
+ 2 what (child|of-type)
+ 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
+ 4 xn-component of xn+y argument ([+-]?\d*n|)
+ 5 sign of xn-component
+ 6 x of xn-component
+ 7 sign of y-component
+ 8 y of y-component
+ */
+ match[1] = match[1].toLowerCase();
+
+ if ( match[1].slice( 0, 3 ) === "nth" ) {
+ if ( !match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
+ match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
+
+ } else if ( match[3] ) {
+ Sizzle.error( match[0] );
+ }
+
+ return match;
+ },
+
+ "PSEUDO": function( match ) {
+ var excess,
+ unquoted = !match[5] && match[2];
+
+ if ( matchExpr["CHILD"].test( match[0] ) ) {
+ return null;
+ }
+
+ if ( match[3] && match[4] !== undefined ) {
+ match[2] = match[4];
+
+ } else if ( unquoted && rpseudo.test( unquoted ) &&
+ (excess = tokenize( unquoted, true )) &&
+ (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
+
+ match[0] = match[0].slice( 0, excess );
+ match[2] = unquoted.slice( 0, excess );
+ }
+
+ return match.slice( 0, 3 );
+ }
+ },
+
+ filter: {
+
+ "TAG": function( nodeNameSelector ) {
+ var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
+ return nodeNameSelector === "*" ?
+ function() { return true; } :
+ function( elem ) {
+ return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
+ };
+ },
+
+ "CLASS": function( className ) {
+ var pattern = classCache[ className + " " ];
+
+ return pattern ||
+ (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
+ classCache( className, function( elem ) {
+ return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
+ });
+ },
+
+ "ATTR": function( name, operator, check ) {
+ return function( elem ) {
+ var result = Sizzle.attr( elem, name );
+
+ if ( result == null ) {
+ return operator === "!=";
+ }
+ if ( !operator ) {
+ return true;
+ }
+
+ result += "";
+
+ return operator === "=" ? result === check :
+ operator === "!=" ? result !== check :
+ operator === "^=" ? check && result.indexOf( check ) === 0 :
+ operator === "*=" ? check && result.indexOf( check ) > -1 :
+ operator === "$=" ? check && result.slice( -check.length ) === check :
+ operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
+ operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
+ false;
+ };
+ },
+
+ "CHILD": function( type, what, argument, first, last ) {
+ var simple = type.slice( 0, 3 ) !== "nth",
+ forward = type.slice( -4 ) !== "last",
+ ofType = what === "of-type";
+
+ return first === 1 && last === 0 ?
+
+ function( elem ) {
+ return !!elem.parentNode;
+ } :
+
+ function( elem, context, xml ) {
+ var cache, outerCache, node, diff, nodeIndex, start,
+ dir = simple !== forward ? "nextSibling" : "previousSibling",
+ parent = elem.parentNode,
+ name = ofType && elem.nodeName.toLowerCase(),
+ useCache = !xml && !ofType;
+
+ if ( parent ) {
+
+ if ( simple ) {
+ while ( dir ) {
+ node = elem;
+ while ( (node = node[ dir ]) ) {
+ if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
+ return false;
+ }
+ }
+ start = dir = type === "only" && !start && "nextSibling";
+ }
+ return true;
+ }
+
+ start = [ forward ? parent.firstChild : parent.lastChild ];
+
+ if ( forward && useCache ) {
+ outerCache = parent[ expando ] || (parent[ expando ] = {});
+ cache = outerCache[ type ] || [];
+ nodeIndex = cache[0] === dirruns && cache[1];
+ diff = cache[0] === dirruns && cache[2];
+ node = nodeIndex && parent.childNodes[ nodeIndex ];
+
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( node.nodeType === 1 && ++diff && node === elem ) {
+ outerCache[ type ] = [ dirruns, nodeIndex, diff ];
+ break;
+ }
+ }
+
+ } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
+ diff = cache[1];
+
+ } else {
+ while ( (node = ++nodeIndex && node && node[ dir ] ||
+ (diff = nodeIndex = 0) || start.pop()) ) {
+
+ if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
+ if ( useCache ) {
+ (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
+ }
+
+ if ( node === elem ) {
+ break;
+ }
+ }
+ }
+ }
+
+ diff -= last;
+ return diff === first || ( diff % first === 0 && diff / first >= 0 );
+ }
+ };
+ },
+
+ "PSEUDO": function( pseudo, argument ) {
+ var args,
+ fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
+ Sizzle.error( "unsupported pseudo: " + pseudo );
+
+ if ( fn[ expando ] ) {
+ return fn( argument );
+ }
+
+ if ( fn.length > 1 ) {
+ args = [ pseudo, pseudo, "", argument ];
+ return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
+ markFunction(function( seed, matches ) {
+ var idx,
+ matched = fn( seed, argument ),
+ i = matched.length;
+ while ( i-- ) {
+ idx = indexOf.call( seed, matched[i] );
+ seed[ idx ] = !( matches[ idx ] = matched[i] );
+ }
+ }) :
+ function( elem ) {
+ return fn( elem, 0, args );
+ };
+ }
+
+ return fn;
+ }
+ },
+
+ pseudos: {
+ "not": markFunction(function( selector ) {
+ var input = [],
+ results = [],
+ matcher = compile( selector.replace( rtrim, "$1" ) );
+
+ return matcher[ expando ] ?
+ markFunction(function( seed, matches, context, xml ) {
+ var elem,
+ unmatched = matcher( seed, null, xml, [] ),
+ i = seed.length;
+
+ while ( i-- ) {
+ if ( (elem = unmatched[i]) ) {
+ seed[i] = !(matches[i] = elem);
+ }
+ }
+ }) :
+ function( elem, context, xml ) {
+ input[0] = elem;
+ matcher( input, null, xml, results );
+ return !results.pop();
+ };
+ }),
+
+ "has": markFunction(function( selector ) {
+ return function( elem ) {
+ return Sizzle( selector, elem ).length > 0;
+ };
+ }),
+
+ "contains": markFunction(function( text ) {
+ return function( elem ) {
+ return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
+ };
+ }),
+
+ "lang": markFunction( function( lang ) {
+ if ( !ridentifier.test(lang || "") ) {
+ Sizzle.error( "unsupported lang: " + lang );
+ }
+ lang = lang.replace( runescape, funescape ).toLowerCase();
+ return function( elem ) {
+ var elemLang;
+ do {
+ if ( (elemLang = documentIsHTML ?
+ elem.lang :
+ elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
+
+ elemLang = elemLang.toLowerCase();
+ return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
+ }
+ } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
+ return false;
+ };
+ }),
+
+ "target": function( elem ) {
+ var hash = window.location && window.location.hash;
+ return hash && hash.slice( 1 ) === elem.id;
+ },
+
+ "root": function( elem ) {
+ return elem === docElem;
+ },
+
+ "focus": function( elem ) {
+ return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
+ },
+
+ "enabled": function( elem ) {
+ return elem.disabled === false;
+ },
+
+ "disabled": function( elem ) {
+ return elem.disabled === true;
+ },
+
+ "checked": function( elem ) {
+ var nodeName = elem.nodeName.toLowerCase();
+ return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
+ },
+
+ "selected": function( elem ) {
+ if ( elem.parentNode ) {
+ elem.parentNode.selectedIndex;
+ }
+
+ return elem.selected === true;
+ },
+
+ "empty": function( elem ) {
+ for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
+ if ( elem.nodeType < 6 ) {
+ return false;
+ }
+ }
+ return true;
+ },
+
+ "parent": function( elem ) {
+ return !Expr.pseudos["empty"]( elem );
+ },
+
+ "header": function( elem ) {
+ return rheader.test( elem.nodeName );
+ },
+
+ "input": function( elem ) {
+ return rinputs.test( elem.nodeName );
+ },
+
+ "button": function( elem ) {
+ var name = elem.nodeName.toLowerCase();
+ return name === "input" && elem.type === "button" || name === "button";
+ },
+
+ "text": function( elem ) {
+ var attr;
+ return elem.nodeName.toLowerCase() === "input" &&
+ elem.type === "text" &&
+
+ ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
+ },
+
+ "first": createPositionalPseudo(function() {
+ return [ 0 ];
+ }),
+
+ "last": createPositionalPseudo(function( matchIndexes, length ) {
+ return [ length - 1 ];
+ }),
+
+ "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ return [ argument < 0 ? argument + length : argument ];
+ }),
+
+ "even": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 0;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "odd": createPositionalPseudo(function( matchIndexes, length ) {
+ var i = 1;
+ for ( ; i < length; i += 2 ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; --i >= 0; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ }),
+
+ "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
+ var i = argument < 0 ? argument + length : argument;
+ for ( ; ++i < length; ) {
+ matchIndexes.push( i );
+ }
+ return matchIndexes;
+ })
+ }
+};
+
+Expr.pseudos["nth"] = Expr.pseudos["eq"];
+
+for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
+ Expr.pseudos[ i ] = createInputPseudo( i );
+}
+for ( i in { submit: true, reset: true } ) {
+ Expr.pseudos[ i ] = createButtonPseudo( i );
+}
+
+function setFilters() {}
+setFilters.prototype = Expr.filters = Expr.pseudos;
+Expr.setFilters = new setFilters();
+
+function tokenize( selector, parseOnly ) {
+ var matched, match, tokens, type,
+ soFar, groups, preFilters,
+ cached = tokenCache[ selector + " " ];
+
+ if ( cached ) {
+ return parseOnly ? 0 : cached.slice( 0 );
+ }
+
+ soFar = selector;
+ groups = [];
+ preFilters = Expr.preFilter;
+
+ while ( soFar ) {
+
+ if ( !matched || (match = rcomma.exec( soFar )) ) {
+ if ( match ) {
+ soFar = soFar.slice( match[0].length ) || soFar;
+ }
+ groups.push( (tokens = []) );
+ }
+
+ matched = false;
+
+ if ( (match = rcombinators.exec( soFar )) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: match[0].replace( rtrim, " " )
+ });
+ soFar = soFar.slice( matched.length );
+ }
+
+ for ( type in Expr.filter ) {
+ if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
+ (match = preFilters[ type ]( match ))) ) {
+ matched = match.shift();
+ tokens.push({
+ value: matched,
+ type: type,
+ matches: match
+ });
+ soFar = soFar.slice( matched.length );
+ }
+ }
+
+ if ( !matched ) {
+ break;
+ }
+ }
+
+ return parseOnly ?
+ soFar.length :
+ soFar ?
+ Sizzle.error( selector ) :
+ tokenCache( selector, groups ).slice( 0 );
+}
+
+function toSelector( tokens ) {
+ var i = 0,
+ len = tokens.length,
+ selector = "";
+ for ( ; i < len; i++ ) {
+ selector += tokens[i].value;
+ }
+ return selector;
+}
+
+function addCombinator( matcher, combinator, base ) {
+ var dir = combinator.dir,
+ checkNonElements = base && dir === "parentNode",
+ doneName = done++;
+
+ return combinator.first ?
+ function( elem, context, xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ return matcher( elem, context, xml );
+ }
+ }
+ } :
+
+ function( elem, context, xml ) {
+ var oldCache, outerCache,
+ newCache = [ dirruns, doneName ];
+
+ if ( xml ) {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ if ( matcher( elem, context, xml ) ) {
+ return true;
+ }
+ }
+ }
+ } else {
+ while ( (elem = elem[ dir ]) ) {
+ if ( elem.nodeType === 1 || checkNonElements ) {
+ outerCache = elem[ expando ] || (elem[ expando ] = {});
+ if ( (oldCache = outerCache[ dir ]) &&
+ oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
+
+ return (newCache[ 2 ] = oldCache[ 2 ]);
+ } else {
+ outerCache[ dir ] = newCache;
+
+ if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
+ return true;
+ }
+ }
+ }
+ }
+ }
+ };
+}
+
+function elementMatcher( matchers ) {
+ return matchers.length > 1 ?
+ function( elem, context, xml ) {
+ var i = matchers.length;
+ while ( i-- ) {
+ if ( !matchers[i]( elem, context, xml ) ) {
+ return false;
+ }
+ }
+ return true;
+ } :
+ matchers[0];
+}
+
+function multipleContexts( selector, contexts, results ) {
+ var i = 0,
+ len = contexts.length;
+ for ( ; i < len; i++ ) {
+ Sizzle( selector, contexts[i], results );
+ }
+ return results;
+}
+
+function condense( unmatched, map, filter, context, xml ) {
+ var elem,
+ newUnmatched = [],
+ i = 0,
+ len = unmatched.length,
+ mapped = map != null;
+
+ for ( ; i < len; i++ ) {
+ if ( (elem = unmatched[i]) ) {
+ if ( !filter || filter( elem, context, xml ) ) {
+ newUnmatched.push( elem );
+ if ( mapped ) {
+ map.push( i );
+ }
+ }
+ }
+ }
+
+ return newUnmatched;
+}
+
+function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
+ if ( postFilter && !postFilter[ expando ] ) {
+ postFilter = setMatcher( postFilter );
+ }
+ if ( postFinder && !postFinder[ expando ] ) {
+ postFinder = setMatcher( postFinder, postSelector );
+ }
+ return markFunction(function( seed, results, context, xml ) {
+ var temp, i, elem,
+ preMap = [],
+ postMap = [],
+ preexisting = results.length,
+
+ elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
+
+ matcherIn = preFilter && ( seed || !selector ) ?
+ condense( elems, preMap, preFilter, context, xml ) :
+ elems,
+
+ matcherOut = matcher ?
+ postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
+
+ [] :
+
+ results :
+ matcherIn;
+
+ if ( matcher ) {
+ matcher( matcherIn, matcherOut, context, xml );
+ }
+
+ if ( postFilter ) {
+ temp = condense( matcherOut, postMap );
+ postFilter( temp, [], context, xml );
+
+ i = temp.length;
+ while ( i-- ) {
+ if ( (elem = temp[i]) ) {
+ matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
+ }
+ }
+ }
+
+ if ( seed ) {
+ if ( postFinder || preFilter ) {
+ if ( postFinder ) {
+ temp = [];
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) ) {
+ temp.push( (matcherIn[i] = elem) );
+ }
+ }
+ postFinder( null, (matcherOut = []), temp, xml );
+ }
+
+ i = matcherOut.length;
+ while ( i-- ) {
+ if ( (elem = matcherOut[i]) &&
+ (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
+
+ seed[temp] = !(results[temp] = elem);
+ }
+ }
+ }
+
+ } else {
+ matcherOut = condense(
+ matcherOut === results ?
+ matcherOut.splice( preexisting, matcherOut.length ) :
+ matcherOut
+ );
+ if ( postFinder ) {
+ postFinder( null, results, matcherOut, xml );
+ } else {
+ push.apply( results, matcherOut );
+ }
+ }
+ });
+}
+
+function matcherFromTokens( tokens ) {
+ var checkContext, matcher, j,
+ len = tokens.length,
+ leadingRelative = Expr.relative[ tokens[0].type ],
+ implicitRelative = leadingRelative || Expr.relative[" "],
+ i = leadingRelative ? 1 : 0,
+
+ matchContext = addCombinator( function( elem ) {
+ return elem === checkContext;
+ }, implicitRelative, true ),
+ matchAnyContext = addCombinator( function( elem ) {
+ return indexOf.call( checkContext, elem ) > -1;
+ }, implicitRelative, true ),
+ matchers = [ function( elem, context, xml ) {
+ return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
+ (checkContext = context).nodeType ?
+ matchContext( elem, context, xml ) :
+ matchAnyContext( elem, context, xml ) );
+ } ];
+
+ for ( ; i < len; i++ ) {
+ if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
+ matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
+ } else {
+ matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
+
+ if ( matcher[ expando ] ) {
+ j = ++i;
+ for ( ; j < len; j++ ) {
+ if ( Expr.relative[ tokens[j].type ] ) {
+ break;
+ }
+ }
+ return setMatcher(
+ i > 1 && elementMatcher( matchers ),
+ i > 1 && toSelector(
+ tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
+ ).replace( rtrim, "$1" ),
+ matcher,
+ i < j && matcherFromTokens( tokens.slice( i, j ) ),
+ j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
+ j < len && toSelector( tokens )
+ );
+ }
+ matchers.push( matcher );
+ }
+ }
+
+ return elementMatcher( matchers );
+}
+
+function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
+ var bySet = setMatchers.length > 0,
+ byElement = elementMatchers.length > 0,
+ superMatcher = function( seed, context, xml, results, outermost ) {
+ var elem, j, matcher,
+ matchedCount = 0,
+ i = "0",
+ unmatched = seed && [],
+ setMatched = [],
+ contextBackup = outermostContext,
+ elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
+ dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
+ len = elems.length;
+
+ if ( outermost ) {
+ outermostContext = context !== document && context;
+ }
+
+ for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
+ if ( byElement && elem ) {
+ j = 0;
+ while ( (matcher = elementMatchers[j++]) ) {
+ if ( matcher( elem, context, xml ) ) {
+ results.push( elem );
+ break;
+ }
+ }
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ }
+ }
+
+ if ( bySet ) {
+ if ( (elem = !matcher && elem) ) {
+ matchedCount--;
+ }
+
+ if ( seed ) {
+ unmatched.push( elem );
+ }
+ }
+ }
+
+ matchedCount += i;
+ if ( bySet && i !== matchedCount ) {
+ j = 0;
+ while ( (matcher = setMatchers[j++]) ) {
+ matcher( unmatched, setMatched, context, xml );
+ }
+
+ if ( seed ) {
+ if ( matchedCount > 0 ) {
+ while ( i-- ) {
+ if ( !(unmatched[i] || setMatched[i]) ) {
+ setMatched[i] = pop.call( results );
+ }
+ }
+ }
+
+ setMatched = condense( setMatched );
+ }
+
+ push.apply( results, setMatched );
+
+ if ( outermost && !seed && setMatched.length > 0 &&
+ ( matchedCount + setMatchers.length ) > 1 ) {
+
+ Sizzle.uniqueSort( results );
+ }
+ }
+
+ if ( outermost ) {
+ dirruns = dirrunsUnique;
+ outermostContext = contextBackup;
+ }
+
+ return unmatched;
+ };
+
+ return bySet ?
+ markFunction( superMatcher ) :
+ superMatcher;
+}
+
+compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
+ var i,
+ setMatchers = [],
+ elementMatchers = [],
+ cached = compilerCache[ selector + " " ];
+
+ if ( !cached ) {
+ if ( !match ) {
+ match = tokenize( selector );
+ }
+ i = match.length;
+ while ( i-- ) {
+ cached = matcherFromTokens( match[i] );
+ if ( cached[ expando ] ) {
+ setMatchers.push( cached );
+ } else {
+ elementMatchers.push( cached );
+ }
+ }
+
+ cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
+
+ cached.selector = selector;
+ }
+ return cached;
+};
+
+/**
+ * A low-level selection function that works with Sizzle's compiled
+ * selector functions
+ * @param {String|Function} selector A selector or a pre-compiled
+ * selector function built with Sizzle.compile
+ * @param {Element} context
+ * @param {Array} [results]
+ * @param {Array} [seed] A set of elements to match against
+ */
+select = Sizzle.select = function( selector, context, results, seed ) {
+ var i, tokens, token, type, find,
+ compiled = typeof selector === "function" && selector,
+ match = !seed && tokenize( (selector = compiled.selector || selector) );
+
+ results = results || [];
+
+ if ( match.length === 1 ) {
+
+ tokens = match[0] = match[0].slice( 0 );
+ if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
+ support.getById && context.nodeType === 9 && documentIsHTML &&
+ Expr.relative[ tokens[1].type ] ) {
+
+ context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
+ if ( !context ) {
+ return results;
+
+ } else if ( compiled ) {
+ context = context.parentNode;
+ }
+
+ selector = selector.slice( tokens.shift().value.length );
+ }
+
+ i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
+ while ( i-- ) {
+ token = tokens[i];
+
+ if ( Expr.relative[ (type = token.type) ] ) {
+ break;
+ }
+ if ( (find = Expr.find[ type ]) ) {
+ if ( (seed = find(
+ token.matches[0].replace( runescape, funescape ),
+ rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
+ )) ) {
+
+ tokens.splice( i, 1 );
+ selector = seed.length && toSelector( tokens );
+ if ( !selector ) {
+ push.apply( results, seed );
+ return results;
+ }
+
+ break;
+ }
+ }
+ }
+ }
+
+ ( compiled || compile( selector, match ) )(
+ seed,
+ context,
+ !documentIsHTML,
+ results,
+ rsibling.test( selector ) && testContext( context.parentNode ) || context
+ );
+ return results;
+};
+
+
+support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
+
+support.detectDuplicates = !!hasDuplicate;
+
+setDocument();
+
+support.sortDetached = assert(function( div1 ) {
+ return div1.compareDocumentPosition( document.createElement("div") ) & 1;
+});
+
+if ( !assert(function( div ) {
+ div.innerHTML = "<a href='#'></a>";
+ return div.firstChild.getAttribute("href") === "#" ;
+}) ) {
+ addHandle( "type|href|height|width", function( elem, name, isXML ) {
+ if ( !isXML ) {
+ return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
+ }
+ });
+}
+
+if ( !support.attributes || !assert(function( div ) {
+ div.innerHTML = "<input/>";
+ div.firstChild.setAttribute( "value", "" );
+ return div.firstChild.getAttribute( "value" ) === "";
+}) ) {
+ addHandle( "value", function( elem, name, isXML ) {
+ if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
+ return elem.defaultValue;
+ }
+ });
+}
+
+if ( !assert(function( div ) {
+ return div.getAttribute("disabled") == null;
+}) ) {
+ addHandle( booleans, function( elem, name, isXML ) {
+ var val;
+ if ( !isXML ) {
+ return elem[ name ] === true ? name.toLowerCase() :
+ (val = elem.getAttributeNode( name )) && val.specified ?
+ val.value :
+ null;
+ }
+ });
+}
+
+if ( typeof define === "function" && define.amd ) {
+ define(function() { return Sizzle; });
+} else if ( typeof module !== "undefined" && module.exports ) {
+ module.exports = Sizzle;
+} else {
+ window.Sizzle = Sizzle;
+}
+
+})( window );
+
+;(function(engine) {
+ var extendElements = Prototype.Selector.extendElements;
+
+ function select(selector, scope) {
+ return extendElements(engine(selector, scope || document));
+ }
+
+ function match(element, selector) {
+ return engine.matches(selector, [element]).length == 1;
+ }
+
+ Prototype.Selector.engine = engine;
+ Prototype.Selector.select = select;
+ Prototype.Selector.match = match;
+})(Sizzle);
+
+window.Sizzle = Prototype._original_property;
+delete Prototype._original_property;
+
+var Form = {
+ reset: function(form) {
+ form = $(form);
+ form.reset();
+ return form;
+ },
+
+ serializeElements: function(elements, options) {
+ if (typeof options != 'object') options = { hash: !!options };
+ else if (Object.isUndefined(options.hash)) options.hash = true;
+ var key, value, submitted = false, submit = options.submit, accumulator, initial;
+
+ if (options.hash) {
+ initial = {};
+ accumulator = function(result, key, value) {
+ if (key in result) {
+ if (!Object.isArray(result[key])) result[key] = [result[key]];
+ result[key] = result[key].concat(value);
+ } else result[key] = value;
+ return result;
+ };
+ } else {
+ initial = '';
+ accumulator = function(result, key, values) {
+ if (!Object.isArray(values)) {values = [values];}
+ if (!values.length) {return result;}
+ var encodedKey = encodeURIComponent(key).gsub(/%20/, '+');
+ return result + (result ? "&" : "") + values.map(function (value) {
+ value = value.gsub(/(\r)?\n/, '\r\n');
+ value = encodeURIComponent(value);
+ value = value.gsub(/%20/, '+');
+ return encodedKey + "=" + value;
+ }).join("&");
+ };
+ }
+
+ return elements.inject(initial, function(result, element) {
+ if (!element.disabled && element.name) {
+ key = element.name; value = $(element).getValue();
+ if (value != null && element.type != 'file' && (element.type != 'submit' || (!submitted &&
+ submit !== false && (!submit || key == submit) && (submitted = true)))) {
+ result = accumulator(result, key, value);
+ }
+ }
+ return result;
+ });
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, options) {
+ return Form.serializeElements(Form.getElements(form), options);
+ },
+
+
+ getElements: function(form) {
+ var elements = $(form).getElementsByTagName('*');
+ var element, results = [], serializers = Form.Element.Serializers;
+
+ for (var i = 0; element = elements[i]; i++) {
+ if (serializers[element.tagName.toLowerCase()])
+ results.push(Element.extend(element));
+ }
+ return results;
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ var elements = $(form).getElements().findAll(function(element) {
+ return 'hidden' != element.type && !element.disabled;
+ });
+ var firstByIndex = elements.findAll(function(element) {
+ return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
+ }).sortBy(function(element) { return element.tabIndex }).first();
+
+ return firstByIndex ? firstByIndex : elements.find(function(element) {
+ return /^(?:input|select|textarea)$/i.test(element.tagName);
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ var element = form.findFirstElement();
+ if (element) element.activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || { });
+
+ var params = options.parameters, action = form.readAttribute('action') || '';
+ if (action.blank()) action = window.location.href;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (Object.isString(params)) params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(action, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+};
+
+Form.Element.Methods = {
+
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = { };
+ pair[element.name] = value;
+ return Object.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ setValue: function(element, value) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ Form.Element.Serializers[method](element, value);
+ return element;
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !(/^(?:button|reset|submit)$/i.test(element.type))))
+ element.select();
+ } catch (e) { }
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+
+var $F = Form.Element.Methods.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = (function() {
+ function input(element, value) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return inputSelector(element, value);
+ default:
+ return valueSelector(element, value);
+ }
+ }
+
+ function inputSelector(element, value) {
+ if (Object.isUndefined(value))
+ return element.checked ? element.value : null;
+ else element.checked = !!value;
+ }
+
+ function valueSelector(element, value) {
+ if (Object.isUndefined(value)) return element.value;
+ else element.value = value;
+ }
+
+ function select(element, value) {
+ if (Object.isUndefined(value))
+ return (element.type === 'select-one' ? selectOne : selectMany)(element);
+
+ var opt, currentValue, single = !Object.isArray(value);
+ for (var i = 0, length = element.length; i < length; i++) {
+ opt = element.options[i];
+ currentValue = this.optionValue(opt);
+ if (single) {
+ if (currentValue == value) {
+ opt.selected = true;
+ return;
+ }
+ }
+ else opt.selected = value.include(currentValue);
+ }
+ }
+
+ function selectOne(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? optionValue(element.options[index]) : null;
+ }
+
+ function selectMany(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(optionValue(opt));
+ }
+ return values;
+ }
+
+ function optionValue(opt) {
+ return Element.hasAttribute(opt, 'value') ? opt.value : opt.text;
+ }
+
+ return {
+ input: input,
+ inputSelector: inputSelector,
+ textarea: valueSelector,
+ select: select,
+ selectOne: selectOne,
+ selectMany: selectMany,
+ optionValue: optionValue,
+ button: valueSelector
+ };
+})();
+
+/*--------------------------------------------------------------------------*/
+
+
+Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
+ initialize: function($super, element, frequency, callback) {
+ $super(callback, frequency);
+ this.element = $(element);
+ this.lastValue = this.getValue();
+ },
+
+ execute: function() {
+ var value = this.getValue();
+ if (Object.isString(this.lastValue) && Object.isString(value) ?
+ this.lastValue != value : String(this.lastValue) != String(value)) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+});
+
+Form.Element.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = Class.create({
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback, this);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+});
+
+Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+(function(GLOBAL) {
+ var DIV = document.createElement('div');
+ var docEl = document.documentElement;
+ var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
+ && 'onmouseleave' in docEl;
+
+ var Event = {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+ KEY_INSERT: 45
+ };
+
+
+ var isIELegacyEvent = function(event) { return false; };
+
+ if (window.attachEvent) {
+ if (window.addEventListener) {
+ isIELegacyEvent = function(event) {
+ return !(event instanceof window.Event);
+ };
+ } else {
+ isIELegacyEvent = function(event) { return true; };
+ }
+ }
+
+ var _isButton;
+
+ function _isButtonForDOMEvents(event, code) {
+ return event.which ? (event.which === code + 1) : (event.button === code);
+ }
+
+ var legacyButtonMap = { 0: 1, 1: 4, 2: 2 };
+ function _isButtonForLegacyEvents(event, code) {
+ return event.button === legacyButtonMap[code];
+ }
+
+ function _isButtonForWebKit(event, code) {
+ switch (code) {
+ case 0: return event.which == 1 && !event.metaKey;
+ case 1: return event.which == 2 || (event.which == 1 && event.metaKey);
+ case 2: return event.which == 3;
+ default: return false;
+ }
+ }
+
+ if (window.attachEvent) {
+ if (!window.addEventListener) {
+ _isButton = _isButtonForLegacyEvents;
+ } else {
+ _isButton = function(event, code) {
+ return isIELegacyEvent(event) ? _isButtonForLegacyEvents(event, code) :
+ _isButtonForDOMEvents(event, code);
+ }
+ }
+ } else if (Prototype.Browser.WebKit) {
+ _isButton = _isButtonForWebKit;
+ } else {
+ _isButton = _isButtonForDOMEvents;
+ }
+
+ function isLeftClick(event) { return _isButton(event, 0) }
+
+ function isMiddleClick(event) { return _isButton(event, 1) }
+
+ function isRightClick(event) { return _isButton(event, 2) }
+
+ function element(event) {
+ return Element.extend(_element(event));
+ }
+
+ function _element(event) {
+ event = Event.extend(event);
+
+ var node = event.target, type = event.type,
+ currentTarget = event.currentTarget;
+
+ if (currentTarget && currentTarget.tagName) {
+ if (type === 'load' || type === 'error' ||
+ (type === 'click' && currentTarget.tagName.toLowerCase() === 'input'
+ && currentTarget.type === 'radio'))
+ node = currentTarget;
+ }
+
+ return node.nodeType == Node.TEXT_NODE ? node.parentNode : node;
+ }
+
+ function findElement(event, expression) {
+ var element = _element(event), selector = Prototype.Selector;
+ if (!expression) return Element.extend(element);
+ while (element) {
+ if (Object.isElement(element) && selector.match(element, expression))
+ return Element.extend(element);
+ element = element.parentNode;
+ }
+ }
+
+ function pointer(event) {
+ return { x: pointerX(event), y: pointerY(event) };
+ }
+
+ function pointerX(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollLeft: 0 };
+
+ return event.pageX || (event.clientX +
+ (docElement.scrollLeft || body.scrollLeft) -
+ (docElement.clientLeft || 0));
+ }
+
+ function pointerY(event) {
+ var docElement = document.documentElement,
+ body = document.body || { scrollTop: 0 };
+
+ return event.pageY || (event.clientY +
+ (docElement.scrollTop || body.scrollTop) -
+ (docElement.clientTop || 0));
+ }
+
+
+ function stop(event) {
+ Event.extend(event);
+ event.preventDefault();
+ event.stopPropagation();
+
+ event.stopped = true;
+ }
+
+
+ Event.Methods = {
+ isLeftClick: isLeftClick,
+ isMiddleClick: isMiddleClick,
+ isRightClick: isRightClick,
+
+ element: element,
+ findElement: findElement,
+
+ pointer: pointer,
+ pointerX: pointerX,
+ pointerY: pointerY,
+
+ stop: stop
+ };
+
+ var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
+ m[name] = Event.Methods[name].methodize();
+ return m;
+ });
+
+ if (window.attachEvent) {
+ function _relatedTarget(event) {
+ var element;
+ switch (event.type) {
+ case 'mouseover':
+ case 'mouseenter':
+ element = event.fromElement;
+ break;
+ case 'mouseout':
+ case 'mouseleave':
+ element = event.toElement;
+ break;
+ default:
+ return null;
+ }
+ return Element.extend(element);
+ }
+
+ var additionalMethods = {
+ stopPropagation: function() { this.cancelBubble = true },
+ preventDefault: function() { this.returnValue = false },
+ inspect: function() { return '[object Event]' }
+ };
+
+ Event.extend = function(event, element) {
+ if (!event) return false;
+
+ if (!isIELegacyEvent(event)) return event;
+
+ if (event._extendedByPrototype) return event;
+ event._extendedByPrototype = Prototype.emptyFunction;
+
+ var pointer = Event.pointer(event);
+
+ Object.extend(event, {
+ target: event.srcElement || element,
+ relatedTarget: _relatedTarget(event),
+ pageX: pointer.x,
+ pageY: pointer.y
+ });
+
+ Object.extend(event, methods);
+ Object.extend(event, additionalMethods);
+
+ return event;
+ };
+ } else {
+ Event.extend = Prototype.K;
+ }
+
+ if (window.addEventListener) {
+ Event.prototype = window.Event.prototype || document.createEvent('HTMLEvents').__proto__;
+ Object.extend(Event.prototype, methods);
+ }
+
+ var EVENT_TRANSLATIONS = {
+ mouseenter: 'mouseover',
+ mouseleave: 'mouseout'
+ };
+
+ function getDOMEventName(eventName) {
+ return EVENT_TRANSLATIONS[eventName] || eventName;
+ }
+
+ if (MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED)
+ getDOMEventName = Prototype.K;
+
+ function getUniqueElementID(element) {
+ if (element === window) return 0;
+
+ if (typeof element._prototypeUID === 'undefined')
+ element._prototypeUID = Element.Storage.UID++;
+ return element._prototypeUID;
+ }
+
+ function getUniqueElementID_IE(element) {
+ if (element === window) return 0;
+ if (element == document) return 1;
+ return element.uniqueID;
+ }
+
+ if ('uniqueID' in DIV)
+ getUniqueElementID = getUniqueElementID_IE;
+
+ function isCustomEvent(eventName) {
+ return eventName.include(':');
+ }
+
+ Event._isCustomEvent = isCustomEvent;
+
+ function getRegistryForElement(element, uid) {
+ var CACHE = GLOBAL.Event.cache;
+ if (Object.isUndefined(uid))
+ uid = getUniqueElementID(element);
+ if (!CACHE[uid]) CACHE[uid] = { element: element };
+ return CACHE[uid];
+ }
+
+ function destroyRegistryForElement(element, uid) {
+ if (Object.isUndefined(uid))
+ uid = getUniqueElementID(element);
+ delete GLOBAL.Event.cache[uid];
+ }
+
+
+ function register(element, eventName, handler) {
+ var registry = getRegistryForElement(element);
+ if (!registry[eventName]) registry[eventName] = [];
+ var entries = registry[eventName];
+
+ var i = entries.length;
+ while (i--)
+ if (entries[i].handler === handler) return null;
+
+ var uid = getUniqueElementID(element);
+ var responder = GLOBAL.Event._createResponder(uid, eventName, handler);
+ var entry = {
+ responder: responder,
+ handler: handler
+ };
+
+ entries.push(entry);
+ return entry;
+ }
+
+ function unregister(element, eventName, handler) {
+ var registry = getRegistryForElement(element);
+ var entries = registry[eventName];
+ if (!entries) return;
+
+ var i = entries.length, entry;
+ while (i--) {
+ if (entries[i].handler === handler) {
+ entry = entries[i];
+ break;
+ }
+ }
+
+ if (!entry) return;
+
+ var index = entries.indexOf(entry);
+ entries.splice(index, 1);
+
+ return entry;
+ }
+
+
+ function observe(element, eventName, handler) {
+ element = $(element);
+ var entry = register(element, eventName, handler);
+
+ if (entry === null) return element;
+
+ var responder = entry.responder;
+ if (isCustomEvent(eventName))
+ observeCustomEvent(element, eventName, responder);
+ else
+ observeStandardEvent(element, eventName, responder);
+
+ return element;
+ }
+
+ function observeStandardEvent(element, eventName, responder) {
+ var actualEventName = getDOMEventName(eventName);
+ if (element.addEventListener) {
+ element.addEventListener(actualEventName, responder, false);
+ } else {
+ element.attachEvent('on' + actualEventName, responder);
+ }
+ }
+
+ function observeCustomEvent(element, eventName, responder) {
+ if (element.addEventListener) {
+ element.addEventListener('dataavailable', responder, false);
+ } else {
+ element.attachEvent('ondataavailable', responder);
+ element.attachEvent('onlosecapture', responder);
+ }
+ }
+
+ function stopObserving(element, eventName, handler) {
+ element = $(element);
+ var handlerGiven = !Object.isUndefined(handler),
+ eventNameGiven = !Object.isUndefined(eventName);
+
+ if (!eventNameGiven && !handlerGiven) {
+ stopObservingElement(element);
+ return element;
+ }
+
+ if (!handlerGiven) {
+ stopObservingEventName(element, eventName);
+ return element;
+ }
+
+ var entry = unregister(element, eventName, handler);
+
+ if (!entry) return element;
+ removeEvent(element, eventName, entry.responder);
+ return element;
+ }
+
+ function stopObservingStandardEvent(element, eventName, responder) {
+ var actualEventName = getDOMEventName(eventName);
+ if (element.removeEventListener) {
+ element.removeEventListener(actualEventName, responder, false);
+ } else {
+ element.detachEvent('on' + actualEventName, responder);
+ }
+ }
+
+ function stopObservingCustomEvent(element, eventName, responder) {
+ if (element.removeEventListener) {
+ element.removeEventListener('dataavailable', responder, false);
+ } else {
+ element.detachEvent('ondataavailable', responder);
+ element.detachEvent('onlosecapture', responder);
+ }
+ }
+
+
+
+ function stopObservingElement(element) {
+ var uid = getUniqueElementID(element), registry = GLOBAL.Event.cache[uid];
+ if (!registry) return;
+
+ destroyRegistryForElement(element, uid);
+
+ var entries, i;
+ for (var eventName in registry) {
+ if (eventName === 'element') continue;
+
+ entries = registry[eventName];
+ i = entries.length;
+ while (i--)
+ removeEvent(element, eventName, entries[i].responder);
+ }
+ }
+
+ function stopObservingEventName(element, eventName) {
+ var registry = getRegistryForElement(element);
+ var entries = registry[eventName];
+ if (!entries) return;
+ delete registry[eventName];
+
+ var i = entries.length;
+ while (i--)
+ removeEvent(element, eventName, entries[i].responder);
+ }
+
+
+ function removeEvent(element, eventName, handler) {
+ if (isCustomEvent(eventName))
+ stopObservingCustomEvent(element, eventName, handler);
+ else
+ stopObservingStandardEvent(element, eventName, handler);
+ }
+
+
+
+ function getFireTarget(element) {
+ if (element !== document) return element;
+ if (document.createEvent && !element.dispatchEvent)
+ return document.documentElement;
+ return element;
+ }
+
+ function fire(element, eventName, memo, bubble) {
+ element = getFireTarget($(element));
+ if (Object.isUndefined(bubble)) bubble = true;
+ memo = memo || {};
+
+ var event = fireEvent(element, eventName, memo, bubble);
+ return Event.extend(event);
+ }
+
+ function fireEvent_DOM(element, eventName, memo, bubble) {
+ var event = document.createEvent('HTMLEvents');
+ event.initEvent('dataavailable', bubble, true);
+
+ event.eventName = eventName;
+ event.memo = memo;
+
+ element.dispatchEvent(event);
+ return event;
+ }
+
+ function fireEvent_IE(element, eventName, memo, bubble) {
+ var event = document.createEventObject();
+ event.eventType = bubble ? 'ondataavailable' : 'onlosecapture';
+
+ event.eventName = eventName;
+ event.memo = memo;
+
+ element.fireEvent(event.eventType, event);
+ return event;
+ }
+
+ var fireEvent = document.createEvent ? fireEvent_DOM : fireEvent_IE;
+
+
+
+ Event.Handler = Class.create({
+ initialize: function(element, eventName, selector, callback) {
+ this.element = $(element);
+ this.eventName = eventName;
+ this.selector = selector;
+ this.callback = callback;
+ this.handler = this.handleEvent.bind(this);
+ },
+
+
+ start: function() {
+ Event.observe(this.element, this.eventName, this.handler);
+ return this;
+ },
+
+ stop: function() {
+ Event.stopObserving(this.element, this.eventName, this.handler);
+ return this;
+ },
+
+ handleEvent: function(event) {
+ var element = Event.findElement(event, this.selector);
+ if (element) this.callback.call(this.element, event, element);
+ }
+ });
+
+ function on(element, eventName, selector, callback) {
+ element = $(element);
+ if (Object.isFunction(selector) && Object.isUndefined(callback)) {
+ callback = selector, selector = null;
+ }
+
+ return new Event.Handler(element, eventName, selector, callback).start();
+ }
+
+ Object.extend(Event, Event.Methods);
+
+ Object.extend(Event, {
+ fire: fire,
+ observe: observe,
+ stopObserving: stopObserving,
+ on: on
+ });
+
+ Element.addMethods({
+ fire: fire,
+
+ observe: observe,
+
+ stopObserving: stopObserving,
+
+ on: on
+ });
+
+ Object.extend(document, {
+ fire: fire.methodize(),
+
+ observe: observe.methodize(),
+
+ stopObserving: stopObserving.methodize(),
+
+ on: on.methodize(),
+
+ loaded: false
+ });
+
+ if (GLOBAL.Event) Object.extend(window.Event, Event);
+ else GLOBAL.Event = Event;
+
+ GLOBAL.Event.cache = {};
+
+ function destroyCache_IE() {
+ GLOBAL.Event.cache = null;
+ }
+
+ if (window.attachEvent)
+ window.attachEvent('onunload', destroyCache_IE);
+
+ DIV = null;
+ docEl = null;
+})(this);
+
+(function(GLOBAL) {
+ /* Code for creating leak-free event responders is based on work by
+ John-David Dalton. */
+
+ var docEl = document.documentElement;
+ var MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED = 'onmouseenter' in docEl
+ && 'onmouseleave' in docEl;
+
+ function isSimulatedMouseEnterLeaveEvent(eventName) {
+ return !MOUSEENTER_MOUSELEAVE_EVENTS_SUPPORTED &&
+ (eventName === 'mouseenter' || eventName === 'mouseleave');
+ }
+
+ function createResponder(uid, eventName, handler) {
+ if (Event._isCustomEvent(eventName))
+ return createResponderForCustomEvent(uid, eventName, handler);
+ if (isSimulatedMouseEnterLeaveEvent(eventName))
+ return createMouseEnterLeaveResponder(uid, eventName, handler);
+
+ return function(event) {
+ if (!Event.cache) return;
+
+ var element = Event.cache[uid].element;
+ Event.extend(event, element);
+ handler.call(element, event);
+ };
+ }
+
+ function createResponderForCustomEvent(uid, eventName, handler) {
+ return function(event) {
+ var element = Event.cache[uid].element;
+
+ if (Object.isUndefined(event.eventName))
+ return false;
+
+ if (event.eventName !== eventName)
+ return false;
+
+ Event.extend(event, element);
+ handler.call(element, event);
+ };
+ }
+
+ function createMouseEnterLeaveResponder(uid, eventName, handler) {
+ return function(event) {
+ var element = Event.cache[uid].element;
+
+ Event.extend(event, element);
+ var parent = event.relatedTarget;
+
+ while (parent && parent !== element) {
+ try { parent = parent.parentNode; }
+ catch(e) { parent = element; }
+ }
+
+ if (parent === element) return;
+ handler.call(element, event);
+ }
+ }
+
+ GLOBAL.Event._createResponder = createResponder;
+ docEl = null;
+})(this);
+
+(function(GLOBAL) {
+ /* Support for the DOMContentLoaded event is based on work by Dan Webb,
+ Matthias Miller, Dean Edwards, John Resig, and Diego Perini. */
+
+ var TIMER;
+
+ function fireContentLoadedEvent() {
+ if (document.loaded) return;
+ if (TIMER) window.clearTimeout(TIMER);
+ document.loaded = true;
+ document.fire('dom:loaded');
+ }
+
+ function checkReadyState() {
+ if (document.readyState === 'complete') {
+ document.detachEvent('onreadystatechange', checkReadyState);
+ fireContentLoadedEvent();
+ }
+ }
+
+ function pollDoScroll() {
+ try {
+ document.documentElement.doScroll('left');
+ } catch (e) {
+ TIMER = pollDoScroll.defer();
+ return;
+ }
+
+ fireContentLoadedEvent();
+ }
+
+
+ if (document.readyState === 'complete') {
+ fireContentLoadedEvent();
+ return;
+ }
+
+ if (document.addEventListener) {
+ document.addEventListener('DOMContentLoaded', fireContentLoadedEvent, false);
+ } else {
+ document.attachEvent('onreadystatechange', checkReadyState);
+ if (window == top) TIMER = pollDoScroll.defer();
+ }
+
+ Event.observe(window, 'load', fireContentLoadedEvent);
+})(this);
+
+
+Element.addMethods();
+/*------------------------------- DEPRECATED -------------------------------*/
+
+Hash.toQueryString = Object.toQueryString;
+
+var Toggle = { display: Element.toggle };
+
+Element.Methods.childOf = Element.Methods.descendantOf;
+
+var Insertion = {
+ Before: function(element, content) {
+ return Element.insert(element, {before:content});
+ },
+
+ Top: function(element, content) {
+ return Element.insert(element, {top:content});
+ },
+
+ Bottom: function(element, content) {
+ return Element.insert(element, {bottom:content});
+ },
+
+ After: function(element, content) {
+ return Element.insert(element, {after:content});
+ }
+};
+
+var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
+
+var Position = {
+ includeScrollOffsets: false,
+
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = Element.cumulativeScrollOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+
+ cumulativeOffset: Element.Methods.cumulativeOffset,
+
+ positionedOffset: Element.Methods.positionedOffset,
+
+ absolutize: function(element) {
+ Position.prepare();
+ return Element.absolutize(element);
+ },
+
+ relativize: function(element) {
+ Position.prepare();
+ return Element.relativize(element);
+ },
+
+ realOffset: Element.Methods.cumulativeScrollOffset,
+
+ offsetParent: Element.Methods.getOffsetParent,
+
+ page: Element.Methods.viewportOffset,
+
+ clone: function(source, target, options) {
+ options = options || { };
+ return Element.clonePosition(target, source, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
+ function iter(name) {
+ return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
+ }
+
+ instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
+ function(element, className) {
+ className = className.toString().strip();
+ var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
+ return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
+ } : function(element, className) {
+ className = className.toString().strip();
+ var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
+ if (!classNames && !className) return elements;
+
+ var nodes = $(element).getElementsByTagName('*');
+ className = ' ' + className + ' ';
+
+ for (var i = 0, child, cn; child = nodes[i]; i++) {
+ if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
+ (classNames && classNames.all(function(name) {
+ return !name.toString().blank() && cn.include(' ' + name + ' ');
+ }))))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+ };
+
+ return function(className, parentElement) {
+ return $(parentElement || document.body).getElementsByClassName(className);
+ };
+}(Element.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator, context) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator, context);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+
+/*--------------------------------------------------------------------------*/
+
+(function() {
+ window.Selector = Class.create({
+ initialize: function(expression) {
+ this.expression = expression.strip();
+ },
+
+ findElements: function(rootElement) {
+ return Prototype.Selector.select(this.expression, rootElement);
+ },
+
+ match: function(element) {
+ return Prototype.Selector.match(element, this.expression);
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector: " + this.expression + ">";
+ }
+ });
+
+ Object.extend(Selector, {
+ matchElements: function(elements, expression) {
+ var match = Prototype.Selector.match,
+ results = [];
+
+ for (var i = 0, length = elements.length; i < length; i++) {
+ var element = elements[i];
+ if (match(element, expression)) {
+ results.push(Element.extend(element));
+ }
+ }
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ index = index || 0;
+ var matchIndex = 0, element;
+ for (var i = 0, length = elements.length; i < length; i++) {
+ element = elements[i];
+ if (Prototype.Selector.match(element, expression) && index === matchIndex++) {
+ return Element.extend(element);
+ }
+ }
+ },
+
+ findChildElements: function(element, expressions) {
+ var selector = expressions.toArray().join(', ');
+ return Prototype.Selector.select(selector, element || document);
+ }
+ });
+})();
diff --git a/shrine-webclient/src/main/html/js-ext/prototype.js b/shrine-webclient/src/main/html/js-ext/prototype_old.js
old mode 100755
new mode 100644
similarity index 96%
copy from shrine-webclient/src/main/html/js-ext/prototype.js
copy to shrine-webclient/src/main/html/js-ext/prototype_old.js
index 08c246446..5c7346294
--- a/shrine-webclient/src/main/html/js-ext/prototype.js
+++ b/shrine-webclient/src/main/html/js-ext/prototype_old.js
@@ -1,4184 +1,4184 @@
-/* Prototype JavaScript framework, version 1.6.0
- * (c) 2005-2007 Sam Stephenson
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://www.prototypejs.org/
- *
- *--------------------------------------------------------------------------*/
-
-var Prototype = {
- Version: '1.6.0',
-
- Browser: {
- IE: !!(window.attachEvent && !window.opera),
- Opera: !!window.opera,
- WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
- Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
- MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
- },
-
- BrowserFeatures: {
- XPath: !!document.evaluate,
- ElementExtensions: !!window.HTMLElement,
- SpecificElementExtensions:
- document.createElement('div').__proto__ &&
- document.createElement('div').__proto__ !==
- document.createElement('form').__proto__
- },
-
- ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
- JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
-
- emptyFunction: function() { },
- K: function(x) { return x }
-};
-
-if (Prototype.Browser.MobileSafari)
- Prototype.BrowserFeatures.SpecificElementExtensions = false;
-
-if (Prototype.Browser.WebKit)
- Prototype.BrowserFeatures.XPath = false;
-
-/* Based on Alex Arnell's inheritance implementation. */
-var Class = {
- create: function() {
- var parent = null, properties = $A(arguments);
- if (Object.isFunction(properties[0]))
- parent = properties.shift();
-
- function klass() {
- this.initialize.apply(this, arguments);
- }
-
- Object.extend(klass, Class.Methods);
- klass.superclass = parent;
- klass.subclasses = [];
-
- if (parent) {
- var subclass = function() { };
- subclass.prototype = parent.prototype;
- klass.prototype = new subclass;
- parent.subclasses.push(klass);
- }
-
- for (var i = 0; i < properties.length; i++)
- klass.addMethods(properties[i]);
-
- if (!klass.prototype.initialize)
- klass.prototype.initialize = Prototype.emptyFunction;
-
- klass.prototype.constructor = klass;
-
- return klass;
- }
-};
-
-Class.Methods = {
- addMethods: function(source) {
- var ancestor = this.superclass && this.superclass.prototype;
- var properties = Object.keys(source);
-
- if (!Object.keys({ toString: true }).length)
- properties.push("toString", "valueOf");
-
- for (var i = 0, length = properties.length; i < length; i++) {
- var property = properties[i], value = source[property];
- if (ancestor && Object.isFunction(value) &&
- value.argumentNames().first() == "$super") {
- var method = value, value = Object.extend((function(m) {
- return function() { return ancestor[m].apply(this, arguments) };
- })(property).wrap(method), {
- valueOf: function() { return method },
- toString: function() { return method.toString() }
- });
- }
- this.prototype[property] = value;
- }
-
- return this;
- }
-};
-
-var Abstract = { };
-
-Object.extend = function(destination, source) {
- for (var property in source)
- destination[property] = source[property];
- return destination;
-};
-
-Object.extend(Object, {
- inspect: function(object) {
- try {
- if (object === undefined) return 'undefined';
- if (object === null) return 'null';
- return object.inspect ? object.inspect() : object.toString();
- } catch (e) {
- if (e instanceof RangeError) return '...';
- throw e;
- }
- },
-
- toJSON: function(object) {
- var type = typeof object;
- switch (type) {
- case 'undefined':
- case 'function':
- case 'unknown': return;
- case 'boolean': return object.toString();
- }
-
- if (object === null) return 'null';
- if (object.toJSON) return object.toJSON();
- if (Object.isElement(object)) return;
-
- var results = [];
- for (var property in object) {
- var value = Object.toJSON(object[property]);
- if (value !== undefined)
- results.push(property.toJSON() + ': ' + value);
- }
-
- return '{' + results.join(', ') + '}';
- },
-
- toQueryString: function(object) {
- return $H(object).toQueryString();
- },
-
- toHTML: function(object) {
- return object && object.toHTML ? object.toHTML() : String.interpret(object);
- },
-
- keys: function(object) {
- var keys = [];
- for (var property in object)
- keys.push(property);
- return keys;
- },
-
- values: function(object) {
- var values = [];
- for (var property in object)
- values.push(object[property]);
- return values;
- },
-
- clone: function(object) {
- return Object.extend({ }, object);
- },
-
- isElement: function(object) {
- return object && object.nodeType == 1;
- },
-
- isArray: function(object) {
- return object && object.constructor === Array;
- },
-
- isHash: function(object) {
- return object instanceof Hash;
- },
-
- isFunction: function(object) {
- return typeof object == "function";
- },
-
- isString: function(object) {
- return typeof object == "string";
- },
-
- isNumber: function(object) {
- return typeof object == "number";
- },
-
- isUndefined: function(object) {
- return typeof object == "undefined";
- }
-});
-
-Object.extend(Function.prototype, {
- argumentNames: function() {
- var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
- return names.length == 1 && !names[0] ? [] : names;
- },
-
- bind: function() {
- if (arguments.length < 2 && arguments[0] === undefined) return this;
- var __method = this, args = $A(arguments), object = args.shift();
- return function() {
- return __method.apply(object, args.concat($A(arguments)));
- }
- },
-
- bindAsEventListener: function() {
- var __method = this, args = $A(arguments), object = args.shift();
- return function(event) {
- return __method.apply(object, [event || window.event].concat(args));
- }
- },
-
- curry: function() {
- if (!arguments.length) return this;
- var __method = this, args = $A(arguments);
- return function() {
- return __method.apply(this, args.concat($A(arguments)));
- }
- },
-
- delay: function() {
- var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
- return window.setTimeout(function() {
- return __method.apply(__method, args);
- }, timeout);
- },
-
- wrap: function(wrapper) {
- var __method = this;
- return function() {
- return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
- }
- },
-
- methodize: function() {
- if (this._methodized) return this._methodized;
- var __method = this;
- return this._methodized = function() {
- return __method.apply(null, [this].concat($A(arguments)));
- };
- }
-});
-
-Function.prototype.defer = Function.prototype.delay.curry(0.01);
-
-Date.prototype.toJSON = function() {
- return '"' + this.getUTCFullYear() + '-' +
- (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
- this.getUTCDate().toPaddedString(2) + 'T' +
- this.getUTCHours().toPaddedString(2) + ':' +
- this.getUTCMinutes().toPaddedString(2) + ':' +
- this.getUTCSeconds().toPaddedString(2) + 'Z"';
-};
-
-var Try = {
- these: function() {
- var returnValue;
-
- for (var i = 0, length = arguments.length; i < length; i++) {
- var lambda = arguments[i];
- try {
- returnValue = lambda();
- break;
- } catch (e) { }
- }
-
- return returnValue;
- }
-};
-
-RegExp.prototype.match = RegExp.prototype.test;
-
-RegExp.escape = function(str) {
- return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
-};
-
-/*--------------------------------------------------------------------------*/
-
-var PeriodicalExecuter = Class.create({
- initialize: function(callback, frequency) {
- this.callback = callback;
- this.frequency = frequency;
- this.currentlyExecuting = false;
-
- this.registerCallback();
- },
-
- registerCallback: function() {
- this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
- },
-
- execute: function() {
- this.callback(this);
- },
-
- stop: function() {
- if (!this.timer) return;
- clearInterval(this.timer);
- this.timer = null;
- },
-
- onTimerEvent: function() {
- if (!this.currentlyExecuting) {
- try {
- this.currentlyExecuting = true;
- this.execute();
- } finally {
- this.currentlyExecuting = false;
- }
- }
- }
-});
-Object.extend(String, {
- interpret: function(value) {
- return value == null ? '' : String(value);
- },
- specialChar: {
- '\b': '\\b',
- '\t': '\\t',
- '\n': '\\n',
- '\f': '\\f',
- '\r': '\\r',
- '\\': '\\\\'
- }
-});
-
-Object.extend(String.prototype, {
- gsub: function(pattern, replacement) {
- var result = '', source = this, match;
- replacement = arguments.callee.prepareReplacement(replacement);
-
- while (source.length > 0) {
- if (match = source.match(pattern)) {
- result += source.slice(0, match.index);
- result += String.interpret(replacement(match));
- source = source.slice(match.index + match[0].length);
- } else {
- result += source, source = '';
- }
- }
- return result;
- },
-
- sub: function(pattern, replacement, count) {
- replacement = this.gsub.prepareReplacement(replacement);
- count = count === undefined ? 1 : count;
-
- return this.gsub(pattern, function(match) {
- if (--count < 0) return match[0];
- return replacement(match);
- });
- },
-
- scan: function(pattern, iterator) {
- this.gsub(pattern, iterator);
- return String(this);
- },
-
- truncate: function(length, truncation) {
- length = length || 30;
- truncation = truncation === undefined ? '...' : truncation;
- return this.length > length ?
- this.slice(0, length - truncation.length) + truncation : String(this);
- },
-
- strip: function() {
- return this.replace(/^\s+/, '').replace(/\s+$/, '');
- },
-
- stripTags: function() {
- return this.replace(/<\/?[^>]+>/gi, '');
- },
-
- stripScripts: function() {
- return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
- },
-
- extractScripts: function() {
- var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
- var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
- return (this.match(matchAll) || []).map(function(scriptTag) {
- return (scriptTag.match(matchOne) || ['', ''])[1];
- });
- },
-
- evalScripts: function() {
- return this.extractScripts().map(function(script) { return eval(script) });
- },
-
- escapeHTML: function() {
- var self = arguments.callee;
- self.text.data = this;
- return self.div.innerHTML;
- },
-
- unescapeHTML: function() {
- var div = new Element('div');
- div.innerHTML = this.stripTags();
- return div.childNodes[0] ? (div.childNodes.length > 1 ?
- $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
- div.childNodes[0].nodeValue) : '';
- },
-
- toQueryParams: function(separator) {
- var match = this.strip().match(/([^?#]*)(#.*)?$/);
- if (!match) return { };
-
- return match[1].split(separator || '&').inject({ }, function(hash, pair) {
- if ((pair = pair.split('='))[0]) {
- var key = decodeURIComponent(pair.shift());
- var value = pair.length > 1 ? pair.join('=') : pair[0];
- if (value != undefined) value = decodeURIComponent(value);
-
- if (key in hash) {
- if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
- hash[key].push(value);
- }
- else hash[key] = value;
- }
- return hash;
- });
- },
-
- toArray: function() {
- return this.split('');
- },
-
- succ: function() {
- return this.slice(0, this.length - 1) +
- String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
- },
-
- times: function(count) {
- return count < 1 ? '' : new Array(count + 1).join(this);
- },
-
- camelize: function() {
- var parts = this.split('-'), len = parts.length;
- if (len == 1) return parts[0];
-
- var camelized = this.charAt(0) == '-'
- ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
- : parts[0];
-
- for (var i = 1; i < len; i++)
- camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
-
- return camelized;
- },
-
- capitalize: function() {
- return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
- },
-
- underscore: function() {
- return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
- },
-
- dasherize: function() {
- return this.gsub(/_/,'-');
- },
-
- inspect: function(useDoubleQuotes) {
- var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
- var character = String.specialChar[match[0]];
- return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
- });
- if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
- return "'" + escapedString.replace(/'/g, '\\\'') + "'";
- },
-
- toJSON: function() {
- return this.inspect(true);
- },
-
- unfilterJSON: function(filter) {
- return this.sub(filter || Prototype.JSONFilter, '#{1}');
- },
-
- isJSON: function() {
- var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
- return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
- },
-
- evalJSON: function(sanitize) {
- var json = this.unfilterJSON();
- try {
- if (!sanitize || json.isJSON()) return eval('(' + json + ')');
- } catch (e) { }
- throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
- },
-
- include: function(pattern) {
- return this.indexOf(pattern) > -1;
- },
-
- startsWith: function(pattern) {
- return this.indexOf(pattern) === 0;
- },
-
- endsWith: function(pattern) {
- var d = this.length - pattern.length;
- return d >= 0 && this.lastIndexOf(pattern) === d;
- },
-
- empty: function() {
- return this == '';
- },
-
- blank: function() {
- return /^\s*$/.test(this);
- },
-
- interpolate: function(object, pattern) {
- return new Template(this, pattern).evaluate(object);
- }
-});
-
-if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
- escapeHTML: function() {
- return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
- },
- unescapeHTML: function() {
- return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
- }
-});
-
-String.prototype.gsub.prepareReplacement = function(replacement) {
- if (Object.isFunction(replacement)) return replacement;
- var template = new Template(replacement);
- return function(match) { return template.evaluate(match) };
-};
-
-String.prototype.parseQuery = String.prototype.toQueryParams;
-
-Object.extend(String.prototype.escapeHTML, {
- div: document.createElement('div'),
- text: document.createTextNode('')
-});
-
-with (String.prototype.escapeHTML) div.appendChild(text);
-
-var Template = Class.create({
- initialize: function(template, pattern) {
- this.template = template.toString();
- this.pattern = pattern || Template.Pattern;
- },
-
- evaluate: function(object) {
- if (Object.isFunction(object.toTemplateReplacements))
- object = object.toTemplateReplacements();
-
- return this.template.gsub(this.pattern, function(match) {
- if (object == null) return '';
-
- var before = match[1] || '';
- if (before == '\\') return match[2];
-
- var ctx = object, expr = match[3];
- var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr);
- if (match == null) return before;
-
- while (match != null) {
- var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
- ctx = ctx[comp];
- if (null == ctx || '' == match[3]) break;
- expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
- match = pattern.exec(expr);
- }
-
- return before + String.interpret(ctx);
- }.bind(this));
- }
-});
-Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
-
-var $break = { };
-
-var Enumerable = {
- each: function(iterator, context) {
- var index = 0;
- iterator = iterator.bind(context);
- try {
- this._each(function(value) {
- iterator(value, index++);
- });
- } catch (e) {
- if (e != $break) throw e;
- }
- return this;
- },
-
- eachSlice: function(number, iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var index = -number, slices = [], array = this.toArray();
- while ((index += number) < array.length)
- slices.push(array.slice(index, index+number));
- return slices.collect(iterator, context);
- },
-
- all: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result = true;
- this.each(function(value, index) {
- result = result && !!iterator(value, index);
- if (!result) throw $break;
- });
- return result;
- },
-
- any: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result = false;
- this.each(function(value, index) {
- if (result = !!iterator(value, index))
- throw $break;
- });
- return result;
- },
-
- collect: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var results = [];
- this.each(function(value, index) {
- results.push(iterator(value, index));
- });
- return results;
- },
-
- detect: function(iterator, context) {
- iterator = iterator.bind(context);
- var result;
- this.each(function(value, index) {
- if (iterator(value, index)) {
- result = value;
- throw $break;
- }
- });
- return result;
- },
-
- findAll: function(iterator, context) {
- iterator = iterator.bind(context);
- var results = [];
- this.each(function(value, index) {
- if (iterator(value, index))
- results.push(value);
- });
- return results;
- },
-
- grep: function(filter, iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var results = [];
-
- if (Object.isString(filter))
- filter = new RegExp(filter);
-
- this.each(function(value, index) {
- if (filter.match(value))
- results.push(iterator(value, index));
- });
- return results;
- },
-
- include: function(object) {
- if (Object.isFunction(this.indexOf))
- if (this.indexOf(object) != -1) return true;
-
- var found = false;
- this.each(function(value) {
- if (value == object) {
- found = true;
- throw $break;
- }
- });
- return found;
- },
-
- inGroupsOf: function(number, fillWith) {
- fillWith = fillWith === undefined ? null : fillWith;
- return this.eachSlice(number, function(slice) {
- while(slice.length < number) slice.push(fillWith);
- return slice;
- });
- },
-
- inject: function(memo, iterator, context) {
- iterator = iterator.bind(context);
- this.each(function(value, index) {
- memo = iterator(memo, value, index);
- });
- return memo;
- },
-
- invoke: function(method) {
- var args = $A(arguments).slice(1);
- return this.map(function(value) {
- return value[method].apply(value, args);
- });
- },
-
- max: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result;
- this.each(function(value, index) {
- value = iterator(value, index);
- if (result == undefined || value >= result)
- result = value;
- });
- return result;
- },
-
- min: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var result;
- this.each(function(value, index) {
- value = iterator(value, index);
- if (result == undefined || value < result)
- result = value;
- });
- return result;
- },
-
- partition: function(iterator, context) {
- iterator = iterator ? iterator.bind(context) : Prototype.K;
- var trues = [], falses = [];
- this.each(function(value, index) {
- (iterator(value, index) ?
- trues : falses).push(value);
- });
- return [trues, falses];
- },
-
- pluck: function(property) {
- var results = [];
- this.each(function(value) {
- results.push(value[property]);
- });
- return results;
- },
-
- reject: function(iterator, context) {
- iterator = iterator.bind(context);
- var results = [];
- this.each(function(value, index) {
- if (!iterator(value, index))
- results.push(value);
- });
- return results;
- },
-
- sortBy: function(iterator, context) {
- iterator = iterator.bind(context);
- return this.map(function(value, index) {
- return {value: value, criteria: iterator(value, index)};
- }).sort(function(left, right) {
- var a = left.criteria, b = right.criteria;
- return a < b ? -1 : a > b ? 1 : 0;
- }).pluck('value');
- },
-
- toArray: function() {
- return this.map();
- },
-
- zip: function() {
- var iterator = Prototype.K, args = $A(arguments);
- if (Object.isFunction(args.last()))
- iterator = args.pop();
-
- var collections = [this].concat(args).map($A);
- return this.map(function(value, index) {
- return iterator(collections.pluck(index));
- });
- },
-
- size: function() {
- return this.toArray().length;
- },
-
- inspect: function() {
- return '#<Enumerable:' + this.toArray().inspect() + '>';
- }
-};
-
-Object.extend(Enumerable, {
- map: Enumerable.collect,
- find: Enumerable.detect,
- select: Enumerable.findAll,
- filter: Enumerable.findAll,
- member: Enumerable.include,
- entries: Enumerable.toArray,
- every: Enumerable.all,
- some: Enumerable.any
-});
-function $A(iterable) {
- if (!iterable) return [];
- if (iterable.toArray) return iterable.toArray();
- var length = iterable.length, results = new Array(length);
- while (length--) results[length] = iterable[length];
- return results;
-}
-
-if (Prototype.Browser.WebKit) {
- function $A(iterable) {
- if (!iterable) return [];
- if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
- iterable.toArray) return iterable.toArray();
- var length = iterable.length, results = new Array(length);
- while (length--) results[length] = iterable[length];
- return results;
- }
-}
-
-Array.from = $A;
-
-Object.extend(Array.prototype, Enumerable);
-
-if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
-
-Object.extend(Array.prototype, {
- _each: function(iterator) {
- for (var i = 0, length = this.length; i < length; i++)
- iterator(this[i]);
- },
-
- clear: function() {
- this.length = 0;
- return this;
- },
-
- first: function() {
- return this[0];
- },
-
- last: function() {
- return this[this.length - 1];
- },
-
- compact: function() {
- return this.select(function(value) {
- return value != null;
- });
- },
-
- flatten: function() {
- return this.inject([], function(array, value) {
- return array.concat(Object.isArray(value) ?
- value.flatten() : [value]);
- });
- },
-
- without: function() {
- var values = $A(arguments);
- return this.select(function(value) {
- return !values.include(value);
- });
- },
-
- reverse: function(inline) {
- return (inline !== false ? this : this.toArray())._reverse();
- },
-
- reduce: function() {
- return this.length > 1 ? this : this[0];
- },
-
- uniq: function(sorted) {
- return this.inject([], function(array, value, index) {
- if (0 == index || (sorted ? array.last() != value : !array.include(value)))
- array.push(value);
- return array;
- });
- },
-
- intersect: function(array) {
- return this.uniq().findAll(function(item) {
- return array.detect(function(value) { return item === value });
- });
- },
-
- clone: function() {
- return [].concat(this);
- },
-
- size: function() {
- return this.length;
- },
-
- inspect: function() {
- return '[' + this.map(Object.inspect).join(', ') + ']';
- },
-
- toJSON: function() {
- var results = [];
- this.each(function(object) {
- var value = Object.toJSON(object);
- if (value !== undefined) results.push(value);
- });
- return '[' + results.join(', ') + ']';
- }
-});
-
-// use native browser JS 1.6 implementation if available
-if (Object.isFunction(Array.prototype.forEach))
- Array.prototype._each = Array.prototype.forEach;
-
-if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
- i || (i = 0);
- var length = this.length;
- if (i < 0) i = length + i;
- for (; i < length; i++)
- if (this[i] === item) return i;
- return -1;
-};
-
-if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
- i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
- var n = this.slice(0, i).reverse().indexOf(item);
- return (n < 0) ? n : i - n - 1;
-};
-
-Array.prototype.toArray = Array.prototype.clone;
-
-function $w(string) {
- if (!Object.isString(string)) return [];
- string = string.strip();
- return string ? string.split(/\s+/) : [];
-}
-
-if (Prototype.Browser.Opera){
- Array.prototype.concat = function() {
- var array = [];
- for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
- for (var i = 0, length = arguments.length; i < length; i++) {
- if (Object.isArray(arguments[i])) {
- for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
- array.push(arguments[i][j]);
- } else {
- array.push(arguments[i]);
- }
- }
- return array;
- };
-}
-Object.extend(Number.prototype, {
- toColorPart: function() {
- return this.toPaddedString(2, 16);
- },
-
- succ: function() {
- return this + 1;
- },
-
- times: function(iterator) {
- $R(0, this, true).each(iterator);
- return this;
- },
-
- toPaddedString: function(length, radix) {
- var string = this.toString(radix || 10);
- return '0'.times(length - string.length) + string;
- },
-
- toJSON: function() {
- return isFinite(this) ? this.toString() : 'null';
- }
-});
-
-$w('abs round ceil floor').each(function(method){
- Number.prototype[method] = Math[method].methodize();
-});
-function $H(object) {
- return new Hash(object);
-};
-
-var Hash = Class.create(Enumerable, (function() {
- if (function() {
- var i = 0, Test = function(value) { this.key = value };
- Test.prototype.key = 'foo';
- for (var property in new Test('bar')) i++;
- return i > 1;
- }()) {
- function each(iterator) {
- var cache = [];
- for (var key in this._object) {
- var value = this._object[key];
- if (cache.include(key)) continue;
- cache.push(key);
- var pair = [key, value];
- pair.key = key;
- pair.value = value;
- iterator(pair);
- }
- }
- } else {
- function each(iterator) {
- for (var key in this._object) {
- var value = this._object[key], pair = [key, value];
- pair.key = key;
- pair.value = value;
- iterator(pair);
- }
- }
- }
-
- function toQueryPair(key, value) {
- if (Object.isUndefined(value)) return key;
- return key + '=' + encodeURIComponent(String.interpret(value));
- }
-
- return {
- initialize: function(object) {
- this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
- },
-
- _each: each,
-
- set: function(key, value) {
- return this._object[key] = value;
- },
-
- get: function(key) {
- return this._object[key];
- },
-
- unset: function(key) {
- var value = this._object[key];
- delete this._object[key];
- return value;
- },
-
- toObject: function() {
- return Object.clone(this._object);
- },
-
- keys: function() {
- return this.pluck('key');
- },
-
- values: function() {
- return this.pluck('value');
- },
-
- index: function(value) {
- var match = this.detect(function(pair) {
- return pair.value === value;
- });
- return match && match.key;
- },
-
- merge: function(object) {
- return this.clone().update(object);
- },
-
- update: function(object) {
- return new Hash(object).inject(this, function(result, pair) {
- result.set(pair.key, pair.value);
- return result;
- });
- },
-
- toQueryString: function() {
- return this.map(function(pair) {
- var key = encodeURIComponent(pair.key), values = pair.value;
-
- if (values && typeof values == 'object') {
- if (Object.isArray(values))
- return values.map(toQueryPair.curry(key)).join('&');
- }
- return toQueryPair(key, values);
- }).join('&');
- },
-
- inspect: function() {
- return '#<Hash:{' + this.map(function(pair) {
- return pair.map(Object.inspect).join(': ');
- }).join(', ') + '}>';
- },
-
- toJSON: function() {
- return Object.toJSON(this.toObject());
- },
-
- clone: function() {
- return new Hash(this);
- }
- }
-})());
-
-Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
-Hash.from = $H;
-var ObjectRange = Class.create(Enumerable, {
- initialize: function(start, end, exclusive) {
- this.start = start;
- this.end = end;
- this.exclusive = exclusive;
- },
-
- _each: function(iterator) {
- var value = this.start;
- while (this.include(value)) {
- iterator(value);
- value = value.succ();
- }
- },
-
- include: function(value) {
- if (value < this.start)
- return false;
- if (this.exclusive)
- return value < this.end;
- return value <= this.end;
- }
-});
-
-var $R = function(start, end, exclusive) {
- return new ObjectRange(start, end, exclusive);
-};
-
-var Ajax = {
- getTransport: function() {
- return Try.these(
- function() {return new XMLHttpRequest()},
- function() {return new ActiveXObject('Msxml2.XMLHTTP')},
- function() {return new ActiveXObject('Microsoft.XMLHTTP')}
- ) || false;
- },
-
- activeRequestCount: 0
-};
-
-Ajax.Responders = {
- responders: [],
-
- _each: function(iterator) {
- this.responders._each(iterator);
- },
-
- register: function(responder) {
- if (!this.include(responder))
- this.responders.push(responder);
- },
-
- unregister: function(responder) {
- this.responders = this.responders.without(responder);
- },
-
- dispatch: function(callback, request, transport, json) {
- this.each(function(responder) {
- if (Object.isFunction(responder[callback])) {
- try {
- responder[callback].apply(responder, [request, transport, json]);
- } catch (e) { }
- }
- });
- }
-};
-
-Object.extend(Ajax.Responders, Enumerable);
-
-Ajax.Responders.register({
- onCreate: function() { Ajax.activeRequestCount++ },
- onComplete: function() { Ajax.activeRequestCount-- }
-});
-
-Ajax.Base = Class.create({
- initialize: function(options) {
- this.options = {
- method: 'post',
- asynchronous: true,
- contentType: 'application/x-www-form-urlencoded',
- encoding: 'UTF-8',
- parameters: '',
- evalJSON: true,
- evalJS: true
- };
- Object.extend(this.options, options || { });
-
- this.options.method = this.options.method.toLowerCase();
- if (Object.isString(this.options.parameters))
- this.options.parameters = this.options.parameters.toQueryParams();
- }
-});
-
-Ajax.Request = Class.create(Ajax.Base, {
- _complete: false,
-
- initialize: function($super, url, options) {
- $super(options);
- this.transport = Ajax.getTransport();
- this.request(url);
- },
-
- request: function(url) {
- this.url = url;
- this.method = this.options.method;
- var params = Object.clone(this.options.parameters);
-
- if (!['get', 'post'].include(this.method)) {
- // simulate other verbs over post
- params['_method'] = this.method;
- this.method = 'post';
- }
-
- this.parameters = params;
-
- if (params = Object.toQueryString(params)) {
- // when GET, append parameters to URL
- if (this.method == 'get')
- this.url += (this.url.include('?') ? '&' : '?') + params;
- else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
- params += '&_=';
- }
-
- try {
- var response = new Ajax.Response(this);
- if (this.options.onCreate) this.options.onCreate(response);
- Ajax.Responders.dispatch('onCreate', this, response);
-
- this.transport.open(this.method.toUpperCase(), this.url,
- this.options.asynchronous);
-
- if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
-
- this.transport.onreadystatechange = this.onStateChange.bind(this);
- this.setRequestHeaders();
-
- this.body = this.method == 'post' ? (this.options.postBody || params) : null;
- this.transport.send(this.body);
-
- /* Force Firefox to handle ready state 4 for synchronous requests */
- if (!this.options.asynchronous && this.transport.overrideMimeType)
- this.onStateChange();
-
- }
- catch (e) {
- this.dispatchException(e);
- }
- },
-
- onStateChange: function() {
- var readyState = this.transport.readyState;
- if (readyState > 1 && !((readyState == 4) && this._complete))
- this.respondToReadyState(this.transport.readyState);
- },
-
- setRequestHeaders: function() {
- var headers = {
- 'X-Requested-With': 'XMLHttpRequest',
- 'X-Prototype-Version': Prototype.Version,
- 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
- };
-
- if (this.method == 'post') {
- headers['Content-type'] = this.options.contentType +
- (this.options.encoding ? '; charset=' + this.options.encoding : '');
-
- /* Force "Connection: close" for older Mozilla browsers to work
- * around a bug where XMLHttpRequest sends an incorrect
- * Content-length header. See Mozilla Bugzilla #246651.
- */
- if (this.transport.overrideMimeType &&
- (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
- headers['Connection'] = 'close';
- }
-
- // user-defined headers
- if (typeof this.options.requestHeaders == 'object') {
- var extras = this.options.requestHeaders;
-
- if (Object.isFunction(extras.push))
- for (var i = 0, length = extras.length; i < length; i += 2)
- headers[extras[i]] = extras[i+1];
- else
- $H(extras).each(function(pair) { headers[pair.key] = pair.value });
- }
-
- for (var name in headers)
- this.transport.setRequestHeader(name, headers[name]);
- },
-
- success: function() {
- var status = this.getStatus();
- return !status || (status >= 200 && status < 300);
- },
-
- getStatus: function() {
- try {
- return this.transport.status || 0;
- } catch (e) { return 0 }
- },
-
- respondToReadyState: function(readyState) {
- var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
-
- if (state == 'Complete') {
- try {
- this._complete = true;
- (this.options['on' + response.status]
- || this.options['on' + (this.success() ? 'Success' : 'Failure')]
- || Prototype.emptyFunction)(response, response.headerJSON);
- } catch (e) {
- this.dispatchException(e);
- }
-
- var contentType = response.getHeader('Content-type');
- if (this.options.evalJS == 'force'
- || (this.options.evalJS && contentType
- && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
- this.evalResponse();
- }
-
- try {
- (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
- Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
- } catch (e) {
- this.dispatchException(e);
- }
-
- if (state == 'Complete') {
- // avoid memory leak in MSIE: clean up
- this.transport.onreadystatechange = Prototype.emptyFunction;
- }
- },
-
- getHeader: function(name) {
- try {
- return this.transport.getResponseHeader(name);
- } catch (e) { return null }
- },
-
- evalResponse: function() {
- try {
- return eval((this.transport.responseText || '').unfilterJSON());
- } catch (e) {
- this.dispatchException(e);
- }
- },
-
- dispatchException: function(exception) {
- (this.options.onException || Prototype.emptyFunction)(this, exception);
- Ajax.Responders.dispatch('onException', this, exception);
- }
-});
-
-Ajax.Request.Events =
- ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
-
-Ajax.Response = Class.create({
- initialize: function(request){
- this.request = request;
- var transport = this.transport = request.transport,
- readyState = this.readyState = transport.readyState;
-
- if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
- this.status = this.getStatus();
- this.statusText = this.getStatusText();
- this.responseText = String.interpret(transport.responseText);
- this.headerJSON = this._getHeaderJSON();
- }
-
- if(readyState == 4) {
- var xml = transport.responseXML;
- this.responseXML = xml === undefined ? null : xml;
- this.responseJSON = this._getResponseJSON();
- }
- },
-
- status: 0,
- statusText: '',
-
- getStatus: Ajax.Request.prototype.getStatus,
-
- getStatusText: function() {
- try {
- return this.transport.statusText || '';
- } catch (e) { return '' }
- },
-
- getHeader: Ajax.Request.prototype.getHeader,
-
- getAllHeaders: function() {
- try {
- return this.getAllResponseHeaders();
- } catch (e) { return null }
- },
-
- getResponseHeader: function(name) {
- return this.transport.getResponseHeader(name);
- },
-
- getAllResponseHeaders: function() {
- return this.transport.getAllResponseHeaders();
- },
-
- _getHeaderJSON: function() {
- var json = this.getHeader('X-JSON');
- if (!json) return null;
- json = decodeURIComponent(escape(json));
- try {
- return json.evalJSON(this.request.options.sanitizeJSON);
- } catch (e) {
- this.request.dispatchException(e);
- }
- },
-
- _getResponseJSON: function() {
- var options = this.request.options;
- if (!options.evalJSON || (options.evalJSON != 'force' &&
- !(this.getHeader('Content-type') || '').include('application/json')))
- return null;
- try {
- return this.transport.responseText.evalJSON(options.sanitizeJSON);
- } catch (e) {
- this.request.dispatchException(e);
- }
- }
-});
-
-Ajax.Updater = Class.create(Ajax.Request, {
- initialize: function($super, container, url, options) {
- this.container = {
- success: (container.success || container),
- failure: (container.failure || (container.success ? null : container))
- };
-
- options = options || { };
- var onComplete = options.onComplete;
- options.onComplete = (function(response, param) {
- this.updateContent(response.responseText);
- if (Object.isFunction(onComplete)) onComplete(response, param);
- }).bind(this);
-
- $super(url, options);
- },
-
- updateContent: function(responseText) {
- var receiver = this.container[this.success() ? 'success' : 'failure'],
- options = this.options;
-
- if (!options.evalScripts) responseText = responseText.stripScripts();
-
- if (receiver = $(receiver)) {
- if (options.insertion) {
- if (Object.isString(options.insertion)) {
- var insertion = { }; insertion[options.insertion] = responseText;
- receiver.insert(insertion);
- }
- else options.insertion(receiver, responseText);
- }
- else receiver.update(responseText);
- }
-
- if (this.success()) {
- if (this.onComplete) this.onComplete.bind(this).defer();
- }
- }
-});
-
-Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
- initialize: function($super, container, url, options) {
- $super(options);
- this.onComplete = this.options.onComplete;
-
- this.frequency = (this.options.frequency || 2);
- this.decay = (this.options.decay || 1);
-
- this.updater = { };
- this.container = container;
- this.url = url;
-
- this.start();
- },
-
- start: function() {
- this.options.onComplete = this.updateComplete.bind(this);
- this.onTimerEvent();
- },
-
- stop: function() {
- this.updater.options.onComplete = undefined;
- clearTimeout(this.timer);
- (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
- },
-
- updateComplete: function(response) {
- if (this.options.decay) {
- this.decay = (response.responseText == this.lastText ?
- this.decay * this.options.decay : 1);
-
- this.lastText = response.responseText;
- }
- this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
- },
-
- onTimerEvent: function() {
- this.updater = new Ajax.Updater(this.container, this.url, this.options);
- }
-});
-function $(element) {
- if (arguments.length > 1) {
- for (var i = 0, elements = [], length = arguments.length; i < length; i++)
- elements.push($(arguments[i]));
- return elements;
- }
- if (Object.isString(element))
- element = document.getElementById(element);
- return Element.extend(element);
-}
-
-if (Prototype.BrowserFeatures.XPath) {
- document._getElementsByXPath = function(expression, parentElement) {
- var results = [];
- var query = document.evaluate(expression, $(parentElement) || document,
- null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
- for (var i = 0, length = query.snapshotLength; i < length; i++)
- results.push(Element.extend(query.snapshotItem(i)));
- return results;
- };
-}
-
-/*--------------------------------------------------------------------------*/
-
-if (!window.Node) var Node = { };
-
-if (!Node.ELEMENT_NODE) {
- // DOM level 2 ECMAScript Language Binding
- Object.extend(Node, {
- ELEMENT_NODE: 1,
- ATTRIBUTE_NODE: 2,
- TEXT_NODE: 3,
- CDATA_SECTION_NODE: 4,
- ENTITY_REFERENCE_NODE: 5,
- ENTITY_NODE: 6,
- PROCESSING_INSTRUCTION_NODE: 7,
- COMMENT_NODE: 8,
- DOCUMENT_NODE: 9,
- DOCUMENT_TYPE_NODE: 10,
- DOCUMENT_FRAGMENT_NODE: 11,
- NOTATION_NODE: 12
- });
-}
-
-(function() {
- var element = this.Element;
- this.Element = function(tagName, attributes) {
- attributes = attributes || { };
- tagName = tagName.toLowerCase();
- var cache = Element.cache;
- if (Prototype.Browser.IE && attributes.name) {
- tagName = '<' + tagName + ' name="' + attributes.name + '">';
- delete attributes.name;
- return Element.writeAttribute(document.createElement(tagName), attributes);
- }
- if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
- return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
- };
- Object.extend(this.Element, element || { });
-}).call(window);
-
-Element.cache = { };
-
-Element.Methods = {
- visible: function(element) {
- return $(element).style.display != 'none';
- },
-
- toggle: function(element) {
- element = $(element);
- Element[Element.visible(element) ? 'hide' : 'show'](element);
- return element;
- },
-
- hide: function(element) {
- $(element).style.display = 'none';
- return element;
- },
-
- show: function(element) {
- $(element).style.display = '';
- return element;
- },
-
- remove: function(element) {
- element = $(element);
- element.parentNode.removeChild(element);
- return element;
- },
-
- update: function(element, content) {
- element = $(element);
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) return element.update().insert(content);
- content = Object.toHTML(content);
- element.innerHTML = content.stripScripts();
- content.evalScripts.bind(content).defer();
- return element;
- },
-
- replace: function(element, content) {
- element = $(element);
- if (content && content.toElement) content = content.toElement();
- else if (!Object.isElement(content)) {
- content = Object.toHTML(content);
- var range = element.ownerDocument.createRange();
- range.selectNode(element);
- content.evalScripts.bind(content).defer();
- content = range.createContextualFragment(content.stripScripts());
- }
- element.parentNode.replaceChild(content, element);
- return element;
- },
-
- insert: function(element, insertions) {
- element = $(element);
-
- if (Object.isString(insertions) || Object.isNumber(insertions) ||
- Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
- insertions = {bottom:insertions};
-
- var content, t, range;
-
- for (position in insertions) {
- content = insertions[position];
- position = position.toLowerCase();
- t = Element._insertionTranslations[position];
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) {
- t.insert(element, content);
- continue;
- }
-
- content = Object.toHTML(content);
-
- range = element.ownerDocument.createRange();
- t.initializeRange(element, range);
- t.insert(element, range.createContextualFragment(content.stripScripts()));
-
- content.evalScripts.bind(content).defer();
- }
-
- return element;
- },
-
- wrap: function(element, wrapper, attributes) {
- element = $(element);
- if (Object.isElement(wrapper))
- $(wrapper).writeAttribute(attributes || { });
- else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
- else wrapper = new Element('div', wrapper);
- if (element.parentNode)
- element.parentNode.replaceChild(wrapper, element);
- wrapper.appendChild(element);
- return wrapper;
- },
-
- inspect: function(element) {
- element = $(element);
- var result = '<' + element.tagName.toLowerCase();
- $H({'id': 'id', 'className': 'class'}).each(function(pair) {
- var property = pair.first(), attribute = pair.last();
- var value = (element[property] || '').toString();
- if (value) result += ' ' + attribute + '=' + value.inspect(true);
- });
- return result + '>';
- },
-
- recursivelyCollect: function(element, property) {
- element = $(element);
- var elements = [];
- while (element = element[property])
- if (element.nodeType == 1)
- elements.push(Element.extend(element));
- return elements;
- },
-
- ancestors: function(element) {
- return $(element).recursivelyCollect('parentNode');
- },
-
- descendants: function(element) {
- return $A($(element).getElementsByTagName('*')).each(Element.extend);
- },
-
- firstDescendant: function(element) {
- element = $(element).firstChild;
- while (element && element.nodeType != 1) element = element.nextSibling;
- return $(element);
- },
-
- immediateDescendants: function(element) {
- if (!(element = $(element).firstChild)) return [];
- while (element && element.nodeType != 1) element = element.nextSibling;
- if (element) return [element].concat($(element).nextSiblings());
- return [];
- },
-
- previousSiblings: function(element) {
- return $(element).recursivelyCollect('previousSibling');
- },
-
- nextSiblings: function(element) {
- return $(element).recursivelyCollect('nextSibling');
- },
-
- siblings: function(element) {
- element = $(element);
- return element.previousSiblings().reverse().concat(element.nextSiblings());
- },
-
- match: function(element, selector) {
- if (Object.isString(selector))
- selector = new Selector(selector);
- return selector.match($(element));
- },
-
- up: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return $(element.parentNode);
- var ancestors = element.ancestors();
- return expression ? Selector.findElement(ancestors, expression, index) :
- ancestors[index || 0];
- },
-
- down: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return element.firstDescendant();
- var descendants = element.descendants();
- return expression ? Selector.findElement(descendants, expression, index) :
- descendants[index || 0];
- },
-
- previous: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
- var previousSiblings = element.previousSiblings();
- return expression ? Selector.findElement(previousSiblings, expression, index) :
- previousSiblings[index || 0];
- },
-
- next: function(element, expression, index) {
- element = $(element);
- if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
- var nextSiblings = element.nextSiblings();
- return expression ? Selector.findElement(nextSiblings, expression, index) :
- nextSiblings[index || 0];
- },
-
- select: function() {
- var args = $A(arguments), element = $(args.shift());
- return Selector.findChildElements(element, args);
- },
-
- adjacent: function() {
- var args = $A(arguments), element = $(args.shift());
- return Selector.findChildElements(element.parentNode, args).without(element);
- },
-
- identify: function(element) {
- element = $(element);
- var id = element.readAttribute('id'), self = arguments.callee;
- if (id) return id;
- do { id = 'anonymous_element_' + self.counter++ } while ($(id));
- element.writeAttribute('id', id);
- return id;
- },
-
- readAttribute: function(element, name) {
- element = $(element);
- if (Prototype.Browser.IE) {
- var t = Element._attributeTranslations.read;
- if (t.values[name]) return t.values[name](element, name);
- if (t.names[name]) name = t.names[name];
- if (name.include(':')) {
- return (!element.attributes || !element.attributes[name]) ? null :
- element.attributes[name].value;
- }
- }
- return element.getAttribute(name);
- },
-
- writeAttribute: function(element, name, value) {
- element = $(element);
- var attributes = { }, t = Element._attributeTranslations.write;
-
- if (typeof name == 'object') attributes = name;
- else attributes[name] = value === undefined ? true : value;
-
- for (var attr in attributes) {
- var name = t.names[attr] || attr, value = attributes[attr];
- if (t.values[attr]) name = t.values[attr](element, value);
- if (value === false || value === null)
- element.removeAttribute(name);
- else if (value === true)
- element.setAttribute(name, name);
- else element.setAttribute(name, value);
- }
- return element;
- },
-
- getHeight: function(element) {
- return $(element).getDimensions().height;
- },
-
- getWidth: function(element) {
- return $(element).getDimensions().width;
- },
-
- classNames: function(element) {
- return new Element.ClassNames(element);
- },
-
- hasClassName: function(element, className) {
- if (!(element = $(element))) return;
- var elementClassName = element.className;
- return (elementClassName.length > 0 && (elementClassName == className ||
- new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
- },
-
- addClassName: function(element, className) {
- if (!(element = $(element))) return;
- if (!element.hasClassName(className))
- element.className += (element.className ? ' ' : '') + className;
- return element;
- },
-
- removeClassName: function(element, className) {
- if (!(element = $(element))) return;
- element.className = element.className.replace(
- new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
- return element;
- },
-
- toggleClassName: function(element, className) {
- if (!(element = $(element))) return;
- return element[element.hasClassName(className) ?
- 'removeClassName' : 'addClassName'](className);
- },
-
- // removes whitespace-only text node children
- cleanWhitespace: function(element) {
- element = $(element);
- var node = element.firstChild;
- while (node) {
- var nextNode = node.nextSibling;
- if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
- element.removeChild(node);
- node = nextNode;
- }
- return element;
- },
-
- empty: function(element) {
- return $(element).innerHTML.blank();
- },
-
- descendantOf: function(element, ancestor) {
- element = $(element), ancestor = $(ancestor);
-
- if (element.compareDocumentPosition)
- return (element.compareDocumentPosition(ancestor) & 8) === 8;
-
- if (element.sourceIndex && !Prototype.Browser.Opera) {
- var e = element.sourceIndex, a = ancestor.sourceIndex,
- nextAncestor = ancestor.nextSibling;
- if (!nextAncestor) {
- do { ancestor = ancestor.parentNode; }
- while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode);
- }
- if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex);
- }
-
- while (element = element.parentNode)
- if (element == ancestor) return true;
- return false;
- },
-
- scrollTo: function(element) {
- element = $(element);
- var pos = element.cumulativeOffset();
- window.scrollTo(pos[0], pos[1]);
- return element;
- },
-
- getStyle: function(element, style) {
- element = $(element);
- style = style == 'float' ? 'cssFloat' : style.camelize();
- var value = element.style[style];
- if (!value) {
- var css = document.defaultView.getComputedStyle(element, null);
- value = css ? css[style] : null;
- }
- if (style == 'opacity') return value ? parseFloat(value) : 1.0;
- return value == 'auto' ? null : value;
- },
-
- getOpacity: function(element) {
- return $(element).getStyle('opacity');
- },
-
- setStyle: function(element, styles) {
- element = $(element);
- var elementStyle = element.style, match;
- if (Object.isString(styles)) {
- element.style.cssText += ';' + styles;
- return styles.include('opacity') ?
- element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
- }
- for (var property in styles)
- if (property == 'opacity') element.setOpacity(styles[property]);
- else
- elementStyle[(property == 'float' || property == 'cssFloat') ?
- (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
- property] = styles[property];
-
- return element;
- },
-
- setOpacity: function(element, value) {
- element = $(element);
- element.style.opacity = (value == 1 || value === '') ? '' :
- (value < 0.00001) ? 0 : value;
- return element;
- },
-
- getDimensions: function(element) {
- element = $(element);
- var display = $(element).getStyle('display');
- if (display != 'none' && display != null) // Safari bug
- return {width: element.offsetWidth, height: element.offsetHeight};
-
- // All *Width and *Height properties give 0 on elements with display none,
- // so enable the element temporarily
- var els = element.style;
- var originalVisibility = els.visibility;
- var originalPosition = els.position;
- var originalDisplay = els.display;
- els.visibility = 'hidden';
- els.position = 'absolute';
- els.display = 'block';
- var originalWidth = element.clientWidth;
- var originalHeight = element.clientHeight;
- els.display = originalDisplay;
- els.position = originalPosition;
- els.visibility = originalVisibility;
- return {width: originalWidth, height: originalHeight};
- },
-
- makePositioned: function(element) {
- element = $(element);
- var pos = Element.getStyle(element, 'position');
- if (pos == 'static' || !pos) {
- element._madePositioned = true;
- element.style.position = 'relative';
- // Opera returns the offset relative to the positioning context, when an
- // element is position relative but top and left have not been defined
- if (window.opera) {
- element.style.top = 0;
- element.style.left = 0;
- }
- }
- return element;
- },
-
- undoPositioned: function(element) {
- element = $(element);
- if (element._madePositioned) {
- element._madePositioned = undefined;
- element.style.position =
- element.style.top =
- element.style.left =
- element.style.bottom =
- element.style.right = '';
- }
- return element;
- },
-
- makeClipping: function(element) {
- element = $(element);
- if (element._overflow) return element;
- element._overflow = Element.getStyle(element, 'overflow') || 'auto';
- if (element._overflow !== 'hidden')
- element.style.overflow = 'hidden';
- return element;
- },
-
- undoClipping: function(element) {
- element = $(element);
- if (!element._overflow) return element;
- element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
- element._overflow = null;
- return element;
- },
-
- cumulativeOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- element = element.offsetParent;
- } while (element);
- return Element._returnOffset(valueL, valueT);
- },
-
- positionedOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- element = element.offsetParent;
- if (element) {
- if (element.tagName == 'BODY') break;
- var p = Element.getStyle(element, 'position');
- if (p == 'relative' || p == 'absolute') break;
- }
- } while (element);
- return Element._returnOffset(valueL, valueT);
- },
-
- absolutize: function(element) {
- element = $(element);
- if (element.getStyle('position') == 'absolute') return;
- // Position.prepare(); // To be done manually by Scripty when it needs it.
-
- var offsets = element.positionedOffset();
- var top = offsets[1];
- var left = offsets[0];
- var width = element.clientWidth;
- var height = element.clientHeight;
-
- element._originalLeft = left - parseFloat(element.style.left || 0);
- element._originalTop = top - parseFloat(element.style.top || 0);
- element._originalWidth = element.style.width;
- element._originalHeight = element.style.height;
-
- element.style.position = 'absolute';
- element.style.top = top + 'px';
- element.style.left = left + 'px';
- element.style.width = width + 'px';
- element.style.height = height + 'px';
- return element;
- },
-
- relativize: function(element) {
- element = $(element);
- if (element.getStyle('position') == 'relative') return;
- // Position.prepare(); // To be done manually by Scripty when it needs it.
-
- element.style.position = 'relative';
- var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
- var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
-
- element.style.top = top + 'px';
- element.style.left = left + 'px';
- element.style.height = element._originalHeight;
- element.style.width = element._originalWidth;
- return element;
- },
-
- cumulativeScrollOffset: function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.scrollTop || 0;
- valueL += element.scrollLeft || 0;
- element = element.parentNode;
- } while (element);
- return Element._returnOffset(valueL, valueT);
- },
-
- getOffsetParent: function(element) {
- if (element.offsetParent) return $(element.offsetParent);
- if (element == document.body) return $(element);
-
- while ((element = element.parentNode) && element != document.body)
- if (Element.getStyle(element, 'position') != 'static')
- return $(element);
-
- return $(document.body);
- },
-
- viewportOffset: function(forElement) {
- var valueT = 0, valueL = 0;
-
- var element = forElement;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
-
- // Safari fix
- if (element.offsetParent == document.body &&
- Element.getStyle(element, 'position') == 'absolute') break;
-
- } while (element = element.offsetParent);
-
- element = forElement;
- do {
- if (!Prototype.Browser.Opera || element.tagName == 'BODY') {
- valueT -= element.scrollTop || 0;
- valueL -= element.scrollLeft || 0;
- }
- } while (element = element.parentNode);
-
- return Element._returnOffset(valueL, valueT);
- },
-
- clonePosition: function(element, source) {
- var options = Object.extend({
- setLeft: true,
- setTop: true,
- setWidth: true,
- setHeight: true,
- offsetTop: 0,
- offsetLeft: 0
- }, arguments[2] || { });
-
- // find page position of source
- source = $(source);
- var p = source.viewportOffset();
-
- // find coordinate system to use
- element = $(element);
- var delta = [0, 0];
- var parent = null;
- // delta [0,0] will do fine with position: fixed elements,
- // position:absolute needs offsetParent deltas
- if (Element.getStyle(element, 'position') == 'absolute') {
- parent = element.getOffsetParent();
- delta = parent.viewportOffset();
- }
-
- // correct by body offsets (fixes Safari)
- if (parent == document.body) {
- delta[0] -= document.body.offsetLeft;
- delta[1] -= document.body.offsetTop;
- }
-
- // set position
- if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
- if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
- if (options.setWidth) element.style.width = source.offsetWidth + 'px';
- if (options.setHeight) element.style.height = source.offsetHeight + 'px';
- return element;
- }
-};
-
-Element.Methods.identify.counter = 1;
-
-Object.extend(Element.Methods, {
- getElementsBySelector: Element.Methods.select,
- childElements: Element.Methods.immediateDescendants
-});
-
-Element._attributeTranslations = {
- write: {
- names: {
- className: 'class',
- htmlFor: 'for'
- },
- values: { }
- }
-};
-
-
-if (!document.createRange || Prototype.Browser.Opera) {
- Element.Methods.insert = function(element, insertions) {
- element = $(element);
-
- if (Object.isString(insertions) || Object.isNumber(insertions) ||
- Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
- insertions = { bottom: insertions };
-
- var t = Element._insertionTranslations, content, position, pos, tagName;
-
- for (position in insertions) {
- content = insertions[position];
- position = position.toLowerCase();
- pos = t[position];
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) {
- pos.insert(element, content);
- continue;
- }
-
- content = Object.toHTML(content);
- tagName = ((position == 'before' || position == 'after')
- ? element.parentNode : element).tagName.toUpperCase();
-
- if (t.tags[tagName]) {
- var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
- if (position == 'top' || position == 'after') fragments.reverse();
- fragments.each(pos.insert.curry(element));
- }
- else element.insertAdjacentHTML(pos.adjacency, content.stripScripts());
-
- content.evalScripts.bind(content).defer();
- }
-
- return element;
- };
-}
-
-if (Prototype.Browser.Opera) {
- Element.Methods._getStyle = Element.Methods.getStyle;
- Element.Methods.getStyle = function(element, style) {
- switch(style) {
- case 'left':
- case 'top':
- case 'right':
- case 'bottom':
- if (Element._getStyle(element, 'position') == 'static') return null;
- default: return Element._getStyle(element, style);
- }
- };
- Element.Methods._readAttribute = Element.Methods.readAttribute;
- Element.Methods.readAttribute = function(element, attribute) {
- if (attribute == 'title') return element.title;
- return Element._readAttribute(element, attribute);
- };
-}
-
-else if (Prototype.Browser.IE) {
- $w('positionedOffset getOffsetParent viewportOffset').each(function(method) {
- Element.Methods[method] = Element.Methods[method].wrap(
- function(proceed, element) {
- element = $(element);
- var position = element.getStyle('position');
- if (position != 'static') return proceed(element);
- element.setStyle({ position: 'relative' });
- var value = proceed(element);
- element.setStyle({ position: position });
- return value;
- }
- );
- });
-
- Element.Methods.getStyle = function(element, style) {
- element = $(element);
- style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
- var value = element.style[style];
- if (!value && element.currentStyle) value = element.currentStyle[style];
-
- if (style == 'opacity') {
- if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
- if (value[1]) return parseFloat(value[1]) / 100;
- return 1.0;
- }
-
- if (value == 'auto') {
- if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
- return element['offset' + style.capitalize()] + 'px';
- return null;
- }
- return value;
- };
-
- Element.Methods.setOpacity = function(element, value) {
- function stripAlpha(filter){
- return filter.replace(/alpha\([^\)]*\)/gi,'');
- }
- element = $(element);
- var currentStyle = element.currentStyle;
- if ((currentStyle && !currentStyle.hasLayout) ||
- (!currentStyle && element.style.zoom == 'normal'))
- element.style.zoom = 1;
-
- var filter = element.getStyle('filter'), style = element.style;
- if (value == 1 || value === '') {
- (filter = stripAlpha(filter)) ?
- style.filter = filter : style.removeAttribute('filter');
- return element;
- } else if (value < 0.00001) value = 0;
- style.filter = stripAlpha(filter) +
- 'alpha(opacity=' + (value * 100) + ')';
- return element;
- };
-
- Element._attributeTranslations = {
- read: {
- names: {
- 'class': 'className',
- 'for': 'htmlFor'
- },
- values: {
- _getAttr: function(element, attribute) {
- return element.getAttribute(attribute, 2);
- },
- _getAttrNode: function(element, attribute) {
- var node = element.getAttributeNode(attribute);
- return node ? node.value : "";
- },
- _getEv: function(element, attribute) {
- var attribute = element.getAttribute(attribute);
- return attribute ? attribute.toString().slice(23, -2) : null;
- },
- _flag: function(element, attribute) {
- return $(element).hasAttribute(attribute) ? attribute : null;
- },
- style: function(element) {
- return element.style.cssText.toLowerCase();
- },
- title: function(element) {
- return element.title;
- }
- }
- }
- };
-
- Element._attributeTranslations.write = {
- names: Object.clone(Element._attributeTranslations.read.names),
- values: {
- checked: function(element, value) {
- element.checked = !!value;
- },
-
- style: function(element, value) {
- element.style.cssText = value ? value : '';
- }
- }
- };
-
- Element._attributeTranslations.has = {};
-
- $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
- 'encType maxLength readOnly longDesc').each(function(attr) {
- Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
- Element._attributeTranslations.has[attr.toLowerCase()] = attr;
- });
-
- (function(v) {
- Object.extend(v, {
- href: v._getAttr,
- src: v._getAttr,
- type: v._getAttr,
- action: v._getAttrNode,
- disabled: v._flag,
- checked: v._flag,
- readonly: v._flag,
- multiple: v._flag,
- onload: v._getEv,
- onunload: v._getEv,
- onclick: v._getEv,
- ondblclick: v._getEv,
- onmousedown: v._getEv,
- onmouseup: v._getEv,
- onmouseover: v._getEv,
- onmousemove: v._getEv,
- onmouseout: v._getEv,
- onfocus: v._getEv,
- onblur: v._getEv,
- onkeypress: v._getEv,
- onkeydown: v._getEv,
- onkeyup: v._getEv,
- onsubmit: v._getEv,
- onreset: v._getEv,
- onselect: v._getEv,
- onchange: v._getEv
- });
- })(Element._attributeTranslations.read.values);
-}
-
-else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
- Element.Methods.setOpacity = function(element, value) {
- element = $(element);
- element.style.opacity = (value == 1) ? 0.999999 :
- (value === '') ? '' : (value < 0.00001) ? 0 : value;
- return element;
- };
-}
-
-else if (Prototype.Browser.WebKit) {
- Element.Methods.setOpacity = function(element, value) {
- element = $(element);
- element.style.opacity = (value == 1 || value === '') ? '' :
- (value < 0.00001) ? 0 : value;
-
- if (value == 1)
- if(element.tagName == 'IMG' && element.width) {
- element.width++; element.width--;
- } else try {
- var n = document.createTextNode(' ');
- element.appendChild(n);
- element.removeChild(n);
- } catch (e) { }
-
- return element;
- };
-
- // Safari returns margins on body which is incorrect if the child is absolutely
- // positioned. For performance reasons, redefine Position.cumulativeOffset for
- // KHTML/WebKit only.
- Element.Methods.cumulativeOffset = function(element) {
- var valueT = 0, valueL = 0;
- do {
- valueT += element.offsetTop || 0;
- valueL += element.offsetLeft || 0;
- if (element.offsetParent == document.body)
- if (Element.getStyle(element, 'position') == 'absolute') break;
-
- element = element.offsetParent;
- } while (element);
-
- return Element._returnOffset(valueL, valueT);
- };
-}
-
-if (Prototype.Browser.IE || Prototype.Browser.Opera) {
- // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
- Element.Methods.update = function(element, content) {
- element = $(element);
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) return element.update().insert(content);
-
- content = Object.toHTML(content);
- var tagName = element.tagName.toUpperCase();
-
- if (tagName in Element._insertionTranslations.tags) {
- $A(element.childNodes).each(function(node) { element.removeChild(node) });
- Element._getContentFromAnonymousElement(tagName, content.stripScripts())
- .each(function(node) { element.appendChild(node) });
- }
- else element.innerHTML = content.stripScripts();
-
- content.evalScripts.bind(content).defer();
- return element;
- };
-}
-
-if (document.createElement('div').outerHTML) {
- Element.Methods.replace = function(element, content) {
- element = $(element);
-
- if (content && content.toElement) content = content.toElement();
- if (Object.isElement(content)) {
- element.parentNode.replaceChild(content, element);
- return element;
- }
-
- content = Object.toHTML(content);
- var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
-
- if (Element._insertionTranslations.tags[tagName]) {
- var nextSibling = element.next();
- var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
- parent.removeChild(element);
- if (nextSibling)
- fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
- else
- fragments.each(function(node) { parent.appendChild(node) });
- }
- else element.outerHTML = content.stripScripts();
-
- content.evalScripts.bind(content).defer();
- return element;
- };
-}
-
-Element._returnOffset = function(l, t) {
- var result = [l, t];
- result.left = l;
- result.top = t;
- return result;
-};
-
-Element._getContentFromAnonymousElement = function(tagName, html) {
- var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
- div.innerHTML = t[0] + html + t[1];
- t[2].times(function() { div = div.firstChild });
- return $A(div.childNodes);
-};
-
-Element._insertionTranslations = {
- before: {
- adjacency: 'beforeBegin',
- insert: function(element, node) {
- element.parentNode.insertBefore(node, element);
- },
- initializeRange: function(element, range) {
- range.setStartBefore(element);
- }
- },
- top: {
- adjacency: 'afterBegin',
- insert: function(element, node) {
- element.insertBefore(node, element.firstChild);
- },
- initializeRange: function(element, range) {
- range.selectNodeContents(element);
- range.collapse(true);
- }
- },
- bottom: {
- adjacency: 'beforeEnd',
- insert: function(element, node) {
- element.appendChild(node);
- }
- },
- after: {
- adjacency: 'afterEnd',
- insert: function(element, node) {
- element.parentNode.insertBefore(node, element.nextSibling);
- },
- initializeRange: function(element, range) {
- range.setStartAfter(element);
- }
- },
- tags: {
- TABLE: ['<table>', '</table>', 1],
- TBODY: ['<table><tbody>', '</tbody></table>', 2],
- TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
- TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
- SELECT: ['<select>', '</select>', 1]
- }
-};
-
-(function() {
- this.bottom.initializeRange = this.top.initializeRange;
- Object.extend(this.tags, {
- THEAD: this.tags.TBODY,
- TFOOT: this.tags.TBODY,
- TH: this.tags.TD
- });
-}).call(Element._insertionTranslations);
-
-Element.Methods.Simulated = {
- hasAttribute: function(element, attribute) {
- attribute = Element._attributeTranslations.has[attribute] || attribute;
- var node = $(element).getAttributeNode(attribute);
- return node && node.specified;
- }
-};
-
-Element.Methods.ByTag = { };
-
-Object.extend(Element, Element.Methods);
-
-if (!Prototype.BrowserFeatures.ElementExtensions &&
- document.createElement('div').__proto__) {
- window.HTMLElement = { };
- window.HTMLElement.prototype = document.createElement('div').__proto__;
- Prototype.BrowserFeatures.ElementExtensions = true;
-}
-
-Element.extend = (function() {
- if (Prototype.BrowserFeatures.SpecificElementExtensions)
- return Prototype.K;
-
- var Methods = { }, ByTag = Element.Methods.ByTag;
-
- var extend = Object.extend(function(element) {
- if (!element || element._extendedByPrototype ||
- element.nodeType != 1 || element == window) return element;
-
- var methods = Object.clone(Methods),
- tagName = element.tagName, property, value;
-
- // extend methods for specific tags
- if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
-
- for (property in methods) {
- value = methods[property];
- if (Object.isFunction(value) && !(property in element))
- element[property] = value.methodize();
- }
-
- element._extendedByPrototype = Prototype.emptyFunction;
- return element;
-
- }, {
- refresh: function() {
- // extend methods for all tags (Safari doesn't need this)
- if (!Prototype.BrowserFeatures.ElementExtensions) {
- Object.extend(Methods, Element.Methods);
- Object.extend(Methods, Element.Methods.Simulated);
- }
- }
- });
-
- extend.refresh();
- return extend;
-})();
-
-Element.hasAttribute = function(element, attribute) {
- if (element.hasAttribute) return element.hasAttribute(attribute);
- return Element.Methods.Simulated.hasAttribute(element, attribute);
-};
-
-Element.addMethods = function(methods) {
- var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
-
- if (!methods) {
- Object.extend(Form, Form.Methods);
- Object.extend(Form.Element, Form.Element.Methods);
- Object.extend(Element.Methods.ByTag, {
- "FORM": Object.clone(Form.Methods),
- "INPUT": Object.clone(Form.Element.Methods),
- "SELECT": Object.clone(Form.Element.Methods),
- "TEXTAREA": Object.clone(Form.Element.Methods)
- });
- }
-
- if (arguments.length == 2) {
- var tagName = methods;
- methods = arguments[1];
- }
-
- if (!tagName) Object.extend(Element.Methods, methods || { });
- else {
- if (Object.isArray(tagName)) tagName.each(extend);
- else extend(tagName);
- }
-
- function extend(tagName) {
- tagName = tagName.toUpperCase();
- if (!Element.Methods.ByTag[tagName])
- Element.Methods.ByTag[tagName] = { };
- Object.extend(Element.Methods.ByTag[tagName], methods);
- }
-
- function copy(methods, destination, onlyIfAbsent) {
- onlyIfAbsent = onlyIfAbsent || false;
- for (var property in methods) {
- var value = methods[property];
- if (!Object.isFunction(value)) continue;
- if (!onlyIfAbsent || !(property in destination))
- destination[property] = value.methodize();
- }
- }
-
- function findDOMClass(tagName) {
- var klass;
- var trans = {
- "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
- "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
- "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
- "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
- "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
- "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
- "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
- "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
- "FrameSet", "IFRAME": "IFrame"
- };
- if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
- if (window[klass]) return window[klass];
- klass = 'HTML' + tagName + 'Element';
- if (window[klass]) return window[klass];
- klass = 'HTML' + tagName.capitalize() + 'Element';
- if (window[klass]) return window[klass];
-
- window[klass] = { };
- window[klass].prototype = document.createElement(tagName).__proto__;
- return window[klass];
- }
-
- if (F.ElementExtensions) {
- copy(Element.Methods, HTMLElement.prototype);
- copy(Element.Methods.Simulated, HTMLElement.prototype, true);
- }
-
- if (F.SpecificElementExtensions) {
- for (var tag in Element.Methods.ByTag) {
- var klass = findDOMClass(tag);
- if (Object.isUndefined(klass)) continue;
- copy(T[tag], klass.prototype);
- }
- }
-
- Object.extend(Element, Element.Methods);
- delete Element.ByTag;
-
- if (Element.extend.refresh) Element.extend.refresh();
- Element.cache = { };
-};
-
-document.viewport = {
- getDimensions: function() {
- var dimensions = { };
- $w('width height').each(function(d) {
- var D = d.capitalize();
- dimensions[d] = self['inner' + D] ||
- (document.documentElement['client' + D] || document.body['client' + D]);
- });
- return dimensions;
- },
-
- getWidth: function() {
- return this.getDimensions().width;
- },
-
- getHeight: function() {
- return this.getDimensions().height;
- },
-
- getScrollOffsets: function() {
- return Element._returnOffset(
- window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
- window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
- }
-};
-/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
- * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
- * license. Please see http://www.yui-ext.com/ for more information. */
-
-var Selector = Class.create({
- initialize: function(expression) {
- this.expression = expression.strip();
- this.compileMatcher();
- },
-
- compileMatcher: function() {
- // Selectors with namespaced attributes can't use the XPath version
- if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression))
- return this.compileXPathMatcher();
-
- var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
- c = Selector.criteria, le, p, m;
-
- if (Selector._cache[e]) {
- this.matcher = Selector._cache[e];
- return;
- }
-
- this.matcher = ["this.matcher = function(root) {",
- "var r = root, h = Selector.handlers, c = false, n;"];
-
- while (e && le != e && (/\S/).test(e)) {
- le = e;
- for (var i in ps) {
- p = ps[i];
- if (m = e.match(p)) {
- this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
- new Template(c[i]).evaluate(m));
- e = e.replace(m[0], '');
- break;
- }
- }
- }
-
- this.matcher.push("return h.unique(n);\n}");
- eval(this.matcher.join('\n'));
- Selector._cache[this.expression] = this.matcher;
- },
-
- compileXPathMatcher: function() {
- var e = this.expression, ps = Selector.patterns,
- x = Selector.xpath, le, m;
-
- if (Selector._cache[e]) {
- this.xpath = Selector._cache[e]; return;
- }
-
- this.matcher = ['.//*'];
- while (e && le != e && (/\S/).test(e)) {
- le = e;
- for (var i in ps) {
- if (m = e.match(ps[i])) {
- this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
- new Template(x[i]).evaluate(m));
- e = e.replace(m[0], '');
- break;
- }
- }
- }
-
- this.xpath = this.matcher.join('');
- Selector._cache[this.expression] = this.xpath;
- },
-
- findElements: function(root) {
- root = root || document;
- if (this.xpath) return document._getElementsByXPath(this.xpath, root);
- return this.matcher(root);
- },
-
- match: function(element) {
- this.tokens = [];
-
- var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
- var le, p, m;
-
- while (e && le !== e && (/\S/).test(e)) {
- le = e;
- for (var i in ps) {
- p = ps[i];
- if (m = e.match(p)) {
- // use the Selector.assertions methods unless the selector
- // is too complex.
- if (as[i]) {
- this.tokens.push([i, Object.clone(m)]);
- e = e.replace(m[0], '');
- } else {
- // reluctantly do a document-wide search
- // and look for a match in the array
- return this.findElements(document).include(element);
- }
- }
- }
- }
-
- var match = true, name, matches;
- for (var i = 0, token; token = this.tokens[i]; i++) {
- name = token[0], matches = token[1];
- if (!Selector.assertions[name](element, matches)) {
- match = false; break;
- }
- }
-
- return match;
- },
-
- toString: function() {
- return this.expression;
- },
-
- inspect: function() {
- return "#<Selector:" + this.expression.inspect() + ">";
- }
-});
-
-Object.extend(Selector, {
- _cache: { },
-
- xpath: {
- descendant: "//*",
- child: "/*",
- adjacent: "/following-sibling::*[1]",
- laterSibling: '/following-sibling::*',
- tagName: function(m) {
- if (m[1] == '*') return '';
- return "[local-name()='" + m[1].toLowerCase() +
- "' or local-name()='" + m[1].toUpperCase() + "']";
- },
- className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
- id: "[@id='#{1}']",
- attrPresence: "[@#{1}]",
- attr: function(m) {
- m[3] = m[5] || m[6];
- return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
- },
- pseudo: function(m) {
- var h = Selector.xpath.pseudos[m[1]];
- if (!h) return '';
- if (Object.isFunction(h)) return h(m);
- return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
- },
- operators: {
- '=': "[@#{1}='#{3}']",
- '!=': "[@#{1}!='#{3}']",
- '^=': "[starts-with(@#{1}, '#{3}')]",
- '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
- '*=': "[contains(@#{1}, '#{3}')]",
- '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
- '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
- },
- pseudos: {
- 'first-child': '[not(preceding-sibling::*)]',
- 'last-child': '[not(following-sibling::*)]',
- 'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
- 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
- 'checked': "[@checked]",
- 'disabled': "[@disabled]",
- 'enabled': "[not(@disabled)]",
- 'not': function(m) {
- var e = m[6], p = Selector.patterns,
- x = Selector.xpath, le, m, v;
-
- var exclusion = [];
- while (e && le != e && (/\S/).test(e)) {
- le = e;
- for (var i in p) {
- if (m = e.match(p[i])) {
- v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
- exclusion.push("(" + v.substring(1, v.length - 1) + ")");
- e = e.replace(m[0], '');
- break;
- }
- }
- }
- return "[not(" + exclusion.join(" and ") + ")]";
- },
- 'nth-child': function(m) {
- return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
- },
- 'nth-last-child': function(m) {
- return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
- },
- 'nth-of-type': function(m) {
- return Selector.xpath.pseudos.nth("position() ", m);
- },
- 'nth-last-of-type': function(m) {
- return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
- },
- 'first-of-type': function(m) {
- m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
- },
- 'last-of-type': function(m) {
- m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
- },
- 'only-of-type': function(m) {
- var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
- },
- nth: function(fragment, m) {
- var mm, formula = m[6], predicate;
- if (formula == 'even') formula = '2n+0';
- if (formula == 'odd') formula = '2n+1';
- if (mm = formula.match(/^(\d+)$/)) // digit only
- return '[' + fragment + "= " + mm[1] + ']';
- if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
- if (mm[1] == "-") mm[1] = -1;
- var a = mm[1] ? Number(mm[1]) : 1;
- var b = mm[2] ? Number(mm[2]) : 0;
- predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
- "((#{fragment} - #{b}) div #{a} >= 0)]";
- return new Template(predicate).evaluate({
- fragment: fragment, a: a, b: b });
- }
- }
- }
- },
-
- criteria: {
- tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
- className: 'n = h.className(n, r, "#{1}", c); c = false;',
- id: 'n = h.id(n, r, "#{1}", c); c = false;',
- attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;',
- attr: function(m) {
- m[3] = (m[5] || m[6]);
- return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
- },
- pseudo: function(m) {
- if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
- return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
- },
- descendant: 'c = "descendant";',
- child: 'c = "child";',
- adjacent: 'c = "adjacent";',
- laterSibling: 'c = "laterSibling";'
- },
-
- patterns: {
- // combinators must be listed first
- // (and descendant needs to be last combinator)
- laterSibling: /^\s*~\s*/,
- child: /^\s*>\s*/,
- adjacent: /^\s*\+\s*/,
- descendant: /^\s/,
-
- // selectors follow
- tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
- id: /^#([\w\-\*]+)(\b|$)/,
- className: /^\.([\w\-\*]+)(\b|$)/,
- pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,
- attrPresence: /^\[([\w]+)\]/,
- attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
- },
-
- // for Selector.match and Element#match
- assertions: {
- tagName: function(element, matches) {
- return matches[1].toUpperCase() == element.tagName.toUpperCase();
- },
-
- className: function(element, matches) {
- return Element.hasClassName(element, matches[1]);
- },
-
- id: function(element, matches) {
- return element.id === matches[1];
- },
-
- attrPresence: function(element, matches) {
- return Element.hasAttribute(element, matches[1]);
- },
-
- attr: function(element, matches) {
- var nodeValue = Element.readAttribute(element, matches[1]);
- return Selector.operators[matches[2]](nodeValue, matches[3]);
- }
- },
-
- handlers: {
- // UTILITY FUNCTIONS
- // joins two collections
- concat: function(a, b) {
- for (var i = 0, node; node = b[i]; i++)
- a.push(node);
- return a;
- },
-
- // marks an array of nodes for counting
- mark: function(nodes) {
- for (var i = 0, node; node = nodes[i]; i++)
- node._counted = true;
- return nodes;
- },
-
- unmark: function(nodes) {
- for (var i = 0, node; node = nodes[i]; i++)
- node._counted = undefined;
- return nodes;
- },
-
- // mark each child node with its position (for nth calls)
- // "ofType" flag indicates whether we're indexing for nth-of-type
- // rather than nth-child
- index: function(parentNode, reverse, ofType) {
- parentNode._counted = true;
- if (reverse) {
- for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
- var node = nodes[i];
- if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
- }
- } else {
- for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
- if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
- }
- },
-
- // filters out duplicates and extends all nodes
- unique: function(nodes) {
- if (nodes.length == 0) return nodes;
- var results = [], n;
- for (var i = 0, l = nodes.length; i < l; i++)
- if (!(n = nodes[i])._counted) {
- n._counted = true;
- results.push(Element.extend(n));
- }
- return Selector.handlers.unmark(results);
- },
-
- // COMBINATOR FUNCTIONS
- descendant: function(nodes) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- h.concat(results, node.getElementsByTagName('*'));
- return results;
- },
-
- child: function(nodes) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- for (var j = 0, children = [], child; child = node.childNodes[j]; j++)
- if (child.nodeType == 1 && child.tagName != '!') results.push(child);
- }
- return results;
- },
-
- adjacent: function(nodes) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- var next = this.nextElementSibling(node);
- if (next) results.push(next);
- }
- return results;
- },
-
- laterSibling: function(nodes) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- h.concat(results, Element.nextSiblings(node));
- return results;
- },
-
- nextElementSibling: function(node) {
- while (node = node.nextSibling)
- if (node.nodeType == 1) return node;
- return null;
- },
-
- previousElementSibling: function(node) {
- while (node = node.previousSibling)
- if (node.nodeType == 1) return node;
- return null;
- },
-
- // TOKEN FUNCTIONS
- tagName: function(nodes, root, tagName, combinator) {
- tagName = tagName.toUpperCase();
- var results = [], h = Selector.handlers;
- if (nodes) {
- if (combinator) {
- // fastlane for ordinary descendant combinators
- if (combinator == "descendant") {
- for (var i = 0, node; node = nodes[i]; i++)
- h.concat(results, node.getElementsByTagName(tagName));
- return results;
- } else nodes = this[combinator](nodes);
- if (tagName == "*") return nodes;
- }
- for (var i = 0, node; node = nodes[i]; i++)
- if (node.tagName.toUpperCase() == tagName) results.push(node);
- return results;
- } else return root.getElementsByTagName(tagName);
- },
-
- id: function(nodes, root, id, combinator) {
- var targetNode = $(id), h = Selector.handlers;
- if (!targetNode) return [];
- if (!nodes && root == document) return [targetNode];
- if (nodes) {
- if (combinator) {
- if (combinator == 'child') {
- for (var i = 0, node; node = nodes[i]; i++)
- if (targetNode.parentNode == node) return [targetNode];
- } else if (combinator == 'descendant') {
- for (var i = 0, node; node = nodes[i]; i++)
- if (Element.descendantOf(targetNode, node)) return [targetNode];
- } else if (combinator == 'adjacent') {
- for (var i = 0, node; node = nodes[i]; i++)
- if (Selector.handlers.previousElementSibling(targetNode) == node)
- return [targetNode];
- } else nodes = h[combinator](nodes);
- }
- for (var i = 0, node; node = nodes[i]; i++)
- if (node == targetNode) return [targetNode];
- return [];
- }
- return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
- },
-
- className: function(nodes, root, className, combinator) {
- if (nodes && combinator) nodes = this[combinator](nodes);
- return Selector.handlers.byClassName(nodes, root, className);
- },
-
- byClassName: function(nodes, root, className) {
- if (!nodes) nodes = Selector.handlers.descendant([root]);
- var needle = ' ' + className + ' ';
- for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
- nodeClassName = node.className;
- if (nodeClassName.length == 0) continue;
- if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
- results.push(node);
- }
- return results;
- },
-
- attrPresence: function(nodes, root, attr) {
- if (!nodes) nodes = root.getElementsByTagName("*");
- var results = [];
- for (var i = 0, node; node = nodes[i]; i++)
- if (Element.hasAttribute(node, attr)) results.push(node);
- return results;
- },
-
- attr: function(nodes, root, attr, value, operator) {
- if (!nodes) nodes = root.getElementsByTagName("*");
- var handler = Selector.operators[operator], results = [];
- for (var i = 0, node; node = nodes[i]; i++) {
- var nodeValue = Element.readAttribute(node, attr);
- if (nodeValue === null) continue;
- if (handler(nodeValue, value)) results.push(node);
- }
- return results;
- },
-
- pseudo: function(nodes, name, value, root, combinator) {
- if (nodes && combinator) nodes = this[combinator](nodes);
- if (!nodes) nodes = root.getElementsByTagName("*");
- return Selector.pseudos[name](nodes, value, root);
- }
- },
-
- pseudos: {
- 'first-child': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- if (Selector.handlers.previousElementSibling(node)) continue;
- results.push(node);
- }
- return results;
- },
- 'last-child': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- if (Selector.handlers.nextElementSibling(node)) continue;
- results.push(node);
- }
- return results;
- },
- 'only-child': function(nodes, value, root) {
- var h = Selector.handlers;
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
- results.push(node);
- return results;
- },
- 'nth-child': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root);
- },
- 'nth-last-child': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root, true);
- },
- 'nth-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root, false, true);
- },
- 'nth-last-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, formula, root, true, true);
- },
- 'first-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, "1", root, false, true);
- },
- 'last-of-type': function(nodes, formula, root) {
- return Selector.pseudos.nth(nodes, "1", root, true, true);
- },
- 'only-of-type': function(nodes, formula, root) {
- var p = Selector.pseudos;
- return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
- },
-
- // handles the an+b logic
- getIndices: function(a, b, total) {
- if (a == 0) return b > 0 ? [b] : [];
- return $R(1, total).inject([], function(memo, i) {
- if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
- return memo;
- });
- },
-
- // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
- nth: function(nodes, formula, root, reverse, ofType) {
- if (nodes.length == 0) return [];
- if (formula == 'even') formula = '2n+0';
- if (formula == 'odd') formula = '2n+1';
- var h = Selector.handlers, results = [], indexed = [], m;
- h.mark(nodes);
- for (var i = 0, node; node = nodes[i]; i++) {
- if (!node.parentNode._counted) {
- h.index(node.parentNode, reverse, ofType);
- indexed.push(node.parentNode);
- }
- }
- if (formula.match(/^\d+$/)) { // just a number
- formula = Number(formula);
- for (var i = 0, node; node = nodes[i]; i++)
- if (node.nodeIndex == formula) results.push(node);
- } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
- if (m[1] == "-") m[1] = -1;
- var a = m[1] ? Number(m[1]) : 1;
- var b = m[2] ? Number(m[2]) : 0;
- var indices = Selector.pseudos.getIndices(a, b, nodes.length);
- for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
- for (var j = 0; j < l; j++)
- if (node.nodeIndex == indices[j]) results.push(node);
- }
- }
- h.unmark(nodes);
- h.unmark(indexed);
- return results;
- },
-
- 'empty': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++) {
- // IE treats comments as element nodes
- if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
- results.push(node);
- }
- return results;
- },
-
- 'not': function(nodes, selector, root) {
- var h = Selector.handlers, selectorType, m;
- var exclusions = new Selector(selector).findElements(root);
- h.mark(exclusions);
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (!node._counted) results.push(node);
- h.unmark(exclusions);
- return results;
- },
-
- 'enabled': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (!node.disabled) results.push(node);
- return results;
- },
-
- 'disabled': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (node.disabled) results.push(node);
- return results;
- },
-
- 'checked': function(nodes, value, root) {
- for (var i = 0, results = [], node; node = nodes[i]; i++)
- if (node.checked) results.push(node);
- return results;
- }
- },
-
- operators: {
- '=': function(nv, v) { return nv == v; },
- '!=': function(nv, v) { return nv != v; },
- '^=': function(nv, v) { return nv.startsWith(v); },
- '$=': function(nv, v) { return nv.endsWith(v); },
- '*=': function(nv, v) { return nv.include(v); },
- '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
- '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
- },
-
- matchElements: function(elements, expression) {
- var matches = new Selector(expression).findElements(), h = Selector.handlers;
- h.mark(matches);
- for (var i = 0, results = [], element; element = elements[i]; i++)
- if (element._counted) results.push(element);
- h.unmark(matches);
- return results;
- },
-
- findElement: function(elements, expression, index) {
- if (Object.isNumber(expression)) {
- index = expression; expression = false;
- }
- return Selector.matchElements(elements, expression || '*')[index || 0];
- },
-
- findChildElements: function(element, expressions) {
- var exprs = expressions.join(','), expressions = [];
- exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
- expressions.push(m[1].strip());
- });
- var results = [], h = Selector.handlers;
- for (var i = 0, l = expressions.length, selector; i < l; i++) {
- selector = new Selector(expressions[i].strip());
- h.concat(results, selector.findElements(element));
- }
- return (l > 1) ? h.unique(results) : results;
- }
-});
-
-function $$() {
- return Selector.findChildElements(document, $A(arguments));
-}
-var Form = {
- reset: function(form) {
- $(form).reset();
- return form;
- },
-
- serializeElements: function(elements, options) {
- if (typeof options != 'object') options = { hash: !!options };
- else if (options.hash === undefined) options.hash = true;
- var key, value, submitted = false, submit = options.submit;
-
- var data = elements.inject({ }, function(result, element) {
- if (!element.disabled && element.name) {
- key = element.name; value = $(element).getValue();
- if (value != null && (element.type != 'submit' || (!submitted &&
- submit !== false && (!submit || key == submit) && (submitted = true)))) {
- if (key in result) {
- // a key is already present; construct an array of values
- if (!Object.isArray(result[key])) result[key] = [result[key]];
- result[key].push(value);
- }
- else result[key] = value;
- }
- }
- return result;
- });
-
- return options.hash ? data : Object.toQueryString(data);
- }
-};
-
-Form.Methods = {
- serialize: function(form, options) {
- return Form.serializeElements(Form.getElements(form), options);
- },
-
- getElements: function(form) {
- return $A($(form).getElementsByTagName('*')).inject([],
- function(elements, child) {
- if (Form.Element.Serializers[child.tagName.toLowerCase()])
- elements.push(Element.extend(child));
- return elements;
- }
- );
- },
-
- getInputs: function(form, typeName, name) {
- form = $(form);
- var inputs = form.getElementsByTagName('input');
-
- if (!typeName && !name) return $A(inputs).map(Element.extend);
-
- for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
- var input = inputs[i];
- if ((typeName && input.type != typeName) || (name && input.name != name))
- continue;
- matchingInputs.push(Element.extend(input));
- }
-
- return matchingInputs;
- },
-
- disable: function(form) {
- form = $(form);
- Form.getElements(form).invoke('disable');
- return form;
- },
-
- enable: function(form) {
- form = $(form);
- Form.getElements(form).invoke('enable');
- return form;
- },
-
- findFirstElement: function(form) {
- var elements = $(form).getElements().findAll(function(element) {
- return 'hidden' != element.type && !element.disabled;
- });
- var firstByIndex = elements.findAll(function(element) {
- return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
- }).sortBy(function(element) { return element.tabIndex }).first();
-
- return firstByIndex ? firstByIndex : elements.find(function(element) {
- return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
- });
- },
-
- focusFirstElement: function(form) {
- form = $(form);
- form.findFirstElement().activate();
- return form;
- },
-
- request: function(form, options) {
- form = $(form), options = Object.clone(options || { });
-
- var params = options.parameters, action = form.readAttribute('action') || '';
- if (action.blank()) action = window.location.href;
- options.parameters = form.serialize(true);
-
- if (params) {
- if (Object.isString(params)) params = params.toQueryParams();
- Object.extend(options.parameters, params);
- }
-
- if (form.hasAttribute('method') && !options.method)
- options.method = form.method;
-
- return new Ajax.Request(action, options);
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-Form.Element = {
- focus: function(element) {
- $(element).focus();
- return element;
- },
-
- select: function(element) {
- $(element).select();
- return element;
- }
-};
-
-Form.Element.Methods = {
- serialize: function(element) {
- element = $(element);
- if (!element.disabled && element.name) {
- var value = element.getValue();
- if (value != undefined) {
- var pair = { };
- pair[element.name] = value;
- return Object.toQueryString(pair);
- }
- }
- return '';
- },
-
- getValue: function(element) {
- element = $(element);
- var method = element.tagName.toLowerCase();
- return Form.Element.Serializers[method](element);
- },
-
- setValue: function(element, value) {
- element = $(element);
- var method = element.tagName.toLowerCase();
- Form.Element.Serializers[method](element, value);
- return element;
- },
-
- clear: function(element) {
- $(element).value = '';
- return element;
- },
-
- present: function(element) {
- return $(element).value != '';
- },
-
- activate: function(element) {
- element = $(element);
- try {
- element.focus();
- if (element.select && (element.tagName.toLowerCase() != 'input' ||
- !['button', 'reset', 'submit'].include(element.type)))
- element.select();
- } catch (e) { }
- return element;
- },
-
- disable: function(element) {
- element = $(element);
- element.blur();
- element.disabled = true;
- return element;
- },
-
- enable: function(element) {
- element = $(element);
- element.disabled = false;
- return element;
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-var Field = Form.Element;
-var $F = Form.Element.Methods.getValue;
-
-/*--------------------------------------------------------------------------*/
-
-Form.Element.Serializers = {
- input: function(element, value) {
- switch (element.type.toLowerCase()) {
- case 'checkbox':
- case 'radio':
- return Form.Element.Serializers.inputSelector(element, value);
- default:
- return Form.Element.Serializers.textarea(element, value);
- }
- },
-
- inputSelector: function(element, value) {
- if (value === undefined) return element.checked ? element.value : null;
- else element.checked = !!value;
- },
-
- textarea: function(element, value) {
- if (value === undefined) return element.value;
- else element.value = value;
- },
-
- select: function(element, index) {
- if (index === undefined)
- return this[element.type == 'select-one' ?
- 'selectOne' : 'selectMany'](element);
- else {
- var opt, value, single = !Object.isArray(index);
- for (var i = 0, length = element.length; i < length; i++) {
- opt = element.options[i];
- value = this.optionValue(opt);
- if (single) {
- if (value == index) {
- opt.selected = true;
- return;
- }
- }
- else opt.selected = index.include(value);
- }
- }
- },
-
- selectOne: function(element) {
- var index = element.selectedIndex;
- return index >= 0 ? this.optionValue(element.options[index]) : null;
- },
-
- selectMany: function(element) {
- var values, length = element.length;
- if (!length) return null;
-
- for (var i = 0, values = []; i < length; i++) {
- var opt = element.options[i];
- if (opt.selected) values.push(this.optionValue(opt));
- }
- return values;
- },
-
- optionValue: function(opt) {
- // extend element because hasAttribute may not be native
- return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
- initialize: function($super, element, frequency, callback) {
- $super(callback, frequency);
- this.element = $(element);
- this.lastValue = this.getValue();
- },
-
- execute: function() {
- var value = this.getValue();
- if (Object.isString(this.lastValue) && Object.isString(value) ?
- this.lastValue != value : String(this.lastValue) != String(value)) {
- this.callback(this.element, value);
- this.lastValue = value;
- }
- }
-});
-
-Form.Element.Observer = Class.create(Abstract.TimedObserver, {
- getValue: function() {
- return Form.Element.getValue(this.element);
- }
-});
-
-Form.Observer = Class.create(Abstract.TimedObserver, {
- getValue: function() {
- return Form.serialize(this.element);
- }
-});
-
-/*--------------------------------------------------------------------------*/
-
-Abstract.EventObserver = Class.create({
- initialize: function(element, callback) {
- this.element = $(element);
- this.callback = callback;
-
- this.lastValue = this.getValue();
- if (this.element.tagName.toLowerCase() == 'form')
- this.registerFormCallbacks();
- else
- this.registerCallback(this.element);
- },
-
- onElementEvent: function() {
- var value = this.getValue();
- if (this.lastValue != value) {
- this.callback(this.element, value);
- this.lastValue = value;
- }
- },
-
- registerFormCallbacks: function() {
- Form.getElements(this.element).each(this.registerCallback, this);
- },
-
- registerCallback: function(element) {
- if (element.type) {
- switch (element.type.toLowerCase()) {
- case 'checkbox':
- case 'radio':
- Event.observe(element, 'click', this.onElementEvent.bind(this));
- break;
- default:
- Event.observe(element, 'change', this.onElementEvent.bind(this));
- break;
- }
- }
- }
-});
-
-Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
- getValue: function() {
- return Form.Element.getValue(this.element);
- }
-});
-
-Form.EventObserver = Class.create(Abstract.EventObserver, {
- getValue: function() {
- return Form.serialize(this.element);
- }
-});
-if (!window.Event) var Event = { };
-
-Object.extend(Event, {
- KEY_BACKSPACE: 8,
- KEY_TAB: 9,
- KEY_RETURN: 13,
- KEY_ESC: 27,
- KEY_LEFT: 37,
- KEY_UP: 38,
- KEY_RIGHT: 39,
- KEY_DOWN: 40,
- KEY_DELETE: 46,
- KEY_HOME: 36,
- KEY_END: 35,
- KEY_PAGEUP: 33,
- KEY_PAGEDOWN: 34,
- KEY_INSERT: 45,
-
- cache: { },
-
- relatedTarget: function(event) {
- var element;
- switch(event.type) {
- case 'mouseover': element = event.fromElement; break;
- case 'mouseout': element = event.toElement; break;
- default: return null;
- }
- return Element.extend(element);
- }
-});
-
-Event.Methods = (function() {
- var isButton;
-
- if (Prototype.Browser.IE) {
- var buttonMap = { 0: 1, 1: 4, 2: 2 };
- isButton = function(event, code) {
- return event.button == buttonMap[code];
- };
-
- } else if (Prototype.Browser.WebKit) {
- isButton = function(event, code) {
- switch (code) {
- case 0: return event.which == 1 && !event.metaKey;
- case 1: return event.which == 1 && event.metaKey;
- default: return false;
- }
- };
-
- } else {
- isButton = function(event, code) {
- return event.which ? (event.which === code + 1) : (event.button === code);
- };
- }
-
- return {
- isLeftClick: function(event) { return isButton(event, 0) },
- isMiddleClick: function(event) { return isButton(event, 1) },
- isRightClick: function(event) { return isButton(event, 2) },
-
- element: function(event) {
- var node = Event.extend(event).target;
- return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node);
- },
-
- findElement: function(event, expression) {
- var element = Event.element(event);
- return element.match(expression) ? element : element.up(expression);
- },
-
- pointer: function(event) {
- return {
- x: event.pageX || (event.clientX +
- (document.documentElement.scrollLeft || document.body.scrollLeft)),
- y: event.pageY || (event.clientY +
- (document.documentElement.scrollTop || document.body.scrollTop))
- };
- },
-
- pointerX: function(event) { return Event.pointer(event).x },
- pointerY: function(event) { return Event.pointer(event).y },
-
- stop: function(event) {
- Event.extend(event);
- event.preventDefault();
- event.stopPropagation();
- event.stopped = true;
- }
- };
-})();
-
-Event.extend = (function() {
- var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
- m[name] = Event.Methods[name].methodize();
- return m;
- });
-
- if (Prototype.Browser.IE) {
- Object.extend(methods, {
- stopPropagation: function() { this.cancelBubble = true },
- preventDefault: function() { this.returnValue = false },
- inspect: function() { return "[object Event]" }
- });
-
- return function(event) {
- if (!event) return false;
- if (event._extendedByPrototype) return event;
-
- event._extendedByPrototype = Prototype.emptyFunction;
- var pointer = Event.pointer(event);
- Object.extend(event, {
- target: event.srcElement,
- relatedTarget: Event.relatedTarget(event),
- pageX: pointer.x,
- pageY: pointer.y
- });
- return Object.extend(event, methods);
- };
-
- } else {
- Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__;
- Object.extend(Event.prototype, methods);
- return Prototype.K;
- }
-})();
-
-Object.extend(Event, (function() {
- var cache = Event.cache;
-
- function getEventID(element) {
- if (element._eventID) return element._eventID;
- arguments.callee.id = arguments.callee.id || 1;
- return element._eventID = ++arguments.callee.id;
- }
-
- function getDOMEventName(eventName) {
- if (eventName && eventName.include(':')) return "dataavailable";
- return eventName;
- }
-
- function getCacheForID(id) {
- return cache[id] = cache[id] || { };
- }
-
- function getWrappersForEventName(id, eventName) {
- var c = getCacheForID(id);
- return c[eventName] = c[eventName] || [];
- }
-
- function createWrapper(element, eventName, handler) {
- var id = getEventID(element);
- var c = getWrappersForEventName(id, eventName);
- if (c.pluck("handler").include(handler)) return false;
-
- var wrapper = function(event) {
- if (!Event || !Event.extend ||
- (event.eventName && event.eventName != eventName))
- return false;
-
- Event.extend(event);
- handler.call(element, event)
- };
-
- wrapper.handler = handler;
- c.push(wrapper);
- return wrapper;
- }
-
- function findWrapper(id, eventName, handler) {
- var c = getWrappersForEventName(id, eventName);
- return c.find(function(wrapper) { return wrapper.handler == handler });
- }
-
- function destroyWrapper(id, eventName, handler) {
- var c = getCacheForID(id);
- if (!c[eventName]) return false;
- c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
- }
-
- function destroyCache() {
- for (var id in cache)
- for (var eventName in cache[id])
- cache[id][eventName] = null;
- }
-
- if (window.attachEvent) {
- window.attachEvent("onunload", destroyCache);
- }
-
- return {
- observe: function(element, eventName, handler) {
- element = $(element);
- var name = getDOMEventName(eventName);
-
- var wrapper = createWrapper(element, eventName, handler);
- if (!wrapper) return element;
-
- if (element.addEventListener) {
- element.addEventListener(name, wrapper, false);
- } else {
- element.attachEvent("on" + name, wrapper);
- }
-
- return element;
- },
-
- stopObserving: function(element, eventName, handler) {
- element = $(element);
- var id = getEventID(element), name = getDOMEventName(eventName);
-
- if (!handler && eventName) {
- getWrappersForEventName(id, eventName).each(function(wrapper) {
- element.stopObserving(eventName, wrapper.handler);
- });
- return element;
-
- } else if (!eventName) {
- Object.keys(getCacheForID(id)).each(function(eventName) {
- element.stopObserving(eventName);
- });
- return element;
- }
-
- var wrapper = findWrapper(id, eventName, handler);
- if (!wrapper) return element;
-
- if (element.removeEventListener) {
- element.removeEventListener(name, wrapper, false);
- } else {
- element.detachEvent("on" + name, wrapper);
- }
-
- destroyWrapper(id, eventName, handler);
-
- return element;
- },
-
- fire: function(element, eventName, memo) {
- element = $(element);
- if (element == document && document.createEvent && !element.dispatchEvent)
- element = document.documentElement;
-
- if (document.createEvent) {
- var event = document.createEvent("HTMLEvents");
- event.initEvent("dataavailable", true, true);
- } else {
- var event = document.createEventObject();
- event.eventType = "ondataavailable";
- }
-
- event.eventName = eventName;
- event.memo = memo || { };
-
- if (document.createEvent) {
- element.dispatchEvent(event);
- } else {
- element.fireEvent(event.eventType, event);
- }
-
- return event;
- }
- };
-})());
-
-Object.extend(Event, Event.Methods);
-
-Element.addMethods({
- fire: Event.fire,
- observe: Event.observe,
- stopObserving: Event.stopObserving
-});
-
-Object.extend(document, {
- fire: Element.Methods.fire.methodize(),
- observe: Element.Methods.observe.methodize(),
- stopObserving: Element.Methods.stopObserving.methodize()
-});
-
-(function() {
- /* Support for the DOMContentLoaded event is based on work by Dan Webb,
- Matthias Miller, Dean Edwards and John Resig. */
-
- var timer, fired = false;
-
- function fireContentLoadedEvent() {
- if (fired) return;
- if (timer) window.clearInterval(timer);
- document.fire("dom:loaded");
- fired = true;
- }
-
- if (document.addEventListener) {
- if (Prototype.Browser.WebKit) {
- timer = window.setInterval(function() {
- if (/loaded|complete/.test(document.readyState))
- fireContentLoadedEvent();
- }, 0);
-
- Event.observe(window, "load", fireContentLoadedEvent);
-
- } else {
- document.addEventListener("DOMContentLoaded",
- fireContentLoadedEvent, false);
- }
-
- } else {
- document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
- $("__onDOMContentLoaded").onreadystatechange = function() {
- if (this.readyState == "complete") {
- this.onreadystatechange = null;
- fireContentLoadedEvent();
- }
- };
- }
-})();
-/*------------------------------- DEPRECATED -------------------------------*/
-
-Hash.toQueryString = Object.toQueryString;
-
-var Toggle = { display: Element.toggle };
-
-Element.Methods.childOf = Element.Methods.descendantOf;
-
-var Insertion = {
- Before: function(element, content) {
- return Element.insert(element, {before:content});
- },
-
- Top: function(element, content) {
- return Element.insert(element, {top:content});
- },
-
- Bottom: function(element, content) {
- return Element.insert(element, {bottom:content});
- },
-
- After: function(element, content) {
- return Element.insert(element, {after:content});
- }
-};
-
-var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
-
-// This should be moved to script.aculo.us; notice the deprecated methods
-// further below, that map to the newer Element methods.
-var Position = {
- // set to true if needed, warning: firefox performance problems
- // NOT neeeded for page scrolling, only if draggable contained in
- // scrollable elements
- includeScrollOffsets: false,
-
- // must be called before calling withinIncludingScrolloffset, every time the
- // page is scrolled
- prepare: function() {
- this.deltaX = window.pageXOffset
- || document.documentElement.scrollLeft
- || document.body.scrollLeft
- || 0;
- this.deltaY = window.pageYOffset
- || document.documentElement.scrollTop
- || document.body.scrollTop
- || 0;
- },
-
- // caches x/y coordinate pair to use with overlap
- within: function(element, x, y) {
- if (this.includeScrollOffsets)
- return this.withinIncludingScrolloffsets(element, x, y);
- this.xcomp = x;
- this.ycomp = y;
- this.offset = Element.cumulativeOffset(element);
-
- return (y >= this.offset[1] &&
- y < this.offset[1] + element.offsetHeight &&
- x >= this.offset[0] &&
- x < this.offset[0] + element.offsetWidth);
- },
-
- withinIncludingScrolloffsets: function(element, x, y) {
- var offsetcache = Element.cumulativeScrollOffset(element);
-
- this.xcomp = x + offsetcache[0] - this.deltaX;
- this.ycomp = y + offsetcache[1] - this.deltaY;
- this.offset = Element.cumulativeOffset(element);
-
- return (this.ycomp >= this.offset[1] &&
- this.ycomp < this.offset[1] + element.offsetHeight &&
- this.xcomp >= this.offset[0] &&
- this.xcomp < this.offset[0] + element.offsetWidth);
- },
-
- // within must be called directly before
- overlap: function(mode, element) {
- if (!mode) return 0;
- if (mode == 'vertical')
- return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
- element.offsetHeight;
- if (mode == 'horizontal')
- return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
- element.offsetWidth;
- },
-
- // Deprecation layer -- use newer Element methods now (1.5.2).
-
- cumulativeOffset: Element.Methods.cumulativeOffset,
-
- positionedOffset: Element.Methods.positionedOffset,
-
- absolutize: function(element) {
- Position.prepare();
- return Element.absolutize(element);
- },
-
- relativize: function(element) {
- Position.prepare();
- return Element.relativize(element);
- },
-
- realOffset: Element.Methods.cumulativeScrollOffset,
-
- offsetParent: Element.Methods.getOffsetParent,
-
- page: Element.Methods.viewportOffset,
-
- clone: function(source, target, options) {
- options = options || { };
- return Element.clonePosition(target, source, options);
- }
-};
-
-/*--------------------------------------------------------------------------*/
-
-if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
- function iter(name) {
- return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
- }
-
- instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
- function(element, className) {
- className = className.toString().strip();
- var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
- return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
- } : function(element, className) {
- className = className.toString().strip();
- var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
- if (!classNames && !className) return elements;
-
- var nodes = $(element).getElementsByTagName('*');
- className = ' ' + className + ' ';
-
- for (var i = 0, child, cn; child = nodes[i]; i++) {
- if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
- (classNames && classNames.all(function(name) {
- return !name.toString().blank() && cn.include(' ' + name + ' ');
- }))))
- elements.push(Element.extend(child));
- }
- return elements;
- };
-
- return function(className, parentElement) {
- return $(parentElement || document.body).getElementsByClassName(className);
- };
-}(Element.Methods);
-
-/*--------------------------------------------------------------------------*/
-
-Element.ClassNames = Class.create();
-Element.ClassNames.prototype = {
- initialize: function(element) {
- this.element = $(element);
- },
-
- _each: function(iterator) {
- this.element.className.split(/\s+/).select(function(name) {
- return name.length > 0;
- })._each(iterator);
- },
-
- set: function(className) {
- this.element.className = className;
- },
-
- add: function(classNameToAdd) {
- if (this.include(classNameToAdd)) return;
- this.set($A(this).concat(classNameToAdd).join(' '));
- },
-
- remove: function(classNameToRemove) {
- if (!this.include(classNameToRemove)) return;
- this.set($A(this).without(classNameToRemove).join(' '));
- },
-
- toString: function() {
- return $A(this).join(' ');
- }
-};
-
-Object.extend(Element.ClassNames.prototype, Enumerable);
-
-/*--------------------------------------------------------------------------*/
-
+/* Prototype JavaScript framework, version 1.6.0
+ * (c) 2005-2007 Sam Stephenson
+ *
+ * Prototype is freely distributable under the terms of an MIT-style license.
+ * For details, see the Prototype web site: http://www.prototypejs.org/
+ *
+ *--------------------------------------------------------------------------*/
+
+var Prototype = {
+ Version: '1.6.0',
+
+ Browser: {
+ IE: !!(window.attachEvent && !window.opera),
+ Opera: !!window.opera,
+ WebKit: navigator.userAgent.indexOf('AppleWebKit/') > -1,
+ Gecko: navigator.userAgent.indexOf('Gecko') > -1 && navigator.userAgent.indexOf('KHTML') == -1,
+ MobileSafari: !!navigator.userAgent.match(/Apple.*Mobile.*Safari/)
+ },
+
+ BrowserFeatures: {
+ XPath: !!document.evaluate,
+ ElementExtensions: !!window.HTMLElement,
+ SpecificElementExtensions:
+ document.createElement('div').__proto__ &&
+ document.createElement('div').__proto__ !==
+ document.createElement('form').__proto__
+ },
+
+ ScriptFragment: '<script[^>]*>([\\S\\s]*?)<\/script>',
+ JSONFilter: /^\/\*-secure-([\s\S]*)\*\/\s*$/,
+
+ emptyFunction: function() { },
+ K: function(x) { return x }
+};
+
+if (Prototype.Browser.MobileSafari)
+ Prototype.BrowserFeatures.SpecificElementExtensions = false;
+
+if (Prototype.Browser.WebKit)
+ Prototype.BrowserFeatures.XPath = false;
+
+/* Based on Alex Arnell's inheritance implementation. */
+var Class = {
+ create: function() {
+ var parent = null, properties = $A(arguments);
+ if (Object.isFunction(properties[0]))
+ parent = properties.shift();
+
+ function klass() {
+ this.initialize.apply(this, arguments);
+ }
+
+ Object.extend(klass, Class.Methods);
+ klass.superclass = parent;
+ klass.subclasses = [];
+
+ if (parent) {
+ var subclass = function() { };
+ subclass.prototype = parent.prototype;
+ klass.prototype = new subclass;
+ parent.subclasses.push(klass);
+ }
+
+ for (var i = 0; i < properties.length; i++)
+ klass.addMethods(properties[i]);
+
+ if (!klass.prototype.initialize)
+ klass.prototype.initialize = Prototype.emptyFunction;
+
+ klass.prototype.constructor = klass;
+
+ return klass;
+ }
+};
+
+Class.Methods = {
+ addMethods: function(source) {
+ var ancestor = this.superclass && this.superclass.prototype;
+ var properties = Object.keys(source);
+
+ if (!Object.keys({ toString: true }).length)
+ properties.push("toString", "valueOf");
+
+ for (var i = 0, length = properties.length; i < length; i++) {
+ var property = properties[i], value = source[property];
+ if (ancestor && Object.isFunction(value) &&
+ value.argumentNames().first() == "$super") {
+ var method = value, value = Object.extend((function(m) {
+ return function() { return ancestor[m].apply(this, arguments) };
+ })(property).wrap(method), {
+ valueOf: function() { return method },
+ toString: function() { return method.toString() }
+ });
+ }
+ this.prototype[property] = value;
+ }
+
+ return this;
+ }
+};
+
+var Abstract = { };
+
+Object.extend = function(destination, source) {
+ for (var property in source)
+ destination[property] = source[property];
+ return destination;
+};
+
+Object.extend(Object, {
+ inspect: function(object) {
+ try {
+ if (object === undefined) return 'undefined';
+ if (object === null) return 'null';
+ return object.inspect ? object.inspect() : object.toString();
+ } catch (e) {
+ if (e instanceof RangeError) return '...';
+ throw e;
+ }
+ },
+
+ toJSON: function(object) {
+ var type = typeof object;
+ switch (type) {
+ case 'undefined':
+ case 'function':
+ case 'unknown': return;
+ case 'boolean': return object.toString();
+ }
+
+ if (object === null) return 'null';
+ if (object.toJSON) return object.toJSON();
+ if (Object.isElement(object)) return;
+
+ var results = [];
+ for (var property in object) {
+ var value = Object.toJSON(object[property]);
+ if (value !== undefined)
+ results.push(property.toJSON() + ': ' + value);
+ }
+
+ return '{' + results.join(', ') + '}';
+ },
+
+ toQueryString: function(object) {
+ return $H(object).toQueryString();
+ },
+
+ toHTML: function(object) {
+ return object && object.toHTML ? object.toHTML() : String.interpret(object);
+ },
+
+ keys: function(object) {
+ var keys = [];
+ for (var property in object)
+ keys.push(property);
+ return keys;
+ },
+
+ values: function(object) {
+ var values = [];
+ for (var property in object)
+ values.push(object[property]);
+ return values;
+ },
+
+ clone: function(object) {
+ return Object.extend({ }, object);
+ },
+
+ isElement: function(object) {
+ return object && object.nodeType == 1;
+ },
+
+ isArray: function(object) {
+ return object && object.constructor === Array;
+ },
+
+ isHash: function(object) {
+ return object instanceof Hash;
+ },
+
+ isFunction: function(object) {
+ return typeof object == "function";
+ },
+
+ isString: function(object) {
+ return typeof object == "string";
+ },
+
+ isNumber: function(object) {
+ return typeof object == "number";
+ },
+
+ isUndefined: function(object) {
+ return typeof object == "undefined";
+ }
+});
+
+Object.extend(Function.prototype, {
+ argumentNames: function() {
+ var names = this.toString().match(/^[\s\(]*function[^(]*\((.*?)\)/)[1].split(",").invoke("strip");
+ return names.length == 1 && !names[0] ? [] : names;
+ },
+
+ bind: function() {
+ if (arguments.length < 2 && arguments[0] === undefined) return this;
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function() {
+ return __method.apply(object, args.concat($A(arguments)));
+ }
+ },
+
+ bindAsEventListener: function() {
+ var __method = this, args = $A(arguments), object = args.shift();
+ return function(event) {
+ return __method.apply(object, [event || window.event].concat(args));
+ }
+ },
+
+ curry: function() {
+ if (!arguments.length) return this;
+ var __method = this, args = $A(arguments);
+ return function() {
+ return __method.apply(this, args.concat($A(arguments)));
+ }
+ },
+
+ delay: function() {
+ var __method = this, args = $A(arguments), timeout = args.shift() * 1000;
+ return window.setTimeout(function() {
+ return __method.apply(__method, args);
+ }, timeout);
+ },
+
+ wrap: function(wrapper) {
+ var __method = this;
+ return function() {
+ return wrapper.apply(this, [__method.bind(this)].concat($A(arguments)));
+ }
+ },
+
+ methodize: function() {
+ if (this._methodized) return this._methodized;
+ var __method = this;
+ return this._methodized = function() {
+ return __method.apply(null, [this].concat($A(arguments)));
+ };
+ }
+});
+
+Function.prototype.defer = Function.prototype.delay.curry(0.01);
+
+Date.prototype.toJSON = function() {
+ return '"' + this.getUTCFullYear() + '-' +
+ (this.getUTCMonth() + 1).toPaddedString(2) + '-' +
+ this.getUTCDate().toPaddedString(2) + 'T' +
+ this.getUTCHours().toPaddedString(2) + ':' +
+ this.getUTCMinutes().toPaddedString(2) + ':' +
+ this.getUTCSeconds().toPaddedString(2) + 'Z"';
+};
+
+var Try = {
+ these: function() {
+ var returnValue;
+
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ var lambda = arguments[i];
+ try {
+ returnValue = lambda();
+ break;
+ } catch (e) { }
+ }
+
+ return returnValue;
+ }
+};
+
+RegExp.prototype.match = RegExp.prototype.test;
+
+RegExp.escape = function(str) {
+ return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
+};
+
+/*--------------------------------------------------------------------------*/
+
+var PeriodicalExecuter = Class.create({
+ initialize: function(callback, frequency) {
+ this.callback = callback;
+ this.frequency = frequency;
+ this.currentlyExecuting = false;
+
+ this.registerCallback();
+ },
+
+ registerCallback: function() {
+ this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
+ },
+
+ execute: function() {
+ this.callback(this);
+ },
+
+ stop: function() {
+ if (!this.timer) return;
+ clearInterval(this.timer);
+ this.timer = null;
+ },
+
+ onTimerEvent: function() {
+ if (!this.currentlyExecuting) {
+ try {
+ this.currentlyExecuting = true;
+ this.execute();
+ } finally {
+ this.currentlyExecuting = false;
+ }
+ }
+ }
+});
+Object.extend(String, {
+ interpret: function(value) {
+ return value == null ? '' : String(value);
+ },
+ specialChar: {
+ '\b': '\\b',
+ '\t': '\\t',
+ '\n': '\\n',
+ '\f': '\\f',
+ '\r': '\\r',
+ '\\': '\\\\'
+ }
+});
+
+Object.extend(String.prototype, {
+ gsub: function(pattern, replacement) {
+ var result = '', source = this, match;
+ replacement = arguments.callee.prepareReplacement(replacement);
+
+ while (source.length > 0) {
+ if (match = source.match(pattern)) {
+ result += source.slice(0, match.index);
+ result += String.interpret(replacement(match));
+ source = source.slice(match.index + match[0].length);
+ } else {
+ result += source, source = '';
+ }
+ }
+ return result;
+ },
+
+ sub: function(pattern, replacement, count) {
+ replacement = this.gsub.prepareReplacement(replacement);
+ count = count === undefined ? 1 : count;
+
+ return this.gsub(pattern, function(match) {
+ if (--count < 0) return match[0];
+ return replacement(match);
+ });
+ },
+
+ scan: function(pattern, iterator) {
+ this.gsub(pattern, iterator);
+ return String(this);
+ },
+
+ truncate: function(length, truncation) {
+ length = length || 30;
+ truncation = truncation === undefined ? '...' : truncation;
+ return this.length > length ?
+ this.slice(0, length - truncation.length) + truncation : String(this);
+ },
+
+ strip: function() {
+ return this.replace(/^\s+/, '').replace(/\s+$/, '');
+ },
+
+ stripTags: function() {
+ return this.replace(/<\/?[^>]+>/gi, '');
+ },
+
+ stripScripts: function() {
+ return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
+ },
+
+ extractScripts: function() {
+ var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
+ var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
+ return (this.match(matchAll) || []).map(function(scriptTag) {
+ return (scriptTag.match(matchOne) || ['', ''])[1];
+ });
+ },
+
+ evalScripts: function() {
+ return this.extractScripts().map(function(script) { return eval(script) });
+ },
+
+ escapeHTML: function() {
+ var self = arguments.callee;
+ self.text.data = this;
+ return self.div.innerHTML;
+ },
+
+ unescapeHTML: function() {
+ var div = new Element('div');
+ div.innerHTML = this.stripTags();
+ return div.childNodes[0] ? (div.childNodes.length > 1 ?
+ $A(div.childNodes).inject('', function(memo, node) { return memo+node.nodeValue }) :
+ div.childNodes[0].nodeValue) : '';
+ },
+
+ toQueryParams: function(separator) {
+ var match = this.strip().match(/([^?#]*)(#.*)?$/);
+ if (!match) return { };
+
+ return match[1].split(separator || '&').inject({ }, function(hash, pair) {
+ if ((pair = pair.split('='))[0]) {
+ var key = decodeURIComponent(pair.shift());
+ var value = pair.length > 1 ? pair.join('=') : pair[0];
+ if (value != undefined) value = decodeURIComponent(value);
+
+ if (key in hash) {
+ if (!Object.isArray(hash[key])) hash[key] = [hash[key]];
+ hash[key].push(value);
+ }
+ else hash[key] = value;
+ }
+ return hash;
+ });
+ },
+
+ toArray: function() {
+ return this.split('');
+ },
+
+ succ: function() {
+ return this.slice(0, this.length - 1) +
+ String.fromCharCode(this.charCodeAt(this.length - 1) + 1);
+ },
+
+ times: function(count) {
+ return count < 1 ? '' : new Array(count + 1).join(this);
+ },
+
+ camelize: function() {
+ var parts = this.split('-'), len = parts.length;
+ if (len == 1) return parts[0];
+
+ var camelized = this.charAt(0) == '-'
+ ? parts[0].charAt(0).toUpperCase() + parts[0].substring(1)
+ : parts[0];
+
+ for (var i = 1; i < len; i++)
+ camelized += parts[i].charAt(0).toUpperCase() + parts[i].substring(1);
+
+ return camelized;
+ },
+
+ capitalize: function() {
+ return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase();
+ },
+
+ underscore: function() {
+ return this.gsub(/::/, '/').gsub(/([A-Z]+)([A-Z][a-z])/,'#{1}_#{2}').gsub(/([a-z\d])([A-Z])/,'#{1}_#{2}').gsub(/-/,'_').toLowerCase();
+ },
+
+ dasherize: function() {
+ return this.gsub(/_/,'-');
+ },
+
+ inspect: function(useDoubleQuotes) {
+ var escapedString = this.gsub(/[\x00-\x1f\\]/, function(match) {
+ var character = String.specialChar[match[0]];
+ return character ? character : '\\u00' + match[0].charCodeAt().toPaddedString(2, 16);
+ });
+ if (useDoubleQuotes) return '"' + escapedString.replace(/"/g, '\\"') + '"';
+ return "'" + escapedString.replace(/'/g, '\\\'') + "'";
+ },
+
+ toJSON: function() {
+ return this.inspect(true);
+ },
+
+ unfilterJSON: function(filter) {
+ return this.sub(filter || Prototype.JSONFilter, '#{1}');
+ },
+
+ isJSON: function() {
+ var str = this.replace(/\\./g, '@').replace(/"[^"\\\n\r]*"/g, '');
+ return (/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(str);
+ },
+
+ evalJSON: function(sanitize) {
+ var json = this.unfilterJSON();
+ try {
+ if (!sanitize || json.isJSON()) return eval('(' + json + ')');
+ } catch (e) { }
+ throw new SyntaxError('Badly formed JSON string: ' + this.inspect());
+ },
+
+ include: function(pattern) {
+ return this.indexOf(pattern) > -1;
+ },
+
+ startsWith: function(pattern) {
+ return this.indexOf(pattern) === 0;
+ },
+
+ endsWith: function(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.lastIndexOf(pattern) === d;
+ },
+
+ empty: function() {
+ return this == '';
+ },
+
+ blank: function() {
+ return /^\s*$/.test(this);
+ },
+
+ interpolate: function(object, pattern) {
+ return new Template(this, pattern).evaluate(object);
+ }
+});
+
+if (Prototype.Browser.WebKit || Prototype.Browser.IE) Object.extend(String.prototype, {
+ escapeHTML: function() {
+ return this.replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;');
+ },
+ unescapeHTML: function() {
+ return this.replace(/&amp;/g,'&').replace(/&lt;/g,'<').replace(/&gt;/g,'>');
+ }
+});
+
+String.prototype.gsub.prepareReplacement = function(replacement) {
+ if (Object.isFunction(replacement)) return replacement;
+ var template = new Template(replacement);
+ return function(match) { return template.evaluate(match) };
+};
+
+String.prototype.parseQuery = String.prototype.toQueryParams;
+
+Object.extend(String.prototype.escapeHTML, {
+ div: document.createElement('div'),
+ text: document.createTextNode('')
+});
+
+with (String.prototype.escapeHTML) div.appendChild(text);
+
+var Template = Class.create({
+ initialize: function(template, pattern) {
+ this.template = template.toString();
+ this.pattern = pattern || Template.Pattern;
+ },
+
+ evaluate: function(object) {
+ if (Object.isFunction(object.toTemplateReplacements))
+ object = object.toTemplateReplacements();
+
+ return this.template.gsub(this.pattern, function(match) {
+ if (object == null) return '';
+
+ var before = match[1] || '';
+ if (before == '\\') return match[2];
+
+ var ctx = object, expr = match[3];
+ var pattern = /^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/, match = pattern.exec(expr);
+ if (match == null) return before;
+
+ while (match != null) {
+ var comp = match[1].startsWith('[') ? match[2].gsub('\\\\]', ']') : match[1];
+ ctx = ctx[comp];
+ if (null == ctx || '' == match[3]) break;
+ expr = expr.substring('[' == match[3] ? match[1].length : match[0].length);
+ match = pattern.exec(expr);
+ }
+
+ return before + String.interpret(ctx);
+ }.bind(this));
+ }
+});
+Template.Pattern = /(^|.|\r|\n)(#\{(.*?)\})/;
+
+var $break = { };
+
+var Enumerable = {
+ each: function(iterator, context) {
+ var index = 0;
+ iterator = iterator.bind(context);
+ try {
+ this._each(function(value) {
+ iterator(value, index++);
+ });
+ } catch (e) {
+ if (e != $break) throw e;
+ }
+ return this;
+ },
+
+ eachSlice: function(number, iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var index = -number, slices = [], array = this.toArray();
+ while ((index += number) < array.length)
+ slices.push(array.slice(index, index+number));
+ return slices.collect(iterator, context);
+ },
+
+ all: function(iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var result = true;
+ this.each(function(value, index) {
+ result = result && !!iterator(value, index);
+ if (!result) throw $break;
+ });
+ return result;
+ },
+
+ any: function(iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var result = false;
+ this.each(function(value, index) {
+ if (result = !!iterator(value, index))
+ throw $break;
+ });
+ return result;
+ },
+
+ collect: function(iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var results = [];
+ this.each(function(value, index) {
+ results.push(iterator(value, index));
+ });
+ return results;
+ },
+
+ detect: function(iterator, context) {
+ iterator = iterator.bind(context);
+ var result;
+ this.each(function(value, index) {
+ if (iterator(value, index)) {
+ result = value;
+ throw $break;
+ }
+ });
+ return result;
+ },
+
+ findAll: function(iterator, context) {
+ iterator = iterator.bind(context);
+ var results = [];
+ this.each(function(value, index) {
+ if (iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ grep: function(filter, iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var results = [];
+
+ if (Object.isString(filter))
+ filter = new RegExp(filter);
+
+ this.each(function(value, index) {
+ if (filter.match(value))
+ results.push(iterator(value, index));
+ });
+ return results;
+ },
+
+ include: function(object) {
+ if (Object.isFunction(this.indexOf))
+ if (this.indexOf(object) != -1) return true;
+
+ var found = false;
+ this.each(function(value) {
+ if (value == object) {
+ found = true;
+ throw $break;
+ }
+ });
+ return found;
+ },
+
+ inGroupsOf: function(number, fillWith) {
+ fillWith = fillWith === undefined ? null : fillWith;
+ return this.eachSlice(number, function(slice) {
+ while(slice.length < number) slice.push(fillWith);
+ return slice;
+ });
+ },
+
+ inject: function(memo, iterator, context) {
+ iterator = iterator.bind(context);
+ this.each(function(value, index) {
+ memo = iterator(memo, value, index);
+ });
+ return memo;
+ },
+
+ invoke: function(method) {
+ var args = $A(arguments).slice(1);
+ return this.map(function(value) {
+ return value[method].apply(value, args);
+ });
+ },
+
+ max: function(iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator(value, index);
+ if (result == undefined || value >= result)
+ result = value;
+ });
+ return result;
+ },
+
+ min: function(iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var result;
+ this.each(function(value, index) {
+ value = iterator(value, index);
+ if (result == undefined || value < result)
+ result = value;
+ });
+ return result;
+ },
+
+ partition: function(iterator, context) {
+ iterator = iterator ? iterator.bind(context) : Prototype.K;
+ var trues = [], falses = [];
+ this.each(function(value, index) {
+ (iterator(value, index) ?
+ trues : falses).push(value);
+ });
+ return [trues, falses];
+ },
+
+ pluck: function(property) {
+ var results = [];
+ this.each(function(value) {
+ results.push(value[property]);
+ });
+ return results;
+ },
+
+ reject: function(iterator, context) {
+ iterator = iterator.bind(context);
+ var results = [];
+ this.each(function(value, index) {
+ if (!iterator(value, index))
+ results.push(value);
+ });
+ return results;
+ },
+
+ sortBy: function(iterator, context) {
+ iterator = iterator.bind(context);
+ return this.map(function(value, index) {
+ return {value: value, criteria: iterator(value, index)};
+ }).sort(function(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }).pluck('value');
+ },
+
+ toArray: function() {
+ return this.map();
+ },
+
+ zip: function() {
+ var iterator = Prototype.K, args = $A(arguments);
+ if (Object.isFunction(args.last()))
+ iterator = args.pop();
+
+ var collections = [this].concat(args).map($A);
+ return this.map(function(value, index) {
+ return iterator(collections.pluck(index));
+ });
+ },
+
+ size: function() {
+ return this.toArray().length;
+ },
+
+ inspect: function() {
+ return '#<Enumerable:' + this.toArray().inspect() + '>';
+ }
+};
+
+Object.extend(Enumerable, {
+ map: Enumerable.collect,
+ find: Enumerable.detect,
+ select: Enumerable.findAll,
+ filter: Enumerable.findAll,
+ member: Enumerable.include,
+ entries: Enumerable.toArray,
+ every: Enumerable.all,
+ some: Enumerable.any
+});
+function $A(iterable) {
+ if (!iterable) return [];
+ if (iterable.toArray) return iterable.toArray();
+ var length = iterable.length, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+}
+
+if (Prototype.Browser.WebKit) {
+ function $A(iterable) {
+ if (!iterable) return [];
+ if (!(Object.isFunction(iterable) && iterable == '[object NodeList]') &&
+ iterable.toArray) return iterable.toArray();
+ var length = iterable.length, results = new Array(length);
+ while (length--) results[length] = iterable[length];
+ return results;
+ }
+}
+
+Array.from = $A;
+
+Object.extend(Array.prototype, Enumerable);
+
+if (!Array.prototype._reverse) Array.prototype._reverse = Array.prototype.reverse;
+
+Object.extend(Array.prototype, {
+ _each: function(iterator) {
+ for (var i = 0, length = this.length; i < length; i++)
+ iterator(this[i]);
+ },
+
+ clear: function() {
+ this.length = 0;
+ return this;
+ },
+
+ first: function() {
+ return this[0];
+ },
+
+ last: function() {
+ return this[this.length - 1];
+ },
+
+ compact: function() {
+ return this.select(function(value) {
+ return value != null;
+ });
+ },
+
+ flatten: function() {
+ return this.inject([], function(array, value) {
+ return array.concat(Object.isArray(value) ?
+ value.flatten() : [value]);
+ });
+ },
+
+ without: function() {
+ var values = $A(arguments);
+ return this.select(function(value) {
+ return !values.include(value);
+ });
+ },
+
+ reverse: function(inline) {
+ return (inline !== false ? this : this.toArray())._reverse();
+ },
+
+ reduce: function() {
+ return this.length > 1 ? this : this[0];
+ },
+
+ uniq: function(sorted) {
+ return this.inject([], function(array, value, index) {
+ if (0 == index || (sorted ? array.last() != value : !array.include(value)))
+ array.push(value);
+ return array;
+ });
+ },
+
+ intersect: function(array) {
+ return this.uniq().findAll(function(item) {
+ return array.detect(function(value) { return item === value });
+ });
+ },
+
+ clone: function() {
+ return [].concat(this);
+ },
+
+ size: function() {
+ return this.length;
+ },
+
+ inspect: function() {
+ return '[' + this.map(Object.inspect).join(', ') + ']';
+ },
+
+ toJSON: function() {
+ var results = [];
+ this.each(function(object) {
+ var value = Object.toJSON(object);
+ if (value !== undefined) results.push(value);
+ });
+ return '[' + results.join(', ') + ']';
+ }
+});
+
+// use native browser JS 1.6 implementation if available
+if (Object.isFunction(Array.prototype.forEach))
+ Array.prototype._each = Array.prototype.forEach;
+
+if (!Array.prototype.indexOf) Array.prototype.indexOf = function(item, i) {
+ i || (i = 0);
+ var length = this.length;
+ if (i < 0) i = length + i;
+ for (; i < length; i++)
+ if (this[i] === item) return i;
+ return -1;
+};
+
+if (!Array.prototype.lastIndexOf) Array.prototype.lastIndexOf = function(item, i) {
+ i = isNaN(i) ? this.length : (i < 0 ? this.length + i : i) + 1;
+ var n = this.slice(0, i).reverse().indexOf(item);
+ return (n < 0) ? n : i - n - 1;
+};
+
+Array.prototype.toArray = Array.prototype.clone;
+
+function $w(string) {
+ if (!Object.isString(string)) return [];
+ string = string.strip();
+ return string ? string.split(/\s+/) : [];
+}
+
+if (Prototype.Browser.Opera){
+ Array.prototype.concat = function() {
+ var array = [];
+ for (var i = 0, length = this.length; i < length; i++) array.push(this[i]);
+ for (var i = 0, length = arguments.length; i < length; i++) {
+ if (Object.isArray(arguments[i])) {
+ for (var j = 0, arrayLength = arguments[i].length; j < arrayLength; j++)
+ array.push(arguments[i][j]);
+ } else {
+ array.push(arguments[i]);
+ }
+ }
+ return array;
+ };
+}
+Object.extend(Number.prototype, {
+ toColorPart: function() {
+ return this.toPaddedString(2, 16);
+ },
+
+ succ: function() {
+ return this + 1;
+ },
+
+ times: function(iterator) {
+ $R(0, this, true).each(iterator);
+ return this;
+ },
+
+ toPaddedString: function(length, radix) {
+ var string = this.toString(radix || 10);
+ return '0'.times(length - string.length) + string;
+ },
+
+ toJSON: function() {
+ return isFinite(this) ? this.toString() : 'null';
+ }
+});
+
+$w('abs round ceil floor').each(function(method){
+ Number.prototype[method] = Math[method].methodize();
+});
+function $H(object) {
+ return new Hash(object);
+};
+
+var Hash = Class.create(Enumerable, (function() {
+ if (function() {
+ var i = 0, Test = function(value) { this.key = value };
+ Test.prototype.key = 'foo';
+ for (var property in new Test('bar')) i++;
+ return i > 1;
+ }()) {
+ function each(iterator) {
+ var cache = [];
+ for (var key in this._object) {
+ var value = this._object[key];
+ if (cache.include(key)) continue;
+ cache.push(key);
+ var pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ }
+ } else {
+ function each(iterator) {
+ for (var key in this._object) {
+ var value = this._object[key], pair = [key, value];
+ pair.key = key;
+ pair.value = value;
+ iterator(pair);
+ }
+ }
+ }
+
+ function toQueryPair(key, value) {
+ if (Object.isUndefined(value)) return key;
+ return key + '=' + encodeURIComponent(String.interpret(value));
+ }
+
+ return {
+ initialize: function(object) {
+ this._object = Object.isHash(object) ? object.toObject() : Object.clone(object);
+ },
+
+ _each: each,
+
+ set: function(key, value) {
+ return this._object[key] = value;
+ },
+
+ get: function(key) {
+ return this._object[key];
+ },
+
+ unset: function(key) {
+ var value = this._object[key];
+ delete this._object[key];
+ return value;
+ },
+
+ toObject: function() {
+ return Object.clone(this._object);
+ },
+
+ keys: function() {
+ return this.pluck('key');
+ },
+
+ values: function() {
+ return this.pluck('value');
+ },
+
+ index: function(value) {
+ var match = this.detect(function(pair) {
+ return pair.value === value;
+ });
+ return match && match.key;
+ },
+
+ merge: function(object) {
+ return this.clone().update(object);
+ },
+
+ update: function(object) {
+ return new Hash(object).inject(this, function(result, pair) {
+ result.set(pair.key, pair.value);
+ return result;
+ });
+ },
+
+ toQueryString: function() {
+ return this.map(function(pair) {
+ var key = encodeURIComponent(pair.key), values = pair.value;
+
+ if (values && typeof values == 'object') {
+ if (Object.isArray(values))
+ return values.map(toQueryPair.curry(key)).join('&');
+ }
+ return toQueryPair(key, values);
+ }).join('&');
+ },
+
+ inspect: function() {
+ return '#<Hash:{' + this.map(function(pair) {
+ return pair.map(Object.inspect).join(': ');
+ }).join(', ') + '}>';
+ },
+
+ toJSON: function() {
+ return Object.toJSON(this.toObject());
+ },
+
+ clone: function() {
+ return new Hash(this);
+ }
+ }
+})());
+
+Hash.prototype.toTemplateReplacements = Hash.prototype.toObject;
+Hash.from = $H;
+var ObjectRange = Class.create(Enumerable, {
+ initialize: function(start, end, exclusive) {
+ this.start = start;
+ this.end = end;
+ this.exclusive = exclusive;
+ },
+
+ _each: function(iterator) {
+ var value = this.start;
+ while (this.include(value)) {
+ iterator(value);
+ value = value.succ();
+ }
+ },
+
+ include: function(value) {
+ if (value < this.start)
+ return false;
+ if (this.exclusive)
+ return value < this.end;
+ return value <= this.end;
+ }
+});
+
+var $R = function(start, end, exclusive) {
+ return new ObjectRange(start, end, exclusive);
+};
+
+var Ajax = {
+ getTransport: function() {
+ return Try.these(
+ function() {return new XMLHttpRequest()},
+ function() {return new ActiveXObject('Msxml2.XMLHTTP')},
+ function() {return new ActiveXObject('Microsoft.XMLHTTP')}
+ ) || false;
+ },
+
+ activeRequestCount: 0
+};
+
+Ajax.Responders = {
+ responders: [],
+
+ _each: function(iterator) {
+ this.responders._each(iterator);
+ },
+
+ register: function(responder) {
+ if (!this.include(responder))
+ this.responders.push(responder);
+ },
+
+ unregister: function(responder) {
+ this.responders = this.responders.without(responder);
+ },
+
+ dispatch: function(callback, request, transport, json) {
+ this.each(function(responder) {
+ if (Object.isFunction(responder[callback])) {
+ try {
+ responder[callback].apply(responder, [request, transport, json]);
+ } catch (e) { }
+ }
+ });
+ }
+};
+
+Object.extend(Ajax.Responders, Enumerable);
+
+Ajax.Responders.register({
+ onCreate: function() { Ajax.activeRequestCount++ },
+ onComplete: function() { Ajax.activeRequestCount-- }
+});
+
+Ajax.Base = Class.create({
+ initialize: function(options) {
+ this.options = {
+ method: 'post',
+ asynchronous: true,
+ contentType: 'application/x-www-form-urlencoded',
+ encoding: 'UTF-8',
+ parameters: '',
+ evalJSON: true,
+ evalJS: true
+ };
+ Object.extend(this.options, options || { });
+
+ this.options.method = this.options.method.toLowerCase();
+ if (Object.isString(this.options.parameters))
+ this.options.parameters = this.options.parameters.toQueryParams();
+ }
+});
+
+Ajax.Request = Class.create(Ajax.Base, {
+ _complete: false,
+
+ initialize: function($super, url, options) {
+ $super(options);
+ this.transport = Ajax.getTransport();
+ this.request(url);
+ },
+
+ request: function(url) {
+ this.url = url;
+ this.method = this.options.method;
+ var params = Object.clone(this.options.parameters);
+
+ if (!['get', 'post'].include(this.method)) {
+ // simulate other verbs over post
+ params['_method'] = this.method;
+ this.method = 'post';
+ }
+
+ this.parameters = params;
+
+ if (params = Object.toQueryString(params)) {
+ // when GET, append parameters to URL
+ if (this.method == 'get')
+ this.url += (this.url.include('?') ? '&' : '?') + params;
+ else if (/Konqueror|Safari|KHTML/.test(navigator.userAgent))
+ params += '&_=';
+ }
+
+ try {
+ var response = new Ajax.Response(this);
+ if (this.options.onCreate) this.options.onCreate(response);
+ Ajax.Responders.dispatch('onCreate', this, response);
+
+ this.transport.open(this.method.toUpperCase(), this.url,
+ this.options.asynchronous);
+
+ if (this.options.asynchronous) this.respondToReadyState.bind(this).defer(1);
+
+ this.transport.onreadystatechange = this.onStateChange.bind(this);
+ this.setRequestHeaders();
+
+ this.body = this.method == 'post' ? (this.options.postBody || params) : null;
+ this.transport.send(this.body);
+
+ /* Force Firefox to handle ready state 4 for synchronous requests */
+ if (!this.options.asynchronous && this.transport.overrideMimeType)
+ this.onStateChange();
+
+ }
+ catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ onStateChange: function() {
+ var readyState = this.transport.readyState;
+ if (readyState > 1 && !((readyState == 4) && this._complete))
+ this.respondToReadyState(this.transport.readyState);
+ },
+
+ setRequestHeaders: function() {
+ var headers = {
+ 'X-Requested-With': 'XMLHttpRequest',
+ 'X-Prototype-Version': Prototype.Version,
+ 'Accept': 'text/javascript, text/html, application/xml, text/xml, */*'
+ };
+
+ if (this.method == 'post') {
+ headers['Content-type'] = this.options.contentType +
+ (this.options.encoding ? '; charset=' + this.options.encoding : '');
+
+ /* Force "Connection: close" for older Mozilla browsers to work
+ * around a bug where XMLHttpRequest sends an incorrect
+ * Content-length header. See Mozilla Bugzilla #246651.
+ */
+ if (this.transport.overrideMimeType &&
+ (navigator.userAgent.match(/Gecko\/(\d{4})/) || [0,2005])[1] < 2005)
+ headers['Connection'] = 'close';
+ }
+
+ // user-defined headers
+ if (typeof this.options.requestHeaders == 'object') {
+ var extras = this.options.requestHeaders;
+
+ if (Object.isFunction(extras.push))
+ for (var i = 0, length = extras.length; i < length; i += 2)
+ headers[extras[i]] = extras[i+1];
+ else
+ $H(extras).each(function(pair) { headers[pair.key] = pair.value });
+ }
+
+ for (var name in headers)
+ this.transport.setRequestHeader(name, headers[name]);
+ },
+
+ success: function() {
+ var status = this.getStatus();
+ return !status || (status >= 200 && status < 300);
+ },
+
+ getStatus: function() {
+ try {
+ return this.transport.status || 0;
+ } catch (e) { return 0 }
+ },
+
+ respondToReadyState: function(readyState) {
+ var state = Ajax.Request.Events[readyState], response = new Ajax.Response(this);
+
+ if (state == 'Complete') {
+ try {
+ this._complete = true;
+ (this.options['on' + response.status]
+ || this.options['on' + (this.success() ? 'Success' : 'Failure')]
+ || Prototype.emptyFunction)(response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ var contentType = response.getHeader('Content-type');
+ if (this.options.evalJS == 'force'
+ || (this.options.evalJS && contentType
+ && contentType.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i)))
+ this.evalResponse();
+ }
+
+ try {
+ (this.options['on' + state] || Prototype.emptyFunction)(response, response.headerJSON);
+ Ajax.Responders.dispatch('on' + state, this, response, response.headerJSON);
+ } catch (e) {
+ this.dispatchException(e);
+ }
+
+ if (state == 'Complete') {
+ // avoid memory leak in MSIE: clean up
+ this.transport.onreadystatechange = Prototype.emptyFunction;
+ }
+ },
+
+ getHeader: function(name) {
+ try {
+ return this.transport.getResponseHeader(name);
+ } catch (e) { return null }
+ },
+
+ evalResponse: function() {
+ try {
+ return eval((this.transport.responseText || '').unfilterJSON());
+ } catch (e) {
+ this.dispatchException(e);
+ }
+ },
+
+ dispatchException: function(exception) {
+ (this.options.onException || Prototype.emptyFunction)(this, exception);
+ Ajax.Responders.dispatch('onException', this, exception);
+ }
+});
+
+Ajax.Request.Events =
+ ['Uninitialized', 'Loading', 'Loaded', 'Interactive', 'Complete'];
+
+Ajax.Response = Class.create({
+ initialize: function(request){
+ this.request = request;
+ var transport = this.transport = request.transport,
+ readyState = this.readyState = transport.readyState;
+
+ if((readyState > 2 && !Prototype.Browser.IE) || readyState == 4) {
+ this.status = this.getStatus();
+ this.statusText = this.getStatusText();
+ this.responseText = String.interpret(transport.responseText);
+ this.headerJSON = this._getHeaderJSON();
+ }
+
+ if(readyState == 4) {
+ var xml = transport.responseXML;
+ this.responseXML = xml === undefined ? null : xml;
+ this.responseJSON = this._getResponseJSON();
+ }
+ },
+
+ status: 0,
+ statusText: '',
+
+ getStatus: Ajax.Request.prototype.getStatus,
+
+ getStatusText: function() {
+ try {
+ return this.transport.statusText || '';
+ } catch (e) { return '' }
+ },
+
+ getHeader: Ajax.Request.prototype.getHeader,
+
+ getAllHeaders: function() {
+ try {
+ return this.getAllResponseHeaders();
+ } catch (e) { return null }
+ },
+
+ getResponseHeader: function(name) {
+ return this.transport.getResponseHeader(name);
+ },
+
+ getAllResponseHeaders: function() {
+ return this.transport.getAllResponseHeaders();
+ },
+
+ _getHeaderJSON: function() {
+ var json = this.getHeader('X-JSON');
+ if (!json) return null;
+ json = decodeURIComponent(escape(json));
+ try {
+ return json.evalJSON(this.request.options.sanitizeJSON);
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ },
+
+ _getResponseJSON: function() {
+ var options = this.request.options;
+ if (!options.evalJSON || (options.evalJSON != 'force' &&
+ !(this.getHeader('Content-type') || '').include('application/json')))
+ return null;
+ try {
+ return this.transport.responseText.evalJSON(options.sanitizeJSON);
+ } catch (e) {
+ this.request.dispatchException(e);
+ }
+ }
+});
+
+Ajax.Updater = Class.create(Ajax.Request, {
+ initialize: function($super, container, url, options) {
+ this.container = {
+ success: (container.success || container),
+ failure: (container.failure || (container.success ? null : container))
+ };
+
+ options = options || { };
+ var onComplete = options.onComplete;
+ options.onComplete = (function(response, param) {
+ this.updateContent(response.responseText);
+ if (Object.isFunction(onComplete)) onComplete(response, param);
+ }).bind(this);
+
+ $super(url, options);
+ },
+
+ updateContent: function(responseText) {
+ var receiver = this.container[this.success() ? 'success' : 'failure'],
+ options = this.options;
+
+ if (!options.evalScripts) responseText = responseText.stripScripts();
+
+ if (receiver = $(receiver)) {
+ if (options.insertion) {
+ if (Object.isString(options.insertion)) {
+ var insertion = { }; insertion[options.insertion] = responseText;
+ receiver.insert(insertion);
+ }
+ else options.insertion(receiver, responseText);
+ }
+ else receiver.update(responseText);
+ }
+
+ if (this.success()) {
+ if (this.onComplete) this.onComplete.bind(this).defer();
+ }
+ }
+});
+
+Ajax.PeriodicalUpdater = Class.create(Ajax.Base, {
+ initialize: function($super, container, url, options) {
+ $super(options);
+ this.onComplete = this.options.onComplete;
+
+ this.frequency = (this.options.frequency || 2);
+ this.decay = (this.options.decay || 1);
+
+ this.updater = { };
+ this.container = container;
+ this.url = url;
+
+ this.start();
+ },
+
+ start: function() {
+ this.options.onComplete = this.updateComplete.bind(this);
+ this.onTimerEvent();
+ },
+
+ stop: function() {
+ this.updater.options.onComplete = undefined;
+ clearTimeout(this.timer);
+ (this.onComplete || Prototype.emptyFunction).apply(this, arguments);
+ },
+
+ updateComplete: function(response) {
+ if (this.options.decay) {
+ this.decay = (response.responseText == this.lastText ?
+ this.decay * this.options.decay : 1);
+
+ this.lastText = response.responseText;
+ }
+ this.timer = this.onTimerEvent.bind(this).delay(this.decay * this.frequency);
+ },
+
+ onTimerEvent: function() {
+ this.updater = new Ajax.Updater(this.container, this.url, this.options);
+ }
+});
+function $(element) {
+ if (arguments.length > 1) {
+ for (var i = 0, elements = [], length = arguments.length; i < length; i++)
+ elements.push($(arguments[i]));
+ return elements;
+ }
+ if (Object.isString(element))
+ element = document.getElementById(element);
+ return Element.extend(element);
+}
+
+if (Prototype.BrowserFeatures.XPath) {
+ document._getElementsByXPath = function(expression, parentElement) {
+ var results = [];
+ var query = document.evaluate(expression, $(parentElement) || document,
+ null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
+ for (var i = 0, length = query.snapshotLength; i < length; i++)
+ results.push(Element.extend(query.snapshotItem(i)));
+ return results;
+ };
+}
+
+/*--------------------------------------------------------------------------*/
+
+if (!window.Node) var Node = { };
+
+if (!Node.ELEMENT_NODE) {
+ // DOM level 2 ECMAScript Language Binding
+ Object.extend(Node, {
+ ELEMENT_NODE: 1,
+ ATTRIBUTE_NODE: 2,
+ TEXT_NODE: 3,
+ CDATA_SECTION_NODE: 4,
+ ENTITY_REFERENCE_NODE: 5,
+ ENTITY_NODE: 6,
+ PROCESSING_INSTRUCTION_NODE: 7,
+ COMMENT_NODE: 8,
+ DOCUMENT_NODE: 9,
+ DOCUMENT_TYPE_NODE: 10,
+ DOCUMENT_FRAGMENT_NODE: 11,
+ NOTATION_NODE: 12
+ });
+}
+
+(function() {
+ var element = this.Element;
+ this.Element = function(tagName, attributes) {
+ attributes = attributes || { };
+ tagName = tagName.toLowerCase();
+ var cache = Element.cache;
+ if (Prototype.Browser.IE && attributes.name) {
+ tagName = '<' + tagName + ' name="' + attributes.name + '">';
+ delete attributes.name;
+ return Element.writeAttribute(document.createElement(tagName), attributes);
+ }
+ if (!cache[tagName]) cache[tagName] = Element.extend(document.createElement(tagName));
+ return Element.writeAttribute(cache[tagName].cloneNode(false), attributes);
+ };
+ Object.extend(this.Element, element || { });
+}).call(window);
+
+Element.cache = { };
+
+Element.Methods = {
+ visible: function(element) {
+ return $(element).style.display != 'none';
+ },
+
+ toggle: function(element) {
+ element = $(element);
+ Element[Element.visible(element) ? 'hide' : 'show'](element);
+ return element;
+ },
+
+ hide: function(element) {
+ $(element).style.display = 'none';
+ return element;
+ },
+
+ show: function(element) {
+ $(element).style.display = '';
+ return element;
+ },
+
+ remove: function(element) {
+ element = $(element);
+ element.parentNode.removeChild(element);
+ return element;
+ },
+
+ update: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) return element.update().insert(content);
+ content = Object.toHTML(content);
+ element.innerHTML = content.stripScripts();
+ content.evalScripts.bind(content).defer();
+ return element;
+ },
+
+ replace: function(element, content) {
+ element = $(element);
+ if (content && content.toElement) content = content.toElement();
+ else if (!Object.isElement(content)) {
+ content = Object.toHTML(content);
+ var range = element.ownerDocument.createRange();
+ range.selectNode(element);
+ content.evalScripts.bind(content).defer();
+ content = range.createContextualFragment(content.stripScripts());
+ }
+ element.parentNode.replaceChild(content, element);
+ return element;
+ },
+
+ insert: function(element, insertions) {
+ element = $(element);
+
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+ insertions = {bottom:insertions};
+
+ var content, t, range;
+
+ for (position in insertions) {
+ content = insertions[position];
+ position = position.toLowerCase();
+ t = Element._insertionTranslations[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ t.insert(element, content);
+ continue;
+ }
+
+ content = Object.toHTML(content);
+
+ range = element.ownerDocument.createRange();
+ t.initializeRange(element, range);
+ t.insert(element, range.createContextualFragment(content.stripScripts()));
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ return element;
+ },
+
+ wrap: function(element, wrapper, attributes) {
+ element = $(element);
+ if (Object.isElement(wrapper))
+ $(wrapper).writeAttribute(attributes || { });
+ else if (Object.isString(wrapper)) wrapper = new Element(wrapper, attributes);
+ else wrapper = new Element('div', wrapper);
+ if (element.parentNode)
+ element.parentNode.replaceChild(wrapper, element);
+ wrapper.appendChild(element);
+ return wrapper;
+ },
+
+ inspect: function(element) {
+ element = $(element);
+ var result = '<' + element.tagName.toLowerCase();
+ $H({'id': 'id', 'className': 'class'}).each(function(pair) {
+ var property = pair.first(), attribute = pair.last();
+ var value = (element[property] || '').toString();
+ if (value) result += ' ' + attribute + '=' + value.inspect(true);
+ });
+ return result + '>';
+ },
+
+ recursivelyCollect: function(element, property) {
+ element = $(element);
+ var elements = [];
+ while (element = element[property])
+ if (element.nodeType == 1)
+ elements.push(Element.extend(element));
+ return elements;
+ },
+
+ ancestors: function(element) {
+ return $(element).recursivelyCollect('parentNode');
+ },
+
+ descendants: function(element) {
+ return $A($(element).getElementsByTagName('*')).each(Element.extend);
+ },
+
+ firstDescendant: function(element) {
+ element = $(element).firstChild;
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ return $(element);
+ },
+
+ immediateDescendants: function(element) {
+ if (!(element = $(element).firstChild)) return [];
+ while (element && element.nodeType != 1) element = element.nextSibling;
+ if (element) return [element].concat($(element).nextSiblings());
+ return [];
+ },
+
+ previousSiblings: function(element) {
+ return $(element).recursivelyCollect('previousSibling');
+ },
+
+ nextSiblings: function(element) {
+ return $(element).recursivelyCollect('nextSibling');
+ },
+
+ siblings: function(element) {
+ element = $(element);
+ return element.previousSiblings().reverse().concat(element.nextSiblings());
+ },
+
+ match: function(element, selector) {
+ if (Object.isString(selector))
+ selector = new Selector(selector);
+ return selector.match($(element));
+ },
+
+ up: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(element.parentNode);
+ var ancestors = element.ancestors();
+ return expression ? Selector.findElement(ancestors, expression, index) :
+ ancestors[index || 0];
+ },
+
+ down: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return element.firstDescendant();
+ var descendants = element.descendants();
+ return expression ? Selector.findElement(descendants, expression, index) :
+ descendants[index || 0];
+ },
+
+ previous: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.previousElementSibling(element));
+ var previousSiblings = element.previousSiblings();
+ return expression ? Selector.findElement(previousSiblings, expression, index) :
+ previousSiblings[index || 0];
+ },
+
+ next: function(element, expression, index) {
+ element = $(element);
+ if (arguments.length == 1) return $(Selector.handlers.nextElementSibling(element));
+ var nextSiblings = element.nextSiblings();
+ return expression ? Selector.findElement(nextSiblings, expression, index) :
+ nextSiblings[index || 0];
+ },
+
+ select: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element, args);
+ },
+
+ adjacent: function() {
+ var args = $A(arguments), element = $(args.shift());
+ return Selector.findChildElements(element.parentNode, args).without(element);
+ },
+
+ identify: function(element) {
+ element = $(element);
+ var id = element.readAttribute('id'), self = arguments.callee;
+ if (id) return id;
+ do { id = 'anonymous_element_' + self.counter++ } while ($(id));
+ element.writeAttribute('id', id);
+ return id;
+ },
+
+ readAttribute: function(element, name) {
+ element = $(element);
+ if (Prototype.Browser.IE) {
+ var t = Element._attributeTranslations.read;
+ if (t.values[name]) return t.values[name](element, name);
+ if (t.names[name]) name = t.names[name];
+ if (name.include(':')) {
+ return (!element.attributes || !element.attributes[name]) ? null :
+ element.attributes[name].value;
+ }
+ }
+ return element.getAttribute(name);
+ },
+
+ writeAttribute: function(element, name, value) {
+ element = $(element);
+ var attributes = { }, t = Element._attributeTranslations.write;
+
+ if (typeof name == 'object') attributes = name;
+ else attributes[name] = value === undefined ? true : value;
+
+ for (var attr in attributes) {
+ var name = t.names[attr] || attr, value = attributes[attr];
+ if (t.values[attr]) name = t.values[attr](element, value);
+ if (value === false || value === null)
+ element.removeAttribute(name);
+ else if (value === true)
+ element.setAttribute(name, name);
+ else element.setAttribute(name, value);
+ }
+ return element;
+ },
+
+ getHeight: function(element) {
+ return $(element).getDimensions().height;
+ },
+
+ getWidth: function(element) {
+ return $(element).getDimensions().width;
+ },
+
+ classNames: function(element) {
+ return new Element.ClassNames(element);
+ },
+
+ hasClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ var elementClassName = element.className;
+ return (elementClassName.length > 0 && (elementClassName == className ||
+ new RegExp("(^|\\s)" + className + "(\\s|$)").test(elementClassName)));
+ },
+
+ addClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ if (!element.hasClassName(className))
+ element.className += (element.className ? ' ' : '') + className;
+ return element;
+ },
+
+ removeClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ element.className = element.className.replace(
+ new RegExp("(^|\\s+)" + className + "(\\s+|$)"), ' ').strip();
+ return element;
+ },
+
+ toggleClassName: function(element, className) {
+ if (!(element = $(element))) return;
+ return element[element.hasClassName(className) ?
+ 'removeClassName' : 'addClassName'](className);
+ },
+
+ // removes whitespace-only text node children
+ cleanWhitespace: function(element) {
+ element = $(element);
+ var node = element.firstChild;
+ while (node) {
+ var nextNode = node.nextSibling;
+ if (node.nodeType == 3 && !/\S/.test(node.nodeValue))
+ element.removeChild(node);
+ node = nextNode;
+ }
+ return element;
+ },
+
+ empty: function(element) {
+ return $(element).innerHTML.blank();
+ },
+
+ descendantOf: function(element, ancestor) {
+ element = $(element), ancestor = $(ancestor);
+
+ if (element.compareDocumentPosition)
+ return (element.compareDocumentPosition(ancestor) & 8) === 8;
+
+ if (element.sourceIndex && !Prototype.Browser.Opera) {
+ var e = element.sourceIndex, a = ancestor.sourceIndex,
+ nextAncestor = ancestor.nextSibling;
+ if (!nextAncestor) {
+ do { ancestor = ancestor.parentNode; }
+ while (!(nextAncestor = ancestor.nextSibling) && ancestor.parentNode);
+ }
+ if (nextAncestor) return (e > a && e < nextAncestor.sourceIndex);
+ }
+
+ while (element = element.parentNode)
+ if (element == ancestor) return true;
+ return false;
+ },
+
+ scrollTo: function(element) {
+ element = $(element);
+ var pos = element.cumulativeOffset();
+ window.scrollTo(pos[0], pos[1]);
+ return element;
+ },
+
+ getStyle: function(element, style) {
+ element = $(element);
+ style = style == 'float' ? 'cssFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value) {
+ var css = document.defaultView.getComputedStyle(element, null);
+ value = css ? css[style] : null;
+ }
+ if (style == 'opacity') return value ? parseFloat(value) : 1.0;
+ return value == 'auto' ? null : value;
+ },
+
+ getOpacity: function(element) {
+ return $(element).getStyle('opacity');
+ },
+
+ setStyle: function(element, styles) {
+ element = $(element);
+ var elementStyle = element.style, match;
+ if (Object.isString(styles)) {
+ element.style.cssText += ';' + styles;
+ return styles.include('opacity') ?
+ element.setOpacity(styles.match(/opacity:\s*(\d?\.?\d*)/)[1]) : element;
+ }
+ for (var property in styles)
+ if (property == 'opacity') element.setOpacity(styles[property]);
+ else
+ elementStyle[(property == 'float' || property == 'cssFloat') ?
+ (elementStyle.styleFloat === undefined ? 'cssFloat' : 'styleFloat') :
+ property] = styles[property];
+
+ return element;
+ },
+
+ setOpacity: function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+ return element;
+ },
+
+ getDimensions: function(element) {
+ element = $(element);
+ var display = $(element).getStyle('display');
+ if (display != 'none' && display != null) // Safari bug
+ return {width: element.offsetWidth, height: element.offsetHeight};
+
+ // All *Width and *Height properties give 0 on elements with display none,
+ // so enable the element temporarily
+ var els = element.style;
+ var originalVisibility = els.visibility;
+ var originalPosition = els.position;
+ var originalDisplay = els.display;
+ els.visibility = 'hidden';
+ els.position = 'absolute';
+ els.display = 'block';
+ var originalWidth = element.clientWidth;
+ var originalHeight = element.clientHeight;
+ els.display = originalDisplay;
+ els.position = originalPosition;
+ els.visibility = originalVisibility;
+ return {width: originalWidth, height: originalHeight};
+ },
+
+ makePositioned: function(element) {
+ element = $(element);
+ var pos = Element.getStyle(element, 'position');
+ if (pos == 'static' || !pos) {
+ element._madePositioned = true;
+ element.style.position = 'relative';
+ // Opera returns the offset relative to the positioning context, when an
+ // element is position relative but top and left have not been defined
+ if (window.opera) {
+ element.style.top = 0;
+ element.style.left = 0;
+ }
+ }
+ return element;
+ },
+
+ undoPositioned: function(element) {
+ element = $(element);
+ if (element._madePositioned) {
+ element._madePositioned = undefined;
+ element.style.position =
+ element.style.top =
+ element.style.left =
+ element.style.bottom =
+ element.style.right = '';
+ }
+ return element;
+ },
+
+ makeClipping: function(element) {
+ element = $(element);
+ if (element._overflow) return element;
+ element._overflow = Element.getStyle(element, 'overflow') || 'auto';
+ if (element._overflow !== 'hidden')
+ element.style.overflow = 'hidden';
+ return element;
+ },
+
+ undoClipping: function(element) {
+ element = $(element);
+ if (!element._overflow) return element;
+ element.style.overflow = element._overflow == 'auto' ? '' : element._overflow;
+ element._overflow = null;
+ return element;
+ },
+
+ cumulativeOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ } while (element);
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ positionedOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ element = element.offsetParent;
+ if (element) {
+ if (element.tagName == 'BODY') break;
+ var p = Element.getStyle(element, 'position');
+ if (p == 'relative' || p == 'absolute') break;
+ }
+ } while (element);
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ absolutize: function(element) {
+ element = $(element);
+ if (element.getStyle('position') == 'absolute') return;
+ // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+ var offsets = element.positionedOffset();
+ var top = offsets[1];
+ var left = offsets[0];
+ var width = element.clientWidth;
+ var height = element.clientHeight;
+
+ element._originalLeft = left - parseFloat(element.style.left || 0);
+ element._originalTop = top - parseFloat(element.style.top || 0);
+ element._originalWidth = element.style.width;
+ element._originalHeight = element.style.height;
+
+ element.style.position = 'absolute';
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.width = width + 'px';
+ element.style.height = height + 'px';
+ return element;
+ },
+
+ relativize: function(element) {
+ element = $(element);
+ if (element.getStyle('position') == 'relative') return;
+ // Position.prepare(); // To be done manually by Scripty when it needs it.
+
+ element.style.position = 'relative';
+ var top = parseFloat(element.style.top || 0) - (element._originalTop || 0);
+ var left = parseFloat(element.style.left || 0) - (element._originalLeft || 0);
+
+ element.style.top = top + 'px';
+ element.style.left = left + 'px';
+ element.style.height = element._originalHeight;
+ element.style.width = element._originalWidth;
+ return element;
+ },
+
+ cumulativeScrollOffset: function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.scrollTop || 0;
+ valueL += element.scrollLeft || 0;
+ element = element.parentNode;
+ } while (element);
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ getOffsetParent: function(element) {
+ if (element.offsetParent) return $(element.offsetParent);
+ if (element == document.body) return $(element);
+
+ while ((element = element.parentNode) && element != document.body)
+ if (Element.getStyle(element, 'position') != 'static')
+ return $(element);
+
+ return $(document.body);
+ },
+
+ viewportOffset: function(forElement) {
+ var valueT = 0, valueL = 0;
+
+ var element = forElement;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+
+ // Safari fix
+ if (element.offsetParent == document.body &&
+ Element.getStyle(element, 'position') == 'absolute') break;
+
+ } while (element = element.offsetParent);
+
+ element = forElement;
+ do {
+ if (!Prototype.Browser.Opera || element.tagName == 'BODY') {
+ valueT -= element.scrollTop || 0;
+ valueL -= element.scrollLeft || 0;
+ }
+ } while (element = element.parentNode);
+
+ return Element._returnOffset(valueL, valueT);
+ },
+
+ clonePosition: function(element, source) {
+ var options = Object.extend({
+ setLeft: true,
+ setTop: true,
+ setWidth: true,
+ setHeight: true,
+ offsetTop: 0,
+ offsetLeft: 0
+ }, arguments[2] || { });
+
+ // find page position of source
+ source = $(source);
+ var p = source.viewportOffset();
+
+ // find coordinate system to use
+ element = $(element);
+ var delta = [0, 0];
+ var parent = null;
+ // delta [0,0] will do fine with position: fixed elements,
+ // position:absolute needs offsetParent deltas
+ if (Element.getStyle(element, 'position') == 'absolute') {
+ parent = element.getOffsetParent();
+ delta = parent.viewportOffset();
+ }
+
+ // correct by body offsets (fixes Safari)
+ if (parent == document.body) {
+ delta[0] -= document.body.offsetLeft;
+ delta[1] -= document.body.offsetTop;
+ }
+
+ // set position
+ if (options.setLeft) element.style.left = (p[0] - delta[0] + options.offsetLeft) + 'px';
+ if (options.setTop) element.style.top = (p[1] - delta[1] + options.offsetTop) + 'px';
+ if (options.setWidth) element.style.width = source.offsetWidth + 'px';
+ if (options.setHeight) element.style.height = source.offsetHeight + 'px';
+ return element;
+ }
+};
+
+Element.Methods.identify.counter = 1;
+
+Object.extend(Element.Methods, {
+ getElementsBySelector: Element.Methods.select,
+ childElements: Element.Methods.immediateDescendants
+});
+
+Element._attributeTranslations = {
+ write: {
+ names: {
+ className: 'class',
+ htmlFor: 'for'
+ },
+ values: { }
+ }
+};
+
+
+if (!document.createRange || Prototype.Browser.Opera) {
+ Element.Methods.insert = function(element, insertions) {
+ element = $(element);
+
+ if (Object.isString(insertions) || Object.isNumber(insertions) ||
+ Object.isElement(insertions) || (insertions && (insertions.toElement || insertions.toHTML)))
+ insertions = { bottom: insertions };
+
+ var t = Element._insertionTranslations, content, position, pos, tagName;
+
+ for (position in insertions) {
+ content = insertions[position];
+ position = position.toLowerCase();
+ pos = t[position];
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ pos.insert(element, content);
+ continue;
+ }
+
+ content = Object.toHTML(content);
+ tagName = ((position == 'before' || position == 'after')
+ ? element.parentNode : element).tagName.toUpperCase();
+
+ if (t.tags[tagName]) {
+ var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+ if (position == 'top' || position == 'after') fragments.reverse();
+ fragments.each(pos.insert.curry(element));
+ }
+ else element.insertAdjacentHTML(pos.adjacency, content.stripScripts());
+
+ content.evalScripts.bind(content).defer();
+ }
+
+ return element;
+ };
+}
+
+if (Prototype.Browser.Opera) {
+ Element.Methods._getStyle = Element.Methods.getStyle;
+ Element.Methods.getStyle = function(element, style) {
+ switch(style) {
+ case 'left':
+ case 'top':
+ case 'right':
+ case 'bottom':
+ if (Element._getStyle(element, 'position') == 'static') return null;
+ default: return Element._getStyle(element, style);
+ }
+ };
+ Element.Methods._readAttribute = Element.Methods.readAttribute;
+ Element.Methods.readAttribute = function(element, attribute) {
+ if (attribute == 'title') return element.title;
+ return Element._readAttribute(element, attribute);
+ };
+}
+
+else if (Prototype.Browser.IE) {
+ $w('positionedOffset getOffsetParent viewportOffset').each(function(method) {
+ Element.Methods[method] = Element.Methods[method].wrap(
+ function(proceed, element) {
+ element = $(element);
+ var position = element.getStyle('position');
+ if (position != 'static') return proceed(element);
+ element.setStyle({ position: 'relative' });
+ var value = proceed(element);
+ element.setStyle({ position: position });
+ return value;
+ }
+ );
+ });
+
+ Element.Methods.getStyle = function(element, style) {
+ element = $(element);
+ style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
+ var value = element.style[style];
+ if (!value && element.currentStyle) value = element.currentStyle[style];
+
+ if (style == 'opacity') {
+ if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
+ if (value[1]) return parseFloat(value[1]) / 100;
+ return 1.0;
+ }
+
+ if (value == 'auto') {
+ if ((style == 'width' || style == 'height') && (element.getStyle('display') != 'none'))
+ return element['offset' + style.capitalize()] + 'px';
+ return null;
+ }
+ return value;
+ };
+
+ Element.Methods.setOpacity = function(element, value) {
+ function stripAlpha(filter){
+ return filter.replace(/alpha\([^\)]*\)/gi,'');
+ }
+ element = $(element);
+ var currentStyle = element.currentStyle;
+ if ((currentStyle && !currentStyle.hasLayout) ||
+ (!currentStyle && element.style.zoom == 'normal'))
+ element.style.zoom = 1;
+
+ var filter = element.getStyle('filter'), style = element.style;
+ if (value == 1 || value === '') {
+ (filter = stripAlpha(filter)) ?
+ style.filter = filter : style.removeAttribute('filter');
+ return element;
+ } else if (value < 0.00001) value = 0;
+ style.filter = stripAlpha(filter) +
+ 'alpha(opacity=' + (value * 100) + ')';
+ return element;
+ };
+
+ Element._attributeTranslations = {
+ read: {
+ names: {
+ 'class': 'className',
+ 'for': 'htmlFor'
+ },
+ values: {
+ _getAttr: function(element, attribute) {
+ return element.getAttribute(attribute, 2);
+ },
+ _getAttrNode: function(element, attribute) {
+ var node = element.getAttributeNode(attribute);
+ return node ? node.value : "";
+ },
+ _getEv: function(element, attribute) {
+ var attribute = element.getAttribute(attribute);
+ return attribute ? attribute.toString().slice(23, -2) : null;
+ },
+ _flag: function(element, attribute) {
+ return $(element).hasAttribute(attribute) ? attribute : null;
+ },
+ style: function(element) {
+ return element.style.cssText.toLowerCase();
+ },
+ title: function(element) {
+ return element.title;
+ }
+ }
+ }
+ };
+
+ Element._attributeTranslations.write = {
+ names: Object.clone(Element._attributeTranslations.read.names),
+ values: {
+ checked: function(element, value) {
+ element.checked = !!value;
+ },
+
+ style: function(element, value) {
+ element.style.cssText = value ? value : '';
+ }
+ }
+ };
+
+ Element._attributeTranslations.has = {};
+
+ $w('colSpan rowSpan vAlign dateTime accessKey tabIndex ' +
+ 'encType maxLength readOnly longDesc').each(function(attr) {
+ Element._attributeTranslations.write.names[attr.toLowerCase()] = attr;
+ Element._attributeTranslations.has[attr.toLowerCase()] = attr;
+ });
+
+ (function(v) {
+ Object.extend(v, {
+ href: v._getAttr,
+ src: v._getAttr,
+ type: v._getAttr,
+ action: v._getAttrNode,
+ disabled: v._flag,
+ checked: v._flag,
+ readonly: v._flag,
+ multiple: v._flag,
+ onload: v._getEv,
+ onunload: v._getEv,
+ onclick: v._getEv,
+ ondblclick: v._getEv,
+ onmousedown: v._getEv,
+ onmouseup: v._getEv,
+ onmouseover: v._getEv,
+ onmousemove: v._getEv,
+ onmouseout: v._getEv,
+ onfocus: v._getEv,
+ onblur: v._getEv,
+ onkeypress: v._getEv,
+ onkeydown: v._getEv,
+ onkeyup: v._getEv,
+ onsubmit: v._getEv,
+ onreset: v._getEv,
+ onselect: v._getEv,
+ onchange: v._getEv
+ });
+ })(Element._attributeTranslations.read.values);
+}
+
+else if (Prototype.Browser.Gecko && /rv:1\.8\.0/.test(navigator.userAgent)) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1) ? 0.999999 :
+ (value === '') ? '' : (value < 0.00001) ? 0 : value;
+ return element;
+ };
+}
+
+else if (Prototype.Browser.WebKit) {
+ Element.Methods.setOpacity = function(element, value) {
+ element = $(element);
+ element.style.opacity = (value == 1 || value === '') ? '' :
+ (value < 0.00001) ? 0 : value;
+
+ if (value == 1)
+ if(element.tagName == 'IMG' && element.width) {
+ element.width++; element.width--;
+ } else try {
+ var n = document.createTextNode(' ');
+ element.appendChild(n);
+ element.removeChild(n);
+ } catch (e) { }
+
+ return element;
+ };
+
+ // Safari returns margins on body which is incorrect if the child is absolutely
+ // positioned. For performance reasons, redefine Position.cumulativeOffset for
+ // KHTML/WebKit only.
+ Element.Methods.cumulativeOffset = function(element) {
+ var valueT = 0, valueL = 0;
+ do {
+ valueT += element.offsetTop || 0;
+ valueL += element.offsetLeft || 0;
+ if (element.offsetParent == document.body)
+ if (Element.getStyle(element, 'position') == 'absolute') break;
+
+ element = element.offsetParent;
+ } while (element);
+
+ return Element._returnOffset(valueL, valueT);
+ };
+}
+
+if (Prototype.Browser.IE || Prototype.Browser.Opera) {
+ // IE and Opera are missing .innerHTML support for TABLE-related and SELECT elements
+ Element.Methods.update = function(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) return element.update().insert(content);
+
+ content = Object.toHTML(content);
+ var tagName = element.tagName.toUpperCase();
+
+ if (tagName in Element._insertionTranslations.tags) {
+ $A(element.childNodes).each(function(node) { element.removeChild(node) });
+ Element._getContentFromAnonymousElement(tagName, content.stripScripts())
+ .each(function(node) { element.appendChild(node) });
+ }
+ else element.innerHTML = content.stripScripts();
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ };
+}
+
+if (document.createElement('div').outerHTML) {
+ Element.Methods.replace = function(element, content) {
+ element = $(element);
+
+ if (content && content.toElement) content = content.toElement();
+ if (Object.isElement(content)) {
+ element.parentNode.replaceChild(content, element);
+ return element;
+ }
+
+ content = Object.toHTML(content);
+ var parent = element.parentNode, tagName = parent.tagName.toUpperCase();
+
+ if (Element._insertionTranslations.tags[tagName]) {
+ var nextSibling = element.next();
+ var fragments = Element._getContentFromAnonymousElement(tagName, content.stripScripts());
+ parent.removeChild(element);
+ if (nextSibling)
+ fragments.each(function(node) { parent.insertBefore(node, nextSibling) });
+ else
+ fragments.each(function(node) { parent.appendChild(node) });
+ }
+ else element.outerHTML = content.stripScripts();
+
+ content.evalScripts.bind(content).defer();
+ return element;
+ };
+}
+
+Element._returnOffset = function(l, t) {
+ var result = [l, t];
+ result.left = l;
+ result.top = t;
+ return result;
+};
+
+Element._getContentFromAnonymousElement = function(tagName, html) {
+ var div = new Element('div'), t = Element._insertionTranslations.tags[tagName];
+ div.innerHTML = t[0] + html + t[1];
+ t[2].times(function() { div = div.firstChild });
+ return $A(div.childNodes);
+};
+
+Element._insertionTranslations = {
+ before: {
+ adjacency: 'beforeBegin',
+ insert: function(element, node) {
+ element.parentNode.insertBefore(node, element);
+ },
+ initializeRange: function(element, range) {
+ range.setStartBefore(element);
+ }
+ },
+ top: {
+ adjacency: 'afterBegin',
+ insert: function(element, node) {
+ element.insertBefore(node, element.firstChild);
+ },
+ initializeRange: function(element, range) {
+ range.selectNodeContents(element);
+ range.collapse(true);
+ }
+ },
+ bottom: {
+ adjacency: 'beforeEnd',
+ insert: function(element, node) {
+ element.appendChild(node);
+ }
+ },
+ after: {
+ adjacency: 'afterEnd',
+ insert: function(element, node) {
+ element.parentNode.insertBefore(node, element.nextSibling);
+ },
+ initializeRange: function(element, range) {
+ range.setStartAfter(element);
+ }
+ },
+ tags: {
+ TABLE: ['<table>', '</table>', 1],
+ TBODY: ['<table><tbody>', '</tbody></table>', 2],
+ TR: ['<table><tbody><tr>', '</tr></tbody></table>', 3],
+ TD: ['<table><tbody><tr><td>', '</td></tr></tbody></table>', 4],
+ SELECT: ['<select>', '</select>', 1]
+ }
+};
+
+(function() {
+ this.bottom.initializeRange = this.top.initializeRange;
+ Object.extend(this.tags, {
+ THEAD: this.tags.TBODY,
+ TFOOT: this.tags.TBODY,
+ TH: this.tags.TD
+ });
+}).call(Element._insertionTranslations);
+
+Element.Methods.Simulated = {
+ hasAttribute: function(element, attribute) {
+ attribute = Element._attributeTranslations.has[attribute] || attribute;
+ var node = $(element).getAttributeNode(attribute);
+ return node && node.specified;
+ }
+};
+
+Element.Methods.ByTag = { };
+
+Object.extend(Element, Element.Methods);
+
+if (!Prototype.BrowserFeatures.ElementExtensions &&
+ document.createElement('div').__proto__) {
+ window.HTMLElement = { };
+ window.HTMLElement.prototype = document.createElement('div').__proto__;
+ Prototype.BrowserFeatures.ElementExtensions = true;
+}
+
+Element.extend = (function() {
+ if (Prototype.BrowserFeatures.SpecificElementExtensions)
+ return Prototype.K;
+
+ var Methods = { }, ByTag = Element.Methods.ByTag;
+
+ var extend = Object.extend(function(element) {
+ if (!element || element._extendedByPrototype ||
+ element.nodeType != 1 || element == window) return element;
+
+ var methods = Object.clone(Methods),
+ tagName = element.tagName, property, value;
+
+ // extend methods for specific tags
+ if (ByTag[tagName]) Object.extend(methods, ByTag[tagName]);
+
+ for (property in methods) {
+ value = methods[property];
+ if (Object.isFunction(value) && !(property in element))
+ element[property] = value.methodize();
+ }
+
+ element._extendedByPrototype = Prototype.emptyFunction;
+ return element;
+
+ }, {
+ refresh: function() {
+ // extend methods for all tags (Safari doesn't need this)
+ if (!Prototype.BrowserFeatures.ElementExtensions) {
+ Object.extend(Methods, Element.Methods);
+ Object.extend(Methods, Element.Methods.Simulated);
+ }
+ }
+ });
+
+ extend.refresh();
+ return extend;
+})();
+
+Element.hasAttribute = function(element, attribute) {
+ if (element.hasAttribute) return element.hasAttribute(attribute);
+ return Element.Methods.Simulated.hasAttribute(element, attribute);
+};
+
+Element.addMethods = function(methods) {
+ var F = Prototype.BrowserFeatures, T = Element.Methods.ByTag;
+
+ if (!methods) {
+ Object.extend(Form, Form.Methods);
+ Object.extend(Form.Element, Form.Element.Methods);
+ Object.extend(Element.Methods.ByTag, {
+ "FORM": Object.clone(Form.Methods),
+ "INPUT": Object.clone(Form.Element.Methods),
+ "SELECT": Object.clone(Form.Element.Methods),
+ "TEXTAREA": Object.clone(Form.Element.Methods)
+ });
+ }
+
+ if (arguments.length == 2) {
+ var tagName = methods;
+ methods = arguments[1];
+ }
+
+ if (!tagName) Object.extend(Element.Methods, methods || { });
+ else {
+ if (Object.isArray(tagName)) tagName.each(extend);
+ else extend(tagName);
+ }
+
+ function extend(tagName) {
+ tagName = tagName.toUpperCase();
+ if (!Element.Methods.ByTag[tagName])
+ Element.Methods.ByTag[tagName] = { };
+ Object.extend(Element.Methods.ByTag[tagName], methods);
+ }
+
+ function copy(methods, destination, onlyIfAbsent) {
+ onlyIfAbsent = onlyIfAbsent || false;
+ for (var property in methods) {
+ var value = methods[property];
+ if (!Object.isFunction(value)) continue;
+ if (!onlyIfAbsent || !(property in destination))
+ destination[property] = value.methodize();
+ }
+ }
+
+ function findDOMClass(tagName) {
+ var klass;
+ var trans = {
+ "OPTGROUP": "OptGroup", "TEXTAREA": "TextArea", "P": "Paragraph",
+ "FIELDSET": "FieldSet", "UL": "UList", "OL": "OList", "DL": "DList",
+ "DIR": "Directory", "H1": "Heading", "H2": "Heading", "H3": "Heading",
+ "H4": "Heading", "H5": "Heading", "H6": "Heading", "Q": "Quote",
+ "INS": "Mod", "DEL": "Mod", "A": "Anchor", "IMG": "Image", "CAPTION":
+ "TableCaption", "COL": "TableCol", "COLGROUP": "TableCol", "THEAD":
+ "TableSection", "TFOOT": "TableSection", "TBODY": "TableSection", "TR":
+ "TableRow", "TH": "TableCell", "TD": "TableCell", "FRAMESET":
+ "FrameSet", "IFRAME": "IFrame"
+ };
+ if (trans[tagName]) klass = 'HTML' + trans[tagName] + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName + 'Element';
+ if (window[klass]) return window[klass];
+ klass = 'HTML' + tagName.capitalize() + 'Element';
+ if (window[klass]) return window[klass];
+
+ window[klass] = { };
+ window[klass].prototype = document.createElement(tagName).__proto__;
+ return window[klass];
+ }
+
+ if (F.ElementExtensions) {
+ copy(Element.Methods, HTMLElement.prototype);
+ copy(Element.Methods.Simulated, HTMLElement.prototype, true);
+ }
+
+ if (F.SpecificElementExtensions) {
+ for (var tag in Element.Methods.ByTag) {
+ var klass = findDOMClass(tag);
+ if (Object.isUndefined(klass)) continue;
+ copy(T[tag], klass.prototype);
+ }
+ }
+
+ Object.extend(Element, Element.Methods);
+ delete Element.ByTag;
+
+ if (Element.extend.refresh) Element.extend.refresh();
+ Element.cache = { };
+};
+
+document.viewport = {
+ getDimensions: function() {
+ var dimensions = { };
+ $w('width height').each(function(d) {
+ var D = d.capitalize();
+ dimensions[d] = self['inner' + D] ||
+ (document.documentElement['client' + D] || document.body['client' + D]);
+ });
+ return dimensions;
+ },
+
+ getWidth: function() {
+ return this.getDimensions().width;
+ },
+
+ getHeight: function() {
+ return this.getDimensions().height;
+ },
+
+ getScrollOffsets: function() {
+ return Element._returnOffset(
+ window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft,
+ window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop);
+ }
+};
+/* Portions of the Selector class are derived from Jack Slocum’s DomQuery,
+ * part of YUI-Ext version 0.40, distributed under the terms of an MIT-style
+ * license. Please see http://www.yui-ext.com/ for more information. */
+
+var Selector = Class.create({
+ initialize: function(expression) {
+ this.expression = expression.strip();
+ this.compileMatcher();
+ },
+
+ compileMatcher: function() {
+ // Selectors with namespaced attributes can't use the XPath version
+ if (Prototype.BrowserFeatures.XPath && !(/(\[[\w-]*?:|:checked)/).test(this.expression))
+ return this.compileXPathMatcher();
+
+ var e = this.expression, ps = Selector.patterns, h = Selector.handlers,
+ c = Selector.criteria, le, p, m;
+
+ if (Selector._cache[e]) {
+ this.matcher = Selector._cache[e];
+ return;
+ }
+
+ this.matcher = ["this.matcher = function(root) {",
+ "var r = root, h = Selector.handlers, c = false, n;"];
+
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ p = ps[i];
+ if (m = e.match(p)) {
+ this.matcher.push(Object.isFunction(c[i]) ? c[i](m) :
+ new Template(c[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.matcher.push("return h.unique(n);\n}");
+ eval(this.matcher.join('\n'));
+ Selector._cache[this.expression] = this.matcher;
+ },
+
+ compileXPathMatcher: function() {
+ var e = this.expression, ps = Selector.patterns,
+ x = Selector.xpath, le, m;
+
+ if (Selector._cache[e]) {
+ this.xpath = Selector._cache[e]; return;
+ }
+
+ this.matcher = ['.//*'];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ if (m = e.match(ps[i])) {
+ this.matcher.push(Object.isFunction(x[i]) ? x[i](m) :
+ new Template(x[i]).evaluate(m));
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+
+ this.xpath = this.matcher.join('');
+ Selector._cache[this.expression] = this.xpath;
+ },
+
+ findElements: function(root) {
+ root = root || document;
+ if (this.xpath) return document._getElementsByXPath(this.xpath, root);
+ return this.matcher(root);
+ },
+
+ match: function(element) {
+ this.tokens = [];
+
+ var e = this.expression, ps = Selector.patterns, as = Selector.assertions;
+ var le, p, m;
+
+ while (e && le !== e && (/\S/).test(e)) {
+ le = e;
+ for (var i in ps) {
+ p = ps[i];
+ if (m = e.match(p)) {
+ // use the Selector.assertions methods unless the selector
+ // is too complex.
+ if (as[i]) {
+ this.tokens.push([i, Object.clone(m)]);
+ e = e.replace(m[0], '');
+ } else {
+ // reluctantly do a document-wide search
+ // and look for a match in the array
+ return this.findElements(document).include(element);
+ }
+ }
+ }
+ }
+
+ var match = true, name, matches;
+ for (var i = 0, token; token = this.tokens[i]; i++) {
+ name = token[0], matches = token[1];
+ if (!Selector.assertions[name](element, matches)) {
+ match = false; break;
+ }
+ }
+
+ return match;
+ },
+
+ toString: function() {
+ return this.expression;
+ },
+
+ inspect: function() {
+ return "#<Selector:" + this.expression.inspect() + ">";
+ }
+});
+
+Object.extend(Selector, {
+ _cache: { },
+
+ xpath: {
+ descendant: "//*",
+ child: "/*",
+ adjacent: "/following-sibling::*[1]",
+ laterSibling: '/following-sibling::*',
+ tagName: function(m) {
+ if (m[1] == '*') return '';
+ return "[local-name()='" + m[1].toLowerCase() +
+ "' or local-name()='" + m[1].toUpperCase() + "']";
+ },
+ className: "[contains(concat(' ', @class, ' '), ' #{1} ')]",
+ id: "[@id='#{1}']",
+ attrPresence: "[@#{1}]",
+ attr: function(m) {
+ m[3] = m[5] || m[6];
+ return new Template(Selector.xpath.operators[m[2]]).evaluate(m);
+ },
+ pseudo: function(m) {
+ var h = Selector.xpath.pseudos[m[1]];
+ if (!h) return '';
+ if (Object.isFunction(h)) return h(m);
+ return new Template(Selector.xpath.pseudos[m[1]]).evaluate(m);
+ },
+ operators: {
+ '=': "[@#{1}='#{3}']",
+ '!=': "[@#{1}!='#{3}']",
+ '^=': "[starts-with(@#{1}, '#{3}')]",
+ '$=': "[substring(@#{1}, (string-length(@#{1}) - string-length('#{3}') + 1))='#{3}']",
+ '*=': "[contains(@#{1}, '#{3}')]",
+ '~=': "[contains(concat(' ', @#{1}, ' '), ' #{3} ')]",
+ '|=': "[contains(concat('-', @#{1}, '-'), '-#{3}-')]"
+ },
+ pseudos: {
+ 'first-child': '[not(preceding-sibling::*)]',
+ 'last-child': '[not(following-sibling::*)]',
+ 'only-child': '[not(preceding-sibling::* or following-sibling::*)]',
+ 'empty': "[count(*) = 0 and (count(text()) = 0 or translate(text(), ' \t\r\n', '') = '')]",
+ 'checked': "[@checked]",
+ 'disabled': "[@disabled]",
+ 'enabled': "[not(@disabled)]",
+ 'not': function(m) {
+ var e = m[6], p = Selector.patterns,
+ x = Selector.xpath, le, m, v;
+
+ var exclusion = [];
+ while (e && le != e && (/\S/).test(e)) {
+ le = e;
+ for (var i in p) {
+ if (m = e.match(p[i])) {
+ v = Object.isFunction(x[i]) ? x[i](m) : new Template(x[i]).evaluate(m);
+ exclusion.push("(" + v.substring(1, v.length - 1) + ")");
+ e = e.replace(m[0], '');
+ break;
+ }
+ }
+ }
+ return "[not(" + exclusion.join(" and ") + ")]";
+ },
+ 'nth-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./preceding-sibling::*) + 1) ", m);
+ },
+ 'nth-last-child': function(m) {
+ return Selector.xpath.pseudos.nth("(count(./following-sibling::*) + 1) ", m);
+ },
+ 'nth-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("position() ", m);
+ },
+ 'nth-last-of-type': function(m) {
+ return Selector.xpath.pseudos.nth("(last() + 1 - position()) ", m);
+ },
+ 'first-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-of-type'](m);
+ },
+ 'last-of-type': function(m) {
+ m[6] = "1"; return Selector.xpath.pseudos['nth-last-of-type'](m);
+ },
+ 'only-of-type': function(m) {
+ var p = Selector.xpath.pseudos; return p['first-of-type'](m) + p['last-of-type'](m);
+ },
+ nth: function(fragment, m) {
+ var mm, formula = m[6], predicate;
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ if (mm = formula.match(/^(\d+)$/)) // digit only
+ return '[' + fragment + "= " + mm[1] + ']';
+ if (mm = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (mm[1] == "-") mm[1] = -1;
+ var a = mm[1] ? Number(mm[1]) : 1;
+ var b = mm[2] ? Number(mm[2]) : 0;
+ predicate = "[((#{fragment} - #{b}) mod #{a} = 0) and " +
+ "((#{fragment} - #{b}) div #{a} >= 0)]";
+ return new Template(predicate).evaluate({
+ fragment: fragment, a: a, b: b });
+ }
+ }
+ }
+ },
+
+ criteria: {
+ tagName: 'n = h.tagName(n, r, "#{1}", c); c = false;',
+ className: 'n = h.className(n, r, "#{1}", c); c = false;',
+ id: 'n = h.id(n, r, "#{1}", c); c = false;',
+ attrPresence: 'n = h.attrPresence(n, r, "#{1}"); c = false;',
+ attr: function(m) {
+ m[3] = (m[5] || m[6]);
+ return new Template('n = h.attr(n, r, "#{1}", "#{3}", "#{2}"); c = false;').evaluate(m);
+ },
+ pseudo: function(m) {
+ if (m[6]) m[6] = m[6].replace(/"/g, '\\"');
+ return new Template('n = h.pseudo(n, "#{1}", "#{6}", r, c); c = false;').evaluate(m);
+ },
+ descendant: 'c = "descendant";',
+ child: 'c = "child";',
+ adjacent: 'c = "adjacent";',
+ laterSibling: 'c = "laterSibling";'
+ },
+
+ patterns: {
+ // combinators must be listed first
+ // (and descendant needs to be last combinator)
+ laterSibling: /^\s*~\s*/,
+ child: /^\s*>\s*/,
+ adjacent: /^\s*\+\s*/,
+ descendant: /^\s/,
+
+ // selectors follow
+ tagName: /^\s*(\*|[\w\-]+)(\b|$)?/,
+ id: /^#([\w\-\*]+)(\b|$)/,
+ className: /^\.([\w\-\*]+)(\b|$)/,
+ pseudo: /^:((first|last|nth|nth-last|only)(-child|-of-type)|empty|checked|(en|dis)abled|not)(\((.*?)\))?(\b|$|(?=\s)|(?=:))/,
+ attrPresence: /^\[([\w]+)\]/,
+ attr: /\[((?:[\w-]*:)?[\w-]+)\s*(?:([!^$*~|]?=)\s*((['"])([^\4]*?)\4|([^'"][^\]]*?)))?\]/
+ },
+
+ // for Selector.match and Element#match
+ assertions: {
+ tagName: function(element, matches) {
+ return matches[1].toUpperCase() == element.tagName.toUpperCase();
+ },
+
+ className: function(element, matches) {
+ return Element.hasClassName(element, matches[1]);
+ },
+
+ id: function(element, matches) {
+ return element.id === matches[1];
+ },
+
+ attrPresence: function(element, matches) {
+ return Element.hasAttribute(element, matches[1]);
+ },
+
+ attr: function(element, matches) {
+ var nodeValue = Element.readAttribute(element, matches[1]);
+ return Selector.operators[matches[2]](nodeValue, matches[3]);
+ }
+ },
+
+ handlers: {
+ // UTILITY FUNCTIONS
+ // joins two collections
+ concat: function(a, b) {
+ for (var i = 0, node; node = b[i]; i++)
+ a.push(node);
+ return a;
+ },
+
+ // marks an array of nodes for counting
+ mark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._counted = true;
+ return nodes;
+ },
+
+ unmark: function(nodes) {
+ for (var i = 0, node; node = nodes[i]; i++)
+ node._counted = undefined;
+ return nodes;
+ },
+
+ // mark each child node with its position (for nth calls)
+ // "ofType" flag indicates whether we're indexing for nth-of-type
+ // rather than nth-child
+ index: function(parentNode, reverse, ofType) {
+ parentNode._counted = true;
+ if (reverse) {
+ for (var nodes = parentNode.childNodes, i = nodes.length - 1, j = 1; i >= 0; i--) {
+ var node = nodes[i];
+ if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
+ }
+ } else {
+ for (var i = 0, j = 1, nodes = parentNode.childNodes; node = nodes[i]; i++)
+ if (node.nodeType == 1 && (!ofType || node._counted)) node.nodeIndex = j++;
+ }
+ },
+
+ // filters out duplicates and extends all nodes
+ unique: function(nodes) {
+ if (nodes.length == 0) return nodes;
+ var results = [], n;
+ for (var i = 0, l = nodes.length; i < l; i++)
+ if (!(n = nodes[i])._counted) {
+ n._counted = true;
+ results.push(Element.extend(n));
+ }
+ return Selector.handlers.unmark(results);
+ },
+
+ // COMBINATOR FUNCTIONS
+ descendant: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName('*'));
+ return results;
+ },
+
+ child: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ for (var j = 0, children = [], child; child = node.childNodes[j]; j++)
+ if (child.nodeType == 1 && child.tagName != '!') results.push(child);
+ }
+ return results;
+ },
+
+ adjacent: function(nodes) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ var next = this.nextElementSibling(node);
+ if (next) results.push(next);
+ }
+ return results;
+ },
+
+ laterSibling: function(nodes) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ h.concat(results, Element.nextSiblings(node));
+ return results;
+ },
+
+ nextElementSibling: function(node) {
+ while (node = node.nextSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ previousElementSibling: function(node) {
+ while (node = node.previousSibling)
+ if (node.nodeType == 1) return node;
+ return null;
+ },
+
+ // TOKEN FUNCTIONS
+ tagName: function(nodes, root, tagName, combinator) {
+ tagName = tagName.toUpperCase();
+ var results = [], h = Selector.handlers;
+ if (nodes) {
+ if (combinator) {
+ // fastlane for ordinary descendant combinators
+ if (combinator == "descendant") {
+ for (var i = 0, node; node = nodes[i]; i++)
+ h.concat(results, node.getElementsByTagName(tagName));
+ return results;
+ } else nodes = this[combinator](nodes);
+ if (tagName == "*") return nodes;
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.tagName.toUpperCase() == tagName) results.push(node);
+ return results;
+ } else return root.getElementsByTagName(tagName);
+ },
+
+ id: function(nodes, root, id, combinator) {
+ var targetNode = $(id), h = Selector.handlers;
+ if (!targetNode) return [];
+ if (!nodes && root == document) return [targetNode];
+ if (nodes) {
+ if (combinator) {
+ if (combinator == 'child') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (targetNode.parentNode == node) return [targetNode];
+ } else if (combinator == 'descendant') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.descendantOf(targetNode, node)) return [targetNode];
+ } else if (combinator == 'adjacent') {
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Selector.handlers.previousElementSibling(targetNode) == node)
+ return [targetNode];
+ } else nodes = h[combinator](nodes);
+ }
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node == targetNode) return [targetNode];
+ return [];
+ }
+ return (targetNode && Element.descendantOf(targetNode, root)) ? [targetNode] : [];
+ },
+
+ className: function(nodes, root, className, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ return Selector.handlers.byClassName(nodes, root, className);
+ },
+
+ byClassName: function(nodes, root, className) {
+ if (!nodes) nodes = Selector.handlers.descendant([root]);
+ var needle = ' ' + className + ' ';
+ for (var i = 0, results = [], node, nodeClassName; node = nodes[i]; i++) {
+ nodeClassName = node.className;
+ if (nodeClassName.length == 0) continue;
+ if (nodeClassName == className || (' ' + nodeClassName + ' ').include(needle))
+ results.push(node);
+ }
+ return results;
+ },
+
+ attrPresence: function(nodes, root, attr) {
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ var results = [];
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (Element.hasAttribute(node, attr)) results.push(node);
+ return results;
+ },
+
+ attr: function(nodes, root, attr, value, operator) {
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ var handler = Selector.operators[operator], results = [];
+ for (var i = 0, node; node = nodes[i]; i++) {
+ var nodeValue = Element.readAttribute(node, attr);
+ if (nodeValue === null) continue;
+ if (handler(nodeValue, value)) results.push(node);
+ }
+ return results;
+ },
+
+ pseudo: function(nodes, name, value, root, combinator) {
+ if (nodes && combinator) nodes = this[combinator](nodes);
+ if (!nodes) nodes = root.getElementsByTagName("*");
+ return Selector.pseudos[name](nodes, value, root);
+ }
+ },
+
+ pseudos: {
+ 'first-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.previousElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'last-child': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ if (Selector.handlers.nextElementSibling(node)) continue;
+ results.push(node);
+ }
+ return results;
+ },
+ 'only-child': function(nodes, value, root) {
+ var h = Selector.handlers;
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!h.previousElementSibling(node) && !h.nextElementSibling(node))
+ results.push(node);
+ return results;
+ },
+ 'nth-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root);
+ },
+ 'nth-last-child': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true);
+ },
+ 'nth-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, false, true);
+ },
+ 'nth-last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, formula, root, true, true);
+ },
+ 'first-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, false, true);
+ },
+ 'last-of-type': function(nodes, formula, root) {
+ return Selector.pseudos.nth(nodes, "1", root, true, true);
+ },
+ 'only-of-type': function(nodes, formula, root) {
+ var p = Selector.pseudos;
+ return p['last-of-type'](p['first-of-type'](nodes, formula, root), formula, root);
+ },
+
+ // handles the an+b logic
+ getIndices: function(a, b, total) {
+ if (a == 0) return b > 0 ? [b] : [];
+ return $R(1, total).inject([], function(memo, i) {
+ if (0 == (i - b) % a && (i - b) / a >= 0) memo.push(i);
+ return memo;
+ });
+ },
+
+ // handles nth(-last)-child, nth(-last)-of-type, and (first|last)-of-type
+ nth: function(nodes, formula, root, reverse, ofType) {
+ if (nodes.length == 0) return [];
+ if (formula == 'even') formula = '2n+0';
+ if (formula == 'odd') formula = '2n+1';
+ var h = Selector.handlers, results = [], indexed = [], m;
+ h.mark(nodes);
+ for (var i = 0, node; node = nodes[i]; i++) {
+ if (!node.parentNode._counted) {
+ h.index(node.parentNode, reverse, ofType);
+ indexed.push(node.parentNode);
+ }
+ }
+ if (formula.match(/^\d+$/)) { // just a number
+ formula = Number(formula);
+ for (var i = 0, node; node = nodes[i]; i++)
+ if (node.nodeIndex == formula) results.push(node);
+ } else if (m = formula.match(/^(-?\d*)?n(([+-])(\d+))?/)) { // an+b
+ if (m[1] == "-") m[1] = -1;
+ var a = m[1] ? Number(m[1]) : 1;
+ var b = m[2] ? Number(m[2]) : 0;
+ var indices = Selector.pseudos.getIndices(a, b, nodes.length);
+ for (var i = 0, node, l = indices.length; node = nodes[i]; i++) {
+ for (var j = 0; j < l; j++)
+ if (node.nodeIndex == indices[j]) results.push(node);
+ }
+ }
+ h.unmark(nodes);
+ h.unmark(indexed);
+ return results;
+ },
+
+ 'empty': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++) {
+ // IE treats comments as element nodes
+ if (node.tagName == '!' || (node.firstChild && !node.innerHTML.match(/^\s*$/))) continue;
+ results.push(node);
+ }
+ return results;
+ },
+
+ 'not': function(nodes, selector, root) {
+ var h = Selector.handlers, selectorType, m;
+ var exclusions = new Selector(selector).findElements(root);
+ h.mark(exclusions);
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node._counted) results.push(node);
+ h.unmark(exclusions);
+ return results;
+ },
+
+ 'enabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (!node.disabled) results.push(node);
+ return results;
+ },
+
+ 'disabled': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.disabled) results.push(node);
+ return results;
+ },
+
+ 'checked': function(nodes, value, root) {
+ for (var i = 0, results = [], node; node = nodes[i]; i++)
+ if (node.checked) results.push(node);
+ return results;
+ }
+ },
+
+ operators: {
+ '=': function(nv, v) { return nv == v; },
+ '!=': function(nv, v) { return nv != v; },
+ '^=': function(nv, v) { return nv.startsWith(v); },
+ '$=': function(nv, v) { return nv.endsWith(v); },
+ '*=': function(nv, v) { return nv.include(v); },
+ '~=': function(nv, v) { return (' ' + nv + ' ').include(' ' + v + ' '); },
+ '|=': function(nv, v) { return ('-' + nv.toUpperCase() + '-').include('-' + v.toUpperCase() + '-'); }
+ },
+
+ matchElements: function(elements, expression) {
+ var matches = new Selector(expression).findElements(), h = Selector.handlers;
+ h.mark(matches);
+ for (var i = 0, results = [], element; element = elements[i]; i++)
+ if (element._counted) results.push(element);
+ h.unmark(matches);
+ return results;
+ },
+
+ findElement: function(elements, expression, index) {
+ if (Object.isNumber(expression)) {
+ index = expression; expression = false;
+ }
+ return Selector.matchElements(elements, expression || '*')[index || 0];
+ },
+
+ findChildElements: function(element, expressions) {
+ var exprs = expressions.join(','), expressions = [];
+ exprs.scan(/(([\w#:.~>+()\s-]+|\*|\[.*?\])+)\s*(,|$)/, function(m) {
+ expressions.push(m[1].strip());
+ });
+ var results = [], h = Selector.handlers;
+ for (var i = 0, l = expressions.length, selector; i < l; i++) {
+ selector = new Selector(expressions[i].strip());
+ h.concat(results, selector.findElements(element));
+ }
+ return (l > 1) ? h.unique(results) : results;
+ }
+});
+
+function $$() {
+ return Selector.findChildElements(document, $A(arguments));
+}
+var Form = {
+ reset: function(form) {
+ $(form).reset();
+ return form;
+ },
+
+ serializeElements: function(elements, options) {
+ if (typeof options != 'object') options = { hash: !!options };
+ else if (options.hash === undefined) options.hash = true;
+ var key, value, submitted = false, submit = options.submit;
+
+ var data = elements.inject({ }, function(result, element) {
+ if (!element.disabled && element.name) {
+ key = element.name; value = $(element).getValue();
+ if (value != null && (element.type != 'submit' || (!submitted &&
+ submit !== false && (!submit || key == submit) && (submitted = true)))) {
+ if (key in result) {
+ // a key is already present; construct an array of values
+ if (!Object.isArray(result[key])) result[key] = [result[key]];
+ result[key].push(value);
+ }
+ else result[key] = value;
+ }
+ }
+ return result;
+ });
+
+ return options.hash ? data : Object.toQueryString(data);
+ }
+};
+
+Form.Methods = {
+ serialize: function(form, options) {
+ return Form.serializeElements(Form.getElements(form), options);
+ },
+
+ getElements: function(form) {
+ return $A($(form).getElementsByTagName('*')).inject([],
+ function(elements, child) {
+ if (Form.Element.Serializers[child.tagName.toLowerCase()])
+ elements.push(Element.extend(child));
+ return elements;
+ }
+ );
+ },
+
+ getInputs: function(form, typeName, name) {
+ form = $(form);
+ var inputs = form.getElementsByTagName('input');
+
+ if (!typeName && !name) return $A(inputs).map(Element.extend);
+
+ for (var i = 0, matchingInputs = [], length = inputs.length; i < length; i++) {
+ var input = inputs[i];
+ if ((typeName && input.type != typeName) || (name && input.name != name))
+ continue;
+ matchingInputs.push(Element.extend(input));
+ }
+
+ return matchingInputs;
+ },
+
+ disable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('disable');
+ return form;
+ },
+
+ enable: function(form) {
+ form = $(form);
+ Form.getElements(form).invoke('enable');
+ return form;
+ },
+
+ findFirstElement: function(form) {
+ var elements = $(form).getElements().findAll(function(element) {
+ return 'hidden' != element.type && !element.disabled;
+ });
+ var firstByIndex = elements.findAll(function(element) {
+ return element.hasAttribute('tabIndex') && element.tabIndex >= 0;
+ }).sortBy(function(element) { return element.tabIndex }).first();
+
+ return firstByIndex ? firstByIndex : elements.find(function(element) {
+ return ['input', 'select', 'textarea'].include(element.tagName.toLowerCase());
+ });
+ },
+
+ focusFirstElement: function(form) {
+ form = $(form);
+ form.findFirstElement().activate();
+ return form;
+ },
+
+ request: function(form, options) {
+ form = $(form), options = Object.clone(options || { });
+
+ var params = options.parameters, action = form.readAttribute('action') || '';
+ if (action.blank()) action = window.location.href;
+ options.parameters = form.serialize(true);
+
+ if (params) {
+ if (Object.isString(params)) params = params.toQueryParams();
+ Object.extend(options.parameters, params);
+ }
+
+ if (form.hasAttribute('method') && !options.method)
+ options.method = form.method;
+
+ return new Ajax.Request(action, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element = {
+ focus: function(element) {
+ $(element).focus();
+ return element;
+ },
+
+ select: function(element) {
+ $(element).select();
+ return element;
+ }
+};
+
+Form.Element.Methods = {
+ serialize: function(element) {
+ element = $(element);
+ if (!element.disabled && element.name) {
+ var value = element.getValue();
+ if (value != undefined) {
+ var pair = { };
+ pair[element.name] = value;
+ return Object.toQueryString(pair);
+ }
+ }
+ return '';
+ },
+
+ getValue: function(element) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ return Form.Element.Serializers[method](element);
+ },
+
+ setValue: function(element, value) {
+ element = $(element);
+ var method = element.tagName.toLowerCase();
+ Form.Element.Serializers[method](element, value);
+ return element;
+ },
+
+ clear: function(element) {
+ $(element).value = '';
+ return element;
+ },
+
+ present: function(element) {
+ return $(element).value != '';
+ },
+
+ activate: function(element) {
+ element = $(element);
+ try {
+ element.focus();
+ if (element.select && (element.tagName.toLowerCase() != 'input' ||
+ !['button', 'reset', 'submit'].include(element.type)))
+ element.select();
+ } catch (e) { }
+ return element;
+ },
+
+ disable: function(element) {
+ element = $(element);
+ element.blur();
+ element.disabled = true;
+ return element;
+ },
+
+ enable: function(element) {
+ element = $(element);
+ element.disabled = false;
+ return element;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+var Field = Form.Element;
+var $F = Form.Element.Methods.getValue;
+
+/*--------------------------------------------------------------------------*/
+
+Form.Element.Serializers = {
+ input: function(element, value) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ return Form.Element.Serializers.inputSelector(element, value);
+ default:
+ return Form.Element.Serializers.textarea(element, value);
+ }
+ },
+
+ inputSelector: function(element, value) {
+ if (value === undefined) return element.checked ? element.value : null;
+ else element.checked = !!value;
+ },
+
+ textarea: function(element, value) {
+ if (value === undefined) return element.value;
+ else element.value = value;
+ },
+
+ select: function(element, index) {
+ if (index === undefined)
+ return this[element.type == 'select-one' ?
+ 'selectOne' : 'selectMany'](element);
+ else {
+ var opt, value, single = !Object.isArray(index);
+ for (var i = 0, length = element.length; i < length; i++) {
+ opt = element.options[i];
+ value = this.optionValue(opt);
+ if (single) {
+ if (value == index) {
+ opt.selected = true;
+ return;
+ }
+ }
+ else opt.selected = index.include(value);
+ }
+ }
+ },
+
+ selectOne: function(element) {
+ var index = element.selectedIndex;
+ return index >= 0 ? this.optionValue(element.options[index]) : null;
+ },
+
+ selectMany: function(element) {
+ var values, length = element.length;
+ if (!length) return null;
+
+ for (var i = 0, values = []; i < length; i++) {
+ var opt = element.options[i];
+ if (opt.selected) values.push(this.optionValue(opt));
+ }
+ return values;
+ },
+
+ optionValue: function(opt) {
+ // extend element because hasAttribute may not be native
+ return Element.extend(opt).hasAttribute('value') ? opt.value : opt.text;
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.TimedObserver = Class.create(PeriodicalExecuter, {
+ initialize: function($super, element, frequency, callback) {
+ $super(callback, frequency);
+ this.element = $(element);
+ this.lastValue = this.getValue();
+ },
+
+ execute: function() {
+ var value = this.getValue();
+ if (Object.isString(this.lastValue) && Object.isString(value) ?
+ this.lastValue != value : String(this.lastValue) != String(value)) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ }
+});
+
+Form.Element.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.Observer = Class.create(Abstract.TimedObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+
+/*--------------------------------------------------------------------------*/
+
+Abstract.EventObserver = Class.create({
+ initialize: function(element, callback) {
+ this.element = $(element);
+ this.callback = callback;
+
+ this.lastValue = this.getValue();
+ if (this.element.tagName.toLowerCase() == 'form')
+ this.registerFormCallbacks();
+ else
+ this.registerCallback(this.element);
+ },
+
+ onElementEvent: function() {
+ var value = this.getValue();
+ if (this.lastValue != value) {
+ this.callback(this.element, value);
+ this.lastValue = value;
+ }
+ },
+
+ registerFormCallbacks: function() {
+ Form.getElements(this.element).each(this.registerCallback, this);
+ },
+
+ registerCallback: function(element) {
+ if (element.type) {
+ switch (element.type.toLowerCase()) {
+ case 'checkbox':
+ case 'radio':
+ Event.observe(element, 'click', this.onElementEvent.bind(this));
+ break;
+ default:
+ Event.observe(element, 'change', this.onElementEvent.bind(this));
+ break;
+ }
+ }
+ }
+});
+
+Form.Element.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.Element.getValue(this.element);
+ }
+});
+
+Form.EventObserver = Class.create(Abstract.EventObserver, {
+ getValue: function() {
+ return Form.serialize(this.element);
+ }
+});
+if (!window.Event) var Event = { };
+
+Object.extend(Event, {
+ KEY_BACKSPACE: 8,
+ KEY_TAB: 9,
+ KEY_RETURN: 13,
+ KEY_ESC: 27,
+ KEY_LEFT: 37,
+ KEY_UP: 38,
+ KEY_RIGHT: 39,
+ KEY_DOWN: 40,
+ KEY_DELETE: 46,
+ KEY_HOME: 36,
+ KEY_END: 35,
+ KEY_PAGEUP: 33,
+ KEY_PAGEDOWN: 34,
+ KEY_INSERT: 45,
+
+ cache: { },
+
+ relatedTarget: function(event) {
+ var element;
+ switch(event.type) {
+ case 'mouseover': element = event.fromElement; break;
+ case 'mouseout': element = event.toElement; break;
+ default: return null;
+ }
+ return Element.extend(element);
+ }
+});
+
+Event.Methods = (function() {
+ var isButton;
+
+ if (Prototype.Browser.IE) {
+ var buttonMap = { 0: 1, 1: 4, 2: 2 };
+ isButton = function(event, code) {
+ return event.button == buttonMap[code];
+ };
+
+ } else if (Prototype.Browser.WebKit) {
+ isButton = function(event, code) {
+ switch (code) {
+ case 0: return event.which == 1 && !event.metaKey;
+ case 1: return event.which == 1 && event.metaKey;
+ default: return false;
+ }
+ };
+
+ } else {
+ isButton = function(event, code) {
+ return event.which ? (event.which === code + 1) : (event.button === code);
+ };
+ }
+
+ return {
+ isLeftClick: function(event) { return isButton(event, 0) },
+ isMiddleClick: function(event) { return isButton(event, 1) },
+ isRightClick: function(event) { return isButton(event, 2) },
+
+ element: function(event) {
+ var node = Event.extend(event).target;
+ return Element.extend(node.nodeType == Node.TEXT_NODE ? node.parentNode : node);
+ },
+
+ findElement: function(event, expression) {
+ var element = Event.element(event);
+ return element.match(expression) ? element : element.up(expression);
+ },
+
+ pointer: function(event) {
+ return {
+ x: event.pageX || (event.clientX +
+ (document.documentElement.scrollLeft || document.body.scrollLeft)),
+ y: event.pageY || (event.clientY +
+ (document.documentElement.scrollTop || document.body.scrollTop))
+ };
+ },
+
+ pointerX: function(event) { return Event.pointer(event).x },
+ pointerY: function(event) { return Event.pointer(event).y },
+
+ stop: function(event) {
+ Event.extend(event);
+ event.preventDefault();
+ event.stopPropagation();
+ event.stopped = true;
+ }
+ };
+})();
+
+Event.extend = (function() {
+ var methods = Object.keys(Event.Methods).inject({ }, function(m, name) {
+ m[name] = Event.Methods[name].methodize();
+ return m;
+ });
+
+ if (Prototype.Browser.IE) {
+ Object.extend(methods, {
+ stopPropagation: function() { this.cancelBubble = true },
+ preventDefault: function() { this.returnValue = false },
+ inspect: function() { return "[object Event]" }
+ });
+
+ return function(event) {
+ if (!event) return false;
+ if (event._extendedByPrototype) return event;
+
+ event._extendedByPrototype = Prototype.emptyFunction;
+ var pointer = Event.pointer(event);
+ Object.extend(event, {
+ target: event.srcElement,
+ relatedTarget: Event.relatedTarget(event),
+ pageX: pointer.x,
+ pageY: pointer.y
+ });
+ return Object.extend(event, methods);
+ };
+
+ } else {
+ Event.prototype = Event.prototype || document.createEvent("HTMLEvents").__proto__;
+ Object.extend(Event.prototype, methods);
+ return Prototype.K;
+ }
+})();
+
+Object.extend(Event, (function() {
+ var cache = Event.cache;
+
+ function getEventID(element) {
+ if (element._eventID) return element._eventID;
+ arguments.callee.id = arguments.callee.id || 1;
+ return element._eventID = ++arguments.callee.id;
+ }
+
+ function getDOMEventName(eventName) {
+ if (eventName && eventName.include(':')) return "dataavailable";
+ return eventName;
+ }
+
+ function getCacheForID(id) {
+ return cache[id] = cache[id] || { };
+ }
+
+ function getWrappersForEventName(id, eventName) {
+ var c = getCacheForID(id);
+ return c[eventName] = c[eventName] || [];
+ }
+
+ function createWrapper(element, eventName, handler) {
+ var id = getEventID(element);
+ var c = getWrappersForEventName(id, eventName);
+ if (c.pluck("handler").include(handler)) return false;
+
+ var wrapper = function(event) {
+ if (!Event || !Event.extend ||
+ (event.eventName && event.eventName != eventName))
+ return false;
+
+ Event.extend(event);
+ handler.call(element, event)
+ };
+
+ wrapper.handler = handler;
+ c.push(wrapper);
+ return wrapper;
+ }
+
+ function findWrapper(id, eventName, handler) {
+ var c = getWrappersForEventName(id, eventName);
+ return c.find(function(wrapper) { return wrapper.handler == handler });
+ }
+
+ function destroyWrapper(id, eventName, handler) {
+ var c = getCacheForID(id);
+ if (!c[eventName]) return false;
+ c[eventName] = c[eventName].without(findWrapper(id, eventName, handler));
+ }
+
+ function destroyCache() {
+ for (var id in cache)
+ for (var eventName in cache[id])
+ cache[id][eventName] = null;
+ }
+
+ if (window.attachEvent) {
+ window.attachEvent("onunload", destroyCache);
+ }
+
+ return {
+ observe: function(element, eventName, handler) {
+ element = $(element);
+ var name = getDOMEventName(eventName);
+
+ var wrapper = createWrapper(element, eventName, handler);
+ if (!wrapper) return element;
+
+ if (element.addEventListener) {
+ element.addEventListener(name, wrapper, false);
+ } else {
+ element.attachEvent("on" + name, wrapper);
+ }
+
+ return element;
+ },
+
+ stopObserving: function(element, eventName, handler) {
+ element = $(element);
+ var id = getEventID(element), name = getDOMEventName(eventName);
+
+ if (!handler && eventName) {
+ getWrappersForEventName(id, eventName).each(function(wrapper) {
+ element.stopObserving(eventName, wrapper.handler);
+ });
+ return element;
+
+ } else if (!eventName) {
+ Object.keys(getCacheForID(id)).each(function(eventName) {
+ element.stopObserving(eventName);
+ });
+ return element;
+ }
+
+ var wrapper = findWrapper(id, eventName, handler);
+ if (!wrapper) return element;
+
+ if (element.removeEventListener) {
+ element.removeEventListener(name, wrapper, false);
+ } else {
+ element.detachEvent("on" + name, wrapper);
+ }
+
+ destroyWrapper(id, eventName, handler);
+
+ return element;
+ },
+
+ fire: function(element, eventName, memo) {
+ element = $(element);
+ if (element == document && document.createEvent && !element.dispatchEvent)
+ element = document.documentElement;
+
+ if (document.createEvent) {
+ var event = document.createEvent("HTMLEvents");
+ event.initEvent("dataavailable", true, true);
+ } else {
+ var event = document.createEventObject();
+ event.eventType = "ondataavailable";
+ }
+
+ event.eventName = eventName;
+ event.memo = memo || { };
+
+ if (document.createEvent) {
+ element.dispatchEvent(event);
+ } else {
+ element.fireEvent(event.eventType, event);
+ }
+
+ return event;
+ }
+ };
+})());
+
+Object.extend(Event, Event.Methods);
+
+Element.addMethods({
+ fire: Event.fire,
+ observe: Event.observe,
+ stopObserving: Event.stopObserving
+});
+
+Object.extend(document, {
+ fire: Element.Methods.fire.methodize(),
+ observe: Element.Methods.observe.methodize(),
+ stopObserving: Element.Methods.stopObserving.methodize()
+});
+
+(function() {
+ /* Support for the DOMContentLoaded event is based on work by Dan Webb,
+ Matthias Miller, Dean Edwards and John Resig. */
+
+ var timer, fired = false;
+
+ function fireContentLoadedEvent() {
+ if (fired) return;
+ if (timer) window.clearInterval(timer);
+ document.fire("dom:loaded");
+ fired = true;
+ }
+
+ if (document.addEventListener) {
+ if (Prototype.Browser.WebKit) {
+ timer = window.setInterval(function() {
+ if (/loaded|complete/.test(document.readyState))
+ fireContentLoadedEvent();
+ }, 0);
+
+ Event.observe(window, "load", fireContentLoadedEvent);
+
+ } else {
+ document.addEventListener("DOMContentLoaded",
+ fireContentLoadedEvent, false);
+ }
+
+ } else {
+ document.write("<script id=__onDOMContentLoaded defer src=//:><\/script>");
+ $("__onDOMContentLoaded").onreadystatechange = function() {
+ if (this.readyState == "complete") {
+ this.onreadystatechange = null;
+ fireContentLoadedEvent();
+ }
+ };
+ }
+})();
+/*------------------------------- DEPRECATED -------------------------------*/
+
+Hash.toQueryString = Object.toQueryString;
+
+var Toggle = { display: Element.toggle };
+
+Element.Methods.childOf = Element.Methods.descendantOf;
+
+var Insertion = {
+ Before: function(element, content) {
+ return Element.insert(element, {before:content});
+ },
+
+ Top: function(element, content) {
+ return Element.insert(element, {top:content});
+ },
+
+ Bottom: function(element, content) {
+ return Element.insert(element, {bottom:content});
+ },
+
+ After: function(element, content) {
+ return Element.insert(element, {after:content});
+ }
+};
+
+var $continue = new Error('"throw $continue" is deprecated, use "return" instead');
+
+// This should be moved to script.aculo.us; notice the deprecated methods
+// further below, that map to the newer Element methods.
+var Position = {
+ // set to true if needed, warning: firefox performance problems
+ // NOT neeeded for page scrolling, only if draggable contained in
+ // scrollable elements
+ includeScrollOffsets: false,
+
+ // must be called before calling withinIncludingScrolloffset, every time the
+ // page is scrolled
+ prepare: function() {
+ this.deltaX = window.pageXOffset
+ || document.documentElement.scrollLeft
+ || document.body.scrollLeft
+ || 0;
+ this.deltaY = window.pageYOffset
+ || document.documentElement.scrollTop
+ || document.body.scrollTop
+ || 0;
+ },
+
+ // caches x/y coordinate pair to use with overlap
+ within: function(element, x, y) {
+ if (this.includeScrollOffsets)
+ return this.withinIncludingScrolloffsets(element, x, y);
+ this.xcomp = x;
+ this.ycomp = y;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (y >= this.offset[1] &&
+ y < this.offset[1] + element.offsetHeight &&
+ x >= this.offset[0] &&
+ x < this.offset[0] + element.offsetWidth);
+ },
+
+ withinIncludingScrolloffsets: function(element, x, y) {
+ var offsetcache = Element.cumulativeScrollOffset(element);
+
+ this.xcomp = x + offsetcache[0] - this.deltaX;
+ this.ycomp = y + offsetcache[1] - this.deltaY;
+ this.offset = Element.cumulativeOffset(element);
+
+ return (this.ycomp >= this.offset[1] &&
+ this.ycomp < this.offset[1] + element.offsetHeight &&
+ this.xcomp >= this.offset[0] &&
+ this.xcomp < this.offset[0] + element.offsetWidth);
+ },
+
+ // within must be called directly before
+ overlap: function(mode, element) {
+ if (!mode) return 0;
+ if (mode == 'vertical')
+ return ((this.offset[1] + element.offsetHeight) - this.ycomp) /
+ element.offsetHeight;
+ if (mode == 'horizontal')
+ return ((this.offset[0] + element.offsetWidth) - this.xcomp) /
+ element.offsetWidth;
+ },
+
+ // Deprecation layer -- use newer Element methods now (1.5.2).
+
+ cumulativeOffset: Element.Methods.cumulativeOffset,
+
+ positionedOffset: Element.Methods.positionedOffset,
+
+ absolutize: function(element) {
+ Position.prepare();
+ return Element.absolutize(element);
+ },
+
+ relativize: function(element) {
+ Position.prepare();
+ return Element.relativize(element);
+ },
+
+ realOffset: Element.Methods.cumulativeScrollOffset,
+
+ offsetParent: Element.Methods.getOffsetParent,
+
+ page: Element.Methods.viewportOffset,
+
+ clone: function(source, target, options) {
+ options = options || { };
+ return Element.clonePosition(target, source, options);
+ }
+};
+
+/*--------------------------------------------------------------------------*/
+
+if (!document.getElementsByClassName) document.getElementsByClassName = function(instanceMethods){
+ function iter(name) {
+ return name.blank() ? null : "[contains(concat(' ', @class, ' '), ' " + name + " ')]";
+ }
+
+ instanceMethods.getElementsByClassName = Prototype.BrowserFeatures.XPath ?
+ function(element, className) {
+ className = className.toString().strip();
+ var cond = /\s/.test(className) ? $w(className).map(iter).join('') : iter(className);
+ return cond ? document._getElementsByXPath('.//*' + cond, element) : [];
+ } : function(element, className) {
+ className = className.toString().strip();
+ var elements = [], classNames = (/\s/.test(className) ? $w(className) : null);
+ if (!classNames && !className) return elements;
+
+ var nodes = $(element).getElementsByTagName('*');
+ className = ' ' + className + ' ';
+
+ for (var i = 0, child, cn; child = nodes[i]; i++) {
+ if (child.className && (cn = ' ' + child.className + ' ') && (cn.include(className) ||
+ (classNames && classNames.all(function(name) {
+ return !name.toString().blank() && cn.include(' ' + name + ' ');
+ }))))
+ elements.push(Element.extend(child));
+ }
+ return elements;
+ };
+
+ return function(className, parentElement) {
+ return $(parentElement || document.body).getElementsByClassName(className);
+ };
+}(Element.Methods);
+
+/*--------------------------------------------------------------------------*/
+
+Element.ClassNames = Class.create();
+Element.ClassNames.prototype = {
+ initialize: function(element) {
+ this.element = $(element);
+ },
+
+ _each: function(iterator) {
+ this.element.className.split(/\s+/).select(function(name) {
+ return name.length > 0;
+ })._each(iterator);
+ },
+
+ set: function(className) {
+ this.element.className = className;
+ },
+
+ add: function(classNameToAdd) {
+ if (this.include(classNameToAdd)) return;
+ this.set($A(this).concat(classNameToAdd).join(' '));
+ },
+
+ remove: function(classNameToRemove) {
+ if (!this.include(classNameToRemove)) return;
+ this.set($A(this).without(classNameToRemove).join(' '));
+ },
+
+ toString: function() {
+ return $A(this).join(' ');
+ }
+};
+
+Object.extend(Element.ClassNames.prototype, Enumerable);
+
+/*--------------------------------------------------------------------------*/
+
Element.addMethods();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/yui-License.txt b/shrine-webclient/src/main/html/js-ext/yui-License.txt
old mode 100755
new mode 100644
index ee46ee990..15d20f159
--- a/shrine-webclient/src/main/html/js-ext/yui-License.txt
+++ b/shrine-webclient/src/main/html/js-ext/yui-License.txt
@@ -1,25 +1,25 @@
-Please see http://developer.yahoo.com/yui/license.html
-
-
-The following was copied from the above URL:
------------------------------------------------------------------------------------------------------------------------------------------
-Software License Agreement (BSD License)
-Copyright (c) 2008, Yahoo! Inc.
-All rights reserved.
-
-Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following
-conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the
- following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
- documentation and/or other materials provided with the distribution.
- * Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this
- software without specific prior written permission of Yahoo! Inc.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+Please see http://developer.yahoo.com/yui/license.html
+
+
+The following was copied from the above URL:
+-----------------------------------------------------------------------------------------------------------------------------------------
+Software License Agreement (BSD License)
+Copyright (c) 2008, Yahoo! Inc.
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification, are permitted provided that the following
+conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the
+ following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+ * Neither the name of Yahoo! Inc. nor the names of its contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission of Yahoo! Inc.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-ext/yui/README b/shrine-webclient/src/main/html/js-ext/yui/README
old mode 100755
new mode 100644
index f88b44d52..aa77970cb
--- a/shrine-webclient/src/main/html/js-ext/yui/README
+++ b/shrine-webclient/src/main/html/js-ext/yui/README
@@ -1,306 +1,306 @@
-YUI Library Release Notes
-
-
-*** version 2.5.2 ***
-
-This update contains the following:
-
-- Patches for DataTable and Menu posted to developer site following the release of 2.5.1 have been incorporated into the build.
-- FireFox 3 compatibility in advance of its release.
-- Opera 9.5 beta compatibility in advance of its release.
-- ActionScript source for Charts and Uploader is now included.
-- Charts component now includes support for dynamically created legends, and new chart and series styles.
-- DataTable bug fixes in pagination, scrolling, and column handling.
-- Several Rich Text Editor bug fixes.
-- Approximately 15 Source Forge bug fixes.
-
-Please see the README file for each component in the build directory for specific updates since version 2.5.1.
-
-*** version 2.5.1 ***
-
-This update contains the following:
-
-- additions to the Yahoo, Uploader, Editor, and DataSource components to improve YUI support for Adobe AIR
-- Douglas Crockford's fix for a security vulnerability where the JSON parser could be tricked into processing
-an unquoted string as quoted which could allow unsafe scripts to be evaled
-- a new aggregate file Ñ yuiloader-dom-event.js that is the ideal baseline rollup to use to be able to
-lazy-load any part of YUI on-demand
-- over 60 bug fixes
-
-Please see the README file for each component in the build directory for specific updates since version 2.5.0.
-
-*** version 2.5.0 ***
-
-This release introduces six new components into YUI:
-
- * Cookie Utility
- * ImageCropper
- * Layout Manager
- * Resize
- * Uploader
- * Profiler Viewer
-
-These new components are introduced as "beta", with the exception of the Charts
-WidgeUploadert which is released as an experimental component. Please see the YUI FAQ
-on the definition of beta and experimental at:
-http://developer.yahoo.com/yui/articles/faq/#beta
-
-In addition to new components, you'll find updates and bug fixes throughout the
-library.
-
-*** version 2.4.1 ***
-
-This update contains one change. We have reverted the change to the way the Event Utility cleans up
-events in its page unload handler that was introduced in 2.4.0. The change resulted in some events
-not being properly unloaded, which in turn resulted in IE-specific memory leaks in some YUI components
-including the Menu Control and controls in the Container Family.
-
-*** version 2.4.0 ***
-
-This release introduces five new components into YUI:
-
- * Selector
- * Charts Widget
- * Get Utility
- * Profiler
- * JSON Utility
-
-These new components are introduced as "beta", with the exception of the Charts
-Widget which is released as an experimental component. Please see the YUI FAQ
-on the definition of beta and experimental at:
-http://developer.yahoo.com/yui/articles/faq/#beta
-
-In addition to new components, you'll find updates and bug fixes throughout the
-library.
-
-*** version 2.3.1 ***
-
-This update contains general fixes to the YUI library. Please see the README
-file for each component in the build directory for specific updates since
-version 2.3.0.
-
-*** version 2.3.0 ***
-
-This release introduces six new components into YUI:
-
- * Base CSS
- * Color Picker Control
- * ImageLoader Utility
- * Rich Text Editor
- * YUI Loader Utility
- * YUI Test Utility
-
-These new components are introduced as "beta", with the exception of ImageLoader
-Utility which is released as an experimental component. Please see the YUI
-FAQ on the definition of beta and experimental at:
-http://developer.yahoo.com/yui/articles/faq/#beta
-
-In addition to new components, you'll find updates and bug fixes throughout the
-library.
-
-*** version 2.2.2 ***
-
-This update contains general fixes to the YUI library. Please see the
-README file for each component in the build directory for specific updates since
-version 2.2.1.
-
-*** version 2.2.1 ***
-
-This update contains general fixes to the YUI library. Please see the
-README file for each component in the build directory for specific updates since
-version 2.2.0.
-
-*** version 2.2.0 ***
-
-This release synchronizes the SourceForge version with Yahoo!'s version of YUI
--- version number 2.2.0. Please see the following blog article for information
-on this specific version increment at:
-http://www.yuiblog.com/blog/2007/02/20/yui-220-released
-
-The following new components are introduced with this release:
-
- * Button
- * DataTable
- * Browser History Manager
-
- The following components are now available as utilities:
-
- * Element
- * DataSource
-
-These new components are introduced as "beta", with the exception of Browser
-History Manager as an experimental component. Please see the YUI FAQ on the
-definition of beta and experimental at:
-http://developer.yahoo.com/yui/articles/faq/#beta
-
-* CSS customizations *
-Calendar, Container, and Menu have been revised to allow image customizations
-through their respective CSS files. Please refer to each component's README to
-see the full details on affected properties.
-
-Additional details for fixes and updates can be found in the README files for
-each updated component. All YUI API cheatsheets have been updated for the
-current version and can be found at: yui/docs/assets/cheatsheets.zip.
-
-*** version 0.12.2 ***
-
-This update contains general fixes to the YUI library. Please see the
-README file for each component in the build directory for specific updates since
-version 0.12.1. As part of the 0.12.2 update, a number of corrections have been
-made to functional examples that were configured incorrectly in 0.12.1.
-
-*** version 0.12.1 ***
-
-This update contains general fixes to the YUI library. Please see the
-README file for each component in the build directory for specific updates since
-version 0.12.0.
-
-Beginning with this release, all YUI minification will be performed with JSMin(
-http://www.crockford.com/javascript/jsmin.html). Line breaks will be preserved.
-
-*** version 0.12.0 ***
-
-This version introduces the Tabview widget as well as general fixes to the YUI
-library. Additional details can be found in the README files for each updated
-component. All YUI API cheatsheets have been updated for the current version
-and can be found at: yui/docs/assets/cheatsheets.zip.
-
-* documentation *
-The YUI API documentation format is revised with this release. This new
-format -- now a flat file structure under yui/docs/ -- implements the YUI
-AutoComplete widget on the main landing page to allow keyword searching of YUI.
-It also contains the full API documentation for all YUI components along with
-the following categories of data for each component(if applicable):
-
-* Inheritance hierarchy for extensions and subclasses.
-* YUI dependencies
-* Properties and methods
-* Events
-* Configuration attributes.
-
-* concatenated files *
-For convenience, three additional, minified variations of YUI are now available
-for your use:
-
-* reset-fonts-grids.css
-* yahoo-dom-event.js
-* utilities.js
-
-* API changes *
-There are interface changes to the Calendar widget. Please see the 0.12.0
-Calendar upgrade guide at http:// developer.yahoo.com/yui/calendar/upgrade.html
-to see if this update affects your Calendar implementation and instructions on
-upgrading to version 0.12.0.
-
-
-*** version 0.11.4 ***
-
-This update contains some priority bug fixes to the following components:
-
-* Yahoo
-* Container
-* Drag and Drop
-* Event
-
-Additional details can be found in the README files for each updated component.
-
-*** version 0.11.3 ***
-
-This update contains general fixes to the YUI library. Please see the
-README file for each component in the build directory for updates and fixes
-since version 0.11.2.
-
-*** version 0.11.2 ***
-
-This update contains a high-priority fix to Drag and Drop that prevents text
-selection. Additional details can be found in the README file for:
-
-* Drag and Drop
-
-*** version 0.11.1 ***
-
-Release 0.11.1 addresses some high-priority bugs reported in the recently
-released version 0.11.0. Additional details can be found in the README files for
-each updated component:
-
-* Animation
-* Dom
-* Drag and Drop
-* Connection Manager
-* Container
-
-*** version 0.11.0 ***
-
-This version introduces the Logger widget. The YUI cheatsheets for version
-0.11.0 and 0.10.0 are also included in this distribution under docs/assets.
-
-Please see the README file for each component in the build directory for
-updates and fixes since version 0.10.0.
-
-*** version 0.10.0 ***
-
-In this release, the directory structure has been modified to provide more
-component organization. This is the new format:
-
-yui/
- |
- -- build/
- | |
- | -- dom/
- | |
- | | -- assets/
- | |
- | | -- dom.js
- | |
- -- docs/
- | |
- | -- dom/
- | |
- -- examples/
- | |
- | -- dom/
- | |
- | | -- img/
-
-Notice there are three immediate directories under the
-root YUI. They are:
-
-*build/*
-This directory contains the source files for each YUI component, and each
-component is presented as a sub-directory under build/. Notice that there are
-generally two source files: component.js and component-min.js. The "component"
-source is the raw, commented build and "component-min" is the minified version
-of the same file with comments and whitespace removed. With some components,
-there is an assets sub-directory. CSS and image dependencies for each
-component are stored in its assets sub-directory.
-
-Note: If a component makes use of images, the image source path in the
-component's CSS file will point to Akamai. The physical images are also
-available in the assets/ directory for local availability. Please modify the
-CSS image references if you wish to use your own image assets.
-
-*docs/*
-This directory contains the jsdoc-generated API reference for every YUI
-component. Each component is presented as a sub-directory under docs/.
-
-*examples/*
-This directory contains functional examples for each component in the YUI
-Library. The examples are not part of the formal distribution; rather,
-they provide demonstrations of each component in use. Each example uses YUI
-Library source files from the build/ directory, while all example-specific
-dependencies are stored in sub-directories (e.g. examples/dom/img).
-Some components, including the AutoComplete Control and Connection Manager,
-make use of PHP to implement certain examples.
-
-For example:
-In yui/examples/dom, the dom.js source file and all YUI .js dependencies
-are drawn from yui/build/ directories. All other example-specific sources are
-stored as sub-directories: yui/examples/dom/css and yui/examples/dom/img.
-
-Each functional example is also available and functional on
-developer.yahoo.com/yui/. They reproduced here as part of the distribution
-for your convenience.
-
-
-
-
+YUI Library Release Notes
+
+
+*** version 2.5.2 ***
+
+This update contains the following:
+
+- Patches for DataTable and Menu posted to developer site following the release of 2.5.1 have been incorporated into the build.
+- FireFox 3 compatibility in advance of its release.
+- Opera 9.5 beta compatibility in advance of its release.
+- ActionScript source for Charts and Uploader is now included.
+- Charts component now includes support for dynamically created legends, and new chart and series styles.
+- DataTable bug fixes in pagination, scrolling, and column handling.
+- Several Rich Text Editor bug fixes.
+- Approximately 15 Source Forge bug fixes.
+
+Please see the README file for each component in the build directory for specific updates since version 2.5.1.
+
+*** version 2.5.1 ***
+
+This update contains the following:
+
+- additions to the Yahoo, Uploader, Editor, and DataSource components to improve YUI support for Adobe AIR
+- Douglas Crockford's fix for a security vulnerability where the JSON parser could be tricked into processing
+an unquoted string as quoted which could allow unsafe scripts to be evaled
+- a new aggregate file Ñ yuiloader-dom-event.js that is the ideal baseline rollup to use to be able to
+lazy-load any part of YUI on-demand
+- over 60 bug fixes
+
+Please see the README file for each component in the build directory for specific updates since version 2.5.0.
+
+*** version 2.5.0 ***
+
+This release introduces six new components into YUI:
+
+ * Cookie Utility
+ * ImageCropper
+ * Layout Manager
+ * Resize
+ * Uploader
+ * Profiler Viewer
+
+These new components are introduced as "beta", with the exception of the Charts
+WidgeUploadert which is released as an experimental component. Please see the YUI FAQ
+on the definition of beta and experimental at:
+http://developer.yahoo.com/yui/articles/faq/#beta
+
+In addition to new components, you'll find updates and bug fixes throughout the
+library.
+
+*** version 2.4.1 ***
+
+This update contains one change. We have reverted the change to the way the Event Utility cleans up
+events in its page unload handler that was introduced in 2.4.0. The change resulted in some events
+not being properly unloaded, which in turn resulted in IE-specific memory leaks in some YUI components
+including the Menu Control and controls in the Container Family.
+
+*** version 2.4.0 ***
+
+This release introduces five new components into YUI:
+
+ * Selector
+ * Charts Widget
+ * Get Utility
+ * Profiler
+ * JSON Utility
+
+These new components are introduced as "beta", with the exception of the Charts
+Widget which is released as an experimental component. Please see the YUI FAQ
+on the definition of beta and experimental at:
+http://developer.yahoo.com/yui/articles/faq/#beta
+
+In addition to new components, you'll find updates and bug fixes throughout the
+library.
+
+*** version 2.3.1 ***
+
+This update contains general fixes to the YUI library. Please see the README
+file for each component in the build directory for specific updates since
+version 2.3.0.
+
+*** version 2.3.0 ***
+
+This release introduces six new components into YUI:
+
+ * Base CSS
+ * Color Picker Control
+ * ImageLoader Utility
+ * Rich Text Editor
+ * YUI Loader Utility
+ * YUI Test Utility
+
+These new components are introduced as "beta", with the exception of ImageLoader
+Utility which is released as an experimental component. Please see the YUI
+FAQ on the definition of beta and experimental at:
+http://developer.yahoo.com/yui/articles/faq/#beta
+
+In addition to new components, you'll find updates and bug fixes throughout the
+library.
+
+*** version 2.2.2 ***
+
+This update contains general fixes to the YUI library. Please see the
+README file for each component in the build directory for specific updates since
+version 2.2.1.
+
+*** version 2.2.1 ***
+
+This update contains general fixes to the YUI library. Please see the
+README file for each component in the build directory for specific updates since
+version 2.2.0.
+
+*** version 2.2.0 ***
+
+This release synchronizes the SourceForge version with Yahoo!'s version of YUI
+-- version number 2.2.0. Please see the following blog article for information
+on this specific version increment at:
+http://www.yuiblog.com/blog/2007/02/20/yui-220-released
+
+The following new components are introduced with this release:
+
+ * Button
+ * DataTable
+ * Browser History Manager
+
+ The following components are now available as utilities:
+
+ * Element
+ * DataSource
+
+These new components are introduced as "beta", with the exception of Browser
+History Manager as an experimental component. Please see the YUI FAQ on the
+definition of beta and experimental at:
+http://developer.yahoo.com/yui/articles/faq/#beta
+
+* CSS customizations *
+Calendar, Container, and Menu have been revised to allow image customizations
+through their respective CSS files. Please refer to each component's README to
+see the full details on affected properties.
+
+Additional details for fixes and updates can be found in the README files for
+each updated component. All YUI API cheatsheets have been updated for the
+current version and can be found at: yui/docs/assets/cheatsheets.zip.
+
+*** version 0.12.2 ***
+
+This update contains general fixes to the YUI library. Please see the
+README file for each component in the build directory for specific updates since
+version 0.12.1. As part of the 0.12.2 update, a number of corrections have been
+made to functional examples that were configured incorrectly in 0.12.1.
+
+*** version 0.12.1 ***
+
+This update contains general fixes to the YUI library. Please see the
+README file for each component in the build directory for specific updates since
+version 0.12.0.
+
+Beginning with this release, all YUI minification will be performed with JSMin(
+http://www.crockford.com/javascript/jsmin.html). Line breaks will be preserved.
+
+*** version 0.12.0 ***
+
+This version introduces the Tabview widget as well as general fixes to the YUI
+library. Additional details can be found in the README files for each updated
+component. All YUI API cheatsheets have been updated for the current version
+and can be found at: yui/docs/assets/cheatsheets.zip.
+
+* documentation *
+The YUI API documentation format is revised with this release. This new
+format -- now a flat file structure under yui/docs/ -- implements the YUI
+AutoComplete widget on the main landing page to allow keyword searching of YUI.
+It also contains the full API documentation for all YUI components along with
+the following categories of data for each component(if applicable):
+
+* Inheritance hierarchy for extensions and subclasses.
+* YUI dependencies
+* Properties and methods
+* Events
+* Configuration attributes.
+
+* concatenated files *
+For convenience, three additional, minified variations of YUI are now available
+for your use:
+
+* reset-fonts-grids.css
+* yahoo-dom-event.js
+* utilities.js
+
+* API changes *
+There are interface changes to the Calendar widget. Please see the 0.12.0
+Calendar upgrade guide at http:// developer.yahoo.com/yui/calendar/upgrade.html
+to see if this update affects your Calendar implementation and instructions on
+upgrading to version 0.12.0.
+
+
+*** version 0.11.4 ***
+
+This update contains some priority bug fixes to the following components:
+
+* Yahoo
+* Container
+* Drag and Drop
+* Event
+
+Additional details can be found in the README files for each updated component.
+
+*** version 0.11.3 ***
+
+This update contains general fixes to the YUI library. Please see the
+README file for each component in the build directory for updates and fixes
+since version 0.11.2.
+
+*** version 0.11.2 ***
+
+This update contains a high-priority fix to Drag and Drop that prevents text
+selection. Additional details can be found in the README file for:
+
+* Drag and Drop
+
+*** version 0.11.1 ***
+
+Release 0.11.1 addresses some high-priority bugs reported in the recently
+released version 0.11.0. Additional details can be found in the README files for
+each updated component:
+
+* Animation
+* Dom
+* Drag and Drop
+* Connection Manager
+* Container
+
+*** version 0.11.0 ***
+
+This version introduces the Logger widget. The YUI cheatsheets for version
+0.11.0 and 0.10.0 are also included in this distribution under docs/assets.
+
+Please see the README file for each component in the build directory for
+updates and fixes since version 0.10.0.
+
+*** version 0.10.0 ***
+
+In this release, the directory structure has been modified to provide more
+component organization. This is the new format:
+
+yui/
+ |
+ -- build/
+ | |
+ | -- dom/
+ | |
+ | | -- assets/
+ | |
+ | | -- dom.js
+ | |
+ -- docs/
+ | |
+ | -- dom/
+ | |
+ -- examples/
+ | |
+ | -- dom/
+ | |
+ | | -- img/
+
+Notice there are three immediate directories under the
+root YUI. They are:
+
+*build/*
+This directory contains the source files for each YUI component, and each
+component is presented as a sub-directory under build/. Notice that there are
+generally two source files: component.js and component-min.js. The "component"
+source is the raw, commented build and "component-min" is the minified version
+of the same file with comments and whitespace removed. With some components,
+there is an assets sub-directory. CSS and image dependencies for each
+component are stored in its assets sub-directory.
+
+Note: If a component makes use of images, the image source path in the
+component's CSS file will point to Akamai. The physical images are also
+available in the assets/ directory for local availability. Please modify the
+CSS image references if you wish to use your own image assets.
+
+*docs/*
+This directory contains the jsdoc-generated API reference for every YUI
+component. Each component is presented as a sub-directory under docs/.
+
+*examples/*
+This directory contains functional examples for each component in the YUI
+Library. The examples are not part of the formal distribution; rather,
+they provide demonstrations of each component in use. Each example uses YUI
+Library source files from the build/ directory, while all example-specific
+dependencies are stored in sub-directories (e.g. examples/dom/img).
+Some components, including the AutoComplete Control and Connection Manager,
+make use of PHP to implement certain examples.
+
+For example:
+In yui/examples/dom, the dom.js source file and all YUI .js dependencies
+are drawn from yui/build/ directories. All other example-specific sources are
+stored as sub-directories: yui/examples/dom/css and yui/examples/dom/img.
+
+Each functional example is also available and functional on
+developer.yahoo.com/yui/. They reproduced here as part of the distribution
+for your convenience.
+
+
+
+
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/animation/animation-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/animation/animation-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/animation/animation-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/animation/animation-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/animation/animation.js b/shrine-webclient/src/main/html/js-ext/yui/build/animation/animation.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/ajax-loader.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/ajax-loader.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/asc.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/asc.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/autocomplete.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/autocomplete.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/back-h.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/back-h.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/back-v.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/back-v.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bar-h.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bar-h.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bar-v.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bar-v.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bg-h.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bg-h.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bg-v.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/bg-v.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/blankimage.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/blankimage.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/button.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/button.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/calendar.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/calendar.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/carousel.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/carousel.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/check0.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/check0.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/check1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/check1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/check2.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/check2.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/colorpicker.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/colorpicker.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/container.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/container.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/datatable.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/datatable.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/desc.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/desc.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/dt-arrow-dn.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/dt-arrow-dn.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/dt-arrow-up.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/dt-arrow-up.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor-knob.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor-knob.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor-sprite-active.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor-sprite-active.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor-sprite.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor-sprite.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/editor.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/header_background.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/header_background.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/hue_bg.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/hue_bg.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/imagecropper.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/imagecropper.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/layout.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/layout.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/layout_sprite.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/layout_sprite.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/loading.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/loading.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/logger.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/logger.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menu-button-arrow-disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menu-button-arrow-disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menu-button-arrow.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menu-button-arrow.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menu.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menu.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menubaritem_submenuindicator.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menubaritem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menubaritem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_checkbox.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_checkbox.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_checkbox_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_checkbox_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_submenuindicator.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/menuitem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/paginator.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/paginator.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/picker_mask.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/picker_mask.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/profilerviewer.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/profilerviewer.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/progressbar.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/progressbar.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/resize.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/resize.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/simpleeditor.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/simpleeditor.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/slider.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/slider.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-active.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-active.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-focus.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-focus.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-hover.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow-hover.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/split-button-arrow.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/sprite.png b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/sprite.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/sprite.psd b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/sprite.psd
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/tabview.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/tabview.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/treeview-loading.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/treeview-loading.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/treeview-sprite.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/treeview-sprite.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/treeview.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/treeview.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/wait.gif b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/wait.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/yuitest.css b/shrine-webclient/src/main/html/js-ext/yui/build/assets/skins/sam/yuitest.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/assets/autocomplete-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/assets/autocomplete-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/assets/skins/sam/autocomplete-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/assets/skins/sam/autocomplete-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/assets/skins/sam/autocomplete.css b/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/assets/skins/sam/autocomplete.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/autocomplete-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/autocomplete-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/autocomplete-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/autocomplete-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/autocomplete.js b/shrine-webclient/src/main/html/js-ext/yui/build/autocomplete/autocomplete.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/base/base-min.css b/shrine-webclient/src/main/html/js-ext/yui/build/base/base-min.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/base/base.css b/shrine-webclient/src/main/html/js-ext/yui/build/base/base.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/button-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/button-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/button-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/button-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/button.css b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/button.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/menu-button-arrow-disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/menu-button-arrow-disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/menu-button-arrow.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/menu-button-arrow.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-active.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-active.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-focus.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-focus.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-hover.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow-hover.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow.png b/shrine-webclient/src/main/html/js-ext/yui/build/button/assets/skins/sam/split-button-arrow.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/button-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/button/button-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/button-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/button/button-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/button/button.js b/shrine-webclient/src/main/html/js-ext/yui/build/button/button.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calendar-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calendar-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calendar.css b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calendar.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calgrad.png b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calgrad.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/callt.gif b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/callt.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calrt.gif b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calrt.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calx.gif b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/calx.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/skins/sam/calendar-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/skins/sam/calendar-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/skins/sam/calendar.css b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/assets/skins/sam/calendar.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/calendar-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/calendar-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/calendar-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/calendar-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/calendar/calendar.js b/shrine-webclient/src/main/html/js-ext/yui/build/calendar/calendar.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/ajax-loader.gif b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/ajax-loader.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/carousel-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/carousel-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/skins/sam/ajax-loader.gif b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/skins/sam/ajax-loader.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/skins/sam/carousel-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/skins/sam/carousel-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/skins/sam/carousel.css b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/assets/skins/sam/carousel.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/carousel-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/carousel-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/carousel-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/carousel-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/carousel/carousel.js b/shrine-webclient/src/main/html/js-ext/yui/build/carousel/carousel.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/charts/assets/charts.swf b/shrine-webclient/src/main/html/js-ext/yui/build/charts/assets/charts.swf
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/charts/charts-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/charts/charts-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/charts/charts-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/charts/charts-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/charts/charts.js b/shrine-webclient/src/main/html/js-ext/yui/build/charts/charts.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/colorpicker-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/colorpicker-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/hue_thumb.png b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/hue_thumb.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/picker_mask.png b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/picker_mask.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/picker_thumb.png b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/picker_thumb.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/colorpicker-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/colorpicker-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/colorpicker.css b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/colorpicker.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/hue_bg.png b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/hue_bg.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/picker_mask.png b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/assets/skins/sam/picker_mask.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/colorpicker-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/colorpicker-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/colorpicker-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/colorpicker-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/colorpicker.js b/shrine-webclient/src/main/html/js-ext/yui/build/colorpicker/colorpicker.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection.js b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection.swf b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection.swf
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection_core-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection_core-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection_core-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection_core-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection_core.js b/shrine-webclient/src/main/html/js-ext/yui/build/connection/connection_core.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/alrt16_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/alrt16_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/blck16_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/blck16_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/close12_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/close12_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/container-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/container-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/container.css b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/container.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/hlp16_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/hlp16_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/info16_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/info16_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/skins/sam/container-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/skins/sam/container-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/skins/sam/container.css b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/skins/sam/container.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/tip16_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/tip16_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/warn16_1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/container/assets/warn16_1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/container-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/container/container-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/container-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/container/container-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/container.js b/shrine-webclient/src/main/html/js-ext/yui/build/container/container.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/container_core-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/container/container_core-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/container_core-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/container/container_core-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/container/container_core.js b/shrine-webclient/src/main/html/js-ext/yui/build/container/container_core.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/cookie/cookie-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/cookie/cookie-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/cookie/cookie-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/cookie/cookie-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/cookie/cookie.js b/shrine-webclient/src/main/html/js-ext/yui/build/cookie/cookie.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datasource/datasource-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/datasource/datasource-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datasource/datasource-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/datasource/datasource-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datasource/datasource.js b/shrine-webclient/src/main/html/js-ext/yui/build/datasource/datasource.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/datatable-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/datatable-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/datatable.css b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/datatable.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/datatable-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/datatable-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/datatable.css b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/datatable.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/dt-arrow-dn.png b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/dt-arrow-dn.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/dt-arrow-up.png b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/assets/skins/sam/dt-arrow-up.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/datatable-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/datatable-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/datatable-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/datatable-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datatable/datatable.js b/shrine-webclient/src/main/html/js-ext/yui/build/datatable/datatable.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datemath/datemath-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/datemath/datemath-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datemath/datemath-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/datemath/datemath-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/datemath/datemath.js b/shrine-webclient/src/main/html/js-ext/yui/build/datemath/datemath.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/dom/dom-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/dom/dom-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/dom/dom-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/dom/dom-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/dom/dom.js b/shrine-webclient/src/main/html/js-ext/yui/build/dom/dom.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/dragdrop/dragdrop-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/dragdrop/dragdrop-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/dragdrop/dragdrop-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/dragdrop/dragdrop-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/dragdrop/dragdrop.js b/shrine-webclient/src/main/html/js-ext/yui/build/dragdrop/dragdrop.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/editor-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/editor-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/simpleeditor-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/simpleeditor-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/blankimage.png b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/blankimage.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-knob.gif b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-knob.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-sprite-active.gif b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-sprite-active.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-sprite.gif b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor-sprite.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor.css b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/editor.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/simpleeditor-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/simpleeditor-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/simpleeditor.css b/shrine-webclient/src/main/html/js-ext/yui/build/editor/assets/skins/sam/simpleeditor.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/editor-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/editor/editor-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/editor-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/editor/editor-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/editor.js b/shrine-webclient/src/main/html/js-ext/yui/build/editor/editor.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/simpleeditor-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/editor/simpleeditor-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/simpleeditor-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/editor/simpleeditor-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/editor/simpleeditor.js b/shrine-webclient/src/main/html/js-ext/yui/build/editor/simpleeditor.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/element-delegate/element-delegate-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/element-delegate/element-delegate-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/element-delegate/element-delegate-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/element-delegate/element-delegate-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/element-delegate/element-delegate.js b/shrine-webclient/src/main/html/js-ext/yui/build/element-delegate/element-delegate.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/element/element-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/element/element-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/element/element-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/element/element-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/element/element.js b/shrine-webclient/src/main/html/js-ext/yui/build/element/element.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-delegate/event-delegate-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-delegate/event-delegate-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-delegate/event-delegate-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-delegate/event-delegate-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-delegate/event-delegate.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-delegate/event-delegate.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-mouseenter/event-mouseenter-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-mouseenter/event-mouseenter-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-mouseenter/event-mouseenter-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-mouseenter/event-mouseenter-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-mouseenter/event-mouseenter.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-mouseenter/event-mouseenter.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-simulate/event-simulate-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-simulate/event-simulate-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-simulate/event-simulate-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-simulate/event-simulate-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event-simulate/event-simulate.js b/shrine-webclient/src/main/html/js-ext/yui/build/event-simulate/event-simulate.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event/event-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/event/event-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event/event-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/event/event-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/event/event.js b/shrine-webclient/src/main/html/js-ext/yui/build/event/event.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/fonts/fonts-min.css b/shrine-webclient/src/main/html/js-ext/yui/build/fonts/fonts-min.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/fonts/fonts.css b/shrine-webclient/src/main/html/js-ext/yui/build/fonts/fonts.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/get/get-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/get/get-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/get/get-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/get/get-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/get/get.js b/shrine-webclient/src/main/html/js-ext/yui/build/get/get.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/grids/grids-min.css b/shrine-webclient/src/main/html/js-ext/yui/build/grids/grids-min.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/grids/grids.css b/shrine-webclient/src/main/html/js-ext/yui/build/grids/grids.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/history/assets/blank.html b/shrine-webclient/src/main/html/js-ext/yui/build/history/assets/blank.html
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/history/history-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/history/history-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/history/history-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/history/history-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/history/history.js b/shrine-webclient/src/main/html/js-ext/yui/build/history/history.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/assets/imagecropper-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/assets/imagecropper-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/assets/skins/sam/imagecropper-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/assets/skins/sam/imagecropper-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/assets/skins/sam/imagecropper.css b/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/assets/skins/sam/imagecropper.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/imagecropper-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/imagecropper-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/imagecropper-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/imagecropper-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/imagecropper.js b/shrine-webclient/src/main/html/js-ext/yui/build/imagecropper/imagecropper.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imageloader/imageloader-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/imageloader/imageloader-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imageloader/imageloader-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/imageloader/imageloader-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/imageloader/imageloader.js b/shrine-webclient/src/main/html/js-ext/yui/build/imageloader/imageloader.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/json/json-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/json/json-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/json/json-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/json/json-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/json/json.js b/shrine-webclient/src/main/html/js-ext/yui/build/json/json.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/layout-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/layout-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/skins/sam/layout-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/skins/sam/layout-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/skins/sam/layout.css b/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/skins/sam/layout.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/skins/sam/layout_sprite.png b/shrine-webclient/src/main/html/js-ext/yui/build/layout/assets/skins/sam/layout_sprite.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/layout-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/layout/layout-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/layout-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/layout/layout-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/layout/layout.js b/shrine-webclient/src/main/html/js-ext/yui/build/layout/layout.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/logger-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/logger-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/logger.css b/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/logger.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/skins/sam/logger-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/skins/sam/logger-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/skins/sam/logger.css b/shrine-webclient/src/main/html/js-ext/yui/build/logger/assets/skins/sam/logger.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/logger-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/logger/logger-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/logger-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/logger/logger-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/logger/logger.js b/shrine-webclient/src/main/html/js-ext/yui/build/logger/logger.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu.css b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_down_arrow.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_down_arrow.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_down_arrow_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_down_arrow_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_up_arrow.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_up_arrow.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_up_arrow_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menu_up_arrow_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menubaritem_submenuindicator.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menubaritem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menubaritem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menubaritem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menubaritem_submenuindicator_selected.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menubaritem_submenuindicator_selected.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_checkbox.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_checkbox.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_checkbox_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_checkbox_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_checkbox_selected.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_checkbox_selected.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_submenuindicator.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_submenuindicator_selected.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/menuitem_submenuindicator_selected.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menu-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menu-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menu.css b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menu.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menubaritem_submenuindicator.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menubaritem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menubaritem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_checkbox.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_checkbox.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_checkbox_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_submenuindicator.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-ext/yui/build/menu/assets/skins/sam/menuitem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/menu-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/menu/menu-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/menu-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/menu/menu-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/menu/menu.js b/shrine-webclient/src/main/html/js-ext/yui/build/menu/menu.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/paginator/assets/paginator-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/paginator/assets/paginator-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/paginator/assets/skins/sam/paginator-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/paginator/assets/skins/sam/paginator-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/paginator/assets/skins/sam/paginator.css b/shrine-webclient/src/main/html/js-ext/yui/build/paginator/assets/skins/sam/paginator.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/paginator/paginator-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/paginator/paginator-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/paginator/paginator-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/paginator/paginator-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/paginator/paginator.js b/shrine-webclient/src/main/html/js-ext/yui/build/paginator/paginator.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profiler/profiler-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/profiler/profiler-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profiler/profiler-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/profiler/profiler-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profiler/profiler.js b/shrine-webclient/src/main/html/js-ext/yui/build/profiler/profiler.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/profilerviewer-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/profilerviewer-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/asc.gif b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/asc.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/desc.gif b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/desc.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/header_background.png b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/header_background.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/profilerviewer-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/profilerviewer.css b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/profilerviewer.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/wait.gif b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/assets/skins/sam/wait.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/profilerviewer-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/profilerviewer-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/profilerviewer-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/profilerviewer-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/profilerviewer.js b/shrine-webclient/src/main/html/js-ext/yui/build/profilerviewer/profilerviewer.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/progressbar-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/progressbar-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/back-h.png b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/back-h.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/back-v.png b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/back-v.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/bar-h.png b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/bar-h.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/bar-v.png b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/bar-v.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/progressbar-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/progressbar-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/progressbar.css b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/assets/skins/sam/progressbar.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/progressbar-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/progressbar-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/progressbar-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/progressbar-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/progressbar.js b/shrine-webclient/src/main/html/js-ext/yui/build/progressbar/progressbar.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/reset-fonts-grids/reset-fonts-grids.css b/shrine-webclient/src/main/html/js-ext/yui/build/reset-fonts-grids/reset-fonts-grids.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/reset-fonts/reset-fonts.css b/shrine-webclient/src/main/html/js-ext/yui/build/reset-fonts/reset-fonts.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/reset/reset-min.css b/shrine-webclient/src/main/html/js-ext/yui/build/reset/reset-min.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/reset/reset.css b/shrine-webclient/src/main/html/js-ext/yui/build/reset/reset.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/resize-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/resize-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/skins/sam/layout_sprite.png b/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/skins/sam/layout_sprite.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/skins/sam/resize-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/skins/sam/resize-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/skins/sam/resize.css b/shrine-webclient/src/main/html/js-ext/yui/build/resize/assets/skins/sam/resize.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/resize-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/resize/resize-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/resize-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/resize/resize-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/resize/resize.js b/shrine-webclient/src/main/html/js-ext/yui/build/resize/resize.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/selector/selector-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/selector/selector-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/selector/selector-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/selector/selector-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/selector/selector.js b/shrine-webclient/src/main/html/js-ext/yui/build/selector/selector.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-fader.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-fader.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-h.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-h.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-v-e.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-v-e.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-v.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/bg-v.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/left-thumb.png b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/left-thumb.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/right-thumb.png b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/right-thumb.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/bg-h.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/bg-h.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/bg-v.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/bg-v.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/slider-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/slider-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/slider.css b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/skins/sam/slider.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/slider-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/slider-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/slider-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/slider-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-bar.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-bar.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-e.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-e.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-fader.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-fader.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-n.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-n.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-s.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-s.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-w.gif b/shrine-webclient/src/main/html/js-ext/yui/build/slider/assets/thumb-w.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/slider-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/slider/slider-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/slider-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/slider/slider-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/slider/slider.js b/shrine-webclient/src/main/html/js-ext/yui/build/slider/slider.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/storage/storage-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/storage/storage-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/storage/storage-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/storage/storage-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/storage/storage.js b/shrine-webclient/src/main/html/js-ext/yui/build/storage/storage.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/stylesheet/stylesheet-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/stylesheet/stylesheet-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/stylesheet/stylesheet-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/stylesheet/stylesheet-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/stylesheet/stylesheet.js b/shrine-webclient/src/main/html/js-ext/yui/build/stylesheet/stylesheet.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swf/swf-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/swf/swf-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swf/swf-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/swf/swf-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swf/swf.js b/shrine-webclient/src/main/html/js-ext/yui/build/swf/swf.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfdetect/swfdetect-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfdetect/swfdetect-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfdetect/swfdetect-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfdetect/swfdetect-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfdetect/swfdetect.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfdetect/swfdetect.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swf.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swf.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore.js b/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore.swf b/shrine-webclient/src/main/html/js-ext/yui/build/swfstore/swfstore.swf
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/border_tabs.css b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/border_tabs.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/loading.gif b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/loading.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/skin-sam.css b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/skin-sam.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/skins/sam/tabview-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/skins/sam/tabview-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/skins/sam/tabview.css b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/skins/sam/tabview.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/tabview-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/tabview-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/tabview.css b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/assets/tabview.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/tabview-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/tabview-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/tabview-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/tabview-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/tabview/tabview.js b/shrine-webclient/src/main/html/js-ext/yui/build/tabview/tabview.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/check0.gif b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/check0.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/check1.gif b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/check1.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/check2.gif b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/check2.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/loading.gif b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/loading.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview-loading.gif b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview-loading.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview-sprite.gif b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview-sprite.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview.css b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/skins/sam/treeview.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/treeview-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/assets/treeview-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/treeview-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/treeview-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/treeview-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/treeview-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/treeview/treeview.js b/shrine-webclient/src/main/html/js-ext/yui/build/treeview/treeview.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/uploader/assets/uploader.swf b/shrine-webclient/src/main/html/js-ext/yui/build/uploader/assets/uploader.swf
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/uploader/uploader-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/uploader/uploader-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/uploader/uploader-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/uploader/uploader-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/uploader/uploader.js b/shrine-webclient/src/main/html/js-ext/yui/build/uploader/uploader.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/utilities/utilities.js b/shrine-webclient/src/main/html/js-ext/yui/build/utilities/utilities.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yahoo-dom-event/yahoo-dom-event.js b/shrine-webclient/src/main/html/js-ext/yui/build/yahoo-dom-event/yahoo-dom-event.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yahoo/yahoo-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/yahoo/yahoo-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yahoo/yahoo-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/yahoo/yahoo-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yahoo/yahoo.js b/shrine-webclient/src/main/html/js-ext/yui/build/yahoo/yahoo.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader-dom-event/yuiloader-dom-event.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader-dom-event/yuiloader-dom-event.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader/yuiloader-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader/yuiloader-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader/yuiloader-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader/yuiloader-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader/yuiloader.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuiloader/yuiloader.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/skins/sam/yuitest-skin.css b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/skins/sam/yuitest-skin.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/skins/sam/yuitest.css b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/skins/sam/yuitest.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/testlogger.css b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/testlogger.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/yuitest-core.css b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/assets/yuitest-core.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest_core-debug.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest_core-debug.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest_core-min.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest_core-min.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest_core.js b/shrine-webclient/src/main/html/js-ext/yui/build/yuitest/yuitest_core.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_Dates.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_Dates.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_History.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_History.js
old mode 100755
new mode 100644
index f38fa45df..03dd755c5
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_History.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_History.js
@@ -1,341 +1,340 @@
/**
* @projectDescription The main controller for the history viewport. (CRC's "previous queries" functionality)
* @inherits i2b2.CRC.ctrlr
* @namespace i2b2.CRC.ctrlr.history
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* ----------------------------------------------------------------------------------------
* updated 9-15-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: CRC > ctrlr > History');
console.time('execute time');
i2b2.CRC.ctrlr.history = {
clickedID: false,
queryNewName: false,
// ================================================================================================== //
Refresh: function() {
console.info("CALLED i2b2.CRC.ctrlr.history.Refresh()");
// THIS FUNCTION DOES THE FOLLOWING:
// 1) fires a call to ajax.getCategories(),
// 2) interprets the XML / populates the ONT data model,
// 3) fires it's onDataUpdate event
//update view from controller @todo: this is a bad practice...going with design already in place:
$("refPrevQS").setStyle({
display:'none'
});
$("refPrev2QS").setStyle({
display:'inline'
});
// create a scoped callback message
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = i2b2.CRC.model.QueryMasters;
scopeCB.callback = function(i2b2CellMsg) {
// define the XML processing function
console.group("CALLBACK Processing AJAX i2b2CellMsg");
console.dir(i2b2CellMsg);
i2b2.CRC.view.history.queryResponse = i2b2CellMsg.msgResponse;
i2b2.CRC.view.history.queryRequest = i2b2CellMsg.msgRequest;
i2b2.CRC.view.history.queryUrl = i2b2CellMsg.msgUrl;
// the THIS scope is already set to i2b2.CRC.model.QueryMasters
i2b2.sdx.Master.ClearAll('QM');
if (!i2b2CellMsg.error) {
var qm = i2b2CellMsg.refXML.getElementsByTagName('query_master');
for(var i=0; i<1*qm.length; i++) {
var o = new Object;
o.xmlOrig = qm[i];
o.id = i2b2.h.getXNodeVal(qm[i],'query_master_id');
o.realname = i2b2.h.getXNodeVal(qm[i],'name');
o.userid = i2b2.h.getXNodeVal(qm[i],'user_id');
o.group = i2b2.h.getXNodeVal(qm[i],'group_id');
o.created = i2b2.h.getXNodeVal(qm[i],'create_date');
o.master_type_cd = i2b2.h.getXNodeVal(qm[i],'master_type_cd');
o.flagged = i2b2.h.getXNodeVal(qm[i], 'flagged');
var dStr = '';
var d = o.created.match(/^[0-9\-]*/).toString();
if (d) {
d = d.replace(/-/g,'/');
d = new Date(Date.parse(d));
if (d) {
dStr = ' [' + (d.getMonth()+1) + '-' + d.getDate() + '-' + d.getFullYear().toString() + ']';
}
}
o.name = o.realname + dStr + ' ['+o.userid+']';
// encapsulate into an SDX package
var sdxDataPack = i2b2.sdx.Master.EncapsulateData('QM',o);
// save the node to the CRC data model
i2b2.sdx.Master.Save(sdxDataPack, null);
}
} else {
alert("An error has occurred in the Cell's AJAX library.\n Press F12 for more information");
}
// Broadcast an update event letting interested view controllers know that the Categories data model has been updated
var DataUpdateSignal = {
DataLocation: "i2b2.CRC.model.QueryMasters",
DataRef: i2b2.CRC.model.QueryMasters
}
console.info("EVENT FIRE i2b2.CRC.ctrlr.gen.events.onDataUpdate; Msg:",DataUpdateSignal);
console.groupEnd();
i2b2.CRC.ctrlr.history.events.onDataUpdate.fire(DataUpdateSignal);
//@todo: updating view from controller is bad...ugh!
$("refPrev2QS").setStyle({
display:'none'
});
$("refPrevQS").setStyle({
display:'inline'
});
};
// fire the AJAX call
var options = {
result_wait_time: 180,
crc_max_records: i2b2.CRC.view['history'].params.maxQueriesDisp,
crc_sort_by: i2b2.CRC.view['history'].params.sortBy,
crc_user_type: (i2b2.PM.model.userRoles.indexOf("MANAGER") == -1? "CRC_QRY_getQueryMasterList_fromUserId" : "CRC_QRY_getQueryMasterList_fromGroupId"),
crc_sort_order: i2b2.CRC.view['history'].params.sortOrder
};
i2b2.CRC.ajax.getQueryMasterList_fromUserId("CRC:History", options, scopeCB);
},
/**
* Asynchronous Unflag Query method.
* Note: this method accesses the shrine rest calls directly, and therefore does
* not currently subscribe to the i2b2 message format.
* @param unflagQueryDto - {Object} - Data transfer object with queryId member.
*/
Unflag: function( unflagQueryDto ){
// create a scoped callback message
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = i2b2.CRC.model.QueryMasters;
scopeCB.callback = function(i2b2CellMsg) {
i2b2.CRC.ctrlr.history.Refresh();
};
// fire the AJAX call
var options = {
network_query_id: unflagQueryDto.queryId
};
i2b2.CRC.ajax.unFlagQueryMaster("CRC:History", options, scopeCB);
},
/**
* Asynchronous Flag Query method.
* Note: this method accesses the shrine rest calls directly, and therefore does
* not currently subscribe to the i2b2 message format.
* @param unflagQueryDto - {Object} - Data transfer object with queryId member.
*/
Flag: function( flagQueryDto ){
// create a scoped callback message
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = i2b2.CRC.model.QueryMasters;
scopeCB.callback = function(i2b2CellMsg) {
i2b2.CRC.ctrlr.history.Refresh();
};
// fire the AJAX call
var options = {
- network_query_id: flagQueryDto.queryId,
- message: flagQueryDto.message
+ network_query_id: flagQueryDto.queryId
};
i2b2.CRC.ajax.flagQueryMaster("CRC:History", options, scopeCB);
},
// ================================================================================================== //
SyncRefresh: function() {
console.info("CALLED i2b2.CRC.ctrlr.history.Refresh()");
// THIS FUNCTION DOES THE FOLLOWING:
// 1) fires a call to ajax.getCategories(),
// 2) interprets the XML / populates the ONT data model,
// 3) fires it's onDataUpdate event
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = i2b2.CRC.model.QueryMasters;
scopeCB.callback = i2b2.CRC.ctrlr.history.refresh_callback2;
// fire the AJAX call
var options = {
result_wait_time: 180,
crc_max_records: i2b2.CRC.view['history'].params.maxQueriesDisp,
crc_sort_by: i2b2.CRC.view['history'].params.sortBy,
crc_sort_order: i2b2.CRC.view['history'].params.sortOrder
};
i2b2.CRC.ajax.getQueryMasterList_fromUserId("CRC:History", options, scopeCB);
//var i2b2CellMsg = i2b2.CRC.ajax.getQueryMasterList_fromUserId("CRC:History", options);
//i2b2.CRC.ctrlr.history.refresh_callback(i2b2CellMsg);
},
// ================================================================================================== //
queryDelete: function(qmID) {
// function requires a Query Master ID
var t = i2b2.sdx.Master.Load('QM',qmID);
var QueryName = t.origData.name;
if (confirm('Delete Query "' + QueryName + '"?')) {
// create a scoped callback message
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = i2b2.CRC.model.QueryMasters;
scopeCB.callback = function(i2b2CellMsg) {
// define the XML processing function
console.group("CALLBACK Processing AJAX i2b2CellMsg");
console.dir(i2b2CellMsg);
i2b2.CRC.view.history.queryResponse = i2b2CellMsg.msgResponse;
i2b2.CRC.view.history.queryRequest = i2b2CellMsg.msgRequest;
i2b2.CRC.view.history.queryUrl = i2b2CellMsg.msgUrl;
if (i2b2CellMsg.error) {
alert("An error has occurred in the Cell's AJAX library.\n Press F12 for more information");
}
// refresh the Query History data
i2b2.CRC.ctrlr.history.Refresh();
};
// fire the AJAX call
var options = {
result_wait_time: 180,
qm_key_value: qmID
};
i2b2.CRC.ajax.deleteQueryMaster("CRC:History", options, scopeCB);
}
},
queryDeleteNoPrompt: function(qmID) {
// function requires a Query Master ID
// create a scoped callback message
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = i2b2.CRC.model.QueryMasters;
scopeCB.callback = function(i2b2CellMsg) {
// define the XML processing function
console.group("CALLBACK Processing AJAX i2b2CellMsg");
console.dir(i2b2CellMsg);
i2b2.CRC.view.history.queryResponse = i2b2CellMsg.msgResponse;
i2b2.CRC.view.history.queryRequest = i2b2CellMsg.msgRequest;
i2b2.CRC.view.history.queryUrl = i2b2CellMsg.msgUrl;
//if (i2b2CellMsg.error) {
// alert("An error has occurred in the Cell's AJAX library.\n Press F12 for more information");
//}
// refresh the Query History data
i2b2.CRC.ctrlr.history.Refresh();
};
// fire the AJAX call
var options = {
result_wait_time: 180,
qm_key_value: qmID
};
i2b2.CRC.ajax.deleteQueryMaster("CRC:History", options, scopeCB);
},
// ================================================================================================== //
queryRename: function(qmID, newQueryName, sdxPackage) {
this.queryNewName = newQueryName || false;
if (!this.queryNewName) {
// callback for dialog submission
var handleSubmit = function() {
// submit value(s)
var closure_qmID = qmID;
if(this.submit()) {
// run the query
i2b2.CRC.ctrlr.history.queryRename(closure_qmID, $('inputQueryName').value);
}
}
// display the query name input dialog
this._queryPromptName(handleSubmit);
// get the old name (and trim whitespace)
$('inputQueryName').value = sdxPackage.origData.realname;
return;
}
// create a scoped callback message
var scopeCB = new i2b2_scopedCallback();
scopeCB.scope = this;
scopeCB.callback = function(i2b2CellMsg) {
// define the XML processing function
console.group("CALLBACK Processing AJAX i2b2CellMsg");
console.dir(i2b2CellMsg);
i2b2.CRC.view.history.queryResponse = i2b2CellMsg.msgResponse;
i2b2.CRC.view.history.queryRequest = i2b2CellMsg.msgRequest;
i2b2.CRC.view.history.queryUrl = i2b2CellMsg.msgUrl;
if (i2b2CellMsg.error) {
alert("An error has occurred in the Cell's AJAX library.\n Press F12 for more information");
}
// refresh the Query History data
i2b2.CRC.ctrlr.history.Refresh();
console.groupEnd();
};
// fire the AJAX call
var options = {
qm_key_value: qmID,
qm_name: newQueryName
};
i2b2.CRC.ajax.renameQueryMaster("CRC:History", options, scopeCB);
},
// ================================================================================================== //
_queryPromptName: function(handleSubmit) {
if (!i2b2.CRC.view.dialogQmName) {
var handleCancel = function() {
this.cancel();
};
var loopBackSubmit = function() {
i2b2.CRC.view.dialogQmName.submitterFunction();
};
i2b2.CRC.view.dialogQmName = new YAHOO.widget.SimpleDialog("dialogQmName", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: loopBackSubmit,
isDefault: true
}, {
text: "Cancel",
handler: handleCancel
}]
});
$('dialogQmName').show();
i2b2.CRC.view.dialogQmName.validate = function(){
// now process the form data
var msgError = '';
var queryNameInput = $('inputQueryName');
if (!queryNameInput || queryNameInput.value.blank()) {
alert('Please enter a name for this query.');
return false;
}
return true;
};
i2b2.CRC.view.dialogQmName.render(document.body);
}
// manage the event handler for submit
delete i2b2.CRC.view.dialogQmName.submitterFunction;
i2b2.CRC.view.dialogQmName.submitterFunction = handleSubmit;
// display the dialoge
i2b2.CRC.view.dialogQmName.center();
i2b2.CRC.view.dialogQmName.show();
}
}
// signal that is fired when the CRC cell's data model is updated
// ================================================================================================== //
i2b2.CRC.ctrlr.history.events = new Object;
i2b2.CRC.ctrlr.history.events.onDataUpdate = new YAHOO.util.CustomEvent("DataUpdate", i2b2.CRC);
console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryPanel.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryPanel.js
old mode 100755
new mode 100644
index 9a7d7f221..55ab3a38f
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryPanel.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryPanel.js
@@ -1,998 +1,1014 @@
/**
* @projectDescription Event controller for Query Tool's three query panels. (GUI-only controller).
* @inherits
* @namespace
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* ----------------------------------------------------------------------------------------
* updated 9-15-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: CRC > ctrlr > QueryPanel');
console.time('execute time');
function i2b2_PanelController(parentCtrlr) {
// this is the base class for the single panel controllers
this.panelCurrentIndex = false;
this.actualPanelIndex = false;
this.QTController = parentCtrlr;
this.refTitle = undefined;
this.refButtonExclude = undefined;
this.refButtonDates = undefined;
this.refButtonOccurs = undefined;
this.refButtonOccursNum = undefined;
this.refDispContents = undefined;
this.refButtonTiming = undefined;
this.refBalloon = undefined;
this.itemNumber = 0;
var Event = YAHOO.util.Event;
// ================================================================================================== //
this.doRedraw = function() {
if (this.panelCurrentIndex===false) { return true; }
if (!i2b2.CRC.model.queryCurrent.panels) {
i2b2.CRC.model.queryCurrent.panels = [];
i2b2.CRC.model.queryCurrent.panels[0] = new Array();
i2b2.CRC.model.queryCurrent.panels[1] = new Array();
i2b2.CRC.model.queryCurrent.panels[2] = new Array();
// new Array(new Array());
}
var dm = i2b2.CRC.model.queryCurrent;
// retreve/initialize the display data
// if ((this.panelCurrentIndex < dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length)
// || (this.panelCurrentIndex == 0)) {
var pd = dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
this._redrawPanelStyle(pd);
// protip: use null data to get other redraws to work
if (undefined===pd) {
pd = {};
pd._nullRecord = true;
pd.dateTo = false;
pd.dateFrom = false;
pd.exclude = false;
pd.timing = i2b2.CRC.ctrlr.QT.queryTiming; //'ANY';
pd.occurs = '0';
pd.items = [];
}
// do redraw
this._redrawTree(pd);
this._redrawButtons(pd);
this._redrawTiming(pd);
+ this._redrawExclude(pd); // nw096 - Excludes improvement
//}
}
// ================================================================================================== //
this._redrawPanelStyle = function(pd) {
if (undefined===pd) {
// disable visual changes on hover
Element.removeClassName(this.refButtonExclude,'queryPanelButtonHover');
Element.removeClassName(this.refButtonOccurs,'queryPanelButtonHover');
Element.removeClassName(this.refButtonDates,'queryPanelButtonHover');
Element.removeClassName(this.refButtonTiming,'queryPanelButtonHover');
Element.removeClassName(this.refButtonExclude,'queryPanelButtonSelected');
Element.removeClassName(this.refButtonOccurs,'queryPanelButtonSelected');
Element.removeClassName(this.refButtonDates,'queryPanelButtonSelected');
Element.removeClassName(this.refButtonTiming,'queryPanelButtonSelected');
// is this panel one up from the max number of panels?
if (this.panelCurrentIndex == i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length) {
this.isActive = 'Y';
if (this.QTController.queryTiming == "SAME") {
this.refButtonTiming.set('disabled', true);
//MM $("queryPanelTimingB" + (this.panelCurrentIndex+1) + "-button").disabled = false;
}
Element.removeClassName(this.refDispContents,'queryPanelHover');
Element.removeClassName(this.refDispContents,'queryPanelDisabled');
this.refBalloon.style.display = 'block';
this.refBalloon.innerHTML = 'drop a<br />term<br />on here';
this.refBalloon.style.background = '#FFFF99';
} else {
this.isActive = 'N';
Element.addClassName(this.refDispContents,'queryPanelDisabled');
this.refBalloon.style.display = 'none';
}
} else {
// enable visual changes on hover
Element.addClassName(this.refButtonExclude,'queryPanelButtonHover');
Element.addClassName(this.refButtonTiming,'queryPanelButtonHover');
Element.addClassName(this.refButtonOccurs,'queryPanelButtonHover');
Element.addClassName(this.refButtonDates,'queryPanelButtonHover');
this.isActive = 'Y';
Element.removeClassName(this.refDispContents,'queryPanelHover');
Element.removeClassName(this.refDispContents,'queryPanelDisabled');
this.refBalloon.style.display = 'block';
}
}
// ================================================================================================== //
this._redrawTree = function(pd) {
if (undefined===pd.tvRootNode) {
pd.tvRootNode = new YAHOO.widget.RootNode(this.yuiTree);
}
// reconnect the root node with the treeview
YAHOO.widget.TreeView.attachRootNodeToTree(pd.tvRootNode, this.yuiTree);
// cause the treeview to redraw
this.yuiTree.draw();
for (var i=0; i<pd.tvRootNode.children.length; i++) {
// fix the folder icon for expanded folders
var n = pd.tvRootNode.children[i];
this._redrawTreeFix.call(this, n);
}
}
// ================================================================================================== //
this._redrawTreeFix = function(tvNode) {
// this is a recursive function used to fix all the folder images in a treeview after initial redraw
if (!tvNode.tree.locked && (tvNode.hasChildren(true))) {
if (tvNode.children.length > 0 && tvNode.expanded) {
var imgs = $(tvNode.contentElId);
if (imgs) {
imgs = imgs.select('img');
} else {
imgs = [];
}
if (imgs.length > 0) {
var isrc = imgs[0].getAttribute('src').replace('.gif','-exp.gif');
imgs[0].setAttribute('src', isrc);
}
}
if (!tvNode.isLeaf) {
tvNode._dynLoad = true;
// reattach the dynamic load event if it was lost
this.yuiTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1);
}
for (var i=0; i<tvNode.children.length; i++) {
this._redrawTreeFix.call(this, tvNode.children[i]);
}
}
}
// ================================================================================================== //
this._redrawTiming = function(pd) {
// set panel GUI according to data in the "pd" object
if (undefined===pd) { pd = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex]; }
if (this.actualPanelIndex > 3) {return}
if (pd.timing == "SAMEVISIT" )
{
//this.refTiming.innerHTML = "Occurs in Same Encounter";
$("queryPanelTimingB" + (this.actualPanelIndex+1) + "-button").innerHTML = "Occurs in Same Encounter";
} else if (pd.timing == "SAMEINSTANCENUM") {
// this.refTiming.innerHTML ="Items Instance will be the same";
$("queryPanelTimingB" + (this.actualPanelIndex+1) + "-button").innerHTML = "Items Instance will be the same";
} else {
// this.refTiming.innerHTML = "Treat Independently";
$("queryPanelTimingB" + (this.actualPanelIndex+1) + "-button").innerHTML = "Treat Independently";
}
// i2b2.CRC.view.QT.setPanelTiming(this.panelCurrentIndex + 1, pd.timing);
}
// ================================================================================================== //
this._redrawButtons = function(pd) {
$('infoQueryStatusText').innerHTML = "";
// set panel GUI according to data in the "pd" object
if (undefined===pd) { pd = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex]; }
if (pd.exclude) {
Element.addClassName(this.refButtonExclude,'queryPanelButtonSelected');
this.refBalloon.style.background = '#FF9999';
this.refBalloon.innerHTML = 'none<br />of<br />these';
} else {
Element.removeClassName(this.refButtonExclude,'queryPanelButtonSelected');
if (pd._nullRecord) {
this.refBalloon.style.background = '#FFFF99';
this.refBalloon.innerHTML = 'drop a<br />term<br />on here';
} else {
this.refBalloon.style.background = '#99EE99';
this.refBalloon.innerHTML = 'one or<br />more of<br />these';
}
}
if (pd.occurs > 0) {
Element.addClassName(this.refButtonOccurs,'queryPanelButtonSelected');
} else {
Element.removeClassName(this.refButtonOccurs,'queryPanelButtonSelected');
}
this.refButtonOccursNum.innerHTML = pd.occurs;
if (pd.dateTo || pd.dateFrom) {
Element.addClassName(this.refButtonDates,'queryPanelButtonSelected');
} else {
Element.removeClassName(this.refButtonDates,'queryPanelButtonSelected');
}
}
+
+// ================================================================================================== //
+ this._redrawExclude = function(pd) {
+ if (undefined===pd) { pd = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex]; }
+
+ jQuery('#QPD'+(this.panelCurrentIndex+1)+' [class^="sdxDefault"]').find('span.itemExclude').remove();
+ if(pd.exclude){
+ for(var i=0;i<pd.items.length;i++){
+ jQuery('<span title="This item is being excluded" class="itemExclude">&nbsp;NOT&nbsp;</span>').prependTo(jQuery('#QPD'+(this.panelCurrentIndex+1)+' [class^="sdxDefault"]')[i]);
+ }
+ }
+ }
// ================================================================================================== //
this.showLabValues = function(key, extData) {
i2b2.CRC.view.modalLabValues.show(this.panelCurrentIndex, this, key, extData, false);
}
// ================================================================================================== //
this.showModValues = function(key, extData) {
i2b2.CRC.view.modalLabValues.show(this.panelCurrentIndex, this, key, extData, true);
}
// ================================================================================================== //
this.showOccurs = function(iMinCount) {
if (i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length==0) { return;}
var dm = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
if (undefined!==dm) {
if (i2b2.CRC.ctrlr.QT.queryTiming == "ENCOUNTER")
{
$('constraintEncounterBased').show();
$('constraintTextBased').hide();
} else {
$('constraintEncounterBased').hide();
$('constraintTextBased').hide();
}
// load value
$('constraintOccursInput').value = dm.occurs;
// prep variables for JS closure
var qpi = this.panelCurrentIndex;
var cpc = this;
// show occurs window
if (!Object.isUndefined(this.modalOccurs)) { delete this.modalOccurs; }
if (!this.modalOccurs) {
if (!Object.isUndefined(handleSubmit)) { delete handleSubmit; }
//init slider
var slider,
bg="slider-bg", thumb="slider-thumb",
valuearea="slider-value", textfield="slider-converted-value";
// The slider can move 0 pixels up
var topConstraint = 0;
// The slider can move 200 pixels down
var bottomConstraint = 200;
// Custom scale factor for converting the pixel offset into a real value
var scaleFactor = 2;
// The amount the slider moves when the value is changed with the arrow
// keys
var keyIncrement = 10;
var tickSize = 10;
Event.onDOMReady(function() {
slider = YAHOO.widget.Slider.getHorizSlider(bg,
thumb, topConstraint, bottomConstraint);
// Sliders with ticks can be animated without YAHOO.util.Anim
slider.animate = true;
slider.setValue(dm.relevance * 2);
slider.getRealValue = function() {
return Math.round(this.getValue() / scaleFactor);
}
slider.subscribe("change", function(offsetFromStart) {
var valnode = Dom.get(valuearea);
// Display the pixel value of the control
valnode.innerHTML = slider.getRealValue()// offsetFromStart ;
// slider.getRealValue();
//var fld = Dom.get(textfield);
});
Event.on(textfield, "keydown", function(e) {
// set the value when the 'return' key is detected
if (Event.getCharCode(e) === 13) {
var v = parseFloat(this.value, 10);
v = (lang.isNumber(v)) ? v : 0;
// convert the real value into a pixel offset
slider.setValue(Math.round(v/scaleFactor));
}
});
// Use setValue to reset the value to white:
Event.on("putval", "click", function(e) {
slider.setValue(100, false); //false here means to animate if possible
});
});
var handleSubmit = function(){
var closure_qpi = qpi;
var closure_cpc = cpc;
// submit value(s)
if (this.submit()) {
var pd = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][closure_qpi];
pd.occurs = parseInt($('constraintOccursInput').value, 10);
pd.relevance = slider.getRealValue();
slider.setValue(0);
delete(slider);
closure_cpc._redrawButtons(pd);
i2b2.CRC.ctrlr.QT.doSetQueryName.call(this, '');
}
}
var handleCancel = function(){
this.cancel();
}
var handleHelp = function(){
alert("Help soon");
}
this.modalOccurs = new YAHOO.widget.SimpleDialog("constraintOccurs", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: handleSubmit,
isDefault: true
}, {
text: "Cancel",
handler: handleCancel
}]
});
$('constraintOccurs').show();
this.modalOccurs.validate = function(){
// now process the form data
var t = parseInt($('constraintOccursInput').value, 10);
if (isNaN(t)) {
alert('The number you entered could not be understood.\nPlease make sure that you entered a valid number.');
return false;
}
if (t > 19) {
alert('The number you entered was too large.\nThe maximum number you can enter is 19.');
return false;
}
if (t < 0) {
alert('The number you entered was too small.\nThe minimum number you can enter is 0.');
return false;
}
return true;
};
this.modalOccurs.render(document.body);
}
//$('constraintOccurs_c').show();
this.modalOccurs.show();
//this.modalOccurs.visible = true;
}
}
this.showLimit = function(iMinCount) {
if (i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length==0) { return;}
var dm = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
if (undefined!==dm) {
// prep variables for JS closure
var qpi = this.panelCurrentIndex;
var cpc = this;
// show occurs window
if (!Object.isUndefined(this.modalLimits)) { delete this.modalLimits }
if (!this.modalLimits) {
if (!Object.isUndefined(handleSubmit)) { delete handleSubmit; }
var handleSubmit = function(){
var closure_qpi = qpi;
var closure_cpc = cpc;
// submit value(s)
if (this.submit()) {
var pd = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][closure_qpi];
closure_cpc._redrawButtons(pd);
i2b2.CRC.ctrlr.QT.doSetQueryName.call(this, '');
}
}
var handleCancel = function(){
this.cancel();
}
var handleHelp = function(){
alert("Help soon");
}
this.modalLimits = new YAHOO.widget.SimpleDialog("constraintLimits", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: handleSubmit,
isDefault: true
}, {
text: "Cancel",
handler: handleCancel
}, {
text: "Help",
handler: handleHelp
}]
});
$('constraintLimits').show();
this.modalLimits.validate = function(){
// now process the form data
return true;
};
this.modalLimits.render(document.body);
}
//$('constraintOccurs_c').show();
this.modalLimits.show();
//this.modalOccurs.visible = true;
}
}
// ================================================================================================== //
this.doExclude = function(bExclude) {
if (i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length==0) { return;}
var bVal;
var dm = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
if (undefined!==dm) {
if (undefined!=bExclude) {
bVal = bExclude;
} else {
bVal = !Boolean(dm.exclude);
}
dm.exclude = bVal;
this._redrawButtons(dm);
+ this._redrawExclude(dm);
}
// clear the query name and set the query as having dirty data
var QT = i2b2.CRC.ctrlr.QT;
QT.doSetQueryName.call(QT,'');
}
// ================================================================================================== //
this.doTiming = function(sTiming) {
$('infoQueryStatusText').innerHTML = "";
if (i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length==0) { return;}
var bVal;
var dm = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
//this.QTController.panelControllers[this.panelCurrentIndex];
if (undefined!==dm) {
if (undefined!=sTiming) {
bVal = sTiming;
} else {
bVal = i2b2.CRC.ctrlr.QT.queryTiming; //'ANY';
}
dm.timing = bVal;
//this._redrawButtons(dm);
}
// clear the query name and set the query as having dirty data
//var QT = i2b2.CRC.ctrlr.QT;
//QT.doSetQueryName.call(QT,'');
}
this.clone = function(obj){
/*
var outpurArr = {};
for (var i in obj) {
outpurArr[i] = typeof (obj[i]) == 'object' ? this.clone(obj[i]) : obj[i];
}
return outpurArr;
*/
//return YAHOO.lang.JSON.parse( YAHOO.lang.JSON.stringify( obj ) );
if ((null == obj) || ("object" != (typeof obj))) return obj;
var copy = obj.constructor();
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) copy[attr] = obj[attr];
}
copy.itemNumber = this.itemNumber++;
return copy;
/* *
if(obj == null || typeof(obj) != 'object')
return obj;
var copy = {};
for (var attr in obj) {
if (obj.hasOwnProperty(attr)) copy[attr] = this.clone(obj[attr]);
}
return copy;
*/
/*
var clone = {};
for(var i in obj) {
if(typeof(obj[i])=="object")
clone[i] = this.clone(obj[i]);
else
clone[i] = obj[i];
}
return clone;
*/
}
// ================================================================================================== //
this.doDrop = function(sdxConceptOrig) { // function to handle drag and drop
//Clone it
//var sdxConcept = this.clone(sdxConceptOrig);
var sdxConcept = i2b2.sdx.TypeControllers.CONCPT.MakeObject(sdxConceptOrig.origData.xmlOrig, sdxConceptOrig.origData.isModifier, null, sdxConceptOrig.origData.parent, sdxConceptOrig.sdxInfo.sdxType);
// insert concept into our panel's items array;
var dm = i2b2.CRC.model.queryCurrent;
var repos = false;
var targetPanelIndex = this.panelCurrentIndex;
if (Object.isUndefined(dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][targetPanelIndex])) {
this.QTController.panelAdd(this.yuiTree);
repos = true;
}
var il = dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][targetPanelIndex].items;
// check for duplicate data
//if (sdxConcept.origData.isModifier != true) {
// for (var i=0; i<il.length; i++) {
// if (il[i].sdxInfo.sdxKeyValue==sdxConcept.sdxInfo.sdxKeyValue) {return false; }
// }
//}
//Delete any lab or modifiers that exist
//delete sdxConcept.LabValues;
//delete sdxConcept.ModValues;
sdxConcept.itemNumber = this.itemNumber++;
// save data
this._addConcept(sdxConcept,this.yuiTree.root, true);
// reset the query name to be blank and flag as having dirty data
i2b2.CRC.ctrlr.QT.doSetQueryName('');
this.QTController._redrawAllPanels();
}
// ================================================================================================== //
this._addConcept = function (sdxConcept, tvParent, isDragged) {
var tmpNode = this._addConceptVisuals.call(this, sdxConcept, tvParent, isDragged);
// add concept to data model record for panel
var panel = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
panel.items[panel.items.length] = sdxConcept;
return tmpNode;
}
// ================================================================================================== //
this._addConceptVisuals = function (sdxConcept, tvParent, isDragged) {
var tvTree = tvParent.tree;
if (sdxConcept.sdxInfo.sdxType == "CONCPT") {
var sdxDataNode = i2b2.sdx.Master.EncapsulateData('CONCPT',sdxConcept.origData);
var title = "";
if (sdxConcept.origData.isModifier) {
var values = sdxConcept.ModValues;
} else {
var values = sdxConcept.LabValues;
}
if (values != null) {
switch(values.MatchBy) {
case "FLAG":
//mm ??not sure tvChildren[i].html = ' = '+i2b2.h.Escape(values.ValueFlag) + "</div></div>";
break;
case "VALUE":
if (values.GeneralValueType== "LARGESTRING") {
title = "";
} else if ((values.GeneralValueType=="ENUM") || (values.GeneralValueType=="TEXT")) {
try {
var sEnum = [];
for (var i2=0;i2<values.ValueEnum.length;i2++) {
sEnum.push(i2b2.h.Escape(values.ValueEnum[i2]));
}
sEnum = sEnum.join("\", \"");
sEnum = ' = ('+sEnum+')';
//tvChildren[i].html = sEnum + "</div></div>"
title = sEnum;
} catch (e) {
}
} else {
if (values.NumericOp == 'BETWEEN') {
title = ' '+i2b2.h.Escape(values.ValueLow)+' - '+i2b2.h.Escape(values.ValueHigh);
} else {
switch(values.NumericOp) {
case "LT":
var numericOp = " < ";
break;
case "LE":
var numericOp = " <= ";
break;
case "EQ":
var numericOp = " = ";
break;
case "GT":
var numericOp = " > ";
break;
case "GE":
var numericOp = " >= ";
break;
case "":
break;
}
title = numericOp +i2b2.h.Escape(values.Value);
}
}
break;
case "":
break;
}
}
if (sdxConcept.origData.isModifier) {
i2b2.CRC.ctrlr.QT.hasModifier = true;
//Get the blob for this now.
if (isDragged) {
var cdetails = i2b2.ONT.ajax.GetModifierInfo("CRC:QueryTool", {modifier_applied_path:sdxConcept.origData.applied_path, modifier_key_value:sdxConcept.origData.key, ont_synonym_records: true, ont_hidden_records: true} );
// this is what comes out of the old AJAX call
var c = i2b2.h.XPath(cdetails.refXML, 'descendant::modifier');
if (c.length > 0) {
sdxConcept.origData.xmlOrig = c[0];
}
}
//Get parent who is not a modifier
var modParent = sdxConcept.origData.parent;
while (modParent != null)
{
if (modParent.isModifier)
{
modParent = modParent.parent;
} else {
sdxConcept.origData.newName = modParent.name + " [" + sdxConcept.origData.name + title + "]";
break;
}
}
var hasContainer = false;
var data = sdxConcept.origData;
while (hasContainer || !Object.isUndefined(data.parent))
{
if ((data.hasChildren == "OAE") || (data.hasChildren == "OA"))
{
hasContainer = true;
var realdata = sdxConcept.origData;
while ((realdata.hasChildren != "FA") &&
(realdata.hasChildren != "FAE"))
{
realdata = realdata.parent;
}
sdxConcept.origData.level = realdata.level;
sdxConcept.origData.parent.key = realdata.key;
//sdxConcept.origData.parent.name = sdxConcept.origData.name;
//sdxConcept.origData.name = realdata.name;
if (undefined == sdxConcept.origData.newName)
sdxConcept.origData.newName = realdata.name + " [" + sdxConcept.origData.name + title + "]";
//mm sdxConcept.origData.tooltip = realdata.tooltip;
sdxConcept.origData.hasChildren = realdata.hasChildren;
}
if (!Object.isUndefined(data.parent)) {
data = data.parent;
} else {
break;
}
}
//method to replace nth instance of a particular character.
function replaceNth(inputStr, nth){
var index = 0,
spaceReplaceRegex = /\s/g;
return inputStr.replace(spaceReplaceRegex, function (match, i, original) {
index++;
return (index % nth === 0) ? "<br/>" : match;
});
}
var renderOptions = {
//format string so that it isn't too wide.
title: replaceNth(sdxConcept.origData.newName, 4),
dblclick: "i2b2.CRC.ctrlr.QT.ToggleNode(this,'"+tvTree.id+"')",
icon: {
root: "sdx_ONT_CONCPT_root.gif",
rootExp: "sdx_ONT_CONCPT_root-exp.gif",
branch: "sdx_ONT_CONCPT_branch.gif",
branchExp: "sdx_ONT_CONCPT_branch-exp.gif",
leaf: "sdx_ONT_MODIFIER_leaf.gif"
}
};
} else {
if (isDragged) {
var cdetails = i2b2.ONT.ajax.GetTermInfo("CRC:QueryTool", {concept_key_value:sdxConcept.origData.key, ont_synonym_records: true, ont_hidden_records: true} );
var c = i2b2.h.XPath(cdetails.refXML, 'descendant::concept');
if (c.length > 0) {
sdxConcept.origData.xmlOrig = c[0];
}
}
sdxConcept.origData.newName = sdxConcept.origData.name + title;
var renderOptions = {
title: sdxConcept.origData.name + title,
dblclick: "i2b2.CRC.ctrlr.QT.ToggleNode(this,'"+tvTree.id+"')",
icon: {
root: "sdx_ONT_CONCPT_root.gif",
rootExp: "sdx_ONT_CONCPT_root-exp.gif",
branch: "sdx_ONT_CONCPT_branch.gif",
branchExp: "sdx_ONT_CONCPT_branch-exp.gif",
leaf: "sdx_ONT_CONCPT_leaf.gif"
}
};
}
} else if (sdxConcept.sdxInfo.sdxType == "ENS") {
var sdxDataNode = i2b2.sdx.Master.EncapsulateData('ENS',sdxConcept.origData);
var title = sdxConcept.origData.titleCRC;
if (title == undefined)
{
title = sdxConcept.origData.title;
}
var renderOptions = {
title: title,
icon: "sdx_CRC_PRS.jpg"
};
} else if (sdxConcept.sdxInfo.sdxType == "PRS") {
var sdxDataNode = i2b2.sdx.Master.EncapsulateData('PRS',sdxConcept.origData);
var title = sdxConcept.origData.titleCRC;
if (title == undefined)
{
title = sdxConcept.origData.title;
}
var renderOptions = {
title: title,
icon: "sdx_CRC_PRS.jpg"
};
} else if (sdxConcept.sdxInfo.sdxType == "QM") {
var sdxDataNode = i2b2.sdx.Master.EncapsulateData('QM',sdxConcept.origData);
var title = sdxConcept.origData.titleCRC;
if (title == undefined)
{
title = sdxConcept.origData.title;
}
var renderOptions = {
title: title,
icon: "sdx_CRC_QM.gif"
};
}
if (!sdxDataNode) { return false; }
var sdxRenderData = i2b2.sdx.Master.RenderHTML(tvTree.id, sdxDataNode, renderOptions);
sdxRenderData.itemNumber = sdxConcept.itemNumber;
if (!sdxConcept.origData.isModifier) {
//check if lab has value if so than auto popup
var lvMetaDatas2 = i2b2.h.XPath(sdxConcept.origData.xmlOrig, 'metadataxml/ValueMetadata[string-length(Version)>0]');
if (lvMetaDatas2.length > 0) {
//bring up popup
this.showLabValues(sdxConcept.origData.key, sdxRenderData);
}
} else {
//check if the mod has a value, if so than auto popup
var lvMetaDatas1 = i2b2.h.XPath(sdxConcept.origData.xmlOrig, 'metadataxml/ValueMetadata[string-length(Version)>0]');
if (lvMetaDatas1.length > 0) {
//bring up popup
this.showModValues(sdxConcept.origData.key, sdxRenderData);
}
}
i2b2.sdx.Master.AppendTreeNode(tvTree, tvParent, sdxRenderData);
return sdxRenderData;
}
// ================================================================================================== //
this._deleteConcept = function(htmlID) {
var pd = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup][this.panelCurrentIndex];
$('infoQueryStatusText').innerHTML = "";
if (undefined===htmlID) { return; }
// remove the node in the treeview
var tvChildren = pd.tvRootNode.children
for (var i=0; i< tvChildren.length; i++) {
if (tvChildren[i].data.nodeid===htmlID) {
this.yuiTree.removeNode(tvChildren[i],false);
this._redrawTree.call(this, pd);
+ this._redrawExclude.call(this,pd);
break;
}
}
// remove the concept from the data model
pd.items.splice(i,1);
// remove this panel if it's empty
if (pd.items.length == 0) { this.doDelete(); }
// clear the query name if it was set
this.QTController.doSetQueryName.call(this,'');
+ this._redrawExclude(pd);
}
// ================================================================================================== //
this._renameConcept = function(key, isModifier, pd) {
$('infoQueryStatusText').innerHTML = "";
//var pd = i2b2.CRC.model.queryCurrent.panels[this.panelCurrentIndex];
// remove the concept from panel
for (var i=0; i< pd.items.length; i++) {
if ((pd.items[i].origData.key == key)
|| (pd.items[i].itemNumber == key)) {
// found the concept to remove
var rto = pd.items[i];
break;
}
}
if (undefined===rto) { return; }
// rename the node in the treeview
var tvChildren = pd.tvRootNode.children
for (var i=0; i< tvChildren.length; i++) {
//if ((tvChildren[i].data.i2b2_SDX.sdxInfo.sdxKeyValue===rto.origData.key)
// || (tvChildren[i].data.i2b2_SDX.sdxInfo.sdxKeyValue===rto.origData.id)) {
if (tvChildren[i].data.i2b2_SDX.itemNumber==key) {
var tt = tvChildren[i].getContentHtml();
var tt2 = tt.substring(0, tt.lastIndexOf("\"/>")+3);
var tt3 = "";
if (isModifier) {
var values = rto.ModValues;
var modParent = rto.origData.parent;
while (modParent != null)
{
if (modParent.isModifier)
{
modParent = modParent.parent;
} else {
break;
}
}
tt2 += modParent.name + " ["+ rto.origData.name;
tt3 = "]";
rto.origData.newName = modParent.name + " ["+ rto.origData.name;
} else {
var values = rto.LabValues;
tt2 += rto.origData.name;
rto.origData.newName =rto.origData.name;
}
tvChildren[i].html = tt2 + tt3 + "</div></div>"
rto.origData.newName += tt3 ;
if (undefined != values) {
switch(values.MatchBy) {
case "FLAG":
tvChildren[i].html = tt2 + ' = '+i2b2.h.Escape(values.ValueFlag) + "</div></div>";
rto.origData.newName += ' = '+i2b2.h.Escape(values.ValueFlag);
break;
case "VALUE":
if (values.GeneralValueType=="ENUM") {
var sEnum = [];
for (var i2=0;i2<values.ValueEnum.length;i2++) {
sEnum.push(i2b2.h.Escape(values.NameEnum[i2].text));
}
sEnum = sEnum.join("\", \"");
sEnum = ' = ("'+sEnum+'")';
tvChildren[i].html = tt2 + sEnum + tt3 + "</div></div>";
rto.origData.newName += sEnum + tt3 ;
} else if (values.GeneralValueType=="LARGESTRING") {
tvChildren[i].html = tt2 + ' [contains "' + i2b2.h.Escape(values.ValueString) + '"]' + tt3 + "</div></div>";
rto.origData.newName += ' [contains "' + i2b2.h.Escape(values.ValueString) + '"]' + tt3;
} else if (values.GeneralValueType=="STRING") {
if (values.StringOp == undefined )
{
var stringOp = "";
} else {
switch(values.StringOp) {
case "LIKE[exact]":
var stringOp = "Exact: ";
break;
case "LIKE[begin]":
var stringOp = "Starts With: ";
break;
case "LIKE[end]":
var stringOp = "Ends With: ";
break;
case "LIKE[contains]":
var stringOp = "Contains: ";
break;
default:
var stringOp = "";
break;
}
}
tvChildren[i].html = tt2 + ' ['+stringOp + i2b2.h.Escape(values.ValueString) + "]" + tt3 + "</div></div>";
rto.origData.newName += ' ['+stringOp + i2b2.h.Escape(values.ValueString) + "]" + tt3;
} else {
if (!Object.isUndefined(values.UnitsCtrl))
{
tt3 = " " + values.UnitsCtrl + tt3;
}
if (values.NumericOp == 'BETWEEN') {
tvChildren[i].html = tt2 + ' '+i2b2.h.Escape(values.ValueLow)+' - '+i2b2.h.Escape(values.ValueHigh) + tt3 + "</div></div>";
rto.origData.newName += ' '+i2b2.h.Escape(values.ValueLow)+' - '+i2b2.h.Escape(values.ValueHigh) + tt3;
} else {
switch(values.NumericOp) {
case "LT":
var numericOp = " < ";
break;
case "LE":
var numericOp = " <= ";
break;
case "EQ":
var numericOp = " = ";
break;
case "GT":
var numericOp = " > ";
break;
case "GE":
var numericOp = " >= ";
break;
case "":
break;
}
tvChildren[i].html = tt2 + numericOp +i2b2.h.Escape(values.Value) + tt3 + "</div></div>"
rto.origData.newName += numericOp +i2b2.h.Escape(values.Value) + tt3 ;
}
}
break;
case "":
break;
}
}
//tvChildren[i].setNodesProperty("label", "test", true);
//tvChildren[i].getLabelEl().innerHTML = label;
//this.yuiTree.removeNode(tvChildren[i],false);
//this._redrawTree.call(this, pd);
//this._redrawTree(pd);
pd.tvRootNode.tree.draw();
break;
}
}
// remove the concept from the data model
//pd.items.splice(i,1);
// remove this panel if it's empty
if (pd.items.length == 0) { this.doDelete(); }
// clear the query name if it was set
this.QTController.doSetQueryName.call(this,'');
}
// ================================================================================================== //
this.setPanelRecord = function (index, actual) {
this.panelCurrentIndex = index;
this.actualPanelIndex = actual;
this.doRedraw();
}
// ================================================================================================== //
this.doDelete = function() {
$('infoQueryStatusText').innerHTML = "";
// function fired when the [X] icon for the GUI panel is clicked
i2b2.CRC.ctrlr.QT.panelDelete(this.panelCurrentIndex);
// redraw the panels
var idx = this.panelCurrentIndex - this.ctrlIndex;
if (idx < 0) { idx = 0; }
i2b2.CRC.ctrlr.QT.doShowFrom(idx);
}
}
console.timeEnd('execute time');
console.groupEnd();
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryResults.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryResults.js
new file mode 100644
index 000000000..aae2a1b8c
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryResults.js
@@ -0,0 +1,15 @@
+/**
+ * @projectDescription The Asynchronous Query Formatted Results controller .
+ * @inherits i2b2.CRC.ctrlr
+ * @namespace i2b2.CRC.ctrlr.QueryFormattedResults
+ * @author Bhaswati Ghosh
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ */
+
+i2b2.CRC.ctrlr.QueryResults = function(string) {
+ this.resultString = string;
+};
+
+i2b2.CRC.ctrlr.currentQueryResults = false;
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryStatus.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryStatus.js
old mode 100755
new mode 100644
index 5c00520ee..3f15a536e
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryStatus.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryStatus.js
@@ -1,599 +1,653 @@
/**
* @projectDescription The Asynchronous Query Status controller (GUI-only controller).
* @inherits i2b2.CRC.ctrlr
* @namespace i2b2.CRC.ctrlr.QueryStatus
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.0
* ----------------------------------------------------------------------------------------
* updated 8-10-09: Initial Creation [Nick Benik]
*/
function cgmUtcDateParser(dateString){
//Date format: 2011-02-21T14:35:03.480-05:00
try{
splitDateAndTime = dateString.split("T");
vrDate = splitDateAndTime[0].split("-");
vrTime = splitDateAndTime[1].split(":");
strYear = vrDate[0];
strMonth = vrDate[1] - 1;
strDay = vrDate[2];
/*
alert("Year: "+ strYear);
alert("Month: "+ strMonth);
alert("Day: "+ strDay);*/
strHours = vrTime[0];
strMins = vrTime[1];
strSecs = null;
strMills = null;
vSecs = vrTime[2].split(".");
strSecs = vSecs[0];
vMills = vSecs[1].split("-");
strMills = vMills[0];
/*
alert("Hours: "+ strHours);
alert("Minutes: "+ strMins);
alert("Seconds: "+ strSecs);
alert("MilliSeconds: "+ strMills);*/
return new Date(strYear, strMonth, strDay, strHours, strMins, strSecs, strMills);
}
catch(e){
return null;
}
}
i2b2.CRC.ctrlr.QueryStatus = function(dispDIV) { this.dispDIV = dispDIV; };
-
+i2b2.CRC.ctrlr.currentQueryResults = null;
function trim(sString) {
while (sString.substring(0,1) == '\n') {
sString = sString.substring(1, sString.length);
}
while (sString.substring(sString.length-1, sString.length) == '\n') {
sString = sString.substring(0,sString.length-1);
}
return sString;
}
+
+
i2b2.CRC.ctrlr.QueryStatus.prototype = function() {
var private_singleton_isRunning = false;
var private_startTime = false;
var private_refreshInterrupt = false;
function private_refresh_status() {
// callback processor to check the Query Instance
var scopedCallbackQRSI = new i2b2_scopedCallback();
scopedCallbackQRSI.scope = self;
scopedCallbackQRSI.callback = function(results) {
if (results.error) {
alert(results.errorMsg);
return;
} else {
// find our query instance
var ri_list = results.refXML.getElementsByTagName('query_result_instance');
var l = ri_list.length;
for (var i=0; i<l; i++) {
var temp = ri_list[i];
var description = i2b2.h.XPath(temp, 'descendant-or-self::description')[0].firstChild.nodeValue;
self.dispDIV.innerHTML += "<div style=\"clear: both; padding-top: 10px; font-weight: bold;\">" + description + "</div>";
}
var crc_xml = results.refXML.getElementsByTagName('crc_xml_result');
l = crc_xml.length;
for (var i=0; i<l; i++) {
var temp = crc_xml[i];
var xml_value = i2b2.h.XPath(temp, 'descendant-or-self::xml_value')[0].firstChild.nodeValue;
var xml_v = i2b2.h.parseXml(xml_value);
var params = i2b2.h.XPath(xml_v, 'descendant::data[@column]/text()/..');
for (var i2 = 0; i2 < params.length; i2++) {
var name = params[i2].getAttribute("name");
if (i2b2.PM.model.isObfuscated) {
if ( params[i2].firstChild.nodeValue < 4) {
var value = "<3";
} else {
var value = params[i2].firstChild.nodeValue + "&plusmn;3" ;
}
} else
{
var value = params[i2].firstChild.nodeValue;
}
self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 20px; float: left; height: 16px; line-height: 16px;\">" + params[i2].getAttribute("column") + ": <font color=\"#0000dd\">" + value + "</font></div>";
}
var ri_id = i2b2.h.XPath(temp, 'descendant-or-self::result_instance_id')[0].firstChild.nodeValue;
}
//self.dispDIV.innerHTML += this.dispMsg;
}
}
var self = i2b2.CRC.ctrlr.currentQueryStatus;
// this private function refreshes the display DIV
var d = new Date();
var t = Math.floor((d.getTime() - private_startTime)/100)/10;
var s = t.toString();
if (s.indexOf('.') < 0) {
s += '.0';
}
if (private_singleton_isRunning) {
self.dispDIV.innerHTML = '<div style="clear:both;"><div style="float:left; font-weight:bold">Running Query: "'+self.QM.name+'"</div>';
// display the current run duration
self.dispDIV.innerHTML += '<div style="float:right">['+s+' secs]</div>';
} else {
self.dispDIV.innerHTML = '<div style="clear:both;"><div style="float:left; font-weight:bold">Finished Query: "'+self.QM.name+'"</div>';
self.dispDIV.innerHTML += '<div style="float:right">['+s+' secs]</div>';
-
// self.dispDIV.innerHTML += '<div style="margin-left:20px; clear:both; height:16px; line-height:16px; "><div height:16px; line-height:16px; ">Compute Time: ' + (Math.floor((self.QI.end_date - self.QI.start_date)/100))/10 + ' secs</div></div>';
// self.dispDIV.innerHTML += '</div>';
$('runBoxText').innerHTML = "Run Query";
}
self.dispDIV.innerHTML += '</div>';
if ((!private_singleton_isRunning) && (undefined != self.QI.end_date)){
self.dispDIV.innerHTML += '<div style="margin-left:20px; clear:both; line-height:16px; ">Compute Time: '+ (Math.floor((self.QI.end_date - self.QI.start_date)/100))/10 +' secs</div>';
}
var foundError = false;
for (var i=0; i < self.QRS.length; i++) {
var rec = self.QRS[i];
if (rec.QRS_time) {
var t = '<font color="';
switch(rec.QRS_Status) {
case "ERROR":
self.dispDIV.innerHTML += '<div style="clear:both; height:16px; line-height:16px; "><div style="float:left; font-weight:bold; height:16px; line-height:16px; ">'+rec.title+'</div><div style="float:right; height:16px; line-height:16px; "><font color="#dd0000">ERROR</font></div>';
// self.dispDIV.innerHTML += '<div style="float:right; height:16px; line-height:16px; "><font color="#dd0000">ERROR</font></div>'; //['+rec.QRS_time+' secs]</div>';
foundError = true;
break;
case "COMPLETED":
case "FINISHED":
foundError = false;
//t += '#0000dd">'+rec.QRS_Status;
break;
case "INCOMPLETE":
case "WAITTOPROCESS":
case "PROCESSING":
self.dispDIV.innerHTML += '<div style="clear:both; height:16px;line-height:16px; "><div style="float:left; font-weight:bold; height:16px; line-height:16px; ">'+rec.title+'</div><div style="float:right; height:16px; line-height:16px; "><font color="#00dd00">PROCESSING</font></div>';
// self.dispDIV.innerHTML += '<div style="float:right; height:16px; line-height:16px; "><font color="#00dd00">PROCESSING</font></div>'; //['+rec.QRS_time+' secs]</div>';
alert('Your query has timed out and has been rescheduled to run in the background. The results will appear in "Previous Queries"');
foundError = true;
//t += '#00dd00">'+rec.QRS_Status;
break;
}
t += '</font> ';
//self.dispDIV.innerHTML += '<div style="float:right; height:16px; line-height:16px; ">'+t+'['+rec.QRS_time+' secs]</div>';
}
self.dispDIV.innerHTML += '</div>';
if (foundError == false) {
if (rec.QRS_DisplayType == "CATNUM") {
//make call to get QRSI.
i2b2.CRC.ajax.getQueryResultInstanceList_fromQueryResultInstanceId("CRC:QueryStatus", {qr_key_value: rec.QRS_ID}, scopedCallbackQRSI);
} else if ((rec.QRS_DisplayType == "LIST") && (foundError == false)) {
self.dispDIV.innerHTML += "<div style=\"clear: both; padding-top: 10px; font-weight: bold;\">" + rec.QRS_Description + "</div>";
} else if (i2b2.h.isDQ) {
self.dispDIV.innerHTML += "<div style=\"margin-left:20px; clear:both; height:16px; line-height:16px; \"><div style=\"float:left; height:16px; line-height:16px; \">" + rec.title + "</div><div style=\"float:right; height:16px; line-height:16px; \"><font color=\"#0000dd\">" + rec.QRS_Status + "</font> [" + rec.QRS_time + " secs]</div></div>";
}
if (rec.QRS_Type == "PATIENTSET") {
// Check to see if timeline is checked off, if so switch to timeline
var t2 = $('dialogQryRun').select('INPUT.chkQueryType');
for (var i=0;i<t2.length; i++) {
var curItem = t2[i].nextSibling.data;
if (curItem != undefined)
{
curItem = curItem.toLowerCase();
//curitem = curItem.trim();
}
if ((t2[i].checked == true) && (rec.size > 0) && (curItem == " timeline")
&& !(i2b2.h.isBadObjPath('i2b2.Timeline.cfg.config.plugin'))
) {
i2b2.hive.MasterView.setViewMode('Analysis');
i2b2.PLUGINMGR.ctrlr.main.selectPlugin("Timeline");
//Process PatientSet
rec.QM_id = self.QM.id;
rec.QI_id = self.QI.id;
rec.PRS_id = rec.QRS_ID;
rec.result_instance_id = rec.PRS_id;
var sdxData = {};
sdxData[0] = i2b2.sdx.Master.EncapsulateData('PRS', rec);
i2b2.Timeline.prsDropped(sdxData);
i2b2.Timeline.setShowMetadataDialog(false);
//Process Concepts, put all concepts in one large set
sdxData = {};
for (var j2 = 0; j2 < i2b2.CRC.model.queryCurrent.panels.length; j2++) {
var panel_list = i2b2.CRC.model.queryCurrent.panels[j2]
var panel_cnt = panel_list.length;
for (var p2 = 0; p2 < panel_cnt; p2++) {
// Concepts
for (var i2=0; i2 < panel_list[p2].items.length; i2++) {
sdxData[0] = panel_list[p2].items[i2];
i2b2.Timeline.conceptDropped(sdxData);
}
}
}
//$('Timeline-pgstart').value = '1';
//$('Timeline-pgsize').value = '10';
//i2b2.Timeline.pgGo(0);
i2b2.Timeline.yuiTabs.set('activeIndex', 1);
i2b2.Timeline.setShowMetadataDialog(true);
}
}
}
}
}
if ((undefined != self.QI.message) && (foundError == false)) {
self.dispDIV.innerHTML += '<div style="clear:both; float:left; padding-top: 10px; font-weight:bold">Status</div>';
var mySplitResult = self.QI.message.split("<?xml");
for(i3 = 1; i3 < mySplitResult.length; i3++){
var xml_v = i2b2.h.parseXml(trim("<?xml " + mySplitResult[i3]));
for (var i2 = 0; i2 < xml_v.childNodes.length; i2++) {
try {
if (i2b2.PM.model.isObfuscated) {
if (i2b2.h.XPath(xml_v, 'descendant::total_time_second/text()/..')[i2].firstChild.nodeValue < 4)
{
var value = "<3";
} else {
var value = i2b2.h.XPath(xml_v, 'descendant::total_time_second/text()/..')[i2].firstChild.nodeValue + "&plusmn;3";
}
} else
{
var value = i2b2.h.XPath(xml_v, 'descendant::total_time_second/text()/..')[i2].firstChild.nodeValue;
}
self.dispDIV.innerHTML += '<div style="margin-left:20px; clear:both; line-height:16px; ">' + i2b2.h.XPath(xml_v, 'descendant::name/text()/..')[i2].firstChild.nodeValue + '<font color="#0000dd">: ' + value + ' secs</font></div>';
//self.dispDIV.innerHTML += '<div style="float: left; height: 16px; margin-right: 100px; line-height: 16px;"><font color="#0000dd">: ' + i2b2.h.XPath(xml_v, 'descendant::total_time_second/text()/..')[i2].firstChild.nodeValue + ' secs</font></div>';
} catch (e) {}
}
}
}
self.dispDIV.style.display = 'none';
self.dispDIV.style.display = 'block';
if (!private_singleton_isRunning && private_refreshInterrupt) {
// make sure our refresh interrupt is turned off
try {
clearInterval(private_refreshInterrupt);
private_refreshInterrupt = false;
} catch (e) {}
}
}
function private_cancelQuery() {
if (private_singleton_isRunning) {
try {
var self = i2b2.CRC.ctrlr.currentQueryStatus;
i2b2.CRC.ctrlr.history.queryDeleteNoPrompt(self.QM.id);
clearInterval(private_refreshInterrupt);
private_refreshInterrupt = false;
private_singleton_isRunning = false;
$('runBoxText').innerHTML = "Run Query";
self.dispDIV.innerHTML += '<div style="clear:both; height:16px; line-height:16px; text-align:center; color:r#ff0000;">QUERY CANCELLED</div>';
i2b2.CRC.ctrlr.currentQueryStatus = false;
} catch (e) {}
}
}
function private_startQuery() {
var self = i2b2.CRC.ctrlr.currentQueryStatus;
+ var resultString = ""; //BG
if (private_singleton_isRunning) {
return false;
}
private_singleton_isRunning = true;
+ //BG
+ var downloadDataTab = $('infoDownloadStatusData');
+ if(downloadDataTab)
+ downloadDataTab.innerHTML="";
+ i2b2.CRC.ctrlr.currentQueryResults = new i2b2.CRC.ctrlr.QueryResults(resultString);
+ //BG
self.dispDIV.innerHTML = '<b>Processing Query: "'+this.name+'"</b>';
self.QM.name = this.name;
self.QRS = [];
self.QI = {};
// callback processor to run the query from definition
this.callbackQueryDef = new i2b2_scopedCallback();
this.callbackQueryDef.scope = this;
this.callbackQueryDef.callback = function(results) {
- //if error
- if (results.error) {
- var temp = results.refXML.getElementsByTagName('response_header')[0];
- if (undefined != temp) {
- results.errorMsg = i2b2.h.XPath(temp, 'descendant-or-self::result_status/status')[0].firstChild.nodeValue;
- if (results.errorMsg.substring(0,9) == "LOCKEDOUT")
- {
- results.errorMsg = 'As an "obfuscated user" you have exceeded the allowed query repeat and are now LOCKED OUT, please notify your system administrator.';
- }
- }
- alert(results.errorMsg);
- private_cancelQuery();
- return;
- }
-
- //query was successful so update global settings.
- clearInterval(private_refreshInterrupt);
- private_refreshInterrupt = false;
- private_singleton_isRunning = false;
-
- //update the ui
- var self = i2b2.CRC.ctrlr.currentQueryStatus;
-
- // this private function refreshes the display DIV
- var d = new Date();
- var t = Math.floor((d.getTime() - private_startTime)/100)/10;
- var s = t.toString();
- if (s.indexOf('.') < 0) {
- s += '.0';
- }
-
- self.dispDIV.innerHTML = '<div style="clear:both;"><div style="float:left; font-weight:bold">Finished Query: "'+self.QM.name+'"</div>';
- self.dispDIV.innerHTML += '<div style="float:right">['+s+' secs]</div><br/>';
-
- $('runBoxText').innerHTML = "Run Query";
-
- //------------ QI Logic -------------------//
- // find our query instance
- var qi_list = results.refXML.getElementsByTagName('query_instance');
- var l = qi_list.length;
-
- for (var i=0; i<l; i++) {
- var qiNode = qi_list[i];
- var qi_id = i2b2.h.XPath(qiNode, 'descendant-or-self::query_instance_id')[0].firstChild.nodeValue;
-
- this.QI.message = i2b2.h.getXNodeVal(qiNode, 'message');
-
- //start date.
- this.QI.start_date = i2b2.h.getXNodeVal(qiNode, 'start_date');
- if (!Object.isUndefined(this.QI.start_date)) {
- this.QI.start_date = new Date(this.QI.start_date.substring(0,4), this.QI.start_date.substring(5,7)-1, this.QI.start_date.substring(8,10), this.QI.start_date.substring(11,13),this.QI.start_date.substring(14,16),this.QI.start_date.substring(17,19),this.QI.start_date.substring(20,23));
- }
+ try
+ {
+ //if error
+ if (results.error) {
+ var temp = results.refXML.getElementsByTagName('response_header')[0];
+ if (undefined != temp) {
+ results.errorMsg = i2b2.h.XPath(temp, 'descendant-or-self::result_status/status')[0].firstChild.nodeValue;
+ if (results.errorMsg.substring(0,9) == "LOCKEDOUT")
+ {
+ results.errorMsg = 'As an "obfuscated user" you have exceeded the allowed query repeat and are now LOCKED OUT, please notify your system administrator.';
+ }
+ }
+ alert(results.errorMsg);
+ private_cancelQuery();
+ return;
+ }
- //end date.
- this.QI.end_date = i2b2.h.getXNodeVal(qiNode, 'end_date');
- if (!Object.isUndefined(this.QI.end_date)) {
- this.QI.end_date = new Date(this.QI.end_date.substring(0,4), this.QI.end_date.substring(5,7)-1, this.QI.end_date.substring(8,10), this.QI.end_date.substring(11,13),this.QI.end_date.substring(14,16),this.QI.end_date.substring(17,19),this.QI.end_date.substring(20,23));
- }
+ //query was successful so update global settings.
+ clearInterval(private_refreshInterrupt);
+ private_refreshInterrupt = false;
+ private_singleton_isRunning = false;
+ resultString = ""; //BG
- // found the query instance, extract the info
- this.QI.status = i2b2.h.XPath(qiNode, 'descendant-or-self::query_status_type/name')[0].firstChild.nodeValue;
- this.QI.statusID = i2b2.h.XPath(qiNode, 'descendant-or-self::query_status_type/status_type_id')[0].firstChild.nodeValue;
- }
+ //update the ui
+ var self = i2b2.CRC.ctrlr.currentQueryStatus;
- //add the compute time.
- self.dispDIV.innerHTML += '</div>';
- self.dispDIV.innerHTML += '<div style="margin-left:20px; clear:both; line-height:16px; ">Compute Time: '+ s +' secs</div>';
+ // this private function refreshes the display DIV
+ var d = new Date();
+ var t = Math.floor((d.getTime() - private_startTime)/100)/10;
+ var s = t.toString();
+ if (s.indexOf('.') < 0) {
+ s += '.0';
+ }
- // -- query result instance vars -- //
- var qriNodeList = results.refXML.getElementsByTagName('query_result_instance'),
- qriIdx, qriNode, qriObj, breakdownType,
- errorObjects = [],
- brdNodeList, brdNode, brdIdx, brdObj;
+
+ self.dispDIV.innerHTML = '<div style="clear:both;"><div style="float:left; font-weight:bold">Finished Query: "'+self.QM.name+'"</div>';
+ self.dispDIV.innerHTML += '<div style="float:right">['+s+' secs]</div><br/>';
+ resultString += 'Finished Query: "' + self.QM.name + '"\n'; //BG
+ resultString += '[' + s + ' secs]\n'; //BG
+
+
+ $('runBoxText').innerHTML = "Run Query";
- //iterate through each query result.
- for (qriIdx = 0; qriIdx < qriNodeList.length; qriIdx++) {
+ //------------ QI Logic -------------------//
+
+ //BG find user id
+ var temp = results.refXML.getElementsByTagName('query_master')[0];
+
+ //Update the userid element when query is run first time
+ var userId = i2b2.h.getXNodeVal(temp,'user_id');
+ if(userId)
+ {
+ var existingUserIdElemList = $$("#userIdElem");
+ if(existingUserIdElemList)
+ {
+ existingUserIdElemList.each(function(existingUserIdElem){
+ existingUserIdElem.remove();
+ });
+ }
+ $("crcQueryToolBox.bodyBox").insert(new Element('input',{'type':'hidden','id':'userIdElem','value':userId}));
+ }
+ //End BG
+
+
+ // find our query instance
+ var qi_list = results.refXML.getElementsByTagName('query_instance'); //Original code commented by BG
+
+
+ var l = qi_list.length;
- //init qri vars.
- qriNode = qriNodeList[qriIdx];
- qriObj = parseQueryResultInstance(qriNode);
- breakdownType = '';
+ for (var i=0; i<l; i++) {
+ var qiNode = qi_list[i];
+ var qi_id = i2b2.h.XPath(qiNode, 'descendant-or-self::query_instance_id')[0].firstChild.nodeValue;
- //which hospital
- self.dispDIV.innerHTML += '<div style="clear:both;"><br/><div style="float:left; font-weight:bold; margin-left:20px;">' + qriObj.description + ' "' +self.QM.name+ '"</div>';
+ this.QI.message = i2b2.h.getXNodeVal(qiNode, 'message');
- //if there was an error display it.
- if((qriObj.statusName == "ERROR") || (qriObj.statusName == "UNAVAILABLE")){
+ //start date.
+ this.QI.start_date = i2b2.h.getXNodeVal(qiNode, 'start_date');
+ if (!Object.isUndefined(this.QI.start_date)) {
+ this.QI.start_date = new Date(this.QI.start_date.substring(0,4), this.QI.start_date.substring(5,7)-1, this.QI.start_date.substring(8,10), this.QI.start_date.substring(11,13),this.QI.start_date.substring(14,16),this.QI.start_date.substring(17,19),this.QI.start_date.substring(20,23));
+ }
- errorObjects.push(qriObj.problem);
+ //end date.
+ this.QI.end_date = i2b2.h.getXNodeVal(qiNode, 'end_date');
+ if (!Object.isUndefined(this.QI.end_date)) {
+ this.QI.end_date = new Date(this.QI.end_date.substring(0,4), this.QI.end_date.substring(5,7)-1, this.QI.end_date.substring(8,10), this.QI.end_date.substring(11,13),this.QI.end_date.substring(14,16),this.QI.end_date.substring(17,19),this.QI.end_date.substring(20,23));
+ }
- self.dispDIV.innerHTML += " &nbsp;- <span title='" + qriObj.statusDescription +"'> <b><a class='query-error-anchor' href='#' style='color:#ff0000'> <b><span color='#ff0000'>" + qriObj.problem.summary+ "</span></b></a></b></span>";
- continue;
- }
- else if((qriObj.statusName == "PROCESSING")){
- self.dispDIV.innerHTML += " - <span><b><font color='#00dd00'>Still Processing Request</font></b></span>";
- continue;
+ // found the query instance, extract the info
+ this.QI.status = i2b2.h.XPath(qiNode, 'descendant-or-self::query_status_type/name')[0].firstChild.nodeValue;
+ this.QI.statusID = i2b2.h.XPath(qiNode, 'descendant-or-self::query_status_type/status_type_id')[0].firstChild.nodeValue;
}
- else if(["COMPLETED","FINISHED"].indexOf(qriObj.statusName) < 0){
- self.dispDIV.innerHTML += " - <span><b><font color='#dd0000'>Results not available</font></b></span>";
- continue;
- }
+ //add the compute time.
+ self.dispDIV.innerHTML += '</div>';
+ resultString += '\n'; //BG
+ self.dispDIV.innerHTML += '<div style="margin-left:20px; clear:both; line-height:16px; ">Compute Time: '+ s +' secs</div>';
+ resultString += 'Compute Time: '+ s + ' secs\n'; //BG
+
+ // -- query result instance vars -- //
+ var qriNodeList = results.refXML.getElementsByTagName('query_result_instance'),
+ qriIdx, qriNode, qriObj, breakdownType,
+ errorObjects = [],
+ brdNodeList, brdNode, brdIdx, brdObj;
+
+ //iterate through each query result.
+ for (qriIdx = 0; qriIdx < qriNodeList.length; qriIdx++) {
- self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 30px; float: left; height: 16px; line-height: 16px;\">"
- + "Patient Count"
- + ": <font color=\"#0000dd\">"
- + getObfuscatedResult(qriObj.setSize, 10)
- + "</font></div>";
+ //init qri vars.
+ qriNode = qriNodeList[qriIdx];
+ qriObj = parseQueryResultInstance(qriNode);
+ breakdownType = '';
- //grab breakdown data.
- brdNodeList = i2b2.h.XPath(qriNode, 'descendant-or-self::breakdown_data/column');
+ //which hospital
+ self.dispDIV.innerHTML += '<div style="clear:both;"><br/><div style="float:left; font-weight:bold; margin-left:20px;">' + qriObj.description + ' "' +self.QM.name+ '"</div>';
+ resultString += '\n'; //BG
+ resultString += qriObj.description + ' "' + self.QM.name+ '"\n'; //BG
- for(brdIdx = 0; brdIdx < brdNodeList.length; brdIdx ++){
+ //if there was an error display it.
+ if((qriObj.statusName == "ERROR") || (qriObj.statusName == "UNAVAILABLE")){
- //init brd vars.
- brdNode = brdNodeList[brdIdx];
- brdObj = parseBreakdown(brdNode);
+ errorObjects.push(qriObj.problem);
- if(brdObj.parentResultType !== breakdownType){
- breakdownType = brdObj.parentResultType;
- self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 30px; float: left; height: 16px; line-height: 16px;\"><br/><font>"
- + getBreakdownTitle(brdObj.parentResultType)
- + ":</font></div>";
- self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 40px; float: left; height: 16px; line-height: 16px;\"></div>";
- }
+ self.dispDIV.innerHTML += " &nbsp;- <span title='" + qriObj.statusDescription +"'> <b><a class='query-error-anchor' href='#' style='color:#ff0000'> <b><span color='#ff0000'>" + qriObj.problem.summary+ "</span></b></a></b></span>";
+ resultString += 'ERROR : ' + qriObj.problem.summary + '\n'; //BG
+ continue;
+ }
+ else if((qriObj.statusName == "PROCESSING")){
+ self.dispDIV.innerHTML += " - <span><b><font color='#00dd00'>Still Processing Request</font></b></span>";
+ resultString += 'Still Processing Request : Still Processing Request\n'; //BG
+ continue;
+ }
+ else if(["COMPLETED","FINISHED"].indexOf(qriObj.statusName) < 0){
+ self.dispDIV.innerHTML += " - <span><b><font color='#dd0000'>Results not available</font></b></span>";
+ resultString += 'Results not available : Results not available\n'; //BG
+ continue;
+ }
- self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 40px; float: left; height: 16px; line-height: 16px;\">"
- + brdObj.name
+ self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 30px; float: left; height: 16px; line-height: 16px;\">"
+ + "Patient Count"
+ ": <font color=\"#0000dd\">"
- + getObfuscatedResult(brdObj.value, 10)
+ + getObfuscatedResult(qriObj.setSize, 10)
+ "</font></div>";
- }
- }
- $hrine.EnhancedError.createErrorDialogue(self.dispDIV, errorObjects);
- i2b2.CRC.ctrlr.history.Refresh();
- }
+ resultString += 'Patient Count' + getObfuscatedResult(qriObj.setSize, 10) + '\n'; //BG
+
+
+ //grab breakdown data.
+ brdNodeList = i2b2.h.XPath(qriNode, 'descendant-or-self::breakdown_data/column');
+
+ for(brdIdx = 0; brdIdx < brdNodeList.length; brdIdx ++){
+
+ //init brd vars.
+ brdNode = brdNodeList[brdIdx];
+ brdObj = parseBreakdown(brdNode);
+
+ if(brdObj.parentResultType !== breakdownType){
+ breakdownType = brdObj.parentResultType;
+ self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 30px; float: left; height: 16px; line-height: 16px;\"><br/><font>"
+ + getBreakdownTitle(brdObj.parentResultType)
+ + ":</font></div>";
+ resultString += '\n'; //BG
+ resultString += getBreakdownTitle(brdObj.parentResultType) + '\n'; //BG
+ self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 40px; float: left; height: 16px; line-height: 16px;\"></div>";
+ }
+
+ self.dispDIV.innerHTML += "<div style=\"clear: both; margin-left: 40px; float: left; height: 16px; line-height: 16px;\">"
+ + brdObj.name
+ + ": <font color=\"#0000dd\">"
+ + getObfuscatedResult(brdObj.value, 10)
+ + "</font></div>";
+ resultString += brdObj.name + getObfuscatedResult(brdObj.value, 10) + '\n'; //BG
+ }
+ }
+ i2b2.CRC.ctrlr.currentQueryResults = new i2b2.CRC.ctrlr.QueryResults(resultString);
+ $hrine.EnhancedError.createErrorDialogue(self.dispDIV, errorObjects);
+ i2b2.CRC.ctrlr.history.Refresh();
+ }
+ catch(err)
+ {
+ console.error(err);
+ }
+ }
/**
*
* @param qriNode
* @returns {{qiStatusName: string, qiStatusDescription: string, qiSetSize: string, qiDescription: string, qiResultName: string, qiResultDescription: string}}
*/
function parseQueryResultInstance(qriNode){
var qriObj = {
statusName: grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/name'),
statusDescription: grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/description'),
description: grabXmlNodeData(qriNode, 'descendant-or-self::description')
};
if(qriObj.statusName == "ERROR"){
qriObj.problem = $hrine.EnhancedError.parseProblem(qriNode);
return qriObj;
}
qriObj.setSize = grabXmlNodeData(qriNode, 'descendant-or-self::set_size');
qriObj.resultName = grabXmlNodeData(qriNode, 'descendant-or-self::query_result_type/name');
qriObj.resultDescription = grabXmlNodeData(qriNode, 'descendant-or-self::query_result_type/description');
return qriObj;
}
/**
*
* @param brdNode
*/
function parseBreakdown(brdNode){
var brdObj = {
name: grabXmlNodeData(brdNode, 'name'),
value: grabXmlNodeData(brdNode, 'value'),
parentResultType: grabXmlNodeData(brdNode, 'parent::breakdown_data/resultType')
}
return brdObj;
}
/**
* Return breakdown title based on breakdown type.
* @param breakdownType
* @returns {*}
*/
function getBreakdownTitle(breakdownType) {
return {
'PATIENT_AGE_COUNT_XML': 'Patient Age Count Breakdown',
'PATIENT_GENDER_COUNT_XML': 'Patient Gender Count Breakdown',
'PATIENT_RACE_COUNT_XML': 'Patient Race Count Breakdown',
'PATIENT_VITALSTATUS_COUNT_XML':'Patient Vital Status Count Breakdown'
}[breakdownType];
};
/**
* Method for hiding the precise value of a query below a certain result.
* @param resultCount - the number of results from a query.
* @param obfuscationSetting - do not reveal this number of results
*/
function getObfuscatedResult(resultCount, obfuscationSetting) {
var resultTitle = " - ",
name = " patients",
offsetText = " +-3",
isException = i2b2.PM.model.isObfuscated === false;
//default to 10.
obfuscationSetting = (arguments.length > 1) ? arguments[1] : 10;
//if user role is an exception. return result.
if (isException) {
return resultTitle += resultCount + name;
}
resultTitle += ((resultCount >= obfuscationSetting)?
resultCount + offsetText + name: obfuscationSetting + name + " or fewer");
return resultTitle;
}
/**
* Grab data for node, return empty string if none.
* @param node
* @param xPathString
* @returns {string}
*/
function grabXmlNodeData(node, xPathString){
var nodeVal = i2b2.h.XPath(node, xPathString);
return (nodeVal.length)? nodeVal[0].firstChild.nodeValue : '';
}
// switch to status tab
i2b2.CRC.view.status.showDisplay();
// timer and display refresh stuff
private_startTime = new Date();
private_refreshInterrupt = setInterval("i2b2.CRC.ctrlr.currentQueryStatus.refreshStatus()", 100);
// AJAX call
i2b2.CRC.ajax.runQueryInstance_fromQueryDefinition("CRC:QueryTool", this.params, this.callbackQueryDef);
}
return {
name: "",
polling_interval: 1000,
QM: {id:false, status:""},
QI: {id:false, status:""},
QRS:{},
displayDIV: false,
running: false,
started: false,
startQuery: function(queryName, ajaxParams) {
this.name = queryName;
this.params = ajaxParams;
private_startQuery.call(this);
},
cancelQuery: function() {
private_cancelQuery();
},
isQueryRunning: function() {
return private_singleton_isRunning;
},
refreshStatus: function() {
private_refresh_status();
}
};
}();
i2b2.CRC.ctrlr.currentQueryStatus = false;
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryTool.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryTool.js
old mode 100755
new mode 100644
index 5f12045ba..d066738f8
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryTool.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_ctrlr_QryTool.js
@@ -1,1732 +1,2861 @@
/**
* @projectDescription Event controller for CRC's Query Tool.
* @inherits i2b2.CRC.ctrlr
* @namespace i2b2.CRC.ctrlr.QT
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* ----------------------------------------------------------------------------------------
* updated 9-15-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: CRC > ctrlr > QueryTool');
console.time('execute time');
i2b2.CRC.ctrlr.QT = new QueryToolController();
function QueryToolController() {
i2b2.CRC.model.queryCurrent = {};
this.queryIsDirty = true;
this.queryIsRunning = false;
this.queryNamePrompt = false;
this.queryTiming = 'ANY';
this.temporalGroup = 0;
this.tenporalBuilders = 0;
this.hasModifier = false;
this.queryNameDefault = 'New Query';
this.queryStatusDefaultText = 'Drag query items to one or more groups then click Run Query.';
this.panelControllers = [];
this.panelControllers[0] = new i2b2_PanelController(this);
this.panelControllers[1] = new i2b2_PanelController(this);
this.panelControllers[2] = new i2b2_PanelController(this);
// ================================================================================================== //
this.doSetQueryName = function(inName) {
this.queryIsDirty = true;
$('queryName').innerHTML = inName;
i2b2.CRC.model.queryCurrent.name = inName;
}
// ================================================================================================== //
this.doQueryClear = function() {
// function to clear query from memory
delete i2b2.CRC.model.queryCurrent;
i2b2.CRC.model.queryCurrent = {};
i2b2.CRC.ctrlr.QT.temporalGroup = 0;
var dm = i2b2.CRC.model.queryCurrent;
dm.panels = [];
dm.panels[0] = new Array();
dm.panels[1] = new Array();
dm.panels[2] = new Array();
this.doSetQueryName.call(this,'');
this.doShowFrom(0);
this._redrawPanelCount();
this.queryNamePrompt = false;
this.queryIsDirty = true;
this.hasModifier = false;
$('infoQueryStatusText').innerHTML = "";
$('crc.temoralBuilder').hide();
$('crc.innerQueryPanel').show();
this.panelControllers[0].refTitle.innerHTML = 'Group 1';
$("defineTemporal-button").innerHTML = "Population in which events occur";
i2b2.CRC.view.QT.setQueryTiming(0);
}
// ================================================================================================== //
this.doQueryLoad = function(qm_id) { // function to load query from history
// clear existing query
i2b2.CRC.ctrlr.QT.doQueryClear();
// show on GUI that work is being done
i2b2.h.LoadingMask.show();
// callback processor
var scopedCallback = new i2b2_scopedCallback();
scopedCallback.scope = this;
scopedCallback.callback = function(results) {
var cl_queryMasterId = qm_id;
// THIS function is used to process the AJAX results of the getChild call
// results data object contains the following attributes:
// refXML: xmlDomObject <--- for data processing
// msgRequest: xml (string)
// msgResponse: xml (string)
// error: boolean
// errorStatus: string [only with error=true]
// errorMsg: string [only with error=true]
i2b2.CRC.view.QT.queryRequest = results.msgRequest;
i2b2.CRC.view.QT.queryResponse = results.msgResponse;
// switch to status tab
i2b2.CRC.view.status.showDisplay();
// did we get a valid query definition back?
var qd = i2b2.h.XPath(results.refXML, 'descendant::query_name/..');
if (qd.length != 0) {
i2b2.CRC.ctrlr.QT.doQueryClear();
var dObj = {};
//1.17 dObj.name = i2b2.h.getXNodeVal(results.refXML,'name');
dObj.name = i2b2.h.getXNodeVal(results.refXML,'query_name');
$('queryName').innerHTML = dObj.name;
dObj.specificity = i2b2.h.getXNodeVal(qd[0],'specificity_scale');
dObj.panels = []; //1.17
for (var j=0; j <qd.length; j++) {
/* 1.17
qp variable initialization was if else for i2b2.
if (j==0)
var qp = i2b2.h.XPath(qd[j], 'panel');
else
*/
var qp = i2b2.h.XPath(qd[j], 'descendant::panel');//1.17
var total_panels = qp.length;
for (var i1=0; i1<total_panels; i1++) {
//1.17 i2b2.CRC.ctrlr.QT.temporalGroup = j;
i2b2.CRC.ctrlr.QT.temporalGroup = 0; //1.17
//1.17 i2b2.CRC.ctrlr.QT._redrawAllPanels();
// extract the data for each panel
var po = {};
po.panel_num = i2b2.h.getXNodeVal(qp[i1],'panel_number');
var t = i2b2.h.getXNodeVal(qp[i1],'invert');
po.exclude = (t=="1");
//po.timing = i2b2.h.getXNodeVal(qp[i1],'panel_timing');
// 1.4 queries don't have panel_timing, and undefined doesn't work
// so default to ANY
po.timing = i2b2.h.getXNodeVal(qp[i1],'panel_timing') || 'ANY';
i2b2.CRC.view.QT.setPanelTiming(po.panel_num, po.timing);
var t = i2b2.h.getXNodeVal(qp[i1],'total_item_occurrences');
po.occurs = (1*t)-1;
//1.17 var t = i2b2.h.getXNodeVal(qp[i1],'panel_accuracy_scale');
// 1.17 po.relevance = t;
var t = i2b2.h.getXNodeVal(qp[i1],'panel_date_from');
if (t) {
//section added for 1.17
t = t.replace('Z','');
t = t.split('-');
po.dateFrom = {};
po.dateFrom.Year = t[0];
po.dateFrom.Month = t[1];
po.dateFrom.Day = t[2];
/**
* Commented out for 1.17.
po.dateFrom = {};
po.dateFrom.Year = t.substring(0,4); //t[0];
po.dateFrom.Month = t.substring(5,7); //t[1];
po.dateFrom.Day = t.substring(8,10); //t[2];
**/
} else {
po.dateFrom = false;
}
var t = i2b2.h.getXNodeVal(qp[i1],'panel_date_to');
if (t) {
//added for 1.17
t = t.replace('Z','');
t = t.split('-');
po.dateTo = {};
po.dateTo.Year = t[0];
po.dateTo.Month = t[1];
po.dateTo.Day = t[2];
/**
* Commented out for 1.17.
po.dateTo = {};
po.dateTo.Year = t.substring(0,4); //t[0];
po.dateTo.Month = t.substring(5,7); // t[1];
po.dateTo.Day = t.substring(8,10);// t[2];
*/
} else {
po.dateTo = false;
}
//process query items.
po.items = [];
var pi = i2b2.h.XPath(qp[i1], 'descendant::item[item_key]');
for (i2=0; i2<pi.length; i2++) {
var item = {};
// get the item's details from the ONT Cell
var ckey = i2b2.h.getXNodeVal(pi[i2],'item_key');
//1.17 WE MUST QUERY THE ONT CELL TO BE ABLE TO DISPLAY THE TREE STRUCTURE CORRECTLY
var cdetails = i2b2.ONT.ajax.GetTermInfo("CRC:QueryTool", {concept_key_value:ckey, ont_synonym_records: true, ont_hidden_records: true} );
//1.17 this is what comes out of the old AJAX call
var c = i2b2.h.XPath(cdetails.refXML, 'descendant::concept');
//this entire if block is for 1.17.
if (c.length > 0) {
c = c[0];
var o = new Object;
o.xmlOrig = c;
o.table_name = i2b2.h.getXNodeVal(c,'tablename');
o.column_name = i2b2.h.getXNodeVal(c,'columnname');
o.operator = i2b2.h.getXNodeVal(c,'operator');
o.icd9 = i2b2.h.getXNodeVal(c,'basecode');
o.level = i2b2.h.getXNodeVal(c,'level');
o.name = i2b2.h.getXNodeVal(c,'name');
o.key = i2b2.h.getXNodeVal(c,'key');
o.tooltip = i2b2.h.getXNodeVal(c,'tooltip');
o.dim_code = i2b2.h.getXNodeVal(c,'dimcode');
o.visual_attribs = i2b2.h.getXNodeVal(c,'visualattributes');
o.hasChildren = i2b2.h.getXNodeVal(c,'visualattributes').substring(0,2);
// these are not needed?
o.fact_table_column = i2b2.h.getXNodeVal(c,'facttablecolumn');
o.column_name_datatype = i2b2.h.getXNodeVal(c,'columndatatype');
o.synonym_cd = i2b2.h.getXNodeVal(c,'synonym_cd');
o.totalnum = i2b2.h.getXNodeVal(c,'totalnum');
//1.17 process lab values.
var lvd = i2b2.h.XPath(pi[i2], 'descendant::constrain_by_value');
if (lvd.length>0){
lvd = lvd[0];
// pull the LabValue definition for concept
var lvdef = i2b2.h.XPath(c, "descendant::metadataxml/ValueMetadata[Loinc]");
if (lvdef.length > 0) {
lvdef = lvdef[0];
} else {
lvdef = false;
}
// extract & translate
var t = i2b2.h.getXNodeVal(lvd,"value_constraint");
o.LabValues = {};
o.LabValues.NumericOp = i2b2.h.getXNodeVal(lvd,"value_operator");
o.LabValues.GeneralValueType = i2b2.h.getXNodeVal(lvd,"value_type");
switch(o.LabValues.GeneralValueType) {
case "NUMBER":
o.LabValues.MatchBy = "VALUE";
if (t.indexOf(' and ')!=-1) {
// extract high and low values
t = t.split(' and ');
o.LabValues.ValueLow = t[0];
o.LabValues.ValueHigh = t[1];
} else {
o.LabValues.Value = t;
}
break;
case "STRING":
o.LabValues.MatchBy = "VALUE";
o.LabValues.ValueString = t;
break;
case "TEXT": // this means Enum?
o.LabValues.MatchBy = "VALUE";
try {
o.LabValues.ValueEnum = eval("(Array"+t+")");
} catch(e) {
console.error("Conversion Failed: Lab Value data = "+t);
}
break;
case "FLAG":
o.LabValues.MatchBy = "FLAG";
o.LabValues.ValueFlag = t
break;
default:
o.LabValues.Value = t;
}
}//1.17 end lab values section
var sdxDataNode = i2b2.sdx.Master.EncapsulateData('CONCPT',o);
if (o.LabValues) {
// We do want 2 copies of the Lab Values: one is original from server while the other one is for user manipulation
sdxDataNode.LabValues = o.LabValues;
}
//push item on po.
po.items.push(sdxDataNode);
} else {
console.error("CRC's ONT Handler could not get term details about '"+ckey+"'!");
}
}
dObj.panels[po.panel_num] = po;
}
// reindex the panels index (panel [1,3,5] should be [0,1,2])
dObj.panels = dObj.panels.compact();
i2b2.CRC.model.queryCurrent.panels[j] = dObj.panels;
var qpc = i2b2.CRC.ctrlr.QT.panelControllers[0];
var dm = i2b2.CRC.model.queryCurrent;
for (var k=0; k<dm.panels.length; k++) {
//length of panels should always be 1.
for (var pi=0; pi<dm.panels[k].length; pi++) {
// create a treeview root node and connect it to the treeview controller
dm.panels[k][pi].tvRootNode = new YAHOO.widget.RootNode(qpc.yuiTree);
qpc.yuiTree.root = dm.panels[k][pi].tvRootNode;
dm.panels[k][pi].tvRootNode.tree = qpc.yuiTree;
qpc.yuiTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1);
// load the treeview with the data
var tvRoot = qpc.yuiTree.getRoot();
for (var pii=0; pii<dm.panels[k][pi].items.length; pii++) {
var withRenderData = qpc._addConceptVisuals(dm.panels[k][pi].items[pii], tvRoot, false);
if (dm.panels[k][pi].items[pii].ModValues)
{
withRenderData.ModValues = dm.panels[k][pi].items[pii].ModValues;
}
if (dm.panels[k][pi].items[pii].LabValues)
{
withRenderData.LabValues = dm.panels[k][pi].items[pii].LabValues;
}
dm.panels[k][pi].items[pii] = withRenderData;
}
}
}
// redraw the Query Tool GUI
i2b2.CRC.ctrlr.QT._redrawPanelCount();
i2b2.CRC.ctrlr.QT.doScrollFirst();
// hide the loading mask
i2b2.h.LoadingMask.hide();
}
i2b2.CRC.ctrlr.QT.temporalGroup = 0;
i2b2.CRC.ctrlr.QT._redrawAllPanels();
}
}
// AJAX CALL
i2b2.CRC.ajax.getRequestXml_fromQueryMasterId("CRC:QueryTool", { qm_key_value: qm_id }, scopedCallback);
}
// ================================================================================================== //
this.doQueryRun = function() {
// function to build and run query
if (i2b2.CRC.ctrlr.currentQueryStatus != false && i2b2.CRC.ctrlr.currentQueryStatus.isQueryRunning()) {
i2b2.CRC.ctrlr.currentQueryStatus.cancelQuery();
i2b2.CRC.ctrlr.currentQueryStatus = false;
//alert('A query is already running.\n Please wait until the currently running query has finished.');
return void(0);
}
/*
* Method added for edge case where
* dragging previous query does not add items to panel. Will occur when ontology
* @param panels
*/
function hasItems(panel) {
return panel.length > 0 && panel[0].items.length > 0;
}
if (i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length < 1) {
alert('You must enter at least one concept to run a query.');
return void(0);
}
// make sure a shrine topic has been selected
if (i2b2.PM.model.shrine_domain) {
var topicSELECT = $('queryTopicSelect');
//@pcori_webclient
if(topicSELECT){
if (topicSELECT.selectedIndex == null || topicSELECT.selectedIndex == 0) {
alert('You must select a Topic to run a SHRINE query.');
return void(0);
}
var topicid = topicSELECT.options[topicSELECT.selectedIndex].value;
}
}
// callback for dialog submission
var handleSubmit = function() {
// submit value(s)
if(this.submit()) {
// run the query
var t = $('dialogQryRun');
var queryNameInput = t.select('INPUT.inputQueryName')[0];
var options = {};
var t2 = t.select('INPUT.chkQueryType');
for (var i=0;i<t2.length; i++) {
if (t2[i].checked == true) {
options['chk_'+t2[i].value] = t2[i].checked;
}
}
$('queryName').innerHTML = queryNameInput.value;
i2b2.CRC.model.queryCurrent.name = queryNameInput.value;
i2b2.CRC.ctrlr.QT._queryRun(queryNameInput.value, options);
}
}
// display the query name input dialog
this._queryPromptRun(handleSubmit);
// autogenerate query name
var myDate=new Date();
var hours = myDate.getHours()
if (hours < 10){
hours = "0" + hours
}
var minutes = myDate.getMinutes()
if (minutes < 10){
minutes = "0" + minutes
}
var seconds = myDate.getSeconds()
if (seconds < 10){
seconds = "0" + seconds
}
//var ds = myDate.toLocaleString();
var ts = hours + ":" + minutes + ":" + seconds; //ds.substring(ds.length-5,ds.length-13);
var defQuery = this._getQueryXML.call(this);
var qn = defQuery.queryAutoName+'@'+ts;
// display name
var queryNameInput = $('dialogQryRun').select('INPUT.inputQueryName')[0];
queryNameInput.value = qn;
}
// ================================================================================================== //
this._queryRun = function(inQueryName, options) {
// make sure name is not blank
if (inQueryName.blank()) {
alert('Cannot run query with without providing a name!');
return;
}
// Query Parameters
var query_definition = this._getQueryXML(inQueryName);
var params = {
result_wait_time: i2b2.CRC.view.QT.params.queryTimeout,
psm_query_definition: query_definition.queryXML
}
// SHRINE topic if we are running SHRINE query
if (i2b2.h.isSHRINE()) {
var topicSELECT = $('queryTopicSelect');
//@pcori_webclient
if(topicSELECT){
if (topicSELECT.selectedIndex == null || topicSELECT.selectedIndex == 0) {
alert("Please select a Topic to run the query.");
return false;
}
params.shrine_topic = "<shrine><queryTopicID>"+topicSELECT.options[topicSELECT.selectedIndex].value+"</queryTopicID></shrine>";
}
}
// generate the result_output_list (for 1.3 backend)
var result_output = "";
for(var name in options)
{
if (name) {
i++;
result_output += '<result_output priority_index="'+i+'" name="' + name.substring(4).toLowerCase() + '"/>\n';
}
}
//@pcori_webclient
//result_output = '<result_output priority_index="11" name="patient_count_xml"/>';
params.psm_result_output = '<result_output_list>'+result_output+'</result_output_list>\n';
// create query object
$('runBoxText').innerHTML = "Cancel Query";
i2b2.CRC.ctrlr.currentQueryStatus = new i2b2.CRC.ctrlr.QueryStatus($('infoQueryStatusText'));
i2b2.CRC.ctrlr.currentQueryStatus.startQuery(inQueryName, params);
}
// ================================================================================================== //
this._queryRunningTime = function() {
if (i2b2.CRC.ctrlr.QT.queryIsRunning) {
var d = new Date();
var t = Math.floor((d.getTime() - queryStartTime)/100)/10;
var el = $('numSeconds');
if (el) {
var s = t.toString();
if (s.indexOf('.') < 0) {
s += '.0';
}
el.innerHTML = s;
window.setTimeout('i2b2.CRC.ctrlr.QT._queryRunningTime()',100);
}
}
}
// ================================================================================================== //
this._queryPromptRun = function(handleSubmit) {
if (!i2b2.CRC.view.dialogQryRun) {
var handleCancel = function() {
this.cancel();
};
var loopBackSubmit = function() {
i2b2.CRC.view.dialogQryRun.submitterFunction();
};
i2b2.CRC.view.dialogQryRun = new YAHOO.widget.SimpleDialog("dialogQryRun", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: loopBackSubmit,
isDefault: true
}, {
text: "Cancel",
handler: handleCancel
}]
});
$('dialogQryRun').show();
i2b2.CRC.view.dialogQryRun.validate = function(){
// now process the form data
var msgError = '';
var queryNameInput = $('dialogQryRun').select('INPUT.inputQueryName')[0];
if (!queryNameInput || queryNameInput.value.blank()) {
alert('Please enter a name for this query.');
return false;
}
return true;
};
i2b2.CRC.view.dialogQryRun.render(document.body);
}
// manage the event handler for submit
delete i2b2.CRC.view.dialogQryRun.submitterFunction;
i2b2.CRC.view.dialogQryRun.submitterFunction = handleSubmit;
// display the dialoge
i2b2.CRC.view.dialogQryRun.center();
i2b2.CRC.view.dialogQryRun.show();
}
// ================================================================================================== //
this._queryPromptName = function(handleSubmit) {
if (!i2b2.CRC.view.dialogQmName) {
var handleCancel = function() {
this.cancel();
};
var loopBackSubmit = function() {
i2b2.CRC.view.dialogQmName.submitterFunction();
};
i2b2.CRC.view.dialogQmName = new YAHOO.widget.SimpleDialog("dialogQmName", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: loopBackSubmit,
isDefault: true
}, {
text: "Cancel",
handler: handleCancel
}]
});
$('dialogQmName').show();
i2b2.CRC.view.dialogQmName.validate = function(){
// now process the form data
var msgError = '';
var queryNameInput = $('inputQueryName');
if (!queryNameInput || queryNameInput.value.blank()) {
alert('Please enter a name for this query.');
return false;
}
return true;
};
i2b2.CRC.view.dialogQmName.render(document.body);
}
// manage the event handler for submit
delete i2b2.CRC.view.dialogQmName.submitterFunction;
i2b2.CRC.view.dialogQmName.submitterFunction = handleSubmit;
// display the dialoge
i2b2.CRC.view.dialogQmName.center();
i2b2.CRC.view.dialogQmName.show();
}
// ================================================================================================== //
this._getQueryXML = function(queryName) {
var i;
var isTemporal = false;
var el;
var concept;
var panel_list = i2b2.CRC.model.queryCurrent.panels[0]; //i2b2.CRC.ctrlr.QT.temporalGroup];
var panel_cnt = panel_list.length;
var auto_query_name_len = 15;
var auto_query_name = '';
if (this.queryTiming == "TEMPORAL") {
isTemporal = true;
}
if (panel_cnt > 0) {
auto_query_name_len = Math.floor(15/panel_cnt);
if (auto_query_name_len < 1) {auto_query_name_len = 1;}
}
// build Query XML
var s = '<query_definition>\n';
if (isTemporal)
{
queryName = '(t) ' + queryName;
}
s += '\t<query_name>' + i2b2.h.Escape(queryName) + '</query_name>\n';
if (this.queryTiming == "SAMEVISIT")
{
s += '\t<query_timing>SAMEVISIT</query_timing>\n';
} else if (this.queryTiming == "ANY") {
s += '\t<query_timing>ANY</query_timing>\n';
} else if (this.queryTiming == "TEMPORAL") {
s += '\t<query_timing>ANY</query_timing>\n';
} else {
s += '\t<query_timing>SAMEINSTANCENUM</query_timing>\n';
}
s += '\t<specificity_scale>0</specificity_scale>\n';
if (i2b2.PM.model.shrine_domain) { s += '\t<use_shrine>1</use_shrine>\n'; }
for (var ip = 0; ip < i2b2.CRC.model.queryCurrent.panels.length; ip++)
{
panel_list = i2b2.CRC.model.queryCurrent.panels[ip]; //i2b2.CRC.ctrlr.QT.temporalGroup];
panel_cnt = panel_list.length;
if (isTemporal && ip > 0)
{
//if equal to one than add subquery_contraint
if (ip == 1)
{
for (var tb=0; tb <= this.tenporalBuilders; tb++) {
s += '\t<subquery_constraint>\n';
s += '\t\t<first_query>\n';
s += '\t\t\t<query_id>' + $('instancevent1[' + tb + ']').options[$('instancevent1[' + tb + ']').selectedIndex].value + '</query_id>\n';
s += '\t\t\t<join_column>' + $('preloc1[' + tb + ']').options[$('preloc1[' + tb + ']').selectedIndex].value + '</join_column>\n';
s += '\t\t\t<aggregate_operator>' + $('instanceopf1[' + tb + ']').options[$('instanceopf1[' + tb + ']').selectedIndex].value + '</aggregate_operator>\n';
s += '\t\t</first_query>\n';
s += '\t\t<operator>' + $('postloc[' + tb + ']').options[$('postloc[' + tb + ']').selectedIndex].value + '</operator>\n';
s += '\t\t<second_query>\n';
s += '\t\t\t<query_id>' + $('instancevent2[' + tb + ']').options[$('instancevent2[' + tb + ']').selectedIndex].value + '</query_id>\n';
s += '\t\t\t<join_column>' + $('preloc2[' + tb + ']').options[$('preloc2[' + tb + ']').selectedIndex].value + '</join_column>\n';
s += '\t\t\t<aggregate_operator>' + $('instanceopf2[' + tb + ']').options[$('instanceopf2[' + tb + ']').selectedIndex].value + '</aggregate_operator>\n';
s += '\t\t</second_query>\n';
if ( $('bytime1[' + tb + ']').checked)
{
s += '\t\t<span>\n';
s += '\t\t\t<operator>' + $('byspan1[' + tb + ']').options[$('byspan1[' + tb + ']').selectedIndex].value + '</operator>\n';
s += '\t\t\t<span_value>' + $('bytimevalue1[' + tb + ']').value + '</span_value>\n';
s += '\t\t\t<units>' + $('bytimeunit1[' + tb + ']').options[$('bytimeunit1[' + tb + ']').selectedIndex].value + '</units>\n';
s += '\t\t</span>\n';
}
if ( $('bytime2[' + tb + ']').checked)
{
s += '\t\t<span>\n';
s += '\t\t\t<operator>' + $('byspan2[' + tb + ']').options[$('byspan2[' + tb + ']').selectedIndex].value + '</operator>\n';
s += '\t\t\t<span_value>' + $('bytimevalue2[' + tb + ']').value + '</span_value>\n';
s += '\t\t\t<units>' + $('bytimeunit2[' + tb + ']').options[$('bytimeunit2[' + tb + ']').selectedIndex].value + '</units>\n';
s += '\t\t</span>\n';
}
s += '\t</subquery_constraint>\n';
}
}
if (panel_list[0].items.length == 0)
break;
s += '<subquery>\n ';
s += '<query_id>Event '+ ip +'</query_id>\n';
s += '<query_type>EVENT</query_type>\n';
s += '<query_name>Event '+ ip +'</query_name>\n';
s += '<query_timing>SAMEINSTANCENUM</query_timing>\n';
s += '<specificity_scale>0</specificity_scale>\n';
}
for (var p = 0; p < panel_cnt; p++) {
s += '\t<panel>\n';
s += '\t\t<panel_number>' + (p+1) + '</panel_number>\n';
// date range constraints
if (panel_list[p].dateFrom) {
s += '\t\t<panel_date_from>'+panel_list[p].dateFrom.Year+'-'+padNumber(panel_list[p].dateFrom.Month,2)+'-'+padNumber(panel_list[p].dateFrom.Day,2)+'T00:00:00.000-05:00</panel_date_from>\n';
}
if (panel_list[p].dateTo) {
s += '\t\t<panel_date_to>'+panel_list[p].dateTo.Year+'-'+padNumber(panel_list[p].dateTo.Month,2)+'-'+padNumber(panel_list[p].dateTo.Day,2)+'T00:00:00.000-05:00</panel_date_to>\n';
}
s += "\t\t<panel_accuracy_scale>" + panel_list[p].relevance + "</panel_accuracy_scale>\n";
// Exclude constraint (invert flag)
if (panel_list[p].exclude) {
s += '\t\t<invert>1</invert>\n';
} else {
s += '\t\t<invert>0</invert>\n';
}
// Panel Timing
s += '\t\t<panel_timing>' + panel_list[p].timing + '</panel_timing>\n';
// Occurs constraint
s += '\t\t<total_item_occurrences>'+((panel_list[p].occurs*1)+1)+'</total_item_occurrences>\n';
// Concepts
for (i=0; i < panel_list[p].items.length; i++) {
var sdxData = panel_list[p].items[i];
s += '\t\t<item>\n';
switch(sdxData.sdxInfo.sdxType) {
case "QM":
s += '\t\t\t<item_key>masterid:' + sdxData.origData.id + '</item_key>\n';
s += '\t\t\t<item_name>' + sdxData.origData.title + '</item_name>\n';
s += '\t\t\t<tooltip>' + sdxData.origData.name + '</tooltip>\n';
s += '\t\t\t<item_is_synonym>false</item_is_synonym>\n';
s += '\t\t\t<hlevel>0</hlevel>\n';
break;
case "PRS":
s += '\t\t\t<item_key>patient_set_coll_id:' + sdxData.sdxInfo.sdxKeyValue + '</item_key>\n';
s += '\t\t\t<item_name>' + sdxData.sdxInfo.sdxDisplayName + '</item_name>\n';
s += '\t\t\t<tooltip>' + sdxData.sdxInfo.sdxDisplayName + '</tooltip>\n';
s += '\t\t\t<item_is_synonym>false</item_is_synonym>\n';
s += '\t\t\t<hlevel>0</hlevel>\n';
break;
case "ENS":
s += '\t\t\t<item_key>patient_set_enc_id:' + sdxData.sdxInfo.sdxKeyValue + '</item_key>\n';
s += '\t\t\t<item_name>' + sdxData.sdxInfo.sdxDisplayName + '</item_name>\n';
s += '\t\t\t<tooltip>' + sdxData.sdxInfo.sdxDisplayName + '</tooltip>\n';
s += '\t\t\t<item_is_synonym>false</item_is_synonym>\n';
s += '\t\t\t<hlevel>0</hlevel>\n';
break;
default:
if (sdxData.origData.isModifier) {
var modParent = sdxData.origData.parent;
var level = sdxData.origData.level;
var key = sdxData.origData.parent.key;
var name = (sdxData.origData.parent.name != null ? i2b2.h.Escape(sdxData.origData.parent.name) : i2b2.h.Escape(sdxData.origData.name)) ;
var tooltip = sdxData.origData.tooltip;
var itemicon = sdxData.origData.hasChildren;
while (modParent != null)
{
if (modParent.isModifier)
{
modParent = modParent.parent;
} else {
level = modParent.level;
key = modParent.key;
name = modParent.name;
tooltip = modParent.tooltip;
itemicon = modParent.hasChildren;
break;
}
}
s += '\t\t\t<hlevel>' + level + '</hlevel>\n';
s += '\t\t\t<item_key>' + key + '</item_key>\n';
s += '\t\t\t<item_name>' + name + '</item_name>\n';
// (sdxData.origData.newName != null ? sdxData.origData.newName : sdxData.origData.name) + '</item_name>\n';
s += '\t\t\t<tooltip>' + tooltip + '</tooltip>\n';
s += '\t\t\t<item_icon>' + itemicon + '</item_icon>\n';
s += '\t\t\t<class>ENC</class>\n';
s += '\t\t\t\t<constrain_by_modifier>\n';
s += '\t\t\t\t\t<modifier_name>' + sdxData.origData.name + '</modifier_name>\n';
s += '\t\t\t\t\t<applied_path>' + sdxData.origData.applied_path + '</applied_path>\n';
s += '\t\t\t\t\t<modifier_key>' + sdxData.origData.key + '</modifier_key>\n';
if (sdxData.ModValues)
{
s += this.getValues( sdxData.ModValues);
}
s += '\t\t\t\t</constrain_by_modifier>\n';
} else {
sdxData.origData.key = (sdxData.origData.key).replace(/</g,"&lt;");
sdxData.origData.name = (sdxData.origData.name).replace(/</g,"&lt;");
if (undefined != sdxData.origData.tooltip)
sdxData.origData.tooltip = (sdxData.origData.tooltip).replace(/</g,"&lt;");
s += '\t\t\t<hlevel>' + sdxData.origData.level + '</hlevel>\n';
//s += '\t\t\t<item_name>' + (sdxData.origData.newName != null ? i2b2.h.Escape(sdxData.origData.newName) : i2b2.h.Escape(sdxData.origData.name)) + '</item_name>\n';
s += '\t\t\t<item_name>' + (sdxData.origData.name != null ? i2b2.h.Escape(sdxData.origData.name) : i2b2.h.Escape(sdxData.origData.newName)) + '</item_name>\n';
s += '\t\t\t<item_key>' + sdxData.origData.key + '</item_key>\n';
s += '\t\t\t<tooltip>' + sdxData.origData.tooltip + '</tooltip>\n';
s += '\t\t\t<class>ENC</class>\n';
s += '\t\t\t<item_icon>' + sdxData.origData.hasChildren + '</item_icon>\n';
}
try {
var t = i2b2.h.XPath(sdxData.origData.xmlOrig,'descendant::synonym_cd/text()');
t = (t[0].nodeValue=="Y");
} catch(e) {
var t = "false";
}
s += '\t\t\t<item_is_synonym>'+t+'</item_is_synonym>\n';
if (sdxData.LabValues) {
//s += '\t\t\t<constrain_by_value>\n';
s += this.getValues( sdxData.LabValues);
}
break;
}
//TODO add contraint to the item in the future
/*
s += '\t\t\t<constrain_by_date>\n';
if (panel_list[p].dateFrom) {
s += '\t\t\t\t<date_from>'+panel_list[p].dateFrom.Year+'-'+padNumber(panel_list[p].dateFrom.Month,2)+'-'+padNumber(panel_list[p].dateFrom.Day,2)+'Z</date_from>\n';
}
if (panel_list[p].dateTo) {
s += '\t\t\t\t<date_to>'+panel_list[p].dateTo.Year+'-'+padNumber(panel_list[p].dateTo.Month,2)+'-'+padNumber(panel_list[p].dateTo.Day,2)+'Z</date_to>\n';
}
s += '\t\t\t</constrain_by_date>\n';
*/
s += '\t\t</item>\n';
if (i==0) {
if (undefined != sdxData.origData.name) {
auto_query_name += sdxData.origData.name.substring(0,auto_query_name_len);
} else if (undefined != sdxData.origData.title) {
auto_query_name += sdxData.origData.title.substring(0,auto_query_name_len);
} else {
auto_query_name += "new query";
}
if (p < panel_cnt-1) {auto_query_name += '-';}
}
}
s += '\t</panel>\n';
}
if (isTemporal && ip > 0)
{
s += '</subquery>\n ';
}
if (isTemporal == false)
{
break;
}
}
s += '</query_definition>\n';
this.queryMsg = {};
this.queryMsg.queryAutoName = auto_query_name;
if (undefined===queryName) {
this.queryMsg.queryName = this.queryNameDefault;
} else {
this.queryMsg.queryName = queryName;
}
this.queryMsg.queryXML = s;
return(this.queryMsg);
}
this.getValues = function(lvd) {
var s = '\t\t\t<constrain_by_value>\n';
//var lvd = sdxData.LabValues;
switch(lvd.MatchBy) {
case "FLAG":
s += '\t\t\t\t<value_type>FLAG</value_type>\n';
s += '\t\t\t\t<value_operator>EQ</value_operator>\n';
s += '\t\t\t\t<value_constraint>'+i2b2.h.Escape(lvd.ValueFlag)+'</value_constraint>\n';
break;
case "VALUE":
if (lvd.GeneralValueType=="ENUM") {
var sEnum = [];
for (var i2=0;i2<lvd.ValueEnum.length;i2++) {
sEnum.push(i2b2.h.Escape(lvd.ValueEnum[i2]));
}
//sEnum = sEnum.join("\", \"");
sEnum = sEnum.join("\',\'");
sEnum = '(\''+sEnum+'\')';
s += '\t\t\t\t<value_type>TEXT</value_type>\n';
s += '\t\t\t\t<value_constraint>'+sEnum+'</value_constraint>\n';
s += '\t\t\t\t<value_operator>IN</value_operator>\n';
} else if (lvd.GeneralValueType=="STRING") {
s += '\t\t\t\t<value_type>TEXT</value_type>\n';
s += '\t\t\t\t<value_operator>'+lvd.StringOp+'</value_operator>\n';
s += '\t\t\t\t<value_constraint><![CDATA['+i2b2.h.Escape(lvd.ValueString)+']]></value_constraint>\n';
} else if (lvd.GeneralValueType=="LARGESTRING") {
if (lvd.DbOp) {
s += '\t\t\t\t<value_operator>CONTAINS[database]</value_operator>\n';
} else {
s += '\t\t\t\t<value_operator>CONTAINS</value_operator>\n';
}
s += '\t\t\t\t<value_type>LARGETEXT</value_type>\n';
s += '\t\t\t\t<value_constraint><![CDATA['+lvd.ValueString+']]></value_constraint>\n';
} else {
s += '\t\t\t\t<value_type>'+lvd.GeneralValueType+'</value_type>\n';
s += '\t\t\t\t<value_unit_of_measure>'+lvd.UnitsCtrl+'</value_unit_of_measure>\n';
s += '\t\t\t\t<value_operator>'+lvd.NumericOp+'</value_operator>\n';
if (lvd.NumericOp == 'BETWEEN') {
s += '\t\t\t\t<value_constraint>'+i2b2.h.Escape(lvd.ValueLow)+' and '+i2b2.h.Escape(lvd.ValueHigh)+'</value_constraint>\n';
} else {
s += '\t\t\t\t<value_constraint>'+i2b2.h.Escape(lvd.Value)+'</value_constraint>\n';
}
}
break;
case "":
break;
}
s += '\t\t\t</constrain_by_value>\n';
return s;
}
// ================================================================================================== //
this.panelAdd = function(yuiTree) {
// this function is used to create a new panel, it initializes the data structure in the
if (!i2b2.CRC.model.queryCurrent.panels) {
i2b2.CRC.model.queryCurrent.panels = [];
i2b2.CRC.model.queryCurrent.panels[0] = new Array();
i2b2.CRC.model.queryCurrent.panels[1] = new Array();
i2b2.CRC.model.queryCurrent.panels[2] = new Array();
// i2b2.CRC.model.queryCurrent.panels = new Array(new Array());
}
var dm = i2b2.CRC.model.queryCurrent;
var pi = dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length;
if (pi == undefined)
{
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup] = new Array();
pi = 0;
}
var tTiming = i2b2.CRC.ctrlr.QT.queryTiming;
if ((tTiming == "TEMPORAL") && (i2b2.CRC.ctrlr.QT.temporalGroup > 0))
tTiming = "SAMEINSTANCENUM";
if ((tTiming == "TEMPORAL") && (i2b2.CRC.ctrlr.QT.temporalGroup == 0))
tTiming = "ANY";
// setup the data model for this panel
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi] = {};
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].dateTo = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].dateFrom = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].exclude = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].occurs = '0';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].relevance = '100';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].timing = tTiming; // i2b2.CRC.ctrlr.QT.queryTiming; //'ANY';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].items = [];
// create a treeview root node and connect it to the treeview controller
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode = new YAHOO.widget.RootNode(this.yuiTree);
yuiTree.root = dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode.tree = yuiTree;
yuiTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1);
if (dm.panels.length == 1)
{
var tTiming = i2b2.CRC.ctrlr.QT.queryTiming;
if (i2b2.CRC.ctrlr.QT.queryTiming == "TEMPORAL")
tTiming = "ANY";
i2b2.CRC.ctrlr.QT.temporalGroup = 1;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup] = {};
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi] = {};
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].dateTo = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].dateFrom = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].exclude = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].occurs = '0';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].relevance = '100';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].timing = tTiming; //i2b2.CRC.ctrlr.QT.queryTiming; //'ANY';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].items = [];
// create a treeview root node and connect it to the treeview controller
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode = new YAHOO.widget.RootNode(this.yuiTree);
yuiTree.root = dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode.tree = yuiTree;
yuiTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1);
i2b2.CRC.ctrlr.QT.temporalGroup = 2;
if (i2b2.CRC.ctrlr.QT.queryTiming == "TEMPORAL")
tTiming = "SAMEINSTANCENUM";
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup] = {};
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi] = {};
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].dateTo = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].dateFrom = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].exclude = false;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].occurs = '0';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].relevance = '100';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].timing = tTiming; //i2b2.CRC.ctrlr.QT.queryTiming; //'ANY';
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].items = [];
// create a treeview root node and connect it to the treeview controller
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode = new YAHOO.widget.RootNode(this.yuiTree);
yuiTree.root = dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode;
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi].tvRootNode.tree = yuiTree;
yuiTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1);
i2b2.CRC.ctrlr.QT.temporalGroup = 0;
}
// update the count on the GUI
this._redrawPanelCount();
// return a reference to the new panel object
this.doSetQueryName.call(this,'');
return dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup][pi];
}
// ================================================================================================== //
this._loadTreeDataForNode = function(node, onCompleteCallback) {
i2b2.sdx.Master.LoadChildrenFromTreeview(node, onCompleteCallback);
}
// ================================================================================================== //
this.ToggleNode = function(divTarg, divTreeID) {
// get the i2b2 data from the yuiTree node
var tvTree = YAHOO.widget.TreeView.findTreeByChildDiv(divTarg); // this is a custom extention found in "hive_helpers.js"
var tvNode = tvTree.getNodeByProperty('nodeid', divTarg.id);
tvNode.toggle();
}
// ================================================================================================== //
this.panelDelete = function(index) {
// alter the data model's panel elements
var dm = i2b2.CRC.model.queryCurrent;
if(index <0 || index>=dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length) { return false;}
dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup].splice(index,1);
// redraw the panels
this.doShowFrom(this.panelControllers[0].panelCurrentIndex);
// BUG FIX: force the panels to fully reattach the yuiRootNode to the controllers
for (var i=0; i<this.panelControllers.length; i++) {
this.panelControllers[i].doRedraw();
}
this._redrawPanelCount();
this.doSetQueryName.call(this,'');
}
// ================================================================================================== //
this.doShowFrom = function(index_offset) {
// have all panel controllers redraw using new index offest
$('infoQueryStatusText').innerHTML = "";
if (index_offset===false) { return true; }
if (index_offset < 0) { index_offset = 0; }
for (var i=0; i<3; i++) {
if ((i2b2.CRC.ctrlr.QT.queryTiming == "TEMPORAL") && (i==0))
{
var sText = defineTemporalButton.get("label");
if (sText != "Population in which events occur")
this.panelControllers[i].refTitle.innerHTML = 'Anchoring Observation';
else
this.panelControllers[i].refTitle.innerHTML = 'Group 1';
}
else
{
this.panelControllers[i].refTitle.innerHTML = "Group "+(index_offset+i+1);
}
this.panelControllers[i].setPanelRecord(index_offset+i, i);
if (i > 0) {
if (index_offset+i <= i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length) {
$('queryBalloonAnd'+(i)).style.display = 'block';
} else {
$('queryBalloonAnd'+(i)).style.display = 'none';
}
}
}
this._redrawScrollBtns();
}
// ================================================================================================== //
this._redrawAllPanels = function() {
$('infoQueryStatusText').innerHTML = "";
for (var i=0; i<3; i++) {
this.panelControllers[i].doRedraw();
if (i > 0) {//@pcori panel fix. for panels[i2b2.CRC.ctrlr.QT.temporalGroup]
if (this.panelControllers[i].panelCurrentIndex-1 < i2b2.CRC.model.queryCurrent.panels.length) {
$('queryBalloonAnd'+(i)).style.display = 'block';
} else {
$('queryBalloonAnd'+(i)).style.display = 'none';
}
}
}
}
// ================================================================================================== //
this._redrawPanelCount = function() {
var c = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length;
if (c == 1) {
var s = '1 Group';
} else {
var s = c + ' Groups';
}
$('groupCount').innerHTML = s;
}
// ================================================================================================== //
this.laodQueryStatus = function( queryMasterId, queryName) {
var QRS = {};
var newHTML = "";
var qi_id = "";
$('infoQueryStatusText').innerHTML = "";
var scopedCallbackQI = new i2b2_scopedCallback();
scopedCallbackQI.scope = this;
scopedCallbackQI.callback = function(results) {
if (results.error) {
alert(results.errorMsg);
return;
} else {
// find our query instance
var qi_list = results.refXML.getElementsByTagName('query_instance');
var l = qi_list.length;
for (var i=0; i<l; i++) {
var temp = qi_list[i];
qi_id = i2b2.h.XPath(temp, 'descendant-or-self::query_instance_id')[0].firstChild.nodeValue;
var start_date = i2b2.h.XPath(temp, 'descendant-or-self::start_date')[0].firstChild.nodeValue;
if (!Object.isUndefined(start_date)) {
//alert(sDate.substring(0,4) + ":" + sDate.substring(5,7) + ":" + sDate.substring(8,10));
//012345678901234567890123
//2010-12-21T16:12:01.427
start_date = new Date(start_date.substring(0,4), start_date.substring(5,7)-1, start_date.substring(8,10), start_date.substring(11,13), start_date.substring(14,16),start_date.substring(17,19),start_date.substring(20,23));
}
var end_date = i2b2.h.XPath(temp, 'descendant-or-self::end_date')[0].firstChild.nodeValue;
if (!Object.isUndefined(end_date)) {
//alert(sDate.substring(0,4) + ":" + sDate.substring(5,7) + ":" + sDate.substring(8,10));
end_date = new Date(end_date.substring(0,4), end_date.substring(5,7)-1, end_date.substring(8,10), end_date.substring(11,13),end_date.substring(14,16), end_date.substring(17,19), end_date.substring(20,23));
}
$('infoQueryStatusText').innerHTML = '<div style="clear:both;"><div style="float:left; font-weight:bold">Finished Query: "'+queryName+'"</div>';
$('infoQueryStatusText').innerHTML += '<div style="float:right">['+ (Math.floor((end_date - start_date)/100))/10 +' secs]</div></div>';
// $('infoQueryStatusText').innerHTML += '<div style="clear:both;"><div style="float:left; font-weight:bold">Finished Query: "'+queryName+'"</div><div style="margin-left:20px; clear:both; height:16px; line-height:16px; "><div height:16px; line-height:16px; ">Compute Time: ' + (Math.floor((end_date - start_date)/100))/10 + ' secs</div></div>';
i2b2.CRC.ajax.getQueryResultInstanceList_fromQueryInstanceId("CRC:QueryTool", {qi_key_value: qi_id}, scopedCallbackQRS);
}
}
}
// this is a private function that is used by all QueryStatus object instances to check their status
// callback processor to check the Query Instance
var scopedCallbackQRSI = new i2b2_scopedCallback();
scopedCallbackQRSI.scope = this;
scopedCallbackQRSI.callback = function(results) {
if (results.error) {
alert(results.errorMsg);
return;
} else {
// find our query instance
var ri_list = results.refXML.getElementsByTagName('query_result_instance');
var l = ri_list.length;
for (var i=0; i<l; i++) {
var temp = ri_list[i];
var description = i2b2.h.XPath(temp, 'descendant-or-self::description')[0].firstChild.nodeValue;
$('infoQueryStatusText').innerHTML += "<div style=\"clear: both; padding-top: 10px; font-weight: bold;\">" + description + "</div>";
}
var crc_xml = results.refXML.getElementsByTagName('crc_xml_result');
l = crc_xml.length;
for (var i=0; i<l; i++) {
var temp = crc_xml[i];
var xml_value = i2b2.h.XPath(temp, 'descendant-or-self::xml_value')[0].firstChild.nodeValue;
var xml_v = i2b2.h.parseXml(xml_value);
i2b2.PM.model.userRoles.indexOf("DATA_LDS") == -1
// var proj_data = i2b2.PM.view.admin.currentProject;
var params = i2b2.h.XPath(xml_v, 'descendant::data[@column]/text()/..');
for (var i2 = 0; i2 < params.length; i2++) {
var name = params[i2].getAttribute("name");
// $('infoQueryStatusText').innerHTML += "<div style=\"margin-left: 20px; clear: both; height: 16px; line-height: 16px;\">";
$('infoQueryStatusText').innerHTML += "<div style=\"clear: both; margin-left: 20px; float: left; height: 16px; line-height: 16px;\">" + params[i2].getAttribute("column") + ": <font color=\"#0000dd\">" + params[i2].firstChild.nodeValue + "" + (i2b2.PM.model.userRoles.indexOf("DATA_LDS") == -1 ? "&plusmn;3" : "") + "</font></div>";
//$('infoQueryStatusText').innerHTML += "</div>"; //i2b2.h.XPath(newxml, 'descendant-or-self::result/data')[0].firstChild.nodeValue;
}
var ri_id = i2b2.h.XPath(temp, 'descendant-or-self::result_instance_id')[0].firstChild.nodeValue;
}
}
}
// callback processor to check the Query Result Set
var scopedCallbackQRS = new i2b2_scopedCallback();
scopedCallbackQRS.scope = this;
scopedCallbackQRS.callback = function(results) {
if (results.error) {
alert(results.errorMsg);
return;
} else {
// find our query instance
var qrs_list = results.refXML.getElementsByTagName('query_result_instance');
var l = qrs_list.length;
var resultStr = "";
for (var i=0; i<l; i++) {
var temp = qrs_list[i];
var qrs_id = i2b2.h.XPath(temp, 'descendant-or-self::result_instance_id')[0].firstChild.nodeValue;
if (QRS.hasOwnProperty(qrs_id)) {
var rec = QRS[qrs_id];
} else {
var rec = new Object();
rec.QRS_ID = qrs_id;
// resultStr += i2b2.h.getXNodeVal(temp, 'description');
// resultStr += i2b2.h.XPath(temp, 'descendant-or-self::query_status_type/name')[0].firstChild.nodeValue;
// resultStr += "<br/>";
rec.QRS_DisplayType = i2b2.h.XPath(temp, 'descendant-or-self::query_result_type/display_type')[0].firstChild.nodeValue;
rec.QRS_Type = i2b2.h.XPath(temp, 'descendant-or-self::query_result_type/name')[0].firstChild.nodeValue;
rec.QRS_Description = i2b2.h.XPath(temp, 'descendant-or-self::description')[0].firstChild.nodeValue;
rec.QRS_TypeID = i2b2.h.XPath(temp, 'descendant-or-self::query_result_type/result_type_id')[0].firstChild.nodeValue;
}
rec.QRS_Status = i2b2.h.XPath(temp, 'descendant-or-self::query_status_type/name')[0].firstChild.nodeValue;
rec.QRS_Status_ID = i2b2.h.XPath(temp, 'descendant-or-self::query_status_type/status_type_id')[0].firstChild.nodeValue;
// create execution time string
QRS[rec.QRS_ID] = rec;
if (rec.QRS_DisplayType == "CATNUM") {
i2b2.CRC.ajax.getQueryResultInstanceList_fromQueryResultInstanceId("CRC:QueryTool", {qr_key_value: rec.QRS_ID}, scopedCallbackQRSI);
} else if (rec.QRS_DisplayType == "LIST") {
$('infoQueryStatusText').innerHTML += "<div style=\"clear: both; padding-top: 10px; font-weight: bold;\">" + rec.QRS_Description + "</div>";
}
}
// $('infoQueryStatusText').innerHTML = resultStr;
}
}
//first get instance id
i2b2.CRC.ajax.getQueryInstanceList_fromQueryMasterId("CRC:QueryTool", {qm_key_value: queryMasterId}, scopedCallbackQI);
//if (qi_id != "") {
// i2b2.CRC.ajax.getQueryResultInstanceList_fromQueryInstanceId("CRC:QueryTool", {qi_key_value: qi_id}, scopedCallbackQRS);
// for (var q in QRS) {
// i2b2.CRC.ajax.getQueryResultInstanceList_fromQueryResultInstanceId("CRC:QueryTool", {qr_key_value: QRS[q].QRS_ID}, scopedCallbackQRSI);
// }
//}
}
// ================================================================================================== //
this.doAddTemporal = function() {
var html = $('temporalbuilders').innerHTML;
this.tenporalBuilders = this.tenporalBuilders + 1;
html = $('temporalbuilders').innerHTML
+ ' <div class="relationshipAmongEvents" id="temporalbuilder_' + this.tenporalBuilders + '"> '
+ ' <select id="preloc1[' + this.tenporalBuilders + ']" name="preloc1[' + this.tenporalBuilders + ']" style="width:100px;"><option value="STARTDATE">Start of</option><option value="ENDDATE">End of</option></select> '
+ ' <select id="instanceopf1[' + this.tenporalBuilders + ']" name="instanceopf1[' + this.tenporalBuilders + ']" style="width:150px;"><option value="FIRST">the First Ever</option><option value="LAST">the Last Ever</option><option value="ANY">any</option></select> '
+ ' <select id="instancevent1[' + this.tenporalBuilders + ']" name="instancevent1[' + this.tenporalBuilders + ']" style="width:100px;"><option selected="selected">Event 1</option><option>Event 2</option>';
for (var j =3; j < i2b2.CRC.model.queryCurrent.panels.length; j ++)
{
html += '<option>Event ' + j + '</option>';
}
html += ' </select> <br/> '
+ ' <select id="postloc[' + this.tenporalBuilders + ']" name="postloc[' + this.tenporalBuilders + ']" style="width:150px;"><option value="LESS">Occurs Before</option><option value="LESSEQUAL">On Or After</option> '
+ ' <option value="EQUAL">Equals</option> '
+ ' <option value="GREATER">Occurs On Or After</option> '
+ ' <option value="GREATEREQUAL">Occurs After</option> '
+ ' </select> '
+ ' <br/> '
+ ' <select id="preloc2[' + this.tenporalBuilders + ']" name="preloc2[' + this.tenporalBuilders + ']" style="width:100px;"><option value="STARTDATE">Start of</option><option value="ENDDATE">End of</option></select> '
+ ' <select id="instanceopf2[' + this.tenporalBuilders + ']" name="instanceopf2[' + this.tenporalBuilders + ']" style="width:150px;"><option value="FIRST">the First Ever</option><option value="LAST">the Last Ever</option><option value="ANY">any</option></select> '
+ ' <select id="instancevent2[' + this.tenporalBuilders + ']" name="instancevent2[' + this.tenporalBuilders + ']" style="width:100px;"><option>Event 1</option><option selected="selected">Event 2</option>';
for (var j =3; j < i2b2.CRC.model.queryCurrent.panels.length; j ++)
{
html += '<option>Event ' + j + '</option>';
}
html += ' </select> <br/> '
+ ' <input id="bytime1[' + this.tenporalBuilders + ']" name="bytime1[' + this.tenporalBuilders + ']" type="checkbox">By <select id="byspan1[' + this.tenporalBuilders + ']" name="byspan1[' + this.tenporalBuilders + ']" style="width:50px;"><option value="GREATER">&gt;</option><option value="GREATEREQUAL" selected="selected">&ge;</option><option value="EQUAL">=</option><option value="LESSEQUAL">&le;</option><option value="LESS">&lt;</option></select> '
+ ' <input id="bytimevalue1[' + this.tenporalBuilders + ']" name="bytimevalue1[' + this.tenporalBuilders + ']" style="width:50px;" type="text" value="1"> '
+ ' <select id="bytimeunit1[' + this.tenporalBuilders + ']" name="bytimeunit1[' + this.tenporalBuilders + ']" style="width:100px;"> '
+ ' <option value="HOUR">hour(s)</option> '
+ ' <option value="DAY" selected="selected">day(s)</option> '
+ ' <option value="MONTH">month(s)</option> '
+ ' <option value="YEAR">year(s)</option></select> '
+ ' <br/> '
+ ' <input id="bytime2[' + this.tenporalBuilders + ']" name="bytime2[' + this.tenporalBuilders + ']" type="checkbox">And <select id="byspan2[' + this.tenporalBuilders + ']" name="byspan2[' + this.tenporalBuilders + ']" style="width:50px;"><option value="GREATER">&gt;</option><option value="GREATEREQUAL">&ge;</option><option value="EQUAL">=</option><option value="LESSEQUAL" selected="selected">&le;</option><option value="LESS">&lt;</option></select> '
+ ' <input id="bytimevalue2[' + this.tenporalBuilders + ']" name="bytimevalue2[' + this.tenporalBuilders + ']" style="width:50px;" type="text" value="1"> '
+ ' <select id="bytimeunit2[' + this.tenporalBuilders + ']" name="bytimeunit2[' + this.tenporalBuilders + ']" style="width:100px;"> '
+ ' <option value="HOUR">hour(s)</option> '
+ ' <option value="DAY" selected="selected">day(s)</option> '
+ ' <option value="MONTH">month(s)</option> '
+ ' <option value="YEAR">year(s)</option></select> '
+ ' </div> ';
'<div class="relationshipAmongEvents" id="temporalbuilder_' + this.tenporalBuilders + '">' + html + '</div>';
$('temporalbuilders').innerHTML = html;
}
// ================================================================================================== //
this.doScrollFirst = function() {
this.doShowFrom(0);
}
// ================================================================================================== //
this.doScrollPrev = function() {
var i = this.panelControllers[0].panelCurrentIndex - 1;
if (i<0) { i=0; }
this.doShowFrom(i);
}
// ================================================================================================== //
this.doScrollNext = function() {
var i = this.panelControllers[0].panelCurrentIndex + 1;
var dm = i2b2.CRC.model.queryCurrent;
if (i > (dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length-3)) { i=dm.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length-3; }
this.doShowFrom(i);
}
// ================================================================================================== //
this.doScrollLast = function() {
var i = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length - 3;
if (i<0) { i = 0; }
this.doShowFrom(i);
}
// ================================================================================================== //
this.doScrollNew = function() {
var i = i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length - 2;
if (i<0) { i = 0; }
this.doShowFrom(i);
}
// ================================================================================================== //
this._redrawScrollBtns = function() {
// enable & disable scroll buttons (at least the look of the buttons)
var dir = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/';
if (i2b2.CRC.ctrlr.QT.panelControllers[0].panelCurrentIndex == 0) {
$('panelScrollFirst').src = dir+"QryTool_b_first_hide.gif";
$('panelScrollPrev').src = dir+"QryTool_b_prev_hide.gif";
} else {
$('panelScrollFirst').src = dir+"QryTool_b_first.gif";
$('panelScrollPrev').src = dir+"QryTool_b_prev.gif";
}
if ((i2b2.CRC.model.queryCurrent.panels[i2b2.CRC.ctrlr.QT.temporalGroup].length - i2b2.CRC.ctrlr.QT.panelControllers[0].panelCurrentIndex) > 3) {
$('panelScrollNext').src = dir+"QryTool_b_next.gif";
$('panelScrollLast').src = dir+"QryTool_b_last.gif";
} else {
$('panelScrollNext').src = dir+"QryTool_b_next_hide.gif";
$('panelScrollLast').src = dir+"QryTool_b_last_hide.gif";
}
},
// =====================================================================================================//
/***************
* Print Query
****************/
- this.doPrintQuery = function() {
- var v_i2b2_quey_name = i2b2.CRC.model.queryCurrent.name;
-
-
- var crc_bcgrnd1 = "<td style='border:1px solid #667788;'>";
- var crc_bcgrnd2 = "<td style='border:1px solid #667788;background:#7FFFD4'>";
- var crc_cur_bcgrnd = null;
-
- if(
- (v_i2b2_quey_name == null) ||
- (v_i2b2_quey_name == undefined) ||
- (v_i2b2_quey_name.length == 0)
- ){
- v_i2b2_quey_name = 'No Query Name is currently provided.';
- }
- var v_cnt_panels = i2b2.CRC.model.queryCurrent.panels[0].length;
-
- if(v_cnt_panels > 0){
- var win_html_inner =
- "<table style='border:1px solid #667788;width:700px;' cellpadding=3px>"+
- "<tbody>";
-
-
-
- //Get Query Name if available
- win_html_inner +=
- "<tr>"+
- "<td style='background:#6677AA none repeat scroll 0%;border:1px solid #667788;'>"+
- "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:13px;'>"+
- "Query Name: "+ v_i2b2_quey_name + "<br>Temporal Constraint: ";
-
- var v_querytiming = i2b2.CRC.ctrlr.QT.queryTiming;
- if (v_querytiming == "ANY")
- {
- win_html_inner += "Treat all groups independently";
- } else if (v_querytiming == "SAMEVISIT") {
- win_html_inner += "Selected groups occur in the same financial encounter";
- } else if (v_querytiming == "TEMPORAL") {
- win_html_inner += "Define sequence of events";
- } else {
- win_html_inner += "Items Instance will be the same";
- }
-
- win_html_inner += "</span></td></tr>";
-
-
- var isTemporal = false;
- if (this.queryTiming == "TEMPORAL") {
- isTemporal = true;
- }
-
- for (var ip = 0; ip < i2b2.CRC.model.queryCurrent.panels.length; ip++)
- {
-
- var v_cnt_panels = i2b2.CRC.model.queryCurrent.panels[ip].length;
-
- //Get information for each query panel
- for(x =0; x < v_cnt_panels; x++){
- var v_dateTo = i2b2.CRC.model.queryCurrent.panels[ip][x].dateTo;
- var v_dateFrom = i2b2.CRC.model.queryCurrent.panels[ip][x].dateFrom;
- var v_exclude = i2b2.CRC.model.queryCurrent.panels[ip][x].exclude;
- var v_occurs = i2b2.CRC.model.queryCurrent.panels[ip][x].occurs;
- var v_relevance = i2b2.CRC.model.queryCurrent.panels[ip][x].relevance;
- var v_timing = i2b2.CRC.model.queryCurrent.panels[ip][x].timing;
- var v_items = i2b2.CRC.model.queryCurrent.panels[ip][x].items;
-
- if((x % 2) == 0){
- crc_cur_bcgrnd = crc_bcgrnd1;
- }
- else{
- crc_cur_bcgrnd = crc_bcgrnd2;
- }
-
- var v_strDateTo = null;
- var v_strDateFrom = null;
- //Handle JS Dates
- if((v_dateTo == null) ||
- (v_dateTo == undefined) ||
- (v_dateTo == false)
- ){
- v_strDateTo = "none";
- }
- else{
- v_strDateTo =
- v_dateTo.Month +"/"+
- v_dateTo.Day +"/" +
- v_dateTo.Year;
- }
-
-
- //QueryTiming
- if (v_querytiming == "ANY")
- {
- v_timing = "Treat Independently";
-
- } else if (v_querytiming == "SAMEVISIT")
- {
- if (v_timing == "ANY")
- {
- v_timing = "Treat Independently";
- } else {
- v_timing = "Occurs in Same Encounter";
- }
- } else
- {
- if (v_timing == "ANY")
- {
- v_timing = "Treat Independently";
- } else {
- v_timing = "Items Instance will be the same";
- }
- }
-
-
- //Handle JS Dates
- if((v_dateFrom == null) ||
- (v_dateFrom == undefined) ||
- (v_dateFrom == false)
- ){
- v_strDateFrom = "none";
- }
- else{
- v_strDateFrom =
- v_dateFrom.Month +"/"+
- v_dateFrom.Day +"/" +
- v_dateFrom.Year;
- }
-
- if (isTemporal)
- {
- var tempalTitle = "Population in which events occur";
- if (ip > 0)
- tempalTitle = "Event " + ip;
-
- win_html_inner +=
- "<tr>"+
- crc_cur_bcgrnd;
-
- win_html_inner +=
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:12px;'>"+
- tempalTitle
- "</span></td></tr>";
- }
-
- win_html_inner +=
- "<tr>"+
- crc_cur_bcgrnd;
-
- win_html_inner +=
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:12px;'>"+
- "Group "+ (x + 1)
- "</span></td></tr>";
-
- win_html_inner +=
- "<tr><td style='border:1px solid #667788;'>"+
- "<table width=100% cellpadding=2px cellspacing=0>"+
- "<tbody>"+
- "<tr style='border:1px solid #667788;'>"+
- "<td colspan=3>"+
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
- "&nbsp; Date From: &nbsp;</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
- v_strDateFrom +
- "</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
- "&nbsp; Date To: &nbsp;</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
- v_strDateTo +
- "</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
- "<!--Excluded-->"+
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
- "&nbsp; Excluded? &nbsp;</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
- v_exclude +
- "</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
- "&nbsp; Occurs X times: &nbsp;</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>&gt; "+
- v_occurs +
- "</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
- "&nbsp; Relevance %: &nbsp;</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> "+
- v_relevance +
- "</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
- "&nbsp; Temporal Constraint: &nbsp;</span>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
- v_timing +
- "</span>"+
- "</td>"+
- "</tr>";
-
- win_html_inner +=
- "<!--Header Columns-->"+
- "<tr>"+
- "<!--Path-->"+
- "<td width=40% style='background:#6677AA none repeat scroll 0%;align:center;border-left-style:solid;border-bottom-style:solid;border-top-style:solid;border-right-style:solid;'>"+
- "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>Path</span>"+
- "</td>"+
- "<!--Concept-->"+
- "<td width=30% style='background:#6677AA none repeat scroll 0%;align:center;border-bottom-style:solid;border-top-style:solid;border-right-style:solid;'>"+
- "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>Concept/Term</span>"+
- "</td>"+
- "<!--Other Information-->"+
- "<td width=30% style='background:#6677AA none repeat scroll 0%;align:center;border-bottom-style:solid;border-top-style:solid;border-right-style:solid;'>"+
- "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>Other Information</span>"+
- "</td>"+
- "</tr>";
-
- win_html_inner +=
- "<!--Data Columns-->";
-
- for(n = 0; n < v_items.length; n++){
- //str_shrine_path = v_items[n].sdxInfo.sdxKeyValue;
- //Using tooltips
- str_shrine_path = v_items[n].origData.tooltip;
-
- win_html_inner += "<tr>";
- win_html_inner +=
- "<td width=40% style='align:center;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;'>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
- str_shrine_path +
- "</span></td>";
-
- win_html_inner +=
- "<td width=30% style='align:center;solid;border-bottom-style:solid;border-right-style:solid;'>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
- v_items[n].origData.name +
- "</span></td>";
-
- win_html_inner +=
- "<td width=30% style='align:center;border-bottom-style:solid;border-right-style:solid;'>"+
- "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>";
- if((v_items[n].LabValues == null) ||
- (v_items[n].LabValues == undefined) ||
- (v_items[n].LabValues.length <= 0)
- ){
-
- win_html_inner += "&nbsp;";
-
- }
- else{
- var v_lab_values = v_items[n].LabValues;
-
- var str_lab_values = "";
-
-
- if(v_lab_values.GeneralValueType == "NUMBER") {
- str_lab_values =
- v_lab_values.NumericOp +" : ";
-
- if((v_lab_values.ValueLow != null) ||
- (v_lab_values.ValueLow != undefined)
- ){
- str_lab_values +=
- v_lab_values.ValueLow + " - "+
- v_lab_values.ValueHigh;
- } else {
- str_lab_values +=
- v_lab_values.Value;
- }
- str_lab_values += " "+ v_lab_values.UnitsCtrl;
- }
- //String
- else if((v_lab_values.ValueString != null) ||
- (v_lab_values.ValueString != undefined)
- ){
- str_lab_values =
- "By String: "+
- v_lab_values.ValueString;
- }
- //Flag
- else if((v_lab_values.ValueFlag != null) ||
- (v_lab_values.ValueFlag != undefined)
- ){
- var v_flag = "Normal";
- if(v_lab_values.ValueFlag == "H"){
- v_flag = "High";
- }
- else if(v_lab_values.ValueFlag == "L"){
- v_flag = "Low";
- }
-
- str_lab_values =
- "By Flag: "+ v_flag;
- }
-
- win_html_inner += str_lab_values;
- }
-
-
- win_html_inner += "</span></td></tr>";
- }
-
- //end
-
- if (isTemporal == false)
- break;
- }
-
-
-
- win_html_inner += "</tbody></table>";
-
- }
-
- if (isTemporal)
- {
-
- win_html_inner +=
- "<tr>"+
- crc_cur_bcgrnd;
-
- win_html_inner +=
- "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:12px;'><center>"+
-
- $('instancevent1[0]').options[$('instancevent1[0]').selectedIndex].value + " " +
- $('preloc1[0]').options[$('preloc1[0]').selectedIndex].value +" " +
- $('instanceopf1[0]').options[$('instanceopf1[0]').selectedIndex].value +"<br/>" +
- $('postloc[0]').options[$('postloc[0]').selectedIndex].value + "<br/>" +
- $('instancevent2[0]').options[$('instancevent2[0]').selectedIndex].value + " " +
- $('preloc2[0]').options[$('preloc2[0]').selectedIndex].value + " " +
- $('instanceopf2[0]').options[$('instanceopf2[0]').selectedIndex].value +" ";
-
- if ( $('bytime1[0]').checked)
- {
- win_html_inner += "<br/>" + $('byspan1[0]').options[$('byspan1[0]').selectedIndex].value + " " +
- $('bytimevalue1[0]').value + " " +
- $('bytimeunit1[0]').options[$('bytimeunit1[0]').selectedIndex].value +" ";
-
- }
- if ( $('bytime2[0]').checked)
- {
- win_html_inner += "<br/>" + $('byspan2[0]').options[$('byspan2[0]').selectedIndex].value + " " +
- $('bytimevalue2[0]').value + " " +
- $('bytimeunit2[0]').options[$('bytimeunit2[0]').selectedIndex].value;
-
- }
- win_html_inner += "</center></span></td></tr>";
- }
-
- win_html_inner += "</tbody></table>";
-
- //Query Status window
- var self = i2b2.CRC.ctrlr.currentQueryStatus;
- if(
- (self != null) &&
- (self != undefined) &&
- (self.dispDIV != null) &&
- (self.dispDIV != undefined)
- ){
- win_html_inner += self.dispDIV.innerHTML;
-
- }
-
- var win =
- window.open("",'shrinePrintWindow','width=800,height=750,menubar=yes,resizable=yes,scrollbars=yes');
-
-
-
- win.document.writeln('<div id="shrinePrintQueryPage">');
- win.document.writeln(win_html_inner);
- win.document.writeln('</div>');
- }
- else{
- alert("Currently no query is available for printing. \nPlease generate a query before clicking on [Print Query] button.");
- }
- }
-
+ this.doPrintQuery = function() {
+ var v_i2b2_quey_name = i2b2.CRC.model.queryCurrent.name;
+
+
+ var crc_bcgrnd1 = "<td style='border:1px solid #667788;'>";
+ var crc_bcgrnd2 = "<td style='border:1px solid #667788;background:#7FFFD4'>";
+ var crc_cur_bcgrnd = null;
+
+ if(
+ (v_i2b2_quey_name == null) ||
+ (v_i2b2_quey_name == undefined) ||
+ (v_i2b2_quey_name.length == 0)
+ ){
+ v_i2b2_quey_name = 'No Query Name is currently provided.';
+ }
+ var v_cnt_panels = i2b2.CRC.model.queryCurrent.panels[0].length;
+
+ if(v_cnt_panels > 0){
+ var win_html_inner =
+ "<table style='border:1px solid #667788;width:700px;' cellpadding=3px>"+
+ "<tbody>";
+
+
+
+ //Get Query Name if available
+ win_html_inner +=
+ "<tr>"+
+ "<td style='background:#6677AA none repeat scroll 0%;border:1px solid #667788;'>"+
+ "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:13px;'>"+
+ "Query Name: "+ v_i2b2_quey_name + "<br>Temporal Constraint: ";
+
+ var v_querytiming = i2b2.CRC.ctrlr.QT.queryTiming;
+ if (v_querytiming == "ANY")
+ {
+ win_html_inner += "Treat all groups independently";
+ } else if (v_querytiming == "SAMEVISIT") {
+ win_html_inner += "Selected groups occur in the same financial encounter";
+ } else if (v_querytiming == "TEMPORAL") {
+ win_html_inner += "Define sequence of events";
+ } else {
+ win_html_inner += "Items Instance will be the same";
+ }
+
+ win_html_inner += "</span></td></tr>";
+
+
+ var isTemporal = false;
+ if (this.queryTiming == "TEMPORAL") {
+ isTemporal = true;
+ }
+
+ for (var ip = 0; ip < i2b2.CRC.model.queryCurrent.panels.length; ip++)
+ {
+
+ var v_cnt_panels = i2b2.CRC.model.queryCurrent.panels[ip].length;
+
+ //Get information for each query panel
+ for(x =0; x < v_cnt_panels; x++){
+ var v_dateTo = i2b2.CRC.model.queryCurrent.panels[ip][x].dateTo;
+ var v_dateFrom = i2b2.CRC.model.queryCurrent.panels[ip][x].dateFrom;
+ var v_exclude = i2b2.CRC.model.queryCurrent.panels[ip][x].exclude;
+ var v_occurs = i2b2.CRC.model.queryCurrent.panels[ip][x].occurs;
+ var v_relevance = i2b2.CRC.model.queryCurrent.panels[ip][x].relevance;
+ var v_timing = i2b2.CRC.model.queryCurrent.panels[ip][x].timing;
+ var v_items = i2b2.CRC.model.queryCurrent.panels[ip][x].items;
+
+ if((x % 2) == 0){
+ crc_cur_bcgrnd = crc_bcgrnd1;
+ }
+ else{
+ crc_cur_bcgrnd = crc_bcgrnd2;
+ }
+
+ var v_strDateTo = null;
+ var v_strDateFrom = null;
+ //Handle JS Dates
+ if((v_dateTo == null) ||
+ (v_dateTo == undefined) ||
+ (v_dateTo == false)
+ ){
+ v_strDateTo = "none";
+ }
+ else{
+ v_strDateTo =
+ v_dateTo.Month +"/"+
+ v_dateTo.Day +"/" +
+ v_dateTo.Year;
+ }
+
+
+ //QueryTiming
+ if (v_querytiming == "ANY")
+ {
+ v_timing = "Treat Independently";
+
+ } else if (v_querytiming == "SAMEVISIT")
+ {
+ if (v_timing == "ANY")
+ {
+ v_timing = "Treat Independently";
+ } else {
+ v_timing = "Occurs in Same Encounter";
+ }
+ } else
+ {
+ if (v_timing == "ANY")
+ {
+ v_timing = "Treat Independently";
+ } else {
+ v_timing = "Items Instance will be the same";
+ }
+ }
+
+
+ //Handle JS Dates
+ if((v_dateFrom == null) ||
+ (v_dateFrom == undefined) ||
+ (v_dateFrom == false)
+ ){
+ v_strDateFrom = "none";
+ }
+ else{
+ v_strDateFrom =
+ v_dateFrom.Month +"/"+
+ v_dateFrom.Day +"/" +
+ v_dateFrom.Year;
+ }
+
+ if (isTemporal)
+ {
+ var tempalTitle = "Population in which events occur";
+ if (ip > 0)
+ tempalTitle = "Event " + ip;
+
+ win_html_inner +=
+ "<tr>"+
+ crc_cur_bcgrnd;
+
+ win_html_inner +=
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:12px;'>"+
+ tempalTitle
+ "</span></td></tr>";
+ }
+
+ win_html_inner +=
+ "<tr>"+
+ crc_cur_bcgrnd;
+
+ win_html_inner +=
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:12px;'>"+
+ "Group "+ (x + 1)
+ "</span></td></tr>";
+
+ win_html_inner +=
+ "<tr><td style='border:1px solid #667788;'>"+
+ "<table width=100% cellpadding=2px cellspacing=0>"+
+ "<tbody>"+
+ "<tr style='border:1px solid #667788;'>"+
+ "<td colspan=3>"+
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
+ "&nbsp; Date From: &nbsp;</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
+ v_strDateFrom +
+ "</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
+ "&nbsp; Date To: &nbsp;</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
+ v_strDateTo +
+ "</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
+ "<!--Excluded-->"+
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
+ "&nbsp; Excluded? &nbsp;</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
+ v_exclude +
+ "</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
+ "&nbsp; Occurs X times: &nbsp;</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>&gt; "+
+ v_occurs +
+ "</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
+ "&nbsp; Relevance %: &nbsp;</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> "+
+ v_relevance +
+ "</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'> </span>"+
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>"+
+ "&nbsp; Temporal Constraint: &nbsp;</span>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
+ v_timing +
+ "</span>"+
+ "</td>"+
+ "</tr>";
+
+ win_html_inner +=
+ "<!--Header Columns-->"+
+ "<tr>"+
+ "<!--Path-->"+
+ "<td width=40% style='background:#6677AA none repeat scroll 0%;align:center;border-left-style:solid;border-bottom-style:solid;border-top-style:solid;border-right-style:solid;'>"+
+ "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>Path</span>"+
+ "</td>"+
+ "<!--Concept-->"+
+ "<td width=30% style='background:#6677AA none repeat scroll 0%;align:center;border-bottom-style:solid;border-top-style:solid;border-right-style:solid;'>"+
+ "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>Concept/Term</span>"+
+ "</td>"+
+ "<!--Other Information-->"+
+ "<td width=30% style='background:#6677AA none repeat scroll 0%;align:center;border-bottom-style:solid;border-top-style:solid;border-right-style:solid;'>"+
+ "<span style='color:#FFFFFF;font-weight:bold;font-family:arial,helvetica;font-size:11px;'>Other Information</span>"+
+ "</td>"+
+ "</tr>";
+
+ win_html_inner +=
+ "<!--Data Columns-->";
+
+ for(n = 0; n < v_items.length; n++){
+ //str_shrine_path = v_items[n].sdxInfo.sdxKeyValue;
+ //Using tooltips
+ str_shrine_path = v_items[n].origData.tooltip;
+
+ win_html_inner += "<tr>";
+ win_html_inner +=
+ "<td width=40% style='align:center;border-left-style:solid;border-bottom-style:solid;border-right-style:solid;'>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
+ str_shrine_path +
+ "</span></td>";
+
+ win_html_inner +=
+ "<td width=30% style='align:center;solid;border-bottom-style:solid;border-right-style:solid;'>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>"+
+ v_items[n].origData.name +
+ "</span></td>";
+
+ win_html_inner +=
+ "<td width=30% style='align:center;border-bottom-style:solid;border-right-style:solid;'>"+
+ "<span style='color:black;font-weight:normal;font-family:arial,helvetica;font-size:11px;'>";
+ if((v_items[n].LabValues == null) ||
+ (v_items[n].LabValues == undefined) ||
+ (v_items[n].LabValues.length <= 0)
+ ){
+
+ win_html_inner += "&nbsp;";
+
+ }
+ else{
+ var v_lab_values = v_items[n].LabValues;
+
+ var str_lab_values = "";
+
+
+ if(v_lab_values.GeneralValueType == "NUMBER") {
+ str_lab_values =
+ v_lab_values.NumericOp +" : ";
+
+ if((v_lab_values.ValueLow != null) ||
+ (v_lab_values.ValueLow != undefined)
+ ){
+ str_lab_values +=
+ v_lab_values.ValueLow + " - "+
+ v_lab_values.ValueHigh;
+ } else {
+ str_lab_values +=
+ v_lab_values.Value;
+ }
+ str_lab_values += " "+ v_lab_values.UnitsCtrl;
+ }
+ //String
+ else if((v_lab_values.ValueString != null) ||
+ (v_lab_values.ValueString != undefined)
+ ){
+ str_lab_values =
+ "By String: "+
+ v_lab_values.ValueString;
+ }
+ //Flag
+ else if((v_lab_values.ValueFlag != null) ||
+ (v_lab_values.ValueFlag != undefined)
+ ){
+ var v_flag = "Normal";
+ if(v_lab_values.ValueFlag == "H"){
+ v_flag = "High";
+ }
+ else if(v_lab_values.ValueFlag == "L"){
+ v_flag = "Low";
+ }
+
+ str_lab_values =
+ "By Flag: "+ v_flag;
+ }
+
+ win_html_inner += str_lab_values;
+ }
+
+
+ win_html_inner += "</span></td></tr>";
+ }
+
+ //end
+
+ if (isTemporal == false)
+ break;
+ }
+
+
+
+ win_html_inner += "</tbody></table>";
+
+ }
+
+ if (isTemporal)
+ {
+
+ win_html_inner +=
+ "<tr>"+
+ crc_cur_bcgrnd;
+
+ win_html_inner +=
+ "<span style='color:black;font-weight:bold;font-family:arial,helvetica;font-size:12px;'><center>"+
+
+ $('instancevent1[0]').options[$('instancevent1[0]').selectedIndex].value + " " +
+ $('preloc1[0]').options[$('preloc1[0]').selectedIndex].value +" " +
+ $('instanceopf1[0]').options[$('instanceopf1[0]').selectedIndex].value +"<br/>" +
+ $('postloc[0]').options[$('postloc[0]').selectedIndex].value + "<br/>" +
+ $('instancevent2[0]').options[$('instancevent2[0]').selectedIndex].value + " " +
+ $('preloc2[0]').options[$('preloc2[0]').selectedIndex].value + " " +
+ $('instanceopf2[0]').options[$('instanceopf2[0]').selectedIndex].value +" ";
+
+ if ( $('bytime1[0]').checked)
+ {
+ win_html_inner += "<br/>" + $('byspan1[0]').options[$('byspan1[0]').selectedIndex].value + " " +
+ $('bytimevalue1[0]').value + " " +
+ $('bytimeunit1[0]').options[$('bytimeunit1[0]').selectedIndex].value +" ";
+
+ }
+ if ( $('bytime2[0]').checked)
+ {
+ win_html_inner += "<br/>" + $('byspan2[0]').options[$('byspan2[0]').selectedIndex].value + " " +
+ $('bytimevalue2[0]').value + " " +
+ $('bytimeunit2[0]').options[$('bytimeunit2[0]').selectedIndex].value;
+
+ }
+ win_html_inner += "</center></span></td></tr>";
+ }
+
+ win_html_inner += "</tbody></table>";
+
+ //Query Status window
+ var self = i2b2.CRC.ctrlr.currentQueryStatus;
+ if(
+ (self != null) &&
+ (self != undefined) &&
+ (self.dispDIV != null) &&
+ (self.dispDIV != undefined)
+ ){
+ win_html_inner += self.dispDIV.innerHTML;
+
+ }
+
+ var win =
+ window.open("",'shrinePrintWindow','width=800,height=750,menubar=yes,resizable=yes,scrollbars=yes');
+
+
+
+ win.document.writeln('<div id="shrinePrintQueryPage">');
+ win.document.writeln(win_html_inner);
+ win.document.writeln('</div>');
+ }
+ else{
+ alert("Currently no query is available for printing. \nPlease generate a query before clicking on [Print Query] button.");
+ }
+ },
+
+// =====================================================================================================//
+ /**********************
+ * Query Report BG
+ **********************/
+ // Print Query variables
+ this.queryPanelObjForPrinting = {};
+ this.QI_Rec_ForPrinting = new Object();
+ this.QueryResultsForPrinting = {};
+ this.QueryResultsForPrintingIndex = 0;
+ this.QueryResultsNum = 0;
+ this.query_user_id=null;
+ this.XMLResultsStringForPrint = "";
+ var uniqueItems = $H();
+ var queryReportWin = null;
+ // End Print Query variables
+
+ this.ClearVariablesForPrinting = function()
+ {
+ this.queryPanelObjForPrinting = {};
+ this.QI_Rec_ForPrinting = new Object();
+ this.QueryResultsForPrinting = {};
+ this.QueryResultsForPrintingIndex = 0;
+ this.QueryResultsNum = 0;
+ this.query_user_id=null;
+ this.XMLResultsStringForPrint = "";
+ var uniqueItems = $H();
+ queryReportWin = null;
+ };
+
+ this.createQueryReport = function(queryNameInput,previewQueryOnly)
+ {
+ //This request is to populate the query report panel in the query results section
+ //If the status box is empty no need to proceed
+ if($('infoQueryStatusText').innerHTML=="") return;
+
+ //Clean the corresponding div before repopulating
+ $("infoQueryStatusReport").innerHTML="";
+
+ //Clean and populate the variables for printing
+ this.ClearVariablesForPrinting();
+ if(queryNameInput.length>0 || previewQueryOnly)
+ this.queryPanelObjForPrinting.name = queryNameInput;
+ else{
+ var nameObj = document.getElementById("queryName");
+ var v_i2b2_quey_name = i2b2.CRC.model.queryCurrent.name;
+ if(nameObj){
+ this.queryPanelObjForPrinting.name = nameObj.innerHTML;
+ }
+ }
+
+ var userIdElm = $("userIdElem");
+ if(userIdElm)
+ this.query_user_id = userIdElm.value;
+
+ var v_cnt_panels = i2b2.CRC.model.queryCurrent.panels[0].length;
+ if(v_cnt_panels > 0){
+ this.queryPanelObjForPrinting.timing = i2b2.CRC.ctrlr.QT.queryTiming;
+
+ var isTemporal = false;
+ if (this.queryTiming == "TEMPORAL") {
+ isTemporal = true;
+ }
+ this.queryPanelObjForPrinting.subQryRelationStructure = [];
+ this.queryPanelObjForPrinting.mainQryStructure = [];
+ this.queryPanelObjForPrinting.subQryStructure = [];
+ this.queryPanelObjForPrinting.hasSubquery = false;
+
+
+ for (var ip = 0; ip < i2b2.CRC.model.queryCurrent.panels.length; ip++)
+ {
+ var v_cnt_panels = i2b2.CRC.model.queryCurrent.panels[ip].length;
+ //Get information for each query panel
+ var panels = [];
+ for(x =0; x < v_cnt_panels; x++){
+ var po = {};
+ po.dateTo = i2b2.CRC.model.queryCurrent.panels[ip][x].dateTo;
+ po.dateFrom = i2b2.CRC.model.queryCurrent.panels[ip][x].dateFrom;
+ po.exclude = i2b2.CRC.model.queryCurrent.panels[ip][x].exclude;
+ po.occurs = i2b2.CRC.model.queryCurrent.panels[ip][x].occurs;
+ po.relevance = i2b2.CRC.model.queryCurrent.panels[ip][x].relevance;
+ po.timing = i2b2.CRC.model.queryCurrent.panels[ip][x].timing;
+ po.subquery = false;
+ if (isTemporal && ip>0){
+ po.name = "Event" + ip;
+ po.subquery = true;
+ }
+
+ var v_items = i2b2.CRC.model.queryCurrent.panels[ip][x].items;
+
+ var v_strDateTo = null;
+ var v_strDateFrom = null;
+ //Handle JS Dates
+ if((po.dateTo == null) ||
+ (po.dateTo == undefined) ||
+ (po.dateTo == false)
+ ){
+ v_strDateTo = "none";
+ }
+ else{
+ v_strDateTo =
+ po.dateTo.Month +"/"+
+ po.dateTo.Day +"/" +
+ po.dateTo.Year;
+ }
+ po.dateTo = v_strDateTo
+
+ //Handle JS Dates
+ if((po.dateFrom == null) ||
+ (po.dateFrom == undefined) ||
+ (po.dateFrom == false)
+ ){
+ po.strDateFrom = "none";
+ }
+ else{
+ v_strDateFrom =
+ po.dateFrom.Month +"/"+
+ po.dateFrom.Day +"/" +
+ po.dateFrom.Year;
+ }
+ po.dateFrom = v_strDateFrom;
+
+ po.items = [];
+
+ for(n = 0; n < v_items.length; n++){
+ var itemObj = {};
+ itemObj.tooltip = v_items[n].origData.tooltip? v_items[n].origData.tooltip:"";
+ itemObj.name = v_items[n].origData.result_instance_id ?
+ (v_items[n].origData.title ? v_items[n].origData.title :
+ (v_items[n].origData.titleCRC ? v_items[n].origData.titleCRC : ""))
+ :(v_items[n].origData.newName ? v_items[n].origData.newName
+ : (v_items[n].origData.name?v_items[n].origData.name:""));
+ itemObj.hasChildren = v_items[n].origData.hasChildren;
+ po.items.push(itemObj);
+ //itemObj.level =
+ }
+ panels[x] = po;
+ }
+ if(panels.length>0){
+ if (isTemporal)
+ {
+ if (ip > 0)
+ this.queryPanelObjForPrinting.subQryStructure.push(panels);
+ else
+ this.queryPanelObjForPrinting.mainQryStructure.push(panels);
+ }
+ else
+ this.queryPanelObjForPrinting.mainQryStructure.push(panels);
+ }
+ }
+
+ if(isTemporal)
+ {
+ var evntRelDiv = document.getElementById('temporalbuilders');
+ if(evntRelDiv)
+ {
+ var relationNodes = evntRelDiv.childNodes;
+ this.queryPanelObjForPrinting.subQryRelationStructure = [];
+ var subQryRelationStructureIndex = 0;
+ for(i=0; i < relationNodes.length; i++)
+ {
+ var thisRelNode = relationNodes[i];
+ var rel = {};
+ rel.spans = [];
+ var spanIndex = 0;
+ var spanObj = {};
+ var bytime1 = false;
+ var bytime2 = false;
+ var allChildren = thisRelNode.childNodes;
+
+ for(j=0; j < allChildren.length; j++)
+ {
+ var currentNode = allChildren[j];
+ if(currentNode.id){
+ if(currentNode.id.indexOf("preloc1") >= 0)
+ {
+ rel.firstQryJoinCol = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf("instanceopf1") >= 0)
+ {
+ rel.firstQryOp = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf("instancevent1") >= 0)
+ {
+ rel.firstQryEvntNm = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf("postloc") >= 0)
+ {
+ rel.operator = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf("preloc2") >= 0)
+ {
+ rel.secondQryJoinCol = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf("instanceopf2") >= 0)
+ {
+ rel.secondQryOp = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf("instancevent2") >= 0)
+ {
+ rel.secondQryEvntNm = getSelectedValueFromOptions(currentNode.options);
+ }
+ if((currentNode.id.indexOf('bytime1') >= 0) && currentNode.checked)
+ {
+ bytime1 = true;
+ }
+ if(currentNode.id.indexOf('byspan1') >= 0 && bytime1)
+ {
+ spanObj.oprator = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf('bytimevalue1') >= 0 && bytime1)
+ {
+ spanObj.value = currentNode.value;
+ }
+ if(currentNode.id.indexOf('bytimeunit1') >= 0 && bytime1)
+ {
+ spanObj.units = getSelectedValueFromOptions(currentNode.options);
+ rel.spans[spanIndex++] = spanObj;
+ }
+ if((currentNode.id.indexOf('bytime2') >= 0) && currentNode.checked)
+ {
+ bytime2 = true;
+ spanObj = {};
+ }
+ if(currentNode.id.indexOf('byspan2') >= 0 && bytime2)
+ {
+ spanObj.oprator = getSelectedValueFromOptions(currentNode.options);
+ }
+ if(currentNode.id.indexOf('bytimevalue2') >= 0 && bytime2)
+ {
+ spanObj.value = currentNode.value;
+ }
+ if(currentNode.id.indexOf('bytimeunit2') >= 0 && bytime2)
+ {
+ spanObj.units = getSelectedValueFromOptions(currentNode.options);
+ rel.spans[spanIndex++] = spanObj;
+ }
+ }
+ }
+ if(allChildren.length > 0)
+ this.queryPanelObjForPrinting.subQryRelationStructure[subQryRelationStructureIndex++] = rel ;
+ }
+ }
+ }
+ //All variables are ready to print.
+ var infoQueryStatusTextObj = $('infoQueryStatusText');
+ this.createHTMLForPrinting(previewQueryOnly);
+ }
+ else{
+ alert("Currently no query is available for printing. \nPlease generate a query before clicking on [Print Query] button.");
+ }
+ };
+
+ this.PrintQueryTemplate = "<head>"+
+ "<title>Query Report</title>"+
+ // "<script type=\"text/javascript\" src=\"js-i2b2/cells/CRC/CRC_ctrlr_Query_Report.js\"></script>"+
+ "<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>"+
+ "<link rel='stylesheet' TYPE='text/css' href='js-i2b2/cells/CRC/assets/query_report.css'>"+
+ "<link href='js-ext/c3code/c3.css' rel='stylesheet' type='text/css'>"+
+ "</head>"+
+ "<body>"+
+ "</body>";
+
+ this.PrintQueryBody =
+ "<div id=\"QueryReportLoading\"><img src=\"js-i2b2/cells/CRC/assets/loading.gif\" alt=\"Loading\"/></div>"+
+ "<div id='QueryReportContainer' class='no-show'>"+
+ "<span style='float:right;'><img src='assets/images/title.gif'/></span>"+
+ "<span class='no-print' style='font-family:Arial;font-size:11px;'><img src=\"js-i2b2/cells/CRC/assets/print.png\"/><a href='javascript:window.print()' title='Click here to print the report.'> Print Report</a></span>"+
+ "<div class='QRMainHeader'>Query Report</div>"+
+ "<table id='queryDetailsTable'></table>"+
+ "<div class='descHead'>Query Definition</div>"+
+ "<table id='qdHeaderTable'></table>"+
+ "<table id='qdContainerTable'></table><br>"+
+ "<table id='temporalQryEventsContainerTable'></table><br>"+
+ "<table id='temporalQryEventsRelationsTable'></table>"+
+ "<div id='qrsTitle' class='descHead'>Query Results</div>"+
+ "<br><div id='queryResultsContainer'><div id='tablesContainer'></div><div id='graphsContainer'></div></div>" +
+ "<span class='no-print' style='font-family:Arial;font-size:11px;'><img src=\"js-i2b2/cells/CRC/assets/print.png\"/><a href='javascript:window.print()' title='Click here to print the report.'> Print Report</a></span>"+
+ "</div>";
+
+ this.createHTMLForPrinting = function(previewQueryOnly)
+ {
+ var QueryReportWin = null;
+ var QueryReportDiv = null;
+ var ua = window.navigator.userAgent;
+ var msie = ua.indexOf("MSIE ");
+ var browserIsIE = false;
+ if (msie > 0)
+ browserIsIE = true;
+ if(!(window.ActiveXObject) && "ActiveXObject" in window)
+ browserIsIE = true;
+ var savedHTML = null;
+
+ if(this.queryPanelObjForPrinting.mainQryStructure.length > 0){
+ if( previewQueryOnly){
+ if(browserIsIE){
+ i2b2.CRC.ctrlr.QT.queryReportViewer.yuiPanel = null;
+ i2b2.CRC.ctrlr.QT.queryReportViewer.show();
+ QueryReportDiv = jQuery(i2b2.CRC.ctrlr.QT.queryReportViewer.yuiPanel.body)//.find('#queryReport-viewer-body');
+ }
+ else{ //Open a new window for printing query for non-IE browsers
+ QueryReportWin = window.open("",'shrinePrintWindow','width=800,height=750,menubar=yes,resizable=yes,scrollbars=yes');
+ //Request came for query preview generation. Need to load the child window with template
+ // if(previewQueryOnly){
+ var doc = QueryReportWin.document;
+ doc.write(this.PrintQueryTemplate);
+ doc.write(this.PrintQueryBody);
+ doc.close();
+ // }
+ }
+ }
+ else
+ {
+ QueryReportDiv = $('infoQueryStatusReport');
+ QueryReportDiv.innerHTML=this.PrintQueryBody;
+ var printLinks = $$('.no-print');
+ if(printLinks)
+ printLinks.each(function(printLink){
+ var link = printLink.down('a');
+ if(link)
+ link.href="javascript:i2b2.CRC.ctrlr.QT.PrintElem('infoQueryStatusReport')";
+ });
+
+ }
+
+ //Populate the query details section
+ try{
+ if(QueryReportWin)
+ this.getQueryDetails(this.queryPanelObjForPrinting,this.query_user_id,previewQueryOnly,QueryReportWin,"queryDetailsTable");
+
+ if(QueryReportDiv)
+ this.getQueryDetails(this.queryPanelObjForPrinting,this.query_user_id,previewQueryOnly,false,"queryDetailsTable");
+ }
+ catch(e)
+ {
+ console.error(e);
+ }
+
+ //Populate the query description section
+
+ try{
+ if(QueryReportWin)
+ this.getQrTiming(this.queryPanelObjForPrinting,QueryReportWin,"qdHeaderTable");
+ if(QueryReportDiv)
+ this.getQrTiming(this.queryPanelObjForPrinting,false,"qdHeaderTable");
+ }
+ catch(e)
+ {
+ console.error(e);
+ }
+
+ //Populate the query structure description section
+
+ var qdDescription = this.getQueryDescription(this.queryPanelObjForPrinting.mainQryStructure);
+ if(qdDescription)
+ {
+ try{
+ var Row = "<tr><td width=\"5px\"><div class=\"tabSpace\"></div></td>";
+ var Cell = "<td class=\"eventsRelHdr\">" + "All Groups" + "</td>";
+ Row = Row + Cell;
+
+ if(QueryReportWin)
+ jQuery("#qdContainerTable",QueryReportWin.document).append(Row);
+ if(QueryReportDiv)
+ jQuery("#qdContainerTable").append(Row);
+
+ if(QueryReportWin)
+ jQuery("#qdContainerTable",QueryReportWin.document).append(qdDescription);
+ if(QueryReportDiv)
+ jQuery("#qdContainerTable").append(qdDescription);
+ }
+ catch(e)
+ {
+ console.error(e);
+ }
+ }
+
+ //Populate temporal query events description section
+ var qdDescription = this.getQueryDescription(this.queryPanelObjForPrinting.subQryStructure);
+ if(qdDescription)
+ {
+ try{
+ var Row = "<tr><td width=\"5px\"><div class=\"tabSpace\"></div></td>";
+ var Cell = "<td class=\"eventsRelHdr\">" + "All Events" + "</td>";
+ Row = Row + Cell;
+
+ if(QueryReportWin)
+ jQuery("#temporalQryEventsContainerTable",QueryReportWin.document).append(Row);
+ if(QueryReportDiv)
+ jQuery("#temporalQryEventsContainerTable").append(Row);
+
+ if(QueryReportWin)
+ jQuery("#temporalQryEventsContainerTable",QueryReportWin.document).append(qdDescription);
+ if(QueryReportDiv)
+ jQuery("#temporalQryEventsContainerTable").append(qdDescription);
+ }
+ catch(e)
+ {
+ console.error(e);
+ }
+ }
+
+ //Populate temporal query events relation section
+ if(this.queryPanelObjForPrinting.subQryStructure && this.queryPanelObjForPrinting.subQryStructure.length>0){
+ var temporalQEventsRelTable = null;
+ if(QueryReportWin)
+ temporalQEventsRelTable = QueryReportWin.document.getElementById("temporalQryEventsRelationsTable");
+ if(QueryReportDiv)
+ temporalQEventsRelTable = $("temporalQryEventsRelationsTable");
+
+ try{
+ var qdDescription = this.getTemporalQueryEventRelations(temporalQEventsRelTable);
+ }
+ catch(e)
+ {
+ console.error(e);
+ }
+ }
+
+ if(!previewQueryOnly){
+ //Populate the query results section
+ var resultsArray = i2b2.CRC.view.graphs.parseInputIntoArray(i2b2.CRC.ctrlr.currentQueryResults.resultString, true);
+ if(resultsArray && resultsArray.length>0){
+ try{
+ if(QueryReportWin)
+ this.createResultsForPrint(resultsArray,QueryReportWin);
+ else{
+ this.createResultsForPrint(resultsArray,false);
+ }
+ }
+ catch(e)
+ {
+ console.error(e);
+ }
+ }
+ else // There is no results, so no need to show Query Results section
+ {
+ var resultTitleDiv = null;
+ if(QueryReportWin)
+ resultTitleDiv = QueryReportWin.document.getElementById("qrsTitle");
+ if(QueryReportDiv)
+ resultTitleDiv = $("qrsTitle");
+
+ if(resultTitleDiv){
+ resultTitleDiv.parentNode.removeChild(resultTitleDiv);
+ }
+ }
+ }
+ else // This window is to only show the query structure preview, so no need to show Query Results section
+ {
+ var resultTitleDiv = null;
+ if(QueryReportWin)
+ resultTitleDiv = QueryReportWin.document.getElementById("qrsTitle");
+ if(QueryReportDiv)
+ resultTitleDiv = $("qrsTitle");
+
+ if(resultTitleDiv){
+ resultTitleDiv.parentNode.removeChild(resultTitleDiv);
+ }
+ }
+ var loaderDiv = null;
+ if(QueryReportWin)
+ loaderDiv = QueryReportWin.document.getElementById("QueryReportLoading");
+ if(QueryReportDiv){
+ // if(browserIsIE && printFromId)
+ loaderDiv = jQuery(QueryReportDiv).find('#QueryReportLoading');
+ // else
+ // loaderDiv = jQuery("#infoQueryStatusReport #QueryReportLoading");
+ }
+
+ if(loaderDiv)
+ jQuery(loaderDiv).addClass("no-show");
+
+ var resultsDiv = null;
+ if(QueryReportWin)
+ resultsDiv = QueryReportWin.document.getElementById("QueryReportContainer");
+ if(QueryReportDiv){
+ // if(browserIsIE && printFromId)
+ resultsDiv = jQuery(QueryReportDiv).find('#QueryReportContainer');
+ // else
+ // resultsDiv = $("#infoQueryStatusReport #QueryReportContainer");
+ }
+
+ if(resultsDiv)
+ jQuery(resultsDiv).removeClass("no-show");
+
+ if(browserIsIE && previewQueryOnly)
+ {
+ // this.PrintElem();
+ // jQuery(resultsDiv).html(savedHTML);
+ }
+ }
+ else{
+ alert("Currently no query is available for printing. \nPlease generate a query before clicking on [Print Query] button.");
+ }
+ };
+
+ this.getQueryDetails = function(queryObj,query_user_id,previewQueryOnly,QueryReportWin,objId){
+ var username = this.getQueryUserFullName(query_user_id);
+ var instanceRec = this.QI_Rec_ForPrinting;
+ var dateInfoProvided = false;
+ var diff = "";
+ var text = "";
+ var qrNameNotProvided = false;
+ if(queryObj.name.length <= 0){
+ text = 'No Query Name is currently provided';
+ qrNameNotProvided = true;
+ }
+ else{
+ if(previewQueryOnly)
+ text = 'The query is entitled "' + queryObj.name + '"';
+ else
+ text = 'The query entitled "' + queryObj.name ;
+ }
+
+ var formattedResObj = i2b2.CRC.ctrlr.currentQueryResults;
+ var resString = formattedResObj.resultString;
+ var computeTime = null;
+ if(resString.toLowerCase().indexOf("compute time")>0)
+ {
+ var textCompTime = resString.match(new RegExp("Compute Time" + "(.*)" + "\n"));
+ if(textCompTime.length>0)
+ {
+ var compText = textCompTime[0];
+ var splitcompText = compText.split(":");
+ if(splitcompText && splitcompText.length>1)
+ computeTime = splitcompText[1];
+ }
+ }
+
+ text = (qrNameNotProvided ? 'The query "' : '') + text +
+ ' was completed in '+ computeTime + '. This query was performed by "'+ username +".";
+
+ if(QueryReportWin)
+ jQuery("#" + objId,QueryReportWin.document).append('<tr><td>' + text.toString() + '</td></tr>');
+ else
+ jQuery("#" + objId).append('<tr><td>' + text.toString() + '</td></tr>');
+ };
+
+ this.getQrTiming = function(queryObj,QueryReportWin,objId){
+ var tdText = "";
+ if(queryObj.timing)
+ {
+ switch(queryObj.timing)
+ {
+ case "ANY":
+ tdText = " Temporal Constraint: Treat All Groups Independently";
+ break;
+ case "SAMEVISIT":
+ tdText = " Temporal Constraint: Selected groups occur in the same financial encounter";
+ break;
+ case "TEMPORAL": //Temporal query
+ query_order = "Groups occur in the same sequence from left to right";
+ tdText = " Temporal Constraint: Population in which events occur";
+ }
+ if(QueryReportWin)
+ jQuery("#" + objId,QueryReportWin.document).append('<tr><td>' + tdText + '</td></tr>');
+ else
+ jQuery("#" + objId).append('<tr><td>' + tdText + '</td></tr>');
+ }
+ };
+
+ this.getQueryDescription = function(queryObj) {
+ var elemToAppend = "";
+
+ if(queryObj.length > 0)
+ {
+ elemToAppend = "<tr>";
+ var panelNum = 0;
+ elemToAppend = elemToAppend + "<td width=\"5px\"><div class=\"tabSpace\"></div></td>";
+
+ var tdObj = "<td width=\"610px\">";
+
+ queryObj.each(function(queryData){
+ var andCounter = 0;
+ var subQryEventNameDisplayed = false;
+ queryData.each(function(panelData){
+ var orCounter = 0;
+ var numItemsInPanel = panelData.items.length;
+
+ var panelContdivObj = "<div class=\"panelContainer";
+ var PanelTableObj = "<table width=\"615px\" border=\"0\">";
+ var PanelTableTrObj = "<tr>";
+ var PanelTableTd1Obj = "<td width=\"5px\"><div class=\"tabSpace\"></div></td>";
+ PanelTableTrObj = PanelTableTrObj + PanelTableTd1Obj;
+ var PanelTableTd2Obj = "<td width=\"610px\">";
+ panelNum++ ;
+ var panelOperatorDivId = "PanelOp-" + panelNum;
+ var panelOperatorDiv = "<div id=\"" + panelOperatorDivId + "\" class=\"opDiv\">";
+ if(andCounter == 0){
+ andCounter++ ;
+ if (panelData.exclude)
+ {
+ panelOperatorDiv = panelOperatorDiv + "NOT";
+ panelContdivObj = panelContdivObj + " notOpPanel";
+ }
+ }
+ else
+ {
+ var text = "AND";
+ if (panelData.exclude)
+ {
+ text = "AND NOT";
+ panelContdivObj = panelContdivObj + " notOpPanel";
+ }
+ panelOperatorDiv = panelOperatorDiv + text;
+ andCounter++ ;
+ }
+ var panelItemDiv = "<div class=\"panelItem\">";
+
+ var panelTiming = "";
+ switch(panelData.timing)
+ {
+ case "ANY":
+ panelTiming = "Independent of Visit";
+ break;
+ case "SAMEVISIT":
+ panelTiming = "Occurs in Same Encounter";
+ break;
+ case "SAMEINSTANCENUM":
+ panelTiming = "Items Instance will be the same";
+ break;
+ }
+
+ var panelDateFrom = "";
+ if(panelData.dateFrom)
+ {
+ if(panelData.dateFrom.Month && panelData.dateFrom.Day && panelData.dateFrom.Year)
+ panelDateFrom = panelData.dateFrom.Month + "/" + panelData.dateFrom.Day + "/" + panelData.dateFrom.Year;
+ else
+ {
+ panelDateFrom = panelData.dateFrom;
+ }
+ }
+
+ var panelDateTo = "";
+ if(panelData.dateTo)
+ {
+ if(panelData.dateTo.Month && panelData.dateTo.Day && panelData.dateTo.Year)
+ panelDateTo = panelData.dateTo.Month + "/" + panelData.dateTo.Day + "/" + panelData.dateTo.Year;
+ else
+ {
+ panelDateTo = panelData.dateTo;
+ }
+ }
+
+ var panelDateRangeText = "From earliest date available to latest date available";
+ if(panelData.dateFrom && panelData.dateTo)
+ {
+ if(panelDateFrom == "none")
+ panelDateFrom = "earliest date available";
+ if(panelDateTo == "none")
+ panelDateTo = "latest date available";
+ panelDateRangeText = "From " + panelDateFrom + " to " + panelDateTo;
+ }
+ else
+ {
+ if(panelDateFrom == "none")
+ panelDateFrom = "earliest date available";
+ if(panelDateTo == "none")
+ panelDateTo = "latest date available";
+ if(panelData.dateFrom && !panelData.dateTo)
+ panelDateRangeText = "From " + panelDateFrom + " to latest date available";
+
+ if(!panelData.dateFrom && panelData.dateTo)
+ panelDateRangeText = "From earliest date available to " + panelDateTo;
+ }
+
+ var panelItemOccurrenceText = "# of times an item is recorded is > " + panelData.occurs;
+
+ panelData.items.each(function(itemData){
+ var data = itemData;
+ if(!(typeof itemData.origData == 'undefined'))
+ data = itemData.origData;
+ var qrPanelItemTableObj = "<table class=\"qrPanelItemTable\">";
+ var qrPanelItemTableTrObj = "<tr>";
+ var imageObj = null;
+
+ //Evaluate the lab values
+ var str_lab_values = "";
+ if(data.LabValues){
+ var v_lab_values = data.LabValues;
+
+ if(v_lab_values.GeneralValueType == "NUMBER") {
+ var labOp = "";
+ switch(v_lab_values.NumericOp)
+ {
+ case "LT":
+ labOp = " <";
+ break;
+ case "LE":
+ labOp = " <=";
+ break;
+ case "EQ":
+ labOp = " =";
+ break;
+ case "BETWEEN":
+ labOp = " Between";
+ break;
+ case "GE":
+ labOp = " >=";
+ break;
+ case "GT":
+ labOp = " >";
+ break;
+ }
+ str_lab_values =
+ labOp +" ";
+
+ if((v_lab_values.ValueLow != null) ||
+ (v_lab_values.ValueLow != undefined)
+ ){
+ str_lab_values +=
+ v_lab_values.ValueLow + " - "+
+ v_lab_values.ValueHigh;
+ } else {
+ str_lab_values +=
+ v_lab_values.Value;
+ }
+ str_lab_values += " "+ v_lab_values.UnitsCtrl;
+ }
+ //String
+ else if((v_lab_values.ValueString != null) ||
+ (v_lab_values.ValueString != undefined)
+ ){
+ str_lab_values =
+ "By String: "+
+ v_lab_values.ValueString;
+ }
+ //Flag
+ else if((v_lab_values.ValueFlag != null) ||
+ (v_lab_values.ValueFlag != undefined)
+ ){
+ var v_flag = "Normal";
+ if(v_lab_values.ValueFlag == "H"){
+ v_flag = "High";
+ }
+ else if(v_lab_values.ValueFlag == "L"){
+ v_flag = "Low";
+ }
+
+ str_lab_values =
+ "By Flag: "+ v_flag;
+ }
+ // End evaluate lab values
+ }
+ if(data.hasChildren) //It is a previous query inside a query, so no item-icon provided
+ {
+ if( data.hasChildren.indexOf("LA") >=0 )
+ {
+ imageObj = "<img src=\"js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_leaf.gif\" style=\"float:left;margin-top:5px;margin-right:5px;\">";
+ }
+ else
+ {
+ imageObj = "<img src=\"js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_branch-exp.gif\" style=\"float:left;margin-top: 5px;margin-right: 5px;\">";
+ }
+ }
+ if(imageObj)
+ {
+ var nameText = "";
+ if(data.newName)
+ nameText = data.newName;
+ else
+ nameText = data.name;
+ var qrPanelItemTableTdObj = "<td width=\"610px\" style=\"font-weight:bold; font-size:18px;\"><div width=\"400px\" style=\"display:inline;\">" + imageObj + "<div>" + " " + nameText + str_lab_values + "</div></div>" + "</td>";
+ }
+ else
+ {
+ var qrPanelItemTableTdObj = "<td width=\"610px\" style=\"font-weight:bold; font-size:18px;\">" + data.name + str_lab_values + "</td>";
+ }
+
+
+ qrPanelItemTableTrObj = qrPanelItemTableTrObj + qrPanelItemTableTdObj;
+ qrPanelItemTableObj = qrPanelItemTableObj + qrPanelItemTableTrObj + "</tr>";
+
+ qrPanelItemTableTrObj = "<tr>";
+ qrPanelItemTableTdObj = "<td width=\"610px\" style=\"font-weight:bold; font-size:14px;\">" + data.tooltip + "</td>";
+ qrPanelItemTableTrObj = qrPanelItemTableTrObj + qrPanelItemTableTdObj + "</tr>";
+ qrPanelItemTableObj = qrPanelItemTableObj + qrPanelItemTableTrObj;
+
+ qrPanelItemTableTrObj = "<tr>";
+ qrPanelItemTableTdObj = "<td width=\"610px\" style=\"font-size:14px;\">" + panelTiming + "</td>" ;
+ qrPanelItemTableTrObj = qrPanelItemTableTrObj + qrPanelItemTableTdObj + "</tr>";
+ qrPanelItemTableObj = qrPanelItemTableObj + qrPanelItemTableTrObj;
+
+ qrPanelItemTableTrObj = "<tr>";
+ qrPanelItemTableTdObj = "<td width=\"610px\" style=\"font-size:14px;\">" + panelDateRangeText + "</td>" ;
+ qrPanelItemTableTrObj = qrPanelItemTableTrObj + qrPanelItemTableTdObj + "</tr>";
+ qrPanelItemTableObj = qrPanelItemTableObj + qrPanelItemTableTrObj;
+
+ qrPanelItemTableTrObj = "<tr>";
+ qrPanelItemTableTdObj = "<td width=\"610px\" style=\"font-size:14px;\">" + panelItemOccurrenceText + "</td>" ;
+ qrPanelItemTableTrObj = qrPanelItemTableTrObj + qrPanelItemTableTdObj + "</tr>";
+ qrPanelItemTableObj = qrPanelItemTableObj + qrPanelItemTableTrObj;
+
+ qrPanelItemTableObj = qrPanelItemTableObj + "</table>";
+ panelItemDiv = panelItemDiv + "<br>" + qrPanelItemTableObj + "<br>";
+
+ if(++orCounter < numItemsInPanel)
+ {
+ var orDiv = "<div style=\"font-size: 20px;font-style: italic;font-weight: bold;\">" + "OR" + "</div>";
+ panelItemDiv = panelItemDiv + orDiv;
+ }
+
+ });
+ panelItemDiv = panelItemDiv + "</div>";
+ PanelTableTd2Obj = PanelTableTd2Obj + panelItemDiv + "</td>";
+ PanelTableTrObj = PanelTableTrObj + PanelTableTd2Obj + "</tr>";
+ PanelTableObj = PanelTableObj + PanelTableTrObj + "</table>";
+ panelContdivObj = panelContdivObj + "\">" + PanelTableObj + "</div>";
+
+ panelOperatorDiv = panelOperatorDiv + "</div>";
+ if(panelData.subquery)
+ {
+ if(!subQryEventNameDisplayed){
+ var eventNameDiv = "<div class=\"opDiv\">" + panelData.name + "</div>";
+ tdObj = tdObj + eventNameDiv + panelOperatorDiv + panelContdivObj;
+ subQryEventNameDisplayed = true;
+ }
+ else
+ tdObj = tdObj + panelOperatorDiv + panelContdivObj;
+ }
+ else
+ tdObj = tdObj + panelOperatorDiv + panelContdivObj;
+
+ });
+ });
+ }
+ if(elemToAppend)
+ elemToAppend = elemToAppend + tdObj + "</td></tr>";
+ return elemToAppend;
+ };
+
+ this.getTemporalQueryEventRelations = function(eventsRelTable){
+ if(this.queryPanelObjForPrinting.subQryRelationStructure.length > 0 )
+ {
+ var Row = new Element('tr');
+ var Cell = new Element('td',{'width':'5px'});
+ var divInCell = new Element('div',{'class':'tabSpace'});
+ Row.insert(Cell.insert(divInCell));
+ Cell = new Element('td',{'class':'eventsRelHdr'}).update('Order of Events');
+ Row.insert(Cell);
+ var tempDiv = new Element('div');
+ tempDiv.insert(Row);
+ jQuery(eventsRelTable).append(jQuery(tempDiv).html());
+ }
+
+ this.queryPanelObjForPrinting.subQryRelationStructure.each(function(relation){
+ var Row = new Element('tr');
+ var Cell = new Element('td',{'width':'5px'});
+ var divInCell = new Element('div',{'class':'tabSpace'});
+ Row.insert(Cell.insert(divInCell));
+
+ Cell = new Element('td', {'class' : 'eventsRel'});
+ var mnSpan = new Element('span', {'class' : 'eventsRelSpan'});
+ var mainSpan = new Element('center');
+ var textFirst = relation.firstQryJoinCol + " " + relation.firstQryOp + " occurrence for " + relation.firstQryEvntNm;
+ var firstSpan = new Element('span').update(textFirst);
+ mainSpan.insert(firstSpan).insert(new Element('br'));
+ var relationOperator = "";
+ switch(relation.operator)
+ {
+ case "LESS":
+ relationOperator = "Occurs Before";
+ break;
+ case "LESSEQUAL":
+ relationOperator = "Occurs On Or Before";
+ break;
+ case "EQUAL":
+ relationOperator = "Occurs Simultaneously With";
+ break;
+ case "GREATER":
+ relationOperator = "Occurs After";
+ break;
+ case "GREATEREQUAL":
+ relationOperator = "Occurs On or After";
+ break;
+ default:
+ break;
+ }
+ var textOperator = relationOperator.length>0 ? relationOperator : relation.operator;
+ var opSpan = new Element('span').update(textOperator);
+ mainSpan.insert(opSpan).insert(new Element('br'));
+ var textSecond = relation.secondQryJoinCol + " of " + relation.secondQryOp + " occurrence of " + relation.secondQryEvntNm;
+ var secondSpan = new Element('span').update(textSecond);
+ mainSpan.insert(secondSpan).insert(new Element('br'));
+
+ var firstSpan = true;
+ relation.spans.each(function(thisSpan){
+ switch(thisSpan.oprator)
+ {
+ case "GREATER" :
+ thisSpan.oprator = ">";
+ break;
+ case "GREATEREQUAL" :
+ thisSpan.oprator = ">=";
+ break;
+ case "EQUAL" :
+ thisSpan.oprator = "=";
+ break;
+ case "LESSEQUAL" :
+ thisSpan.oprator = "<=";
+ break;
+ case "LESS" :
+ thisSpan.oprator = "<";
+ break;
+ default:
+ break;
+ }
+ var text = "";
+ if(firstSpan)
+ {
+ text = " By " + thisSpan.oprator + " " + thisSpan.value + " " + thisSpan.units;
+ firstSpan = false;
+ }
+ else
+ {
+ text = " And " + thisSpan.oprator + " " + thisSpan.value + " " + thisSpan.units;
+ }
+ mainSpan.insert((new Element('span')).update(text)).insert(new Element('br'));
+ });
+ mnSpan.insert(mainSpan);
+ Row.insert((Cell).insert(mnSpan));
+ var tempDiv = new Element('div');
+ tempDiv.insert(Row);
+ jQuery(eventsRelTable).append(jQuery(tempDiv).html());
+ });
+ };
+
+ this.createResultsForPrint = function(dataArray,child){
+ var _2DResultsArray = i2b2.CRC.view.downloadData.getFormattedResults(dataArray);
+ if(_2DResultsArray && _2DResultsArray.length>0)
+ {
+ //Populate the tables
+ var clonedArray = _2DResultsArray.slice(0);
+ var allSites = $H();
+ var allSitesRow = clonedArray[0];
+ if(allSitesRow && allSitesRow.length>0)
+ {
+ for(var x = 1; x < allSitesRow.length ; x++)
+ {
+ var siteName = allSitesRow[x];
+ allSites.set(siteName,x); //SiteName,Index pairs
+ }
+ }
+ clonedArray = _2DResultsArray.slice(0);
+ var allUniqueBreakDowns = $H();
+ for(var i = 0 ; i < clonedArray.length ; i++)
+ {
+ var brkDownEntry = clonedArray[i][0];
+ if(brkDownEntry.length>0)
+ {
+ var tmpBrkDown = brkDownEntry.split("|");
+ if(tmpBrkDown && tmpBrkDown.length>1)
+ {
+ thisBrkDown = tmpBrkDown[0];
+ allUniqueBreakDowns.set(thisBrkDown,thisBrkDown);
+ }
+ }
+ }
+
+ //Take care of the patient number element separately
+ //Create the data array for table creation
+ clonedArray = _2DResultsArray.slice(0);
+ var dataArray = new Array();
+
+ var thisRow = clonedArray[0].slice(0);
+ thisRow[0] = "";
+ dataArray.push(thisRow);
+ thisRow = clonedArray[1].slice(0);
+ thisRow[0] = "Total Patients Count";
+ dataArray.push(thisRow);
+
+ if(dataArray && dataArray.length>0)
+ {
+ jQuery('#tablesContainer').append("<br/>");
+ jQuery('#tablesContainer').append("<div class='subTitleDivs'>Total Number of Cases</div>" );
+ this.createTable(dataArray);
+ }
+ //Create tables for the breakdowns
+ allUniqueBreakDowns.each(function(brkDown)
+ {
+ clonedArray = _2DResultsArray.slice(0);
+ dataArray = new Array();
+ var thisRow = _2DResultsArray[0].slice(0);
+ thisRow[0] = "";
+ dataArray.push(thisRow);
+ var category = "";
+ for(var i = 1; i<clonedArray.length;i++)
+ {
+ var thisbrkDown = clonedArray[i][0];
+ if(thisbrkDown.toLowerCase().indexOf(brkDown.key.toLowerCase())>=0)
+ {
+ thisRow = clonedArray[i];
+ var tmpBrkDown = thisbrkDown.split("|");
+ if(tmpBrkDown && tmpBrkDown.length>1)
+ {
+ category = tmpBrkDown[0];
+ thisRow[0][0] = tmpBrkDown[1];
+ }
+ dataArray.push(thisRow);
+ }
+ }
+
+ if(dataArray && dataArray.length>0)
+ {
+ jQuery('#tablesContainer').append("<br/>");
+ jQuery('#tablesContainer').append("<div class='subTitleDivs'>Total Unique Patients by" + category +"</div>" );
+ i2b2.CRC.ctrlr.QT.createTable(dataArray);
+ }
+ });
+
+ //Populate charts
+ jQuery('#tablesContainer').append("<br/><br/>");
+ i2b2.CRC.view.graphs.createGraphs("graphsContainer", i2b2.CRC.ctrlr.currentQueryResults.resultString, true);
+ }
+ };
+
+ this.createTable = function(dataArray)
+ {
+ var content = "<table class='reultsTable'>";
+ for(var i = 0 ; i < dataArray.length ; i++)
+ {
+ var thisRow = dataArray[i];
+ if(i==0)
+ {
+ content += "<tr>";
+ for(var j = 0 ; j < thisRow.length ; j++)
+ {
+ content += "<th class='descResultshead'>" + thisRow[j] + "</th>";
+ }
+ content += "</tr>";
+ }
+ else
+ {
+ content += "<tr>";
+
+ for(var j = 0 ; j < thisRow.length ; j++)
+ {
+ var thisRowColItem = thisRow[j];
+ if(thisRowColItem)
+ {
+ if((thisRowColItem.trim().indexOf("10 patients or fewer"))>0)
+ thisRowColItem = 0;
+ if(i==0 && j==0)
+ content += "<td class='descResults'>&nbsp;</td>";
+ else{
+ if(thisRowColItem==' ')
+ content += "<td class='descResults'>&nbsp;</td>";
+ else
+ content += "<td class='descResults'>" + thisRowColItem + "</td>";
+ }
+ }
+ else
+ content += "<td class='descResults'>&nbsp;</td>";
+ }
+ content += "</tr>";
+ }
+ }
+
+ content += "</table>";
+
+ jQuery('#tablesContainer').append(content);
+ }
+
+ this.getQueryUserFullName = function(query_user_id)
+ {
+ var returnValue = query_user_id;
+ if(query_user_id)
+ {
+ try {
+ var response = i2b2.PM.ajax.getUser("CRC:PrintQueryNew", {user_id:query_user_id});
+ response.parse();
+ var data = response.model[0];
+ if (data.full_name) { returnValue = data.full_name;}
+ }
+ catch (e) {}
+ }
+ return returnValue;
+ };
+
+ function getSelectedValueFromOptions(options)
+ {
+ var value = null;
+ for(k = 0; k < options.length; k++) {
+ var thisOption = options[k];
+ if(thisOption.selected == true)
+ {
+ value = options[k].innerHTML;
+ break;
+ }
+ }
+ return value;
+ };
+
+ this.PrintElem = function(divIdToPrint)
+ {
+ // Popup(jQuery("#" + divToPrint).html());
+ if(jQuery("#" + divIdToPrint)){
+ var contents = jQuery("#" + divIdToPrint).html();
+ var frame1 = jQuery("<iframe />");
+ frame1[0].name = "frame1";
+ frame1.css({ "position": "absolute", "top": "-1000000px" });
+ jQuery("body").append(frame1);
+ var frameDoc = frame1[0].contentWindow ? frame1[0].contentWindow : frame1[0].contentDocument.document ? frame1[0].contentDocument.document : frame1[0].contentDocument;
+ frameDoc.document.open();
+ //Create a new HTML document.
+ frameDoc.document.write("<html><head><title>Query Report</title>");
+ //Append the external CSS file.
+ frameDoc.document.write("<link rel=\"stylesheet\" href=\"js-i2b2/cells/CRC/assets/query_report.css\">");
+ frameDoc.document.write('<link href=\'js-ext/c3code/c3.css\' rel=\'stylesheet\' type=\'text/css\'></head><body>');
+ frameDoc.document.write("</head><body>");
+ //Append the DIV contents.
+ frameDoc.document.write(contents);
+ frameDoc.document.write('</body></html>');
+ frameDoc.document.close();
+
+ setTimeout(function () {
+ window.frames["frame1"].focus();
+ window.frames["frame1"].print();
+ frame1.remove();
+ }, 500);
+ }
+ else
+ alert("Query report can't be printed!");
+ };
+
+/**********************
+* End Query Report BG
+**********************/
}
console.timeEnd('execute time');
console.groupEnd();
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_ENS.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_ENS.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PR.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PR.js
old mode 100755
new mode 100644
index 7bd6737ae..ab2d1aaf5
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PR.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PR.js
@@ -1,310 +1,310 @@
-/**
- * @projectDescription The SDX controller library for the PatientRecord data-type.
- * @namespace i2b2.sdx.TypeControllers.PR
- * @inherits i2b2.sdx.TypeControllers
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * @see i2b2.sdx
- * ----------------------------------------------------------------------------------------
- * updated 9-15-08: RC4 launch [Nick Benik]
- */
-console.group('Load & Execute component file: CRC > SDX > Patient Record');
-console.time('execute time');
-
-
-i2b2.sdx.TypeControllers.PR = {};
-i2b2.sdx.TypeControllers.PR.model = {};
-// *********************************************************************************
-// ENCAPSULATE DATA
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.getEncapsulateInfo = function() {
- // this function returns the encapsulation head information
- return {sdxType: 'PR', sdxKeyName: 'patient_id', sdxControlCell:'CRC', sdxDisplayNameKey: 'title'};
-}
-
-i2b2.sdx.TypeControllers.PR.SaveToDataModel = function(sdxData, sdxParentNode) {
- // do not save save to CRC data model because of sheer
- if (!sdxParentNode) { return false; }
- var pr_id = sdxData.sdxInfo.sdxKeyValue;
- var pr_hash = i2b2.sdx.Master._KeyHash(pr_id);
-
- // class for all SDX communications
- function i2b2_SDX_Encapsulation_EXTENDED() {}
- // create an instance and populate with info
- var t = new i2b2_SDX_Encapsulation_EXTENDED();
- t.origData = Object.clone(sdxData.origData);
- t.sdxInfo = Object.clone(sdxData.sdxInfo);
- t.parent = sdxParentNode;
- t.children = new Hash();
- t.children.loaded = false;
- // add to hash
- sdxParentNode.children.set(pr_hash, t);
- // TODO: send data update signal (use JOINING-MUTEX or AGGREGATING-MUTEX to avoid rapid fire of event!)
- return t;
-}
-
-
-i2b2.sdx.TypeControllers.PR.LoadFromDataModel = function(key_value) {}
-
-
-i2b2.sdx.TypeControllers.PR.ClearAllFromDataModel= function(sdxOptionalParent) {
- // never called
- return true;
-}
-
-
-// *********************************************************************************
-// GENERATE HTML (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.RenderHTML= function(sdxData, options, targetDiv) {
- // OPTIONS:
- // title: string
- // showchildren: true | false
- // cssClass: string
- // icon: [data object]
- // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // dragdrop: string (function name)
- // context: string
- // click: string
- // dblclick: string
-
- if (Object.isUndefined(options)) { options = {}; }
- var render = {html: retHtml, htmlID: id};
- var id = "CRC_ID-" + i2b2.GUID();
-
- // process drag drop controllers
- if (!Object.isUndefined(options.dragdrop)) {
-// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
-// This would ensure removal of the onmouseover call in a cross-browser way
- var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
- } else {
- var sDD = '';
- }
-
- if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultPR';}
-
- // user can override
- bCanExp = true;
- if (Object.isBoolean(options.showchildren)) {
- bCanExp = options.showchildren;
- }
- render.canExpand = bCanExp;
- render.iconType = "PR";
-
- if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
- if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
- // in cases of one set icon, copy valid icon to the missing icon
- if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
- if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
-
- // handle the event controllers
- var sMainEvents = sDD;
- var sImgEvents = sDD;
-
- // **** Render the HTML ***
- var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
- retHtml += '<DIV ';
- if (Object.isString(options.cssClass)) {
- retHtml += ' class="'+options.cssClass+'" ';
- } else {
- retHtml += ' class= "sdxDefaultPR" ';
- }
- retHtml += sImgEvents;
- retHtml += '>';
- retHtml += '<IMG src="'+render.icon+'"/> ';
- if (!Object.isUndefined(options.title)) {
- retHtml += options.title;
- } else {
- console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > PR node!');
- retHtml += ' PR '+id;
- }
- retHtml += '</DIV></DIV>';
- render.html = retHtml;
- render.htmlID = id;
- var retObj = {};
- Object.extend(retObj, sdxData);
- retObj.renderData = render;
- return retObj;
-}
-
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.onHoverOver = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.addClassName(el,'ddPRTarget'); }
-}
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.onHoverOut = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.removeClassName(el,'ddPRTarget'); }
-}
-
-
-// *********************************************************************************
-// ADD DATA TO TREENODE (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
- var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
- var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
- if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
- // add the callback to load child nodes
- sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
- }
- tmpNode.data.i2b2_SDX= sdxDataPack;
- tmpNode.toggle = function() {
- if (!this.tree.locked && ( this.hasChildren(true) ) ) {
- var data = this.data.i2b2_SDX.renderData;
- var img = this.getContentEl();
- img = Element.select(img,'img')[0];
- if (this.expanded) {
- img.src = data.icon;
- this.collapse();
- } else {
- img.src = data.iconExp;
- this.expand();
- }
- }
- };
- if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
- return tmpNode;
-}
-
-
-// *********************************************************************************
-// ATTACH DRAG TO DATA (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.AttachDrag2Data = function(divParentID, divDataID){
- if (Object.isUndefined($(divDataID))) { return false; }
-
- // get the i2b2 data from the yuiTree node
- var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
- var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
- if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
-
- // attach DD
- var t = new i2b2.sdx.TypeControllers.PR.DragDrop(divDataID)
- t.yuiTree = tvTree;
- t.yuiTreeNode = tvNode;
- tvNode.DDProxy = t;
-
- // clear the mouseover attachment function
- var tdn = $(divDataID);
- if (!Object.isUndefined(tdn.onmouseover)) {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- if (!Object.isUndefined(tdn.attributes)) {
- for (var i=0;i<tdn.attributes.length; i++) {
- if (tdn.attributes[i].name=="onmouseover") {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- }
- }
-}
-
-
-
-
-// *********************************************************************************
-// DRAG DROP PROXY CONTROLLER
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.DragDrop = function(id, config) {
- if (id) {
- this.init(id, 'PR',{isTarget:false});
- this.initFrame();
- }
- var s = this.getDragEl().style;
- s.borderColor = "transparent";
- s.opacity = 0.75;
- s.filter = "alpha(opacity=75)";
- s.whiteSpace = "nowrap";
- s.overflow = "hidden";
- s.textOverflow = "ellipsis";
-};
-YAHOO.extend(i2b2.sdx.TypeControllers.PR.DragDrop, YAHOO.util.DDProxy);
-i2b2.sdx.TypeControllers.PR.DragDrop.prototype.startDrag = function(x, y) {
- var dragEl = this.getDragEl();
- var clickEl = this.getEl();
- dragEl.innerHTML = clickEl.innerHTML;
- dragEl.className = clickEl.className;
- dragEl.style.backgroundColor = '#FFFFEE';
- dragEl.style.color = clickEl.style.color;
- dragEl.style.border = "1px solid blue";
- dragEl.style.width = "160px";
- dragEl.style.height = "20px";
- this.setDelta(15,10);
-};
-i2b2.sdx.TypeControllers.PR.DragDrop.prototype.endDrag = function(e) {
- // remove DragDrop targeting CCS
- var targets = YAHOO.util.DDM.getRelated(this, true);
- for (var i=0; i<targets.length; i++) {
- var targetEl = targets[i]._domRef;
- i2b2.sdx.Master.onHoverOut('PR', e, targetEl, this);
- }
-};
-i2b2.sdx.TypeControllers.PR.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
- var oCoord = this.getTargetCoord(iPageX, iPageY);
- if (!this.deltaSetXY) {
- var aCoord = [oCoord.x, oCoord.y];
- YAHOO.util.Dom.setXY(el, aCoord);
- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
- } else {
- var posX = (oCoord.x + this.deltaSetXY[0]);
- var posY = (oCoord.y + this.deltaSetXY[1]);
- var scrSize = document.viewport.getDimensions();
- var maxX = parseInt(scrSize.width-25-160);
- var maxY = parseInt(scrSize.height-25);
- if (posX > maxX) {posX = maxX;}
- if (posX < 6) {posX = 6;}
- if (posY > maxY) {posY = maxY;}
- if (posY < 6) {posY = 6;}
- YAHOO.util.Dom.setStyle(el, "left", posX + "px");
- YAHOO.util.Dom.setStyle(el, "top", posY + "px");
- }
- this.cachePosition(oCoord.x, oCoord.y);
- this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
-};
-i2b2.sdx.TypeControllers.PR.DragDrop.prototype.onDragOver = function(e, id) {
- // fire the onHoverOver (use SDX so targets can override default event handler)
- i2b2.sdx.Master.onHoverOver('PR', e, id, this);
-};
-i2b2.sdx.TypeControllers.PR.DragDrop.prototype.onDragOut = function(e, id) {
- // fire the onHoverOut handler (use SDX so targets can override default event handlers)
- i2b2.sdx.Master.onHoverOut('PR', e, id, this);
-};
-i2b2.sdx.TypeControllers.PR.DragDrop.prototype.onDragDrop = function(e, id) {
- i2b2.sdx.Master.onHoverOut('PR', e, id, this);
- // retreive the concept data from the dragged element
- draggedData = this.yuiTreeNode.data.i2b2_SDX;
- i2b2.sdx.Master.ProcessDrop(draggedData, id);
-};
-
-
-
-// *********************************************************************************
-// <BLANK> DROP HANDLER
-// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
-// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PR.DropHandler = function(sdxData) {
- alert('[PatientRecord DROPPED] You need to create your own custom drop event handler.');
-}
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription The SDX controller library for the PatientRecord data-type.
+ * @namespace i2b2.sdx.TypeControllers.PR
+ * @inherits i2b2.sdx.TypeControllers
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * @see i2b2.sdx
+ * ----------------------------------------------------------------------------------------
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: CRC > SDX > Patient Record');
+console.time('execute time');
+
+
+i2b2.sdx.TypeControllers.PR = {};
+i2b2.sdx.TypeControllers.PR.model = {};
+// *********************************************************************************
+// ENCAPSULATE DATA
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.getEncapsulateInfo = function() {
+ // this function returns the encapsulation head information
+ return {sdxType: 'PR', sdxKeyName: 'patient_id', sdxControlCell:'CRC', sdxDisplayNameKey: 'title'};
+}
+
+i2b2.sdx.TypeControllers.PR.SaveToDataModel = function(sdxData, sdxParentNode) {
+ // do not save save to CRC data model because of sheer
+ if (!sdxParentNode) { return false; }
+ var pr_id = sdxData.sdxInfo.sdxKeyValue;
+ var pr_hash = i2b2.sdx.Master._KeyHash(pr_id);
+
+ // class for all SDX communications
+ function i2b2_SDX_Encapsulation_EXTENDED() {}
+ // create an instance and populate with info
+ var t = new i2b2_SDX_Encapsulation_EXTENDED();
+ t.origData = Object.clone(sdxData.origData);
+ t.sdxInfo = Object.clone(sdxData.sdxInfo);
+ t.parent = sdxParentNode;
+ t.children = new Hash();
+ t.children.loaded = false;
+ // add to hash
+ sdxParentNode.children.set(pr_hash, t);
+ // TODO: send data update signal (use JOINING-MUTEX or AGGREGATING-MUTEX to avoid rapid fire of event!)
+ return t;
+}
+
+
+i2b2.sdx.TypeControllers.PR.LoadFromDataModel = function(key_value) {}
+
+
+i2b2.sdx.TypeControllers.PR.ClearAllFromDataModel= function(sdxOptionalParent) {
+ // never called
+ return true;
+}
+
+
+// *********************************************************************************
+// GENERATE HTML (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.RenderHTML= function(sdxData, options, targetDiv) {
+ // OPTIONS:
+ // title: string
+ // showchildren: true | false
+ // cssClass: string
+ // icon: [data object]
+ // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // dragdrop: string (function name)
+ // context: string
+ // click: string
+ // dblclick: string
+
+ if (Object.isUndefined(options)) { options = {}; }
+ var render = {html: retHtml, htmlID: id};
+ var id = "CRC_ID-" + i2b2.GUID();
+
+ // process drag drop controllers
+ if (!Object.isUndefined(options.dragdrop)) {
+// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
+// This would ensure removal of the onmouseover call in a cross-browser way
+ var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
+ } else {
+ var sDD = '';
+ }
+
+ if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultPR';}
+
+ // user can override
+ bCanExp = true;
+ if (Object.isBoolean(options.showchildren)) {
+ bCanExp = options.showchildren;
+ }
+ render.canExpand = bCanExp;
+ render.iconType = "PR";
+
+ if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
+ if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
+ // in cases of one set icon, copy valid icon to the missing icon
+ if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
+ if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
+
+ // handle the event controllers
+ var sMainEvents = sDD;
+ var sImgEvents = sDD;
+
+ // **** Render the HTML ***
+ var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
+ retHtml += '<DIV ';
+ if (Object.isString(options.cssClass)) {
+ retHtml += ' class="'+options.cssClass+'" ';
+ } else {
+ retHtml += ' class= "sdxDefaultPR" ';
+ }
+ retHtml += sImgEvents;
+ retHtml += '>';
+ retHtml += '<IMG src="'+render.icon+'"/> ';
+ if (!Object.isUndefined(options.title)) {
+ retHtml += options.title;
+ } else {
+ console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > PR node!');
+ retHtml += ' PR '+id;
+ }
+ retHtml += '</DIV></DIV>';
+ render.html = retHtml;
+ render.htmlID = id;
+ var retObj = {};
+ Object.extend(retObj, sdxData);
+ retObj.renderData = render;
+ return retObj;
+}
+
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.onHoverOver = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.addClassName(el,'ddPRTarget'); }
+}
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.onHoverOut = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.removeClassName(el,'ddPRTarget'); }
+}
+
+
+// *********************************************************************************
+// ADD DATA TO TREENODE (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
+ var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
+ var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
+ if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
+ // add the callback to load child nodes
+ sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
+ }
+ tmpNode.data.i2b2_SDX= sdxDataPack;
+ tmpNode.toggle = function() {
+ if (!this.tree.locked && ( this.hasChildren(true) ) ) {
+ var data = this.data.i2b2_SDX.renderData;
+ var img = this.getContentEl();
+ img = Element.select(img,'img')[0];
+ if (this.expanded) {
+ img.src = data.icon;
+ this.collapse();
+ } else {
+ img.src = data.iconExp;
+ this.expand();
+ }
+ }
+ };
+ if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
+ return tmpNode;
+}
+
+
+// *********************************************************************************
+// ATTACH DRAG TO DATA (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.AttachDrag2Data = function(divParentID, divDataID){
+ if (Object.isUndefined($(divDataID))) { return false; }
+
+ // get the i2b2 data from the yuiTree node
+ var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
+ var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
+ if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
+
+ // attach DD
+ var t = new i2b2.sdx.TypeControllers.PR.DragDrop(divDataID)
+ t.yuiTree = tvTree;
+ t.yuiTreeNode = tvNode;
+ tvNode.DDProxy = t;
+
+ // clear the mouseover attachment function
+ var tdn = $(divDataID);
+ if (!Object.isUndefined(tdn.onmouseover)) {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ if (!Object.isUndefined(tdn.attributes)) {
+ for (var i=0;i<tdn.attributes.length; i++) {
+ if (tdn.attributes[i].name=="onmouseover") {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+// *********************************************************************************
+// DRAG DROP PROXY CONTROLLER
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.DragDrop = function(id, config) {
+ if (id) {
+ this.init(id, 'PR',{isTarget:false});
+ this.initFrame();
+ }
+ var s = this.getDragEl().style;
+ s.borderColor = "transparent";
+ s.opacity = 0.75;
+ s.filter = "alpha(opacity=75)";
+ s.whiteSpace = "nowrap";
+ s.overflow = "hidden";
+ s.textOverflow = "ellipsis";
+};
+YAHOO.extend(i2b2.sdx.TypeControllers.PR.DragDrop, YAHOO.util.DDProxy);
+i2b2.sdx.TypeControllers.PR.DragDrop.prototype.startDrag = function(x, y) {
+ var dragEl = this.getDragEl();
+ var clickEl = this.getEl();
+ dragEl.innerHTML = clickEl.innerHTML;
+ dragEl.className = clickEl.className;
+ dragEl.style.backgroundColor = '#FFFFEE';
+ dragEl.style.color = clickEl.style.color;
+ dragEl.style.border = "1px solid blue";
+ dragEl.style.width = "160px";
+ dragEl.style.height = "20px";
+ this.setDelta(15,10);
+};
+i2b2.sdx.TypeControllers.PR.DragDrop.prototype.endDrag = function(e) {
+ // remove DragDrop targeting CCS
+ var targets = YAHOO.util.DDM.getRelated(this, true);
+ for (var i=0; i<targets.length; i++) {
+ var targetEl = targets[i]._domRef;
+ i2b2.sdx.Master.onHoverOut('PR', e, targetEl, this);
+ }
+};
+i2b2.sdx.TypeControllers.PR.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+ var oCoord = this.getTargetCoord(iPageX, iPageY);
+ if (!this.deltaSetXY) {
+ var aCoord = [oCoord.x, oCoord.y];
+ YAHOO.util.Dom.setXY(el, aCoord);
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
+ this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+ } else {
+ var posX = (oCoord.x + this.deltaSetXY[0]);
+ var posY = (oCoord.y + this.deltaSetXY[1]);
+ var scrSize = document.viewport.getDimensions();
+ var maxX = parseInt(scrSize.width-25-160);
+ var maxY = parseInt(scrSize.height-25);
+ if (posX > maxX) {posX = maxX;}
+ if (posX < 6) {posX = 6;}
+ if (posY > maxY) {posY = maxY;}
+ if (posY < 6) {posY = 6;}
+ YAHOO.util.Dom.setStyle(el, "left", posX + "px");
+ YAHOO.util.Dom.setStyle(el, "top", posY + "px");
+ }
+ this.cachePosition(oCoord.x, oCoord.y);
+ this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+i2b2.sdx.TypeControllers.PR.DragDrop.prototype.onDragOver = function(e, id) {
+ // fire the onHoverOver (use SDX so targets can override default event handler)
+ i2b2.sdx.Master.onHoverOver('PR', e, id, this);
+};
+i2b2.sdx.TypeControllers.PR.DragDrop.prototype.onDragOut = function(e, id) {
+ // fire the onHoverOut handler (use SDX so targets can override default event handlers)
+ i2b2.sdx.Master.onHoverOut('PR', e, id, this);
+};
+i2b2.sdx.TypeControllers.PR.DragDrop.prototype.onDragDrop = function(e, id) {
+ i2b2.sdx.Master.onHoverOut('PR', e, id, this);
+ // retreive the concept data from the dragged element
+ draggedData = this.yuiTreeNode.data.i2b2_SDX;
+ i2b2.sdx.Master.ProcessDrop(draggedData, id);
+};
+
+
+
+// *********************************************************************************
+// <BLANK> DROP HANDLER
+// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
+// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PR.DropHandler = function(sdxData) {
+ alert('[PatientRecord DROPPED] You need to create your own custom drop event handler.');
+}
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PRC.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PRC.js
old mode 100755
new mode 100644
index bfcab32ef..5e2cabe27
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PRC.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PRC.js
@@ -1,335 +1,335 @@
-/**
- * @projectDescription The SDX controller library for the PatientRecordCount data-type.
- * @namespace i2b2.sdx.TypeControllers.PRC
- * @inherits i2b2.sdx.TypeControllers
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * @see i2b2.sdx
- * ----------------------------------------------------------------------------------------
- * updated 9-15-08: RC4 launch [Nick Benik]
- */
-console.group('Load & Execute component file: CRC > SDX > Patient Record Count');
-console.time('execute time');
-
-
-i2b2.sdx.TypeControllers.PRC = {};
-i2b2.sdx.TypeControllers.PRC.model = {};
-// *********************************************************************************
-// ENCAPSULATE DATA
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.getEncapsulateInfo = function() {
- // this function returns the encapsulation head information
- return {sdxType: 'PRC', sdxKeyName: 'result_instance_id', sdxControlCell:'CRC', sdxDisplayNameKey:'title'};
-}
-
-i2b2.sdx.TypeControllers.PRC.SaveToDataModel = function(sdxData, sdxParentNode) {
- // save to CRC data model
- if (!sdxParentNode) { return false; }
- var qm_id = sdxData.sdxInfo.sdxKeyValue;
- var qm_hash = i2b2.sdx.Master._KeyHash(qm_id);
-
- // class for all SDX communications
- function i2b2_SDX_Encapsulation_EXTENDED() {}
- // create an instance and populate with info
- var t = new i2b2_SDX_Encapsulation_EXTENDED();
- t.origData = Object.clone(sdxData.origData);
- t.sdxInfo = Object.clone(sdxData.sdxInfo);
- t.parent = sdxParentNode;
- t.children = new Hash();
- t.children.loaded = false;
- // add to hash
- sdxParentNode.children.set(qm_hash, t);
- // TODO: send data update signal (use JOINING-MUTEX or AGGREGATING-MUTEX to avoid rapid fire of event!)
- return t;
-}
-
-
-i2b2.sdx.TypeControllers.PRC.LoadFromDataModel = function(key_value) {}
-
-
-i2b2.sdx.TypeControllers.PRC.ClearAllFromDataModel= function(sdxOptionalParent) {
- if (sdxOptionalParent) {
- try {
- var findFunc = function(item_rec) {
- // this function expects the second argument to be the target node's key value
- var hash_key = item_rec[0];
- var QM_rec = item_rec[1];
- if (QM_rec.sdxInfo.sdxKeyValue == this.strip()) { return true; }
- }
- var dm_loc = 'i2b2.CRC.model.QueryMasters.'+i2b2.sdx.Master._KeyHash(sdxOptionalParent.sdxInfo.sdxKeyValue);
- var targets = i2b2.CRC.model.QueryMasters.findAll(findFunc, sdxOptionalParent.sdxInfo.sdxKeyValue);
- for (var i=0; i < targets.length; i++) {
- var t = parent_QM[i].value;
- t.children = new Hash();
- }
- } catch(e) { console.error('Could not clear children of given parent node!'); }
- } else {
- var dm_loc = 'i2b2.CRC.model.QueryMasters';
- i2b2.CRC.model.QueryMasters.each(function(item_rec) {
- try {
- item_rec[1].children = new Hash();
- } catch(e) { console.error('Could not clear children of all QueryMasters'); }
- });
- }
- // TODO: send data update signal (use JOINING-MUTEX or AGGREGATING-MUTEX to avoid rapid fire of event!)
- // updated dm_loc of the data model
- return true;
-}
-
-
-// *********************************************************************************
-// GENERATE HTML (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.RenderHTML= function(sdxData, options, targetDiv) {
- // OPTIONS:
- // title: string
- // showchildren: true | false
- // cssClass: string
- // icon: [data object]
- // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // dragdrop: string (function name)
- // context: string
- // click: string
- // dblclick: string
-
- if (Object.isUndefined(options)) { options = {}; }
- var render = {html: retHtml, htmlID: id};
- var conceptId = sdxData.name;
- var id = "CRC_ID-" + i2b2.GUID();
-
- // process drag drop controllers
- if (!Object.isUndefined(options.dragdrop)) {
-// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
-// This would ensure removal of the onmouseover call in a cross-browser way
- var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
- } else {
- var sDD = '';
- }
-
- if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultPRC';}
-
- // user can override
- bCanExp = true;
- if (Object.isBoolean(options.showchildren)) {
- bCanExp = options.showchildren;
- }
- render.canExpand = bCanExp;
- render.iconType = "PRC";
-
- if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
- if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
- // in cases of one set icon, copy valid icon to the missing icon
- if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
- if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
-
- // handle the event controllers
- var sMainEvents = sDD;
- var sImgEvents = sDD;
-
- // **** Render the HTML ***
- var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
- retHtml += '<DIV ';
- if (Object.isString(options.cssClass)) {
- retHtml += ' class="'+options.cssClass+'" ';
- } else {
- retHtml += ' class= "sdxDefaultPRC" ';
- }
- retHtml += sImgEvents;
- retHtml += '>';
- retHtml += '<IMG src="'+render.icon+'"/> ';
- if (!Object.isUndefined(options.title)) {
- retHtml += options.title;
- } else {
- console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > PRC node!');
- retHtml += ' PRC '+id;
- }
- retHtml += '</DIV></DIV>';
- render.html = retHtml;
- render.htmlID = id;
- var retObj = {};
- Object.extend(retObj, sdxData);
- retObj.renderData = render;
- return retObj;
-}
-
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.onHoverOver = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.addClassName(el,'ddPRCTarget'); }
-}
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.onHoverOut = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.removeClassName(el,'ddPRCTarget'); }
-}
-
-
-// *********************************************************************************
-// ADD DATA TO TREENODE (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
- var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
- var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
- if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
- // add the callback to load child nodes
- sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
- }
- tmpNode.data.i2b2_SDX= sdxDataPack;
- tmpNode.toggle = function() {
- if (!this.tree.locked && ( this.hasChildren(true) ) ) {
- var data = this.data.i2b2_SDX.renderData;
- var img = this.getContentEl();
- img = Element.select(img,'img')[0];
- if (this.expanded) {
- img.src = data.icon;
- this.collapse();
- } else {
- img.src = data.iconExp;
- this.expand();
- }
- }
- };
- if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
- return tmpNode;
-}
-
-
-// *********************************************************************************
-// ATTACH DRAG TO DATA (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.AttachDrag2Data = function(divParentID, divDataID){
- if (Object.isUndefined($(divDataID))) { return false; }
-
- // get the i2b2 data from the yuiTree node
- var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
- var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
- if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
-
- // attach DD
- var t = new i2b2.sdx.TypeControllers.PRC.DragDrop(divDataID)
- t.yuiTree = tvTree;
- t.yuiTreeNode = tvNode;
- tvNode.DDProxy = t;
-
- // clear the mouseover attachment function
- var tdn = $(divDataID);
- if (!Object.isUndefined(tdn.onmouseover)) {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- if (!Object.isUndefined(tdn.attributes)) {
- for (var i=0;i<tdn.attributes.length; i++) {
- if (tdn.attributes[i].name=="onmouseover") {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- }
- }
-}
-
-
-
-
-// *********************************************************************************
-// DRAG DROP PROXY CONTROLLER
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.DragDrop = function(id, config) {
- if (id) {
- this.init(id, 'PRC',{isTarget:false});
- this.initFrame();
- }
- var s = this.getDragEl().style;
- s.borderColor = "transparent";
- s.opacity = 0.75;
- s.filter = "alpha(opacity=75)";
- s.whiteSpace = "nowrap";
- s.overflow = "hidden";
- s.textOverflow = "ellipsis";
-};
-YAHOO.extend(i2b2.sdx.TypeControllers.PRC.DragDrop, YAHOO.util.DDProxy);
-i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.startDrag = function(x, y) {
- var dragEl = this.getDragEl();
- var clickEl = this.getEl();
- dragEl.innerHTML = clickEl.innerHTML;
- dragEl.className = clickEl.className;
- dragEl.style.backgroundColor = '#FFFFEE';
- dragEl.style.color = clickEl.style.color;
- dragEl.style.border = "1px solid blue";
- dragEl.style.width = "160px";
- dragEl.style.height = "20px";
- this.setDelta(15,10);
-};
-i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.endDrag = function(e) {
- // remove DragDrop targeting CCS
- var targets = YAHOO.util.DDM.getRelated(this, true);
- for (var i=0; i<targets.length; i++) {
- var targetEl = targets[i]._domRef;
- i2b2.sdx.Master.onHoverOut('PRC', e, targetEl, this);
- }
-};
-i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
- var oCoord = this.getTargetCoord(iPageX, iPageY);
- if (!this.deltaSetXY) {
- var aCoord = [oCoord.x, oCoord.y];
- YAHOO.util.Dom.setXY(el, aCoord);
- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
- } else {
- var posX = (oCoord.x + this.deltaSetXY[0]);
- var posY = (oCoord.y + this.deltaSetXY[1]);
- var scrSize = document.viewport.getDimensions();
- var maxX = parseInt(scrSize.width-25-160);
- var maxY = parseInt(scrSize.height-25);
- if (posX > maxX) {posX = maxX;}
- if (posX < 6) {posX = 6;}
- if (posY > maxY) {posY = maxY;}
- if (posY < 6) {posY = 6;}
- YAHOO.util.Dom.setStyle(el, "left", posX + "px");
- YAHOO.util.Dom.setStyle(el, "top", posY + "px");
- }
- this.cachePosition(oCoord.x, oCoord.y);
- this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
-};
-i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.onDragOver = function(e, id) {
- // fire the onHoverOver (use SDX so targets can override default event handler)
- i2b2.sdx.Master.onHoverOver('PRC', e, id, this);
-};
-i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.onDragOut = function(e, id) {
- // fire the onHoverOut handler (use SDX so targets can override default event handlers)
- i2b2.sdx.Master.onHoverOut('PRC', e, id, this);
-};
-i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.onDragDrop = function(e, id) {
- i2b2.sdx.Master.onHoverOut('PRC', e, id, this);
- // retreive the concept data from the dragged element
- draggedData = this.yuiTreeNode.data.i2b2_SDX;
- i2b2.sdx.Master.ProcessDrop(draggedData, id);
-};
-
-
-
-// *********************************************************************************
-// <BLANK> DROP HANDLER
-// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
-// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
-// *********************************************************************************
-i2b2.sdx.TypeControllers.PRC.DropHandler = function(sdxData) {
- alert('[PatientRecordCount DROPPED] You need to create your own custom drop event handler.');
-}
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription The SDX controller library for the PatientRecordCount data-type.
+ * @namespace i2b2.sdx.TypeControllers.PRC
+ * @inherits i2b2.sdx.TypeControllers
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * @see i2b2.sdx
+ * ----------------------------------------------------------------------------------------
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: CRC > SDX > Patient Record Count');
+console.time('execute time');
+
+
+i2b2.sdx.TypeControllers.PRC = {};
+i2b2.sdx.TypeControllers.PRC.model = {};
+// *********************************************************************************
+// ENCAPSULATE DATA
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.getEncapsulateInfo = function() {
+ // this function returns the encapsulation head information
+ return {sdxType: 'PRC', sdxKeyName: 'result_instance_id', sdxControlCell:'CRC', sdxDisplayNameKey:'title'};
+}
+
+i2b2.sdx.TypeControllers.PRC.SaveToDataModel = function(sdxData, sdxParentNode) {
+ // save to CRC data model
+ if (!sdxParentNode) { return false; }
+ var qm_id = sdxData.sdxInfo.sdxKeyValue;
+ var qm_hash = i2b2.sdx.Master._KeyHash(qm_id);
+
+ // class for all SDX communications
+ function i2b2_SDX_Encapsulation_EXTENDED() {}
+ // create an instance and populate with info
+ var t = new i2b2_SDX_Encapsulation_EXTENDED();
+ t.origData = Object.clone(sdxData.origData);
+ t.sdxInfo = Object.clone(sdxData.sdxInfo);
+ t.parent = sdxParentNode;
+ t.children = new Hash();
+ t.children.loaded = false;
+ // add to hash
+ sdxParentNode.children.set(qm_hash, t);
+ // TODO: send data update signal (use JOINING-MUTEX or AGGREGATING-MUTEX to avoid rapid fire of event!)
+ return t;
+}
+
+
+i2b2.sdx.TypeControllers.PRC.LoadFromDataModel = function(key_value) {}
+
+
+i2b2.sdx.TypeControllers.PRC.ClearAllFromDataModel= function(sdxOptionalParent) {
+ if (sdxOptionalParent) {
+ try {
+ var findFunc = function(item_rec) {
+ // this function expects the second argument to be the target node's key value
+ var hash_key = item_rec[0];
+ var QM_rec = item_rec[1];
+ if (QM_rec.sdxInfo.sdxKeyValue == this.strip()) { return true; }
+ }
+ var dm_loc = 'i2b2.CRC.model.QueryMasters.'+i2b2.sdx.Master._KeyHash(sdxOptionalParent.sdxInfo.sdxKeyValue);
+ var targets = i2b2.CRC.model.QueryMasters.findAll(findFunc, sdxOptionalParent.sdxInfo.sdxKeyValue);
+ for (var i=0; i < targets.length; i++) {
+ var t = parent_QM[i].value;
+ t.children = new Hash();
+ }
+ } catch(e) { console.error('Could not clear children of given parent node!'); }
+ } else {
+ var dm_loc = 'i2b2.CRC.model.QueryMasters';
+ i2b2.CRC.model.QueryMasters.each(function(item_rec) {
+ try {
+ item_rec[1].children = new Hash();
+ } catch(e) { console.error('Could not clear children of all QueryMasters'); }
+ });
+ }
+ // TODO: send data update signal (use JOINING-MUTEX or AGGREGATING-MUTEX to avoid rapid fire of event!)
+ // updated dm_loc of the data model
+ return true;
+}
+
+
+// *********************************************************************************
+// GENERATE HTML (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.RenderHTML= function(sdxData, options, targetDiv) {
+ // OPTIONS:
+ // title: string
+ // showchildren: true | false
+ // cssClass: string
+ // icon: [data object]
+ // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // dragdrop: string (function name)
+ // context: string
+ // click: string
+ // dblclick: string
+
+ if (Object.isUndefined(options)) { options = {}; }
+ var render = {html: retHtml, htmlID: id};
+ var conceptId = sdxData.name;
+ var id = "CRC_ID-" + i2b2.GUID();
+
+ // process drag drop controllers
+ if (!Object.isUndefined(options.dragdrop)) {
+// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
+// This would ensure removal of the onmouseover call in a cross-browser way
+ var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
+ } else {
+ var sDD = '';
+ }
+
+ if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultPRC';}
+
+ // user can override
+ bCanExp = true;
+ if (Object.isBoolean(options.showchildren)) {
+ bCanExp = options.showchildren;
+ }
+ render.canExpand = bCanExp;
+ render.iconType = "PRC";
+
+ if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
+ if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
+ // in cases of one set icon, copy valid icon to the missing icon
+ if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
+ if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
+
+ // handle the event controllers
+ var sMainEvents = sDD;
+ var sImgEvents = sDD;
+
+ // **** Render the HTML ***
+ var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
+ retHtml += '<DIV ';
+ if (Object.isString(options.cssClass)) {
+ retHtml += ' class="'+options.cssClass+'" ';
+ } else {
+ retHtml += ' class= "sdxDefaultPRC" ';
+ }
+ retHtml += sImgEvents;
+ retHtml += '>';
+ retHtml += '<IMG src="'+render.icon+'"/> ';
+ if (!Object.isUndefined(options.title)) {
+ retHtml += options.title;
+ } else {
+ console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > PRC node!');
+ retHtml += ' PRC '+id;
+ }
+ retHtml += '</DIV></DIV>';
+ render.html = retHtml;
+ render.htmlID = id;
+ var retObj = {};
+ Object.extend(retObj, sdxData);
+ retObj.renderData = render;
+ return retObj;
+}
+
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.onHoverOver = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.addClassName(el,'ddPRCTarget'); }
+}
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.onHoverOut = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.removeClassName(el,'ddPRCTarget'); }
+}
+
+
+// *********************************************************************************
+// ADD DATA TO TREENODE (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
+ var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
+ var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
+ if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
+ // add the callback to load child nodes
+ sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
+ }
+ tmpNode.data.i2b2_SDX= sdxDataPack;
+ tmpNode.toggle = function() {
+ if (!this.tree.locked && ( this.hasChildren(true) ) ) {
+ var data = this.data.i2b2_SDX.renderData;
+ var img = this.getContentEl();
+ img = Element.select(img,'img')[0];
+ if (this.expanded) {
+ img.src = data.icon;
+ this.collapse();
+ } else {
+ img.src = data.iconExp;
+ this.expand();
+ }
+ }
+ };
+ if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
+ return tmpNode;
+}
+
+
+// *********************************************************************************
+// ATTACH DRAG TO DATA (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.AttachDrag2Data = function(divParentID, divDataID){
+ if (Object.isUndefined($(divDataID))) { return false; }
+
+ // get the i2b2 data from the yuiTree node
+ var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
+ var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
+ if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
+
+ // attach DD
+ var t = new i2b2.sdx.TypeControllers.PRC.DragDrop(divDataID)
+ t.yuiTree = tvTree;
+ t.yuiTreeNode = tvNode;
+ tvNode.DDProxy = t;
+
+ // clear the mouseover attachment function
+ var tdn = $(divDataID);
+ if (!Object.isUndefined(tdn.onmouseover)) {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ if (!Object.isUndefined(tdn.attributes)) {
+ for (var i=0;i<tdn.attributes.length; i++) {
+ if (tdn.attributes[i].name=="onmouseover") {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+// *********************************************************************************
+// DRAG DROP PROXY CONTROLLER
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.DragDrop = function(id, config) {
+ if (id) {
+ this.init(id, 'PRC',{isTarget:false});
+ this.initFrame();
+ }
+ var s = this.getDragEl().style;
+ s.borderColor = "transparent";
+ s.opacity = 0.75;
+ s.filter = "alpha(opacity=75)";
+ s.whiteSpace = "nowrap";
+ s.overflow = "hidden";
+ s.textOverflow = "ellipsis";
+};
+YAHOO.extend(i2b2.sdx.TypeControllers.PRC.DragDrop, YAHOO.util.DDProxy);
+i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.startDrag = function(x, y) {
+ var dragEl = this.getDragEl();
+ var clickEl = this.getEl();
+ dragEl.innerHTML = clickEl.innerHTML;
+ dragEl.className = clickEl.className;
+ dragEl.style.backgroundColor = '#FFFFEE';
+ dragEl.style.color = clickEl.style.color;
+ dragEl.style.border = "1px solid blue";
+ dragEl.style.width = "160px";
+ dragEl.style.height = "20px";
+ this.setDelta(15,10);
+};
+i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.endDrag = function(e) {
+ // remove DragDrop targeting CCS
+ var targets = YAHOO.util.DDM.getRelated(this, true);
+ for (var i=0; i<targets.length; i++) {
+ var targetEl = targets[i]._domRef;
+ i2b2.sdx.Master.onHoverOut('PRC', e, targetEl, this);
+ }
+};
+i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+ var oCoord = this.getTargetCoord(iPageX, iPageY);
+ if (!this.deltaSetXY) {
+ var aCoord = [oCoord.x, oCoord.y];
+ YAHOO.util.Dom.setXY(el, aCoord);
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
+ this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+ } else {
+ var posX = (oCoord.x + this.deltaSetXY[0]);
+ var posY = (oCoord.y + this.deltaSetXY[1]);
+ var scrSize = document.viewport.getDimensions();
+ var maxX = parseInt(scrSize.width-25-160);
+ var maxY = parseInt(scrSize.height-25);
+ if (posX > maxX) {posX = maxX;}
+ if (posX < 6) {posX = 6;}
+ if (posY > maxY) {posY = maxY;}
+ if (posY < 6) {posY = 6;}
+ YAHOO.util.Dom.setStyle(el, "left", posX + "px");
+ YAHOO.util.Dom.setStyle(el, "top", posY + "px");
+ }
+ this.cachePosition(oCoord.x, oCoord.y);
+ this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.onDragOver = function(e, id) {
+ // fire the onHoverOver (use SDX so targets can override default event handler)
+ i2b2.sdx.Master.onHoverOver('PRC', e, id, this);
+};
+i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.onDragOut = function(e, id) {
+ // fire the onHoverOut handler (use SDX so targets can override default event handlers)
+ i2b2.sdx.Master.onHoverOut('PRC', e, id, this);
+};
+i2b2.sdx.TypeControllers.PRC.DragDrop.prototype.onDragDrop = function(e, id) {
+ i2b2.sdx.Master.onHoverOut('PRC', e, id, this);
+ // retreive the concept data from the dragged element
+ draggedData = this.yuiTreeNode.data.i2b2_SDX;
+ i2b2.sdx.Master.ProcessDrop(draggedData, id);
+};
+
+
+
+// *********************************************************************************
+// <BLANK> DROP HANDLER
+// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
+// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
+// *********************************************************************************
+i2b2.sdx.TypeControllers.PRC.DropHandler = function(sdxData) {
+ alert('[PatientRecordCount DROPPED] You need to create your own custom drop event handler.');
+}
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PRS.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_PRS.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QDEF.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QDEF.js
old mode 100755
new mode 100644
index 5751b6009..4dde4ce4d
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QDEF.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QDEF.js
@@ -1,284 +1,284 @@
-/**
- * @projectDescription The SDX controller library for the Query Definition data-type.
- * @namespace i2b2.sdx.TypeControllers.QDEF
- * @inherits i2b2.sdx.TypeControllers
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * @see i2b2.sdx
- * ----------------------------------------------------------------------------------------
- * updated 9-15-08: RC4 launch [Nick Benik]
- */
-console.group('Load & Execute component file: CRC > SDX > Query DEFinition');
-console.time('execute time');
-
-
-i2b2.sdx.TypeControllers.QDEF = {};
-i2b2.sdx.TypeControllers.QDEF.model = {};
-// *********************************************************************************
-// ENCAPSULATE DATA
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.getEncapsulateInfo = function() {
- // this function returns the encapsulation head information
- return {sdxType: 'QDEF', sdxKeyName: 'key', sdxControlCell:'CRC', sdxDisplayNameKey: 'QDEF_name'};
-}
-
-i2b2.sdx.TypeControllers.QDEF.SaveToDataModel = function(sdxData, sdxParentNode) { return undefined;}
-i2b2.sdx.TypeControllers.QDEF.LoadFromDataModel = function(key_value) {}
-i2b2.sdx.TypeControllers.QDEF.ClearAllFromDataModel= function(sdxOptionalParent) { return true; }
-
-
-// *********************************************************************************
-// GENERATE HTML (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.RenderHTML= function(sdxData, options, targetDiv) {
- // OPTIONS:
- // title: string
- // showchildren: true | false
- // cssClass: string
- // icon: [data object]
- // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // dragdrop: string (function name)
- // context: string
- // click: string
- // dblclick: string
-
- if (Object.isUndefined(options)) { options = {}; }
- var render = {html: retHtml, htmlID: id};
- var id = "CRC_ID-" + i2b2.GUID();
-
- // process drag drop controllers1
- if (!Object.isUndefined(options.dragdrop)) {
-// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
-// This would ensure removal of the onmouseover call in a cross-browser way
- var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
- } else {
- var sDD = '';
- }
-
- if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultQDEF';}
-
- // user can override
- bCanExp = true;
- if (Object.isBoolean(options.showchildren)) {
- bCanExp = options.showchildren;
- }
- render.canExpand = bCanExp;
- render.iconType = "QDEF";
-
- if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
- if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
- // in cases of one set icon, copy valid icon to the missing icon
- if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
- if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
-
- // handle the event controllers
- var sMainEvents = sDD;
- var sImgEvents = sDD;
-
- // **** Render the HTML ***
- var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
- retHtml += '<DIV ';
- if (Object.isString(options.cssClass)) {
- retHtml += ' class="'+options.cssClass+'" ';
- } else {
- retHtml += ' class= "sdxDefaultQDEF" ';
- }
- retHtml += sImgEvents;
- retHtml += '>';
- retHtml += '<IMG src="'+render.icon+'"/> ';
- if (!Object.isUndefined(options.title)) {
- retHtml += options.title;
- } else {
- console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > QDEF node!');
- retHtml += ' QDEF '+id;
- }
- retHtml += '</DIV></DIV>';
- render.html = retHtml;
- render.htmlID = id;
- var retObj = {};
- Object.extend(retObj, sdxData);
- retObj.renderData = render;
- return retObj;
-}
-
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.onHoverOver = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.addClassName(el,'ddQDEFTarget'); }
-}
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.onHoverOut = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.removeClassName(el,'ddQDEFTarget'); }
-}
-
-
-// *********************************************************************************
-// ADD DATA TO TREENODE (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
- var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
- var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
- if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
- // add the callback to load child nodes
- sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
- }
- tmpNode.data.i2b2_SDX= sdxDataPack;
- tmpNode.toggle = function() {
- if (!this.tree.locked && ( this.hasChildren(true) ) ) {
- var data = this.data.i2b2_SDX.renderData;
- var img = this.getContentEl();
- img = Element.select(img,'img')[0];
- if (this.expanded) {
- img.src = data.icon;
- this.collapse();
- } else {
- img.src = data.iconExp;
- this.expand();
- }
- }
- };
- if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
- return tmpNode;
-}
-
-
-// *********************************************************************************
-// ATTACH DRAG TO DATA (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.AttachDrag2Data = function(divParentID, divDataID){
- if (Object.isUndefined($(divDataID))) { return false; }
-
- // get the i2b2 data from the yuiTree node
- var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
- var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
- if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
-
- // attach DD
- var t = new i2b2.sdx.TypeControllers.QDEF.DragDrop(divDataID)
- t.yuiTree = tvTree;
- t.yuiTreeNode = tvNode;
- tvNode.DDProxy = t;
-
- // clear the mouseover attachment function
- var tdn = $(divDataID);
- if (!Object.isUndefined(tdn.onmouseover)) {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- if (!Object.isUndefined(tdn.attributes)) {
- for (var i=0;i<tdn.attributes.length; i++) {
- if (tdn.attributes[i].name=="onmouseover") {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- }
- }
-}
-
-
-
-
-// *********************************************************************************
-// DRAG DROP PROXY CONTROLLER
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.DragDrop = function(id, config) {
- if (id) {
- this.init(id, 'QDEF',{isTarget:false});
- this.initFrame();
- }
- var s = this.getDragEl().style;
- s.borderColor = "transparent";
- s.opacity = 0.75;
- s.filter = "alpha(opacity=75)";
- s.whiteSpace = "nowrap";
- s.overflow = "hidden";
- s.textOverflow = "ellipsis";
-};
-YAHOO.extend(i2b2.sdx.TypeControllers.QDEF.DragDrop, YAHOO.util.DDProxy);
-i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.startDrag = function(x, y) {
- var dragEl = this.getDragEl();
- var clickEl = this.getEl();
- dragEl.innerHTML = clickEl.innerHTML;
- dragEl.className = clickEl.className;
- dragEl.style.backgroundColor = '#FFFFEE';
- dragEl.style.color = clickEl.style.color;
- dragEl.style.border = "1px solid blue";
- dragEl.style.width = "160px";
- dragEl.style.height = "20px";
- this.setDelta(15,10);
-};
-i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.endDrag = function(e) {
- // remove DragDrop targeting CCS
- var targets = YAHOO.util.DDM.getRelated(this, true);
- for (var i=0; i<targets.length; i++) {
- var targetEl = targets[i]._domRef;
- i2b2.sdx.Master.onHoverOut('QDEF', e, targetEl, this);
- }
-};
-i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
- var oCoord = this.getTargetCoord(iPageX, iPageY);
- if (!this.deltaSetXY) {
- var aCoord = [oCoord.x, oCoord.y];
- YAHOO.util.Dom.setXY(el, aCoord);
- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
- } else {
- var posX = (oCoord.x + this.deltaSetXY[0]);
- var posY = (oCoord.y + this.deltaSetXY[1]);
- var scrSize = document.viewport.getDimensions();
- var maxX = parseInt(scrSize.width-25-160);
- var maxY = parseInt(scrSize.height-25);
- if (posX > maxX) {posX = maxX;}
- if (posX < 6) {posX = 6;}
- if (posY > maxY) {posY = maxY;}
- if (posY < 6) {posY = 6;}
- YAHOO.util.Dom.setStyle(el, "left", posX + "px");
- YAHOO.util.Dom.setStyle(el, "top", posY + "px");
- }
- this.cachePosition(oCoord.x, oCoord.y);
- this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
-};
-i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.onDragOver = function(e, id) {
- // fire the onHoverOver (use SDX so targets can override default event handler)
- i2b2.sdx.Master.onHoverOver('QDEF', e, id, this);
-};
-i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.onDragOut = function(e, id) {
- // fire the onHoverOut handler (use SDX so targets can override default event handlers)
- i2b2.sdx.Master.onHoverOut('QDEF', e, id, this);
-};
-i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.onDragDrop = function(e, id) {
- i2b2.sdx.Master.onHoverOut('QDEF', e, id, this);
- // retreive the concept data from the dragged element
- draggedData = this.yuiTreeNode.data.i2b2_SDX;
- i2b2.sdx.Master.ProcessDrop(draggedData, id);
-};
-
-
-
-// *********************************************************************************
-// <BLANK> DROP HANDLER
-// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
-// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QDEF.DropHandler = function(sdxData) {
- alert('[PatientRecord DROPPED] You need to create your own custom drop event handler.');
-}
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription The SDX controller library for the Query Definition data-type.
+ * @namespace i2b2.sdx.TypeControllers.QDEF
+ * @inherits i2b2.sdx.TypeControllers
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * @see i2b2.sdx
+ * ----------------------------------------------------------------------------------------
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: CRC > SDX > Query DEFinition');
+console.time('execute time');
+
+
+i2b2.sdx.TypeControllers.QDEF = {};
+i2b2.sdx.TypeControllers.QDEF.model = {};
+// *********************************************************************************
+// ENCAPSULATE DATA
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.getEncapsulateInfo = function() {
+ // this function returns the encapsulation head information
+ return {sdxType: 'QDEF', sdxKeyName: 'key', sdxControlCell:'CRC', sdxDisplayNameKey: 'QDEF_name'};
+}
+
+i2b2.sdx.TypeControllers.QDEF.SaveToDataModel = function(sdxData, sdxParentNode) { return undefined;}
+i2b2.sdx.TypeControllers.QDEF.LoadFromDataModel = function(key_value) {}
+i2b2.sdx.TypeControllers.QDEF.ClearAllFromDataModel= function(sdxOptionalParent) { return true; }
+
+
+// *********************************************************************************
+// GENERATE HTML (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.RenderHTML= function(sdxData, options, targetDiv) {
+ // OPTIONS:
+ // title: string
+ // showchildren: true | false
+ // cssClass: string
+ // icon: [data object]
+ // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // dragdrop: string (function name)
+ // context: string
+ // click: string
+ // dblclick: string
+
+ if (Object.isUndefined(options)) { options = {}; }
+ var render = {html: retHtml, htmlID: id};
+ var id = "CRC_ID-" + i2b2.GUID();
+
+ // process drag drop controllers1
+ if (!Object.isUndefined(options.dragdrop)) {
+// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
+// This would ensure removal of the onmouseover call in a cross-browser way
+ var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
+ } else {
+ var sDD = '';
+ }
+
+ if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultQDEF';}
+
+ // user can override
+ bCanExp = true;
+ if (Object.isBoolean(options.showchildren)) {
+ bCanExp = options.showchildren;
+ }
+ render.canExpand = bCanExp;
+ render.iconType = "QDEF";
+
+ if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
+ if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
+ // in cases of one set icon, copy valid icon to the missing icon
+ if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
+ if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
+
+ // handle the event controllers
+ var sMainEvents = sDD;
+ var sImgEvents = sDD;
+
+ // **** Render the HTML ***
+ var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
+ retHtml += '<DIV ';
+ if (Object.isString(options.cssClass)) {
+ retHtml += ' class="'+options.cssClass+'" ';
+ } else {
+ retHtml += ' class= "sdxDefaultQDEF" ';
+ }
+ retHtml += sImgEvents;
+ retHtml += '>';
+ retHtml += '<IMG src="'+render.icon+'"/> ';
+ if (!Object.isUndefined(options.title)) {
+ retHtml += options.title;
+ } else {
+ console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > QDEF node!');
+ retHtml += ' QDEF '+id;
+ }
+ retHtml += '</DIV></DIV>';
+ render.html = retHtml;
+ render.htmlID = id;
+ var retObj = {};
+ Object.extend(retObj, sdxData);
+ retObj.renderData = render;
+ return retObj;
+}
+
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.onHoverOver = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.addClassName(el,'ddQDEFTarget'); }
+}
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.onHoverOut = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.removeClassName(el,'ddQDEFTarget'); }
+}
+
+
+// *********************************************************************************
+// ADD DATA TO TREENODE (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
+ var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
+ var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
+ if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
+ // add the callback to load child nodes
+ sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
+ }
+ tmpNode.data.i2b2_SDX= sdxDataPack;
+ tmpNode.toggle = function() {
+ if (!this.tree.locked && ( this.hasChildren(true) ) ) {
+ var data = this.data.i2b2_SDX.renderData;
+ var img = this.getContentEl();
+ img = Element.select(img,'img')[0];
+ if (this.expanded) {
+ img.src = data.icon;
+ this.collapse();
+ } else {
+ img.src = data.iconExp;
+ this.expand();
+ }
+ }
+ };
+ if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
+ return tmpNode;
+}
+
+
+// *********************************************************************************
+// ATTACH DRAG TO DATA (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.AttachDrag2Data = function(divParentID, divDataID){
+ if (Object.isUndefined($(divDataID))) { return false; }
+
+ // get the i2b2 data from the yuiTree node
+ var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
+ var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
+ if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
+
+ // attach DD
+ var t = new i2b2.sdx.TypeControllers.QDEF.DragDrop(divDataID)
+ t.yuiTree = tvTree;
+ t.yuiTreeNode = tvNode;
+ tvNode.DDProxy = t;
+
+ // clear the mouseover attachment function
+ var tdn = $(divDataID);
+ if (!Object.isUndefined(tdn.onmouseover)) {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ if (!Object.isUndefined(tdn.attributes)) {
+ for (var i=0;i<tdn.attributes.length; i++) {
+ if (tdn.attributes[i].name=="onmouseover") {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+// *********************************************************************************
+// DRAG DROP PROXY CONTROLLER
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.DragDrop = function(id, config) {
+ if (id) {
+ this.init(id, 'QDEF',{isTarget:false});
+ this.initFrame();
+ }
+ var s = this.getDragEl().style;
+ s.borderColor = "transparent";
+ s.opacity = 0.75;
+ s.filter = "alpha(opacity=75)";
+ s.whiteSpace = "nowrap";
+ s.overflow = "hidden";
+ s.textOverflow = "ellipsis";
+};
+YAHOO.extend(i2b2.sdx.TypeControllers.QDEF.DragDrop, YAHOO.util.DDProxy);
+i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.startDrag = function(x, y) {
+ var dragEl = this.getDragEl();
+ var clickEl = this.getEl();
+ dragEl.innerHTML = clickEl.innerHTML;
+ dragEl.className = clickEl.className;
+ dragEl.style.backgroundColor = '#FFFFEE';
+ dragEl.style.color = clickEl.style.color;
+ dragEl.style.border = "1px solid blue";
+ dragEl.style.width = "160px";
+ dragEl.style.height = "20px";
+ this.setDelta(15,10);
+};
+i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.endDrag = function(e) {
+ // remove DragDrop targeting CCS
+ var targets = YAHOO.util.DDM.getRelated(this, true);
+ for (var i=0; i<targets.length; i++) {
+ var targetEl = targets[i]._domRef;
+ i2b2.sdx.Master.onHoverOut('QDEF', e, targetEl, this);
+ }
+};
+i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+ var oCoord = this.getTargetCoord(iPageX, iPageY);
+ if (!this.deltaSetXY) {
+ var aCoord = [oCoord.x, oCoord.y];
+ YAHOO.util.Dom.setXY(el, aCoord);
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
+ this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+ } else {
+ var posX = (oCoord.x + this.deltaSetXY[0]);
+ var posY = (oCoord.y + this.deltaSetXY[1]);
+ var scrSize = document.viewport.getDimensions();
+ var maxX = parseInt(scrSize.width-25-160);
+ var maxY = parseInt(scrSize.height-25);
+ if (posX > maxX) {posX = maxX;}
+ if (posX < 6) {posX = 6;}
+ if (posY > maxY) {posY = maxY;}
+ if (posY < 6) {posY = 6;}
+ YAHOO.util.Dom.setStyle(el, "left", posX + "px");
+ YAHOO.util.Dom.setStyle(el, "top", posY + "px");
+ }
+ this.cachePosition(oCoord.x, oCoord.y);
+ this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.onDragOver = function(e, id) {
+ // fire the onHoverOver (use SDX so targets can override default event handler)
+ i2b2.sdx.Master.onHoverOver('QDEF', e, id, this);
+};
+i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.onDragOut = function(e, id) {
+ // fire the onHoverOut handler (use SDX so targets can override default event handlers)
+ i2b2.sdx.Master.onHoverOut('QDEF', e, id, this);
+};
+i2b2.sdx.TypeControllers.QDEF.DragDrop.prototype.onDragDrop = function(e, id) {
+ i2b2.sdx.Master.onHoverOut('QDEF', e, id, this);
+ // retreive the concept data from the dragged element
+ draggedData = this.yuiTreeNode.data.i2b2_SDX;
+ i2b2.sdx.Master.ProcessDrop(draggedData, id);
+};
+
+
+
+// *********************************************************************************
+// <BLANK> DROP HANDLER
+// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
+// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QDEF.DropHandler = function(sdxData) {
+ alert('[PatientRecord DROPPED] You need to create your own custom drop event handler.');
+}
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QGDEF.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QGDEF.js
old mode 100755
new mode 100644
index 68df6256d..02af27205
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QGDEF.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QGDEF.js
@@ -1,284 +1,284 @@
-/**
- * @projectDescription The SDX controller library for the Query Group Definition data-type.
- * @namespace i2b2.sdx.TypeControllers.QGDEF
- * @inherits i2b2.sdx.TypeControllers
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * @see i2b2.sdx
- * ----------------------------------------------------------------------------------------
- * updated 9-15-08: RC4 launch [Nick Benik]
- */
-console.group('Load & Execute component file: CRC > SDX > Query Group DEFinition');
-console.time('execute time');
-
-
-i2b2.sdx.TypeControllers.QGDEF = {};
-i2b2.sdx.TypeControllers.QGDEF.model = {};
-// *********************************************************************************
-// ENCAPSULATE DATA
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.getEncapsulateInfo = function() {
- // this function returns the encapsulation head information
- return {sdxType: 'QGDEF', sdxKeyName: 'key', sdxControlCell:'CRC', sdxDisplayNameKey: 'QGDEF_name'};
-}
-
-i2b2.sdx.TypeControllers.QGDEF.SaveToDataModel = function(sdxData, sdxParentNode) { return undefined; }
-i2b2.sdx.TypeControllers.QGDEF.LoadFromDataModel = function(key_value) {}
-i2b2.sdx.TypeControllers.QGDEF.ClearAllFromDataModel= function(sdxOptionalParent) { return true; }
-
-
-// *********************************************************************************
-// GENERATE HTML (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.RenderHTML= function(sdxData, options, targetDiv) {
- // OPTIONS:
- // title: string
- // showchildren: true | false
- // cssClass: string
- // icon: [data object]
- // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // dragdrop: string (function name)
- // context: string
- // click: string
- // dblclick: string
-
- if (Object.isUndefined(options)) { options = {}; }
- var render = {html: retHtml, htmlID: id};
- var id = "CRC_ID-" + i2b2.GUID();
-
- // process drag drop controllers1
- if (!Object.isUndefined(options.dragdrop)) {
-// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
-// This would ensure removal of the onmouseover call in a cross-browser way
- var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
- } else {
- var sDD = '';
- }
-
- if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultQGDEF';}
-
- // user can override
- bCanExp = true;
- if (Object.isBoolean(options.showchildren)) {
- bCanExp = options.showchildren;
- }
- render.canExpand = bCanExp;
- render.iconType = "QGDEF";
-
- if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
- if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
- // in cases of one set icon, copy valid icon to the missing icon
- if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
- if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
-
- // handle the event controllers
- var sMainEvents = sDD;
- var sImgEvents = sDD;
-
- // **** Render the HTML ***
- var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
- retHtml += '<DIV ';
- if (Object.isString(options.cssClass)) {
- retHtml += ' class="'+options.cssClass+'" ';
- } else {
- retHtml += ' class= "sdxDefaultQGDEF" ';
- }
- retHtml += sImgEvents;
- retHtml += '>';
- retHtml += '<IMG src="'+render.icon+'"/> ';
- if (!Object.isUndefined(options.title)) {
- retHtml += options.title;
- } else {
- console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > QGDEF node!');
- retHtml += ' QGDEF '+id;
- }
- retHtml += '</DIV></DIV>';
- render.html = retHtml;
- render.htmlID = id;
- var retObj = {};
- Object.extend(retObj, sdxData);
- retObj.renderData = render;
- return retObj;
-}
-
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.onHoverOver = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.addClassName(el,'ddQGDEFTarget'); }
-}
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.onHoverOut = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.removeClassName(el,'ddQGDEFTarget'); }
-}
-
-
-// *********************************************************************************
-// ADD DATA TO TREENODE (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
- var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
- var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
- if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
- // add the callback to load child nodes
- sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
- }
- tmpNode.data.i2b2_SDX= sdxDataPack;
- tmpNode.toggle = function() {
- if (!this.tree.locked && ( this.hasChildren(true) ) ) {
- var data = this.data.i2b2_SDX.renderData;
- var img = this.getContentEl();
- img = Element.select(img,'img')[0];
- if (this.expanded) {
- img.src = data.icon;
- this.collapse();
- } else {
- img.src = data.iconExp;
- this.expand();
- }
- }
- };
- if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
- return tmpNode;
-}
-
-
-// *********************************************************************************
-// ATTACH DRAG TO DATA (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.AttachDrag2Data = function(divParentID, divDataID){
- if (Object.isUndefined($(divDataID))) { return false; }
-
- // get the i2b2 data from the yuiTree node
- var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
- var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
- if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
-
- // attach DD
- var t = new i2b2.sdx.TypeControllers.QGDEF.DragDrop(divDataID)
- t.yuiTree = tvTree;
- t.yuiTreeNode = tvNode;
- tvNode.DDProxy = t;
-
- // clear the mouseover attachment function
- var tdn = $(divDataID);
- if (!Object.isUndefined(tdn.onmouseover)) {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- if (!Object.isUndefined(tdn.attributes)) {
- for (var i=0;i<tdn.attributes.length; i++) {
- if (tdn.attributes[i].name=="onmouseover") {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- }
- }
-}
-
-
-
-
-// *********************************************************************************
-// DRAG DROP PROXY CONTROLLER
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.DragDrop = function(id, config) {
- if (id) {
- this.init(id, 'QGDEF',{isTarget:false});
- this.initFrame();
- }
- var s = this.getDragEl().style;
- s.borderColor = "transparent";
- s.opacity = 0.75;
- s.filter = "alpha(opacity=75)";
- s.whiteSpace = "nowrap";
- s.overflow = "hidden";
- s.textOverflow = "ellipsis";
-};
-YAHOO.extend(i2b2.sdx.TypeControllers.QGDEF.DragDrop, YAHOO.util.DDProxy);
-i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.startDrag = function(x, y) {
- var dragEl = this.getDragEl();
- var clickEl = this.getEl();
- dragEl.innerHTML = clickEl.innerHTML;
- dragEl.className = clickEl.className;
- dragEl.style.backgroundColor = '#FFFFEE';
- dragEl.style.color = clickEl.style.color;
- dragEl.style.border = "1px solid blue";
- dragEl.style.width = "160px";
- dragEl.style.height = "20px";
- this.setDelta(15,10);
-};
-i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.endDrag = function(e) {
- // remove DragDrop targeting CCS
- var targets = YAHOO.util.DDM.getRelated(this, true);
- for (var i=0; i<targets.length; i++) {
- var targetEl = targets[i]._domRef;
- i2b2.sdx.Master.onHoverOut('QGDEF', e, targetEl, this);
- }
-};
-i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
- var oCoord = this.getTargetCoord(iPageX, iPageY);
- if (!this.deltaSetXY) {
- var aCoord = [oCoord.x, oCoord.y];
- YAHOO.util.Dom.setXY(el, aCoord);
- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
- } else {
- var posX = (oCoord.x + this.deltaSetXY[0]);
- var posY = (oCoord.y + this.deltaSetXY[1]);
- var scrSize = document.viewport.getDimensions();
- var maxX = parseInt(scrSize.width-25-160);
- var maxY = parseInt(scrSize.height-25);
- if (posX > maxX) {posX = maxX;}
- if (posX < 6) {posX = 6;}
- if (posY > maxY) {posY = maxY;}
- if (posY < 6) {posY = 6;}
- YAHOO.util.Dom.setStyle(el, "left", posX + "px");
- YAHOO.util.Dom.setStyle(el, "top", posY + "px");
- }
- this.cachePosition(oCoord.x, oCoord.y);
- this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
-};
-i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.onDragOver = function(e, id) {
- // fire the onHoverOver (use SDX so targets can override default event handler)
- i2b2.sdx.Master.onHoverOver('QGDEF', e, id, this);
-};
-i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.onDragOut = function(e, id) {
- // fire the onHoverOut handler (use SDX so targets can override default event handlers)
- i2b2.sdx.Master.onHoverOut('QGDEF', e, id, this);
-};
-i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.onDragDrop = function(e, id) {
- i2b2.sdx.Master.onHoverOut('QGDEF', e, id, this);
- // retreive the concept data from the dragged element
- draggedData = this.yuiTreeNode.data.i2b2_SDX;
- i2b2.sdx.Master.ProcessDrop(draggedData, id);
-};
-
-
-
-// *********************************************************************************
-// <BLANK> DROP HANDLER
-// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
-// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
-// *********************************************************************************
-i2b2.sdx.TypeControllers.QGDEF.DropHandler = function(sdxData) {
- alert('[PatientRecord DROPPED] You need to create your own custom drop event handler.');
-}
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription The SDX controller library for the Query Group Definition data-type.
+ * @namespace i2b2.sdx.TypeControllers.QGDEF
+ * @inherits i2b2.sdx.TypeControllers
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * @see i2b2.sdx
+ * ----------------------------------------------------------------------------------------
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: CRC > SDX > Query Group DEFinition');
+console.time('execute time');
+
+
+i2b2.sdx.TypeControllers.QGDEF = {};
+i2b2.sdx.TypeControllers.QGDEF.model = {};
+// *********************************************************************************
+// ENCAPSULATE DATA
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.getEncapsulateInfo = function() {
+ // this function returns the encapsulation head information
+ return {sdxType: 'QGDEF', sdxKeyName: 'key', sdxControlCell:'CRC', sdxDisplayNameKey: 'QGDEF_name'};
+}
+
+i2b2.sdx.TypeControllers.QGDEF.SaveToDataModel = function(sdxData, sdxParentNode) { return undefined; }
+i2b2.sdx.TypeControllers.QGDEF.LoadFromDataModel = function(key_value) {}
+i2b2.sdx.TypeControllers.QGDEF.ClearAllFromDataModel= function(sdxOptionalParent) { return true; }
+
+
+// *********************************************************************************
+// GENERATE HTML (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.RenderHTML= function(sdxData, options, targetDiv) {
+ // OPTIONS:
+ // title: string
+ // showchildren: true | false
+ // cssClass: string
+ // icon: [data object]
+ // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // dragdrop: string (function name)
+ // context: string
+ // click: string
+ // dblclick: string
+
+ if (Object.isUndefined(options)) { options = {}; }
+ var render = {html: retHtml, htmlID: id};
+ var id = "CRC_ID-" + i2b2.GUID();
+
+ // process drag drop controllers1
+ if (!Object.isUndefined(options.dragdrop)) {
+// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
+// This would ensure removal of the onmouseover call in a cross-browser way
+ var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
+ } else {
+ var sDD = '';
+ }
+
+ if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultQGDEF';}
+
+ // user can override
+ bCanExp = true;
+ if (Object.isBoolean(options.showchildren)) {
+ bCanExp = options.showchildren;
+ }
+ render.canExpand = bCanExp;
+ render.iconType = "QGDEF";
+
+ if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.icon }
+ if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/CRC/assets/'+ options.iconExp }
+ // in cases of one set icon, copy valid icon to the missing icon
+ if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
+ if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
+
+ // handle the event controllers
+ var sMainEvents = sDD;
+ var sImgEvents = sDD;
+
+ // **** Render the HTML ***
+ var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
+ retHtml += '<DIV ';
+ if (Object.isString(options.cssClass)) {
+ retHtml += ' class="'+options.cssClass+'" ';
+ } else {
+ retHtml += ' class= "sdxDefaultQGDEF" ';
+ }
+ retHtml += sImgEvents;
+ retHtml += '>';
+ retHtml += '<IMG src="'+render.icon+'"/> ';
+ if (!Object.isUndefined(options.title)) {
+ retHtml += options.title;
+ } else {
+ console.warn('[SDX RenderHTML] no title was given in the creation options for an CRC > QGDEF node!');
+ retHtml += ' QGDEF '+id;
+ }
+ retHtml += '</DIV></DIV>';
+ render.html = retHtml;
+ render.htmlID = id;
+ var retObj = {};
+ Object.extend(retObj, sdxData);
+ retObj.renderData = render;
+ return retObj;
+}
+
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.onHoverOver = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.addClassName(el,'ddQGDEFTarget'); }
+}
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.onHoverOut = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.removeClassName(el,'ddQGDEFTarget'); }
+}
+
+
+// *********************************************************************************
+// ADD DATA TO TREENODE (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
+ var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
+ var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
+ if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
+ // add the callback to load child nodes
+ sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
+ }
+ tmpNode.data.i2b2_SDX= sdxDataPack;
+ tmpNode.toggle = function() {
+ if (!this.tree.locked && ( this.hasChildren(true) ) ) {
+ var data = this.data.i2b2_SDX.renderData;
+ var img = this.getContentEl();
+ img = Element.select(img,'img')[0];
+ if (this.expanded) {
+ img.src = data.icon;
+ this.collapse();
+ } else {
+ img.src = data.iconExp;
+ this.expand();
+ }
+ }
+ };
+ if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
+ return tmpNode;
+}
+
+
+// *********************************************************************************
+// ATTACH DRAG TO DATA (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.AttachDrag2Data = function(divParentID, divDataID){
+ if (Object.isUndefined($(divDataID))) { return false; }
+
+ // get the i2b2 data from the yuiTree node
+ var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
+ var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
+ if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
+
+ // attach DD
+ var t = new i2b2.sdx.TypeControllers.QGDEF.DragDrop(divDataID)
+ t.yuiTree = tvTree;
+ t.yuiTreeNode = tvNode;
+ tvNode.DDProxy = t;
+
+ // clear the mouseover attachment function
+ var tdn = $(divDataID);
+ if (!Object.isUndefined(tdn.onmouseover)) {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ if (!Object.isUndefined(tdn.attributes)) {
+ for (var i=0;i<tdn.attributes.length; i++) {
+ if (tdn.attributes[i].name=="onmouseover") {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+// *********************************************************************************
+// DRAG DROP PROXY CONTROLLER
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.DragDrop = function(id, config) {
+ if (id) {
+ this.init(id, 'QGDEF',{isTarget:false});
+ this.initFrame();
+ }
+ var s = this.getDragEl().style;
+ s.borderColor = "transparent";
+ s.opacity = 0.75;
+ s.filter = "alpha(opacity=75)";
+ s.whiteSpace = "nowrap";
+ s.overflow = "hidden";
+ s.textOverflow = "ellipsis";
+};
+YAHOO.extend(i2b2.sdx.TypeControllers.QGDEF.DragDrop, YAHOO.util.DDProxy);
+i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.startDrag = function(x, y) {
+ var dragEl = this.getDragEl();
+ var clickEl = this.getEl();
+ dragEl.innerHTML = clickEl.innerHTML;
+ dragEl.className = clickEl.className;
+ dragEl.style.backgroundColor = '#FFFFEE';
+ dragEl.style.color = clickEl.style.color;
+ dragEl.style.border = "1px solid blue";
+ dragEl.style.width = "160px";
+ dragEl.style.height = "20px";
+ this.setDelta(15,10);
+};
+i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.endDrag = function(e) {
+ // remove DragDrop targeting CCS
+ var targets = YAHOO.util.DDM.getRelated(this, true);
+ for (var i=0; i<targets.length; i++) {
+ var targetEl = targets[i]._domRef;
+ i2b2.sdx.Master.onHoverOut('QGDEF', e, targetEl, this);
+ }
+};
+i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+ var oCoord = this.getTargetCoord(iPageX, iPageY);
+ if (!this.deltaSetXY) {
+ var aCoord = [oCoord.x, oCoord.y];
+ YAHOO.util.Dom.setXY(el, aCoord);
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
+ this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+ } else {
+ var posX = (oCoord.x + this.deltaSetXY[0]);
+ var posY = (oCoord.y + this.deltaSetXY[1]);
+ var scrSize = document.viewport.getDimensions();
+ var maxX = parseInt(scrSize.width-25-160);
+ var maxY = parseInt(scrSize.height-25);
+ if (posX > maxX) {posX = maxX;}
+ if (posX < 6) {posX = 6;}
+ if (posY > maxY) {posY = maxY;}
+ if (posY < 6) {posY = 6;}
+ YAHOO.util.Dom.setStyle(el, "left", posX + "px");
+ YAHOO.util.Dom.setStyle(el, "top", posY + "px");
+ }
+ this.cachePosition(oCoord.x, oCoord.y);
+ this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.onDragOver = function(e, id) {
+ // fire the onHoverOver (use SDX so targets can override default event handler)
+ i2b2.sdx.Master.onHoverOver('QGDEF', e, id, this);
+};
+i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.onDragOut = function(e, id) {
+ // fire the onHoverOut handler (use SDX so targets can override default event handlers)
+ i2b2.sdx.Master.onHoverOut('QGDEF', e, id, this);
+};
+i2b2.sdx.TypeControllers.QGDEF.DragDrop.prototype.onDragDrop = function(e, id) {
+ i2b2.sdx.Master.onHoverOut('QGDEF', e, id, this);
+ // retreive the concept data from the dragged element
+ draggedData = this.yuiTreeNode.data.i2b2_SDX;
+ i2b2.sdx.Master.ProcessDrop(draggedData, id);
+};
+
+
+
+// *********************************************************************************
+// <BLANK> DROP HANDLER
+// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
+// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
+// *********************************************************************************
+i2b2.sdx.TypeControllers.QGDEF.DropHandler = function(sdxData) {
+ alert('[PatientRecord DROPPED] You need to create your own custom drop event handler.');
+}
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QI.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QI.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QM.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_sdx_QM.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_DownloadData.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_DownloadData.js
new file mode 100644
index 000000000..85d879055
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_DownloadData.js
@@ -0,0 +1,404 @@
+/**
+ * @projectDescription View controller for the download data window (which is a GUI-only component of the CRC module).
+ * @inherits i2b2.CRC.view
+ * @namespace i2b2.CRC.view.DownloadData
+ * @author Bhaswati Ghosh
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ */
+
+console.group('Load & Execute component file: CRC > view > DownloadData');
+console.time('execute time');
+
+
+// create and save the screen objects
+i2b2.CRC.view.downloadData = new i2b2Base_cellViewController(i2b2.CRC, 'downloadData');
+i2b2.CRC.view.downloadData.visible = false;
+
+i2b2.CRC.view.downloadData.show = function() {
+ i2b2.CRC.view.downloadData.visible = true;
+ $('crcDownloadDataBox').show();
+}
+i2b2.CRC.view.downloadData.hide = function() {
+ i2b2.CRC.view.downloadData.visible = false;
+ $('crcDownloadDataBox').hide();
+}
+
+i2b2.CRC.view.downloadData.hideDisplay = function() {
+ $('infoDownloadStatusData').hide();
+}
+
+i2b2.CRC.view.downloadData.showDisplay = function() {
+ var targs = $('infoDownloadStatusData').parentNode.parentNode.select('DIV.tabBox.active');
+ // remove all active tabs
+ targs.each(function(el) { el.removeClassName('active'); });
+ // set us as active
+ $('infoDownloadStatusData').parentNode.parentNode.select('DIV.tabBox.tabDownloadData')[0].addClassName('active');
+
+ $('infoQueryStatusText').hide();
+ $('infoQueryStatusChart').hide();
+ $('infoQueryStatusReport').hide();
+ $('infoDownloadStatusData').show();
+
+ var output = "";
+
+ if(typeof i2b2.CRC.view.downloadData.active_qm_id === 'undefined'){
+
+ } else {
+ output = "<div style=\"padding:15px;text-align:center;font-size:16px;\"><img src=\"js-i2b2/cells/plugins/biobankportal/BiobankDatafile/assets/csv_icon.png\" align=\"absmiddle\"/> You can download the de-identified data for this query as an Excel/CSV file. ";
+ output += "<input onclick=\"loadDownloadData();i2b2.BiobankDatafile.queryAutoDropped(i2b2.CRC.view.downloadData.active_qm_id);\" type=\"button\" class=\"BiobankDatafile-button\" value=\"Proceed to the Download\">";
+ output += "</div>";
+
+ }
+
+ $('infoDownloadStatusData').innerHTML = output;
+}
+
+i2b2.CRC.view.downloadData.createCSV = function() {
+ var formattedResObj = i2b2.CRC.ctrlr.currentQueryResults;
+ var resString = formattedResObj.resultString;
+ if(resString && resString.length>0)
+ {
+ var asInputFragments = i2b2.CRC.view.graphs.parseInputIntoArray(resString,true);
+ i2b2.CRC.view.downloadData.getFormattedResults(asInputFragments);
+ i2b2.CRC.view.downloadData.getCSVFromResultsHash();
+ }
+}
+
+allSiteNamesHash = $H(); //This hash keeps all the facility names.
+finalOrderdSiteNamesHash = $H(); //In this hash we order the names of all facilities and assign them an index number
+
+resultsHash = $H(); //This hashtable keeps {'breakdown|category',{{'facility Name',{integer value,obfuscated value}}} pairs
+
+errorsHash = $H(); //This hastable keeps {facility name, error message} pairs for all sites that returns error
+
+finalResultsArray = new Array([]); // This is a 2-D array. Keeps data in tabular format where the columns are the sites and rows are the category of results.This array wiil be used to create the CSV table easily.
+
+breakdownHash = $H(); //This hashtable will keep al breakdown categories in lowercase letters. This will help resolve case sensitivity issues for same categories
+
+
+i2b2.CRC.view.downloadData.getFormattedResults = function(inpArray) {
+ try{
+ //Clear all the hashtables
+ allSiteNamesHash = $H();
+ resultsHash = $H();
+ errorsHash = $H();
+ breakdownHash = $H();
+
+ //Populate the facility names hash and results hash tables
+ inpArray.each(function(item){
+ var qryName = item[0];
+ var brkDownCategoryOrError = item[1];
+ var facilityName = item[2];
+ var brkDownLabelorErrorMsg = item[3];
+ var brkDownValue = item[4];
+ var obfuscatedEntry = item[5];
+ var obfuscatedVal = item[5];
+ if(obfuscatedVal)
+ {
+ var tempObfuscated = obfuscatedEntry.split(" - ");
+ if(tempObfuscated && tempObfuscated.length>1)
+ obfuscatedVal = tempObfuscated[1];
+ }
+
+ var errorEntry = false;
+ if(brkDownCategoryOrError && brkDownCategoryOrError.indexOf("ERROR") > -1)
+ errorEntry = true;
+ if(brkDownCategoryOrError && brkDownCategoryOrError.indexOf("Still Processing Request") > -1)
+ errorEntry = true;
+ if(brkDownCategoryOrError && brkDownCategoryOrError.indexOf("Results not available") > -1)
+ errorEntry = true;
+
+ if(facilityName && qryName)
+ allSiteNamesHash.set(facilityName.trim(),qryName.trim());
+
+ //Is this a result entry or error entry
+ if(errorEntry)
+ {
+ if(facilityName && qryName)
+ errorsHash.set(facilityName.trim(),brkDownLabelorErrorMsg.trim());
+ }
+ else //this is a result entry
+ {
+ if(brkDownCategoryOrError && brkDownLabelorErrorMsg && obfuscatedVal)
+ {
+ var brkDownCategory = brkDownCategoryOrError.trim();
+ var brkDownLabel = brkDownLabelorErrorMsg.trim();
+ var keyId = brkDownCategory + "|" + brkDownLabel;
+ if(resultsHash.get(keyId))
+ {
+ var thisKeyDict = resultsHash.get(keyId);
+
+ //Save this site entry in proper breakdown hash
+ thisKeyDict.set(facilityName,{'integerValue' : brkDownValue, 'obfuscated':obfuscatedVal});
+ }
+ else
+ {
+ //Create a dictionary for the site in the very first entry
+ var thisKeyDict = $H();
+
+ //Create a dictionary for break down category for the very first site in input array
+ var thisSiteDict = $H();
+ thisSiteDict.set(facilityName,{'integerValue' : brkDownValue, 'obfuscated':obfuscatedVal});
+
+ resultsHash.set(keyId,thisSiteDict);
+ }
+ }
+ }
+ });
+
+ //We have all our required data hashed. Now lets make a tabular format from it.
+ var maxRowsNum = resultsHash.size();
+ var maxColsNum = allSiteNamesHash.size();
+
+ finalResultsArray = new Array(maxRowsNum+1);
+ for (var i = 0; i <= maxRowsNum; i++) {
+ finalResultsArray[i] = new Array(maxColsNum+1);
+ }
+
+ for(var i = 0 ; i<=maxRowsNum ; i++)
+ {
+ for(var j = 0 ;j<=maxColsNum; j++)
+ {
+ finalResultsArray[i][j]=' ';
+ }
+ }
+
+ finalOrderdSiteNamesHash = $H();
+ var count = 1;
+
+ allSiteNamesHash.keys().sort().each(function(orderedEntry)
+ {
+ finalOrderdSiteNamesHash.set(orderedEntry,count);
+ count++;
+ });
+
+ //Fill in the first row of the 2-D array with all site names in alphabetic order
+ finalResultsArray[0][0]='Site names';
+ finalOrderdSiteNamesHash.each(function(entry)
+ {
+ var col = entry.value;
+ var colEntry = entry.key;
+ finalResultsArray[0][col]=colEntry;
+ });
+
+ //Fill in the first column of the 2-D array with all the break down categories
+ var i=0;
+ var rowIndex = 0;
+
+ var temporaryCatgryArr = new Array(maxRowsNum);
+
+ resultsHash.keys().sort().each(function(breakdown){
+ try{
+ var patCountRow = false;
+ var lowerCaseBrkDown = breakdown.toLowerCase(); //Resolving case issue for same breakdown fact
+ if(breakdown.indexOf("Patient Count") > -1)
+ patCountRow = true;
+ if(!patCountRow)
+ {
+ if(!(breakdownHash.get(lowerCaseBrkDown))){
+ breakdownHash.set(lowerCaseBrkDown,rowIndex+2);
+ rowIndex++;
+ }
+ }
+ else
+ {
+ //Reserve the 2nd row for patient count data
+ finalResultsArray[1][0] = breakdown;
+ breakdownHash.set(lowerCaseBrkDown,1);
+ }
+ temporaryCatgryArr[i++] = breakdown;
+ }
+ catch(err1)
+ {
+ console.error("Error while sorting the breakdown categories : " + err1);
+ }
+ });
+
+ //Fill in the rest of data in the array
+ for(var i = 0 ; i < temporaryCatgryArr.length ; i++)
+ {
+ try{
+ var breakdownCat = temporaryCatgryArr[i];
+ var lowerCaseBrkDown = breakdownCat.toLowerCase();
+ var rowIndex = breakdownHash.get(lowerCaseBrkDown);
+ if(rowIndex){
+ var patCountRow = false;
+ if(breakdownCat.indexOf("Patient Count") > -1)
+ patCountRow = true;
+ if(resultsHash.get(breakdownCat))
+ {
+ var thisBrkDnHash = resultsHash.get(breakdownCat);
+ if(patCountRow) //Fill in the 2nd row with patient count data
+ finalResultsArray[1][0] = 'All Patients';
+ else
+ finalResultsArray[rowIndex][0] = breakdownCat;
+
+ thisBrkDnHash.each(function(item){
+ var siteName = item.key;
+ var siteIndex = finalOrderdSiteNamesHash.get(siteName);
+ var integerVal = item.value.integerValue;
+ finalResultsArray[rowIndex][siteIndex] = integerVal;
+ });
+ }
+ else
+ {
+ var err = "Caltegory " + breakdown + " was not found in resullt hashtable";
+ console.error(err);
+ }
+ }
+ }
+ catch(err1)
+ {
+ console.error("Error while putting together the results table : " + err1);
+ continue;
+ }
+ }
+ return finalResultsArray;
+ }
+ catch(err)
+ {
+ console.error(err);
+ return null;
+ }
+};
+
+i2b2.CRC.view.downloadData.getCSVFromResultsHash = function() {
+ var numberOfSites = finalOrderdSiteNamesHash.size();
+ if(numberOfSites>0)
+ {
+ var maxRowsNum = breakdownHash.size()+1;
+ var maxColNumber = numberOfSites+1;
+
+ var content = "<a href='#' onclick='javascript:i2b2.CRC.view.downloadData.exportTableToCSV();return false;'> Download CSV File </a><br/><br/><br/>";
+ content += "<table id='resultsTable'>";
+ content += "<tr>"+ //Beginning of Site names row
+ "<th colspan=\"" + maxColNumber + "\">SHRINE QUERY RESULTS (OBFUSCATED PATIENT COUNTS)</th>"+
+ "</tr>";
+
+ for(var i = 0 ; i < maxRowsNum ; i++)
+ {
+ content += "<tr>";
+
+ for(var j = 0 ; j < maxColNumber ; j++)
+ {
+ var thisRowColItem = finalResultsArray[i][j];
+ if(thisRowColItem)
+ {
+ if((thisRowColItem.trim().indexOf("10 patients or fewer"))>0)
+ thisRowColItem = 0;
+ if(i==0 && j==0)
+ content += "<td>&nbsp;</td>";
+ else{
+ if(thisRowColItem==' ')
+ content += "<td>&nbsp;</td>";
+ else
+ content += "<td>" + thisRowColItem + "</td>";
+ }
+ }
+ else
+ content += "<td>&nbsp;</td>";
+ }
+ content += "</tr>";
+ }
+
+ content += "</table>";
+ jQuery('#infoDownloadStatusData').append(content);
+ }
+ else
+ {}
+
+}
+
+i2b2.CRC.view.downloadData.exportTableToCSV = function () {
+
+ var table = jQuery('#resultsTable');
+ var filename = 'export.csv';
+ var rows = table.find('tr:has(td)');
+
+ // Temporary delimiter characters unlikely to be typed by keyboard
+ // This is to avoid accidentally splitting the actual contents
+ var tmpColDelim = String.fromCharCode(11); // vertical tab character
+ var tmpRowDelim = String.fromCharCode(0); // null character
+
+ // actual delimiter characters for CSV format
+ var colDelim = '","';
+ var rowDelim = '"\r\n"';
+
+ // Grab text from table into CSV formatted string
+ var csv = '"' + jQuery(rows).map(function (i, row) {
+ var row = jQuery(row),
+ cols = row.find('td');
+
+ return jQuery(cols).map(function (j, col) {
+ var col = jQuery(col),
+ text = col.text();
+
+ if(i==0 && j==0)
+ text = "SHRINE QUERY RESULTS (OBFUSCATED PATIENT COUNTS)";
+ else
+ {
+ if(elementIsEmpty(col))
+ text = "";
+ }
+ text = text.replace(/"/g, '""'); // escape double quotes
+ return text.replace(/,/g, '",'); // escape comma inside a field
+
+ }).get().join(tmpColDelim);
+
+ }).get().join(tmpRowDelim)
+ .split(tmpRowDelim).join(rowDelim)
+ .split(tmpColDelim).join(colDelim) + '"';
+
+ // Check Browser
+ var ua = window.navigator.userAgent;
+ var msie = ua.indexOf("MSIE ");
+ var browserIsIE = false;
+ if (msie > 0) // If Internet Explorer, return version number
+ browserIsIE = true;
+
+ if(browserIsIE)
+ {
+ if (window.navigator.msSaveOrOpenBlob) { // IE 10+
+ // var fileData = ['\ufeff'+csv];
+ // blobObject = new Blob(fileData);
+ var blobObject = new Blob([decodeURIComponent(encodeURI(csv))], {
+ type: "text/csv;charset=utf-8;"
+ });
+ navigator.msSaveOrOpenBlob(blobObject, filename);
+ return false;
+ }
+ else
+ {
+ var IEwindow = window.open();
+ IEwindow.document.write('sep=,\r\n' + csv);
+ IEwindow.document.close();
+ var success = IEwindow.document.execCommand('SaveAs', true, filename);
+ IEwindow.close();
+ if (!success)
+ alert("Sorry, your browser does not support this feature");
+ }
+ }
+ else
+ {
+ var mylink = document.createElement('a');
+ var csvData = 'data:application/csv;charset=utf-8,' + encodeURIComponent(csv);
+ mylink.download = filename;
+ mylink.href = csvData;
+ document.body.appendChild(mylink);
+ mylink.click();
+ }
+}
+
+function elementIsEmpty(td) {
+ if (td.text == '' || td.text() == ' ' || td.html() == '&nbsp;' || td.is(":not(:visible)")) {
+ return true;
+ }
+ return false;
+}
+
+// ================================================================================================== //
+
+
+console.timeEnd('execute time');
+console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Graphs.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Graphs.js
new file mode 100644
index 000000000..35be307ef
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Graphs.js
@@ -0,0 +1,1033 @@
+/** -----------------------------------------------------------------------------------------------------------------------
+ * @projectDescription View controller for the query graph window (which is a GUI-only component of the CRC module).
+ * @inherits i2b2.CRC.view
+ * @namespace i2b2.CRC.view.graphs
+ * @author Shawn Murphy MD PhD, Hannah Murphy
+ * @version 1.7
+ * @description This set of functions uses D3 and its derivative C3 to graph the text that results in the query-status-window
+ * of the i2b2 web client.
+ * The main function is "createGraphs".
+ * Because it makes extensive use of Vector Graphic in the D3 library it will only work in Microsoft Internet
+ * Explorer 9 and above. It assumes the STATUS window is a specific height which is 146px. In theory the
+ * Width can vary, but right not it is set to 535px in many places.
+ * It draws the graphs in a div (which should be the dimensions above), using a string which is essentially
+ * screen-scraped from the text what is placed in the query_status box of the web client. To distinguish the
+ * normal i2b2 vs. SHRINE text, a boolean flag is used. A regular i2b2 result (bIsMultiSite = false)
+ * or a SHRINE result (bIsMultiSite = true).
+ * Internally, everything works off an array the is produced from the test that is a six element array of
+ * **** 0 "query name", 1 "title", 2 "site", 3 "element name", 4 quantity, 5 "sentence" ****
+ * for example, one element would be:
+ * **** ["Circulatory sys@20:21:19", "Age patient breakdown", "MGH" "0-9 years old", 0, "0-9 years old: 0"] ****
+ * It also uses some jQuery, but only for the scroll bar function with *** jQuery Stuff ***
+ * in the comments.
+ * There are four web client javascript files in the CRC folder that have references to functions in this
+ * javascript file, and the default.htm folder in the main web client folder, they are:
+ * CRC_view_Status, CRC_ctlr_QryStatus, CRC_ctlr_QryTools, and cell_config_data
+ ** -----------------------------------------------------------------------------------------------------------------------*/
+console.group('Load & Execute component file: CRC > view > Graphs');
+console.time('execute time');
+
+//i2b2.PM.model.isObfuscated = true; // for testing
+
+// Constants
+var msSpecialBreakdownSite = ""; // this constant designates a site from which the breakdown arrays will always be obtained
+var msStringDefineingNumberOfPatients = "number of patients"; // this constant is what appears in the breakdown text
+// which is the number of patients and is lower cased and trimmed on both sides for comparison
+
+// create and save the screen objects and more constants
+
+i2b2.CRC.view.graphs = new i2b2Base_cellViewController(i2b2.CRC, 'graphs');
+i2b2.CRC.view.graphs.visible = false;
+i2b2.CRC.view.graphs.iObfuscatedFloorNumber = 3; // this is the amount reported that the numbers are obfuscated by
+i2b2.CRC.view.graphs.sObfuscatedText = "<3"; // this is the text that is replaced for a small number in obfuscated mode
+// so that it can be cleaned up before the next display
+i2b2.CRC.view.graphs.sObfuscatedEnding = "&plusmn;3"; //this is the text that is added to all numbers in obfuscated mode
+i2b2.CRC.view.graphs.sObfuscatedSHRINEText = "10 patients or fewer"; // this is the text that is replaced for a small number in obfuscated mode
+// so that it can be cleaned up before the next display
+i2b2.CRC.view.graphs.sObfuscatedSHRINEEnding = "+-3 patients"; //this is the text that is added to all numbers in obfuscated mode
+//i2b2.CRC.view.graphs.bIsSHRINE = false; // this changes the way the graphs are made if the file is being run in SHRINE mode
+// NOTE THAT THIS IS DEMO ONLY IN THIS VERSION - IT DOES NOT REALLY WORK
+i2b2.CRC.view.graphs.asTitleOfShrineGroup = [];
+
+// These functions manage the graph divs, but DECISIONS are made in the CRC_view_Status code
+
+i2b2.CRC.view.graphs.show = function() {
+ i2b2.CRC.view.graphs.visible = true;
+ $('crcGraphsBox').show();
+}
+i2b2.CRC.view.graphs.hide = function() {
+ i2b2.CRC.view.graphs.visible = false;
+ $('crcGraphsBox').hide();
+}
+
+i2b2.CRC.view.graphs.showDisplay = function() {
+ var targs = $('infoQueryStatusChart').parentNode.parentNode.select('DIV.tabBox.active');
+ // remove all active tabs
+ targs.each(function(el) { el.removeClassName('active'); });
+ // set us as active
+ $('infoQueryStatusChart').parentNode.parentNode.select('DIV.tabBox.tabQueryGraphs')[0].addClassName('active');
+ $('infoQueryStatusChart').show();
+}
+
+i2b2.CRC.view.graphs.hideDisplay = function() {
+ $('infoQueryStatusChart').hide();
+}
+
+// ================================================================================================== //
+
+
+/*********************************************************************************
+ FUNCTION createGraphs
+ Takes a Div, the text from the query status view, and a multisite flag and populates the Div
+**********************************************************************************/
+i2b2.CRC.view.graphs.createGraphs = function(sDivName, sInputString, bIsMultiSite) {
+ try {
+ if (sDivName === undefined || sDivName === null || sDivName === "") throw ("ERROR 201 - sDivName in function createGraphs is null");
+ //i2b2.CRC.view.graphs.sNameOfPreviousDiv = sDivName;
+ i2b2.CRC.view.graphs.clearGraphs(sDivName);
+ if (!i2b2.CRC.view.graphs.bisGTIE8) {
+ i2b2.CRC.view.graphs.aDivForIE8(sDivName);
+ return;
+ }
+ // if (bIsMultiSite) sInputString = i2b2.CRC.view.graphs.returnTestString(true); //For testing
+
+ if (sInputString === undefined || sInputString === null || sInputString === "") throw ("ERROR 202 - sInputString in function createGraphs is null");
+ var asBreakdownArray = [[]];
+ var iBreakdown = 0;
+
+ // make the input array
+ var asInputArray = i2b2.CRC.view.graphs.parseInputIntoArray(sInputString, bIsMultiSite);
+ // Pull out unique breakdown types
+ var asBreakdownTypes = [];
+ var iBreakdown = 0;
+ for (var i = 0; i < asInputArray.length; i++) {
+ asBreakdownTypes[iBreakdown] = asInputArray[i][1];
+ iBreakdown++;
+ }
+ var asUniqueBreakdownTypes = [];
+ for (var i=0; i < asBreakdownTypes.length; i++) {
+ if (asUniqueBreakdownTypes.indexOf(asBreakdownTypes[i]) === -1 && asBreakdownTypes[i] !== '')
+ asUniqueBreakdownTypes.push(asBreakdownTypes[i]);
+ }
+ if (asUniqueBreakdownTypes.length === 0) throw ("ERROR 203 in createGraphs, there are no breakdown types in *unique* array");
+ // rearrange unique array so that patient number is on the top
+ for (var i = 0; i < asUniqueBreakdownTypes.length; i++) {
+ if (asUniqueBreakdownTypes[i].toLowerCase().trim() == msStringDefineingNumberOfPatients.toLowerCase().trim()) {
+ var sTempVariable = asUniqueBreakdownTypes[0];
+ asUniqueBreakdownTypes[0] = asUniqueBreakdownTypes[i];
+ asUniqueBreakdownTypes[i] = sTempVariable;
+ break;
+ }
+ }
+
+ //Make Divs in the original div for the charts
+ oParentDiv = document.getElementById(sDivName);
+ for (var i=0; i<asUniqueBreakdownTypes.length; i++){
+ sChartDivName = "chart"+i;
+ var child = document.createElement("div");
+ child.setAttribute("id",sChartDivName);
+ child.setAttribute("class","chartDiv");
+ var chartTitleId = "chartTitle" + i;
+ var childTitle = document.createElement("div");
+ childTitle.setAttribute("id",chartTitleId);
+ childTitle.setAttribute("class","chartTitleDiv");
+ // child.setAttribute("width","auto");
+ oParentDiv.appendChild(childTitle);
+ oParentDiv.appendChild(child);
+
+ }
+ // populate each Div with a graph
+ // populate the Div that has the number of patients first to make it the top one
+ if (!bIsMultiSite) {
+ var iIncrement = 0;
+ if (asUniqueBreakdownTypes[0].toLowerCase().trim() == msStringDefineingNumberOfPatients.toLowerCase().trim()) {
+ graph_singlesite_patient_number("chart0", asUniqueBreakdownTypes[0], asInputArray);
+ iIncrement = 1;
+ }
+ //graph_singlesite_patient_number("chart0", asUniqueBreakdownTypes[0], asInputArray);
+ for (var i=0+iIncrement; i<asUniqueBreakdownTypes.length; i++){
+ graph_singlesite_patient_breakdown("chart"+i, asUniqueBreakdownTypes[i], asInputArray);
+ }
+ }
+ else {
+ var _2DResultsArray = i2b2.CRC.view.downloadData.getFormattedResults(asInputArray);
+ if(_2DResultsArray)
+ {
+ var siteReturningResults = $H();
+ var sitesReturningError = $H();
+ var allSites = _2DResultsArray[0];
+ if(allSites && allSites.length>0)
+ {
+ for(var x = 1; x < allSites.length ; x++)
+ {
+ var siteName = allSites[x];
+ siteReturningResults.set(siteName,x); //SiteName,Index pairs
+ sitesReturningError.set(siteName,true);
+ }
+ }
+
+ for(var x = 2; x < _2DResultsArray.length ; x++) //Skipping the site name and patient count rows
+ {
+ var thisSiteData = _2DResultsArray[x];
+ for(var y = 1 ; y < thisSiteData.length; y++) //Skip the category name column
+ {
+ if(thisSiteData[y] != " ")
+ {
+ var siteName = null;
+ siteReturningResults.each(function(item){
+ if(item.value==y)
+ {
+ siteName = item.key;
+ }
+ });
+ if(siteName){
+ sitesReturningError.unset(siteName);
+
+ }
+ }
+
+ }
+ }
+
+ sitesReturningError.each(function(item){
+ if(siteReturningResults.get(item.key))
+ siteReturningResults.unset(item.key);
+ });
+ }
+
+ var titleDiv = jQuery("#" + sDivName + ' #chartTitle0');
+ if(titleDiv)
+ titleDiv.html("Patient Count");
+ graph_multiplesite_patient_number("#" + sDivName + " #chart0", asUniqueBreakdownTypes[0], asInputArray);
+
+ for (var i=1; i<asUniqueBreakdownTypes.length; i++){
+ var chartDivId = "chart"+i;
+ var title = asUniqueBreakdownTypes[i];
+ if(title.indexOf('ERROR')>=0) continue;
+ if(title.toLowerCase().indexOf('vital')>=0)
+ title = title + ' Status';
+
+ var chartTitle = "Patient " + title + " Count Breakdown";
+ var titleDiv = jQuery("#" + sDivName + ' #chartTitle' + i);
+ if(titleDiv)
+ titleDiv.html(chartTitle);
+ var dataArray = i2b2.CRC.view.graphs.getGraphDataArray(_2DResultsArray,asUniqueBreakdownTypes[i],siteReturningResults);
+ graph_multiplesite_patient_breakdown("#" + sDivName + " #" + chartDivId, siteReturningResults.keys(), dataArray);
+ }
+
+ }
+
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function createGraphs
+
+i2b2.CRC.view.graphs.getGraphDataArray = function(_2DResultsArray,breakdownType,siteHash) {
+ var maxRowsNum = siteHash.size();
+ if(maxRowsNum>0)
+ {
+ var breakdownHash = $H();
+
+ for(x=2;x<_2DResultsArray.length;x++) //Skip the first row which consists of only site names and 2nd row that has total patient count
+ {
+ var thisRow = _2DResultsArray[x];
+ var category = thisRow[0];
+ if(category == " ") continue;
+ if(category.toLowerCase().indexOf(breakdownType.toLowerCase())>=0)
+ {
+ breakdownHash.set(category,x);
+ }
+ }
+
+ var maxColsNum = breakdownHash.size() + 1;
+ var graphDataArray = new Array(maxRowsNum+1);
+ for (var i = 0; i <= maxRowsNum; i++) {
+ graphDataArray[i] = new Array(maxColsNum);
+ }
+
+
+ graphDataArray[0][0] = 'x';
+ var dataArrayColIndex = 1;
+ breakdownHash.each(function(item){
+ var dataArrayRowIndex = 0;
+ var inpArrayRowIndex = item.value;
+ var breakDownCategory = item.key;
+ var breakDown = breakDownCategory;
+ var tempBrkDn = breakDownCategory.split("|");
+ if(tempBrkDn.length>1)
+ breakDown = tempBrkDn[1];
+ graphDataArray[dataArrayRowIndex][dataArrayColIndex] = breakDown;
+ dataArrayRowIndex++;
+ siteHash.each(function(entry){
+ var siteName = entry.key;
+ var inpArrayColIndex = entry.value;
+ graphDataArray[dataArrayRowIndex][0] = siteName;
+ var breakDownValue = _2DResultsArray[inpArrayRowIndex][inpArrayColIndex];
+ if(breakDownValue == " ")
+ breakDownValue = "Not Provided";
+ graphDataArray[dataArrayRowIndex][dataArrayColIndex] = breakDownValue;
+ dataArrayRowIndex++;
+ });
+ dataArrayColIndex++;
+ });
+
+ return graphDataArray;
+ }
+ else
+ return null;
+}
+
+/*****************************************************************************************************
+ @Function i2b2.CRC.view.graphs.parseInputIntoArray(sInputString, isMultiSite)
+ @Input (String *text from query status*, Boolean false = single site, true = multiple site)
+ @Output Create a two dimensional array out of these strings called asInputFragments
+ Each array element is a six element array of 0 "query name", 1 "title", 2 "site", 3 "element name", 4 quantity, 5 "sentence"
+ for example, one element would be ["Circulatory sys@20:21:19", "Age patient breakdown", "MGH" "0-9 years old", 0, "0-9 years old: 0"]
+
+*****************************************************************************************************/
+i2b2.CRC.view.graphs.parseInputIntoArray = function(sInputString, isMultiSite) {
+var sCheckForNothing = "something"; // this gets checked to be a zero length string
+ try {
+ var old_demo = false;
+ if (sInputString === undefined || sInputString === null || sInputString === "") throw ("ERROR - sInputString in function parseInputIntoArray is empty");
+ var asInputFragments = [[]];
+ if (!isMultiSite) {
+ var asTempArray = [];
+ var sLatestTitle, sLatestQueryName, sLatestElementName, iLatestQuantity, sLatestSite;
+ // process input one line at a time to look for the start of a block.
+ // you know it because it has two \"'s
+ // begin your parsing by separating into an array of sentences that were delimited with \n
+ var asInputSentences = sInputString.split("\n");
+ var iFragmentArrayCounter = 0;
+ for(var i = 0; i < asInputSentences.length; i++) {
+ if (asInputSentences[i].indexOf("for") > 0) {
+ asTempArray = asInputSentences[i].split("for");
+ sLatestTitle = asTempArray[0];
+ sLatestQueryName = asTempArray[1];
+ sLatestSite = ".";
+ } else if (asInputSentences[i].indexOf(":") > 0) {
+ asTemp2Array = asInputSentences[i].split(":");
+ sLatestElementName = asTemp2Array[0];
+ iLatestQuantity = asTemp2Array[1];
+ asInputFragments[iFragmentArrayCounter] = new Array (6);
+ asInputFragments[iFragmentArrayCounter][0] = sLatestQueryName;
+ asInputFragments[iFragmentArrayCounter][1] = sLatestTitle;
+ asInputFragments[iFragmentArrayCounter][2] = sLatestSite;
+ asInputFragments[iFragmentArrayCounter][3] = sLatestElementName;
+ asInputFragments[iFragmentArrayCounter][4] = i2b2.CRC.view.graphs.sValueOfi2b2Text(iLatestQuantity);
+ asInputFragments[iFragmentArrayCounter][5] = asInputSentences[i];
+ for(var j = 0; j < 6; j++) {
+ }
+ iFragmentArrayCounter++;
+ } else {
+ }
+ }
+ }
+ else if (old_demo == true) { // parsing for old_demo SHRINE strings
+ var asTempArray = [];
+ var asTemp2Array = [];
+ var sLatestTitle, sLatestQueryName, sLatestElementName, iLatestQuantity, sLatestSite;
+ // process input one line at a time to look for the start of a block.
+ // you know it because it has two \"'s
+ // begin your parsing by separating into an array of sentences that were delimited with \n
+ var asInputSentences = sInputString.split("\n");
+ var iFragmentArrayCounter = 0;
+ for (var i = 0; i < asInputSentences.length; i++) {
+ if (asInputSentences[i].indexOf("for") > 0) {
+ asTempArray = asInputSentences[i].split("for");
+ sLatestTitle = asTempArray[0];
+ if (asTempArray[1].indexOf("=") > 0) {
+ asTemp2Array = asTempArray[1].split("=");
+ sLatestQueryName = asTemp2Array[0];
+ sLatestSite = asTemp2Array[1];
+ }
+ else {
+ sLatestQueryName = asTempArray[1];
+ sLatestSite = "xxx";
+ }
+ } else if (asInputSentences[i].indexOf(":") > 0) {
+ asTemp2Array = asInputSentences[i].split(":");
+ sLatestElementName = asTemp2Array[0];
+ iLatestQuantity = asTemp2Array[1];
+ //document.write("<br /> Element " + i + " = " + asInputSentences[i]);
+ asInputFragments[iFragmentArrayCounter] = new Array (6);
+ asInputFragments[iFragmentArrayCounter][0] = sLatestQueryName;
+ asInputFragments[iFragmentArrayCounter][1] = sLatestTitle;
+ asInputFragments[iFragmentArrayCounter][2] = sLatestSite;
+ asInputFragments[iFragmentArrayCounter][3] = sLatestElementName;
+ asInputFragments[iFragmentArrayCounter][4] = iLatestQuantity;
+ asInputFragments[iFragmentArrayCounter][5] = asInputSentences[i];
+ iFragmentArrayCounter++;
+ } else {
+ }
+ }
+ }
+ else { // parsing for SHRINE strings
+
+ //Read all the main breakdown categories
+ var asInputSentences = sInputString.split("\n");
+
+ var actualBrkDowns = $H();
+ for (var i = 0; i < asInputSentences.length; i++) {
+ var thisLine = asInputSentences[i];
+ if(thisLine && thisLine.toLowerCase().trim().indexOf('breakdown')>0)
+ {
+ asTemp2Array = thisLine.split(":"); // Finding a type of breakdown
+ mainCategory = asTemp2Array[0].trim();
+ actualBrkDowns.set(mainCategory,mainCategory);
+ }
+ }
+ i2b2.CRC.view.graphs.asTitleOfShrineGroup = [];
+ actualBrkDowns.each(function(category)
+ {
+ i2b2.CRC.view.graphs.asTitleOfShrineGroup.push(category.key);
+ });
+
+ var asInputFragments = [[]];
+ try{
+ // parsing for SHRINE strings
+ var asTempArray = [];
+ var asTemp2Array = [];
+ var asInputSentencesBySite =[];
+ var sLatestTitle, sLatestQueryName, sLatestElementName, iLatestQuantity, sLatestSite, sQueryName;
+ var aSiteArray = [];
+ var aTempSiteArray = [];
+ // process input one line at a time to look for the start of a block.
+ // you know it because it has two \"'s
+ // begin your parsing by separating into an array of sentences that were delimited with \n
+ var iQueryNameIndex = -1;
+
+ // look for query title
+ for (var i = 0; i < asInputSentences.length; i++) {
+ if (asInputSentences[i].indexOf("Finished Query:") !== -1) {
+ asTempArray = asInputSentences[i].split('Finished Query:');
+ sQueryName = asTempArray[1].trim();
+ iQueryNameIndex = i;
+ break;
+ }
+ }
+ if (iQueryNameIndex == -1) return;
+ sLatestQueryName = sQueryName;
+ // look for Hospitals (which are to the right of the query name) and put each hospital into an array
+ var iSiteNumber = -1;
+ for (var i = iQueryNameIndex+1; i < asInputSentences.length; i++) {
+ if (asInputSentences[i].indexOf(sQueryName) !== -1) {
+ if (iSiteNumber !== -1) aSiteArray[iSiteNumber] = aTempSiteArray;
+ iSiteNumber = iSiteNumber + 1;
+ aTempSiteArray = new Array(3);
+ asTempArray = asInputSentences[i].split(sQueryName);
+ aTempSiteArray[0] = asTempArray[0].trim();
+ aTempSiteArray[1] = i;
+ } else {
+ aTempSiteArray[2] = i;
+ }
+ }
+ if (iSiteNumber == -1) return;
+ aSiteArray[iSiteNumber] = aTempSiteArray;
+ var iBeginIndex;
+ var iEndIndex;
+ var iFragmentArrayCounter=0;
+ for(var ii = 0; ii <= iSiteNumber; ii++) {
+ sLatestSite = aSiteArray[ii][0];
+ iBeginIndex = aSiteArray[ii][1];
+ iEndIndex = aSiteArray[ii][2];
+ for(var i = iBeginIndex; i < iEndIndex; i++) {
+ var a = asInputSentences[i];
+ if (asInputSentences[i].indexOf("Patient Count") > -1) {
+ asTemp2Array = asInputSentences[i].split(" -");
+ sLatestTitle = 'Patient Count:';
+ sLatestElementName = 'Patient Count:';
+ iLatestQuantity = asTemp2Array[1];
+ asInputFragments[iFragmentArrayCounter] = new Array (6);
+ asInputFragments[iFragmentArrayCounter][0] = sLatestQueryName;
+ asInputFragments[iFragmentArrayCounter][1] = sLatestTitle;
+ asInputFragments[iFragmentArrayCounter][2] = sLatestSite;
+ asInputFragments[iFragmentArrayCounter][3] = sLatestElementName;
+ asInputFragments[iFragmentArrayCounter][4] = i2b2.CRC.view.graphs.sValueOfSHRINEText(iLatestQuantity);
+ asInputFragments[iFragmentArrayCounter][5] = asInputSentences[i];
+ iFragmentArrayCounter++;
+ } else if (i2b2.CRC.view.graphs.asTitleOfShrineGroup.indexOf(asInputSentences[i]) > -1) {
+ asTemp2Array = asInputSentences[i].split(" "); // Finding a type of breakdown
+ sLatestTitle = asTemp2Array[1].trim();
+ sCheckForNothing = asTemp2Array[1];
+
+ } else if (asInputSentences[i].indexOf(" -") > -1) { // parsing the values
+ //Lets make sure the - is not part of query name
+ if (asInputSentences[i].indexOf('"') < 0){
+ asTemp2Array = asInputSentences[i].split(" -");
+ sLatestElementName = asTemp2Array[0];
+ iLatestQuantity = asTemp2Array[1];
+ if (i2b2.CRC.view.graphs.asTitleOfShrineGroup.indexOf(sLatestElementName.toLowerCase().trim()) > -1) {
+ sLatestTitle = sLatestElementName.trim();
+ sCheckForNothing = iLatestQuantity;
+ }
+ asInputFragments[iFragmentArrayCounter] = new Array (6);
+ asInputFragments[iFragmentArrayCounter][0] = sLatestQueryName;
+ asInputFragments[iFragmentArrayCounter][1] = sLatestTitle;
+ asInputFragments[iFragmentArrayCounter][2] = sLatestSite;
+ asInputFragments[iFragmentArrayCounter][3] = sLatestElementName;
+ asInputFragments[iFragmentArrayCounter][4] = i2b2.CRC.view.graphs.sValueOfSHRINEText(iLatestQuantity);
+ asInputFragments[iFragmentArrayCounter][5] = asInputSentences[i];
+ iFragmentArrayCounter++;
+ }
+ } else if ((asInputSentences[i].indexOf("ERROR") > -1) || (asInputSentences[i].indexOf("Still Processing Request") > -1) || (asInputSentences[i].indexOf("Results not available") > -1)) {
+ asTemp2Array = asInputSentences[i].split(" : ");
+ sLatestError = asTemp2Array[0];
+ iLatestErrorMsg = asTemp2Array[1];
+ asInputFragments[iFragmentArrayCounter] = new Array (6);
+ asInputFragments[iFragmentArrayCounter][0] = sLatestQueryName;
+ asInputFragments[iFragmentArrayCounter][1] = sLatestError;
+ asInputFragments[iFragmentArrayCounter][2] = sLatestSite;
+ asInputFragments[iFragmentArrayCounter][3] = iLatestErrorMsg;
+ asInputFragments[iFragmentArrayCounter][4] = '';
+ asInputFragments[iFragmentArrayCounter][5] = '';
+ iFragmentArrayCounter++;
+ } else {
+ //Not required to parse
+ } // and of fragment processing if statement
+ //document.write("<br> Element " + i + " = " + sLatestTitle + " " + sLatestQueryName + " " + sLatestElementName + " " + iLatestQuantity);
+ } //
+ } // end of for loop that processes sites in SHRINE
+ }
+ catch(err)
+ {
+ console.error(err);
+ }
+ } // end of if statement that directs to single or multisite
+
+ return asInputFragments
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function i2b2.CRC.view.graphs.parseInputIntoArray
+
+
+/*********************************************************************************
+ FUNCTION graph_singlesite_patient_number
+ Fills in the Div for a single patient number display
+**********************************************************************************/
+function graph_singlesite_patient_number(sDivName, sBreakdownType, asInputFragments) {
+ try {
+ if (sBreakdownType === undefined || sBreakdownType === null) throw ("ERROR - sBreakdownType in function graph_patient_breakdown is null");
+ var asBreakdownArray = [[]];
+ var iBreakdown = 0;
+
+ // for loop to only pull out data from the breakdown type specified in sBreakdownType variable
+ for (var i = 0; i < asInputFragments.length; i++) {
+ if (asInputFragments[i][1].toLowerCase().trim() === sBreakdownType.toLowerCase().trim()) {
+ //document.write("<br /> OK? " + i + " = " + asInputFragments[i][0]);
+ asBreakdownArray[iBreakdown] = new Array (2);
+ asBreakdownArray[iBreakdown][0] = asInputFragments[i][3];
+ asBreakdownArray[iBreakdown][1] = asInputFragments[i][4];
+ iBreakdown++;
+ } else {
+ //document.write("<br /> ERROR? " + i + " = " + asInputFragments[i][0]);
+ }
+ }
+ // establish style and draw out containing Div
+ var sDivStyle = "font-family: Verdana, Geneva, sans-serif;"
+ + "font-size: 12px;"
+ + "text-align: center;"
+ + "vertical-align: middle;"
+ + "background-color: white;"
+ + "width: 100%;";
+ document.getElementById(sDivName).setAttribute("style",sDivStyle);
+ // establish table in Div and set up its style.
+ var sDisplayNumber = i2b2.CRC.view.graphs.sTexti2b2Value(asBreakdownArray[0][1]);
+ var sTableHtml = '<table style="width: 400px; margin-left: auto; margin-right: auto;">' +
+ '<tr style="background-color: white">' +
+ '<td style="color: red; text-align: center; vertical-align: middle;">&nbsp</td>' +
+ '</tr>' +
+ '<tr style="background-color: #B0C4DE">' +
+ '<td style="color: black; text-align: center; vertical-align: middle;">'+sBreakdownType+'</td>' +
+ '</tr>' +
+ '<tr style="background-color: #B0C4DE">' +
+ '<td style="color: darkblue; text-align: center; vertical-align: middle; font-size: 45px">'+sDisplayNumber+'</td>' +
+ '</tr>' +
+ '<tr style="background-color: #B0C4DE">' +
+ '<td style="color: black; text-align: center; vertical-align: middle;">For Query '+asInputFragments[0][0]+'</td>' +
+ '</tr>' +
+ '<tr style="background-color: white">' +
+ '<td style="color: red; text-align: center; vertical-align: middle;">&nbsp</td>' +
+ '</tr>' +
+ '</table>';
+ document.getElementById(sDivName).innerHTML = sTableHtml;
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function graph_single_patient_number
+
+
+/*********************************************************************************
+ FUNCTION graph_singlesite_patient_breakdown
+ function where the dataset is displayed
+**********************************************************************************/
+function graph_singlesite_patient_breakdown(sDivName,sBreakdownType,asInputFragments) {
+
+ try {
+ if (sBreakdownType === undefined || sBreakdownType === null) throw ("ERROR 101 in graph_patient_breakdown, sBreakdownType is null");
+ var asBreakdownArray = [[]];
+ var iBreakdown = 0;
+ // for loop to only pull out data from the breakdown type specified in sBreakdownType variable
+ // for multiple sites make a data array for each site
+ for (var i = 0; i < asInputFragments.length; i++) {
+ if (asInputFragments[i][1].toLowerCase().trim() === sBreakdownType.toLowerCase().trim()) {
+ //console.log("IN> " + i + " = " + asInputFragments[i][2]);
+ asBreakdownArray[iBreakdown] = new Array (3);
+ asBreakdownArray[iBreakdown][0] = asInputFragments[i][2]; // site
+ asBreakdownArray[iBreakdown][1] = asInputFragments[i][3]; // text
+ asBreakdownArray[iBreakdown][2] = asInputFragments[i][4]; // number
+ iBreakdown++;
+ } else {
+ //console.log("OUT> " + i + " = " + asInputFragments[i][0]); // items that were left out
+ }
+ }
+ // the text 'patient breakdown' is removed and remainder trimmed
+ var sBreakdownText = "";
+ var iPbLocation = sBreakdownType.toLowerCase().indexOf(" patient breakdown");
+ if (iPbLocation != -1) {
+ sBreakdownText = sBreakdownType.substring(0,iPbLocation);
+ //console.log(sBreakdownText + "|");
+ } else {
+ sBreakdownText = sBreakdownType;
+ //console.log(sBreakdownText + "it is");
+ }
+ // function where the dataset arrays are created:
+ var iBreakdown = 1;
+ var c3xaxis = new Array();
+ var c3values = new Array();
+ c3xaxis[0] = 'x';
+ c3values[0] = sBreakdownText;
+ for (var i = 0; i < asInputFragments.length; i++) {
+ if (asInputFragments[i][1].toLowerCase().trim() === sBreakdownType.toLowerCase().trim()) {
+ //document.write("<br /> OK? " + i + " = " + asInputFragments[i][0]);
+ c3xaxis[iBreakdown] = asInputFragments[i][3];
+ c3values[iBreakdown] = asInputFragments[i][4];
+ iBreakdown++;
+ } else {
+ //document.write("<br /> ERROR? " + i + " = " + asInputFragments[i][0]);
+ }
+ }
+
+ // Trying out some C3
+ var graph_color = 'darkblue';
+ //var graph_color = 'hsl(' + Math.floor( 360 * Math.random() ) + ', 85%, 55%)'; // random color
+ if(!(typeof c3 === 'undefined')){
+ var chart = c3.generate({
+ bindto: '#' + sDivName,
+ size: {
+ //width: 535,
+ height: 200
+ },
+ data: {
+ x: 'x',
+ columns: [
+ c3xaxis,
+ c3values
+ ],
+ type: 'bar',
+ color: function (color, d) {return graph_color;},
+ labels: true
+ },
+ legend: {
+ //position: 'inset'
+ position: 'right'
+ },
+ axis: {
+ x: {
+ type: 'category',
+ tick: {
+ rotate: 25
+ },
+ height: 45
+ },
+ y: {
+ label: {
+ text: 'Number of Patients',
+ //position: 'outer-middle',
+ position: 'outer-bottom'
+ }
+ }
+ },
+ bar: {
+ width: {
+ ratio: 0.75 // this makes bar width 75% of length between ticks
+ }
+ }
+ });
+ }
+ }
+ catch(err) {
+ console.error(err);
+ }
+}; // end of function graph_singlesite_patient_breakdown
+
+
+/*********************************************************************************
+ FUNCTION graph_multiplesite_patient_number
+ Fills in the Div for multiple patient number display
+**********************************************************************************/
+function graph_multiplesite_patient_number(sDivName,sBreakdownType,asInputFragments) {
+ try
+ {
+ if (sBreakdownType === undefined || sBreakdownType === null) throw ("ERROR - sBreakdownType in function graph_patient_breakdown is null");
+ var asBreakdownArray = [[]];
+ var iBreakdown = 0;
+ // for loop to only pull out data from the breakdown type specified in sBreakdownType variable
+ // for multiple sites make a data array for each site
+ for (var i = 0; i < asInputFragments.length; i++) {
+ if (asInputFragments[i][1].toLowerCase().trim() === sBreakdownType.toLowerCase().trim()) {
+ //console.log("IN> " + i + " = " + asInputFragments[i][2]);
+ asBreakdownArray[iBreakdown] = new Array (3);
+ asBreakdownArray[iBreakdown][0] = asInputFragments[i][2]; // site
+ asBreakdownArray[iBreakdown][1] = asInputFragments[i][3]; // text
+ asBreakdownArray[iBreakdown][2] = asInputFragments[i][4]; // number
+ iBreakdown++;
+ } else {
+ //console.log("OUT> " + i + " = " + asInputFragments[i][0]); // items that were left out
+ }
+ }
+ // function where the dataset arrays are created:
+ var c3values = new Array();
+ for (var i = 0; i < asBreakdownArray.length; i++) {
+ //console.log("Element " + i + " = " + asBreakdownArray[i][0] + " " + asBreakdownArray[i][2]);
+ c3values[i] = new Array(2);
+ c3values[i][0] = asBreakdownArray[i][0].trim() + " " + asBreakdownArray[i][1].trim();
+ c3values[i][1] = Number(asBreakdownArray[i][2]);
+ }
+ // C3 that makes pie chart
+ if(!(typeof c3 === 'undefined')){
+ var chart = c3.generate({
+ bindto: sDivName,
+ size: {
+ //width: 535,
+ height: 200
+ },
+ data: {
+ columns: c3values,
+ type: 'pie'
+ },
+ pie: {
+ label: {
+ format: d3.format('^g,')
+ }
+ },
+ legend: {
+ position: 'right'
+ },
+ axis: {
+ x: {
+ type: 'category',
+ tick: {
+ rotate: 25
+ },
+ height: 45
+ },
+ y: {
+ label: {
+ text: 'Number of Patients',
+ position: 'outer-bottom'
+ }
+ }
+ },
+ bar: {
+ width: {
+ ratio: 0.75 // this makes bar width 75% of length between ticks
+ }
+ }
+ });
+ }
+ }
+ catch(err) {
+ console.error(err);
+ }
+}; // end of function graph_multiplesite_patient_number
+
+
+/*********************************************************************************
+ FUNCTION graph_multiplesite_patient_breakdown
+ function where the dataset is displayed
+**********************************************************************************/
+function graph_multiplesite_patient_breakdown(sDivName,asUniqueBreakdownSites,c3dataarray) {
+ try {
+ if(!(typeof c3 === 'undefined')){
+ var chart = c3.generate({
+ bindto: sDivName,
+ size: {
+ width: 1000,
+ height: 200
+ },
+ data: {
+ x: 'x',
+ columns: c3dataarray,
+ type: 'bar',
+ groups: [asUniqueBreakdownSites]
+ },
+ padding: {
+ left: 60,
+ bottom: 40
+ },
+ legend: {
+ position: 'right'
+ },
+ axis: {
+ x: {
+ type: 'category',
+ tick: {
+ rotate: 25
+ },
+ height: 45
+ },
+ y: {
+ label: {
+ text: 'Number of Patients'
+ // position: 'outer-bottom'
+ }
+ }
+ },
+ bar: {
+ width: {
+ ratio: 0.50 // this makes bar width 75% of length between ticks
+ }
+ }
+ });
+ }
+ }
+ catch(err) {
+ console.error(err);
+ }
+}; // end of function graph_multiplesite_patient_breakdown
+
+/*********************************************************************************
+ FUNCTION ie
+ function to test for the version of internet explorer
+ usage if ie < 9 then ...
+**********************************************************************************/
+var ie = (function(){
+
+ var undef,
+ v = 3,
+ div = document.createElement('div'),
+ all = div.getElementsByTagName('i');
+
+ while (
+ div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
+ all[0]
+ );
+
+ return v > 4 ? v : undef;
+
+}());
+
+/*********************************************************************************
+ FUNCTION bisGTIE8
+ function to specifically test for internet explorer gt 8 or any other browser
+ which returns "true"
+ usage if bisGTIE8 then ...
+**********************************************************************************/
+i2b2.CRC.view.graphs.bisGTIE8 = (function(){
+ try {
+ if ( document.addEventListener ) {
+ //alert("you got IE9 or greater (or a modern browser)");
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+ catch (e) {
+ return false;
+ }
+}());
+
+/*********************************************************************************
+ FUNCTION sValueOfi2b2Text
+ Return a INTEGER number that was obfuscated = MAKES IT ZERO
+**********************************************************************************/
+
+i2b2.CRC.view.graphs.sValueOfi2b2Text = function(sValue) {
+ try {
+ if (sValue === undefined || sValue === null || sValue === "") {
+ iValue = "undefined in";
+ return iValue;
+ }
+ if (i2b2.PM.model.isObfuscated) {
+ var asTempArray = [];
+ if (sValue.toLowerCase().trim() == i2b2.CRC.view.graphs.sObfuscatedText.toLowerCase().trim()) {
+ iValue = "0";
+ }
+ else {
+ if (sValue.indexOf(i2b2.CRC.view.graphs.sObfuscatedEnding) > 0) {
+ var asTempArray = sValue.split(i2b2.CRC.view.graphs.sObfuscatedEnding);
+ iValue = asTempArray[0];
+ }
+ else {
+ iValue = sValue;
+ }
+ }
+ }
+ else {
+ iValue = sValue;
+ }
+ function isNumber(obj) {return ! isNaN(obj-0) && obj; };
+ if (!isNumber(iValue)) {
+ iValue = "undefined #";
+ return iValue;
+ }
+ return iValue;
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function sValueOfi2b2Text
+
+/*********************************************************************************
+ FUNCTION sValueOfSHRINEText
+ Return a INTEGER number that was obfuscated = MAKES IT ZERO
+**********************************************************************************/
+
+i2b2.CRC.view.graphs.sValueOfSHRINEText = function(sValue) {
+ try {
+ if (sValue === undefined || sValue === null || sValue === "") {
+ iValue = "undefined in";
+ return iValue;
+ }
+ if (true) { // for testing
+ var asTempArray = [];
+ if (sValue.toLowerCase().trim() == i2b2.CRC.view.graphs.sObfuscatedSHRINEText.toLowerCase().trim()) {
+ iValue = "0";
+ }
+ else {
+ if (sValue.indexOf(i2b2.CRC.view.graphs.sObfuscatedSHRINEEnding) > 0) {
+ //alert(i2b2.CRC.view.graphs.sObfuscatedSHRINEEnding);
+ var asTempArray = sValue.split(i2b2.CRC.view.graphs.sObfuscatedSHRINEEnding);
+ //alert(asTempArray);
+ iValue = asTempArray[0].trim();
+ }
+ else {
+ iValue = sValue;
+ }
+ }
+ }
+ else {
+ iValue = sValue;
+ }
+ function isNumber(obj) {return ! isNaN(obj-0) && obj; };
+ if (!isNumber(iValue)) {
+ iValue = "undefined #";
+ return iValue;
+ }
+ return iValue;
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function sValueOfSHRINEText
+
+/*********************************************************************************
+ FUNCTION sTexti2b2Value
+ Return a TEXT number that has obfuscated blurring - FOR DISPLAY ONLY
+**********************************************************************************/
+
+i2b2.CRC.view.graphs.sTexti2b2Value = function(iValue) {
+ try {
+ if (iValue === undefined || iValue === null || iValue === "") {
+ sValue = "undefined";
+ return sValue;
+ }
+ function isNumber(obj) {return ! isNaN(obj-0) && obj; };
+ if (!isNumber(iValue)) {
+ sValue = "undefined";
+ return sValue;
+ }
+ if (iValue >= i2b2.CRC.view.graphs.iObfuscatedFloorNumber) {
+ if (i2b2.PM.model.isObfuscated) {
+ sValue = iValue+i2b2.CRC.view.graphs.sObfuscatedEnding;
+ } else {
+ sValue = iValue;
+ }
+ } else {
+ if (i2b2.PM.model.isObfuscated) {
+ sValue = i2b2.CRC.view.graphs.sObfuscatedText;
+ } else {
+ sValue = iValue;
+ }
+ }
+ return sValue;
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function sTexti2b2Value
+
+
+/*********************************************************************************
+ FUNCTION clearGraphs
+ Clear the previously used Div for the graphs
+**********************************************************************************/
+i2b2.CRC.view.graphs.clearGraphs = function(sDivNameToClear) {
+ try {
+ if (sDivNameToClear === undefined || sDivNameToClear === null || sDivNameToClear === "")
+ throw ("ERROR 291 - i2b2.CRC.view.graphs.sNameOfPreviousDiv in function clearGraphs is null");
+ //Clear Divs in the original div for the charts
+ var oClearDiv = document.getElementById(sDivNameToClear);
+ oClearDiv.innerHTML = "";
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function clearGraphs
+
+/*********************************************************************************
+ FUNCTION clearDivForIE8
+ Clear Div and put message in the middle that "The Graphs Cannot Display in IE8"
+**********************************************************************************/
+i2b2.CRC.view.graphs.aDivForIE8 = function(sDivNameToClear) {
+ try {
+ if (sDivNameToClear === undefined || sDivNameToClear === null || sDivNameToClear === "")
+ throw ("ERROR 291 - i2b2.CRC.view.graphs.sNameOfPreviousDiv in function clearGraphs is null");
+ // Clear Divs in the original div for the charts
+ var oClearDiv = document.getElementById(sDivNameToClear);
+ var child = document.createElement("div");
+ child.setAttribute("id","IE_Div");
+ child.setAttribute("width","auto");
+ oClearDiv.appendChild(child);
+
+ // establish style and draw out containing Div
+ var sDivStyle = "font-family: Verdana, Geneva, sans-serif;"
+ + "font-size: 12px;"
+ + "text-align: center;"
+ + "vertical-align: middle;"
+ + "background-color: white;"
+ + "width: 100%;";
+ child.setAttribute("style",sDivStyle);
+ // establish table in Div and set up its style.
+ var sTableHtml = '<table style="width: 400px; margin-left: auto; margin-right: auto;">' +
+ '<tr style="background-color: white">' +
+ '<td style="color: red; text-align: center; vertical-align: middle;">&nbsp</td>' +
+ '</tr>' +
+ '<tr style="background-color: white">' +
+ '<td style="color: darkblue; text-align: center; vertical-align: middle; font-size: 20px">Graph Results is not supported for this version</td>' +
+ '</tr>' +
+ '<tr style="background-color: white">' +
+ '<td style="color: darkblue; text-align: center; vertical-align: middle; font-size: 20px">of Internet Explorer. In order to display the graphs in </td>' +
+ '</tr>' +
+ '<tr style="background-color: white">' +
+ '<td style="color: darkblue; text-align: center; vertical-align: middle; font-size: 20px">Internet Explorer you will need to use version 11 or higher.</td>' +
+ '</tr>' +
+ '<tr style="background-color: white">' +
+ '<td style="color: red; text-align: center; vertical-align: middle;">&nbsp</td>' +
+ '</tr>' +
+ '</table>';
+ child.innerHTML = sTableHtml;
+ }
+ catch(err) {
+ console.error(err);
+ }
+} // END of function clearDivForIE8
+
+console.timeEnd('execute time');
+console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_History.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_History.js
old mode 100755
new mode 100644
index 9a37db01a..478934825
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_History.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_History.js
@@ -1,585 +1,583 @@
/**
* @projectDescription View controller for the history viewport. (CRC's "previous queries" window)
* @inherits i2b2.CRC.view
* @namespace i2b2.CRC.view.history
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* ----------------------------------------------------------------------------------------
* updated 9-15-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: CRC > view > History');
console.time('execute time');
// create and save the screen objects
i2b2.CRC.view.history = new i2b2Base_cellViewController(i2b2.CRC, 'history');
i2b2.CRC.view.history.visible = false;
// define the option functions
// ================================================================================================== //
i2b2.CRC.view.history.showOptions = function(subScreen){
if (!this.modalOptions) {
var handleSubmit = function(){
// submit value(s)
if (this.submit()) {
if ($('HISTsortOrderASC').checked) {
tmpValue = 'ASC';
}
else {
tmpValue = 'DESC';
}
i2b2.CRC.view['history'].params.sortOrder = tmpValue;
if ($('HISTsortByNAME').checked) {
tmpValue = 'NAME';
}
else {
tmpValue = 'DATE';
}
i2b2.CRC.view['history'].params.sortBy = tmpValue;
tmpValue = parseInt($('HISTMaxQryDisp').value, 10);
i2b2.CRC.view['history'].params.maxQueriesDisp = tmpValue;
// requery the history list
i2b2.CRC.ctrlr.history.Refresh();
}
}
var handleCancel = function(){
this.cancel();
}
this.modalOptions = new YAHOO.widget.SimpleDialog("optionsHistory", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: handleSubmit,
isDefault: true
}, {
text: "Cancel",
handler: handleCancel
}]
});
$('optionsHistory').show();
this.modalOptions.validate = function(){
// now process the form data
var tmpValue = parseInt($('HISTMaxQryDisp').value, 10);
if (!isNaN(tmpValue) && tmpValue <= 0) {
alert("The max number of Queries must be a whole number larger then zero.");
return false;
}
return true;
};
this.modalOptions.render(document.body);
}
this.modalOptions.show();
// load settings
if (this.params.sortOrder=="ASC") {
$('HISTsortOrderASC').checked = true;
} else {
$('HISTsortOrderDESC').checked = true;
}
if (this.params.sortBy=="NAME") {
$('HISTsortByNAME').checked = true;
} else {
$('HISTsortByDATE').checked = true;
}
$('HISTMaxQryDisp').value = this.params.maxQueriesDisp;
}
// ================================================================================================== //
i2b2.CRC.view.history.ToggleNode = function(divTarg, divTreeID) {
// get the i2b2 data from the yuiTree node
var tvTree = YAHOO.widget.TreeView.getTree(divTreeID);
var tvNode = tvTree.getNodeByProperty('nodeid', divTarg.id);
tvNode.toggle();
}
// ================================================================================================== //
i2b2.CRC.view.history.Resize = function(e) {
// this function provides the resize functionality needed for this screen
var viewObj = i2b2.CRC.view.history;
var ve = $('crcHistoryBox');
if (viewObj.visible) {
ve.show();
var ds = document.viewport.getDimensions();
var w = ds.width;
var h = ds.height;
if (w < 840) {w = 840;}
if (h < 517) {h = 517;}
ve = ve.style;
// resize our visual components
switch(i2b2.hive.MasterView.getViewMode()) {
case "Patients":
if (i2b2.WORK && i2b2.WORK.isLoaded) {
// make room for the workspace window
ve.width = Math.max(initBrowserViewPortDim.width-rightSideWidth, 0);
ve.top = h-196+44;
$('crcHistoryData').style.height = '100px';
} else {
ve.width = w-578;
ve.top = h-196;
$('crcHistoryData').style.height = '144px';
}
break;
case "Analysis":
if (i2b2.WORK && i2b2.WORK.isLoaded) {
// make room for the workspace window
w = parseInt(w/3)-10;
ve.width = w;
ve.top = h-196+44;
$('crcHistoryData').style.height = '100px';
} else {
w = parseInt(w/3)-10;
ve.width = w;
ve.top = h-196;
$('crcHistoryData').style.height = '144px';
}
break;
}
if (viewObj.isZoomed) {
ve.top = '';
$('crcHistoryData').style.height = h-97;
}
$$('DIV#crcHistoryBox DIV#crcHistoryData')[0].style.width = (parseInt(ve.width)-24) + 'px';
this.splitterDragged();
this.ResizeHeight();
} else {
ve.hide();
}
}
//YAHOO.util.Event.addListener(window, "resize", i2b2.CRC.view.history.Resize, i2b2.CRC.view.history); // tdw9
i2b2.CRC.view.history.Resize();
//================================================================================================== //
i2b2.CRC.view.history.splitterDragged = function()
{
var splitter = $( i2b2.hive.mySplitter.name );
var CRCHist = $("crcHistoryBox");
CRCHist.style.width = Math.max((parseInt(splitter.style.left) - CRCHist.offsetLeft - 3), 0) + "px";
$$('DIV#crcHistoryBox DIV#crcHistoryData')[0].style.width = Math.max((parseInt(CRCHist.style.width)-24), 0) + 'px';
}
//================================================================================================== //
i2b2.CRC.view.history.ResizeHeight = function() {
// this function provides the resize functionality needed for this screen
var viewObj = i2b2.CRC.view.history;
var ve = $('crcHistoryBox');
if (viewObj.visible) {
ve.show();
var ds = document.viewport.getDimensions();
var h = ds.height;
if (h < 517) {h = 517;}
ve = ve.style;
// resize our visual components
switch(i2b2.hive.MasterView.getViewMode()) {
case "Patients":
if (i2b2.WORK && i2b2.WORK.isLoaded) {
// make room for the workspace window
ve.top = h-196+44;
$('crcHistoryData').style.height = '100px';
} else {
ve.top = h-196;
$('crcHistoryData').style.height = '144px';
}
break;
case "Analysis":
if (i2b2.WORK && i2b2.WORK.isLoaded) {
// make room for the workspace window
ve.top = h-196+44;
$('crcHistoryData').style.height = '100px';
} else {
ve.top = h-196;
$('crcHistoryData').style.height = '144px';
}
break;
}
if (viewObj.isZoomed) {
ve.top = '';
$('crcHistoryData').style.height = h-97;
}
} else {
ve.hide();
}
}
// ================================================================================================== //
i2b2.CRC.view.history.PopulateQueryMasters = function(dm_ptr, dm_name, options) {
var thisview = i2b2.CRC.view.history;
// clear the data first
var tvTree = i2b2.CRC.view.history.yuiTree;
var tvRoot = tvTree.getRoot();
tvTree.removeChildren(tvRoot);
tvTree.locked = false;
// sort by the options
if (Object.isUndefined(options)) { var options = {}; }
if (!options.sortBy) { options.sortBy = 'DATE'; }
if (!options.sortOrder) { options.sortBy = 'DESC'; }
if (options.sortBy=='NAME') {
var compareAttrib = 'name';
} else {
var compareAttrib = 'created';
}
if (options.sortOrder=='ASC') {
var reverseSort = false;
} else {
var reverseSort = true;
}
// NEW SORT METHOD USING prototype Enumerators
var QM_sortVal = function(rec) {
var hash_key = rec[0];
var sdxExtObj = rec[1];
var cl_compareAttrib = compareAttrib; // <---- closure var
var t = sdxExtObj.origData[cl_compareAttrib];
if (cl_compareAttrib=="created") {
// proper date handling (w/improper handling for latest changes to output format)
var sd = t.toUpperCase();
if (sd.indexOf('Z') != -1 || sd.indexOf('T') != -1) {
t = t.toLowerCase();
} else {
t = Date.parse(t);
}
} else {
t = String(t.toLowerCase() );
}
return t;
};
var sortFinal = i2b2.CRC.model.QueryMasters.sortBy(QM_sortVal);
// reverse if needed
if (reverseSort) { sortFinal.reverse(true); }
// populate the Query Masters into the treeview
for (var i=0; i<sortFinal.length; i++) {
// add categories to ONT navigate tree
var sdxDataNode = sortFinal[i][1];
if (sdxDataNode.origData.master_type_cd == "TEMPORAL")
{
icon = "sdx_CRC_QMT.gif";
iconExp = "sdx_CRC_QMT_exp.gif";
}
else
{
icon = "sdx_CRC_QM.gif";
iconExp = "sdx_CRC_QM_exp.gif";
}
var renderOptions = {
title: sdxDataNode.origData.name,
dragdrop: "i2b2.sdx.TypeControllers.QM.AttachDrag2Data",
dblclick: "i2b2.CRC.view.history.ToggleNode(this,'"+tvTree.id+"')",
icon: icon,
iconExp: iconExp
};
var sdxRenderData = i2b2.sdx.Master.RenderHTML(tvTree.id, sdxDataNode, renderOptions);
i2b2.sdx.Master.AppendTreeNode(tvTree, tvRoot, sdxRenderData);
}
tvTree.draw();
};
// ================================================================================================== //
i2b2.CRC.view.history.ZoomView = function() {
i2b2.hive.MasterView.toggleZoomWindow("HISTORY");
}
// =========== Context Menu Suff ===========
// ================================================================================================== //
i2b2.CRC.view.history.doRename = function() {
var op = i2b2.CRC.view.history.contextRecord; // object path
i2b2.CRC.ctrlr.history.queryRename(op.sdxInfo.sdxKeyValue, false, op);
}
// ================================================================================================== //
i2b2.CRC.view.history.doDelete = function() {
i2b2.CRC.ctrlr.history.queryDelete(i2b2.CRC.view.history.contextRecord.sdxInfo.sdxKeyValue);
}
// ================================================================================================== //
i2b2.CRC.view.history.doRefreshAll = function() { i2b2.CRC.ctrlr.history.Refresh(); }
// ================================================================================================== //
/**
* Method for flagging a saved query.
*/
function openQueryFlagPrompt(){
var dialogue = new YAHOO.widget.SimpleDialog("dialogQryFlag", {
width: "400px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [{
text: "OK",
handler: function(){
- var message = document.getElementById('inputQueryFlagMessage').value,
- queryId = i2b2.CRC.view.history.contextRecord.sdxInfo.sdxKeyValue;
+ var message = document.getElementById('inputQueryFlagMessage').value;
//make a call to the controller flag method.
i2b2.CRC.ctrlr.history.Flag({
- queryId: queryId,
- message: message
+ queryId: i2b2.CRC.view.history.contextRecord.sdxInfo.sdxKeyValue
});
this.cancel();
document.getElementById('inputQueryFlagMessage').value = "";
},
isDefault: true
}, {
text: "Cancel",
handler: function(){
this.cancel();
document.getElementById('inputQueryFlagMessage').value = "";
}
}]
});
$('dialogQryFlag').show();
$('dialogQryFlag').show();
dialogue.render(document.body);
dialogue.center();
dialogue.show();
}
// ================================================================================================== //
i2b2.CRC.view.history.doQueryFlagPrompt = function() {
openQueryFlagPrompt(i2b2.CRC.view.history.doFlag);
}
// ================================================================================================== //
/**
* Method for unflagging a saved query.
*/
i2b2.CRC.view.history.doUnflag = function() {
i2b2.CRC.ctrlr.history.Unflag({
queryId: i2b2.CRC.view.history.contextRecord.sdxInfo.sdxKeyValue
});
}
// ================================================================================================== //
i2b2.CRC.view.history.ContextMenuValidate = function(p_oEvent) {
var clickId = null;
var currentNode = this.contextEventTarget;
while (!currentNode.id) {
if (currentNode.parentNode) {
currentNode = currentNode.parentNode;
} else {
// we have recursed up the tree to the window/document DOM... it's a bad click
this.cancel();
return;
}
}
clickId = currentNode.id;
// see if the ID maps back to a treenode with SDX data
var tvNode = i2b2.CRC.view.history.yuiTree.getNodeByProperty('nodeid', clickId);
if (tvNode) {
if (tvNode.data.i2b2_SDX) {
if (tvNode.data.i2b2_SDX.sdxInfo.sdxType == "QM") {
i2b2.CRC.view.history.contextRecord = tvNode.data.i2b2_SDX;
} else {
this.cancel();
return;
}
}
}
};
// This is done once the entire cell has been loaded
// ================================================================================================== //
console.info("SUBSCRIBED TO i2b2.events.afterCellInit");
i2b2.events.afterCellInit.subscribe(
(function(en,co) {
if (co[0].cellCode=='CRC') {
// =========================================================
console.debug('[EVENT CAPTURED i2b2.events.afterCellInit]');
var thisview = i2b2.CRC.view.history;
thisview.Resize();
// initialize treeview
if (!thisview.yuiTree) {
thisview.yuiTree = new YAHOO.widget.TreeView("crcHistoryData");
thisview.yuiTree.setDynamicLoad(i2b2.sdx.Master.LoadChildrenFromTreeview,1);
// register the treeview with the SDX subsystem to be a container for QM, QI, PRS, PRC objects
i2b2.sdx.Master.AttachType("crcHistoryData","QM");
i2b2.sdx.Master.AttachType("crcHistoryData","QI");
i2b2.sdx.Master.AttachType("crcHistoryData","ENS");
i2b2.sdx.Master.AttachType("crcHistoryData","PRC");
i2b2.sdx.Master.AttachType("crcHistoryData","PRS");
i2b2.sdx.Master.AttachType("crcHistoryData","PR");
}
// we need to make sure everything is loaded
setTimeout("i2b2.CRC.ctrlr.history.Refresh();",300);
// -------------------------------------------------------
i2b2.CRC.ctrlr.history.events.onDataUpdate.subscribe(
(function(en,co) {
console.group("[EVENT CAPTURED i2b2.CRC.ctrlr.history.events.onDataUpdate]");
console.dir(co[0]);
var dm_loc = co[0].DataLocation;
var dm_ptr = co[0].DataRef;
if (dm_loc=='i2b2.CRC.model.QueryMasters') {
console.debug("Processing QueryMasters update");
var options = {};
options.sortBy = i2b2.CRC.view['history'].params.sortBy;
options.sortOrder = i2b2.CRC.view['history'].params.sortOrder;
options.max = i2b2.CRC.view['history'].params.maxQueriesDisp;
i2b2.CRC.view.history.PopulateQueryMasters(dm_ptr, dm_loc, options);
}
console.groupEnd();
})
);
// -------------------------------------------------------
// override default handler (we need this so that we can properly capture the XML request/response messagees
i2b2.sdx.Master.setHandlerCustom('crcHistoryData', 'QM', 'LoadChildrenFromTreeview', (function(node, onCompleteCallback) {
var scopedCallback = new i2b2_scopedCallback();
scopedCallback.scope = node.data.i2b2_SDX;
scopedCallback.callback = function(cellResult) {
var cl_node = node;
var cl_onCompleteCB = onCompleteCallback;
// THIS function is used to process the AJAX results of the getChild call
// results data object contains the following attributes:
// refXML: xmlDomObject <--- for data processing
// msgRequest: xml (string)
// msgResponse: xml (string)
// error: boolean
// errorStatus: string [only with error=true]
// errorMsg: string [only with error=true]
// <THIS IS WHY WE ARE CREATING CUSTOMER HANDLERS FOR THE Query Tool CONTROL!>
i2b2.CRC.view.history.queryResponse = cellResult.msgResponse;
i2b2.CRC.view.history.queryRequest = cellResult.msgRequest;
i2b2.CRC.view.history.queryUrl = cellResult.msgUrl;
// </THIS IS WHY WE ARE CREATING CUSTOMER HANDLERS FOR THE QueryTool CONTROL!>
for(var i1=0; i1<1*cellResult.results.length; i1++) {
var o = cellResult.results[i1];
var renderOptions = {
title: o.origData.title,
dragdrop: "i2b2.sdx.TypeControllers.QI.AttachDrag2Data",
dblclick: "i2b2.CRC.view.history.ToggleNode(this,'"+cl_node.tree.id+"')",
icon: "sdx_CRC_QI.gif",
iconExp: "sdx_CRC_QI_exp.gif"
};
var sdxRenderData = i2b2.sdx.Master.RenderHTML(cl_node.tree.id, o, renderOptions);
i2b2.sdx.Master.AppendTreeNode(cl_node.tree, cl_node, sdxRenderData);
}
// handle the YUI treeview
if (getObjectClass(cl_onCompleteCB)=='i2b2_scopedCallback') {
cl_onCompleteCB.callback.call(cl_onCompleteCB.scope, cellResult);
} else {
cl_onCompleteCB(cellResult);
}
}
var sdxParentNode = node.data.i2b2_SDX;
i2b2.sdx.Master.getChildRecords(sdxParentNode, scopedCallback);
}));
// -------------------------------------------------------
i2b2.CRC.view.history.ContextMenu = new YAHOO.widget.ContextMenu(
"divContextMenu-History",
{ lazyload: true,
trigger: $('crcHistoryBox'),
itemdata: [
{ text: "Rename", onclick: { fn: i2b2.CRC.view.history.doRename } },
{ text: "Delete", onclick: { fn: i2b2.CRC.view.history.doDelete } },
{ text: "Refresh All", onclick: { fn: i2b2.CRC.view.history.doRefreshAll } },
{ text: "Flag", onclick: { fn: i2b2.CRC.view.history.doQueryFlagPrompt }},
{ text: "Unflag", onclick: { fn: i2b2.CRC.view.history.doUnflag}}
] }
);
i2b2.CRC.view.history.ContextMenu.subscribe("triggerContextMenu",i2b2.CRC.view.history.ContextMenuValidate);
// =========================================================
}
})
);
//================================================================================================== //
i2b2.events.initView.subscribe((function(eventTypeName, newMode) {
// -------------------------------------------------------
this.visible = true;
if (i2b2.WORK && i2b2.WORK.isLoaded) {
$('crcHistoryData').style.height = '100px';
} else {
$('crcHistoryData').style.height = '144px';
}
$('crcHistoryBox').show();
this.Resize();
// -------------------------------------------------------
}),'',i2b2.CRC.view.history);
// ================================================================================================== //
i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode) {
newMode = newMode[0];
this.viewMode = newMode;
switch(newMode) {
case "Patients":
case "Analysis":
var wlst = i2b2.hive.MasterView.getZoomWindows();
if (wlst.indexOf("ONT")!=-1 || wlst.indexOf("WORK")!=-1) { return; }
this.visible = true;
if (i2b2.WORK && i2b2.WORK.isLoaded) {
$('crcHistoryData').style.height = '100px';
} else {
$('crcHistoryData').style.height = '144px';
}
$('crcHistoryBox').show();
//this.Resize(); // tdw9
this.splitterDragged();
this.ResizeHeight();
break;
default:
this.visible = false;
$('crcHistoryBox').hide();
break;
}
}),'',i2b2.CRC.view.history);
// ================================================================================================== //
i2b2.events.changedZoomWindows.subscribe((function(eventTypeName, zoomMsg) {
newMode = zoomMsg[0];
if (!newMode.action) { return; }
if (newMode.action == "ADD") {
switch (newMode.window) {
case "HISTORY":
this.isZoomed = true;
this.visible = true;
break;
case "ONT":
case "WORK":
this.visible = false;
this.isZoomed = false;
}
} else {
switch (newMode.window) {
case "HISTORY":
case "ONT":
case "WORK":
this.isZoomed = false;
this.visible = true;
}
}
this.ResizeHeight();
this.splitterDragged();
}),'',i2b2.CRC.view.history);
console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_QryTool.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_QryTool.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_QueryReport.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_QueryReport.js
new file mode 100644
index 000000000..1a45fca06
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_QueryReport.js
@@ -0,0 +1,52 @@
+/**
+ * @projectDescription View controller for the query report window (which is a GUI-only component of the CRC module).
+ * @inherits i2b2.CRC.view
+ * @namespace i2b2.CRC.view.QueryReport
+ * @author Bhaswati Ghosh
+ * @version 1.7.05
+ * ----------------------------------------------------------------------------------------
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+
+ // Query Report BG
+console.group('Load & Execute component file: CRC > view > QueryReport');
+console.time('execute time');
+
+
+// create and save the screen objects
+i2b2.CRC.view.queryReport = new i2b2Base_cellViewController(i2b2.CRC, 'queryReport');
+i2b2.CRC.view.queryReport.visible = false;
+
+i2b2.CRC.view.queryReport.show = function() {
+ i2b2.CRC.view.queryReport.visible = true;
+ $('crcQueryReportBox').show();
+}
+i2b2.CRC.view.queryReport.hide = function() {
+ i2b2.CRC.view.queryReport.visible = false;
+ $('crcQueryReportBox').hide();
+}
+
+i2b2.CRC.view.queryReport.hideDisplay = function() {
+ $('infoQueryStatusReport').hide();
+}
+i2b2.CRC.view.queryReport.showDisplay = function() {
+ var targs = $('infoQueryStatusReport').parentNode.parentNode.select('DIV.tabBox.active');
+ // remove all active tabs
+ targs.each(function(el) { el.removeClassName('active'); });
+ // set us as active
+ $('infoQueryStatusReport').parentNode.parentNode.select('DIV.tabBox.tabQueryReport')[0].addClassName('active');
+
+ $('infoQueryStatusText').hide();
+ $('infoQueryStatusChart').hide();
+ $('infoQueryStatusReport').show();
+ // if($('infoQueryStatusReport').innerHTML=="")
+ $('infoQueryStatusReport').innerHTML=="";
+ i2b2.CRC.ctrlr.QT.createQueryReport("",false);
+}
+// ================================================================================================== //
+
+
+console.timeEnd('execute time');
+console.groupEnd();
+
+// End Query Report BG
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Status.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Status.js
old mode 100755
new mode 100644
index 5f33fd168..3a3507349
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Status.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_Status.js
@@ -1,189 +1,277 @@
/**
* @projectDescription View controller for the query status window (which is a GUI-only component of the CRC module).
* @inherits i2b2.CRC.view
* @namespace i2b2.CRC.view.status
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* ----------------------------------------------------------------------------------------
* updated 9-15-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: CRC > view > Status');
console.time('execute time');
// create and save the screen objects
i2b2.CRC.view.status = new i2b2Base_cellViewController(i2b2.CRC, 'status');
i2b2.CRC.view.status.visible = false;
i2b2.CRC.view.status.show = function() {
i2b2.CRC.view.status.visible = true;
$('crcStatusBox').show();
}
i2b2.CRC.view.status.hide = function() {
i2b2.CRC.view.status.visible = false;
$('crcStatusBox').hide();
}
i2b2.CRC.view.status.hideDisplay = function() {
$('infoQueryStatusText').hide();
}
i2b2.CRC.view.status.showDisplay = function() {
var targs = $('infoQueryStatusText').parentNode.parentNode.select('DIV.tabBox.active');
// remove all active tabs
targs.each(function(el) { el.removeClassName('active'); });
// set us as active
$('infoQueryStatusText').parentNode.parentNode.select('DIV.tabBox.tabQueryStatus')[0].addClassName('active');
$('infoQueryStatusText').show();
+ //BG
+ $('infoQueryStatusChart').hide();
+ $('infoQueryStatusReport').hide();
+ $('infoDownloadStatusData').hide();
+ //BG
}
+// ================================================================================================== //
+//BG
+i2b2.CRC.view.status.selectTab = function(tabCode) {
+ // toggle between the Navigate and Find Terms tabs
+ switch (tabCode) {
+ case "graphs":
+ this.currentTab = 'graphs';
+ this.cellRoot.view['graphs'].showDisplay();
+ this.cellRoot.view['status'].hideDisplay();
+ this.cellRoot.view['queryReport'].hideDisplay();
+ this.cellRoot.view['downloadData'].hideDisplay();
+ if(i2b2.CRC.ctrlr.currentQueryResults)
+ i2b2.CRC.view.graphs.createGraphs("infoQueryStatusChart", i2b2.CRC.ctrlr.currentQueryResults.resultString, true);
+ break;
+ case "status":
+ this.currentTab = 'status';
+ this.cellRoot.view['status'].showDisplay();
+ this.cellRoot.view['graphs'].hideDisplay();
+ this.cellRoot.view['queryReport'].hideDisplay();
+ this.cellRoot.view['downloadData'].hideDisplay();
+ break;
+ case "queryReport":
+ this.currentTab = 'queryReport';
+ this.cellRoot.view['queryReport'].showDisplay();
+ this.cellRoot.view['graphs'].hideDisplay();
+ this.cellRoot.view['status'].hideDisplay();
+ this.cellRoot.view['downloadData'].hideDisplay();
+ break;
+ case "downloadData":
+ this.currentTab = 'downloadData';
+ this.cellRoot.view['downloadData'].showDisplay();
+ this.cellRoot.view['graphs'].hideDisplay();
+ this.cellRoot.view['status'].hideDisplay();
+ this.cellRoot.view['queryReport'].hideDisplay();
+ var resultsTable = jQuery("#infoDownloadStatusData").find("#resultsTable");
+ if(resultsTable && resultsTable.length<=0)
+ i2b2.CRC.view.downloadData.createCSV();
+ break;
+ }
+}
+//BG
// ================================================================================================== //
i2b2.CRC.view.status.Resize = function(e) {
var viewObj = i2b2.CRC.view.status;
if (viewObj.visible) {
var ds = document.viewport.getDimensions();
var w = ds.width;
var h = ds.height;
if (w < 840) {w = 840;}
if (h < 517) {h = 517;}
// resize our visual components
var ve = $('crcStatusBox');
ve.show();
switch(viewObj.viewMode) {
case "Patients":
ve = ve.style;
// keyoff splitter's position
ve.left = addToProperty($('main.splitter').style.left, 9, "px", "px" );
ve.width = rightSideWidth - 51;
//ve.left = w-550;
//ve.width = 524;
if (i2b2.WORK && i2b2.WORK.isLoaded) {
$('infoQueryStatusText').style.height = '100px';
if (YAHOO.env.ua.ie > 0) {
ve.top = h-135; //196+44;
} else {
ve.top = h-152; //196+44;
}
} else {
$('infoQueryStatusText').style.height = '144px';
ve.top = h-196;
}
break;
default:
ve.hide();
}
}
}
// ================================================================================================== //
// YAHOO.util.Event.addListener(window, "resize", i2b2.CRC.view.status.Resize, i2b2.CRC.view.status); // tdw9
//================================================================================================== //
i2b2.CRC.view.status.splitterDragged = function()
{
var viewPortDim = document.viewport.getDimensions();
var splitter = $( i2b2.hive.mySplitter.name );
var CRCStatus = $("crcStatusBox");
CRCStatus.style.left = (parseInt(splitter.offsetWidth) + parseInt(splitter.style.left) + 3) + "px";
CRCStatus.style.width = Math.max(parseInt(viewPortDim.width) - parseInt(splitter.style.left) - parseInt(splitter.offsetWidth) - 29, 0) + "px";
}
//================================================================================================== //
i2b2.CRC.view.status.ResizeHeight = function()
{
var viewObj = i2b2.CRC.view.status;
if (viewObj.visible) {
- var ds = document.viewport.getDimensions();
- var h = ds.height;
+ ///var ds = document.viewport.getDimensions();
+ var h = window.innerHeight || (window.document.documentElement.clientHeight || window.document.body.clientHeight);
if (h < 517) {h = 517;}
// resize our visual components
var ve = $('crcStatusBox');
ve.show();
switch(viewObj.viewMode) {
case "Patients":
ve = ve.style;
if (i2b2.WORK && i2b2.WORK.isLoaded)
{
- $('infoQueryStatusText').style.height = '100px';
- ve.top = h-152; //196+44;
+ if (i2b2.CRC.view.status.isZoomed) {
+ $('infoQueryStatusText').style.height = h - 97;
+ $('infoQueryStatusChart').style.height = h - 97;
+ $('infoQueryStatusReport').style.height = h - 97;
+ ve.top = 45;
+ $('crcQueryToolBox').hide();
+ } else {
+ $('infoQueryStatusText').style.height = '100px';
+ $('infoQueryStatusChart').style.height = '100px';//BG
+ $('infoQueryStatusReport').style.height = '100px';//BG
+ $('infoDownloadStatusData').style.height = '100px';//BG
+ ve.top = h-198;
+ $('crcQueryToolBox').show();
+
+ }
}
else
{
- $('infoQueryStatusText').style.height = '144px';
- ve.top = h-196;
+ if (i2b2.CRC.view.status.isZoomed) {
+ $('infoQueryStatusText').style.height = h - 97;
+ $('infoQueryStatusChart').style.height = h - 97;
+ $('infoQueryStatusReport').style.height = h - 97;
+ $('infoDownloadStatusData').style.height = h - 97;
+ ve.top = 45;
+ $('crcQueryToolBox').hide();
+ } else {
+ $('infoQueryStatusText').style.height = '144px';
+ $('infoQueryStatusChart').style.height = '144px';//BG
+ $('infoQueryStatusReport').style.height = '144px';//BG
+ $('infoDownloadStatusData').style.height = '144px';//BG
+ ve.top = h-196;
+ $('crcQueryToolBox').show();
+ }
+
}
break;
default:
ve.hide();
}
}
}
+// ================================================================================================== //
+
+i2b2.CRC.view.status.ZoomView = function() {
+ i2b2.hive.MasterView.toggleZoomWindow("status");
+}
+
// ================================================================================================== //
i2b2.events.initView.subscribe((function(eventTypeName, newMode) {
// -------------------------------------------------------
newMode = newMode[0];
this.viewMode = newMode;
this.visible = true;
$('crcStatusBox').show();
this.Resize();
// -------------------------------------------------------
}),'',i2b2.CRC.view.status);
//================================================================================================== //
i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode) {
// -------------------------------------------------------
newMode = newMode[0];
this.viewMode = newMode;
switch(newMode) {
case "Patients":
// check if other windows are zoomed and blocking us
var zw = i2b2.hive.MasterView.getZoomWindows();
if (zw.member("QT")) {
this.visible = false;
} else {
this.visible = true;
}
break;
default:
this.visible = false;
break;
}
if (this.visible) {
$('crcStatusBox').show();
i2b2.CRC.view.status.splitterDragged();
//this.Resize(); // tdw9
} else {
$('crcStatusBox').hide();
}
// -------------------------------------------------------
}),'',i2b2.CRC.view.status);
// ================================================================================================== //
i2b2.events.changedZoomWindows.subscribe((function(eventTypeName, zoomMsg) {
newMode = zoomMsg[0];
if (!newMode.action) { return; }
if (newMode.action == "ADD") {
switch (newMode.window) {
case "QT":
this.visible = false;
this.isZoomed = false;
i2b2.CRC.view.status.hide();
+ break;
+ case "status":
+ this.isZoomed = true;
+ this.visible = true;
}
} else {
switch (newMode.window) {
case "QT":
this.isZoomed = false;
this.visible = true;
i2b2.CRC.view.status.show();
+ break;
+ case "status":
+ this.isZoomed = false;
+ this.visible = true;
}
}
this.ResizeHeight();
//this.Resize(); // tdw9
}),'',i2b2.CRC.view.status);
+
console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_modLabRange.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/CRC_view_modLabRange.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_clear.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_clear.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_first.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_first.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_first_hide.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_first_hide.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_last.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_last.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_last_hide.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_last_hide.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_newgroup.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_newgroup.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_next.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_next.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_next_hide.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_next_hide.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_prev.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_prev.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_prev_hide.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_prev_hide.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_runquery.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/QryTool_b_runquery.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/loading.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/loading.gif
new file mode 100644
index 000000000..b57e4d820
Binary files /dev/null and b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/loading.gif differ
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/main_list.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/main_list.css
old mode 100755
new mode 100644
index bd5875ba3..afff6dfa0
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/main_list.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/main_list.css
@@ -1,13 +1,13 @@
-@import url(modLabValues.css);
-@import url(sdx_CRC_QDEF.css);
-@import url(sdx_CRC_QGDEF.css);
-@import url(sdx_CRC_PR.css);
-@import url(sdx_CRC_PRC.css);
-@import url(sdx_CRC_PRS.css);
-@import url(sdx_CRC_QI.css);
-@import url(sdx_CRC_QM.css);
-@import url(vwHistory.css);
-@import url(vwQryTool.css);
-@import url(vwStatus.css);
-
-
+@import url(modLabValues.css);
+@import url(sdx_CRC_QDEF.css);
+@import url(sdx_CRC_QGDEF.css);
+@import url(sdx_CRC_PR.css);
+@import url(sdx_CRC_PRC.css);
+@import url(sdx_CRC_PRS.css);
+@import url(sdx_CRC_QI.css);
+@import url(sdx_CRC_QM.css);
+@import url(vwHistory.css);
+@import url(vwQryTool.css);
+@import url(vwStatus.css);
+
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menu.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menu.css
old mode 100755
new mode 100644
index cbe131b1a..f0915cd0f
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menu.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menu.css
@@ -1,7 +1,7 @@
-/*
-Copyright (c) 2008, Yahoo! Inc. All rights reserved.
-Code licensed under the BSD License:
-http://developer.yahoo.net/yui/license.txt
-version: 2.6.0
-*/
-.yuimenu{top:-999em;left:-999em;}.yuimenubar{position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{*zoom:1;_zoom:normal;border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu .yuimenu .bd{*zoom:normal;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);}
+/*
+Copyright (c) 2008, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.6.0
+*/
+.yuimenu{top:-999em;left:-999em;}.yuimenubar{position:static;}.yuimenu .yuimenu,.yuimenubar .yuimenu{position:absolute;}.yuimenubar li,.yuimenu li{list-style-type:none;}.yuimenubar ul,.yuimenu ul,.yuimenubar li,.yuimenu li,.yuimenu h6,.yuimenubar h6{margin:0;padding:0;}.yuimenuitemlabel,.yuimenubaritemlabel{text-align:left;white-space:nowrap;}.yuimenubar ul{*zoom:1;}.yuimenubar .yuimenu ul{*zoom:normal;}.yuimenubar>.bd>ul:after{content:".";display:block;clear:both;visibility:hidden;height:0;line-height:0;}.yuimenubaritem{float:left;}.yuimenubaritemlabel,.yuimenuitemlabel{display:block;}.yuimenuitemlabel .helptext{font-style:normal;display:block;margin:-1em 0 0 10em;}.yui-menu-shadow{position:absolute;visibility:hidden;z-index:-1;}.yui-menu-shadow-visible{top:2px;right:-3px;left:-3px;bottom:-3px;visibility:visible;}.hide-scrollbars *{overflow:hidden;}.hide-scrollbars select{display:none;}.yuimenu.show-scrollbars,.yuimenubar.show-scrollbars{overflow:visible;}.yuimenu.hide-scrollbars .yui-menu-shadow,.yuimenubar.hide-scrollbars .yui-menu-shadow{overflow:hidden;}.yuimenu.show-scrollbars .yui-menu-shadow,.yuimenubar.show-scrollbars .yui-menu-shadow{overflow:auto;}.yui-skin-sam .yuimenubar{font-size:93%;line-height:2;*line-height:1.9;border:solid 1px #808080;background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritem{border-right:solid 1px #ccc;}.yui-skin-sam .yuimenubaritemlabel{padding:0 10px;color:#000;text-decoration:none;cursor:default;border-style:solid;border-color:#808080;border-width:1px 0;*position:relative;margin:-1px 0;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel{padding-right:20px;*display:inline-block;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu{background:url(menubaritem_submenuindicator.png) right center no-repeat;}.yui-skin-sam .yuimenubaritem-selected{background:url(../../../../assets/skins/sam/sprite.png) repeat-x 0 -1700px;}.yui-skin-sam .yuimenubaritemlabel-selected{border-color:#7D98B8;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-selected{border-left-width:1px;margin-left:-1px;*left:-1px;}.yui-skin-sam .yuimenubaritemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenubarnav .yuimenubaritemlabel-hassubmenu-disabled{background-image:url(menubaritem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenu{font-size:93%;line-height:1.5;*line-height:1.45;}.yui-skin-sam .yuimenubar .yuimenu,.yui-skin-sam .yuimenu .yuimenu{font-size:100%;}.yui-skin-sam .yuimenu .bd{*zoom:1;_zoom:normal;border:solid 1px #808080;background-color:#fff;}.yui-skin-sam .yuimenu .yuimenu .bd{*zoom:normal;}.yui-skin-sam .yuimenu ul{padding:3px 0;border-width:1px 0 0 0;border-color:#ccc;border-style:solid;}.yui-skin-sam .yuimenu ul.first-of-type{border-width:0;}.yui-skin-sam .yuimenu h6{font-weight:bold;border-style:solid;border-color:#ccc;border-width:1px 0 0 0;color:#a4a4a4;padding:3px 10px 0 10px;}.yui-skin-sam .yuimenu ul.hastitle,.yui-skin-sam .yuimenu h6.first-of-type{border-width:0;}.yui-skin-sam .yuimenu .yui-menu-body-scrolled{border-color:#ccc #808080;overflow:hidden;}.yui-skin-sam .yuimenu .topscrollbar,.yui-skin-sam .yuimenu .bottomscrollbar{height:16px;border:solid 1px #808080;background:#fff url(../../../../assets/skins/sam/sprite.png) no-repeat 0 0;}.yui-skin-sam .yuimenu .topscrollbar{border-bottom-width:0;background-position:center -950px;}.yui-skin-sam .yuimenu .topscrollbar_disabled{background-position:center -975px;}.yui-skin-sam .yuimenu .bottomscrollbar{border-top-width:0;background-position:center -850px;}.yui-skin-sam .yuimenu .bottomscrollbar_disabled{background-position:center -875px;}.yui-skin-sam .yuimenuitem{_border-bottom:solid 1px #fff;}.yui-skin-sam .yuimenuitemlabel{padding:0 20px;color:#000;text-decoration:none;cursor:default;}.yui-skin-sam .yuimenuitemlabel .helptext{margin-top:-1.5em;*margin-top:-1.45em;}.yui-skin-sam .yuimenuitem-hassubmenu{background-image:url(menuitem_submenuindicator.png);background-position:right center;background-repeat:no-repeat;}.yui-skin-sam .yuimenuitem-checked{background-image:url(menuitem_checkbox.png);background-position:left center;background-repeat:no-repeat;}.yui-skin-sam .yui-menu-shadow-visible{background-color:#000;opacity:.12;*filter:alpha(opacity=12);}.yui-skin-sam .yuimenuitem-selected{background-color:#B3D4FF;}.yui-skin-sam .yuimenuitemlabel-disabled{cursor:default;color:#A6A6A6;}.yui-skin-sam .yuimenuitem-hassubmenu-disabled{background-image:url(menuitem_submenuindicator_disabled.png);}.yui-skin-sam .yuimenuitem-checked-disabled{background-image:url(menuitem_checkbox_disabled.png);}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menubaritem_submenuindicator.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menubaritem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menubaritem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menubaritem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_checkbox.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_checkbox.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_checkbox_disabled.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_checkbox_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_submenuindicator.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_submenuindicator.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_submenuindicator_disabled.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/menuitem_submenuindicator_disabled.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/modLabValues.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/modLabValues.css
old mode 100755
new mode 100644
index 9fd6c8cde..1fa945b4f
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/modLabValues.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/modLabValues.css
@@ -1,52 +1,52 @@
-DIV.modLabValues DIV.mlvBody {
- width:auto;
-}
-
-DIV.modLabValues DIV#mlvfrmNUMERIC P {
- top-margin:0px;
- bottom-margin:5px;
-}
-
-DIV.modLabValues INPUT.numInput {
- width:50px;
-}
-
-DIV.modLabValues INPUT.strInput {
- width:250px;
-}
-
-
-DIV.modLabValues DIV.mlvtop {
- display:block;
- vertical-align:top;
- width:100%;
-}
-
-DIV.modLabValues DIV.mlvModesGroup {
- float:left;
- margin:10px;
- width:136px;
-}
-
-DIV.modLabValues DIV.mlvInputGroup {
- float:left;
- margin:10px;
- vertical-align:top;
-}
-
-DIV.modLabValues DIV.mlvModesGroup > DIV {
- float:left;
- font-size:12px;
- line-height:10px;
- margin:0px;
- padding:4px 0px;
- width:180px;
-}
-
-DIV.modLabValues A.barlink {
- display:block;
- width:100%;
- text-decoration:none;
- color:#000;
- text-align: center;
+DIV.modLabValues DIV.mlvBody {
+ width:auto;
+}
+
+DIV.modLabValues DIV#mlvfrmNUMERIC P {
+ top-margin:0px;
+ bottom-margin:5px;
+}
+
+DIV.modLabValues INPUT.numInput {
+ width:50px;
+}
+
+DIV.modLabValues INPUT.strInput {
+ width:250px;
+}
+
+
+DIV.modLabValues DIV.mlvtop {
+ display:block;
+ vertical-align:top;
+ width:100%;
+}
+
+DIV.modLabValues DIV.mlvModesGroup {
+ float:left;
+ margin:10px;
+ width:136px;
+}
+
+DIV.modLabValues DIV.mlvInputGroup {
+ float:left;
+ margin:10px;
+ vertical-align:top;
+}
+
+DIV.modLabValues DIV.mlvModesGroup > DIV {
+ float:left;
+ font-size:12px;
+ line-height:10px;
+ margin:0px;
+ padding:4px 0px;
+ width:180px;
+}
+
+DIV.modLabValues A.barlink {
+ display:block;
+ width:100%;
+ text-decoration:none;
+ color:#000;
+ text-align: center;
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/print.png b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/print.png
new file mode 100644
index 000000000..f2a8c6425
Binary files /dev/null and b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/print.png differ
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/printer_img.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/printer_img.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/query_report.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/query_report.css
new file mode 100644
index 000000000..8f4a49680
--- /dev/null
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/query_report.css
@@ -0,0 +1,266 @@
+@media print
+{
+ .no-print, .no-print *
+ {
+ display: none !important;
+ }
+}
+
+#infoQueryStatusReport{
+ font-family: 'Open Sans', sans-serif;
+}
+
+.descHead
+{
+ border-bottom:1px solid #006699;
+ font-weight:bold;
+ font-size:20px;
+ padding-top:15px;
+ color:#006699;
+ font-family: 'Open Sans', sans-serif;
+ padding-bottom: 8px;
+}
+
+.QRMainHeader{
+ border-bottom: 1px solid #000;
+ font-weight: bold;
+ font-size: 28px;
+ padding-top: 30px;
+ font-family: 'Open Sans', sans-serif;
+ padding-bottom: 8px;
+}
+
+.descResultshead
+{
+ FONT-WEIGHT: bold;
+ COLOR: #fff;
+ /* FONT-FAMILY: Arial, Helvetica, sans-serif; */
+ BACKGROUND-COLOR: #6699CC;
+ TEXT-ALIGN: center;
+}
+
+.titleDivs
+{
+ width: 100%;
+ color: blue;
+ font-family: Arial Black;
+ font-size: 20px;
+}
+
+.subTitleDivs
+{
+ width: 100%;
+ color: #6699CC;
+ font-family: Open Sans;
+ font-size: 16px;
+ font-weight: bold;
+ padding-left: 60px;
+ padding-bottom: 5px;
+}
+
+.chartTitleDiv
+{
+ /*width: 100%; */
+ color: #6699CC;
+ font-family: Arial;
+ font-size: 18px;
+ /*font-weight: bold; */
+ padding-left: 10px;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ background: #F3F3F3;
+}
+
+#qdContainerTable
+{
+ width: 615px;
+ border-style: none;
+ border-spacing: 0px;
+ display: block;
+}
+
+#qdHeaderTable
+{
+ width: 625px;
+ border: 0px;
+ color : #006699;
+ font-size: 14px;
+}
+
+#queryDetailsTable
+{
+ width: 100%;
+ border-style: none;
+ padding: 10px;
+}
+
+.opDiv
+{
+ float:left;
+ width:100px;
+ /*height:20px;*/
+ padding-top:10px;
+ padding-bottom:5px;
+ font-size: 20px;
+ font-style: italic;
+ font-weight: bold;
+}
+
+.panelContainer
+{
+ float: left;
+ width:640px;
+ display: block;
+ border: 2px double black;
+ background: #CCCCCC;
+}
+
+.notOpPanel
+{
+ background: #FFA4A4;
+}
+
+.panelOperator
+{
+ height:30px;
+}
+
+.tabSpace
+{
+ float: left;
+ width: 20px;
+}
+
+.panelItem
+{
+ float: right;
+ width: 590px;
+}
+
+.chartCanvas
+{
+ display: block;
+}
+
+table.qrPanelItemTable
+{
+ background: white;
+}
+
+.QRSDiv
+{
+ display: block;
+ padding-left: 20px;
+}
+
+.qrsTable
+{
+ width: 250 px;
+ border: 1px double #6699CC;
+}
+
+.qrsTable td
+{
+ width: 50%;
+}
+
+#legendDiv
+{
+ height:60px;
+ width:100px;
+}
+
+.bar-legend
+{
+ list-style-type: none;
+ display: inline;
+}
+
+.bar-legend li
+{
+ font-size:20px;
+ display: inline;
+}
+
+.bar-legend li div.legendColor
+{
+ height:20px;
+ width:20px;
+ float:left;
+}
+
+.legendContainer
+{
+ height:25px;
+ width:100px;
+}
+
+.bar-legend .legendText
+{
+ width: 50%;
+ float:right;
+}
+
+.eventsRel
+{
+ width : 640px;
+ border:1px solid #667788;
+ background:#7FFFD4;
+}
+
+.eventsRelHdr
+{
+ width : 640px;
+ color:#333;
+ font-weight:bold;
+
+ font-size:18px;
+}
+
+.eventsRelSpan
+{
+ color:black;
+ font-weight:bold;
+ font-family:arial,helvetica;
+ font-size:12px;
+}
+
+.reultsTable
+{
+ width : 500px;
+ border-collapse: collapse;
+ font-size:15px;
+ TEXT-ALIGN: center;
+ margin-left: 60px;
+}
+
+.reultsTable td
+{
+ border : 1px double #6699CC;
+}
+
+#QueryReportLoading img {
+ display: block;
+ margin-left: auto;
+ margin-right: auto;
+}
+
+.no-show{
+ display: none;
+}
+
+#queryReport-viewer-body{
+ overflow: auto;
+ background-color:#FFF;
+}
+
+.qrGraphs .c3-legend-item {
+ cursor: auto !important;
+}
+
+#queryResultsContainer {
+ padding-left: 60px;
+}
+
+
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PDO.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PDO.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PR.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PR.css
old mode 100755
new mode 100644
index c6e0a52cc..0facf8881
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PR.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PR.css
@@ -1,26 +1,26 @@
-.sdxDefaultPR {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultPR img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultPR a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultPR a:hover {
- text-decoration:underline;
-}
-
-.ddPRTarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultPR {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultPR img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultPR a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultPR a:hover {
+ text-decoration:underline;
+}
+
+.ddPRTarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PR.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PR.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRC.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRC.css
old mode 100755
new mode 100644
index 06b7ba9f9..80718d236
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRC.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRC.css
@@ -1,26 +1,26 @@
-.sdxDefaultPRC {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultPRC img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultPRC a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultPRC a:hover {
- text-decoration:underline;
-}
-
-.ddPRCTarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultPRC {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultPRC img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultPRC a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultPRC a:hover {
+ text-decoration:underline;
+}
+
+.ddPRCTarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRC.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRC.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.css
old mode 100755
new mode 100644
index 60f1de436..04ab8195e
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.css
@@ -1,26 +1,26 @@
-.sdxDefaultPRS {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultPRS img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultPRS a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultPRS a:hover {
- text-decoration:underline;
-}
-
-.ddPRSTarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultPRS {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultPRS img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultPRS a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultPRS a:hover {
+ text-decoration:underline;
+}
+
+.ddPRSTarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_PRS.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QDEF.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QDEF.css
old mode 100755
new mode 100644
index efbc3a9c4..207ecdfe3
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QDEF.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QDEF.css
@@ -1,26 +1,26 @@
-.sdxDefaultQDEF {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultQDEF img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultQDEF a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultQDEF a:hover {
- text-decoration:underline;
-}
-
-.ddQDEFTarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultQDEF {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultQDEF img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultQDEF a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultQDEF a:hover {
+ text-decoration:underline;
+}
+
+.ddQDEFTarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QDEF.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QDEF.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QGDEF.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QGDEF.css
old mode 100755
new mode 100644
index 172275cb7..14faf105e
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QGDEF.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QGDEF.css
@@ -1,26 +1,26 @@
-.sdxDefaultQGDEF {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultQGDEF img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultQGDEF a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultQGDEF a:hover {
- text-decoration:underline;
-}
-
-.ddQGDEFTarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultQGDEF {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultQGDEF img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultQGDEF a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultQGDEF a:hover {
+ text-decoration:underline;
+}
+
+.ddQGDEFTarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QGDEF.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QGDEF.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI.css
old mode 100755
new mode 100644
index e23cb8a60..6bfa8ccc2
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI.css
@@ -1,26 +1,26 @@
-.sdxDefaultQI {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultQI img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultQI a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultQI a:hover {
- text-decoration:underline;
-}
-
-.ddQITarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultQI {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultQI img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultQI a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultQI a:hover {
+ text-decoration:underline;
+}
+
+.ddQITarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI_exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QI_exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM.css
old mode 100755
new mode 100644
index 5e5bbcb67..6e6133e82
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM.css
@@ -1,27 +1,27 @@
-.sdxDefaultQM {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultQM img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultQM a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultQM a:hover {
- text-decoration:underline;
-}
-
-.ddQMTarget {
- background:#FFFFBB !important;
-}
-
+.sdxDefaultQM {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultQM img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultQM a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultQM a:hover {
+ text-decoration:underline;
+}
+
+.ddQMTarget {
+ background:#FFFFBB !important;
+}
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QMT.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QMT.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QMT_exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QMT_exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM_exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM_exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM_workplace.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/sdx_CRC_QM_workplace.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwHistory.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwHistory.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwQryTool.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwQryTool.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwStatus.css b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwStatus.css
old mode 100755
new mode 100644
index ae8d9ad60..5c111a50d
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwStatus.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/vwStatus.css
@@ -1,31 +1,86 @@
-DIV#crcStatusBox {
- position: absolute;
-}
-
-DIV#crcStatusBox DIV.tabTextBox {
-}
-
-DIV#crcStatusBox DIV.StatusBox {
- background: #BBCCEE none repeat scroll 0%;
- border: 1px solid #667788;
- clear: both;
- display: block;
- overflow: hidden;
- padding: 5px;
- position: relative;
- top: -1px;
- height: auto;
- width: auto;
- z-index: 0;
-}
-
-DIV#crcStatusBox DIV.StatusBoxText {
- background: #FFFFFF none repeat scroll 0%;
- border: 1px solid #667788;
- height: 144px;
- overflow: hidden;
- padding: 1px 5px;
- width: auto;
- overflow: auto;
-}
-
+DIV#crcStatusBox {
+ position: absolute;
+}
+
+DIV#crcStatusBox DIV.tabTextBox {
+}
+
+DIV#crcStatusBox DIV.StatusBox {
+ background: #BBCCEE none repeat scroll 0%;
+ border: 1px solid #667788;
+ clear: both;
+ display: block;
+ overflow: hidden;
+ padding: 5px;
+ position: relative;
+ top: -1px;
+ height: auto;
+ width: auto;
+ z-index: 0;
+}
+
+DIV#crcStatusBox DIV.StatusBoxText {
+ background: #FFFFFF none repeat scroll 0%;
+ border: 1px solid #667788;
+ height: 144px;
+ overflow: hidden;
+ padding: 1px 5px;
+ width: auto;
+ overflow: auto;
+}
+
+/* BG */
+DIV#crcStatusBox DIV.StatusBoxChart {
+ background: #FFFFFF none repeat scroll 0%;
+ border: 1px solid #667788;
+ height: 144px;
+ width: auto;
+ overflow: hidden;
+ padding: 1px 5px;
+ overflow: auto;
+}
+
+DIV#crcStatusBox DIV.StatusBoxReport {
+ background: #FFFFFF none repeat scroll 0%;
+ border: 1px solid #667788;
+ height: 144px;
+ width: auto;
+ overflow: hidden;
+ padding: 1px 5px;
+ overflow: auto;
+}
+
+DIV#crcStatusBox DIV.StatusBoxDownload {
+ background: #FFFFFF none repeat scroll 0%;
+ border: 1px solid #667788;
+ height: 144px;
+ width: auto;
+ overflow: hidden;
+ padding: 1px 5px;
+ overflow: auto;
+}
+
+table#resultsTable td, th {
+ width: 4rem;
+ height: 2rem;
+ border: 1px solid #ccc;
+ text-align: center;
+}
+
+table#resultsTable th {
+ background: lightblue;
+ border-color: white;
+}
+
+table#resultsTable body {
+ padding: 1rem;
+}
+
+/* Graph styling */
+.chartDiv {
+ width: auto;
+ /* padding-top:20px; */
+ padding-bottom: 20px;
+}
+/* BG */
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/zoom_icon.gif b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/assets/zoom_icon.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/cell_config_data.js
old mode 100755
new mode 100644
index c793e9f3f..911bea67b
--- a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/cell_config_data.js
@@ -1,46 +1,50 @@
// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
// every file in this list will be loaded after the cell's Init function is called
{
files: [
// "CRC_ajax.js",
"CRC_ctrlr_Dates.js",
"CRC_ctrlr_History.js",
"CRC_ctrlr_QryPanel.js",
"CRC_ctrlr_QryTool.js",
"CRC_ctrlr_QryStatus.js",
+ "CRC_ctrlr_QryResults.js",//BG
"CRC_sdx_QM.js",
"CRC_sdx_QI.js",
"CRC_sdx_PRC.js",
"CRC_sdx_PRS.js",
"CRC_sdx_ENS.js",
"CRC_sdx_PR.js",
"CRC_sdx_QDEF.js",
"CRC_sdx_QGDEF.js",
"CRC_view_History.js",
"CRC_view_QryTool.js",
"CRC_view_Status.js",
+ "CRC_view_Graphs.js",//BG
+ "CRC_view_QueryReport.js",//BG
+ "CRC_view_DownloadData.js",//BG
"CRC_view_modLabRange.js",
"i2b2_msgs.js"
],
files_updated: [
{origName: "i2b2_msgs.js", newName: "i2b2_msgs-Ver1_3.js", versionLevel: 1.3},
{origName: "CRC_sdx_QI.js", newName: "CRC_sdx_QI-Ver1_3.js", versionLevel: 1.3}
],
css: [ "main_list.css" ], // ONLY USE 1 STYLE SHEET: http://support.microsoft.com/kb/262161
config: {
// additional configuration variables that are set by the system
name: "Data Repository",
description: "The Data Repository cell stores all information that a user saves within the i2b2 Hive.",
icons: {
size32x32: "CRC_icon_32x32.gif"
},
category: ["core","cell"],
paramTranslation: [
{thinClientName:'sortBy', defaultValue:'DATE'},
{thinClientName:'sortOrder', defaultValue:'DESC'},
{thinClientName:'maxQueriesDisp', defaultValue:20},
{thinClientName:'maxChildren', defaultValue:200},
{thinClientName:'queryTimeout', defaultValue:180}
]
}
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/CRC/i2b2_msgs.js b/shrine-webclient/src/main/html/js-i2b2/cells/CRC/i2b2_msgs.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_ctrlr_FindBy.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_ctrlr_FindBy.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_ctrlr_general.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_ctrlr_general.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_sdx_CONCPT.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_sdx_CONCPT.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_view_Find.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_view_Find.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_view_Main.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_view_Main.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_view_Nav.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/ONT_view_Nav.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/loadera16.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/loadera16.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/main_list.css b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/main_list.css
old mode 100755
new mode 100644
index 11bc27c55..695311ee3
--- a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/main_list.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/main_list.css
@@ -1,2 +1,2 @@
-@import url(sdx_ONT_CONCPT.css);
-@import url(ontMain.css);
+@import url(sdx_ONT_CONCPT.css);
+@import url(ontMain.css);
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/ontMain.css b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/ontMain.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT.css b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT.css
old mode 100755
new mode 100644
index dd517472c..2d96fac3f
--- a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT.css
@@ -1,26 +1,30 @@
-.sdxDefaultCONCPT {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- zcursor:pointer;
-}
-.sdxDefaultCONCPT img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultCONCPT a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultCONCPT a:hover {
- text-decoration:underline;
-}
-
-.ddCONCPTTarget {
- background:#FFFFBB !important;
-}
-
+.sdxDefaultCONCPT {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ zcursor:pointer;
+}
+.sdxDefaultCONCPT img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultCONCPT a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultCONCPT a:hover {
+ text-decoration:underline;
+}
+
+.ddCONCPTTarget {
+ background:#FFFFBB !important;
+}
+
+span.itemExclude {
+ font-size: 8px;
+ color: red;
+}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_branch-exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_branch-exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_branch.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_branch.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_leaf.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_leaf.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_root-exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_root-exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_root.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_CONCPT_root.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_branch-exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_branch-exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_branch.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_branch.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_leaf-exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_leaf-exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_leaf.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_leaf.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_root-exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_root-exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_root.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/sdx_ONT_MODIFIER_root.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/zoom_icon.gif b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/assets/zoom_icon.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/cell_config_data.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/ONT/i2b2_msgs.js b/shrine-webclient/src/main/html/js-i2b2/cells/ONT/i2b2_msgs.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_ctrlr_general.js b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_ctrlr_general.js
old mode 100755
new mode 100644
index 6c4fc20ec..29dd63956
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_ctrlr_general.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_ctrlr_general.js
@@ -1,180 +1,180 @@
-/**
- * @projectDescription Main controller for the Plugin Manager system.
- * @inherits i2b2
- * @namespace i2b2.PLUGINMGR
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.4
- * ----------------------------------------------------------------------------------------
- * updated 9-18-09: Updates required by PM update [Nick Benik]
- */
-console.group('Load & Execute component file: PLUGINMGR > ctrl > general');
-console.time('execute time');
-
-
-// helper function to be used by plugins to create canvas objects
-i2b2.PLUGINMGR.createCanvas = function(containerDIV){
- // we must dynamically create our CANVAS node
- var canvas = document.createElement("canvas");
- var trgtDIV = $(containerDIV);
- if (!trgtDIV.appendChild) {
- console.error("[i2b2.PLUGINMGR.createCanvas] Bad canvas container DIV provided");
- return false;
- }
- trgtDIV.appendChild(canvas);
-
- // dynamically initialize canvas object (only on IE)
- if (/msie/i.test(navigator.userAgent)) {
- var guid = i2b2.h.GenerateAlphaNumId(6);
- canvas.id = guid;
- G_vmlCanvasManager.initElement(canvas);
- var canvas = $(guid);
- canvas.id = "";
- }
- return canvas;
-};
-
-
-// main plugin handler
-i2b2.PLUGINMGR.visible = false;
-i2b2.PLUGINMGR.ctrlr.main =
-{
- ZoomView: function() {
- if (i2b2.hive.MasterView.getViewMode()=="Analysis") {
- i2b2.hive.MasterView.setViewMode('AnalysisZoomed');
- } else {
- i2b2.hive.MasterView.setViewMode('Analysis');
- }
- },
-/*
- getPluginList: function() {
- var results = {};
- var cellsLoaded = i2b2.hive.cfg.LoadedCells;
- for (var i1=0; i1<cellsLoaded.length; i1++) {
- var pluginName = cellsLoaded[i1].code;
- if (!i2b2[pluginName].cfg.config.plugin) { pluginName = false; }
- if (pluginName) {
- results[pluginName] = i2b2[pluginName];
- }
- }
- return results;
- },
-*/
- selectPlugin: function(pluginCode) {
- // function to load selected plugin
- if (i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin')) {
- alert("The plugin you clicked does not contain all the required information needed to load.");
- return false;
- }
-
- // send unload single to any plugin that is currently loaded
- if (!i2b2.h.isBadObjPath('i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr')) {
- // Something loaded. fire Unload() and exit if cancel is requested
- var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr.Unload;
- if (!t || t()) {
- // remove plugin name from tab
- try {
- $('anaPluginViewBox').select('DIV.tabBox DIV')[0].innerHTML = "Plugin Viewer";
- } catch(e) {
- console.warn("Could not change PluginViewBox tab label!");
- }
- // clear plugin view window
- if (i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr.cfg.config.plugin.isolateHtml) {
- // clear IFRAME
- var doc = $('anaPluginIFRAME').contentDocument;
- if (!doc) {var doc = $('anaPluginIFRAME').contentWindow.document; }
- doc.open();
- doc.write('Select a plugin to load from the "Plugins" window.');
- doc.close();
- } else {
- // clear DIV
- var trgt = $('anaPluginViewFrame');
- while (trgt.childNodes.length > 0) { trgt.removeChild(trgt.firstChild); }
- trgt.innerHTML = '<div class="initialMsg">Select a plugin to load from the "Plugins" window.</div>';
- }
- delete i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
- } else {
- return false;
- }
- }
-
- // show the plugin name on the main container tab
- try {
- if (i2b2[pluginCode].cfg.config.short_name) {
- sName = i2b2[pluginCode].cfg.config.short_name;
- } else {
- sName = i2b2[pluginCode].cfg.config.name;
- }
- $('anaPluginViewBox').select('DIV.tabBox DIV')[0].innerHTML = sName;
- } catch(e) {
- console.warn("Could not change PluginViewBox tab label!");
- }
- // LOAD PLUGIN GUI
- if (!i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin.iframe')) {
- // the plugin requires loading into an IFRAME
- } else if (!i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin.html')) {
- // the plugin requires direct loading into the DOM tree
- var url = i2b2[pluginCode].cfg.config.assetDir + i2b2[pluginCode].cfg.config.plugin.html.source;
- var response = new Ajax.Request(url, {method: 'get', asynchronous: false});
- console.dir(response);
- if (response.transport.statusText=="OK") {
- // load the html into the IFRAME
- var doc = $('anaPluginIFRAME').contentDocument;
- if (!doc) {var doc = $('anaPluginIFRAME').contentWindow.document; }
- doc.open();
- doc.write(response.transport.responseText);
- doc.close();
- // get the main screen DIV
- var mainDiv = doc.getElementById(i2b2[pluginCode].cfg.config.plugin.html.mainDivId);
- if (!mainDiv) {
- alert("The Plugin's screen was loaded but had errors.");
- return false;
- }
- // clear plugin view window
- var trgt = $('anaPluginViewFrame');
- while (trgt.childNodes.length > 0) { trgt.removeChild(trgt.firstChild); }
- // copy the div to our working window and display it.
- if (mainDiv.outerHTML) {
- // fix for IE issues
- trgt.innerHTML = mainDiv.outerHTML;
- var scrn = trgt.firstChild;
- scrn.style.display = '';
- } else {
- var scrn = mainDiv.cloneNode(true);
- trgt.appendChild(scrn);
- scrn.show();
- }
- // perform GUI changes if the plugin is going to be using standard tabs at the top
- var useTabs = false;
- if (!i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin.standardTabs')) {
- useTabs = Boolean.parseTo(i2b2[pluginCode].cfg.config.plugin.standardTabs);
- }
- i2b2.PLUGINMGR.view.PlugView.UsesTabs(useTabs);
- // show plugin
- trgt.show();
- // notify the plugin's controller class to activate
- try {
- i2b2[pluginCode].Init(scrn);
- i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr = i2b2[pluginCode];
- i2b2.PLUGINMGR.ctrlr.main.currentPluginParentDiv = scrn;
- } catch(e) {
- alert('An error has occurred while trying to initialize the Plugin.');
- }
- // fire the plugin's Resize() function
- i2b2.PLUGINMGR.view.PlugView.ResizeHeight();
- // Reconnect any drag drop handlers that have been dropped, if this plugin has been previously loaded (a YUI issue)
- YAHOO.util.DDM.reattachHandlers();
- } else {
- alert('A problem was encounter while loading the plugin.');
- return false;
- }
- } else {
- alert("The plugin you clicked does not specify how it needs to be loaded.");
- return false;
- }
- }
-};
-
-
-
-console.timeEnd('execute time');
-console.groupEnd();
+/**
+ * @projectDescription Main controller for the Plugin Manager system.
+ * @inherits i2b2
+ * @namespace i2b2.PLUGINMGR
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.4
+ * ----------------------------------------------------------------------------------------
+ * updated 9-18-09: Updates required by PM update [Nick Benik]
+ */
+console.group('Load & Execute component file: PLUGINMGR > ctrl > general');
+console.time('execute time');
+
+
+// helper function to be used by plugins to create canvas objects
+i2b2.PLUGINMGR.createCanvas = function(containerDIV){
+ // we must dynamically create our CANVAS node
+ var canvas = document.createElement("canvas");
+ var trgtDIV = $(containerDIV);
+ if (!trgtDIV.appendChild) {
+ console.error("[i2b2.PLUGINMGR.createCanvas] Bad canvas container DIV provided");
+ return false;
+ }
+ trgtDIV.appendChild(canvas);
+
+ // dynamically initialize canvas object (only on IE)
+ if (/msie/i.test(navigator.userAgent)) {
+ var guid = i2b2.h.GenerateAlphaNumId(6);
+ canvas.id = guid;
+ G_vmlCanvasManager.initElement(canvas);
+ var canvas = $(guid);
+ canvas.id = "";
+ }
+ return canvas;
+};
+
+
+// main plugin handler
+i2b2.PLUGINMGR.visible = false;
+i2b2.PLUGINMGR.ctrlr.main =
+{
+ ZoomView: function() {
+ if (i2b2.hive.MasterView.getViewMode()=="Analysis") {
+ i2b2.hive.MasterView.setViewMode('AnalysisZoomed');
+ } else {
+ i2b2.hive.MasterView.setViewMode('Analysis');
+ }
+ },
+/*
+ getPluginList: function() {
+ var results = {};
+ var cellsLoaded = i2b2.hive.cfg.LoadedCells;
+ for (var i1=0; i1<cellsLoaded.length; i1++) {
+ var pluginName = cellsLoaded[i1].code;
+ if (!i2b2[pluginName].cfg.config.plugin) { pluginName = false; }
+ if (pluginName) {
+ results[pluginName] = i2b2[pluginName];
+ }
+ }
+ return results;
+ },
+*/
+ selectPlugin: function(pluginCode) {
+ // function to load selected plugin
+ if (i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin')) {
+ alert("The plugin you clicked does not contain all the required information needed to load.");
+ return false;
+ }
+
+ // send unload single to any plugin that is currently loaded
+ if (!i2b2.h.isBadObjPath('i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr')) {
+ // Something loaded. fire Unload() and exit if cancel is requested
+ var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr.Unload;
+ if (!t || t()) {
+ // remove plugin name from tab
+ try {
+ $('anaPluginViewBox').select('DIV.tabBox DIV')[0].innerHTML = "Plugin Viewer";
+ } catch(e) {
+ console.warn("Could not change PluginViewBox tab label!");
+ }
+ // clear plugin view window
+ if (i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr.cfg.config.plugin.isolateHtml) {
+ // clear IFRAME
+ var doc = $('anaPluginIFRAME').contentDocument;
+ if (!doc) {var doc = $('anaPluginIFRAME').contentWindow.document; }
+ doc.open();
+ doc.write('Select a plugin to load from the "Plugins" window.');
+ doc.close();
+ } else {
+ // clear DIV
+ var trgt = $('anaPluginViewFrame');
+ while (trgt.childNodes.length > 0) { trgt.removeChild(trgt.firstChild); }
+ trgt.innerHTML = '<div class="initialMsg">Select a plugin to load from the "Plugins" window.</div>';
+ }
+ delete i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
+ } else {
+ return false;
+ }
+ }
+
+ // show the plugin name on the main container tab
+ try {
+ if (i2b2[pluginCode].cfg.config.short_name) {
+ sName = i2b2[pluginCode].cfg.config.short_name;
+ } else {
+ sName = i2b2[pluginCode].cfg.config.name;
+ }
+ $('anaPluginViewBox').select('DIV.tabBox DIV')[0].innerHTML = sName;
+ } catch(e) {
+ console.warn("Could not change PluginViewBox tab label!");
+ }
+ // LOAD PLUGIN GUI
+ if (!i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin.iframe')) {
+ // the plugin requires loading into an IFRAME
+ } else if (!i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin.html')) {
+ // the plugin requires direct loading into the DOM tree
+ var url = i2b2[pluginCode].cfg.config.assetDir + i2b2[pluginCode].cfg.config.plugin.html.source;
+ var response = new Ajax.Request(url, {method: 'get', asynchronous: false});
+ console.dir(response);
+ if (response.transport.statusText=="OK") {
+ // load the html into the IFRAME
+ var doc = $('anaPluginIFRAME').contentDocument;
+ if (!doc) {var doc = $('anaPluginIFRAME').contentWindow.document; }
+ doc.open();
+ doc.write(response.transport.responseText);
+ doc.close();
+ // get the main screen DIV
+ var mainDiv = doc.getElementById(i2b2[pluginCode].cfg.config.plugin.html.mainDivId);
+ if (!mainDiv) {
+ alert("The Plugin's screen was loaded but had errors.");
+ return false;
+ }
+ // clear plugin view window
+ var trgt = $('anaPluginViewFrame');
+ while (trgt.childNodes.length > 0) { trgt.removeChild(trgt.firstChild); }
+ // copy the div to our working window and display it.
+ if (mainDiv.outerHTML) {
+ // fix for IE issues
+ trgt.innerHTML = mainDiv.outerHTML;
+ var scrn = trgt.firstChild;
+ scrn.style.display = '';
+ } else {
+ var scrn = mainDiv.cloneNode(true);
+ trgt.appendChild(scrn);
+ scrn.show();
+ }
+ // perform GUI changes if the plugin is going to be using standard tabs at the top
+ var useTabs = false;
+ if (!i2b2.h.isBadObjPath('i2b2.'+pluginCode+'.cfg.config.plugin.standardTabs')) {
+ useTabs = Boolean.parseTo(i2b2[pluginCode].cfg.config.plugin.standardTabs);
+ }
+ i2b2.PLUGINMGR.view.PlugView.UsesTabs(useTabs);
+ // show plugin
+ trgt.show();
+ // notify the plugin's controller class to activate
+ try {
+ i2b2[pluginCode].Init(scrn);
+ i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr = i2b2[pluginCode];
+ i2b2.PLUGINMGR.ctrlr.main.currentPluginParentDiv = scrn;
+ } catch(e) {
+ alert('An error has occurred while trying to initialize the Plugin.');
+ }
+ // fire the plugin's Resize() function
+ i2b2.PLUGINMGR.view.PlugView.ResizeHeight();
+ // Reconnect any drag drop handlers that have been dropped, if this plugin has been previously loaded (a YUI issue)
+ YAHOO.util.DDM.reattachHandlers();
+ } else {
+ alert('A problem was encounter while loading the plugin.');
+ return false;
+ }
+ } else {
+ alert("The plugin you clicked does not specify how it needs to be loaded.");
+ return false;
+ }
+ }
+};
+
+
+
+console.timeEnd('execute time');
+console.groupEnd();
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_PlugView.js b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_PlugView.js
old mode 100755
new mode 100644
index 0e6c80a1c..921b1b772
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_PlugView.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_PlugView.js
@@ -1,314 +1,314 @@
-/**
- * @projectDescription The controller for the Plugin Viewer window (GUI-only controller).
- * @inherits i2b2.PLUGINMGR.view
- * @namespace i2b2.PLUGINMGR.view.PluginView
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * ----------------------------------------------------------------------------------------
- * updated 10-30-08: Initial Launch [Nick Benik]
- */
-console.group('Load & Execute component file: PLUGINMGR > view > PlugView');
-console.time('execute time');
-
-
-// ********* View: PlugView *********
-// create and save the view object
-i2b2.PLUGINMGR.view.PlugView = new i2b2Base_cellViewController(i2b2.PLUGINMGR, 'PlugView');
-i2b2.PLUGINMGR.view.PlugView.visible = false;
-
-
-/*
- * Adjust width of PLUGINMGR after users drags splitter
- */
-//================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.splitterDragged = function()
-{
- var viewPortDim = document.viewport.getDimensions();
- var splitter = $( i2b2.hive.mySplitter.name );
- var pluginBox = $("anaPluginViewBox");
-
- if (splitter.style.visibility=="visible")
- {
- var basicWidth = parseInt(viewPortDim.width) - parseInt(splitter.style.left) - parseInt(splitter.offsetWidth);
- pluginBox.style.left = parseInt(splitter.offsetWidth) + parseInt(splitter.style.left) + 3 + "px";
- pluginBox.style.width = Math.max(basicWidth - 24, 0) + "px";
- }
- else
- {
- pluginBox.style.left = 15 + "px";
- pluginBox.style.width = Math.max( parseInt(viewPortDim.width)-36, 0) + "px";
- }
-}
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.ResizeHeight = function(e) {
- // this function provides the resize functionality needed for this screen
- var viewObj = i2b2.PLUGINMGR.view.PlugView;
- var ve = $('anaPluginViewBox');
- if (viewObj.visible) {
- var ds = document.viewport.getDimensions();
- var h = ds.height;
- if (h < 517) {h = 517;}
- ve.show();
- // resize our visual components
- switch(i2b2.hive.MasterView.getViewMode()) {
- case "Admin":
- break;
- case "Analysis":
- ve.show();
- if (i2b2.WORK && i2b2.WORK.isLoaded) {
- var z = h - 390 + 142;
- } else {
- var z = h - 390 + 100;
- }
- $('anaPluginViewFrame').style.height = z;
- break;
-
- case "AnalysisZoomed":
- ve.show();
- h = h - 98;
- ve.style.left = '';
- $('anaPluginViewFrame').style.height = h;
- break;
- }
- var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
- if (t) {
- if (t.cfg.config.plugin.standardTabs) {
- // special resizing for tabs
- var tn = $('anaPluginViewBox').select('DIV.yui-content')[0];
- if (i2b2.hive.MasterView.getViewMode() == "AnalysisZoomed") {
- tn.style.height = (h - 34);
- } else {
- tn.style.height = (h - 283);
- }
- }
- if (t.Resize) {
- // a plugin is currently loaded and has a Resize() routine, pass it redraw data
- var rdp = Element.cumulativeOffset(ve);
- var rdd = Element.getDimensions(ve);
- var rd = {
- height: rdd.height,
- width: rdd.width,
- left: rdp.left,
- top: rdp.top
- };
- t.Resize(rd);
- }
- }
- } else {
- ve.hide();
- }
-}
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.Resize = function(e) {
- // this function provides the resize functionality needed for this screen
- var viewObj = i2b2.PLUGINMGR.view.PlugView;
- var ve = $('anaPluginViewBox');
- if (viewObj.visible) {
- var ds = document.viewport.getDimensions();
- var w = ds.width;
- var h = ds.height;
- if (w < 840) {w = 840;}
- if (h < 517) {h = 517;}
- ve.show();
- // resize our visual components
- switch(i2b2.hive.MasterView.getViewMode()) {
- case "Analysis":
- ve.show();
- w = w - 18;
- ve.style.left = parseInt(w/3) + 22;
- ve.style.width = (parseInt(w/3)*2) - 28;
- if (i2b2.WORK && i2b2.WORK.isLoaded) {
- var z = h - 390 + 142;
- } else {
- var z = h - 390 + 100;
- }
- $('anaPluginViewFrame').style.height = z;
- break;
-
- case "AnalysisZoomed":
- ve.show();
- w = w - 40;
- h = h - 98;
-// t.style.left = 16;
-// t.style.width = w;
-// var attribs1 = { width: {to: w}, left: {to: 16} };
-// var anim1 = new YAHOO.util.Anim('anaPluginViewBox', attribs1, 1, YAHOO.util.Easing.easeOut);
-// anim1.animate();
-// var attribs2 = {height: {to: h}};
-// var anim2 = new YAHOO.util.Anim('anaPluginViewFrame', attribs2, 1, YAHOO.util.Easing.easeOut);
-// anim2.animate();
- ve.style.width = w;
- ve.style.left = '';
- $('anaPluginViewFrame').style.height = h;
- break;
- }
- var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
- if (t) {
- if (t.cfg.config.plugin.standardTabs) {
- // special resizing for tabs
- var tn = $('anaPluginViewBox').select('DIV.yui-content')[0];
- if (i2b2.hive.MasterView.getViewMode() == "AnalysisZoomed") {
- tn.style.height = (h - 34);
- } else {
- tn.style.height = (h - 283);
- }
-/*
- var tn = tn.parentNode;
- while (tn && tn != i2b2.PLUGINMGR.ctrlr.main.currentPluginParentDiv ) {
- // size the parent node as well and dig up the tree
- tn.style.height = h;
- tn = tn.parentNode;
- }
-*/
- }
- if (t.Resize) {
- // a plugin is currently loaded and has a Resize() routine, pass it redraw data
- var rdp = Element.cumulativeOffset(ve);
- var rdd = Element.getDimensions(ve);
- var rd = {
- height: rdd.height,
- width: rdd.width,
- left: rdp.left,
- top: rdp.top
- };
- t.Resize(rd);
- }
- }
- } else {
- ve.hide();
- }
-}
-// attach resize events
-//YAHOO.util.Event.addListener(window, "resize", i2b2.PLUGINMGR.view.PlugView.Resize, i2b2.PLUGINMGR.view.PlugView); // tdw9
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.show = function() {
- i2b2.PLUGINMGR.view.PlugView.visible = true;
- $('anaPluginViewBox').show();
- i2b2.PLUGINMGR.view.PlugView.ResizeHeight();
- var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
- if (t && t.wasShown) {
- t.wasShown();
- }
-};
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.hide = function() {
- i2b2.PLUGINMGR.view.PlugView.visible = false;
- $('anaPluginViewBox').hide();
- var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
- if (t && t.wasHidden) {
- t.wasHidden();
- }
-};
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.UsesTabs = function(bIn) {
- i2b2.PLUGINMGR.view.PlugView._isUsingTabs = bIn;
- if (bIn) {
- // use tabs
- $('anaPluginViewFrame').addClassName('USETABS');
-// $$('#ExampTabs-mainDiv .yui-content')[0].style.height = (parseInt($('anaPluginViewFrame').style.height) - 34)+'px';
- } else {
- // don't use tabs
- $('anaPluginViewFrame').removeClassName('USETABS');
- }
-}
-
-
-
-// process view mode changes (via EVENT CAPTURE)
-// ================================================================================================== //
-i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode) {
- newMode = newMode[0];
- this.viewMode = newMode;
- switch(newMode) {
- case "AnalysisZoomed":
- case "Analysis":
- // check if other windows are zoomed and blocking us
- var zw = i2b2.hive.MasterView.getZoomWindows();
- if (zw.member("PLUGINLST"))
- this.view.PlugView.hide();
- else
- {
- this.view.PlugView.show();
- var splitter = $( i2b2.hive.mySplitter.name );
- if ( newMode === "AnalysisZoomed")
- splitter.style.visibility="hidden";
- else
- splitter.style.visibility="visible";
- i2b2.PLUGINMGR.view.PlugView.splitterDragged();
- // bug fix for IE
- //setTimeout("i2b2.PLUGINMGR.view.PlugView.Resize()", 100); // tdw9
- }
- break;
- default:
- this.view.PlugView.hide();
- var splitter = $( i2b2.hive.mySplitter.name ); // make splitter visible
- splitter.style.visibility="visible";
- break;
- }
-}),'',i2b2.PLUGINMGR);
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.PlugView.ZoomView = function() {
- i2b2.hive.MasterView.toggleZoomWindow("PLUGINLST");
-}
-
-
-//================================================================================================== //
-i2b2.events.initView.subscribe((function(eventTypeName, zoomMsg)
-{
- newMode = zoomMsg[0];
- if (!newMode.action) { return; }
- if (newMode.window == "PLUGINLST") {
- if (newMode.action == "ADD") {
- this.visible = false;
- this.isZoomed = false;
- } else {
- this.isZoomed = false;
- this.visible = true;
- }
- this.Resize();
- }
-}),'',i2b2.PLUGINMGR.view.PlugView);
-
-
-
-// ================================================================================================== //
-i2b2.events.changedZoomWindows.subscribe((function(eventTypeName, zoomMsg) {
- newMode = zoomMsg[0];
- if (!newMode.action) { return; }
- if (newMode.window == "PLUGINLST") {
- if (newMode.action == "ADD") {
- this.visible = false;
- this.isZoomed = false;
- } else {
- this.isZoomed = false;
- this.visible = true;
- }
- this.ResizeHeight();
- }
-}),'',i2b2.PLUGINMGR.view.PlugView);
-
-
-
-i2b2.PLUGINMGR.view.PlugView.showOptions = function() {
- var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
- if (t && t.ShowOptions) {
- t.ShowOptions();
- }
-};
-
-// set image icon
-$('plugviewZoomImg').src = i2b2.PLUGINMGR.cfg.config.assetDir+"zoom_icon.gif"
-
-console.timeEnd('execute time');
-console.groupEnd();
+/**
+ * @projectDescription The controller for the Plugin Viewer window (GUI-only controller).
+ * @inherits i2b2.PLUGINMGR.view
+ * @namespace i2b2.PLUGINMGR.view.PluginView
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ * updated 10-30-08: Initial Launch [Nick Benik]
+ */
+console.group('Load & Execute component file: PLUGINMGR > view > PlugView');
+console.time('execute time');
+
+
+// ********* View: PlugView *********
+// create and save the view object
+i2b2.PLUGINMGR.view.PlugView = new i2b2Base_cellViewController(i2b2.PLUGINMGR, 'PlugView');
+i2b2.PLUGINMGR.view.PlugView.visible = false;
+
+
+/*
+ * Adjust width of PLUGINMGR after users drags splitter
+ */
+//================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.splitterDragged = function()
+{
+ var viewPortDim = document.viewport.getDimensions();
+ var splitter = $( i2b2.hive.mySplitter.name );
+ var pluginBox = $("anaPluginViewBox");
+
+ if (splitter.style.visibility=="visible")
+ {
+ var basicWidth = parseInt(viewPortDim.width) - parseInt(splitter.style.left) - parseInt(splitter.offsetWidth);
+ pluginBox.style.left = parseInt(splitter.offsetWidth) + parseInt(splitter.style.left) + 3 + "px";
+ pluginBox.style.width = Math.max(basicWidth - 24, 0) + "px";
+ }
+ else
+ {
+ pluginBox.style.left = 15 + "px";
+ pluginBox.style.width = Math.max( parseInt(viewPortDim.width)-36, 0) + "px";
+ }
+}
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.ResizeHeight = function(e) {
+ // this function provides the resize functionality needed for this screen
+ var viewObj = i2b2.PLUGINMGR.view.PlugView;
+ var ve = $('anaPluginViewBox');
+ if (viewObj.visible) {
+ var ds = document.viewport.getDimensions();
+ var h = ds.height;
+ if (h < 517) {h = 517;}
+ ve.show();
+ // resize our visual components
+ switch(i2b2.hive.MasterView.getViewMode()) {
+ case "Admin":
+ break;
+ case "Analysis":
+ ve.show();
+ if (i2b2.WORK && i2b2.WORK.isLoaded) {
+ var z = h - 390 + 142;
+ } else {
+ var z = h - 390 + 100;
+ }
+ $('anaPluginViewFrame').style.height = z;
+ break;
+
+ case "AnalysisZoomed":
+ ve.show();
+ h = h - 98;
+ ve.style.left = '';
+ $('anaPluginViewFrame').style.height = h;
+ break;
+ }
+ var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
+ if (t) {
+ if (t.cfg.config.plugin.standardTabs) {
+ // special resizing for tabs
+ var tn = $('anaPluginViewBox').select('DIV.yui-content')[0];
+ if (i2b2.hive.MasterView.getViewMode() == "AnalysisZoomed") {
+ tn.style.height = (h - 34);
+ } else {
+ tn.style.height = (h - 283);
+ }
+ }
+ if (t.Resize) {
+ // a plugin is currently loaded and has a Resize() routine, pass it redraw data
+ var rdp = Element.cumulativeOffset(ve);
+ var rdd = Element.getDimensions(ve);
+ var rd = {
+ height: rdd.height,
+ width: rdd.width,
+ left: rdp.left,
+ top: rdp.top
+ };
+ t.Resize(rd);
+ }
+ }
+ } else {
+ ve.hide();
+ }
+}
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.Resize = function(e) {
+ // this function provides the resize functionality needed for this screen
+ var viewObj = i2b2.PLUGINMGR.view.PlugView;
+ var ve = $('anaPluginViewBox');
+ if (viewObj.visible) {
+ var ds = document.viewport.getDimensions();
+ var w = ds.width;
+ var h = ds.height;
+ if (w < 840) {w = 840;}
+ if (h < 517) {h = 517;}
+ ve.show();
+ // resize our visual components
+ switch(i2b2.hive.MasterView.getViewMode()) {
+ case "Analysis":
+ ve.show();
+ w = w - 18;
+ ve.style.left = parseInt(w/3) + 22;
+ ve.style.width = (parseInt(w/3)*2) - 28;
+ if (i2b2.WORK && i2b2.WORK.isLoaded) {
+ var z = h - 390 + 142;
+ } else {
+ var z = h - 390 + 100;
+ }
+ $('anaPluginViewFrame').style.height = z;
+ break;
+
+ case "AnalysisZoomed":
+ ve.show();
+ w = w - 40;
+ h = h - 98;
+// t.style.left = 16;
+// t.style.width = w;
+// var attribs1 = { width: {to: w}, left: {to: 16} };
+// var anim1 = new YAHOO.util.Anim('anaPluginViewBox', attribs1, 1, YAHOO.util.Easing.easeOut);
+// anim1.animate();
+// var attribs2 = {height: {to: h}};
+// var anim2 = new YAHOO.util.Anim('anaPluginViewFrame', attribs2, 1, YAHOO.util.Easing.easeOut);
+// anim2.animate();
+ ve.style.width = w;
+ ve.style.left = '';
+ $('anaPluginViewFrame').style.height = h;
+ break;
+ }
+ var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
+ if (t) {
+ if (t.cfg.config.plugin.standardTabs) {
+ // special resizing for tabs
+ var tn = $('anaPluginViewBox').select('DIV.yui-content')[0];
+ if (i2b2.hive.MasterView.getViewMode() == "AnalysisZoomed") {
+ tn.style.height = (h - 34);
+ } else {
+ tn.style.height = (h - 283);
+ }
+/*
+ var tn = tn.parentNode;
+ while (tn && tn != i2b2.PLUGINMGR.ctrlr.main.currentPluginParentDiv ) {
+ // size the parent node as well and dig up the tree
+ tn.style.height = h;
+ tn = tn.parentNode;
+ }
+*/
+ }
+ if (t.Resize) {
+ // a plugin is currently loaded and has a Resize() routine, pass it redraw data
+ var rdp = Element.cumulativeOffset(ve);
+ var rdd = Element.getDimensions(ve);
+ var rd = {
+ height: rdd.height,
+ width: rdd.width,
+ left: rdp.left,
+ top: rdp.top
+ };
+ t.Resize(rd);
+ }
+ }
+ } else {
+ ve.hide();
+ }
+}
+// attach resize events
+//YAHOO.util.Event.addListener(window, "resize", i2b2.PLUGINMGR.view.PlugView.Resize, i2b2.PLUGINMGR.view.PlugView); // tdw9
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.show = function() {
+ i2b2.PLUGINMGR.view.PlugView.visible = true;
+ $('anaPluginViewBox').show();
+ i2b2.PLUGINMGR.view.PlugView.ResizeHeight();
+ var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
+ if (t && t.wasShown) {
+ t.wasShown();
+ }
+};
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.hide = function() {
+ i2b2.PLUGINMGR.view.PlugView.visible = false;
+ $('anaPluginViewBox').hide();
+ var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
+ if (t && t.wasHidden) {
+ t.wasHidden();
+ }
+};
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.UsesTabs = function(bIn) {
+ i2b2.PLUGINMGR.view.PlugView._isUsingTabs = bIn;
+ if (bIn) {
+ // use tabs
+ $('anaPluginViewFrame').addClassName('USETABS');
+// $$('#ExampTabs-mainDiv .yui-content')[0].style.height = (parseInt($('anaPluginViewFrame').style.height) - 34)+'px';
+ } else {
+ // don't use tabs
+ $('anaPluginViewFrame').removeClassName('USETABS');
+ }
+}
+
+
+
+// process view mode changes (via EVENT CAPTURE)
+// ================================================================================================== //
+i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode) {
+ newMode = newMode[0];
+ this.viewMode = newMode;
+ switch(newMode) {
+ case "AnalysisZoomed":
+ case "Analysis":
+ // check if other windows are zoomed and blocking us
+ var zw = i2b2.hive.MasterView.getZoomWindows();
+ if (zw.member("PLUGINLST"))
+ this.view.PlugView.hide();
+ else
+ {
+ this.view.PlugView.show();
+ var splitter = $( i2b2.hive.mySplitter.name );
+ if ( newMode === "AnalysisZoomed")
+ splitter.style.visibility="hidden";
+ else
+ splitter.style.visibility="visible";
+ i2b2.PLUGINMGR.view.PlugView.splitterDragged();
+ // bug fix for IE
+ //setTimeout("i2b2.PLUGINMGR.view.PlugView.Resize()", 100); // tdw9
+ }
+ break;
+ default:
+ this.view.PlugView.hide();
+ var splitter = $( i2b2.hive.mySplitter.name ); // make splitter visible
+ splitter.style.visibility="visible";
+ break;
+ }
+}),'',i2b2.PLUGINMGR);
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.PlugView.ZoomView = function() {
+ i2b2.hive.MasterView.toggleZoomWindow("PLUGINLST");
+}
+
+
+//================================================================================================== //
+i2b2.events.initView.subscribe((function(eventTypeName, zoomMsg)
+{
+ newMode = zoomMsg[0];
+ if (!newMode.action) { return; }
+ if (newMode.window == "PLUGINLST") {
+ if (newMode.action == "ADD") {
+ this.visible = false;
+ this.isZoomed = false;
+ } else {
+ this.isZoomed = false;
+ this.visible = true;
+ }
+ this.Resize();
+ }
+}),'',i2b2.PLUGINMGR.view.PlugView);
+
+
+
+// ================================================================================================== //
+i2b2.events.changedZoomWindows.subscribe((function(eventTypeName, zoomMsg) {
+ newMode = zoomMsg[0];
+ if (!newMode.action) { return; }
+ if (newMode.window == "PLUGINLST") {
+ if (newMode.action == "ADD") {
+ this.visible = false;
+ this.isZoomed = false;
+ } else {
+ this.isZoomed = false;
+ this.visible = true;
+ }
+ this.ResizeHeight();
+ }
+}),'',i2b2.PLUGINMGR.view.PlugView);
+
+
+
+i2b2.PLUGINMGR.view.PlugView.showOptions = function() {
+ var t = i2b2.PLUGINMGR.ctrlr.main.currentPluginCtrlr;
+ if (t && t.ShowOptions) {
+ t.ShowOptions();
+ }
+};
+
+// set image icon
+$('plugviewZoomImg').src = i2b2.PLUGINMGR.cfg.config.assetDir+"zoom_icon.gif"
+
+console.timeEnd('execute time');
+console.groupEnd();
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_list.js b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_list.js
old mode 100755
new mode 100644
index e6d27fa0e..b780a24ba
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_list.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/PLUGINMGR_view_list.js
@@ -1,306 +1,306 @@
-/**
- * @projectDescription View controller for the Plugin list window (GUI-related functionality).
- * @inherits i2b2.PLUGINMGR.view
- * @namespace i2b2.PLUGINMGR.view.list
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.5
- * ----------------------------------------------------------------------------------------
- * updated 9-18-09: Updates required by PM update [Nick Benik]
- */
-console.group('Load & Execute component file: PLUGINMGR > view > list');
-console.time('execute time');
-
-
-// ********* View: List *********
-// create and save the view object
-i2b2.PLUGINMGR.view.list = new i2b2Base_cellViewController(i2b2.PLUGINMGR, 'list');
-i2b2.PLUGINMGR.view.list.visible = false;
-
-
-/*
- * Adjust width of PLUGINMGR after users drags splitter
- */
-//================================================================================================== //
-i2b2.PLUGINMGR.view.list.splitterDragged = function()
-{
- var viewPortDim = document.viewport.getDimensions();
- var splitter = $( i2b2.hive.mySplitter.name );
- var pluginListBox = $("anaPluginListBox");
-
- var basicWidth = parseInt(viewPortDim.width) - parseInt(splitter.style.left) - parseInt(splitter.offsetWidth);
-
- pluginListBox.style.left = parseInt(splitter.offsetWidth) + parseInt(splitter.style.left) + 3 + "px";
- pluginListBox.style.width = Math.max(basicWidth - 24, 0) + "px";
-}
-
-//================================================================================================== //
-i2b2.PLUGINMGR.view.list.ResizeHeight = function(e) {
- var viewObj = i2b2.PLUGINMGR.view.list;
- if (viewObj.visible) {
- var ds = document.viewport.getDimensions();
- var h = ds.height;
- if (h < 517) {h = 517;}
- // resize our visual components
- var ve = $('anaPluginListBox').style;
- var le = $('anaPluginList').style;
- switch(viewObj.viewMode) {
- case "Analysis":
- if (viewObj.isZoomed) {
- le.height = h-95-27;
- ve.top = '';
- } else {
- if (i2b2.WORK && i2b2.WORK.isLoaded) {
- le.height = 102-27;
- ve.top = h-196+44;
- } else {
- le.height = 146-28;
- ve.top = h-196;
- }
- }
- break;
- default:
- break;
- }
- }
-}
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.list.Resize = function(e) {
- var viewObj = i2b2.PLUGINMGR.view.list;
- if (viewObj.visible) {
- var ds = document.viewport.getDimensions();
- var w = ds.width;
- var h = ds.height;
- if (w < 840) {w = 840;}
- if (h < 517) {h = 517;}
- // resize our visual components
- var ve = $('anaPluginListBox').style;
- var le = $('anaPluginList').style;
- switch(viewObj.viewMode) {
- case "Analysis":
- w = w - 18;
- ve.left = parseInt(w/3) + 22;
- ve.width = (parseInt(w/3)*2) - 28;
- if (viewObj.isZoomed) {
- le.height = h-95-27;
- ve.top = '';
- } else {
- if (i2b2.WORK && i2b2.WORK.isLoaded) {
- le.height = 102-27;
- ve.top = h-196+44;
- } else {
- le.height = 146-28;
- ve.top = h-196;
- }
- }
- break;
- default:
- break;
- }
- }
-}
-// attach resize events
-//YAHOO.util.Event.addListener(window, "resize", i2b2.PLUGINMGR.view.list.Resize, i2b2.PLUGINMGR.view.list); // tdw9
-
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.list.show = function() {
- var t = i2b2.PLUGINMGR.view.list;
- t.visible = true;
- $('anaPluginListBox').show();
- t.Resize();
-};
-
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.list.hide = function() {
- i2b2.PLUGINMGR.view.list.visible = false;
- $('anaPluginListBox').hide();
-};
-
-
-// process view mode changes (via EVENT CAPTURE)
-// ================================================================================================== //
-i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode) {
- newMode = newMode[0];
- var t = i2b2.PLUGINMGR.view.list;
- t.viewMode = newMode;
- switch(newMode) {
- case "Analysis":
- t.show();
- t.BuildCategories();
- t.Render();
- t.splitterDragged();
- //t.Resize();
- break;
- default:
- t.hide();
- break;
- }
-}),'',i2b2.PLUGINMGR);
-
-
-i2b2.PLUGINMGR.view.list.BuildCategories = function() {
- // clear plugins category list
- var domDD = $('anaPluginCats');
- while( domDD.hasChildNodes() ) { domDD.removeChild( domDD.lastChild ); }
- var catList = [];
-
- var cellsLoaded = i2b2.hive.cfg.LoadedCells;
- for (var idx in cellsLoaded) {
- if (cellsLoaded[idx]) {
- if (i2b2[idx].cfg.config.plugin) {
- catList.push(i2b2[idx].cfg.config.category);
- }
- }
- }
- // flattent and remove duplicates
- catList = catList.flatten();
- catList = catList.uniq();
-
- // remove non-relevent categories
- catList = catList.without('cell','celless','core','plugin');
-
- // populate dropdown list
- var dno = document.createElement('OPTION');
- dno.setAttribute('value', "ALL");
- var dnt = document.createTextNode("ALL");
- dno.appendChild(dnt);
- domDD.appendChild(dno);
- for (var i1=0; i1<catList.length; i1++) {
- var dno = document.createElement('OPTION');
- dno.setAttribute('value', catList[i1]);
- var dnt = document.createTextNode(catList[i1]);
- dno.appendChild(dnt);
- domDD.appendChild(dno);
- }
-
-}
-
-
-i2b2.PLUGINMGR.view.list.Render = function() {
- // clear plugins List
- var domContainer = $('anaPluginList');
- domContainer.hide();
- while( domContainer.hasChildNodes() ) { domContainer.removeChild( domContainer.lastChild ); }
-
- var cn = $("anaPluginCats");
- if (!cn) {
- var cFilter = false;
- } else {
- var cFilter = cn.options[cn.selectedIndex].value;
- }
-
- // get our render template
- var xTemplate = $('anaPluginView');
- xTemplate = xTemplate.options[xTemplate.selectedIndex].value;
- if (xTemplate == "DETAIL") {
- xTemplate = $('plugListRecDETAIL-CLONE');
- var xIconVarName = 'size32x32';
- } else {
- xTemplate = $('plugListRecSUMMARY-CLONE');
- var xIconVarName = 'size16x16';
- }
-
-
- // loop through all plugins in the framework
- var cellsLoaded = i2b2.hive.cfg.LoadedCells;
- for (var pluginName in cellsLoaded) {
- if (cellsLoaded[pluginName] && !i2b2[pluginName].cfg.config.plugin) {
- pluginName = false;
- } else if (cFilter!="ALL" && i2b2[pluginName].cfg.config.category.indexOf(cFilter)==-1) {
- pluginName = false;
- }
- if (pluginName) {
- // clone the record DIV and add it to the display list
- var rec = xTemplate.cloneNode(true);
- // change the entry id
- rec.id = "pluginViewList-"+pluginName;
- var t_ref = i2b2[pluginName].cfg.config;
- // extract the
- // change the plugin's icon
- try {
- var part = rec.select('.Icon > IMG')[0];
- if (t_ref.icons[xIconVarName]) {
- part.src = t_ref.assetDir + t_ref.icons[xIconVarName];
- } else {
- part.src = i2b2.PLUGINMGR.cfg.config.assetDir+i2b2.PLUGINMGR.cfg.config.defaultListIcons[xIconVarName];
- }
- } catch(e) {}
- // change name and description
- try {
- var part = rec.select('DIV.Name')[0];
- if (t_ref.name) {
- part.innerHTML = t_ref.name;
- } else {
- part.innerHTML = pluginName + " Plugin";
- }
- } catch(e) {}
- try {
- var part = rec.select('DIV.Descript')[0];
- if (t_ref.description) {
- part.innerHTML = t_ref.description;
- } else {
- part.innerHTML = "<I>No description available.</I>";
- }
- } catch(e) {}
- // attach the record into our DOM tree
- domContainer.appendChild(rec);
- YAHOO.util.Event.addListener(rec.id, "click", i2b2.PLUGINMGR.view.list.recordClick);
- rec.show();
- }
- }
- domContainer.show();
-};
-
-i2b2.PLUGINMGR.view.list.recordClick = function(e) {
- var tn;
- if (this.hasClassName('pluginRecordBox')) {
- var loc = this.id.indexOf('-') + 1;
- if (loc > 0) {
- var pCode = this.id.substr(loc);
- i2b2.PLUGINMGR.ctrlr.main.selectPlugin(pCode);
- // GUI - unzoom to show plugin loaded
- if (i2b2.PLUGINMGR.view.list.isZoomed) {
- i2b2.PLUGINMGR.view.list.ZoomView();
- }
- }
- }
-}
-
-// ================================================================================================== //
-i2b2.PLUGINMGR.view.list.ZoomView = function() {
- i2b2.hive.MasterView.toggleZoomWindow("PLUGINLST");
-}
-
-
-
-// ================================================================================================== //
-i2b2.events.changedZoomWindows.subscribe((function(eventTypeName, zoomMsg) {
- newMode = zoomMsg[0];
- if (!newMode.action) { return; }
- if (newMode.window == "PLUGINLST") {
- if (newMode.action == "ADD") {
- this.visible = true;
- this.isZoomed = true;
- } else {
- this.isZoomed = false;
- this.visible = true;
- }
- this.ResizeHeight();
- }
-}),'',i2b2.PLUGINMGR.view.list);
-
-i2b2.PLUGINMGR.view.list.showOptions = function() {
- alert('show options for plugin viewer list');
-}
-
-
-// set image icon
-$('pluglstZoomImg').src = i2b2.PLUGINMGR.cfg.config.assetDir+"zoom_icon.gif";
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription View controller for the Plugin list window (GUI-related functionality).
+ * @inherits i2b2.PLUGINMGR.view
+ * @namespace i2b2.PLUGINMGR.view.list
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.5
+ * ----------------------------------------------------------------------------------------
+ * updated 9-18-09: Updates required by PM update [Nick Benik]
+ */
+console.group('Load & Execute component file: PLUGINMGR > view > list');
+console.time('execute time');
+
+
+// ********* View: List *********
+// create and save the view object
+i2b2.PLUGINMGR.view.list = new i2b2Base_cellViewController(i2b2.PLUGINMGR, 'list');
+i2b2.PLUGINMGR.view.list.visible = false;
+
+
+/*
+ * Adjust width of PLUGINMGR after users drags splitter
+ */
+//================================================================================================== //
+i2b2.PLUGINMGR.view.list.splitterDragged = function()
+{
+ var viewPortDim = document.viewport.getDimensions();
+ var splitter = $( i2b2.hive.mySplitter.name );
+ var pluginListBox = $("anaPluginListBox");
+
+ var basicWidth = parseInt(viewPortDim.width) - parseInt(splitter.style.left) - parseInt(splitter.offsetWidth);
+
+ pluginListBox.style.left = parseInt(splitter.offsetWidth) + parseInt(splitter.style.left) + 3 + "px";
+ pluginListBox.style.width = Math.max(basicWidth - 24, 0) + "px";
+}
+
+//================================================================================================== //
+i2b2.PLUGINMGR.view.list.ResizeHeight = function(e) {
+ var viewObj = i2b2.PLUGINMGR.view.list;
+ if (viewObj.visible) {
+ var ds = document.viewport.getDimensions();
+ var h = ds.height;
+ if (h < 517) {h = 517;}
+ // resize our visual components
+ var ve = $('anaPluginListBox').style;
+ var le = $('anaPluginList').style;
+ switch(viewObj.viewMode) {
+ case "Analysis":
+ if (viewObj.isZoomed) {
+ le.height = h-95-27;
+ ve.top = '';
+ } else {
+ if (i2b2.WORK && i2b2.WORK.isLoaded) {
+ le.height = 102-27;
+ ve.top = h-196+44;
+ } else {
+ le.height = 146-28;
+ ve.top = h-196;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.list.Resize = function(e) {
+ var viewObj = i2b2.PLUGINMGR.view.list;
+ if (viewObj.visible) {
+ var ds = document.viewport.getDimensions();
+ var w = ds.width;
+ var h = ds.height;
+ if (w < 840) {w = 840;}
+ if (h < 517) {h = 517;}
+ // resize our visual components
+ var ve = $('anaPluginListBox').style;
+ var le = $('anaPluginList').style;
+ switch(viewObj.viewMode) {
+ case "Analysis":
+ w = w - 18;
+ ve.left = parseInt(w/3) + 22;
+ ve.width = (parseInt(w/3)*2) - 28;
+ if (viewObj.isZoomed) {
+ le.height = h-95-27;
+ ve.top = '';
+ } else {
+ if (i2b2.WORK && i2b2.WORK.isLoaded) {
+ le.height = 102-27;
+ ve.top = h-196+44;
+ } else {
+ le.height = 146-28;
+ ve.top = h-196;
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ }
+}
+// attach resize events
+//YAHOO.util.Event.addListener(window, "resize", i2b2.PLUGINMGR.view.list.Resize, i2b2.PLUGINMGR.view.list); // tdw9
+
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.list.show = function() {
+ var t = i2b2.PLUGINMGR.view.list;
+ t.visible = true;
+ $('anaPluginListBox').show();
+ t.Resize();
+};
+
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.list.hide = function() {
+ i2b2.PLUGINMGR.view.list.visible = false;
+ $('anaPluginListBox').hide();
+};
+
+
+// process view mode changes (via EVENT CAPTURE)
+// ================================================================================================== //
+i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode) {
+ newMode = newMode[0];
+ var t = i2b2.PLUGINMGR.view.list;
+ t.viewMode = newMode;
+ switch(newMode) {
+ case "Analysis":
+ t.show();
+ t.BuildCategories();
+ t.Render();
+ t.splitterDragged();
+ //t.Resize();
+ break;
+ default:
+ t.hide();
+ break;
+ }
+}),'',i2b2.PLUGINMGR);
+
+
+i2b2.PLUGINMGR.view.list.BuildCategories = function() {
+ // clear plugins category list
+ var domDD = $('anaPluginCats');
+ while( domDD.hasChildNodes() ) { domDD.removeChild( domDD.lastChild ); }
+ var catList = [];
+
+ var cellsLoaded = i2b2.hive.cfg.LoadedCells;
+ for (var idx in cellsLoaded) {
+ if (cellsLoaded[idx]) {
+ if (i2b2[idx].cfg.config.plugin) {
+ catList.push(i2b2[idx].cfg.config.category);
+ }
+ }
+ }
+ // flattent and remove duplicates
+ catList = catList.flatten();
+ catList = catList.uniq();
+
+ // remove non-relevent categories
+ catList = catList.without('cell','celless','core','plugin');
+
+ // populate dropdown list
+ var dno = document.createElement('OPTION');
+ dno.setAttribute('value', "ALL");
+ var dnt = document.createTextNode("ALL");
+ dno.appendChild(dnt);
+ domDD.appendChild(dno);
+ for (var i1=0; i1<catList.length; i1++) {
+ var dno = document.createElement('OPTION');
+ dno.setAttribute('value', catList[i1]);
+ var dnt = document.createTextNode(catList[i1]);
+ dno.appendChild(dnt);
+ domDD.appendChild(dno);
+ }
+
+}
+
+
+i2b2.PLUGINMGR.view.list.Render = function() {
+ // clear plugins List
+ var domContainer = $('anaPluginList');
+ domContainer.hide();
+ while( domContainer.hasChildNodes() ) { domContainer.removeChild( domContainer.lastChild ); }
+
+ var cn = $("anaPluginCats");
+ if (!cn) {
+ var cFilter = false;
+ } else {
+ var cFilter = cn.options[cn.selectedIndex].value;
+ }
+
+ // get our render template
+ var xTemplate = $('anaPluginView');
+ xTemplate = xTemplate.options[xTemplate.selectedIndex].value;
+ if (xTemplate == "DETAIL") {
+ xTemplate = $('plugListRecDETAIL-CLONE');
+ var xIconVarName = 'size32x32';
+ } else {
+ xTemplate = $('plugListRecSUMMARY-CLONE');
+ var xIconVarName = 'size16x16';
+ }
+
+
+ // loop through all plugins in the framework
+ var cellsLoaded = i2b2.hive.cfg.LoadedCells;
+ for (var pluginName in cellsLoaded) {
+ if (cellsLoaded[pluginName] && !i2b2[pluginName].cfg.config.plugin) {
+ pluginName = false;
+ } else if (cFilter!="ALL" && i2b2[pluginName].cfg.config.category.indexOf(cFilter)==-1) {
+ pluginName = false;
+ }
+ if (pluginName) {
+ // clone the record DIV and add it to the display list
+ var rec = xTemplate.cloneNode(true);
+ // change the entry id
+ rec.id = "pluginViewList-"+pluginName;
+ var t_ref = i2b2[pluginName].cfg.config;
+ // extract the
+ // change the plugin's icon
+ try {
+ var part = rec.select('.Icon > IMG')[0];
+ if (t_ref.icons[xIconVarName]) {
+ part.src = t_ref.assetDir + t_ref.icons[xIconVarName];
+ } else {
+ part.src = i2b2.PLUGINMGR.cfg.config.assetDir+i2b2.PLUGINMGR.cfg.config.defaultListIcons[xIconVarName];
+ }
+ } catch(e) {}
+ // change name and description
+ try {
+ var part = rec.select('DIV.Name')[0];
+ if (t_ref.name) {
+ part.innerHTML = t_ref.name;
+ } else {
+ part.innerHTML = pluginName + " Plugin";
+ }
+ } catch(e) {}
+ try {
+ var part = rec.select('DIV.Descript')[0];
+ if (t_ref.description) {
+ part.innerHTML = t_ref.description;
+ } else {
+ part.innerHTML = "<I>No description available.</I>";
+ }
+ } catch(e) {}
+ // attach the record into our DOM tree
+ domContainer.appendChild(rec);
+ YAHOO.util.Event.addListener(rec.id, "click", i2b2.PLUGINMGR.view.list.recordClick);
+ rec.show();
+ }
+ }
+ domContainer.show();
+};
+
+i2b2.PLUGINMGR.view.list.recordClick = function(e) {
+ var tn;
+ if (this.hasClassName('pluginRecordBox')) {
+ var loc = this.id.indexOf('-') + 1;
+ if (loc > 0) {
+ var pCode = this.id.substr(loc);
+ i2b2.PLUGINMGR.ctrlr.main.selectPlugin(pCode);
+ // GUI - unzoom to show plugin loaded
+ if (i2b2.PLUGINMGR.view.list.isZoomed) {
+ i2b2.PLUGINMGR.view.list.ZoomView();
+ }
+ }
+ }
+}
+
+// ================================================================================================== //
+i2b2.PLUGINMGR.view.list.ZoomView = function() {
+ i2b2.hive.MasterView.toggleZoomWindow("PLUGINLST");
+}
+
+
+
+// ================================================================================================== //
+i2b2.events.changedZoomWindows.subscribe((function(eventTypeName, zoomMsg) {
+ newMode = zoomMsg[0];
+ if (!newMode.action) { return; }
+ if (newMode.window == "PLUGINLST") {
+ if (newMode.action == "ADD") {
+ this.visible = true;
+ this.isZoomed = true;
+ } else {
+ this.isZoomed = false;
+ this.visible = true;
+ }
+ this.ResizeHeight();
+ }
+}),'',i2b2.PLUGINMGR.view.list);
+
+i2b2.PLUGINMGR.view.list.showOptions = function() {
+ alert('show options for plugin viewer list');
+}
+
+
+// set image icon
+$('pluglstZoomImg').src = i2b2.PLUGINMGR.cfg.config.assetDir+"zoom_icon.gif";
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_14x14.gif b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_14x14.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_16x16.gif b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_16x16.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_32x32.gif b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/DEFAULTLIST_icon_32x32.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/main_list.css b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/main_list.css
old mode 100755
new mode 100644
index ce6dc2ff9..985347641
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/main_list.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/main_list.css
@@ -1,2 +1,2 @@
-@import url(vwList.css);
-@import url(vwViewer.css);
+@import url(vwList.css);
+@import url(vwViewer.css);
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/vwList.css b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/vwList.css
old mode 100755
new mode 100644
index a74e3e03d..0a2884739
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/vwList.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/vwList.css
@@ -1,156 +1,156 @@
-DIV#anaPluginListBox {
- position: absolute;
-}
-
-DIV#anaPluginListBox DIV.tabTextBox {
- background: #BBCCEE none repeat scroll 0%;
- border-color: #667788;
- border-style: solid solid none;
- border-width: 1px;
- cursor: pointer;
- float: left;
- height: 20px;
- margin-right: 5px;
- padding: 5px 5px 0px;
- width: 136px;
- position:relative;
- z-index:10;
-}
-
-DIV.tabText {
- background: #6677AA none repeat scroll 0%;
- border: 1px solid #667788;
- color: #FFFFFF;
- font-family: arial,helvetica;
- font-size: 12px;
- font-weight: bold;
- height: 18px;
- line-height: 17px;
- text-align: center;
-}
-
-DIV#anaPluginListBox DIV.PluginListBox {
- background: #BBCCEE none repeat scroll 0%;
- border: 1px solid #667788;
- clear: both;
- display: block;
- overflow: hidden;
- padding: 5px;
- position: relative;
- top: -1px;
- height: auto;
- width: auto;
- z-index: 0;
-}
-
-DIV#anaPluginListBox DIV.PluginListBox DIV.topmenu {
- padding: 2px;
- background: #DBE8EF;
- border: 1px solid #888;
- height: 21px;
- text-align: right;
- overflow:hidden;
-}
-
-DIV#anaPluginListBox DIV#anaPluginList {
- background: #FFF;
- border: 1px solid #667788;
- height: 144px;
- overflow-y: scroll;
- overflow-x: hidden;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox {
- border-top: 1px solid #FFFFFF;
- border-left: 1px solid #FFFFFF;
- border-right: 1px solid #FFFFFF;
- border-bottom: 1px solid #667788;
- padding: 1px 5px;
- display: block;
- cursor: pointer;
- background: #DBE8EF;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox:hover {
- background-color:#FFFFCC;
-
-}
-
-DIV#anaPluginListBox A.pluginRecordBox DIV.Icon {
- float: left;
- background: #ffffff;
- border: solid 1px #678;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox DIV.Name {
- font-family: arial,helvetica;
- font-size: 12px;
- font-weight: bold;
- line-height: 12px;
-}
-
-
-
-
-DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.txtBoundBox {
- padding: 0 2px;
- margin: 0px 36px 0px;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.Name {
- line-height: 14px;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.Descript {
- font-family: arial,helvetica;
- font-size: 10px;
- line-height: 10px;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.Icon {
- height: 32px;
- width: 32px;
-}
-
-
-
-
-DIV#anaPluginListBox A.pluginRecordBox.SUMMARY {
- padding: 0px 5px;
- height: 16px;
- overflow: hidden;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.txtBoundBox {
- margin: 0px 26px 0px;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.Name {
- line-height: 15px;
- font-weight: normal;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.Descript {
- font-family: arial,helvetica;
- font-size: 10px;
- line-height: 12px;
-}
-
-DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.Icon {
- height: 11px;
- width: 11px;
- overflow: hidden;
- margin-top: 1px;
-}
-
-
-
-
-
-
-
-
-
-DIV#anaPluginListBox DIV.PluginListBox SELECT {
- border: 1px solid #ABADB3;
+DIV#anaPluginListBox {
+ position: absolute;
+}
+
+DIV#anaPluginListBox DIV.tabTextBox {
+ background: #BBCCEE none repeat scroll 0%;
+ border-color: #667788;
+ border-style: solid solid none;
+ border-width: 1px;
+ cursor: pointer;
+ float: left;
+ height: 20px;
+ margin-right: 5px;
+ padding: 5px 5px 0px;
+ width: 136px;
+ position:relative;
+ z-index:10;
+}
+
+DIV.tabText {
+ background: #6677AA none repeat scroll 0%;
+ border: 1px solid #667788;
+ color: #FFFFFF;
+ font-family: arial,helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ height: 18px;
+ line-height: 17px;
+ text-align: center;
+}
+
+DIV#anaPluginListBox DIV.PluginListBox {
+ background: #BBCCEE none repeat scroll 0%;
+ border: 1px solid #667788;
+ clear: both;
+ display: block;
+ overflow: hidden;
+ padding: 5px;
+ position: relative;
+ top: -1px;
+ height: auto;
+ width: auto;
+ z-index: 0;
+}
+
+DIV#anaPluginListBox DIV.PluginListBox DIV.topmenu {
+ padding: 2px;
+ background: #DBE8EF;
+ border: 1px solid #888;
+ height: 21px;
+ text-align: right;
+ overflow:hidden;
+}
+
+DIV#anaPluginListBox DIV#anaPluginList {
+ background: #FFF;
+ border: 1px solid #667788;
+ height: 144px;
+ overflow-y: scroll;
+ overflow-x: hidden;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox {
+ border-top: 1px solid #FFFFFF;
+ border-left: 1px solid #FFFFFF;
+ border-right: 1px solid #FFFFFF;
+ border-bottom: 1px solid #667788;
+ padding: 1px 5px;
+ display: block;
+ cursor: pointer;
+ background: #DBE8EF;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox:hover {
+ background-color:#FFFFCC;
+
+}
+
+DIV#anaPluginListBox A.pluginRecordBox DIV.Icon {
+ float: left;
+ background: #ffffff;
+ border: solid 1px #678;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox DIV.Name {
+ font-family: arial,helvetica;
+ font-size: 12px;
+ font-weight: bold;
+ line-height: 12px;
+}
+
+
+
+
+DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.txtBoundBox {
+ padding: 0 2px;
+ margin: 0px 36px 0px;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.Name {
+ line-height: 14px;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.Descript {
+ font-family: arial,helvetica;
+ font-size: 10px;
+ line-height: 10px;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.DETAIL DIV.Icon {
+ height: 32px;
+ width: 32px;
+}
+
+
+
+
+DIV#anaPluginListBox A.pluginRecordBox.SUMMARY {
+ padding: 0px 5px;
+ height: 16px;
+ overflow: hidden;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.txtBoundBox {
+ margin: 0px 26px 0px;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.Name {
+ line-height: 15px;
+ font-weight: normal;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.Descript {
+ font-family: arial,helvetica;
+ font-size: 10px;
+ line-height: 12px;
+}
+
+DIV#anaPluginListBox A.pluginRecordBox.SUMMARY DIV.Icon {
+ height: 11px;
+ width: 11px;
+ overflow: hidden;
+ margin-top: 1px;
+}
+
+
+
+
+
+
+
+
+
+DIV#anaPluginListBox DIV.PluginListBox SELECT {
+ border: 1px solid #ABADB3;
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/vwViewer.css b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/vwViewer.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/zoom_icon.gif b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/assets/zoom_icon.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/cell_config_data.js
old mode 100755
new mode 100644
index 58de1e2fc..9f1636c59
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PLUGINMGR/cell_config_data.js
@@ -1,24 +1,24 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files: [
- "PLUGINMGR_ctrlr_general.js",
- "PLUGINMGR_view_list.js",
- "PLUGINMGR_view_PlugView.js"
- ],
- css: [ "main_list.css" ], // ONLY USE 1 STYLE SHEET: http://support.microsoft.com/kb/262161
- config: {
- // additional configuration variables that are set by the system
- i2b2Only: true,
- name: "Plugin Viewer",
- description: "This client-side cell is used to load and view other cells",
- icons: {
- size32x32: "PLUGIN_icon_32x32.gif"
- },
- defaultListIcons: {
- size16x16: "DEFAULTLIST_icon_14x14.gif",
- size32x32: "DEFAULTLIST_icon_32x32.gif"
- },
- category: ["core","celless"]
- }
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files: [
+ "PLUGINMGR_ctrlr_general.js",
+ "PLUGINMGR_view_list.js",
+ "PLUGINMGR_view_PlugView.js"
+ ],
+ css: [ "main_list.css" ], // ONLY USE 1 STYLE SHEET: http://support.microsoft.com/kb/262161
+ config: {
+ // additional configuration variables that are set by the system
+ i2b2Only: true,
+ name: "Plugin Viewer",
+ description: "This client-side cell is used to load and view other cells",
+ icons: {
+ size32x32: "PLUGIN_icon_32x32.gif"
+ },
+ defaultListIcons: {
+ size16x16: "DEFAULTLIST_icon_14x14.gif",
+ size32x32: "DEFAULTLIST_icon_32x32.gif"
+ },
+ category: ["core","celless"]
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_admin_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_admin_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_admin_view.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_admin_view.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_misc.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_misc.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_view.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_view.js
old mode 100755
new mode 100644
index 776295995..21b7e801e
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_view.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PM/PM_view.js
@@ -1,534 +1,534 @@
-/**
- * @projectDescription View controller for PM module's login form(s).
- * @inherits i2b2
- * @namespace i2b2.PM
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * ----------------------------------------------------------------------------------------
- * updated 9-15-08: RC4 launch [Nick Benik]
- */
-console.group('Load & Execute component file: cells > PM > view');
-console.time('execute time');
-
-var myDataTable = {};
-var mySubDataTable = {};
-var callerid = "";
-var parentid = "";
-/*
-i2b2.PM.view.main = new i2b2Base_cellViewController(i2b2.PM, 'main');
-i2b2.PM.view.main.visible = false;
-
-i2b2.PM.view.main.Resize = function(e){
- var t = $('pmNavTreeview');
- var ds = document.viewport.getDimensions();
- var w = ds.width;
- var h = ds.height-50;
- //if (w < 840) { w = 840; }
- if (h < 170) { h = 170; }
- $('pmNavTreeview').style.height = h - 47;
- $('pmAdminMainView').style.height = h - 44;
- $('pmNav').style.height = h;
- $('pmMain').style.height = h;
- $('pmMain').style.width = w - 225;
- $('pmAdminMainView').style.width = w - 240;
-}
-// attach resize events
-YAHOO.util.Event.addListener(window, "resize", i2b2.PM.view.main.Resize, i2b2.PM.view.main);
-
-// process view mode changes (via EVENT CAPTURE)
-// ================================================================================================== //
-i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode){
- newMode = newMode[0];
- this.viewMode = newMode;
-
- //this.Resize();
- switch (newMode) {
- case "Admin":
- i2b2.PM.model.admin.parentID = false;
- i2b2.PM.model.admin.configScreen = false;
-
- var pu = $('pmNav');
- pu.show();
- pu = pu.style;
- pu.width = 170;
- pu.height = 144;
-
- if (!this.tree) {
- this.tree = new YAHOO.widget.TreeView("pmNavTreeview");
- var root = this.tree.getRoot();
- var tmpNode = new YAHOO.widget.TextNode({label: "Hive", expanded: false}, root);
- tmpNode.data.i2b2NodeType = "HIVE";
- var tmpNode2 = new YAHOO.widget.TextNode({label: "Cells Data", expanded: false}, tmpNode);
- tmpNode2.data.i2b2NodeType = "HIVECELLS";
- var tmpNode2 = new YAHOO.widget.TextNode({label: "Global Params", expanded: false}, tmpNode);
- tmpNode2.data.i2b2NodeType = "HIVEPARAMS";
- var tmpNode = new YAHOO.widget.TextNode({label: "Projects", expanded: false}, root);
- tmpNode.data.i2b2NodeType = "PROJECTS";
- tmpNode.setDynamicLoad(i2b2.PM.adminRefreshProjects);
- var tmpNode = new YAHOO.widget.TextNode({label: "Manage Users", expanded: false}, root);
- tmpNode.data.i2b2NodeType = "USERS";
- this.tree.subscribe('clickEvent', i2b2.PM.adminTreeClick);
- this.tree.render();
- }
-
- this.tree.subscribe('clickEvent',function(oArgs) {
- //i2b2.PM.hideAll();
- switch(oArgs.node.label) {
- case "Global Params":
- callerid = "global";
- break;
- case "Hive Data":
- callerid = "hive";
- break;
- case "Manage Users":
- callerid = "user";
- break;
- case "Cell Data":
- callerid = "cell_data";
- break;
- case "Project Data":
- callerid = "project";
- break;
- case "Users Params":
- callerid = "param-user";
- break;
- }
- i2b2.PM.showItem(callerid);
- //YAHOO.util.Dom.get('msg').innerHTML = 'Click on node: ' + oArgs.node.label;
- });
- i2b2.PM.adminConfigScreenDispay(0);
- i2b2.PM.adminShowInfoPanel("LOADED");
- break;
- default:
- //$('pmNav').hide();
- $('pmMain').hide();
- $('pmNav').hide();
- //$('pmParam').hide();
- this.visible = false;
- break;
- }
- this.Resize();
-}),'',i2b2.PM.view.main);
-*/
-
-
-
-
-i2b2.PM.ShowParameter = function(origin, index) {
-
- if (index=-100) {
- var hiveid = this.myDataTable.getRecord(index);///.getData("domain_name");
-
-
- i2b2.PM.getAll("param-" + origin, ["param","name"], hiveid);
- var myColumnDefs = [
- {key:"id"},
- {key:"name",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"param",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"action"}
- ];
-
- mySubDataTable = new YAHOO.widget.DataTable("pmParamTableview", myColumnDefs, i2b2.PM.getHiveDataSource, {});
- var pu = $('pmParam');
- pu.show();
- pu = pu.style;
- pu.width = 800;
- pu.top = 350;
- pu.left = 200;
- pu.height = 144;
-
-
- switch(origin) {
- case "project":
- parentid = hiveid.getData("id");
- break;
- case "cell":
- parentid = hiveid.getData("domain_id");
- break;
- case "user":
- parentid = hiveid.getData("user_name");
- break;
- case "hive":
- parentid = hiveid.getData("domain_id");
- break;
- }
-
-
-
- for(var i=0; i<mySubDataTable.getRecordSet().getLength(); i++) {
- mySubDataTable.updateCell(mySubDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.UpdateRow('param','" + (mySubDataTable.getRecord(i).getId()) + "');\">Save</a>&nbsp;<a href=\"JavaScript:i2b2.PM.DeleteRow('param','" + (mySubDataTable.getRecord(i).getId()) + "');\">Delete</a>");
- mySubDataTable.updateCell(mySubDataTable.getRecord(i), "id", parentid);
- }
-
-
- // Set up editing flow
- var highlightEditableCell = function(oArgs) {
- var elCell = oArgs.target;
- if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
- this.highlightCell(elCell);
- }
- };
- // Enable row highlighting
- mySubDataTable.subscribe("rowMouseoverEvent", mySubDataTable.onEventHighlightRow);
- mySubDataTable.subscribe("rowMouseoutEvent", mySubDataTable.onEventUnhighlightRow);
-
- //mySubDataTable.subscribe("cellMouseoverEvent", highlightEditableCell);
- //mySubDataTable.subscribe("cellMouseoutEvent", mySubDataTable.onEventUnhighlightCell);
- mySubDataTable.subscribe("cellClickEvent", mySubDataTable.onEventShowCellEditor);
- }
-}
-
-i2b2.PM.ShowRole = function(index) {
- var record = this.myDataTable.getRecord(index); //.getData("id");
-
- i2b2.PM.getAll("role",["project_path","user_id","role"], record); //["project_path","user_id","user_role"]);
- var myColumnDefs = [
- {key:"project_path",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"user_id",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"role",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Active","Inactive"],disableBtns:true})},
- {key:"action"}
- ];
-
- mySubDataTable = new YAHOO.widget.DataTable("pmParamTableview",
- myColumnDefs, i2b2.PM.getHiveDataSource, {});
-
-
- var pu = $('pmParam');
- pu.show();
- pu = pu.style;
- pu.width = 800;
- pu.top = 350;
- pu.left = 200;
- pu.height = 144;
-
-
-
- for(var i=0; i<mySubDataTable.getRecordSet().getLength(); i++) {
- mySubDataTable.updateCell(mySubDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.UpdateRow('role','" + (mySubDataTable.getRecord(i).getId()) + "');\">Save</a>&nbsp;<a href=\"JavaScript:i2b2.PM.DeleteRow('role','" + (mySubDataTable.getRecord(i).getId()) + "');\">Delete</a>");
- }
-
-
-
-
- // Set up editing flow
- var highlightEditableCell = function(oArgs) {
- var elCell = oArgs.target;
- if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
- this.highlightCell(elCell);
- }
- };
- // Enable row highlighting
- mySubDataTable.subscribe("rowMouseoverEvent", mySubDataTable.onEventHighlightRow);
- mySubDataTable.subscribe("rowMouseoutEvent", mySubDataTable.onEventUnhighlightRow);
-
- //mySubDataTable.subscribe("cellMouseoverEvent", highlightEditableCell);
- //mySubDataTable.subscribe("cellMouseoutEvent", mySubDataTable.onEventUnhighlightCell);
- mySubDataTable.subscribe("cellClickEvent", mySubDataTable.onEventShowCellEditor);
-
-
-}
-
-
-i2b2.PM.DeleteRow = function(origin, index) {
- // this.myDataTable.deleteRow(index);
-
- // var trEl = this.myDataTable.getTrEl(index);
- // trEl.style.display = 'none'; //set 'none' to hide...
-
- answer = confirm("Do you really want to delete this item?");
-
- if (answer !=0)
-
- {
- switch(origin.substring(4,0)) {
- case "role":
- var record = mySubDataTable.getRecord(index);
- i2b2.PM.deleteData(origin, record);
-
- mySubDataTable.deleteRow(index);
-
- break;
- case "para":
- var record = mySubDataTable.getRecord(index);
- i2b2.PM.deleteData(origin, record);
-
- mySubDataTable.deleteRow(index);
-
- break;
- default:
- var record = this.myDataTable.getRecord(index);
- i2b2.PM.deleteData(origin, record);
-
- this.myDataTable.deleteRow(index);
- break;
- }
- }
-}
-
-i2b2.PM.AddRow = function() {
- this.myDataTable.set("sortedBy", null);
- this.myDataTable.addRow({ "action":""}, 0); //this.myDataTable.getRecordSet().getLength());
- //this.myDataTable.updateRow(this.myDataTable.getRecord(this.myDataTable.getRecordSet().getLength()-1),{ "action": "<a href=\"JavaScript:i2b2.PM.InsertRow('" + callerid + "','" + (this.myDataTable.getRecord(this.myDataTable.getRecordSet().getLength()-1).getId()) + "');\"><img src=\"js-i2b2/cells/PM/assets/add.gif\" border=\"0\"/></a>"});
- this.myDataTable.updateRow(this.myDataTable.getRecord(0),{ "action": "<a href=\"JavaScript:i2b2.PM.InsertRow('" + callerid + "','" + (this.myDataTable.getRecord(0).getId()) + "');\">Save</a>"});
-
-}
-
-i2b2.PM.UpdateRow = function(origin, index) {
- // this.myDataTable.deleteRow(index);
-
- switch(origin) {
- case "role":
- var record = mySubDataTable.getRecord(index);
- i2b2.PM.setData(origin, record);
- break;
- default:
- var record = this.myDataTable.getRecord(index);
- i2b2.PM.setData(origin, record);
- break;
- }
- i2b2.PM.showItem(callerid);
-}
-
-i2b2.PM.InsertRow = function(origin, index) {
- // this.myDataTable.deleteRow(index);
-
- switch(origin.substring(4,0)) {
- case "para":
- var record = mySubDataTable.getRecord(index);
- i2b2.PM.setData(origin, record);
- break;
- default:
- var record = this.myDataTable.getRecord(index);
- i2b2.PM.setData(origin, record);
- break;
- }
- i2b2.PM.showItem(callerid);
-}
-
-
-i2b2.PM.showItem = function(inputItem) {
- var ph = $('pmMain'); // $(inputItem);
- ph.show();
- ph = ph.style;
- ph.left = 200;
-
- switch(inputItem) {
- case "cell_data":
-
- var myColumnDefs = [
- {key:"project_path", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"method",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["SOAP","REST","OTHER"],disableBtns:true})},
- {key:"url",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"action"},
- {key:"param"}
- ];
-
- this.myDataTable = i2b2.PM.getAll("cell_data", ["project_path", "id", "name","method","url"], null, myColumnDefs, this.myDataTable);
-
- document.getElementById("pmMainTitle").innerHTML="Hive Data &raquo; Cell Data";
- document.getElementById("pmAddButton").innerHTML="Add Cell Data";
-
- //btn.label("Add New Cell");
- break;
- case "project":
-
- var myColumnDefs = [
- {key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"key",sortable:true, resizeable:true, editor: new YAHOO.widget.MD5CellEditor({disableBtns:false})},
- {key:"wiki",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"action"},
- {key:"param"}
- ];
-
- i2b2.PM.getAll("project", ["id", "name","key","wiki"],null, myColumnDefs, this.myDataTable);
-
- document.getElementById("pmMainTitle").innerHTML="Project Data";
- document.getElementById("pmAddButton").innerHTML="Add Project Data";
- break;
- case "approval":
-
- var myColumnDefs = [
- {key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}, ,
- {key:"param"}
- ];
-
- i2b2.PM.getAll("approval", ["id", "name"],null, myColumnDefs, this.myDataTable);
-
- document.getElementById("pmMainTitle").innerHTML="Approval Data";
- document.getElementById("pmAddButton").innerHTML="Add Approval Data";
- break;
- case "user":
-
- var myColumnDefs = [
- {key:"full_name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"user_name",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"email",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"password",resizeable:true,editor: new YAHOO.widget.PasswordCellEditor({disableBtns:false}),formatter: DataTableUtils.PasswordFormatter},
- {key:"action"},
- {key:"param"}
- ];
-
-
-
- this.myDataTable = i2b2.PM.getAll( "user", ["full_name","user_name","email"],null, myColumnDefs, this.myDataTable);
-
- document.getElementById("pmMainTitle").innerHTML="Users";
- document.getElementById("pmAddButton").innerHTML="Add User";
- break;
- case "global":
-
-
-
- var myColumnDefs = [
- {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"param",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"action"}
- ];
-
- i2b2.PM.getAll("global", ["name","param"], null, myColumnDefs, this.myDataTable);
-
-
- for(var i=0; i<this.myDataTable.getRecordSet().getLength(); i++) {
- this.myDataTable.updateCell(this.myDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.DeleteRow('goloal','" + (this.myDataTable.getRecord(i).getId()) + "');\">Delete</a>");
- }
- document.getElementById("pmMainTitle").innerHTML="Hive Data &raquo; Global Params";
- break;
- case "param-user":
-
-
-
- var myColumnDefs = [
- {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"param",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"action"}
- ];
-
- i2b2.PM.getAll("param-user", ["name","param"], new Array(""), myColumnDefs, this.myDataTable);
-
-
- for(var i=0; i<this.myDataTable.getRecordSet().getLength(); i++) {
- this.myDataTable.updateCell(this.myDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.DeleteRow('user_param','" + (this.myDataTable.getRecord(i).getId()) + "');\">Delete</a>");
- }
- document.getElementById("pmMainTitle").innerHTML="Manage Users &raquo; Users Params";
- break;
- case "hive":
-
- var myColumnDefs = [
- {key:"domain_id",sortable:true},
- {key:"active",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Active","Inactive"],disableBtns:true})},
- {key:"environment", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Development","Production", "Test"],disableBtns:true})},
- {key:"domain_name",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"helpURL",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
- {key:"action"},
- {key:"param"}
- ];
-
- i2b2.PM.getAll("hive", ["domain_id", "active","environment","domain_name","helpURL"],null, myColumnDefs, this.myDataTable);
-
-
-
- for(var i=0; i<this.myDataTable.getRecordSet().getLength(); i++) {
- this.myDataTable.updateCell(this.myDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.UpdateRow('hive','" + (this.myDataTable.getRecord(i).getId()) + "');\">Save</a>&nbsp;<a href=\"JavaScript:i2b2.PM.DeleteRow('hive','" + (this.myDataTable.getRecord(i).getId()) + "');\">Delete</a>");
- this.myDataTable.updateCell(this.myDataTable.getRecord(i), "param", "<a href=\"JavaScript:i2b2.PM.ShowParameter('hive','" + (this.myDataTable.getRecord(i).getId()) + "');\">Detail</a>");
- }
- document.getElementById("pmMainTitle").innerHTML="Hive Data";
- document.getElementById("pmAddButton").innerHTML="Add Hive Data";
- break;
-
- }
-};
-
-
-
-
-
-
-
-
-
-
-
-
-
-// login screen
-// ================================================================================================== //
-i2b2.PM.doConnectForm = function(inputUser, inputPass, inputDomain, inputSubmit) {
- console.debug("i2b2.PM.doConnectForm(",inputUser, inputPass, inputDomain, inputSubmit,")");
- i2b2.PM.udlogin = {};
- // function used to save references to the inputs that make up the login screen
- var ref = i2b2.PM.udlogin;
- ref.inputUser = inputUser;
- ref.inputPass = inputPass;
- ref.inputDomain = inputDomain;
- ref.inputSubmitBtn = inputSubmit;
- YAHOO.util.Event.addListener(inputSubmit.id, "click", i2b2.PM.doLogin);
- i2b2.PM._redrawConnectedForm();
-}
-
-// ================================================================================================== //
-i2b2.PM._redrawConnectedForm = function() {
- var ref = i2b2.PM.udlogin;
- // repopulate the domain information
- // ref.inputUser.value = '';
- // ref.inputPass.value = '';
- // clear the list
- var dli = ref.inputDomain;
- while( dli.hasChildNodes() ) { dli.removeChild( dli.lastChild ); }
- // populate the Categories from the data model
- var dml = i2b2.PM.model.Domains;
- for (var i=0; i<dml.length; i++) {
- // ONT options dropdown
- dno = document.createElement('OPTION');
- dno.setAttribute('value', i);
- var dnt = document.createTextNode(dml[i].name);
- dno.appendChild(dnt);
- dli.appendChild(dno);
- }
-}
-
-// ================================================================================================== //
-i2b2.PM.doLoginDialog = function() {
- // this displays the login dialogue box (auto generated popup)
- if (!$("i2b2_login_modal_dialog")) {
- var htmlFrag = i2b2.PM.model.html.loginDialog;
- Element.insert(document.body,htmlFrag);
-
- if (!i2b2.PM.view.modal.login) {
- i2b2.PM.view.modal.login = new YAHOO.widget.Panel("i2b2_login_modal_dialog", {
- zindex: 700,
- width: "501px",
- fixedcenter: true,
- constraintoviewport: true,
- close: false,
- draggable: true
- });
- var kl = new YAHOO.util.KeyListener("i2b2_login_modal_dialog", { keys:13 },
- { fn:i2b2.PM.doLogin,
- scope:i2b2.PM.view.modal.login,
- correctScope:true }, "keydown" );
- i2b2.PM.view.modal.login.cfg.queueProperty("keylisteners", kl);
- i2b2.PM.view.modal.login.render(document.body);
-
- // show the form
- i2b2.PM.view.modal.login.show();
- $('loginusr').focus();
- // connect the form to the PM controller
- i2b2.PM.udlogin = {};
- i2b2.PM.udlogin.inputUser = $('loginusr');
- i2b2.PM.udlogin.inputPass = $('loginpass');
- i2b2.PM.udlogin.inputDomain = $('logindomain');
- // load the domains
- i2b2.PM._redrawConnectedForm();
- }
- }
- // show the form
- i2b2.PM.view.modal.login.show();
-}
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription View controller for PM module's login form(s).
+ * @inherits i2b2
+ * @namespace i2b2.PM
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: cells > PM > view');
+console.time('execute time');
+
+var myDataTable = {};
+var mySubDataTable = {};
+var callerid = "";
+var parentid = "";
+/*
+i2b2.PM.view.main = new i2b2Base_cellViewController(i2b2.PM, 'main');
+i2b2.PM.view.main.visible = false;
+
+i2b2.PM.view.main.Resize = function(e){
+ var t = $('pmNavTreeview');
+ var ds = document.viewport.getDimensions();
+ var w = ds.width;
+ var h = ds.height-50;
+ //if (w < 840) { w = 840; }
+ if (h < 170) { h = 170; }
+ $('pmNavTreeview').style.height = h - 47;
+ $('pmAdminMainView').style.height = h - 44;
+ $('pmNav').style.height = h;
+ $('pmMain').style.height = h;
+ $('pmMain').style.width = w - 225;
+ $('pmAdminMainView').style.width = w - 240;
+}
+// attach resize events
+YAHOO.util.Event.addListener(window, "resize", i2b2.PM.view.main.Resize, i2b2.PM.view.main);
+
+// process view mode changes (via EVENT CAPTURE)
+// ================================================================================================== //
+i2b2.events.changedViewMode.subscribe((function(eventTypeName, newMode){
+ newMode = newMode[0];
+ this.viewMode = newMode;
+
+ //this.Resize();
+ switch (newMode) {
+ case "Admin":
+ i2b2.PM.model.admin.parentID = false;
+ i2b2.PM.model.admin.configScreen = false;
+
+ var pu = $('pmNav');
+ pu.show();
+ pu = pu.style;
+ pu.width = 170;
+ pu.height = 144;
+
+ if (!this.tree) {
+ this.tree = new YAHOO.widget.TreeView("pmNavTreeview");
+ var root = this.tree.getRoot();
+ var tmpNode = new YAHOO.widget.TextNode({label: "Hive", expanded: false}, root);
+ tmpNode.data.i2b2NodeType = "HIVE";
+ var tmpNode2 = new YAHOO.widget.TextNode({label: "Cells Data", expanded: false}, tmpNode);
+ tmpNode2.data.i2b2NodeType = "HIVECELLS";
+ var tmpNode2 = new YAHOO.widget.TextNode({label: "Global Params", expanded: false}, tmpNode);
+ tmpNode2.data.i2b2NodeType = "HIVEPARAMS";
+ var tmpNode = new YAHOO.widget.TextNode({label: "Projects", expanded: false}, root);
+ tmpNode.data.i2b2NodeType = "PROJECTS";
+ tmpNode.setDynamicLoad(i2b2.PM.adminRefreshProjects);
+ var tmpNode = new YAHOO.widget.TextNode({label: "Manage Users", expanded: false}, root);
+ tmpNode.data.i2b2NodeType = "USERS";
+ this.tree.subscribe('clickEvent', i2b2.PM.adminTreeClick);
+ this.tree.render();
+ }
+
+ this.tree.subscribe('clickEvent',function(oArgs) {
+ //i2b2.PM.hideAll();
+ switch(oArgs.node.label) {
+ case "Global Params":
+ callerid = "global";
+ break;
+ case "Hive Data":
+ callerid = "hive";
+ break;
+ case "Manage Users":
+ callerid = "user";
+ break;
+ case "Cell Data":
+ callerid = "cell_data";
+ break;
+ case "Project Data":
+ callerid = "project";
+ break;
+ case "Users Params":
+ callerid = "param-user";
+ break;
+ }
+ i2b2.PM.showItem(callerid);
+ //YAHOO.util.Dom.get('msg').innerHTML = 'Click on node: ' + oArgs.node.label;
+ });
+ i2b2.PM.adminConfigScreenDispay(0);
+ i2b2.PM.adminShowInfoPanel("LOADED");
+ break;
+ default:
+ //$('pmNav').hide();
+ $('pmMain').hide();
+ $('pmNav').hide();
+ //$('pmParam').hide();
+ this.visible = false;
+ break;
+ }
+ this.Resize();
+}),'',i2b2.PM.view.main);
+*/
+
+
+
+
+i2b2.PM.ShowParameter = function(origin, index) {
+
+ if (index=-100) {
+ var hiveid = this.myDataTable.getRecord(index);///.getData("domain_name");
+
+
+ i2b2.PM.getAll("param-" + origin, ["param","name"], hiveid);
+ var myColumnDefs = [
+ {key:"id"},
+ {key:"name",sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"param",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"action"}
+ ];
+
+ mySubDataTable = new YAHOO.widget.DataTable("pmParamTableview", myColumnDefs, i2b2.PM.getHiveDataSource, {});
+ var pu = $('pmParam');
+ pu.show();
+ pu = pu.style;
+ pu.width = 800;
+ pu.top = 350;
+ pu.left = 200;
+ pu.height = 144;
+
+
+ switch(origin) {
+ case "project":
+ parentid = hiveid.getData("id");
+ break;
+ case "cell":
+ parentid = hiveid.getData("domain_id");
+ break;
+ case "user":
+ parentid = hiveid.getData("user_name");
+ break;
+ case "hive":
+ parentid = hiveid.getData("domain_id");
+ break;
+ }
+
+
+
+ for(var i=0; i<mySubDataTable.getRecordSet().getLength(); i++) {
+ mySubDataTable.updateCell(mySubDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.UpdateRow('param','" + (mySubDataTable.getRecord(i).getId()) + "');\">Save</a>&nbsp;<a href=\"JavaScript:i2b2.PM.DeleteRow('param','" + (mySubDataTable.getRecord(i).getId()) + "');\">Delete</a>");
+ mySubDataTable.updateCell(mySubDataTable.getRecord(i), "id", parentid);
+ }
+
+
+ // Set up editing flow
+ var highlightEditableCell = function(oArgs) {
+ var elCell = oArgs.target;
+ if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
+ this.highlightCell(elCell);
+ }
+ };
+ // Enable row highlighting
+ mySubDataTable.subscribe("rowMouseoverEvent", mySubDataTable.onEventHighlightRow);
+ mySubDataTable.subscribe("rowMouseoutEvent", mySubDataTable.onEventUnhighlightRow);
+
+ //mySubDataTable.subscribe("cellMouseoverEvent", highlightEditableCell);
+ //mySubDataTable.subscribe("cellMouseoutEvent", mySubDataTable.onEventUnhighlightCell);
+ mySubDataTable.subscribe("cellClickEvent", mySubDataTable.onEventShowCellEditor);
+ }
+}
+
+i2b2.PM.ShowRole = function(index) {
+ var record = this.myDataTable.getRecord(index); //.getData("id");
+
+ i2b2.PM.getAll("role",["project_path","user_id","role"], record); //["project_path","user_id","user_role"]);
+ var myColumnDefs = [
+ {key:"project_path",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"user_id",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"role",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Active","Inactive"],disableBtns:true})},
+ {key:"action"}
+ ];
+
+ mySubDataTable = new YAHOO.widget.DataTable("pmParamTableview",
+ myColumnDefs, i2b2.PM.getHiveDataSource, {});
+
+
+ var pu = $('pmParam');
+ pu.show();
+ pu = pu.style;
+ pu.width = 800;
+ pu.top = 350;
+ pu.left = 200;
+ pu.height = 144;
+
+
+
+ for(var i=0; i<mySubDataTable.getRecordSet().getLength(); i++) {
+ mySubDataTable.updateCell(mySubDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.UpdateRow('role','" + (mySubDataTable.getRecord(i).getId()) + "');\">Save</a>&nbsp;<a href=\"JavaScript:i2b2.PM.DeleteRow('role','" + (mySubDataTable.getRecord(i).getId()) + "');\">Delete</a>");
+ }
+
+
+
+
+ // Set up editing flow
+ var highlightEditableCell = function(oArgs) {
+ var elCell = oArgs.target;
+ if(YAHOO.util.Dom.hasClass(elCell, "yui-dt-editable")) {
+ this.highlightCell(elCell);
+ }
+ };
+ // Enable row highlighting
+ mySubDataTable.subscribe("rowMouseoverEvent", mySubDataTable.onEventHighlightRow);
+ mySubDataTable.subscribe("rowMouseoutEvent", mySubDataTable.onEventUnhighlightRow);
+
+ //mySubDataTable.subscribe("cellMouseoverEvent", highlightEditableCell);
+ //mySubDataTable.subscribe("cellMouseoutEvent", mySubDataTable.onEventUnhighlightCell);
+ mySubDataTable.subscribe("cellClickEvent", mySubDataTable.onEventShowCellEditor);
+
+
+}
+
+
+i2b2.PM.DeleteRow = function(origin, index) {
+ // this.myDataTable.deleteRow(index);
+
+ // var trEl = this.myDataTable.getTrEl(index);
+ // trEl.style.display = 'none'; //set 'none' to hide...
+
+ answer = confirm("Do you really want to delete this item?");
+
+ if (answer !=0)
+
+ {
+ switch(origin.substring(4,0)) {
+ case "role":
+ var record = mySubDataTable.getRecord(index);
+ i2b2.PM.deleteData(origin, record);
+
+ mySubDataTable.deleteRow(index);
+
+ break;
+ case "para":
+ var record = mySubDataTable.getRecord(index);
+ i2b2.PM.deleteData(origin, record);
+
+ mySubDataTable.deleteRow(index);
+
+ break;
+ default:
+ var record = this.myDataTable.getRecord(index);
+ i2b2.PM.deleteData(origin, record);
+
+ this.myDataTable.deleteRow(index);
+ break;
+ }
+ }
+}
+
+i2b2.PM.AddRow = function() {
+ this.myDataTable.set("sortedBy", null);
+ this.myDataTable.addRow({ "action":""}, 0); //this.myDataTable.getRecordSet().getLength());
+ //this.myDataTable.updateRow(this.myDataTable.getRecord(this.myDataTable.getRecordSet().getLength()-1),{ "action": "<a href=\"JavaScript:i2b2.PM.InsertRow('" + callerid + "','" + (this.myDataTable.getRecord(this.myDataTable.getRecordSet().getLength()-1).getId()) + "');\"><img src=\"js-i2b2/cells/PM/assets/add.gif\" border=\"0\"/></a>"});
+ this.myDataTable.updateRow(this.myDataTable.getRecord(0),{ "action": "<a href=\"JavaScript:i2b2.PM.InsertRow('" + callerid + "','" + (this.myDataTable.getRecord(0).getId()) + "');\">Save</a>"});
+
+}
+
+i2b2.PM.UpdateRow = function(origin, index) {
+ // this.myDataTable.deleteRow(index);
+
+ switch(origin) {
+ case "role":
+ var record = mySubDataTable.getRecord(index);
+ i2b2.PM.setData(origin, record);
+ break;
+ default:
+ var record = this.myDataTable.getRecord(index);
+ i2b2.PM.setData(origin, record);
+ break;
+ }
+ i2b2.PM.showItem(callerid);
+}
+
+i2b2.PM.InsertRow = function(origin, index) {
+ // this.myDataTable.deleteRow(index);
+
+ switch(origin.substring(4,0)) {
+ case "para":
+ var record = mySubDataTable.getRecord(index);
+ i2b2.PM.setData(origin, record);
+ break;
+ default:
+ var record = this.myDataTable.getRecord(index);
+ i2b2.PM.setData(origin, record);
+ break;
+ }
+ i2b2.PM.showItem(callerid);
+}
+
+
+i2b2.PM.showItem = function(inputItem) {
+ var ph = $('pmMain'); // $(inputItem);
+ ph.show();
+ ph = ph.style;
+ ph.left = 200;
+
+ switch(inputItem) {
+ case "cell_data":
+
+ var myColumnDefs = [
+ {key:"project_path", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"method",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["SOAP","REST","OTHER"],disableBtns:true})},
+ {key:"url",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"action"},
+ {key:"param"}
+ ];
+
+ this.myDataTable = i2b2.PM.getAll("cell_data", ["project_path", "id", "name","method","url"], null, myColumnDefs, this.myDataTable);
+
+ document.getElementById("pmMainTitle").innerHTML="Hive Data &raquo; Cell Data";
+ document.getElementById("pmAddButton").innerHTML="Add Cell Data";
+
+ //btn.label("Add New Cell");
+ break;
+ case "project":
+
+ var myColumnDefs = [
+ {key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"key",sortable:true, resizeable:true, editor: new YAHOO.widget.MD5CellEditor({disableBtns:false})},
+ {key:"wiki",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"action"},
+ {key:"param"}
+ ];
+
+ i2b2.PM.getAll("project", ["id", "name","key","wiki"],null, myColumnDefs, this.myDataTable);
+
+ document.getElementById("pmMainTitle").innerHTML="Project Data";
+ document.getElementById("pmAddButton").innerHTML="Add Project Data";
+ break;
+ case "approval":
+
+ var myColumnDefs = [
+ {key:"id", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})}, ,
+ {key:"param"}
+ ];
+
+ i2b2.PM.getAll("approval", ["id", "name"],null, myColumnDefs, this.myDataTable);
+
+ document.getElementById("pmMainTitle").innerHTML="Approval Data";
+ document.getElementById("pmAddButton").innerHTML="Add Approval Data";
+ break;
+ case "user":
+
+ var myColumnDefs = [
+ {key:"full_name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"user_name",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"email",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"password",resizeable:true,editor: new YAHOO.widget.PasswordCellEditor({disableBtns:false}),formatter: DataTableUtils.PasswordFormatter},
+ {key:"action"},
+ {key:"param"}
+ ];
+
+
+
+ this.myDataTable = i2b2.PM.getAll( "user", ["full_name","user_name","email"],null, myColumnDefs, this.myDataTable);
+
+ document.getElementById("pmMainTitle").innerHTML="Users";
+ document.getElementById("pmAddButton").innerHTML="Add User";
+ break;
+ case "global":
+
+
+
+ var myColumnDefs = [
+ {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"param",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"action"}
+ ];
+
+ i2b2.PM.getAll("global", ["name","param"], null, myColumnDefs, this.myDataTable);
+
+
+ for(var i=0; i<this.myDataTable.getRecordSet().getLength(); i++) {
+ this.myDataTable.updateCell(this.myDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.DeleteRow('goloal','" + (this.myDataTable.getRecord(i).getId()) + "');\">Delete</a>");
+ }
+ document.getElementById("pmMainTitle").innerHTML="Hive Data &raquo; Global Params";
+ break;
+ case "param-user":
+
+
+
+ var myColumnDefs = [
+ {key:"name", sortable:true, resizeable:true, editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"param",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"action"}
+ ];
+
+ i2b2.PM.getAll("param-user", ["name","param"], new Array(""), myColumnDefs, this.myDataTable);
+
+
+ for(var i=0; i<this.myDataTable.getRecordSet().getLength(); i++) {
+ this.myDataTable.updateCell(this.myDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.DeleteRow('user_param','" + (this.myDataTable.getRecord(i).getId()) + "');\">Delete</a>");
+ }
+ document.getElementById("pmMainTitle").innerHTML="Manage Users &raquo; Users Params";
+ break;
+ case "hive":
+
+ var myColumnDefs = [
+ {key:"domain_id",sortable:true},
+ {key:"active",sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Active","Inactive"],disableBtns:true})},
+ {key:"environment", sortable:true, resizeable:true, editor: new YAHOO.widget.RadioCellEditor({radioOptions:["Development","Production", "Test"],disableBtns:true})},
+ {key:"domain_name",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"helpURL",sortable:true, resizeable:true,editor: new YAHOO.widget.TextboxCellEditor({disableBtns:true})},
+ {key:"action"},
+ {key:"param"}
+ ];
+
+ i2b2.PM.getAll("hive", ["domain_id", "active","environment","domain_name","helpURL"],null, myColumnDefs, this.myDataTable);
+
+
+
+ for(var i=0; i<this.myDataTable.getRecordSet().getLength(); i++) {
+ this.myDataTable.updateCell(this.myDataTable.getRecord(i), "action", "<a href=\"JavaScript:i2b2.PM.UpdateRow('hive','" + (this.myDataTable.getRecord(i).getId()) + "');\">Save</a>&nbsp;<a href=\"JavaScript:i2b2.PM.DeleteRow('hive','" + (this.myDataTable.getRecord(i).getId()) + "');\">Delete</a>");
+ this.myDataTable.updateCell(this.myDataTable.getRecord(i), "param", "<a href=\"JavaScript:i2b2.PM.ShowParameter('hive','" + (this.myDataTable.getRecord(i).getId()) + "');\">Detail</a>");
+ }
+ document.getElementById("pmMainTitle").innerHTML="Hive Data";
+ document.getElementById("pmAddButton").innerHTML="Add Hive Data";
+ break;
+
+ }
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+// login screen
+// ================================================================================================== //
+i2b2.PM.doConnectForm = function(inputUser, inputPass, inputDomain, inputSubmit) {
+ console.debug("i2b2.PM.doConnectForm(",inputUser, inputPass, inputDomain, inputSubmit,")");
+ i2b2.PM.udlogin = {};
+ // function used to save references to the inputs that make up the login screen
+ var ref = i2b2.PM.udlogin;
+ ref.inputUser = inputUser;
+ ref.inputPass = inputPass;
+ ref.inputDomain = inputDomain;
+ ref.inputSubmitBtn = inputSubmit;
+ YAHOO.util.Event.addListener(inputSubmit.id, "click", i2b2.PM.doLogin);
+ i2b2.PM._redrawConnectedForm();
+}
+
+// ================================================================================================== //
+i2b2.PM._redrawConnectedForm = function() {
+ var ref = i2b2.PM.udlogin;
+ // repopulate the domain information
+ // ref.inputUser.value = '';
+ // ref.inputPass.value = '';
+ // clear the list
+ var dli = ref.inputDomain;
+ while( dli.hasChildNodes() ) { dli.removeChild( dli.lastChild ); }
+ // populate the Categories from the data model
+ var dml = i2b2.PM.model.Domains;
+ for (var i=0; i<dml.length; i++) {
+ // ONT options dropdown
+ dno = document.createElement('OPTION');
+ dno.setAttribute('value', i);
+ var dnt = document.createTextNode(dml[i].name);
+ dno.appendChild(dnt);
+ dli.appendChild(dno);
+ }
+}
+
+// ================================================================================================== //
+i2b2.PM.doLoginDialog = function() {
+ // this displays the login dialogue box (auto generated popup)
+ if (!$("i2b2_login_modal_dialog")) {
+ var htmlFrag = i2b2.PM.model.html.loginDialog;
+ Element.insert(document.body,htmlFrag);
+
+ if (!i2b2.PM.view.modal.login) {
+ i2b2.PM.view.modal.login = new YAHOO.widget.Panel("i2b2_login_modal_dialog", {
+ zindex: 700,
+ width: "501px",
+ fixedcenter: true,
+ constraintoviewport: true,
+ close: false,
+ draggable: true
+ });
+ var kl = new YAHOO.util.KeyListener("i2b2_login_modal_dialog", { keys:13 },
+ { fn:i2b2.PM.doLogin,
+ scope:i2b2.PM.view.modal.login,
+ correctScope:true }, "keydown" );
+ i2b2.PM.view.modal.login.cfg.queueProperty("keylisteners", kl);
+ i2b2.PM.view.modal.login.render(document.body);
+
+ // show the form
+ i2b2.PM.view.modal.login.show();
+ $('loginusr').focus();
+ // connect the form to the PM controller
+ i2b2.PM.udlogin = {};
+ i2b2.PM.udlogin.inputUser = $('loginusr');
+ i2b2.PM.udlogin.inputPass = $('loginpass');
+ i2b2.PM.udlogin.inputDomain = $('logindomain');
+ // load the domains
+ i2b2.PM._redrawConnectedForm();
+ }
+ }
+ // show the form
+ i2b2.PM.view.modal.login.show();
+}
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/i2b2_hive.png b/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/i2b2_hive.png
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/login_bg.jpg b/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/login_bg.jpg
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/modProjects.css b/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/modProjects.css
old mode 100755
new mode 100644
index 1863bc020..37b4886b6
--- a/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/modProjects.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/PM/assets/modProjects.css
@@ -1,189 +1,189 @@
-
-DIV.opAdd {
-float:left;
-overflow:hidden;
-padding:6px 10px 0 0;
-position:relative;
-}
-
-DIV#i2b2_projects_modal_dialog DIV#projectAttribs {
- margin-top: 8px;
- border:#AAA solid;
- border-width: 1px 1px 2px;
- background-color:#DDDDFF;
- margin-top:8px;
-}
-
-
-DIV#i2b2_projects_modal_dialog DIV.name {
- background:#DDDDFF;
- border-top: 1px solid #BBB;
- float:left;
- padding-left:4px;
- width:119px;
-}
-
-DIV#pmNavTreeview {
- background: #FFFFFF;
- border: 1px solid #667788;
- width:auto;
- padding:1px 5px;
- overflow: auto;
-}
-
-DIV#pmNav {
- position: absolute;
-}
-
-DIV#pmNav .bodyBox {
- background:#BBCCEE none repeat scroll 0% 50%;
- border:1px solid #667788;
- clear:both;
- display:block;
- height:auto;
- overflow:hidden;
- padding:5px;
- position:relative;
- top:-1px;
- width:auto;
- z-index:0;
-}
-
-
-DIV#pmMain {
- position: absolute;
-}
-
-DIV#pmMain .bodyBox {
- background:#BBCCEE none repeat scroll 0% 50%;
- border:1px solid #667788;
- clear:both;
- display:block;
- height:auto;
- overflow:hidden;
- padding:5px;
- position:relative;
- top:-1px;
- width:auto;
- z-index:0;
-}
-DIV#pmMain .bodyBox #pmMainTableview {
- overflow:auto;
- width: 100%;
-}
-DIV#pmMain .bodyBox #pmMainTableview table{
- width: 100%;
-}
-
-DIV#pmParam {
- position: absolute;
-}
-
-DIV#pmParam .bodyBox {
- background:#BBCCEE none repeat scroll 0% 50%;
- border:1px solid #667788;
- clear:both;
- display:block;
- height:auto;
- overflow:hidden;
- padding:5px;
- position:relative;
- top:-1px;
- width:auto;
- z-index:0;
-}
-
-DIV#i2b2_projects_modal_dialog DIV.value {
- border-left: 1px solid #BBB;
- border-top: 1px solid #BBB;
- float: right;
- padding-left: 5px;
- width: 248px;
- background: #F2F2F2;
-}
-
-
-DIV#i2b2_projects_modal_dialog SELECT#loginProjs {
- width: 200px;
-}
-
-
-DIV#i2b2_projects_modal_dialog DIV.NoDetails {
- text-align:center;
- font-style: italic;
- font-size: 12px;
- border-top:1px solid #BBB;
- padding:4px 0px;
-}
-
-
-/* login dialog box */
-
-/* DIV#i2b2_login_modal_dialog { border: 1px solid #000; } */
-
-DIV#i2b2_login_modal_dialog .login-dialog {
- background-image: url(login_bg.jpg);
- width: 501px;
- height: 178px;
-}
-
-DIV#i2b2_login_modal_dialog DIV.formDiv { padding-top: 6px; }
-
-DIV#i2b2_login_modal_dialog DIV.label { font-weight: bold; }
-
-DIV#i2b2_login_modal_dialog DIV.input {
- margin-bottom: 8px;
-}
-
-DIV#i2b2_login_modal_dialog INPUT,
-DIV#i2b2_login_modal_dialog SELECT {
- width: 180px;
-}
-
-DIV#i2b2_login_modal_dialog DIV.button INPUT {
- width: 90px;
- margin-top: 6px;
-}
-
-
-/*** CSS for Project Request ***/
-
-
-DIV#project-request-viewer-body DIV.ProjectRequest-MainContent {
- background:#FFF;
- border:solid #63758C;
- border-width:1px 0;
- overflow:auto;
- height:100%;
-}
-
-
-DIV.ProjectRequest-MainContent DIV.droptrgtlbl {
- padding: 6px 0px;
- width:180px;
- text-align:right;
- float: left;
- font-weight:bold;
- color:#666;
- margin: 15px 10px 0px 0px;
-}
-DIV.ProjectRequest-MainContent DIV.droptrgt {
- padding: 5px 10px;
- background: #DEEBEF;
- margin-top: 15px;
- text-align:left;
- border: 1px solid #63758C;
- overflow:hidden;
- float:left;
- white-space:nowrap;
-}
-
-
-DIV.ProjectRequest-MainContent DIV.outputOptions {
- padding: 5px 10px;
- margin-top: 15px;
- text-align:center;
- float:left;
- border: 1px solid #63758C;
- overflow:hidden;
-}
+
+DIV.opAdd {
+float:left;
+overflow:hidden;
+padding:6px 10px 0 0;
+position:relative;
+}
+
+DIV#i2b2_projects_modal_dialog DIV#projectAttribs {
+ margin-top: 8px;
+ border:#AAA solid;
+ border-width: 1px 1px 2px;
+ background-color:#DDDDFF;
+ margin-top:8px;
+}
+
+
+DIV#i2b2_projects_modal_dialog DIV.name {
+ background:#DDDDFF;
+ border-top: 1px solid #BBB;
+ float:left;
+ padding-left:4px;
+ width:119px;
+}
+
+DIV#pmNavTreeview {
+ background: #FFFFFF;
+ border: 1px solid #667788;
+ width:auto;
+ padding:1px 5px;
+ overflow: auto;
+}
+
+DIV#pmNav {
+ position: absolute;
+}
+
+DIV#pmNav .bodyBox {
+ background:#BBCCEE none repeat scroll 0% 50%;
+ border:1px solid #667788;
+ clear:both;
+ display:block;
+ height:auto;
+ overflow:hidden;
+ padding:5px;
+ position:relative;
+ top:-1px;
+ width:auto;
+ z-index:0;
+}
+
+
+DIV#pmMain {
+ position: absolute;
+}
+
+DIV#pmMain .bodyBox {
+ background:#BBCCEE none repeat scroll 0% 50%;
+ border:1px solid #667788;
+ clear:both;
+ display:block;
+ height:auto;
+ overflow:hidden;
+ padding:5px;
+ position:relative;
+ top:-1px;
+ width:auto;
+ z-index:0;
+}
+DIV#pmMain .bodyBox #pmMainTableview {
+ overflow:auto;
+ width: 100%;
+}
+DIV#pmMain .bodyBox #pmMainTableview table{
+ width: 100%;
+}
+
+DIV#pmParam {
+ position: absolute;
+}
+
+DIV#pmParam .bodyBox {
+ background:#BBCCEE none repeat scroll 0% 50%;
+ border:1px solid #667788;
+ clear:both;
+ display:block;
+ height:auto;
+ overflow:hidden;
+ padding:5px;
+ position:relative;
+ top:-1px;
+ width:auto;
+ z-index:0;
+}
+
+DIV#i2b2_projects_modal_dialog DIV.value {
+ border-left: 1px solid #BBB;
+ border-top: 1px solid #BBB;
+ float: right;
+ padding-left: 5px;
+ width: 248px;
+ background: #F2F2F2;
+}
+
+
+DIV#i2b2_projects_modal_dialog SELECT#loginProjs {
+ width: 200px;
+}
+
+
+DIV#i2b2_projects_modal_dialog DIV.NoDetails {
+ text-align:center;
+ font-style: italic;
+ font-size: 12px;
+ border-top:1px solid #BBB;
+ padding:4px 0px;
+}
+
+
+/* login dialog box */
+
+/* DIV#i2b2_login_modal_dialog { border: 1px solid #000; } */
+
+DIV#i2b2_login_modal_dialog .login-dialog {
+ background-image: url(login_bg.jpg);
+ width: 501px;
+ height: 178px;
+}
+
+DIV#i2b2_login_modal_dialog DIV.formDiv { padding-top: 6px; }
+
+DIV#i2b2_login_modal_dialog DIV.label { font-weight: bold; }
+
+DIV#i2b2_login_modal_dialog DIV.input {
+ margin-bottom: 8px;
+}
+
+DIV#i2b2_login_modal_dialog INPUT,
+DIV#i2b2_login_modal_dialog SELECT {
+ width: 180px;
+}
+
+DIV#i2b2_login_modal_dialog DIV.button INPUT {
+ width: 90px;
+ margin-top: 6px;
+}
+
+
+/*** CSS for Project Request ***/
+
+
+DIV#project-request-viewer-body DIV.ProjectRequest-MainContent {
+ background:#FFF;
+ border:solid #63758C;
+ border-width:1px 0;
+ overflow:auto;
+ height:100%;
+}
+
+
+DIV.ProjectRequest-MainContent DIV.droptrgtlbl {
+ padding: 6px 0px;
+ width:180px;
+ text-align:right;
+ float: left;
+ font-weight:bold;
+ color:#666;
+ margin: 15px 10px 0px 0px;
+}
+DIV.ProjectRequest-MainContent DIV.droptrgt {
+ padding: 5px 10px;
+ background: #DEEBEF;
+ margin-top: 15px;
+ text-align:left;
+ border: 1px solid #63758C;
+ overflow:hidden;
+ float:left;
+ white-space:nowrap;
+}
+
+
+DIV.ProjectRequest-MainContent DIV.outputOptions {
+ padding: 5px 10px;
+ margin-top: 15px;
+ text-align:center;
+ float:left;
+ border: 1px solid #63758C;
+ overflow:hidden;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/cell_config_data.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/PM/i2b2_msgs.js b/shrine-webclient/src/main/html/js-i2b2/cells/PM/i2b2_msgs.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/EnhancedError.js b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/EnhancedError.js
index 3620980d0..8c0e730d2 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/EnhancedError.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/EnhancedError.js
@@ -1,341 +1,349 @@
/**
* Created by ben on 10/13/15.
*/
var $hrine = window.$hrine = {};
$hrine.EnhancedError =
(function(){
var EnhancedError = {},
config = config || {
//@TODO:
};
/**
*
* @returns {{}}
*/
function simulateI2b2Obj() {
var self = {},
errorObject = {
summary: "SHRINE Failed to Start",
description: "The SHRINE software is not running at the queried" +
" site. This error must be corrected at the queried site.Check network status or contact your local SHRINE administrator. For faster assistance, expand this window and provide all text below this line to your local SHRINE administrator.",
details: "There is a fatal syntax error in the remote site's" +
" shrine.conf or another .conf file. The remote site admin should check to make sure that there are no stray/missing quotes or brackets, and that URLs are entered correctly.",
codec: ""
};
self.errorObject = errorObject;
self.dispDIV = document.getElementById('infoQueryStatusText');
self.dispDIV.innerHTML =
'<div style="clear:both;"><div style="float:left; font-weight:bold">SHRINE Critical Error</div></div>';
//which hospital
self.dispDIV.innerHTML +=
'<div style="clear:both;"><br/><div style="float:left; font-weight:bold; margin-left:20px;"> Error Summary: </div>';
self.dispDIV.innerHTML += "<span title='" + errorObject.summary + "'><b><a class='query-error-anchor' href='#' style='color:#ff0000'>" +
"<b><span color='#ff0000'>" + errorObject.summary + "</span></b></a></b></span>";
return self;
}
/**
* Scope for error dialog.
*/
EnhancedError.createErrorDialogue = function (container, errorObjects) {
var anchors, btnExpand, btnContract, errorData, i2b2Obj;
//default error.
if(!container || !errorObjects) {
i2b2Obj = simulateI2b2Obj();
container = i2b2Obj.dispDIV;
errorObjects = [i2b2Obj.errorObject];
}
//this sets up the events.
anchors = container.getElementsByClassName('query-error-anchor');
//something's wrong captain, abandon ship!
if(!anchors.length|| !errorObjects.length) {
return;
}
addAnchorEvents();
function expandErrorDetailDiv (ev) {
var errorDetailDiv = $('errorDetailDiv');
btnExpand.style.display = 'none';
btnContract.style.display = 'inline';
errorDetailDiv.innerHTML = getExpandedHtml();
}
function retractErrorDetailDiv (ev) {
var errorDetailDiv = $('errorDetailDiv');
btnExpand.style.display = 'inline';
btnContract.style.display = 'none';
errorDetailDiv.innerHTML = getRetractedHtml();
}
function onClick(evt) {
//ie logic.
var currentTarget = (evt.currentTarget !== undefined)?
evt.currentTarget : evt.srcElement.parentElement.parentElement;
errorData = currentTarget.__errorData__;
btnExpand = document.getElementById('btnExpandErrorDetail');
btnContract = document.getElementById('btnContractErrorDetail');
// -- add event listeners for expand and contract as well --//
addEventListener(btnExpand, 'click', expandErrorDetailDiv, false);
addEventListener(btnContract,'click', retractErrorDetailDiv, false);
showErrorDetail(errorData);
}
/**
*
* @param errorData
* @returns {string}
*/
function getRetractedHtml () {
var wikiBaseUrl = (i2b2.hive.cfg.wikiBaseUrl || 'https://open.med.harvard.edu/wiki/display/SHRINE/');
if(wikiBaseUrl.lastIndexOf('/') !== wikiBaseUrl.length -1){
wikiBaseUrl += '/';
}
var retractedHtml = '<div><b>Summary:</b></div>'+
'<div>' + errorData.summary + '</div><br/>' +
'<div><b>Description:</b></div>'+
'<div>' + errorData.description + '</div><br/>' +
'<div><i>For information on troubleshooting and resolution, check' +
' <a href="' + wikiBaseUrl + errorData.codec +'" target="_blank">the SHRINE Error' +
' Codex</a>.</i></div>';
return retractedHtml;
}
/**
*
* @param errorData
* @returns {string}
*/
function getExpandedHtml () {
var expandedHtml = getRetractedHtml() +
'<br/>' +
'<div><b><i>Copy the text below and paste it in an email to your site administrator for a faster response.</i></b></div>' +
'<br/>' +
'<div><b>Technical Details:</b></div><pre style="margin-top:0">' + errorData.details + '</pre><br/>' +
'<div><b>Codec:</b></div><pre style="margin-top:0">' + errorData.codec + '</pre><br/>' +
'<div><b>Stamp:</b></div><pre style="margin-top:0">' + errorData.stamp + '</pre><br/>' +
'<div><b>Stack Trace Name:</b></div><pre style="margin-top:0">' + errorData.exception.name + '</pre><br/>' +
'<div><b>Stack Trace Message:</b></div><pre style="margin-top:0">' + errorData.exception.message + '</pre><br/>' +
'<div><b>Stack Trace Details:</b></div><pre style="margin-top:0">' + errorData.exception.stackTrace + '</pre><br/>';
return expandedHtml;
}
/**
*
* @param detailObj
*/
function showErrorDetail(detailObj) {
var handleCancel = function() {
this.cancel();
removeAllEvents();
retractErrorDetailDiv();
}
var dialogErrorDetail = new YAHOO.widget.SimpleDialog("dialogErrorDetail", {
width: "820px",
fixedcenter: true,
constraintoviewport: true,
modal: true,
zindex: 700,
buttons: [ {
text: "Done",
handler: handleCancel,
isDefault: true
}]
});
dialogErrorDetail._doClose = function (e) {
this.cancel();
removeAllEvents();
retractErrorDetailDiv();
}
$('dialogErrorDetail').show();
dialogErrorDetail.validate = function(){
return true;
};
dialogErrorDetail.render(document.body);
// / display the dialoge
dialogErrorDetail.center();
dialogErrorDetail.show();
$('errorDetailDiv').innerHTML = getRetractedHtml();
}
function addAnchorEvents () {
var el, length = anchors.length;
// -- will need to iterate over these once they are created and add event listeners.
for(var i = 0; i < length; i ++) {
var el = anchors[i];
el.__errorData__ = errorObjects[i];
addEventListener(el, 'click', onClick, false);
}
}
function removeAllEvents () {
removeEventListener(btnExpand, 'click', expandErrorDetailDiv);
removeEventListener(btnContract, 'click', retractErrorDetailDiv);
}
}
/**
* Parse problem node.
* @param qriNode
* @returns {{exception: {}}}
*/
EnhancedError.parseProblem = function (qriNode) {
var details,
problem = {
exception: {}
};
problem.codec = grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/problem/codec');
problem.summary = grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/problem/summary');
problem.description = grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/problem/description');
problem.stamp = grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/problem/stamp');
//unescape embedded html.
details = i2b2.h.XPath(qriNode, 'descendant-or-self::query_status_type/problem/details')
//funky stuff goin' on...get outta here!
if(!details.length) {
problem.exception.name = problem.exception.message = problem.stackTrace =
problem.codec = problem.summary = 'An unexpected error has occurred.';
}
//error format as expected.
else{
var innerHTML = (details[0].xml !== undefined)?
- details[0].xml : details[0].innerHTML;
+ details[0].xml : details[0].innerHTML?details[0].innerHTML:null;
+ if(!innerHTML)
+ {
+ innerHTML = jQuery(details[0]).text();
+ }
problem.details = innerHTML.unescapeHTML().replace(/(<([^>]+)>)/ig,"");
problem.exception.name = grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/problem/details/exception/name');
problem.exception.message = grabXmlNodeData(qriNode, 'descendant-or-self::query_status_type/problem/details/exception/message');
problem.exception.stackTrace = parseErrorException(qriNode);
}
return problem;
}
/**
* Replace all <line> <message> <exception> and <stacktrace> with <br/> tags.
* @param node
* @returns {*}
*/
function parseErrorException(node) {
- var innerHTML = (node.xml !== undefined)? node.xml : node.innerHTML;
+ var innerHTML = (node.xml !== undefined)? node.xml : node.innerHTML?node.innerHTML:null;;
+ if(!innerHTML)
+ {
+ innerHTML = jQuery(node).text();
+ }
//no exception, abandon ship!
if(innerHTML.indexOf('<exception>') == -1){
return '';
}
var content, startIdx, endIdx;
//fish out the problem section.
content = innerHTML.split('<problem>')
.join()
.split('</problem>')
.join();
//fish out the first stack trace.
startIdx = content.indexOf('<stacktrace>') + 12;
endIdx = content.indexOf('</stacktrace>');
content = content.substring(startIdx, endIdx);
//remove all line tags and replace with line break.
content = content.split('<line>')
.join('</br>')
.split('</line>')
.join()
//remove all exception tags
.split('<exception>')
.join('<br/>')
.split('</exception>')
.join()
//remove all stacktrace tags
.split('<stacktrace>')
.join('<br/>')
.split('</stacktrace>')
.join()
//remove all message tags.
.split('<message>')
.join('<br/>')
.split('</message>')
.join();
return content;
}
/**
* Grab data for node, return empty string if none.
* @param node
* @param xPathString
* @returns {string}
*/
function grabXmlNodeData(node, xPathString){
var nodeVal = i2b2.h.XPath(node, xPathString);
return (nodeVal.length)? nodeVal[0].firstChild.nodeValue : '';
}
/**
*
* @param el
* @param event
* @param callback
*/
function addEventListener(el, event, callback) {
if(el.addEventListener !== undefined) {
el.addEventListener(event, callback, false);
} else {
el.attachEvent('on' + event, callback)
}
}
/**
*
* @param el
* @param event
* @param callback
*/
function removeEventListener(el, event, callback) {
if(el.removeEventListener !== undefined) {
el.removeEventListener(event, callback);
} else {
el.detachEvent('on' + event, callback);
}
}
return EnhancedError;
})();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/BidmcMedSemantics.html b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/BidmcMedSemantics.html
index 4d718d6ea..ada4d33cc 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/BidmcMedSemantics.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/BidmcMedSemantics.html
@@ -1,196 +1,196 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html"><strong><em>BIDMC Medications</em></strong></a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h3>
- <a name="BidmcMedSemantics">BIDMC Medications</a>
- </h3>
- <p>
- Beth Israel Deaconess Medical Center (BIDMC) medications are derived from the internal <a href="http://www.bidmc.org/MedicalEducation/Departments/Medicine/ResidencyinInternalMedicine/WhyBIDMC/WhatSetsUsApart.aspx" target="_blank">Provider Order Entry and Online Medical Record</a> systems.
- </p>
-
-
-
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="33%">
- Code System
- </th>
- <th width="33%">
- Institution
- </th>
- <th width="34%">
- Encounter Type
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- Provider Order Entry (POE)
- </p>
- </td>
- <td>
- <p>
- Beth Israel Deaconess Medical Center
- </p>
- </td>
- <td>
- <p>
- Inpatient orders
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Online Medical Record (OMR)
- </p>
- </td>
- <td>
- <p>
- Beth Israel Deaconess Medical Center
- </p>
- </td>
- <td>
- <p>
- Outpatient orders
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html"><strong><em>BIDMC Medications</em></strong></a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h3>
+ <a name="BidmcMedSemantics">BIDMC Medications</a>
+ </h3>
+ <p>
+ Beth Israel Deaconess Medical Center (BIDMC) medications are derived from the internal <a href="http://www.bidmc.org/MedicalEducation/Departments/Medicine/ResidencyinInternalMedicine/WhyBIDMC/WhatSetsUsApart.aspx" target="_blank">Provider Order Entry and Online Medical Record</a> systems.
+ </p>
+
+
+
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="33%">
+ Code System
+ </th>
+ <th width="33%">
+ Institution
+ </th>
+ <th width="34%">
+ Encounter Type
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ Provider Order Entry (POE)
+ </p>
+ </td>
+ <td>
+ <p>
+ Beth Israel Deaconess Medical Center
+ </p>
+ </td>
+ <td>
+ <p>
+ Inpatient orders
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Online Medical Record (OMR)
+ </p>
+ </td>
+ <td>
+ <p>
+ Beth Israel Deaconess Medical Center
+ </p>
+ </td>
+ <td>
+ <p>
+ Outpatient orders
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/ChbMedSemantics.html b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/ChbMedSemantics.html
index fd34d2010..47176c9c5 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/ChbMedSemantics.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/ChbMedSemantics.html
@@ -1,179 +1,179 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html"><strong><em>CHB Medications</em></strong></a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h3>
- <a name="ChbMedSemantics">CHB Medications</a>
- </h3>
- <p>
- Children's Hospital Boston (CHB) medications are derived from ordered medications data for inpatient encounters, including clinic visits. This data is derived from an internal <em>Provider Order Entry</em> system.
- </p>
-
-
-
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="33%">
- Code System
- </th>
- <th width="33%">
- Institution
- </th>
- <th width="34%">
- Encounter Type
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- Provider Order Entry (POE)
- </p>
- </td>
- <td>
- <p>
- Children's Hospital Boston
- </p>
- </td>
- <td>
- <p>
- Inpatient and clinic orders
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html"><strong><em>CHB Medications</em></strong></a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h3>
+ <a name="ChbMedSemantics">CHB Medications</a>
+ </h3>
+ <p>
+ Children's Hospital Boston (CHB) medications are derived from ordered medications data for inpatient encounters, including clinic visits. This data is derived from an internal <em>Provider Order Entry</em> system.
+ </p>
+
+
+
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="33%">
+ Code System
+ </th>
+ <th width="33%">
+ Institution
+ </th>
+ <th width="34%">
+ Encounter Type
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ Provider Order Entry (POE)
+ </p>
+ </td>
+ <td>
+ <p>
+ Children's Hospital Boston
+ </p>
+ </td>
+ <td>
+ <p>
+ Inpatient and clinic orders
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/LocalDiags.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/LocalDiags.htm
index 05991063c..c9bd4dc5c 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/LocalDiags.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/LocalDiags.htm
@@ -1,141 +1,141 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
- </li>
- <li>
- <a href="LocalDiags.htm"><strong><em>Local Diagnoses Data</em></strong></a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797244">Local Diagnoses Data</a>
- </h2>
- <p>
- All local institutionals use ICD-9 vocabulary for diagnoses data. In addition, individual institution's diagnoses are derived from specific internal systems as described in this section.
- </p>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+ </li>
+ <li>
+ <a href="LocalDiags.htm"><strong><em>Local Diagnoses Data</em></strong></a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797244">Local Diagnoses Data</a>
+ </h2>
+ <p>
+ All local institutionals use ICD-9 vocabulary for diagnoses data. In addition, individual institution's diagnoses are derived from specific internal systems as described in this section.
+ </p>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersDiagSemantics.html b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersDiagSemantics.html
index 11abefdcd..d5f9abe56 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersDiagSemantics.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersDiagSemantics.html
@@ -1,167 +1,167 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html"><strong><em>BWH and MGH Diagnoses</em></strong></a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h3>
- <a name="PartnersDiagSemantics">BWH and MGH Diagnoses</a>
- </h3>
- <p>
- Diagnoses are organized into 22 major categories generally by body system, such as Digestive System, or by disease type, such as Infectious and Parasitic Diseases. Diagnoses data are based on the following:
- </p>
-
-<ul><li>ICD-9-CM codes derived from TSI or IDX</li>
-<li>COSTAR codes derived from OnCall problems identified as <em>diagnoses</em></li>
-<li>LMR codes derived from LMR problems identified as <em>diagnoses</em></li></ul>
-
- <p>
- LMR and OnCall codes and descriptions are developed locally. A number of analytic processes are performed to make the data as consistent and reliable as possible. If a provider described a diagnostic condition in several different ways, such as, for example, Upper Respiratory Infection, the analytic processes attempt to collapse all of the synonyms under one consistent code and description. If the LMR code for this common ailment is LPA1960, but it is described as <em>Upper Respiratory Infection</em> 79% of the time, as <em>URI</em> 19% of the time, and as <em>Cold</em> 3% of the time, these are reviewed manually reviewed, determined to be synonymous, and altered to a single description--Upper Respiratory Infection.
- </p>
-
- <p>
- In general, diagnostic ICD-9-CM coding for inpatient encounters is more accurate
-than for outpatient encounters due to the strict requirements involved in DRG billing for both diagnoses and procedures associated with an inpatient stay. In addition,
-discharge diagnoses or principal diagnoses often are better defined by the time patients' records are reviewed for billing. In contrast, outpatient billing tends to be less accurate on diagnostic codes. In addition, illness visits often are coded for signs and symptoms rather than a well-defined diagnosis, especially in the early stage of an episode of care.
- </p>
-
- <p>
- These groups in the diagnoses Terms view are of special interest:
- </p>
-
-
-<ul><li>Sign or Symptoms - These codes, comprising 780.xx through 789.xx., include presenting conditions as being febrile, or having abdominal tenderness or edema. </li>
-<li>E-Codes - Required for public reporting of accident or traumatic situations or adverse events from medical care. </li>
-<li>V-Codes - A special category for patient or family history of illness.</li></ul>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html"><strong><em>BWH and MGH Diagnoses</em></strong></a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h3>
+ <a name="PartnersDiagSemantics">BWH and MGH Diagnoses</a>
+ </h3>
+ <p>
+ Diagnoses are organized into 22 major categories generally by body system, such as Digestive System, or by disease type, such as Infectious and Parasitic Diseases. Diagnoses data are based on the following:
+ </p>
+
+<ul><li>ICD-9-CM codes derived from TSI or IDX</li>
+<li>COSTAR codes derived from OnCall problems identified as <em>diagnoses</em></li>
+<li>LMR codes derived from LMR problems identified as <em>diagnoses</em></li></ul>
+
+ <p>
+ LMR and OnCall codes and descriptions are developed locally. A number of analytic processes are performed to make the data as consistent and reliable as possible. If a provider described a diagnostic condition in several different ways, such as, for example, Upper Respiratory Infection, the analytic processes attempt to collapse all of the synonyms under one consistent code and description. If the LMR code for this common ailment is LPA1960, but it is described as <em>Upper Respiratory Infection</em> 79% of the time, as <em>URI</em> 19% of the time, and as <em>Cold</em> 3% of the time, these are reviewed manually reviewed, determined to be synonymous, and altered to a single description--Upper Respiratory Infection.
+ </p>
+
+ <p>
+ In general, diagnostic ICD-9-CM coding for inpatient encounters is more accurate
+than for outpatient encounters due to the strict requirements involved in DRG billing for both diagnoses and procedures associated with an inpatient stay. In addition,
+discharge diagnoses or principal diagnoses often are better defined by the time patients' records are reviewed for billing. In contrast, outpatient billing tends to be less accurate on diagnostic codes. In addition, illness visits often are coded for signs and symptoms rather than a well-defined diagnosis, especially in the early stage of an episode of care.
+ </p>
+
+ <p>
+ These groups in the diagnoses Terms view are of special interest:
+ </p>
+
+
+<ul><li>Sign or Symptoms - These codes, comprising 780.xx through 789.xx., include presenting conditions as being febrile, or having abdominal tenderness or edema. </li>
+<li>E-Codes - Required for public reporting of accident or traumatic situations or adverse events from medical care. </li>
+<li>V-Codes - A special category for patient or family history of illness.</li></ul>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersMedSemantics.html b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersMedSemantics.html
index 6ff71f3d8..c85180441 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersMedSemantics.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/PartnersMedSemantics.html
@@ -1,225 +1,225 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html"><strong><em>BWH and MGH Medications</em></strong></a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h3>
- <a name="PartnersMedSemantics">BWH and MGH Medications</a>
- </h3>
- <p>
- Medications are derived from <i>TSI</i>, the <a href="http://www.partners.org/cird/StaffPrj.asp?cBox=CurrProj&prAb=LMR" target="_blank">Longitudinal Medical Record</a> (LMR), and <i>OnCall</i> systems.
- </p>
-
- <p>
- Medications from TSI are associated with hospital encounters only. These comprise mainly inpatient status patients, but also include emergency department, surgical day care (SDC), or observation status patients. Hospital-based patient medications for BWH include inpatients, emergency room, observation stays, and newborns. For MGH, medications include inpatients, dialysis, observation stays, surgical day care, newborns and some research patients.
- </p>
-
- <p>
- Medications from the LMR are associated with outpatient encounters, while the codes are defined locally. A number of analytic processes are performed to make the data as consistent and reliable as possible. If a provider describes a medication in several different ways, such as, for example, aspirin, the analytic processes applied attempt to collapse all of the synonyms under one consistent code and description. If the LMR code for this common medication is 3644, but it is described as <em>Aspirin</em> 79% of the time, as <em>ASA</em> 19% of the time, and as <em>Bayer</em> 3% of the time, these are reviewed manually, determined to be synonymous, and altered to a single description—Aspirin.
- </p>
-
- <p>
- Medications from the OnCall system are associated with outpatient encounters within MGH. The codes are in the <a href="http://www.clinfowiki.org/wiki/index.php/COmputer_STored_Ambulatory_Record_(COSTAR)" target="_blank">COSTAR</a> coding system.
- </p>
-
-
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="33%">
- Code System
- </th>
- <th width="33%">
- Institution
- </th>
- <th width="34%">
- Encounter Type
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- TSI Charge Codes
- </p>
- </td>
- <td>
- <p>
- BWH, MGH
- </p>
- </td>
- <td>
- <p>
- Hospital encounters (inpatient, emergency, observation, dialysis, newborns, research patients)
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- LMR
- </p>
- </td>
- <td>
- <p>
- BWH, MGH
- </p>
- </td>
- <td>
- <p>
- Outpatient encounters
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- COSTAR
- </p>
- </td>
- <td>
- <p>
- MGH
- </p>
- </td>
- <td>
- <p>
- Outpatient encounters
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html"><strong><em>BWH and MGH Medications</em></strong></a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h3>
+ <a name="PartnersMedSemantics">BWH and MGH Medications</a>
+ </h3>
+ <p>
+ Medications are derived from <i>TSI</i>, the <a href="http://www.partners.org/cird/StaffPrj.asp?cBox=CurrProj&prAb=LMR" target="_blank">Longitudinal Medical Record</a> (LMR), and <i>OnCall</i> systems.
+ </p>
+
+ <p>
+ Medications from TSI are associated with hospital encounters only. These comprise mainly inpatient status patients, but also include emergency department, surgical day care (SDC), or observation status patients. Hospital-based patient medications for BWH include inpatients, emergency room, observation stays, and newborns. For MGH, medications include inpatients, dialysis, observation stays, surgical day care, newborns and some research patients.
+ </p>
+
+ <p>
+ Medications from the LMR are associated with outpatient encounters, while the codes are defined locally. A number of analytic processes are performed to make the data as consistent and reliable as possible. If a provider describes a medication in several different ways, such as, for example, aspirin, the analytic processes applied attempt to collapse all of the synonyms under one consistent code and description. If the LMR code for this common medication is 3644, but it is described as <em>Aspirin</em> 79% of the time, as <em>ASA</em> 19% of the time, and as <em>Bayer</em> 3% of the time, these are reviewed manually, determined to be synonymous, and altered to a single description—Aspirin.
+ </p>
+
+ <p>
+ Medications from the OnCall system are associated with outpatient encounters within MGH. The codes are in the <a href="http://www.clinfowiki.org/wiki/index.php/COmputer_STored_Ambulatory_Record_(COSTAR)" target="_blank">COSTAR</a> coding system.
+ </p>
+
+
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="33%">
+ Code System
+ </th>
+ <th width="33%">
+ Institution
+ </th>
+ <th width="34%">
+ Encounter Type
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ TSI Charge Codes
+ </p>
+ </td>
+ <td>
+ <p>
+ BWH, MGH
+ </p>
+ </td>
+ <td>
+ <p>
+ Hospital encounters (inpatient, emergency, observation, dialysis, newborns, research patients)
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ LMR
+ </p>
+ </td>
+ <td>
+ <p>
+ BWH, MGH
+ </p>
+ </td>
+ <td>
+ <p>
+ Outpatient encounters
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ COSTAR
+ </p>
+ </td>
+ <td>
+ <p>
+ MGH
+ </p>
+ </td>
+ <td>
+ <p>
+ Outpatient encounters
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797232.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797232.htm
index 26ab88537..c0c15943c 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797232.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797232.htm
@@ -1,190 +1,190 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm"><strong><em>Basics</em></strong></a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm"><strong><em>Terminology</em></strong></a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252797232">Basics</a>
- </h1>
- <p>
- SHRINE currently makes patient demographics, diagnoses, medications, and a sample of laboratory results data available to be searched. SHRINE Core
- ontology is a collection of terms that describe these data and can be used to construct queries. The terms are arranged into a hierarchy for easy
- navigation; the ontology can be searched for a particular terms as well.
- </p>
- <p>
- A standard terminology was selected where possible to represent each type of data accessible through use of the system. A terminology was modified as
- necessary to fit the requirements of SHRINE.
- </p>
- <h2>
- <a name="_Toc252797232">Terminology</a>
- </h2>
- <p>
- The following standard terminology provides the baseline for the Core ontology:
- </p>
- <ul><li>
- Demographics &#8211; Patient demographic data available at each participating SHRINE hospital include:
- <ul>
- <li>
- Age
- </li>
- <li>
- Gender &#8211; Health Level Seven International (HL7) <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/AdministrativeGender.htm" title="HL7 Administrative Gender" target="_blank">Administrative Gender</a>
- </li>
- <li>
- Language &#8211; International Organization for Standardization (ISO) <a href="http://www.iso.org/iso/catalogue_detail?csnumber=22109" title="ISO 639-1" target="_blank">ISO 639-1</a>
- </li>
- <li>
- Marital status &#8211; HL7 <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/MaritalStatus.htm" title="HL7 Marital Status" target="_blank">Marital Status</a>
- </li>
- <li>
- Race and Ethnicity &#8211; Centers for Disease Control and Prevention (CDC) <a href="http://www.cdc.gov/nedss/DataModels/index.html" title="CDC Race and Ethnicity" target="_blank">Race and Ethnicity Code Sets</a>
- </li></ul></li>
- <li>
- Diagnoses &#8211; Diagnoses are identified by National Center for Health Statistics (NCHS) <a href="http://www.cdc.gov/nchs/about/otheract/icd9/abticd9.htm" title="ICD-9-CM" target="_blank">ICD-9-CM</a> standards and Clinical Classification
- Software (<a href="http://www.hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp" title="CSS" target="_blank">CCS</a>) hierarchy.
- </li>
- <li>
- Medications &#8211; Medications are identified by the Unified Medical Language System (UMLS) <a href="http://www.nlm.nih.gov/research/umls/rxnorm/" title="RxNorm" target="_blank">RxNorm</a> (Ingredient) and the Veterans Administration
- (VA) National Drug File Reference Terminology (<a href="http://bioportal.nci.nih.gov/ncbo/faces/pages/ontology_details.xhtml?ontology_display_name=National%20Drug%20File%20-%20Reference%20Terminology" title="NDR-RT" target="_blank">NDF-RT</a>) hierarchy.
- </li>
- <li>
- Lab Tests &#8211; Data on lab tests is derived from the Clinical Data Repository (CDR). Data are identified by Logical Observation Identifiers
- Names and Codes (<a href="http://loinc.org/" title="LOINC" target="_blank">LOINC</a>) and Partners HealthCare System.
- </li></ul>
- <p>
- The Core ontology was constructed following recommendations of relevant government and private sector bodies using a pragmatic approach. It is a static snapshot of underlying standards. As they change (for example, there are regular updates of ICD-9-CM and RxNorm), we
- expect that the Core ontology will follow after a reasonable delay to accommodate the effort of introducing the changes, resolving issues and completing quality
- assurance processes.
- </p>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm"><strong><em>Basics</em></strong></a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm"><strong><em>Terminology</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252797232">Basics</a>
+ </h1>
+ <p>
+ SHRINE currently makes patient demographics, diagnoses, medications, and a sample of laboratory results data available to be searched. SHRINE Core
+ ontology is a collection of terms that describe these data and can be used to construct queries. The terms are arranged into a hierarchy for easy
+ navigation; the ontology can be searched for a particular terms as well.
+ </p>
+ <p>
+ A standard terminology was selected where possible to represent each type of data accessible through use of the system. A terminology was modified as
+ necessary to fit the requirements of SHRINE.
+ </p>
+ <h2>
+ <a name="_Toc252797232">Terminology</a>
+ </h2>
+ <p>
+ The following standard terminology provides the baseline for the Core ontology:
+ </p>
+ <ul><li>
+ Demographics &#8211; Patient demographic data available at each participating SHRINE hospital include:
+ <ul>
+ <li>
+ Age
+ </li>
+ <li>
+ Gender &#8211; Health Level Seven International (HL7) <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/AdministrativeGender.htm" title="HL7 Administrative Gender" target="_blank">Administrative Gender</a>
+ </li>
+ <li>
+ Language &#8211; International Organization for Standardization (ISO) <a href="http://www.iso.org/iso/catalogue_detail?csnumber=22109" title="ISO 639-1" target="_blank">ISO 639-1</a>
+ </li>
+ <li>
+ Marital status &#8211; HL7 <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/MaritalStatus.htm" title="HL7 Marital Status" target="_blank">Marital Status</a>
+ </li>
+ <li>
+ Race and Ethnicity &#8211; Centers for Disease Control and Prevention (CDC) <a href="http://www.cdc.gov/nedss/DataModels/index.html" title="CDC Race and Ethnicity" target="_blank">Race and Ethnicity Code Sets</a>
+ </li></ul></li>
+ <li>
+ Diagnoses &#8211; Diagnoses are identified by National Center for Health Statistics (NCHS) <a href="http://www.cdc.gov/nchs/about/otheract/icd9/abticd9.htm" title="ICD-9-CM" target="_blank">ICD-9-CM</a> standards and Clinical Classification
+ Software (<a href="http://www.hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp" title="CSS" target="_blank">CCS</a>) hierarchy.
+ </li>
+ <li>
+ Medications &#8211; Medications are identified by the Unified Medical Language System (UMLS) <a href="http://www.nlm.nih.gov/research/umls/rxnorm/" title="RxNorm" target="_blank">RxNorm</a> (Ingredient) and the Veterans Administration
+ (VA) National Drug File Reference Terminology (<a href="http://bioportal.nci.nih.gov/ncbo/faces/pages/ontology_details.xhtml?ontology_display_name=National%20Drug%20File%20-%20Reference%20Terminology" title="NDR-RT" target="_blank">NDF-RT</a>) hierarchy.
+ </li>
+ <li>
+ Lab Tests &#8211; Data on lab tests is derived from the Clinical Data Repository (CDR). Data are identified by Logical Observation Identifiers
+ Names and Codes (<a href="http://loinc.org/" title="LOINC" target="_blank">LOINC</a>) and Partners HealthCare System.
+ </li></ul>
+ <p>
+ The Core ontology was constructed following recommendations of relevant government and private sector bodies using a pragmatic approach. It is a static snapshot of underlying standards. As they change (for example, there are regular updates of ICD-9-CM and RxNorm), we
+ expect that the Core ontology will follow after a reasonable delay to accommodate the effort of introducing the changes, resolving issues and completing quality
+ assurance processes.
+ </p>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797233.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797233.htm
index 0736a8a98..0e949214e 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797233.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797233.htm
@@ -1,144 +1,144 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm"><strong><em>Availability and Maintenance</em></strong></a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797233">Availability and Maintenance</a>
- </h2>
- <p>
- Data in the SHRINE system are available from January 1 and are refreshed regularly. Scheduled maintenance of the Core ontology
- is not defined at that time.
- </p>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm"><strong><em>Availability and Maintenance</em></strong></a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797233">Availability and Maintenance</a>
+ </h2>
+ <p>
+ Data in the SHRINE system are available from January 1 and are refreshed regularly. Scheduled maintenance of the Core ontology
+ is not defined at that time.
+ </p>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797235.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797235.htm
index 51c2a6084..eb5663699 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797235.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797235.htm
@@ -1,213 +1,213 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm"><strong><em>Standards</em></strong></a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm"><strong><em>Core Standards</em></strong></a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252797235">Standards</a>
- </h1>
- <p>
- The following sections describe the standards used in the SHRINE Core ontology.
- </p>
- <h2>
- <a name="_Toc252797235">Core Standards</a>
- </h2>
- <p>
- Core standards for data in the SHRINE Core ontology are identified in the following table.
- </p>
-
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="50%">
- DataType
- </th>
- <th width="50%">
- Proposed Ontology
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- Demographics
- </p>
- </td>
- <td>
- <p>
- <a href="http://www.hitsp.org/ConstructSet_Details.aspx?&amp;PrefixAlpha=4&amp;PrefixNumeric=32" target="_blank">HITSP C32</a>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Diagnoses
- </p>
- </td>
- <td>
- <p>
- <a href="http://www.cdc.gov/nchs/about/otheract/icd9/abticd9.htm" target="_blank">ICD-9-CM</a>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Medications
- </p>
- </td>
- <td>
- <p>
- <a href="http://www.nlm.nih.gov/research/umls/rxnorm/" target="_blank">RxNorm</a>
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Labs
- </p>
- </td>
- <td>
- <p>
- Initial version uses Partners HealthCare System coding standard
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm"><strong><em>Standards</em></strong></a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm"><strong><em>Core Standards</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252797235">Standards</a>
+ </h1>
+ <p>
+ The following sections describe the standards used in the SHRINE Core ontology.
+ </p>
+ <h2>
+ <a name="_Toc252797235">Core Standards</a>
+ </h2>
+ <p>
+ Core standards for data in the SHRINE Core ontology are identified in the following table.
+ </p>
+
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="50%">
+ DataType
+ </th>
+ <th width="50%">
+ Proposed Ontology
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ Demographics
+ </p>
+ </td>
+ <td>
+ <p>
+ <a href="http://www.hitsp.org/ConstructSet_Details.aspx?&amp;PrefixAlpha=4&amp;PrefixNumeric=32" target="_blank">HITSP C32</a>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Diagnoses
+ </p>
+ </td>
+ <td>
+ <p>
+ <a href="http://www.cdc.gov/nchs/about/otheract/icd9/abticd9.htm" target="_blank">ICD-9-CM</a>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Medications
+ </p>
+ </td>
+ <td>
+ <p>
+ <a href="http://www.nlm.nih.gov/research/umls/rxnorm/" target="_blank">RxNorm</a>
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Labs
+ </p>
+ </td>
+ <td>
+ <p>
+ Initial version uses Partners HealthCare System coding standard
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797236.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797236.htm
index 80b4e512d..0bd51f834 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797236.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797236.htm
@@ -1,305 +1,305 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm"><strong><em>Demographic Standards</em></strong></a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797236">Demographic Standards</a>
- </h2>
- <p>
- The following table describes the demographics standards of which the SHRINE Core ontology makes use.
- </p>
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="20%">
- Attribute
- </th>
- <th width="20%">
- Vocabulary
- </th>
- <th width="20%">
- Based on HITSP C32
- </th>
- <th width="20%">
- Notes
- </th>
- <th width="20%">
- UMLS
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- Age
- </p>
- </td>
- <td>
- <p>
- N/A
- </p>
- </td>
- <td>
- <p>
- Yes
- </p>
- </td>
- <td>
- <p>
- HIPAA: &lt;90 yo
- </p>
- </td>
- <td>
- <p>
- N/A
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Gender
- </p>
- </td>
- <td>
- <p>
- HL7 <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/AdministrativeGender.htm" target="_blank">Administrative Gender</a>
- </p>
- </td>
- <td>
- <p>
- Yes
- </p>
- </td>
- <td>
- <p>
- + UNKNOWN
- </p>
- </td>
- <td>
- <p>
- C1550327
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Marital Status
- </p>
- </td>
- <td>
- <p>
- HL7 <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/MaritalStatus.htm" target="_blank">Marital Status</a>
- </p>
- </td>
- <td>
- <p>
- Yes
- </p>
- </td>
- <td>
- <p>
- + UNKNOWN
- </p>
- </td>
- <td>
- <p>
- C1553797
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Race
- </p>
- </td>
- <td>
- <p>
- CDC <a href="http://www.cdc.gov/nedss/DataModels/index.html" target="_blank">Race &amp; Ethnicity Code Sets</a>
- </p>
- </td>
- <td>
- <p>
- Yes
- </p>
- </td>
- <td>
- <p>
- - Other Race (R9)
- <br/>
- + R9: Unknown Race
- </p>
- </td>
- <td>
- <p>
- C1561446
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Ethnicity
- </p>
- </td>
- <td>
- <p>
- N/A
- </p>
- </td>
- <td>
- <p>
- Yes
- </p>
- </td>
- <td>
- <p>
- + E9: Unknown Ethnicity
- <br/>
- see Notes for E2=!E1
- </p>
- </td>
- <td>
- <p>
- C1553821
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm"><strong><em>Demographic Standards</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797236">Demographic Standards</a>
+ </h2>
+ <p>
+ The following table describes the demographics standards of which the SHRINE Core ontology makes use.
+ </p>
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="20%">
+ Attribute
+ </th>
+ <th width="20%">
+ Vocabulary
+ </th>
+ <th width="20%">
+ Based on HITSP C32
+ </th>
+ <th width="20%">
+ Notes
+ </th>
+ <th width="20%">
+ UMLS
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ Age
+ </p>
+ </td>
+ <td>
+ <p>
+ N/A
+ </p>
+ </td>
+ <td>
+ <p>
+ Yes
+ </p>
+ </td>
+ <td>
+ <p>
+ HIPAA: &lt;90 yo
+ </p>
+ </td>
+ <td>
+ <p>
+ N/A
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Gender
+ </p>
+ </td>
+ <td>
+ <p>
+ HL7 <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/AdministrativeGender.htm" target="_blank">Administrative Gender</a>
+ </p>
+ </td>
+ <td>
+ <p>
+ Yes
+ </p>
+ </td>
+ <td>
+ <p>
+ + UNKNOWN
+ </p>
+ </td>
+ <td>
+ <p>
+ C1550327
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Marital Status
+ </p>
+ </td>
+ <td>
+ <p>
+ HL7 <a href="http://www.hl7.org/v3ballot/html/infrastructure/vocabulary/MaritalStatus.htm" target="_blank">Marital Status</a>
+ </p>
+ </td>
+ <td>
+ <p>
+ Yes
+ </p>
+ </td>
+ <td>
+ <p>
+ + UNKNOWN
+ </p>
+ </td>
+ <td>
+ <p>
+ C1553797
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Race
+ </p>
+ </td>
+ <td>
+ <p>
+ CDC <a href="http://www.cdc.gov/nedss/DataModels/index.html" target="_blank">Race &amp; Ethnicity Code Sets</a>
+ </p>
+ </td>
+ <td>
+ <p>
+ Yes
+ </p>
+ </td>
+ <td>
+ <p>
+ - Other Race (R9)
+ <br/>
+ + R9: Unknown Race
+ </p>
+ </td>
+ <td>
+ <p>
+ C1561446
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Ethnicity
+ </p>
+ </td>
+ <td>
+ <p>
+ N/A
+ </p>
+ </td>
+ <td>
+ <p>
+ Yes
+ </p>
+ </td>
+ <td>
+ <p>
+ + E9: Unknown Ethnicity
+ <br/>
+ see Notes for E2=!E1
+ </p>
+ </td>
+ <td>
+ <p>
+ C1553821
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797237.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797237.htm
index c6d17fdfb..c71871e59 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797237.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797237.htm
@@ -1,144 +1,144 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm"><strong><em>Diagnoses Standards</em></strong></a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797237">Diagnoses Standards</a>
- </h2>
- <p>
- The <a href="http://www.hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp" target="_blank">Clinical Classifications Software</a> for ICD-9-CM standard is used for diagnoses data.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm"><strong><em>Diagnoses Standards</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797237">Diagnoses Standards</a>
+ </h2>
+ <p>
+ The <a href="http://www.hcup-us.ahrq.gov/toolssoftware/ccs/ccs.jsp" target="_blank">Clinical Classifications Software</a> for ICD-9-CM standard is used for diagnoses data.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797238.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797238.htm
index 29a2ca3fc..995291fe1 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797238.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797238.htm
@@ -1,264 +1,264 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm"><strong><em>Medications Standards</em></strong></a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797238">Medications Standards</a>
- </h2>
- <p>
- The following reference informs the medications standards used in the SHRINE Core ontology:
- </p>
- <blockquote>
- HITSP C32 Summary Documents Using HL7 Continuity of Care Document (CCD) Component v2.3
- <br />Table 2.2.1.10.10-2 Product / Brand Name Vocabulary
- </blockquote>
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="25%">
- Vocabulary
- </th>
- <th width="25%">
- OID
- </th>
- <th width="25%">
- Used for
- </th>
- <th width="25%">
- Example
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- <a href="http://www.nlm.nih.gov/research/umls/rxnorm/" target="_blank">RxNorm</a>
- </p>
- </td>
- <td>
- <p>
- 2.16.840.1.113883.6.88
- </p>
- </td>
- <td>
- <p>
- Brand Names
- <br/>
- Clinical Drugs
- </p>
- </td>
- <td>
- <p>
- Tylenol
-
- Acetaminophen <br />325 mg tablet
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- National Drug Code (<a href="http://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm" title="NDC" target="_blank">NDC</a>)
- </p>
- </td>
- <td>
- <p>
- 2.16.840.1.113883.6.69
- </p>
- </td>
- <td>
- <p>
- Packaged Product
- </p>
- </td>
- <td>
- <p>
- Tylenol 325 mg tablet <br />bottle of 100
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- FDA Unique Ingredient Identifier (<a href="http://www.fda.gov/ForIndustry/DataStandards/SubstanceRegistrationSystem-UniqueIngredientIdentifierUNII/default.htm" title="UNII" target="_blank">UNII</a>)
- </p>
- </td>
- <td>
- <p>
- 2.16.840.1.113883.4.9
- </p>
- </td>
- <td>
- <p>
- Ingredient Name
- </p>
- </td>
- <td>
- <p>
- Gentian violet
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- <a
- href="http://bioportal.nci.nih.gov/ncbo/faces/pages/ontology_details.xhtml?ontology_display_name=National%20Drug%20File%20-%20Reference%20Terminology" title="NDR-RT"
- target="_blank">
- NDF-RT
- </a>
- </p>
- </td>
- <td>
- <p>
- 2.16.840.1.113883.4.209
- </p>
- </td>
- <td>
- <p>
- Drug Class
- </p>
- </td>
- <td>
- <p>
- Cephalosporins
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm"><strong><em>Medications Standards</em></strong></a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797238">Medications Standards</a>
+ </h2>
+ <p>
+ The following reference informs the medications standards used in the SHRINE Core ontology:
+ </p>
+ <blockquote>
+ HITSP C32 Summary Documents Using HL7 Continuity of Care Document (CCD) Component v2.3
+ <br />Table 2.2.1.10.10-2 Product / Brand Name Vocabulary
+ </blockquote>
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="25%">
+ Vocabulary
+ </th>
+ <th width="25%">
+ OID
+ </th>
+ <th width="25%">
+ Used for
+ </th>
+ <th width="25%">
+ Example
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ <a href="http://www.nlm.nih.gov/research/umls/rxnorm/" target="_blank">RxNorm</a>
+ </p>
+ </td>
+ <td>
+ <p>
+ 2.16.840.1.113883.6.88
+ </p>
+ </td>
+ <td>
+ <p>
+ Brand Names
+ <br/>
+ Clinical Drugs
+ </p>
+ </td>
+ <td>
+ <p>
+ Tylenol
+
+ Acetaminophen <br />325 mg tablet
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ National Drug Code (<a href="http://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm" title="NDC" target="_blank">NDC</a>)
+ </p>
+ </td>
+ <td>
+ <p>
+ 2.16.840.1.113883.6.69
+ </p>
+ </td>
+ <td>
+ <p>
+ Packaged Product
+ </p>
+ </td>
+ <td>
+ <p>
+ Tylenol 325 mg tablet <br />bottle of 100
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ FDA Unique Ingredient Identifier (<a href="http://www.fda.gov/ForIndustry/DataStandards/SubstanceRegistrationSystem-UniqueIngredientIdentifierUNII/default.htm" title="UNII" target="_blank">UNII</a>)
+ </p>
+ </td>
+ <td>
+ <p>
+ 2.16.840.1.113883.4.9
+ </p>
+ </td>
+ <td>
+ <p>
+ Ingredient Name
+ </p>
+ </td>
+ <td>
+ <p>
+ Gentian violet
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ <a
+ href="http://bioportal.nci.nih.gov/ncbo/faces/pages/ontology_details.xhtml?ontology_display_name=National%20Drug%20File%20-%20Reference%20Terminology" title="NDR-RT"
+ target="_blank">
+ NDF-RT
+ </a>
+ </p>
+ </td>
+ <td>
+ <p>
+ 2.16.840.1.113883.4.209
+ </p>
+ </td>
+ <td>
+ <p>
+ Drug Class
+ </p>
+ </td>
+ <td>
+ <p>
+ Cephalosporins
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797239.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797239.htm
index 3275a73db..4f0419cff 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797239.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797239.htm
@@ -1,177 +1,177 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm"><strong><em>Site to RxNorm Associations Type Mapping</em></strong></a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h3>
- <a name="_Toc252797239">Site to RxNorm Associations Type Mapping</a>
- </h3>
- <p>
- For the ingredient name (IN) and trade name (BN), the BN is derived from <a href="http://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm" title="FDA Trade Name" target="_blank">FDA Trade Name</a>, and is the same as IN in most cases. In cases where they
- differ, such as extended release variants with something similar to <em>XL</em> in the trade name, that component of the IN is not in the BN.
- </p>
- <p>
- A diagram indicates the datatype relationships for medication data.
- </p>
- <p align="left">
- <img src="images/rxnorm_tty.PNG" width="341" border="0" height="212"/>
- </p>
- <p>
- This relationship map is described as follows:
- </p>
- <ul>
- <li>
- IN &rarr; has_tradename &rarr; BN
- </li>
- <li>
- IN &rarr; ingedient_of &rarr; SCDC
- </li>
- <li>
- SCDC &rarr; has_tradename &rarr; SBDC
- </li>
- <li>
- IN &rarr; ingredient_of &rarr; SCDF
- </li>
- <li>
- SCDF &rarr; has_tradename &rarr; SBDF
- </li>
- <li>
- SCDF &rarr; inverse_isa &rarr; SCD
- </li>
- <li>
- SCD &rarr; has_tradename &rarr; SBD
- </li>
- </ul>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm"><strong><em>Site to RxNorm Associations Type Mapping</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h3>
+ <a name="_Toc252797239">Site to RxNorm Associations Type Mapping</a>
+ </h3>
+ <p>
+ For the ingredient name (IN) and trade name (BN), the BN is derived from <a href="http://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm" title="FDA Trade Name" target="_blank">FDA Trade Name</a>, and is the same as IN in most cases. In cases where they
+ differ, such as extended release variants with something similar to <em>XL</em> in the trade name, that component of the IN is not in the BN.
+ </p>
+ <p>
+ A diagram indicates the datatype relationships for medication data.
+ </p>
+ <p align="left">
+ <img src="images/rxnorm_tty.PNG" width="341" border="0" height="212"/>
+ </p>
+ <p>
+ This relationship map is described as follows:
+ </p>
+ <ul>
+ <li>
+ IN &rarr; has_tradename &rarr; BN
+ </li>
+ <li>
+ IN &rarr; ingedient_of &rarr; SCDC
+ </li>
+ <li>
+ SCDC &rarr; has_tradename &rarr; SBDC
+ </li>
+ <li>
+ IN &rarr; ingredient_of &rarr; SCDF
+ </li>
+ <li>
+ SCDF &rarr; has_tradename &rarr; SBDF
+ </li>
+ <li>
+ SCDF &rarr; inverse_isa &rarr; SCD
+ </li>
+ <li>
+ SCD &rarr; has_tradename &rarr; SBD
+ </li>
+ </ul>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797240.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797240.htm
index dd554cb11..7590000ca 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797240.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797240.htm
@@ -1,152 +1,152 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm"><strong><em>Site to NDR-RT Mapping</em></strong></a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a> <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h3>
- <a name="_Toc252797240">Site to NDR-RT Mapping</a>
- </h3>
- <p>
- SHRINE uses the OWL version of <a href="http://bioportal.nci.nih.gov/ncbo/faces/pages/ontology_details.xhtml?ontology_display_name=National%20Drug%20File%20-%20Reference%20Terminology" title="NDR-RT" target="_blank">NDF-RT</a> VA Class and VA Product hierarchies for medications data, from the May 12, 2009 NDF-RF XML distribution.
- </p>
- <p>
- The Veterans Administration (VA) Product Component is classified consistently. Any drug or ingredient on the US market has a corresponding VA Product
- Component. Note that there are numerous ingredients that are not part of drugs on the market, such as reagents or preservatives, which result in occasional classification inconsistencies.
- </p>
- <p>
- For NDR-RT mapping of precise versus base ingredients in RxNorm, base ingredients comprise those without salt. NDF-RT links to base ingredient unless a
- salt makes a clinical difference, such as Mg Citrate compared with Mg Oxide.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm"><strong><em>Site to NDR-RT Mapping</em></strong></a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a> <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h3>
+ <a name="_Toc252797240">Site to NDR-RT Mapping</a>
+ </h3>
+ <p>
+ SHRINE uses the OWL version of <a href="http://bioportal.nci.nih.gov/ncbo/faces/pages/ontology_details.xhtml?ontology_display_name=National%20Drug%20File%20-%20Reference%20Terminology" title="NDR-RT" target="_blank">NDF-RT</a> VA Class and VA Product hierarchies for medications data, from the May 12, 2009 NDF-RF XML distribution.
+ </p>
+ <p>
+ The Veterans Administration (VA) Product Component is classified consistently. Any drug or ingredient on the US market has a corresponding VA Product
+ Component. Note that there are numerous ingredients that are not part of drugs on the market, such as reagents or preservatives, which result in occasional classification inconsistencies.
+ </p>
+ <p>
+ For NDR-RT mapping of precise versus base ingredients in RxNorm, base ingredients comprise those without salt. NDF-RT links to base ingredient unless a
+ salt makes a clinical difference, such as Mg Citrate compared with Mg Oxide.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797241.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797241.htm
index e611f363b..1bb3a5f5e 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797241.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797241.htm
@@ -1,156 +1,156 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm"><strong><em>Labs Standards</em></strong></a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
-
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797241">Labs Standards</a>
- </h2>
- <p>
- Lab data in the SHRINE Core ontology are encoded to Partners HealthCare System coding standard. Mapping of Labs to SHRINE data supports the following
- queries:
- </p>
- <ul>
- <li>
- Lab Types (<a href="http://loinc.org/" title="LOINC" target="_blank">LOINC</a>)
- </li>
- <li>
- Normal/Abnormal, High-Low
- </li>
- <li>
- Unit Issue
- </li>
- </ul>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm"><strong><em>Labs Standards</em></strong></a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797241">Labs Standards</a>
+ </h2>
+ <p>
+ Lab data in the SHRINE Core ontology are encoded to Partners HealthCare System coding standard. Mapping of Labs to SHRINE data supports the following
+ queries:
+ </p>
+ <ul>
+ <li>
+ Lab Types (<a href="http://loinc.org/" title="LOINC" target="_blank">LOINC</a>)
+ </li>
+ <li>
+ Normal/Abnormal, High-Low
+ </li>
+ <li>
+ Unit Issue
+ </li>
+ </ul>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797243.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797243.htm
index 2c79f20c6..271795144 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797243.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797243.htm
@@ -1,266 +1,266 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm"><strong><em>Local Data</em></strong></a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm"><strong><em>Semantics Preservation</em></strong></a>
-
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252797243">Local Data</a>
- </h1>
- <p>
- This section describes the SHRINE Core ontology mapping across participating institutions.
- </p>
-
- <p>
- Mapping of local institutional standards to the SHRINE Core ontology is identified in the following table.
- </p>
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="25%">
- Vocabulary
- </th>
- <th width="25%">
- Beth Israel Deaconess Medical Center (BIDMC)
- </th>
- <th width="25%">
- Brigham and Women's Hospital (BWH) &<br />
- Massachusetts General Hospital (MGH)
- </th>
- <th width="25%">
- Children&#8217;s Hospital Boston (CHB)
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- Demographics
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Diagnoses
- </p>
- </td>
- <td>
- <p>
- ICD-9
- </p>
- </td>
- <td>
- <p>
- ICD-9 / COSTAR / LMR
- </p>
- </td>
- <td>
- <p>
- ICD-9
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Medications
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- <td>
- <p>
- TSI / LMR / COSTAR
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- </tr>
- <tr>
- <td>
- <p>
- Labs
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- <td>
- <p>
- LOINC / Local
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-<br />
-
- <h2>
- <a name="_Toc252797243">Semantics Preservation</a>
- </h2>
- <p>
- Each participating institution's data is loaded with native coding schemes used by local information technology solutions. To understand SHRINE queries
- issued using terms from the Core ontology, a mapping is created and maintained for each institution that enables a translation from SHRINE Core
- ontology term to a corresponding local term, enabling the capability to perform a query at that institution.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm"><strong><em>Local Data</em></strong></a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm"><strong><em>Semantics Preservation</em></strong></a>
+
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252797243">Local Data</a>
+ </h1>
+ <p>
+ This section describes the SHRINE Core ontology mapping across participating institutions.
+ </p>
+
+ <p>
+ Mapping of local institutional standards to the SHRINE Core ontology is identified in the following table.
+ </p>
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="25%">
+ Vocabulary
+ </th>
+ <th width="25%">
+ Beth Israel Deaconess Medical Center (BIDMC)
+ </th>
+ <th width="25%">
+ Brigham and Women's Hospital (BWH) &<br />
+ Massachusetts General Hospital (MGH)
+ </th>
+ <th width="25%">
+ Children&#8217;s Hospital Boston (CHB)
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ Demographics
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Diagnoses
+ </p>
+ </td>
+ <td>
+ <p>
+ ICD-9
+ </p>
+ </td>
+ <td>
+ <p>
+ ICD-9 / COSTAR / LMR
+ </p>
+ </td>
+ <td>
+ <p>
+ ICD-9
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Medications
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ <td>
+ <p>
+ TSI / LMR / COSTAR
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <p>
+ Labs
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ <td>
+ <p>
+ LOINC / Local
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+<br />
+
+ <h2>
+ <a name="_Toc252797243">Semantics Preservation</a>
+ </h2>
+ <p>
+ Each participating institution's data is loaded with native coding schemes used by local information technology solutions. To understand SHRINE queries
+ issued using terms from the Core ontology, a mapping is created and maintained for each institution that enables a translation from SHRINE Core
+ ontology term to a corresponding local term, enabling the capability to perform a query at that institution.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797244.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797244.htm
index 7c99c2fba..523106fdc 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797244.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/Toc252797244.htm
@@ -1,183 +1,183 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm"><strong><em>Local Medications Data</em></strong></a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252797244">Local Medications Data</a>
- </h2>
- <p>
- Mapping of local institutional standards to the SHRINE Core ontology is identified in the following table.
- </p>
- <table border="1" cellpadding="3" cellspacing="0">
- <thead>
- <tr>
- <th width="25%">
- Vocabulary
- </th>
- <th width="25%">
- BIDMC
- </th>
- <th width="25%">
- BWH & MGH
- </th>
- <th width="25%">
- CHB
- </th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <p>
- Medications
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- <td>
- <p>
- TSI / LMR / COSTAR
- </p>
- </td>
- <td>
- <p>
- Local
- </p>
- </td>
- </tr>
- </tbody>
- </table>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm"><strong><em>Local Medications Data</em></strong></a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252797244">Local Medications Data</a>
+ </h2>
+ <p>
+ Mapping of local institutional standards to the SHRINE Core ontology is identified in the following table.
+ </p>
+ <table border="1" cellpadding="3" cellspacing="0">
+ <thead>
+ <tr>
+ <th width="25%">
+ Vocabulary
+ </th>
+ <th width="25%">
+ BIDMC
+ </th>
+ <th width="25%">
+ BWH & MGH
+ </th>
+ <th width="25%">
+ CHB
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>
+ <p>
+ Medications
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ <td>
+ <p>
+ TSI / LMR / COSTAR
+ </p>
+ </td>
+ <td>
+ <p>
+ Local
+ </p>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/index.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/index.htm
index a11d000ee..c66cab6af 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/index.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/DR_Help_Files/index.htm
@@ -1,153 +1,153 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Data Reference Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Data Reference Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm"><strong><em>Contents</em></strong></a>
- </p>
-
- <p>
- <a href="Toc252797232.htm">Basics</a>
- </p>
- <ul><li>
- <a href="Toc252797232.htm">Terminology</a>
- </li>
- <li>
- <a href="Toc252797233.htm">Availability and Maintenance</a>
- </li></ul>
- <p>
- <a href="Toc252797235.htm">Standards</a>
- </p>
- <ul><li>
- <a href="Toc252797235.htm">Core Standards</a>
- </li>
- <li>
- <a href="Toc252797236.htm">Demographic Standards</a>
- </li>
- <li>
- <a href="Toc252797237.htm">Diagnoses Standards</a>
- </li>
- <li>
- <a href="Toc252797238.htm">Medications Standards</a>
- <ul><li>
- <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
- </li>
- <li>
- <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
- </li></ul>
- </li>
- <li>
- <a href="Toc252797241.htm">Labs Standards</a>
- </li></ul>
- <p>
- <a href="Toc252797243.htm">Local Data</a>
- </p>
- <ul><li>
- <a href="Toc252797243.htm">Semantics Preservation</a>
- </li>
- <li>
- <a href="LocalDiags.htm">Local Diagnoses Data</a>
- <ul>
-
- <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
-
- </ul>
- </li>
- <li>
- <a href="Toc252797244.htm">Local Medications Data</a>
- <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
-
- <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
-
- <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
- </li></ul>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
-<p>This guide describes the SHRINE Core ontology, including terminology, composition, source systems and maintenance schedules, and data descriptions.</p>
-
-<p>Harvard Catalyst provides a full set of guides to support use of SHRINE:</p>
-
- <ul>
- <li>
- <em><a href="../UG_Help_Files/index.htm" title="SHRINE User Guide">SHRINE User Guide</a></em>
- &#8211; Use the Query Tool to locate patient populations.
- </li>
- <li>
- <em><a href="../QR_Help_Files/index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></em>
- &#8211; Construct optimum queries by using the Query Tool.
- </li>
- <li>
- <em><a href="index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></em>
- &#8211; Understand the terms available for query.
- </li>
- </ul>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Data Reference Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Data Reference Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm"><strong><em>Contents</em></strong></a>
+ </p>
+
+ <p>
+ <a href="Toc252797232.htm">Basics</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797232.htm">Terminology</a>
+ </li>
+ <li>
+ <a href="Toc252797233.htm">Availability and Maintenance</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797235.htm">Standards</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797235.htm">Core Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797236.htm">Demographic Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797237.htm">Diagnoses Standards</a>
+ </li>
+ <li>
+ <a href="Toc252797238.htm">Medications Standards</a>
+ <ul><li>
+ <a href="Toc252797239.htm">Site to RxNorm Associations Type Mapping</a>
+ </li>
+ <li>
+ <a href="Toc252797240.htm">Site to NDR-RT Mapping</a>
+ </li></ul>
+ </li>
+ <li>
+ <a href="Toc252797241.htm">Labs Standards</a>
+ </li></ul>
+ <p>
+ <a href="Toc252797243.htm">Local Data</a>
+ </p>
+ <ul><li>
+ <a href="Toc252797243.htm">Semantics Preservation</a>
+ </li>
+ <li>
+ <a href="LocalDiags.htm">Local Diagnoses Data</a>
+ <ul>
+
+ <li><a href="PartnersDiagSemantics.html">BWH and MGH Diagnoses</a></li>
+
+ </ul>
+ </li>
+ <li>
+ <a href="Toc252797244.htm">Local Medications Data</a>
+ <ul><li><a href="BidmcMedSemantics.html">BIDMC Medications</a></li>
+
+ <li><a href="PartnersMedSemantics.html">BWH and MGH Medications</a></li>
+
+ <li><a href="ChbMedSemantics.html">CHB Medications</a></li></ul>
+ </li></ul>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+<p>This guide describes the SHRINE Core ontology, including terminology, composition, source systems and maintenance schedules, and data descriptions.</p>
+
+<p>Harvard Catalyst provides a full set of guides to support use of SHRINE:</p>
+
+ <ul>
+ <li>
+ <em><a href="../UG_Help_Files/index.htm" title="SHRINE User Guide">SHRINE User Guide</a></em>
+ &#8211; Use the Query Tool to locate patient populations.
+ </li>
+ <li>
+ <em><a href="../QR_Help_Files/index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></em>
+ &#8211; Construct optimum queries by using the Query Tool.
+ </li>
+ <li>
+ <em><a href="index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></em>
+ &#8211; Understand the terms available for query.
+ </li>
+ </ul>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370633.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370633.htm
index b76829b0a..d1c5d0e80 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370633.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370633.htm
@@ -1,137 +1,137 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm"><strong><em>Query Topics</em></strong></a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm"><strong><em>Data Steward</em></strong></a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
- <h1>
- <a name="_Toc252370633">Query Topics</a>
-
- </h1>
- <p>
- The Data Steward maintains Query Topic requests, which grant users access to the SHRINE query topics. You must have an approved topic to run a query.
- </p>
- <h2>
- <a name="_Toc252370633">Data Steward</a>
- </h2>
- <p>
- The Data Steward approves query topics and regularly reviews use of the Query Tool to ensure that no suspicious or unapproved examination of data is
- performed.
- </p>
- <p>
- You can access the Data Steward directly in a web browser at the following address, and log in by using your eCommons account credentials:
- </p>
- <p>
- <a href="https://shrine.catalyst.harvard.edu/sheriff/logon" target="_blank">https://shrine.catalyst.harvard.edu/sheriff/logon</a>
- </p>
- <p>
- Or, you can access the Data Steward from within the SHRINE Query Tool. Click Request New Topic in the tool view to open the Data Steward in a new window.
- </p>
-
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm"><strong><em>Query Topics</em></strong></a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm"><strong><em>Data Steward</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+ <h1>
+ <a name="_Toc252370633">Query Topics</a>
+
+ </h1>
+ <p>
+ The Data Steward maintains Query Topic requests, which grant users access to the SHRINE query topics. You must have an approved topic to run a query.
+ </p>
+ <h2>
+ <a name="_Toc252370633">Data Steward</a>
+ </h2>
+ <p>
+ The Data Steward approves query topics and regularly reviews use of the Query Tool to ensure that no suspicious or unapproved examination of data is
+ performed.
+ </p>
+ <p>
+ You can access the Data Steward directly in a web browser at the following address, and log in by using your eCommons account credentials:
+ </p>
+ <p>
+ <a href="https://shrine.catalyst.harvard.edu/sheriff/logon" target="_blank">https://shrine.catalyst.harvard.edu/sheriff/logon</a>
+ </p>
+ <p>
+ Or, you can access the Data Steward from within the SHRINE Query Tool. Click Request New Topic in the tool view to open the Data Steward in a new window.
+ </p>
+
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370634.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370634.htm
index 3949b40f9..1a605bdea 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370634.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370634.htm
@@ -1,144 +1,144 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm"><strong><em>Guidelines for Query Topics</em></strong></a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370634">Guidelines for Query Topics</a>
- </h2>
- <p>
- Topics for which you might choose to use the Query Tool include:
- </p>
- <ul>
- <li>
- Generating new research hypotheses
- </li>
- <li>
- Conducting research requiring large sample sizes not easily available at any single institution
- </li>
- <li>
- Preparing grant applications that would benefit from characterization of a potential research cohort
- </li>
- <li>
- Identifying potential cohorts for clinical trials
- </li>
- </ul>
-
- <p>
- Individual queries are subject to review by the Data Steward for appropriate usage. Query histories are logged and audited on a regular
- basis to ensure that there are no violations of the Terms of Access Agreement. If the Data Steward suspects inappropriate use of the Query Tool to
- investigate patient data the steward will suspend the user account under which that use occurred.
- </p>
- <p>
- <strong>Note</strong>: Violation of the Terms of Access Agreement results in a misconduct review by your institution and, if appropriate, by Harvard Medical School.
- </p>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm"><strong><em>Guidelines for Query Topics</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370634">Guidelines for Query Topics</a>
+ </h2>
+ <p>
+ Topics for which you might choose to use the Query Tool include:
+ </p>
+ <ul>
+ <li>
+ Generating new research hypotheses
+ </li>
+ <li>
+ Conducting research requiring large sample sizes not easily available at any single institution
+ </li>
+ <li>
+ Preparing grant applications that would benefit from characterization of a potential research cohort
+ </li>
+ <li>
+ Identifying potential cohorts for clinical trials
+ </li>
+ </ul>
+
+ <p>
+ Individual queries are subject to review by the Data Steward for appropriate usage. Query histories are logged and audited on a regular
+ basis to ensure that there are no violations of the Terms of Access Agreement. If the Data Steward suspects inappropriate use of the Query Tool to
+ investigate patient data the steward will suspend the user account under which that use occurred.
+ </p>
+ <p>
+ <strong>Note</strong>: Violation of the Terms of Access Agreement results in a misconduct review by your institution and, if appropriate, by Harvard Medical School.
+ </p>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370635.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370635.htm
index 9ede471ce..2a982da42 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370635.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370635.htm
@@ -1,142 +1,142 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm"><strong><em>Sample Query Topic</em></strong></a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370635">Sample Query Topic</a>
- </h2>
- <p>
- Following is a sample of how you might describe your query request to the Data Steward:
- </p>
- <blockquote>
- Query Topic: Formulating hypotheses
- <br />
- <br />
- Literature shows that patients diagnosed with inflammatory bowel disease are at higher risk for cancers of the colon. It is unclear why. I would like
- to use the SHRINE system to try to identify characteristics of IBD patients who have a co-morbid diagnosis of colon cancer:
- <br />
- <ul>
- <li>
- Quantify the number of patients in the Boston area with a diagnosis of Inflammatory Bowel Disease and Colon Cancer
- </li>
- <li>
- Identify how many patient were treated at each participating institution
- </li>
- <li>
- Obtain breakdown of patients (by gender) who are treated with 5-ASA&#8217;s, steroids and/or biologics
- </li>
- <li>
- Obtain breakdown of patients who are considered active or in remission for their IBD
- </li>
- </ul>
- </blockquote>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm"><strong><em>Sample Query Topic</em></strong></a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370635">Sample Query Topic</a>
+ </h2>
+ <p>
+ Following is a sample of how you might describe your query request to the Data Steward:
+ </p>
+ <blockquote>
+ Query Topic: Formulating hypotheses
+ <br />
+ <br />
+ Literature shows that patients diagnosed with inflammatory bowel disease are at higher risk for cancers of the colon. It is unclear why. I would like
+ to use the SHRINE system to try to identify characteristics of IBD patients who have a co-morbid diagnosis of colon cancer:
+ <br />
+ <ul>
+ <li>
+ Quantify the number of patients in the Boston area with a diagnosis of Inflammatory Bowel Disease and Colon Cancer
+ </li>
+ <li>
+ Identify how many patient were treated at each participating institution
+ </li>
+ <li>
+ Obtain breakdown of patients (by gender) who are treated with 5-ASA&#8217;s, steroids and/or biologics
+ </li>
+ <li>
+ Obtain breakdown of patients who are considered active or in remission for their IBD
+ </li>
+ </ul>
+ </blockquote>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370637.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370637.htm
index 4a96c61b8..0f83c0ad5 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370637.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370637.htm
@@ -1,185 +1,185 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3"width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm"><strong><em>Query Construction</em></strong></a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm"><strong><em>Tool Logic</em></strong></a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252370637">Query Construction</a>
- </h1>
- <p>
- Two icons at the top-right corner of the Query Tool view provide the following options:
- </p>
- <ul>
- <li>
- Show Options icon &#8211; Click this icon at the top-right corner of the view to Select the Maximum Time to Wait for XML Response (in seconds). This value is the length of time that SHRINE will continue to process a query. <br />
-If a query does not process completely within period, only those results that completed processing within an institution are returned.
-
- </li>
- <li>
- Toggle Zoom icon &#8211; Click the Toggle Zoom icon at the top-right corner of the view to toggle between expanded and compressed view sizes.
- </li>
- </ul>
- <h2>
- <a name="_Toc252370637">Tool Logic</a>
- </h2>
- <p>
- You can add terms within a Group to apply OR logic, and use multiple Groups to define your selection by using AND logic. Tool options function as follows:
- </p>
- <ul>
- <li>
- Query Name &#8211; This field remains blank. You cannot edit this field.
- </li>
- <li>
- Group columns &#8211; Query groups represent a set of patients defined by the terms within the group and any constraints applied to that group.
- Drag terms into one or more Group fields to narrow the patient cohort for which you are querying.
- </li>
- <li>
- Constrain group options &#8211; Define criteria by which you can limit all terms within a group:
- <ul>
- <li>
- Dates &#8211; Set a date range within which the terms associated with patients must fall.
- </li>
- <li>
- Occurs &gt; 0x &#8211; Set the number of occurrences for which patients within the query group must be associated with a term.
- </li>
- <li>
- Exclude &#8211; Exclude all patients that meet the criteria of the query group.
- </li>
- </ul>
- Click the constraint a second time to remove it.
- <br />
- <strong>Note</strong>: Not all terms accept all constraints.
- </li>
- <li>
- Term right-click menu &#8211; Right-click a term to set a specific value by which to query a term, or to delete the term from the query group.
- </li>
- <li>
- Select a Topic pull-down list &#8211; Select the query topic to which this query relates, as approved by the Data Steward.
- </li>
- <li>
- Info button &#8211; View the description of that topic as provided to the Data Steward.
- </li>
- <li>
- Request New Topic button &#8211; Access the Data Steward in a new window.
- </li>
- <li>
- Run Query button &#8211; Start the query process.
- </li>
- <li>
- New Query button &#8211; Clear the Query Tool fields and settings and start a new query.
- </li>
- <li>
- New Group button &#8211; Add additional terms and values to your query if needed.
- </li>
- <li>
- Group page controls &#8211; Navigate to additional groups if you add new groups.
- </li>
- </ul>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3"width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm"><strong><em>Query Construction</em></strong></a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm"><strong><em>Tool Logic</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252370637">Query Construction</a>
+ </h1>
+ <p>
+ Two icons at the top-right corner of the Query Tool view provide the following options:
+ </p>
+ <ul>
+ <li>
+ Show Options icon &#8211; Click this icon at the top-right corner of the view to Select the Maximum Time to Wait for XML Response (in seconds). This value is the length of time that SHRINE will continue to process a query. <br />
+If a query does not process completely within period, only those results that completed processing within an institution are returned.
+
+ </li>
+ <li>
+ Toggle Zoom icon &#8211; Click the Toggle Zoom icon at the top-right corner of the view to toggle between expanded and compressed view sizes.
+ </li>
+ </ul>
+ <h2>
+ <a name="_Toc252370637">Tool Logic</a>
+ </h2>
+ <p>
+ You can add terms within a Group to apply OR logic, and use multiple Groups to define your selection by using AND logic. Tool options function as follows:
+ </p>
+ <ul>
+ <li>
+ Query Name &#8211; This field remains blank. You cannot edit this field.
+ </li>
+ <li>
+ Group columns &#8211; Query groups represent a set of patients defined by the terms within the group and any constraints applied to that group.
+ Drag terms into one or more Group fields to narrow the patient cohort for which you are querying.
+ </li>
+ <li>
+ Constrain group options &#8211; Define criteria by which you can limit all terms within a group:
+ <ul>
+ <li>
+ Dates &#8211; Set a date range within which the terms associated with patients must fall.
+ </li>
+ <li>
+ Occurs &gt; 0x &#8211; Set the number of occurrences for which patients within the query group must be associated with a term.
+ </li>
+ <li>
+ Exclude &#8211; Exclude all patients that meet the criteria of the query group.
+ </li>
+ </ul>
+ Click the constraint a second time to remove it.
+ <br />
+ <strong>Note</strong>: Not all terms accept all constraints.
+ </li>
+ <li>
+ Term right-click menu &#8211; Right-click a term to set a specific value by which to query a term, or to delete the term from the query group.
+ </li>
+ <li>
+ Select a Topic pull-down list &#8211; Select the query topic to which this query relates, as approved by the Data Steward.
+ </li>
+ <li>
+ Info button &#8211; View the description of that topic as provided to the Data Steward.
+ </li>
+ <li>
+ Request New Topic button &#8211; Access the Data Steward in a new window.
+ </li>
+ <li>
+ Run Query button &#8211; Start the query process.
+ </li>
+ <li>
+ New Query button &#8211; Clear the Query Tool fields and settings and start a new query.
+ </li>
+ <li>
+ New Group button &#8211; Add additional terms and values to your query if needed.
+ </li>
+ <li>
+ Group page controls &#8211; Navigate to additional groups if you add new groups.
+ </li>
+ </ul>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370638.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370638.htm
index 8031a0176..252250b1c 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370638.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370638.htm
@@ -1,147 +1,147 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm"><strong><em>Constraints</em></strong></a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370638">Constraints</a>
- </h2>
- <p>
- At the top of each group are three criteria by which you can limit all query terms within that group:
- </p>
- <ul>
- <li>
- Dates &#8211; Set a date range to query terms associated with patients for that period.
- <br/>
- For example, a constraint setting of <em>Diagnosis of Asthma for &lt;date range&gt;</em> returns all patients diagnosed with asthma within the
- specified date range.
- </li>
- <li>
- Occurs &gt; 0x &#8211; Set the number of times that patients must be associated with the query term.
- <br />
- For example, a constraint setting of <em>Diagnosis of Fracture of ankle Occurs &gt; 2x</em> returns all patients diagnosed with a broken an ankle at
- least twice.
- </li>
- <li>
- Exclude &#8211; Exclude patients meeting the specified term or terms.
- <br />
- For example, <em>exclude all patients 35 years old</em> returns all patients who are not 35 years old.
- </li>
- </ul>
-
- <p>
- To remove a constraint, click the constraint again and remove the check box from the value that you set. For an exclusion constraint, simply click
- Exclude again to remove it.
- </p>
- <p>
- <strong>Note</strong>: Not all terms accept all constraints. For example, a demographic gender term of <em>Female</em> does not accept a date range constraint.
- </p>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm"><strong><em>Constraints</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370638">Constraints</a>
+ </h2>
+ <p>
+ At the top of each group are three criteria by which you can limit all query terms within that group:
+ </p>
+ <ul>
+ <li>
+ Dates &#8211; Set a date range to query terms associated with patients for that period.
+ <br/>
+ For example, a constraint setting of <em>Diagnosis of Asthma for &lt;date range&gt;</em> returns all patients diagnosed with asthma within the
+ specified date range.
+ </li>
+ <li>
+ Occurs &gt; 0x &#8211; Set the number of times that patients must be associated with the query term.
+ <br />
+ For example, a constraint setting of <em>Diagnosis of Fracture of ankle Occurs &gt; 2x</em> returns all patients diagnosed with a broken an ankle at
+ least twice.
+ </li>
+ <li>
+ Exclude &#8211; Exclude patients meeting the specified term or terms.
+ <br />
+ For example, <em>exclude all patients 35 years old</em> returns all patients who are not 35 years old.
+ </li>
+ </ul>
+
+ <p>
+ To remove a constraint, click the constraint again and remove the check box from the value that you set. For an exclusion constraint, simply click
+ Exclude again to remove it.
+ </p>
+ <p>
+ <strong>Note</strong>: Not all terms accept all constraints. For example, a demographic gender term of <em>Female</em> does not accept a date range constraint.
+ </p>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370639.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370639.htm
index a0a305b75..4e2f29347 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370639.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370639.htm
@@ -1,130 +1,130 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm"><strong><em>Term Values</em></strong></a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370639">Term Values</a>
- </h2>
- <p>
- To set a specific value by which to query a term, right-click the term in the Query Tool group and select Set Value.
- </p>
- <p>
- The <em>Choose value of &lt;term&gt;</em> dialog box appears. Use this dialog to set specific values by which to query. Value options vary depending on the term
- you selected. Click OK to set the query value, or click Cancel to accept the default value.
- </p>
- <p>
-If you change the units of a term when you set a value, note that SHRINE returns the results in the default units, not the units that you selected for your query value.
- </p>
- <p>
- <strong>Note</strong>: Not every term offers the option to set a value limiter.
- </p>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm"><strong><em>Term Values</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370639">Term Values</a>
+ </h2>
+ <p>
+ To set a specific value by which to query a term, right-click the term in the Query Tool group and select Set Value.
+ </p>
+ <p>
+ The <em>Choose value of &lt;term&gt;</em> dialog box appears. Use this dialog to set specific values by which to query. Value options vary depending on the term
+ you selected. Click OK to set the query value, or click Cancel to accept the default value.
+ </p>
+ <p>
+If you change the units of a term when you set a value, note that SHRINE returns the results in the default units, not the units that you selected for your query value.
+ </p>
+ <p>
+ <strong>Note</strong>: Not every term offers the option to set a value limiter.
+ </p>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370640.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370640.htm
index 88db8a253..5de7ba8c5 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370640.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370640.htm
@@ -1,137 +1,137 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm"><strong><em>Query Optimization</em></strong></a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370640">Query Optimization</a>
- </h2>
- <p>
- Tips for optimizing your query include the following:
- </p>
- <ul>
- <li>
- Select the most-limiting terms first.
- <br/>
- For example, demographic data is broader in scope than diagnoses or lab values. Therefore, if you select your diagnoses or lab value terms first
- and then select your demographic terms, SHRINE returns your query results more quickly.
- </li>
- <li>
- Queries that include lab values require a longer processing time that diagnoses or medications.
- <br />
- Consider including either diagnoses or medication
- terms in your first groups before adding a lab test term to your query.
- </li>
- <li>
-When a term category maps to more than 120 specific terms, there are too many values to process and you cannot use the full category in your query. This is an indication that broader terms and multiple terms process more slowly than narrow or fewer terms. You might consider running multiple queries with simpler criteria in place of one complex query.
- </li>
- </ul>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm"><strong><em>Query Optimization</em></strong></a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370640">Query Optimization</a>
+ </h2>
+ <p>
+ Tips for optimizing your query include the following:
+ </p>
+ <ul>
+ <li>
+ Select the most-limiting terms first.
+ <br/>
+ For example, demographic data is broader in scope than diagnoses or lab values. Therefore, if you select your diagnoses or lab value terms first
+ and then select your demographic terms, SHRINE returns your query results more quickly.
+ </li>
+ <li>
+ Queries that include lab values require a longer processing time that diagnoses or medications.
+ <br />
+ Consider including either diagnoses or medication
+ terms in your first groups before adding a lab test term to your query.
+ </li>
+ <li>
+When a term category maps to more than 120 specific terms, there are too many values to process and you cannot use the full category in your query. This is an indication that broader terms and multiple terms process more slowly than narrow or fewer terms. You might consider running multiple queries with simpler criteria in place of one complex query.
+ </li>
+ </ul>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370641.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370641.htm
index c14315bea..e20bcb61f 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370641.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/Toc252370641.htm
@@ -1,141 +1,141 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm"><strong><em>Results: Query Status View</em></strong></a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
-
- <h1>
- <a name="_Toc252370641">Results: Query Status View</a>
- </h1>
- <p>
- The results of your query appear in the Query Status view. Information provided includes:
- </p>
- <ul>
- <li>
- Query Name
- </li>
- <li>
- Elapsed execution time
- </li>
- <li>
- Aggregated Query Results from participating hospitals
- </li>
- </ul>
- <p>
- If your query returned between zero (0) and 10 patients, your results display as <em>None</em>.
- </p>
- <p>
- The results are time and date stamped.
- </p>
- <p>
- <strong>Note</strong>: When you log out of SHRINE, your results are no longer available.
- </p>
-</td>
-</tr>
-</table>
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm"><strong><em>Results: Query Status View</em></strong></a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+
+ <h1>
+ <a name="_Toc252370641">Results: Query Status View</a>
+ </h1>
+ <p>
+ The results of your query appear in the Query Status view. Information provided includes:
+ </p>
+ <ul>
+ <li>
+ Query Name
+ </li>
+ <li>
+ Elapsed execution time
+ </li>
+ <li>
+ Aggregated Query Results from participating hospitals
+ </li>
+ </ul>
+ <p>
+ If your query returned between zero (0) and 10 patients, your results display as <em>None</em>.
+ </p>
+ <p>
+ The results are time and date stamped.
+ </p>
+ <p>
+ <strong>Note</strong>: When you log out of SHRINE, your results are no longer available.
+ </p>
+</td>
+</tr>
+</table>
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/index.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/index.htm
index 9ea40b9bc..3a0e230e2 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/index.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/QR_Help_Files/index.htm
@@ -1,137 +1,137 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE Query Quick Reference</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE Query Quick Reference
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm"><strong><em>Contents</em></strong></a>
- </p>
-
-
- <p>
- <a href="Toc252370633.htm">Query Topics</a></p>
- <ul>
- <li>
-
- <a href="Toc252370633.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370634.htm">Guidelines for Query Topics</a>
- </li>
- <li>
- <a href="Toc252370635.htm">Sample Query Topic</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370637.htm">Query Construction</a></p>
- <ul>
- <li>
- <a href="Toc252370637.htm">Tool Logic</a>
- </li>
- <li>
- <a href="Toc252370638.htm">Constraints</a>
- </li>
- <li>
- <a href="Toc252370639.htm">Term Values</a>
- </li>
- <li>
- <a href="Toc252370640.htm">Query Optimization</a>
- </li>
- </ul>
-
- <p>
- <a href="Toc252370641.htm">Results: Query Status View</a>
- </p>
-
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <p>
- This guide describes how to use the SHRINE Query Tool menus and options, including the role of the Data Steward, how to optimize query construction,
- and what results mean.
- </p>
- <p>
- Harvard Catalyst provides a full set of guides to support use of SHRINE:
- </p>
- <ul>
- <li>
- <em><a href="../UG_Help_Files/index.htm" title="SHRINE User Guide">SHRINE User Guide</a></em>
- &#8211; Use the Query Tool to locate patient populations.
- </li>
- <li>
- <em><a href="index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></em>
- &#8211; Construct optimum queries by using the Query Tool.
- </li>
- <li>
- <em><a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></em>
- &#8211; Understand the terms available for query.
- </li>
- </ul>
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE Query Quick Reference</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE Query Quick Reference
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm"><strong><em>Contents</em></strong></a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370633.htm">Query Topics</a></p>
+ <ul>
+ <li>
+
+ <a href="Toc252370633.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370634.htm">Guidelines for Query Topics</a>
+ </li>
+ <li>
+ <a href="Toc252370635.htm">Sample Query Topic</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370637.htm">Query Construction</a></p>
+ <ul>
+ <li>
+ <a href="Toc252370637.htm">Tool Logic</a>
+ </li>
+ <li>
+ <a href="Toc252370638.htm">Constraints</a>
+ </li>
+ <li>
+ <a href="Toc252370639.htm">Term Values</a>
+ </li>
+ <li>
+ <a href="Toc252370640.htm">Query Optimization</a>
+ </li>
+ </ul>
+
+ <p>
+ <a href="Toc252370641.htm">Results: Query Status View</a>
+ </p>
+
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <p>
+ This guide describes how to use the SHRINE Query Tool menus and options, including the role of the Data Steward, how to optimize query construction,
+ and what results mean.
+ </p>
+ <p>
+ Harvard Catalyst provides a full set of guides to support use of SHRINE:
+ </p>
+ <ul>
+ <li>
+ <em><a href="../UG_Help_Files/index.htm" title="SHRINE User Guide">SHRINE User Guide</a></em>
+ &#8211; Use the Query Tool to locate patient populations.
+ </li>
+ <li>
+ <em><a href="index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></em>
+ &#8211; Construct optimum queries by using the Query Tool.
+ </li>
+ <li>
+ <em><a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></em>
+ &#8211; Understand the terms available for query.
+ </li>
+ </ul>
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370683.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370683.htm
index 30c2acf3c..2efa42366 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370683.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370683.htm
@@ -1,182 +1,182 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm"><strong><em>Basics</a></em></strong></p>
- <ul><li>
- <a href="Toc252370683.htm"><strong><em>Requirements</em></strong></a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252370683">Basics</a>
- </h1>
- <p>
- This topic describes basic functions and requirements associated with the SHRINE system.
- </p>
- <h2>
- <a name="_Toc252370683">Requirements</a>
- </h2>
- <p>
- You need the following to use SHRINE:
- </p>
- <ul><li>
- Meet the criteria required to register for SHRINE use through your local institution &#8211; You must be a Harvard Medical School faculty member appointed at or above the level of
- Instructor and employed by one of the participating SHRINE hospitals:
- <ul>
- <li>Beth Israel Deaconess Medical Center (BIDMC)</li>
- <li>Brigham and Women's Hospital (BWH)</li>
- <li>Children's Hospital Boston (CHB)</li>
- <li>Massachusetts General Hospital (MGH)</li></ul>
- In this case, <em>employed by</em> means that your
- paycheck is generated by that institution.
- <br/>
- When you satisfy these criteria, your local institution gives you an account with access to the SHRINE system.
- <br />
- If you are an instructor or above at Harvard University who is <em>not</em> employed at a participating hospital but you collaborate with a SHRINE member who is, you may access the data indirectly through that relationship. Your
- collaborator must be in the medical specialty of your interest and only your collaborator may initiate a data query.
- </li>
- <li>
- Confirm your eCommons account &#8211; To log in to the Data Steward component of SHRINE and submit a <em>Query Topic</em> request, you use your eCommons account credentials.
- </li>
- <li>
- Submit a Query Topic for approval &#8211; Before you can query any data, you must describe how you intend to use the system to support your research. For
- example, you might use SHRINE to develop preliminary data for a grant proposal. IRB approval is <em>not</em> required to query data; the Data Steward approves Query
- Topic requests based on ethical validity, not scientific objectives.
- </li>
- <li>
- Verify browser support &#8211; The SHRINE web client is verified to function in the following browsers:
- <ul><li>
- Internet Explorer 6, 7, and 8
- </li>
- <li>
- Mozilla Firefox 3.5.5 and 3.5.6
- </li>
- <li>
- Safari 4
- </li></ul>
- <strong>Note</strong>: JavaScript must be enabled to use SHRINE.
- </li></ul>
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm"><strong><em>Basics</a></em></strong></p>
+ <ul><li>
+ <a href="Toc252370683.htm"><strong><em>Requirements</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252370683">Basics</a>
+ </h1>
+ <p>
+ This topic describes basic functions and requirements associated with the SHRINE system.
+ </p>
+ <h2>
+ <a name="_Toc252370683">Requirements</a>
+ </h2>
+ <p>
+ You need the following to use SHRINE:
+ </p>
+ <ul><li>
+ Meet the criteria required to register for SHRINE use through your local institution &#8211; You must be a Harvard Medical School faculty member appointed at or above the level of
+ Instructor and employed by one of the participating SHRINE hospitals:
+ <ul>
+ <li>Beth Israel Deaconess Medical Center (BIDMC)</li>
+ <li>Brigham and Women's Hospital (BWH)</li>
+ <li>Children's Hospital Boston (CHB)</li>
+ <li>Massachusetts General Hospital (MGH)</li></ul>
+ In this case, <em>employed by</em> means that your
+ paycheck is generated by that institution.
+ <br/>
+ When you satisfy these criteria, your local institution gives you an account with access to the SHRINE system.
+ <br />
+ If you are an instructor or above at Harvard University who is <em>not</em> employed at a participating hospital but you collaborate with a SHRINE member who is, you may access the data indirectly through that relationship. Your
+ collaborator must be in the medical specialty of your interest and only your collaborator may initiate a data query.
+ </li>
+ <li>
+ Confirm your eCommons account &#8211; To log in to the Data Steward component of SHRINE and submit a <em>Query Topic</em> request, you use your eCommons account credentials.
+ </li>
+ <li>
+ Submit a Query Topic for approval &#8211; Before you can query any data, you must describe how you intend to use the system to support your research. For
+ example, you might use SHRINE to develop preliminary data for a grant proposal. IRB approval is <em>not</em> required to query data; the Data Steward approves Query
+ Topic requests based on ethical validity, not scientific objectives.
+ </li>
+ <li>
+ Verify browser support &#8211; The SHRINE web client is verified to function in the following browsers:
+ <ul><li>
+ Internet Explorer 6, 7, and 8
+ </li>
+ <li>
+ Mozilla Firefox 3.5.5 and 3.5.6
+ </li>
+ <li>
+ Safari 4
+ </li></ul>
+ <strong>Note</strong>: JavaScript must be enabled to use SHRINE.
+ </li></ul>
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370684.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370684.htm
index 454c77622..bee2ac91f 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370684.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370684.htm
@@ -1,152 +1,152 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm"><strong><em>Data Steward</em></strong></a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370684">Data Steward</a>
- </h2>
- <p>
- The Data Steward must review and approve your Query Topic requests before you access SHRINE data. In addition, the Data Steward also regularly reviews your use of the
- <em>Query Tool</em> to ensure that no unapproved examination of data is performed. You submit a request that describes your intended use of the
- system. Log back in with the Data Steward to find out when your request is approved.
- </p>
- <p>
- You can access the Data Steward from within the SHRINE Query Tool. Click <em>Request New Topic</em> in the tool view to open the Data Steward in a new window, and log in by using your eCommons account credentials.
- </p>
- <p>Or, access the Data Steward directly in your browser at the following address:</p>
- <p>
- <a href="https://shrine.catalyst.harvard.edu/sheriff/logon" target="_blank">https://shrine.catalyst.harvard.edu/sheriff/logon</a>
- </p>
- <p>
- Individual queries are subject to review by the Data Steward for compliance with approved topics. Query histories are logged and audited on a regular
- basis to ensure that there are no violations of the Terms of Access Agreement that you must accept when you log in to SHRINE. Any inappropriate use of the Query Tool to investigate
- patient data results in immediate suspension of your account, and Notification is sent to your institution regarding possible misconduct.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm"><strong><em>Data Steward</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370684">Data Steward</a>
+ </h2>
+ <p>
+ The Data Steward must review and approve your Query Topic requests before you access SHRINE data. In addition, the Data Steward also regularly reviews your use of the
+ <em>Query Tool</em> to ensure that no unapproved examination of data is performed. You submit a request that describes your intended use of the
+ system. Log back in with the Data Steward to find out when your request is approved.
+ </p>
+ <p>
+ You can access the Data Steward from within the SHRINE Query Tool. Click <em>Request New Topic</em> in the tool view to open the Data Steward in a new window, and log in by using your eCommons account credentials.
+ </p>
+ <p>Or, access the Data Steward directly in your browser at the following address:</p>
+ <p>
+ <a href="https://shrine.catalyst.harvard.edu/sheriff/logon" target="_blank">https://shrine.catalyst.harvard.edu/sheriff/logon</a>
+ </p>
+ <p>
+ Individual queries are subject to review by the Data Steward for compliance with approved topics. Query histories are logged and audited on a regular
+ basis to ensure that there are no violations of the Terms of Access Agreement that you must accept when you log in to SHRINE. Any inappropriate use of the Query Tool to investigate
+ patient data results in immediate suspension of your account, and Notification is sent to your institution regarding possible misconduct.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370685.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370685.htm
index 2003863f6..6e1f8a29b 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370685.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370685.htm
@@ -1,199 +1,199 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm"><strong><em>SHRINE Data</em></strong></a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370685">SHRINE Data</a>
- </h2>
- <p>
- SHRINE currently has a complete set of data for demographics and diagnosis, and partial data sets for medications and laboratory values. The quality
- and completeness reflect what is available based on each institution's electronic medical record system. Queries return aggregate results only.
- </p>
- <p>
- Data begin in January 1, 2001 and are current to the present. SHRINE data are refreshed on a regular basis.
- </p>
- <p>
- <strong>Note</strong>: SHRINE does not provide access to patient records. There are plans to provide access to limited data sets in a future release. There are <em>no</em>
- plans to provide access to full datasets.
- </p>
- <p>
- Available data comprise the following:
- </p>
- <ul><li>
- Demographics &#8211; Patient demographic data available at each participating SHRINE hospital consists of:
- <ul><li>
- Age
- </li>
- <li>
- Gender &#8211; Health Level Seven International (HL7) Administrative Gender
- </li>
- <li>
- Language &#8211; ISO 639-1
- </li>
- <li>
- Marital status &#8211; HL7 Marital Status
- </li>
- <li>
- Race and Ethnicity &#8211; Centers for Disease Control and Prevention (CDC) Race and Ethnicity Code Sets
- </li>
- </ul></li>
- <li>
- Diagnoses &#8211; SHRINE contains inpatient and outpatient diagnosis information from BWH and MGH. Diagnoses are identified by National Center
- for Health Statistics (NCHS) ICD-9-CM standards and Clinical Classification Software (CCS) hierarchy.
- </li>
- <li>
- Lab Tests &#8211; Data on lab tests are identified by Logical Observation Identifiers Names and Codes (LOINC) and Partners HealthCare System's hierarchy.
- <br/>
- You can constrain test terms by high/low flags, or by specific values.
- </li>
- <li>
- Medications &#8211; SHRINE shows a subset of medication data for those practices that record this information. Outpatient medication information
- is limited to observation patients, surgical day patients, and ER patients. Medications are identified by the Unified Medical Language System
- (UMLS) RxNorm (Ingredient) and the Veterans Administration National Drug File Reference Terminology (NDF-RT) hierarchy.
- </li></ul>
- <p>
- Note the following qualifications to data availability:
- </p>
- <ul><li>
- Not all data points are available on all patients.
- </li>
- <li>
- Individual patient records are not available through SHRINE.
- </li>
- <li>
- Limited data sets, consisting of personal health information that excludes 16 HIPAA-defined attributes that could identify the patient, are planned for a future release.
- </li</ul>
- <p>
- See the <a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide"><em>Data Reference Guide</em></a> for a detailed description of the data available to query by using SHRINE.
- </p>
-
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm"><strong><em>SHRINE Data</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370685">SHRINE Data</a>
+ </h2>
+ <p>
+ SHRINE currently has a complete set of data for demographics and diagnosis, and partial data sets for medications and laboratory values. The quality
+ and completeness reflect what is available based on each institution's electronic medical record system. Queries return aggregate results only.
+ </p>
+ <p>
+ Data begin in January 1, 2001 and are current to the present. SHRINE data are refreshed on a regular basis.
+ </p>
+ <p>
+ <strong>Note</strong>: SHRINE does not provide access to patient records. There are plans to provide access to limited data sets in a future release. There are <em>no</em>
+ plans to provide access to full datasets.
+ </p>
+ <p>
+ Available data comprise the following:
+ </p>
+ <ul><li>
+ Demographics &#8211; Patient demographic data available at each participating SHRINE hospital consists of:
+ <ul><li>
+ Age
+ </li>
+ <li>
+ Gender &#8211; Health Level Seven International (HL7) Administrative Gender
+ </li>
+ <li>
+ Language &#8211; ISO 639-1
+ </li>
+ <li>
+ Marital status &#8211; HL7 Marital Status
+ </li>
+ <li>
+ Race and Ethnicity &#8211; Centers for Disease Control and Prevention (CDC) Race and Ethnicity Code Sets
+ </li>
+ </ul></li>
+ <li>
+ Diagnoses &#8211; SHRINE contains inpatient and outpatient diagnosis information from BWH and MGH. Diagnoses are identified by National Center
+ for Health Statistics (NCHS) ICD-9-CM standards and Clinical Classification Software (CCS) hierarchy.
+ </li>
+ <li>
+ Lab Tests &#8211; Data on lab tests are identified by Logical Observation Identifiers Names and Codes (LOINC) and Partners HealthCare System's hierarchy.
+ <br/>
+ You can constrain test terms by high/low flags, or by specific values.
+ </li>
+ <li>
+ Medications &#8211; SHRINE shows a subset of medication data for those practices that record this information. Outpatient medication information
+ is limited to observation patients, surgical day patients, and ER patients. Medications are identified by the Unified Medical Language System
+ (UMLS) RxNorm (Ingredient) and the Veterans Administration National Drug File Reference Terminology (NDF-RT) hierarchy.
+ </li></ul>
+ <p>
+ Note the following qualifications to data availability:
+ </p>
+ <ul><li>
+ Not all data points are available on all patients.
+ </li>
+ <li>
+ Individual patient records are not available through SHRINE.
+ </li>
+ <li>
+ Limited data sets, consisting of personal health information that excludes 16 HIPAA-defined attributes that could identify the patient, are planned for a future release.
+ </li</ul>
+ <p>
+ See the <a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide"><em>Data Reference Guide</em></a> for a detailed description of the data available to query by using SHRINE.
+ </p>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370686.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370686.htm
index 06bdd8b1e..ac04a9e17 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370686.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370686.htm
@@ -1,154 +1,154 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm"><strong><em>Results</em></strong></a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370686">Results</a>
- </h2>
- <p>
- To protect patient privacy, data are de-identified before incorporation into the Core ontology. In addition, we blur the aggregate patient counts
- returned as query results so that they are an estimate of the actual number. For information about the technology used to implement this additional obfuscation,
- refer to the following paper:
- </p>
- <blockquote>
- Murphy SN, Chueh HC. A Security Architecture for Query Tools used to Access Large Biomedical Databases. Proceedings of the 2002, AMIA Annual Symposium.
- 2002 Nov 9-13, San Antonio, TX p. 552-6.
- </blockquote>
- <p>
- If you run the same query more than one time, you receive slightly different results each time. SHRINE is designed to lock out users who receive the
- same query results seven times.
- </p>
- <p>
- When you log out of SHRINE, your results no longer are available.
- </p>
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm"><strong><em>Results</em></strong></a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370686">Results</a>
+ </h2>
+ <p>
+ To protect patient privacy, data are de-identified before incorporation into the Core ontology. In addition, we blur the aggregate patient counts
+ returned as query results so that they are an estimate of the actual number. For information about the technology used to implement this additional obfuscation,
+ refer to the following paper:
+ </p>
+ <blockquote>
+ Murphy SN, Chueh HC. A Security Architecture for Query Tools used to Access Large Biomedical Databases. Proceedings of the 2002, AMIA Annual Symposium.
+ 2002 Nov 9-13, San Antonio, TX p. 552-6.
+ </blockquote>
+ <p>
+ If you run the same query more than one time, you receive slightly different results each time. SHRINE is designed to lock out users who receive the
+ same query results seven times.
+ </p>
+ <p>
+ When you log out of SHRINE, your results no longer are available.
+ </p>
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370688.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370688.htm
index 3dabe08b3..4c1fcc6cd 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370688.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370688.htm
@@ -1,183 +1,183 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm"><strong><em>Menus and Options</em></strong></a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm"><strong><em>Main Menu and Options</em></strong></a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252370688">Menus and Options</a>
- </h1>
- <p>
- SHRINE menus and options are described in this section.
- </p>
- <h2>
- <a name="_Toc252370688">Main Menu and Options</a>
- </h2>
- <p>
- The main SHRINE menu is located in the top-right corner of the web browser window. Options include:
- </p>
- <ul><li>
- Find Patients &#8211; The main page, on which you locate patient terms (characteristics), construct queries, and view query status.
- </li>
- <li>
- Message Log &#8211; A development tool used by technical staff to track system functions.
- </li>
- <li>
- Help &#8211; A link to the SHRINE Help home page, from which you can access all guides. Also use this
- option if you need to contact us.
- </li>
- <li>
- Logout &#8211; Exit SHRINE.
- </li>
- </ul>
- <p>
- In addition, two icons at the top-right corner of the Terms and Query Tool views offer options specific to those views:
- </p>
- <ul><li>
- Show Options icon &#8211; Click this icon at the top-right corner of the view to select from the following:
- <ul><li>
- Terms view options &#8211;
- <ul><li>
- Maximum Number of Children to Display &#8211; Default is 200
- </li>
- <li>
- Show Hidden Terms &#8211; Check box to include hidden terms
- </li>
- <li>
- Show Synonymous Terms &#8211; Check box to include terms that are synonymous
- </li></ul></li>
- <li>
- Query Tool view option &#8211; Select the Maximum Time to Wait for XML Response (in seconds). This is the length of time the system will wait for query results. <br />
-If your query does not process completely within this length of time, it returns only those results that completed processing within an institution. If no institution’s data completed processing, the query does not return any results.
- </li></ul></li>
- <li>
- Toggle Zoom icon &#8211; Click the Toggle Zoom icon at the top-right corner of the view to toggle between expanded and compressed view sizes.
- </li></ul>
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm"><strong><em>Menus and Options</em></strong></a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm"><strong><em>Main Menu and Options</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252370688">Menus and Options</a>
+ </h1>
+ <p>
+ SHRINE menus and options are described in this section.
+ </p>
+ <h2>
+ <a name="_Toc252370688">Main Menu and Options</a>
+ </h2>
+ <p>
+ The main SHRINE menu is located in the top-right corner of the web browser window. Options include:
+ </p>
+ <ul><li>
+ Find Patients &#8211; The main page, on which you locate patient terms (characteristics), construct queries, and view query status.
+ </li>
+ <li>
+ Message Log &#8211; A development tool used by technical staff to track system functions.
+ </li>
+ <li>
+ Help &#8211; A link to the SHRINE Help home page, from which you can access all guides. Also use this
+ option if you need to contact us.
+ </li>
+ <li>
+ Logout &#8211; Exit SHRINE.
+ </li>
+ </ul>
+ <p>
+ In addition, two icons at the top-right corner of the Terms and Query Tool views offer options specific to those views:
+ </p>
+ <ul><li>
+ Show Options icon &#8211; Click this icon at the top-right corner of the view to select from the following:
+ <ul><li>
+ Terms view options &#8211;
+ <ul><li>
+ Maximum Number of Children to Display &#8211; Default is 200
+ </li>
+ <li>
+ Show Hidden Terms &#8211; Check box to include hidden terms
+ </li>
+ <li>
+ Show Synonymous Terms &#8211; Check box to include terms that are synonymous
+ </li></ul></li>
+ <li>
+ Query Tool view option &#8211; Select the Maximum Time to Wait for XML Response (in seconds). This is the length of time the system will wait for query results. <br />
+If your query does not process completely within this length of time, it returns only those results that completed processing within an institution. If no institution’s data completed processing, the query does not return any results.
+ </li></ul></li>
+ <li>
+ Toggle Zoom icon &#8211; Click the Toggle Zoom icon at the top-right corner of the view to toggle between expanded and compressed view sizes.
+ </li></ul>
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370689.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370689.htm
index fd4ec5b6a..4b4ad7fa2 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370689.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370689.htm
@@ -1,233 +1,233 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm"><strong><em>Terms View</em></strong></a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370689">Terms View</a>
- </h2>
- <p>
- Use the patient Terms view, on the left side of the SHRINE window, to navigate (browse) or find (search) the medical terms on which you choose to
- query. The full range of terms available for you to query is listed in this view, grouped into four main criteria:
- </p>
- <ul>
- <li>
- Demographics
- </li>
- <li>
- Diagnoses
- </li>
- <li>
- Lab Tests
- </li>
- <li>
- Medications
- </li>
- </ul>
- <p>
- Each of the main criteria contains multiple categories that are displayed in subfolders, which contain more-specific terms by which you can refine your
- query. As you navigate through the subfolders and locate a term or category that you choose to include in your query, drag that entry to the Query Tool
- and drop it in a Group column to add it to your query criteria. You can select term folders, subfolders, or discrete terms to add to your query.
- </p>
-
- <p>
-If a term category maps to more than 120 specific terms, you cannot use that category in the Query Tool. You must expand it and select a more specific term to use. This is an indication that the query would take too long to process.
- </p>
- <p>
-
- Fields and functions in the Terms view include:
- </p>
- <ul><li>
- Navigate Terms tab &#8211; Default tab of the Terms view. Use the Expand (+) and Compress (-) buttons to browse through available
- characteristics on which to query.
- </li>
- <li>
- Find Terms tab &#8211; To search for specific characteristics on which to query, click the Find Terms tab on the Terms view. You can search by
- using the following criteria:
- <ul><li>
- Search by Name &#8211; This is the default tab of the Find Terms view.
- <br />
- To search by Name:
- <ol><li>
- Click the top pull-down list to select the logical search operator. Options include Contains, Exact, Left (starts with), or Right (ends with).
- </li>
- <li>
- Enter your search string in the text field beside the operator pull-down list.
- </li>
- <li>
- Click the Category pull-down list to select which category of data and select the SHRINE option.
- </li>
- <li>
- Click Find.
- </li></ol></li>
- <li>
- Search by Codes &#8211; Click this tab to search criteria for specific coding system terms.
- <br />
- To search by Code:
- <ol><li>
- Use the Select a Coding System pull-down list to select the specific code type for which you choose to search.
- </li>
- <li>
- Enter the term in the text field above the list.
- </li>
- <li>
- Click Find.
- </li></ol>
- Coding systems on which you can search include:
- <ul>
- <li>
- Demographics (Marital)
- </li>
- <li>
- Demographics (Sex)
- </li>
- <li>
- Demographics (Language)
- </li>
- <li>
- Demographics (Age)
- </li>
- <li>
- Demographics (Race)
- </li>
- <li>
- Lab Tests
- </li>
- <li>
- Diagnoses (ICD9)
- </li>
- <li>
- Medications (RxNorm)
- </li></ul>
- </li></ul>
- </li></ul>
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm"><strong><em>Terms View</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370689">Terms View</a>
+ </h2>
+ <p>
+ Use the patient Terms view, on the left side of the SHRINE window, to navigate (browse) or find (search) the medical terms on which you choose to
+ query. The full range of terms available for you to query is listed in this view, grouped into four main criteria:
+ </p>
+ <ul>
+ <li>
+ Demographics
+ </li>
+ <li>
+ Diagnoses
+ </li>
+ <li>
+ Lab Tests
+ </li>
+ <li>
+ Medications
+ </li>
+ </ul>
+ <p>
+ Each of the main criteria contains multiple categories that are displayed in subfolders, which contain more-specific terms by which you can refine your
+ query. As you navigate through the subfolders and locate a term or category that you choose to include in your query, drag that entry to the Query Tool
+ and drop it in a Group column to add it to your query criteria. You can select term folders, subfolders, or discrete terms to add to your query.
+ </p>
+
+ <p>
+If a term category maps to more than 120 specific terms, you cannot use that category in the Query Tool. You must expand it and select a more specific term to use. This is an indication that the query would take too long to process.
+ </p>
+ <p>
+
+ Fields and functions in the Terms view include:
+ </p>
+ <ul><li>
+ Navigate Terms tab &#8211; Default tab of the Terms view. Use the Expand (+) and Compress (-) buttons to browse through available
+ characteristics on which to query.
+ </li>
+ <li>
+ Find Terms tab &#8211; To search for specific characteristics on which to query, click the Find Terms tab on the Terms view. You can search by
+ using the following criteria:
+ <ul><li>
+ Search by Name &#8211; This is the default tab of the Find Terms view.
+ <br />
+ To search by Name:
+ <ol><li>
+ Click the top pull-down list to select the logical search operator. Options include Contains, Exact, Left (starts with), or Right (ends with).
+ </li>
+ <li>
+ Enter your search string in the text field beside the operator pull-down list.
+ </li>
+ <li>
+ Click the Category pull-down list to select which category of data and select the SHRINE option.
+ </li>
+ <li>
+ Click Find.
+ </li></ol></li>
+ <li>
+ Search by Codes &#8211; Click this tab to search criteria for specific coding system terms.
+ <br />
+ To search by Code:
+ <ol><li>
+ Use the Select a Coding System pull-down list to select the specific code type for which you choose to search.
+ </li>
+ <li>
+ Enter the term in the text field above the list.
+ </li>
+ <li>
+ Click Find.
+ </li></ol>
+ Coding systems on which you can search include:
+ <ul>
+ <li>
+ Demographics (Marital)
+ </li>
+ <li>
+ Demographics (Sex)
+ </li>
+ <li>
+ Demographics (Language)
+ </li>
+ <li>
+ Demographics (Age)
+ </li>
+ <li>
+ Demographics (Race)
+ </li>
+ <li>
+ Lab Tests
+ </li>
+ <li>
+ Diagnoses (ICD9)
+ </li>
+ <li>
+ Medications (RxNorm)
+ </li></ul>
+ </li></ul>
+ </li></ul>
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370690.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370690.htm
index a95bdd969..36b5f1139 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370690.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370690.htm
@@ -1,199 +1,199 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm"><strong><em>Query Tool View</em></strong></a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370690">Query Tool View</a>
- </h2>
- <p>
- The Query Tool enables you to create complicated queries by using a simple user interface.
- </p>
- <p>
- <strong>Note</strong>: You cannot run a query until you select a topic. If you do not have an approved Query Topic, you must request a new topic approval from the Data
- Steward.
- </p>
- <p>
- Construct your query by using these fields and functions:
- <ul>
- <li>
- Query Name &#8211; When you click Run Query, SHRINE prompts you to enter a name for that query instance before you can run the process. The
- default name is a string constructed from your term selections and the time at which you run the query.
- <br />
- You cannot type a query name directly into this field.
- </li>
- <li>
- Group columns &#8211; Query groups represent a set of patients defined by the terms within the group and any constraints applied to that group.
- <br />
- Terms within a group operate as <em>OR</em> logic, while terms between groups operate as <em>AND</em> logic. For example, from the Terms view drag
- demographic terms of <em>35 years old</em> and <em>36 years old</em> to one group to select patients either 35 or 36 years old. Or drag a diagnosis
- term of <em>Asthma</em> to one group, a demographic age term of <em>35 years old</em> to a second group, and a demographic gender term of <em>Male</em>
- to a third group to select patients diagnosed with asthma who are 35-year old males.
- <br />
- When a group contains multiple terms, the query first runs with a single term from each group, and then runs with any additional terms. For example, if
- you drag a diagnosis of <em>Asthma</em> to Group 1 and then drag demographic terms of <em>10-17 years old</em> and <em>0-9 years old</em> to Group 2,
- the query first processes diagnosis of asthma and demographics of 10-17 years old. Another query process runs diagnosis of asthma and demographics of
- 0-9 years old. The two results sets then are added together to return the final query results.
- </li>
- <li>
- Select a Topic pull-down list &#8211; Before you can run a query, you must select the Query Topic to which this query relates. The Topics list contains
- all your Data Steward-approved topics.
- <br />
- The Data Steward monitors query activities. If you select query terms that do not apply logically to your topic, the steward can suspend your access to
- SHRINE, and a review of your activities is required.
- </li>
- <li>
- Info button &#8211; When a Query Topic is selected, click Info to view the description of that topic as it was provided to the Data Steward.
- </li>
- <li>
- Request New Topic button &#8211; Access the Data Steward from the SHRINE system by clicking this button. The Data Steward opens in a new window.
- <br />
- <strong>Note</strong>: To run a query that does not conform to any of your approved Topics, you must request a new topic from the Data Steward and receive approval before
- you can perform the query.
- </li>
- <li>
- Run Query button &#8211; When you complete construction of your query using the terms, constraints, and options available, click Run Query to
- start the query process.
- <br />
- You can run additional queries by retaining the existing terms in the Query Tool fields, and then adding new criteria to the query. Be careful not to
- run the same query multiple times.
- </li>
- <li>
- New Query button &#8211; Click this button to clear all Query Tool fields and start a new query.
- </li>
- <li>
- New Group button &#8211; To add additional groups of terms to your query, click this button.
- </li>
- <li>
- Group page controls &#8211; If you add groups to the default of three, you can navigate to additional groups by using these page controls.
- </li></ul>
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm"><strong><em>Query Tool View</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370690">Query Tool View</a>
+ </h2>
+ <p>
+ The Query Tool enables you to create complicated queries by using a simple user interface.
+ </p>
+ <p>
+ <strong>Note</strong>: You cannot run a query until you select a topic. If you do not have an approved Query Topic, you must request a new topic approval from the Data
+ Steward.
+ </p>
+ <p>
+ Construct your query by using these fields and functions:
+ <ul>
+ <li>
+ Query Name &#8211; When you click Run Query, SHRINE prompts you to enter a name for that query instance before you can run the process. The
+ default name is a string constructed from your term selections and the time at which you run the query.
+ <br />
+ You cannot type a query name directly into this field.
+ </li>
+ <li>
+ Group columns &#8211; Query groups represent a set of patients defined by the terms within the group and any constraints applied to that group.
+ <br />
+ Terms within a group operate as <em>OR</em> logic, while terms between groups operate as <em>AND</em> logic. For example, from the Terms view drag
+ demographic terms of <em>35 years old</em> and <em>36 years old</em> to one group to select patients either 35 or 36 years old. Or drag a diagnosis
+ term of <em>Asthma</em> to one group, a demographic age term of <em>35 years old</em> to a second group, and a demographic gender term of <em>Male</em>
+ to a third group to select patients diagnosed with asthma who are 35-year old males.
+ <br />
+ When a group contains multiple terms, the query first runs with a single term from each group, and then runs with any additional terms. For example, if
+ you drag a diagnosis of <em>Asthma</em> to Group 1 and then drag demographic terms of <em>10-17 years old</em> and <em>0-9 years old</em> to Group 2,
+ the query first processes diagnosis of asthma and demographics of 10-17 years old. Another query process runs diagnosis of asthma and demographics of
+ 0-9 years old. The two results sets then are added together to return the final query results.
+ </li>
+ <li>
+ Select a Topic pull-down list &#8211; Before you can run a query, you must select the Query Topic to which this query relates. The Topics list contains
+ all your Data Steward-approved topics.
+ <br />
+ The Data Steward monitors query activities. If you select query terms that do not apply logically to your topic, the steward can suspend your access to
+ SHRINE, and a review of your activities is required.
+ </li>
+ <li>
+ Info button &#8211; When a Query Topic is selected, click Info to view the description of that topic as it was provided to the Data Steward.
+ </li>
+ <li>
+ Request New Topic button &#8211; Access the Data Steward from the SHRINE system by clicking this button. The Data Steward opens in a new window.
+ <br />
+ <strong>Note</strong>: To run a query that does not conform to any of your approved Topics, you must request a new topic from the Data Steward and receive approval before
+ you can perform the query.
+ </li>
+ <li>
+ Run Query button &#8211; When you complete construction of your query using the terms, constraints, and options available, click Run Query to
+ start the query process.
+ <br />
+ You can run additional queries by retaining the existing terms in the Query Tool fields, and then adding new criteria to the query. Be careful not to
+ run the same query multiple times.
+ </li>
+ <li>
+ New Query button &#8211; Click this button to clear all Query Tool fields and start a new query.
+ </li>
+ <li>
+ New Group button &#8211; To add additional groups of terms to your query, click this button.
+ </li>
+ <li>
+ Group page controls &#8211; If you add groups to the default of three, you can navigate to additional groups by using these page controls.
+ </li></ul>
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370691.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370691.htm
index 0f5f3d957..04d94921e 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370691.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370691.htm
@@ -1,157 +1,157 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm"><strong><em>Query Status View</em></strong></a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370691">Query Status View</a>
- </h2>
- <p>
- The results of your query appear in the Query Status view. Information provided includes:
- </p>
- <ul>
- <li>
- Query name
- </li>
- <li>
- Elapsed execution time
- </li>
- <li>
- Aggregated query results from participating hospitals
- </li>
- </ul>
- <p>
- The results are time and date stamped.
- </p>
- <p>
- <strong>Note</strong>: When you log out of SHRINE, your results no longer are available.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm"><strong><em>Query Status View</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370691">Query Status View</a>
+ </h2>
+ <p>
+ The results of your query appear in the Query Status view. Information provided includes:
+ </p>
+ <ul>
+ <li>
+ Query name
+ </li>
+ <li>
+ Elapsed execution time
+ </li>
+ <li>
+ Aggregated query results from participating hospitals
+ </li>
+ </ul>
+ <p>
+ The results are time and date stamped.
+ </p>
+ <p>
+ <strong>Note</strong>: When you log out of SHRINE, your results no longer are available.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370692.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370692.htm
index 85ec228b3..17dc6efdb 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370692.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370692.htm
@@ -1,140 +1,140 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm"><strong><em>Previous Queries View</em></strong></a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370692">Previous Queries View</a>
- </h2>
- <p>
- This view is not functional in the initial release of SHRINE. This view is scheduled for implementation in the SHRINE 1.8 release.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm"><strong><em>Previous Queries View</em></strong></a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370692">Previous Queries View</a>
+ </h2>
+ <p>
+ This view is not functional in the initial release of SHRINE. This view is scheduled for implementation in the SHRINE 1.8 release.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370694.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370694.htm
index 609bd533a..1950e96e3 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370694.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370694.htm
@@ -1,167 +1,167 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm"><strong><em>Accessing SHRINE</em></strong></a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm"><strong><em>Registering</em></strong></a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252370694">Accessing SHRINE</a>
- </h1>
- <p>
- To access SHRINE, you must complete the required registration and authentication process at your local institution.
- </p>
- <h2>
- <a name="_Toc252370694">Registering at Your Local Institution</a>
- </h2>
-
-
- <p>
- To register for use of the SHRINE Beta release:
- </p>
-
- <ul>
- <li>BIDMC &#8211; Go to your institution's registration page to start the process:<br />
- <a href="https://bric.bidmc.harvard.edu/shrine" title="BIDMC SHRINE Registration" target="_blank">https://bric.bidmc.harvard.edu/shrine</a>
- </li>
- <li>CHB &#8211; Go to your institution's registration page to start the process:<br />
- <a href="https://i2b2msprod.tch.harvard.edu:7443/i2b2_shrine_user_reg/" title="CHB SHRINE Registration" target="_blank">https://i2b2msprod.tch.harvard.edu:7443/i2b2_shrine_user_reg/</a>
- </li>
- <li>BWH and MGH &#8211; Contact Shawn N. Murphy (snmurphy@partners.org) for more information.
- </li>
- </ul>
-
- <p>
- <strong>Note</strong>: You must be behind your hospital's firewall to access SHRINE.
- </p>
- <p>
- Complete the registration process as identified by your institution. This process might take a few minutes or a few days,
- depending on the specific verification process. After you are registered, you use the account credentials provided to access SHRINE.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm"><strong><em>Accessing SHRINE</em></strong></a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm"><strong><em>Registering</em></strong></a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252370694">Accessing SHRINE</a>
+ </h1>
+ <p>
+ To access SHRINE, you must complete the required registration and authentication process at your local institution.
+ </p>
+ <h2>
+ <a name="_Toc252370694">Registering at Your Local Institution</a>
+ </h2>
+
+
+ <p>
+ To register for use of the SHRINE Beta release:
+ </p>
+
+ <ul>
+ <li>BIDMC &#8211; Go to your institution's registration page to start the process:<br />
+ <a href="https://bric.bidmc.harvard.edu/shrine" title="BIDMC SHRINE Registration" target="_blank">https://bric.bidmc.harvard.edu/shrine</a>
+ </li>
+ <li>CHB &#8211; Go to your institution's registration page to start the process:<br />
+ <a href="https://i2b2msprod.tch.harvard.edu:7443/i2b2_shrine_user_reg/" title="CHB SHRINE Registration" target="_blank">https://i2b2msprod.tch.harvard.edu:7443/i2b2_shrine_user_reg/</a>
+ </li>
+ <li>BWH and MGH &#8211; Contact Shawn N. Murphy (snmurphy@partners.org) for more information.
+ </li>
+ </ul>
+
+ <p>
+ <strong>Note</strong>: You must be behind your hospital's firewall to access SHRINE.
+ </p>
+ <p>
+ Complete the registration process as identified by your institution. This process might take a few minutes or a few days,
+ depending on the specific verification process. After you are registered, you use the account credentials provided to access SHRINE.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370695.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370695.htm
index 143b516ca..4d60abfd3 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370695.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370695.htm
@@ -1,164 +1,164 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm"><strong><em>Logging In to SHRINE</em></strong></a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h2>
- <a name="_Toc252370695">Logging In to SHRINE</a>
- </h2>
- <p>
- After your registration status is approved at your local institution, access the SHRINE Query Tool using the address, username, and password provided to you.
- </p>
- <ol><li>
- Point your browser to the address identified when you registered for SHRINE.<br />
- <strong>Note</strong>: You must be behind your hospital's firewall to view the login page.
- </li>
- <li>
- Enter your username and password.
- </li>
- <li>
- Use the SHRINE Host pull-down list to select the version of SHRINE available at your institution.
- </li>
- <li>
- Click Login.
- <br />
- You see a Terms of Access Agreement that you must review and accept before you can use the Query Tool.
- </li>
- <li>
- To use the SHRINE system, click <em>Yes, I agree</em>.
- <br />
- You see the SHRINE system in your browser window.
- </li></ol>
- <p>
- Continue to <a href="Toc252370696.htm">Submitting a Query Topic Request</a> to find out how to access the SHRINE Query Tool.
- </p>
-
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm"><strong><em>Logging In to SHRINE</em></strong></a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h2>
+ <a name="_Toc252370695">Logging In to SHRINE</a>
+ </h2>
+ <p>
+ After your registration status is approved at your local institution, access the SHRINE Query Tool using the address, username, and password provided to you.
+ </p>
+ <ol><li>
+ Point your browser to the address identified when you registered for SHRINE.<br />
+ <strong>Note</strong>: You must be behind your hospital's firewall to view the login page.
+ </li>
+ <li>
+ Enter your username and password.
+ </li>
+ <li>
+ Use the SHRINE Host pull-down list to select the version of SHRINE available at your institution.
+ </li>
+ <li>
+ Click Login.
+ <br />
+ You see a Terms of Access Agreement that you must review and accept before you can use the Query Tool.
+ </li>
+ <li>
+ To use the SHRINE system, click <em>Yes, I agree</em>.
+ <br />
+ You see the SHRINE system in your browser window.
+ </li></ol>
+ <p>
+ Continue to <a href="Toc252370696.htm">Submitting a Query Topic Request</a> to find out how to access the SHRINE Query Tool.
+ </p>
+
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370696.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370696.htm
index a5567caf1..c6b667f5c 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370696.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370696.htm
@@ -1,194 +1,194 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm"><strong><em>Submitting a Query Topic Request</em></strong></a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
-
- <h1>
- <a name="_Toc252370696">
- Submitting a Query Topic Request</a>
- </h1>
- <p>
- Before you can construct a query to determine patient populations, you must submit a request to the Data Steward and define a specific topic for which
- you choose to query patient data. The Data Steward approves all topics, and monitors query activities for all topics to ensure that no inappropriate
- use of patient data occurs.
- </p>
- <p>
- You can request multiple Query Topics to support different selection criteria of patient cohorts.
- </p>
- <p>
- To submit a Query Topic request:
- </p>
- <ol><li>
- In a browser window, go to the Data Steward home page:
- <br />
- <a href="https://shrine.catalyst.harvard.edu/sheriff/logon" target="_blank">https://shrine.catalyst.harvard.edu/sheriff/logon</a>
- <br />
- The SHRINE Data Steward window opens.
- <br />
- Note that you also can access the Data Steward from the SHRINE system. In the Query Tool pane, click Request New Topic at the bottom-left of the tool.
- </li>
- <li>
- In the Data Steward window, complete the following information:
- <ul>
- <li>
- Enter a Query Name for your topic.
- </li>
- <li>
- In the Query Intent field, describe the research topic for which you choose to explore potential cohorts.
- </li>
- <li>
- Use the Reason for Query pull-down list to select the reason for which you choose to explore this specific topic. If you select a Reason of
- Other, add an explanation for your reason in the text field below the pull-down.
- </li>
- <li>
- If you are collaborating with a non-SHRINE associate, use the associated pull-down list and select Yes. Then add an explanation in the text
- field below that pull-down.<br />
- <strong>Note</strong>: Collaborations with individuals or entities outside of the participating SHRINE institutions, including academia and industry, currently are prohibited.
- </li>
- </ul>
- </li>
- <li>
- Click Submit.
- <br/>
- The Data Steward will review your Query Topic to determine if it constitutes appropriate use of SHRINE data. If more information is needed, the Data
- Steward will contact you. We try to process all requests within 48 hours.
- <br/>
- You can check the Data Steward to view the status of your request as listed in the Active Requests field at the bottom of the window. When your request
- is approved, you now have access to SHRINE data.
- </li>
- <li>
- Click Logout to exit the Data Steward.
- </li></ol>
- <p>
- Continue to <a href="Toc252370697.htm">Constructing a Query</a>.
- </p>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm"><strong><em>Submitting a Query Topic Request</em></strong></a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+
+ <h1>
+ <a name="_Toc252370696">
+ Submitting a Query Topic Request</a>
+ </h1>
+ <p>
+ Before you can construct a query to determine patient populations, you must submit a request to the Data Steward and define a specific topic for which
+ you choose to query patient data. The Data Steward approves all topics, and monitors query activities for all topics to ensure that no inappropriate
+ use of patient data occurs.
+ </p>
+ <p>
+ You can request multiple Query Topics to support different selection criteria of patient cohorts.
+ </p>
+ <p>
+ To submit a Query Topic request:
+ </p>
+ <ol><li>
+ In a browser window, go to the Data Steward home page:
+ <br />
+ <a href="https://shrine.catalyst.harvard.edu/sheriff/logon" target="_blank">https://shrine.catalyst.harvard.edu/sheriff/logon</a>
+ <br />
+ The SHRINE Data Steward window opens.
+ <br />
+ Note that you also can access the Data Steward from the SHRINE system. In the Query Tool pane, click Request New Topic at the bottom-left of the tool.
+ </li>
+ <li>
+ In the Data Steward window, complete the following information:
+ <ul>
+ <li>
+ Enter a Query Name for your topic.
+ </li>
+ <li>
+ In the Query Intent field, describe the research topic for which you choose to explore potential cohorts.
+ </li>
+ <li>
+ Use the Reason for Query pull-down list to select the reason for which you choose to explore this specific topic. If you select a Reason of
+ Other, add an explanation for your reason in the text field below the pull-down.
+ </li>
+ <li>
+ If you are collaborating with a non-SHRINE associate, use the associated pull-down list and select Yes. Then add an explanation in the text
+ field below that pull-down.<br />
+ <strong>Note</strong>: Collaborations with individuals or entities outside of the participating SHRINE institutions, including academia and industry, currently are prohibited.
+ </li>
+ </ul>
+ </li>
+ <li>
+ Click Submit.
+ <br/>
+ The Data Steward will review your Query Topic to determine if it constitutes appropriate use of SHRINE data. If more information is needed, the Data
+ Steward will contact you. We try to process all requests within 48 hours.
+ <br/>
+ You can check the Data Steward to view the status of your request as listed in the Active Requests field at the bottom of the window. When your request
+ is approved, you now have access to SHRINE data.
+ </li>
+ <li>
+ Click Logout to exit the Data Steward.
+ </li></ol>
+ <p>
+ Continue to <a href="Toc252370697.htm">Constructing a Query</a>.
+ </p>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370697.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370697.htm
index 548e24154..baf472765 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370697.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370697.htm
@@ -1,232 +1,232 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm"><strong><em>Constructing a Query</em></strong></a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252370697">
- Constructing a Query</a>
- </h1>
- <p>
- SHRINE enables you to explore your topic in whatever depth is available currently, as long as your individual queries are related to your general Query
- Topic.
- </p>
- <p>
- To query SHRINE data:
- </p>
- <ol><li>
- Point your browser to the address identified when you registered for SHRINE, and log in by using your institution account credentials.<br />
- <strong>Note</strong>: You must be behind your hospital's firewall to view the login page.<br />
- When you are logged in to SHRINE, you see the SHRINE system in your browser.
- </li>
- <li>
- Select a Query Topic.
- <br/>
- In the Query Tool view, use the Select a Topic pull-down list in the middle-right side of the window and select the topic to which this query applies.
- <br />
- The first time that you use the Query Tool, you will not see any data listed in the Terms view until you select a Query Topic.
- </li>
- <li>
- Navigate (browse) or find (search) for medical terms from which you choose to query for a patient cohort.
- <br />
- In the Terms pane, click the Navigate Terms tab to browse for patient characteristics or medical terms that you would like to query. Click the Expand
- (+) button for a category to view criteria subcategories.
- <br />
- To locate a specific term quickly, use the Find Terms tab options.
- <br />
- Terms comprise the following characteristics:
- <ul>
- <li>
- Demographics
- </li>
- <li>
- Diagnoses
- </li>
- <li>
- Medications
- </li>
- <li>
- Laboratory values
- </li>
- </ul>
- See the <a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide"><em>Data Reference Guide</em></a> for detailed information about the types of data available for you to query.
- </li>
- <li>
- Drag your selected term to the Query Tool view, Group 1 field.
- <br />
- <strong>Tip</strong>: To optimize the rate at which your query executes, select the most-limiting terms first. For example, demographic data is broader in scope than
- diagnoses or lab values. In addition, lab test terms take longer to process than other terms. Therefore, if you select your diagnoses terms first and
- then select your lab or demographic terms, SHRINE returns your query results more quickly.
- <br />
- See the <a href="../QR_Help_Files/index.htm" title="SHRINE Query Quick Reference"><em>Query Quick Reference</em></a> for detailed information about how to optimize query formats and define query logic.
- </li>
- <li>
- Right-click your selected term in the Group field to select patients with specific values of that term.
- <br />
- Or, apply constraints to all terms in a group by using the Date, Occurs, and Exclude options at the top of the Group.
- </li>
- <li>
- Repeat steps 3&#8212;5 for additional terms to narrow your query.
- <br />
- You can add terms within a Group to apply OR logic, and use multiple Groups to define your selection by using AND logic.
- <br/>
- The following is a logical construction of a sample query:
- <ul type="none"><li>
- Query Topic &#8211; What is the overall incidence of myocardial infarction?
- <br />
- The description of this topic is to look for a subset of cardiac myopathies with possible genetic predisposition.
- </li>
- <li>
- Some individual queries that you might run for this topic &#8211;
- <ul><li>
- Diagnoses myocardial infarction AND NOT diagnoses diabetes (eliminate a common cause of CV disease)
- </li>
- <li>
- Diagnoses myocardial infarction AND NOT diagnoses diabetes AND (Age &gt; 20 and Age &lt; 40) (identify unusual heart attacks)
- </li>
- <li>
- Diagnoses myocardial infarction AND NOT diagnoses diabetes AND (Age &gt; 20 and Age &lt; 40) AND NOT diagnoses hypercholesterolemia (enrich for
- genetic myopathies)
- </li></ul></li></ul></li>
- <li>
- When your query terms are defined, click Run Query.
- <br />
- You are prompted to enter a name for this query. The default name is a string derived from the terms that you selected for the query and the time at
- which you run it.
- </li>
- <li>
- Enter a name for the query or accept the default, and then click OK to run your query.
- <br />
- When the query process completes, the aggregate number of potential patient cohorts is displayed in the Query Status view.
- <br />
- <strong>Note</strong>: You cannot access patient records through SHRINE.
- </li></ol>
-
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm"><strong><em>Constructing a Query</em></strong></a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252370697">
+ Constructing a Query</a>
+ </h1>
+ <p>
+ SHRINE enables you to explore your topic in whatever depth is available currently, as long as your individual queries are related to your general Query
+ Topic.
+ </p>
+ <p>
+ To query SHRINE data:
+ </p>
+ <ol><li>
+ Point your browser to the address identified when you registered for SHRINE, and log in by using your institution account credentials.<br />
+ <strong>Note</strong>: You must be behind your hospital's firewall to view the login page.<br />
+ When you are logged in to SHRINE, you see the SHRINE system in your browser.
+ </li>
+ <li>
+ Select a Query Topic.
+ <br/>
+ In the Query Tool view, use the Select a Topic pull-down list in the middle-right side of the window and select the topic to which this query applies.
+ <br />
+ The first time that you use the Query Tool, you will not see any data listed in the Terms view until you select a Query Topic.
+ </li>
+ <li>
+ Navigate (browse) or find (search) for medical terms from which you choose to query for a patient cohort.
+ <br />
+ In the Terms pane, click the Navigate Terms tab to browse for patient characteristics or medical terms that you would like to query. Click the Expand
+ (+) button for a category to view criteria subcategories.
+ <br />
+ To locate a specific term quickly, use the Find Terms tab options.
+ <br />
+ Terms comprise the following characteristics:
+ <ul>
+ <li>
+ Demographics
+ </li>
+ <li>
+ Diagnoses
+ </li>
+ <li>
+ Medications
+ </li>
+ <li>
+ Laboratory values
+ </li>
+ </ul>
+ See the <a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide"><em>Data Reference Guide</em></a> for detailed information about the types of data available for you to query.
+ </li>
+ <li>
+ Drag your selected term to the Query Tool view, Group 1 field.
+ <br />
+ <strong>Tip</strong>: To optimize the rate at which your query executes, select the most-limiting terms first. For example, demographic data is broader in scope than
+ diagnoses or lab values. In addition, lab test terms take longer to process than other terms. Therefore, if you select your diagnoses terms first and
+ then select your lab or demographic terms, SHRINE returns your query results more quickly.
+ <br />
+ See the <a href="../QR_Help_Files/index.htm" title="SHRINE Query Quick Reference"><em>Query Quick Reference</em></a> for detailed information about how to optimize query formats and define query logic.
+ </li>
+ <li>
+ Right-click your selected term in the Group field to select patients with specific values of that term.
+ <br />
+ Or, apply constraints to all terms in a group by using the Date, Occurs, and Exclude options at the top of the Group.
+ </li>
+ <li>
+ Repeat steps 3&#8212;5 for additional terms to narrow your query.
+ <br />
+ You can add terms within a Group to apply OR logic, and use multiple Groups to define your selection by using AND logic.
+ <br/>
+ The following is a logical construction of a sample query:
+ <ul type="none"><li>
+ Query Topic &#8211; What is the overall incidence of myocardial infarction?
+ <br />
+ The description of this topic is to look for a subset of cardiac myopathies with possible genetic predisposition.
+ </li>
+ <li>
+ Some individual queries that you might run for this topic &#8211;
+ <ul><li>
+ Diagnoses myocardial infarction AND NOT diagnoses diabetes (eliminate a common cause of CV disease)
+ </li>
+ <li>
+ Diagnoses myocardial infarction AND NOT diagnoses diabetes AND (Age &gt; 20 and Age &lt; 40) (identify unusual heart attacks)
+ </li>
+ <li>
+ Diagnoses myocardial infarction AND NOT diagnoses diabetes AND (Age &gt; 20 and Age &lt; 40) AND NOT diagnoses hypercholesterolemia (enrich for
+ genetic myopathies)
+ </li></ul></li></ul></li>
+ <li>
+ When your query terms are defined, click Run Query.
+ <br />
+ You are prompted to enter a name for this query. The default name is a string derived from the terms that you selected for the query and the time at
+ which you run it.
+ </li>
+ <li>
+ Enter a name for the query or accept the default, and then click OK to run your query.
+ <br />
+ When the query process completes, the aggregate number of potential patient cohorts is displayed in the Query Status view.
+ <br />
+ <strong>Note</strong>: You cannot access patient records through SHRINE.
+ </li></ol>
+
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370698.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370698.htm
index 64332524e..187112b4c 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370698.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/Toc252370698.htm
@@ -1,156 +1,156 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm">Contents</a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm"><strong><em>Working with Query Results</em></strong></a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
- <h1>
- <a name="_Toc252370698">Working with Query Results</a>
- </h1>
- <p>
- When your query is complete, aggregated results for each institution appear in the Query Status view, with time and date stamp. When you log out of
- SHRINE, your results no longer are available.
- </p>
- <p>
-<strong>None</strong>: If your query returned between zero (0) and 10 patients, your results display as <em>None</em>.
- </p>
- <p>
- SHRINE does not provide direct access to information about individual patients at any of the participating hospitals. To follow up with a potential
- cohort of interest, you must identify a collaborator at the institution where you located patients. Your collaborator then must work with the IRB to seek approval of the proposed study.
- </p>
- <p>
- If you currently do not collaborate with an investigator at that institution and do not know who might be doing similar research, visit the Harvard
- Catalyst website to explore options and make connections. For example, visit the Profiles research social networking system to conduct keyword searches
- for collaborators at Harvard-affiliated institutions. Or visit Medvane to access a Harvard-specific view of PubMed that can help you to identify who at
- Harvard has published on your research of interest.
- </p>
- <p>
- You can search Profiles and Medvane simultaneously using the Search box in the top-right corner of every page on the Harvard Catalyst website.
- </p>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm">Contents</a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm"><strong><em>Working with Query Results</em></strong></a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+ <h1>
+ <a name="_Toc252370698">Working with Query Results</a>
+ </h1>
+ <p>
+ When your query is complete, aggregated results for each institution appear in the Query Status view, with time and date stamp. When you log out of
+ SHRINE, your results no longer are available.
+ </p>
+ <p>
+<strong>None</strong>: If your query returned between zero (0) and 10 patients, your results display as <em>None</em>.
+ </p>
+ <p>
+ SHRINE does not provide direct access to information about individual patients at any of the participating hospitals. To follow up with a potential
+ cohort of interest, you must identify a collaborator at the institution where you located patients. Your collaborator then must work with the IRB to seek approval of the proposed study.
+ </p>
+ <p>
+ If you currently do not collaborate with an investigator at that institution and do not know who might be doing similar research, visit the Harvard
+ Catalyst website to explore options and make connections. For example, visit the Profiles research social networking system to conduct keyword searches
+ for collaborators at Harvard-affiliated institutions. Or visit Medvane to access a Harvard-specific view of PubMed that can help you to identify who at
+ Harvard has published on your research of interest.
+ </p>
+ <p>
+ You can search Profiles and Medvane simultaneously using the Search box in the top-right corner of every page on the Harvard Catalyst website.
+ </p>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/index.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/index.htm
index 99db81dd6..a75c9d692 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/index.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/UG_Help_Files/index.htm
@@ -1,158 +1,158 @@
-
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
-
-
-<title>SHRINE User Guide</title>
-
-<style>
-
-#guide {font-family:"Arial", Arial, sans-serif;
- font-size:120%;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-
-</style>
-
-</head>
-
-<body>
-
-
-<div>
- <div id="guide">
-
- SHRINE User Guide
- </div>
-
-
-<table border="0" bgcolor="white" cellpadding="3" width="100%">
-<tr>
-<td valign="top" width="25%" bgcolor="#D9ECF0">
-
-<!-- Navigation -->
-
- <p>
- <a href="index.htm"><strong><em>Contents</em></strong></a>
- </p>
-
-
- <p>
- <a href="Toc252370683.htm">Basics</a></p>
- <ul><li>
- <a href="Toc252370683.htm">Requirements</a>
- </li>
- <li>
- <a href="Toc252370684.htm">Data Steward</a>
- </li>
- <li>
- <a href="Toc252370685.htm">SHRINE Data</a>
- </li>
- <li>
- <a href="Toc252370686.htm">Results</a>
- </li></ul>
- <p>
- <a href="Toc252370688.htm">Menus and Options</a>
- </p>
- <ul><li>
- <a href="Toc252370688.htm">Main Menu and Options</a>
- </li>
- <li>
- <a href="Toc252370689.htm">Terms View</a>
- </li>
- <li>
- <a href="Toc252370690.htm">Query Tool View</a>
- </li>
- <li>
- <a href="Toc252370691.htm">Query Status View</a>
- </li>
- <li>
- <a href="Toc252370692.htm">Previous Queries View</a>
- </li></ul>
- <p>
- <a href="Toc252370694.htm">Accessing SHRINE</a>
- </p>
- <ul><li>
- <a href="Toc252370694.htm">Registering</a>
- </li>
- <li>
- <a href="Toc252370695.htm">Logging In to SHRINE</a>
- </li></ul
- <p>
- <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
- </p>
- <p>
- <a href="Toc252370697.htm">Constructing a Query</a>
- </p>
- <p>
- <a href="Toc252370698.htm">Working with Query Results</a>
- </p>
- <p>
- &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
- </p>
-
-</td>
-<td valign="top">
-
-
-<!-- Content -->
-
-
-<p>Harvard Catalyst developed the Shared Health Research
-Information Network (SHRINE) to support researchers when planning and performing population-based research, such as compiling large groups of well-characterized
-patients or repeating study results. Qualified investigators can use the SHRINE
-web-based <em>Query Tool</em> to determine the aggregate total number of patients at participating
-hospitals who meet a given set of criteria using both inclusion and exclusion logic.
-Characteristics on which you can query include demographics, diagnoses,
-medications, and selected laboratory values. Because counts are aggregated,
-patient privacy is protected.</p>
-
-<p>This guide describes the SHRINE Query Tool, including how to
-register for use, log in to SHRINE, request a <em>Query Topic</em>, and construct a
-query. Harvard Catalyst provides a full set of guides to support use of SHRINE:</p>
-
- <ul>
- <li>
- <em><a href="index.htm" title="SHRINE User Guide">SHRINE User Guide</a></em>
- &#8211; Use the Query Tool to locate patient populations.
- </li>
- <li>
- <em><a href="../QR_Help_Files/index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></em>
- &#8211; Construct optimum queries by using the Query Tool.
- </li>
- <li>
- <em><a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></em>
- &#8211; Understand the terms available for query.
- </li>
- </ul>
-
-
-</td>
-</tr>
-</table>
-
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
-</body>
-
-</html>
+
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="../shrinestyle.css" />
+
+
+<title>SHRINE User Guide</title>
+
+<style>
+
+#guide {font-family:"Arial", Arial, sans-serif;
+ font-size:120%;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+
+</style>
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="guide">
+
+ SHRINE User Guide
+ </div>
+
+
+<table border="0" bgcolor="white" cellpadding="3" width="100%">
+<tr>
+<td valign="top" width="25%" bgcolor="#D9ECF0">
+
+<!-- Navigation -->
+
+ <p>
+ <a href="index.htm"><strong><em>Contents</em></strong></a>
+ </p>
+
+
+ <p>
+ <a href="Toc252370683.htm">Basics</a></p>
+ <ul><li>
+ <a href="Toc252370683.htm">Requirements</a>
+ </li>
+ <li>
+ <a href="Toc252370684.htm">Data Steward</a>
+ </li>
+ <li>
+ <a href="Toc252370685.htm">SHRINE Data</a>
+ </li>
+ <li>
+ <a href="Toc252370686.htm">Results</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370688.htm">Menus and Options</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370688.htm">Main Menu and Options</a>
+ </li>
+ <li>
+ <a href="Toc252370689.htm">Terms View</a>
+ </li>
+ <li>
+ <a href="Toc252370690.htm">Query Tool View</a>
+ </li>
+ <li>
+ <a href="Toc252370691.htm">Query Status View</a>
+ </li>
+ <li>
+ <a href="Toc252370692.htm">Previous Queries View</a>
+ </li></ul>
+ <p>
+ <a href="Toc252370694.htm">Accessing SHRINE</a>
+ </p>
+ <ul><li>
+ <a href="Toc252370694.htm">Registering</a>
+ </li>
+ <li>
+ <a href="Toc252370695.htm">Logging In to SHRINE</a>
+ </li></ul
+ <p>
+ <a href="Toc252370696.htm">Submitting a Query Topic Request</a>
+ </p>
+ <p>
+ <a href="Toc252370697.htm">Constructing a Query</a>
+ </p>
+ <p>
+ <a href="Toc252370698.htm">Working with Query Results</a>
+ </p>
+ <p>
+ &#91; <a href="../index.htm">SHRINE Help Main Menu</a> &#93;
+ </p>
+
+</td>
+<td valign="top">
+
+
+<!-- Content -->
+
+
+<p>Harvard Catalyst developed the Shared Health Research
+Information Network (SHRINE) to support researchers when planning and performing population-based research, such as compiling large groups of well-characterized
+patients or repeating study results. Qualified investigators can use the SHRINE
+web-based <em>Query Tool</em> to determine the aggregate total number of patients at participating
+hospitals who meet a given set of criteria using both inclusion and exclusion logic.
+Characteristics on which you can query include demographics, diagnoses,
+medications, and selected laboratory values. Because counts are aggregated,
+patient privacy is protected.</p>
+
+<p>This guide describes the SHRINE Query Tool, including how to
+register for use, log in to SHRINE, request a <em>Query Topic</em>, and construct a
+query. Harvard Catalyst provides a full set of guides to support use of SHRINE:</p>
+
+ <ul>
+ <li>
+ <em><a href="index.htm" title="SHRINE User Guide">SHRINE User Guide</a></em>
+ &#8211; Use the Query Tool to locate patient populations.
+ </li>
+ <li>
+ <em><a href="../QR_Help_Files/index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></em>
+ &#8211; Construct optimum queries by using the Query Tool.
+ </li>
+ <li>
+ <em><a href="../DR_Help_Files/index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></em>
+ &#8211; Understand the terms available for query.
+ </li>
+ </ul>
+
+
+</td>
+</tr>
+</table>
+
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
+</body>
+
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/index.htm b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/index.htm
index cb576a1e4..67c13d998 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/index.htm
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/index.htm
@@ -1,85 +1,85 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
-
-<head>
-
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" type="text/css" href="shrinestyle.css" />
-
-
-<title>SHRINE Help Main Menu</title>
-
-<style>
-
-#mainmenu {font-family:"Arial", Arial, sans-serif;
- font-color:"white";
- font-size:18px;
- text-align:center;
- padding-top:15px;
- padding-bottom:15px;
- color:white;
- }
-
-#footer {font-family:"Arial", Arial, sans-serif;
- text-align:center;
- padding-top:1px;
- padding-bottom:1px;
- background-color:#D9ECF0;
-</style>
-
-
-
-</head>
-
-<body>
-
-
-<div>
- <div id="mainmenu">
-SHRINE Help Main Menu
-<p>Version 1.6.8<br>
-Updated April 1, 2010</p>
- </div>
-<table border="0" bgcolor="white" width="100%">
-<tr><td valign="top" width="25%" bgcolor="#D9ECF0">
-<p><strong><em>Main Menu</em></strong></p>
-
-<ul><li>
-<strong><a href="UG_Help_Files/index.htm" title="SHRINE User Guide">SHRINE User Guide</a></strong></li>
-
-<li><strong><a href="QR_Help_Files/index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></strong></li>
-
-<li><strong><a href="DR_Help_Files/index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></strong></li></ul>
-</td>
-<td valign="top">
-
-<p>This is a Beta release of the Harvard Catalyst Shared Health Research
-Information Network (SHRINE). These guides describes the SHRINE Query Tool,
-query construction, and SHRINE data:</p>
-
- <ul>
- <li>
- <em>SHRINE User Guide</em>
- &#8211; Use the Query Tool to locate patient populations.
- </li>
- <li>
- <em>SHRINE Query Quick Reference<</em>
- &#8211; Construct optimum queries by using the Query Tool.
- </li>
- <li>
- <em>SHRINE Data Reference Guide</em>
- &#8211; Understand the terms available for query.
- </li>
- </ul>
-
-</td></tr>
-</table>
-
-</div>
-
- <div id="footer">
-
-<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
- </div>
-
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml" lang="en">
+
+<head>
+
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+<link rel="stylesheet" type="text/css" href="shrinestyle.css" />
+
+
+<title>SHRINE Help Main Menu</title>
+
+<style>
+
+#mainmenu {font-family:"Arial", Arial, sans-serif;
+ font-color:"white";
+ font-size:18px;
+ text-align:center;
+ padding-top:15px;
+ padding-bottom:15px;
+ color:white;
+ }
+
+#footer {font-family:"Arial", Arial, sans-serif;
+ text-align:center;
+ padding-top:1px;
+ padding-bottom:1px;
+ background-color:#D9ECF0;
+</style>
+
+
+
+</head>
+
+<body>
+
+
+<div>
+ <div id="mainmenu">
+SHRINE Help Main Menu
+<p>Version 1.6.8<br>
+Updated April 1, 2010</p>
+ </div>
+<table border="0" bgcolor="white" width="100%">
+<tr><td valign="top" width="25%" bgcolor="#D9ECF0">
+<p><strong><em>Main Menu</em></strong></p>
+
+<ul><li>
+<strong><a href="UG_Help_Files/index.htm" title="SHRINE User Guide">SHRINE User Guide</a></strong></li>
+
+<li><strong><a href="QR_Help_Files/index.htm" title="SHRINE Query Quick Reference">SHRINE Query Quick Reference</a></strong></li>
+
+<li><strong><a href="DR_Help_Files/index.htm" title="SHRINE Data Reference Guide">SHRINE Data Reference Guide</a></strong></li></ul>
+</td>
+<td valign="top">
+
+<p>This is a Beta release of the Harvard Catalyst Shared Health Research
+Information Network (SHRINE). These guides describes the SHRINE Query Tool,
+query construction, and SHRINE data:</p>
+
+ <ul>
+ <li>
+ <em>SHRINE User Guide</em>
+ &#8211; Use the Query Tool to locate patient populations.
+ </li>
+ <li>
+ <em>SHRINE Query Quick Reference<</em>
+ &#8211; Construct optimum queries by using the Query Tool.
+ </li>
+ <li>
+ <em>SHRINE Data Reference Guide</em>
+ &#8211; Understand the terms available for query.
+ </li>
+ </ul>
+
+</td></tr>
+</table>
+
+</div>
+
+ <div id="footer">
+
+<p>Please use our <a href="http://cbmi.catalyst.harvard.edu/formsJsf/shrine_feedback.jsf" target=_BLANK>Feedback</a> form to contact the SHRINE team or to request assistance.</p>
+ </div>
+
</body></html>
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/shrinestyle.css b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/shrinestyle.css
index f359fbc85..dcfa1a365 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/shrinestyle.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/Help/shrinestyle.css
@@ -1,38 +1,38 @@
-body {
- font-family:arial,helvetica;
- font-size:12px;
- line-height:16px;
- padding-right:5px;
- padding-left:5px;
- background-color:#4E5B82;
-}
-
-
-p, li, blockquote {
- font-size:12px;
- line-height:16px;
-}
-h1 {
- color: #D9ECF0;
- font-size:18px;
- font-weight:bold;
- padding:0;
- margin:0;
-}
-h2 {
- color: #D9ECF0;
- font-size:15px;
- font-weight:bold;
- padding:0;
- margin:0;
-}
-h3, th {
- color: #4E5B82;
- font-size:13px;
- font-weight:bold;
- padding:1;
- margin:15px 0 10px 0;
-}
-a {
- color: #4E5B82;
-
+body {
+ font-family:arial,helvetica;
+ font-size:12px;
+ line-height:16px;
+ padding-right:5px;
+ padding-left:5px;
+ background-color:#4E5B82;
+}
+
+
+p, li, blockquote {
+ font-size:12px;
+ line-height:16px;
+}
+h1 {
+ color: #D9ECF0;
+ font-size:18px;
+ font-weight:bold;
+ padding:0;
+ margin:0;
+}
+h2 {
+ color: #D9ECF0;
+ font-size:15px;
+ font-weight:bold;
+ padding:0;
+ margin:0;
+}
+h3, th {
+ color: #4E5B82;
+ font-size:13px;
+ font-weight:bold;
+ padding:1;
+ margin:15px 0 10px 0;
+}
+a {
+ color: #4E5B82;
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/SHRINE_ctrl.js b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/SHRINE_ctrl.js
index 92acd4f09..d6c799c1e 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/SHRINE_ctrl.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/SHRINE_ctrl.js
@@ -1,127 +1,127 @@
-/**
- * @projectDescription SHRINE cell controller object
- * @inherits i2b2
- * @namespace i2b2.SHRINE
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.0
- * ----------------------------------------------------------------------------------------
- */
-
-// Override the default help display to open a new window pointed at the centrally-hosted SHRINE help
-i2b2.events.afterLogin.subscribe((function(type,args) {
- i2b2.hive.HelpViewer = {
- show: function() {
- try {
- window.open('/shrine-webclient/Help/index.htm'
- ,'SHRINE_help_viewer'
- , 'width=650,height=450,toolbar=0,resizable=1,location=0,status=0,menubar=0,scrollbars=1');
- } catch (e) {}
- }
- };
-}));
-
-//Charles McGow - Add previous queries and workplace[if avaiable]
-//i2b2.events.afterLogin.subscribe((function(en,co) { i2b2.hive.MasterView.addZoomWindow("ONT"); }), "", i2b2 );
-//Charles McGow - Add previous queries and workplace[if avaiable]
-
-i2b2.events.afterLogin.subscribe((function(type,args) {
- // all cells have been loaded. Set the viewMode, resize, etc
- try {
- if (i2b2.hive.cfg.lstCells.SHRINE.serverLoaded) {
- i2b2.PM.model.shrine_domain = true;
- }
- } catch (e) {}
- if (i2b2.h.isSHRINE()) {
- i2b2.SHRINE.afterLogin(type,args);
- }
-}));
-
-
-i2b2.SHRINE.afterLogin = function(type,args) {
- var msg = i2b2.SHRINE.ajax.readApprovedEntries("SHRINE");
- msg.parse();
- if (msg.error) {
- console.error("Could not get approved topic list from SHRINE");
- console.dir(msg);
- alert('Could not get approved topics list from SHRINE.');
- } else {
- i2b2.SHRINE.model.topics = {};
- var l = msg.model.length;
- for (var i=0; i<l; i++) {
- var rec = msg.model[i];
- if (rec.TopicID != undefined) {
- i2b2.SHRINE.model.topics[rec.TopicID] = rec;
- }
- }
- }
- i2b2.SHRINE.renderTopics();
- $$('#crcDlgResultOutputPRC input')[0].disabled=true;
- $('crcDlgResultOutputPRS').hide();
-};
-
-i2b2.SHRINE.renderTopics = function() {
- // deal with the Query Tool's topic drop
- try {
- var dropdown = $('queryTopicSelect');
- while (dropdown.hasChildNodes()) { dropdown.removeChild(dropdown.firstChild); }
- // create the "Select Topic" option
- var sno = document.createElement('OPTION');
- sno.setAttribute('value', null);
- var snt = document.createTextNode(" ------ Select an Approved Query Topic ------ ");
- sno.appendChild(snt);
- dropdown.appendChild(sno);
- // populate with topics
- for (var i in i2b2.SHRINE.model.topics) {
- var rec = i2b2.SHRINE.model.topics[i];
- if (rec.TopicID != undefined && rec.approval == "Approved") {
- // ONT options dropdown
- var sno = document.createElement('OPTION');
- sno.setAttribute('value', rec.TopicID);
- var snt = document.createTextNode(rec.Name);
- sno.appendChild(snt);
- dropdown.appendChild(sno);
- }
- }
- } catch(e) {
- console.error("could not populate QueryTool's topic panel");
- }
-};
-
-i2b2.SHRINE.RequestTopic = function() {
- // Change this value in the config file [\i2b2\cells\SHRINE\cell_config_data.js]
- window.open(i2b2.SHRINE.cfg.config.newTopicURL, 'RequestTopic', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600');
-};
-
-i2b2.SHRINE.TopicInfo = function() {
- var s = $('queryTopicSelect');
- if (s.selectedIndex == null || s.selectedIndex == 0) { return true; }
- var topicID = s.options[s.selectedIndex].value;
- if (topicID == "") { return; }
- i2b2.SHRINE.view.modal.topicInfoDialog.showInfo(topicID);
-};
-
-i2b2.SHRINE.view.modal.topicInfoDialog = {
- showInfo: function(id) {
- var thisRef = i2b2.SHRINE.view.modal.topicInfoDialog;
- if (!thisRef.yuiDialog) {
- thisRef.yuiDialog = new YAHOO.widget.SimpleDialog("SHRINE-info-panel", {
- zindex: 700,
- width: "400px",
- fixedcenter: true,
- constraintoviewport: true
- });
- thisRef.yuiDialog.render(document.body);
- // show the form
- thisRef.yuiDialog.show();
- }
- // show the form
- $('SHRINE-info-panel').show();
- thisRef.yuiDialog.show();
- thisRef.yuiDialog.center();
- // display the topic info
- var rec = i2b2.SHRINE.model.topics[id];
- if (undefined == rec) { thisRef.yuiDialog.hide(); } // bad id == bail out here
- $('SHRINE-info-title').innerHTML = rec.Name;
- $('SHRINE-info-body').innerHTML = rec.Intent;
- }
-};
+/**
+ * @projectDescription SHRINE cell controller object
+ * @inherits i2b2
+ * @namespace i2b2.SHRINE
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.0
+ * ----------------------------------------------------------------------------------------
+ */
+
+// Override the default help display to open a new window pointed at the centrally-hosted SHRINE help
+i2b2.events.afterLogin.subscribe((function(type,args) {
+ i2b2.hive.HelpViewer = {
+ show: function() {
+ try {
+ window.open('/shrine-webclient/Help/index.htm'
+ ,'SHRINE_help_viewer'
+ , 'width=650,height=450,toolbar=0,resizable=1,location=0,status=0,menubar=0,scrollbars=1');
+ } catch (e) {}
+ }
+ };
+}));
+
+//Charles McGow - Add previous queries and workplace[if avaiable]
+//i2b2.events.afterLogin.subscribe((function(en,co) { i2b2.hive.MasterView.addZoomWindow("ONT"); }), "", i2b2 );
+//Charles McGow - Add previous queries and workplace[if avaiable]
+
+i2b2.events.afterLogin.subscribe((function(type,args) {
+ // all cells have been loaded. Set the viewMode, resize, etc
+ try {
+ if (i2b2.hive.cfg.lstCells.SHRINE.serverLoaded) {
+ i2b2.PM.model.shrine_domain = true;
+ }
+ } catch (e) {}
+ if (i2b2.h.isSHRINE()) {
+ i2b2.SHRINE.afterLogin(type,args);
+ }
+}));
+
+
+i2b2.SHRINE.afterLogin = function(type,args) {
+ var msg = i2b2.SHRINE.ajax.readApprovedEntries("SHRINE");
+ msg.parse();
+ if (msg.error) {
+ console.error("Could not get approved topic list from SHRINE");
+ console.dir(msg);
+ alert('Could not get approved topics list from SHRINE.');
+ } else {
+ i2b2.SHRINE.model.topics = {};
+ var l = msg.model.length;
+ for (var i=0; i<l; i++) {
+ var rec = msg.model[i];
+ if (rec.TopicID != undefined) {
+ i2b2.SHRINE.model.topics[rec.TopicID] = rec;
+ }
+ }
+ }
+ i2b2.SHRINE.renderTopics();
+ $$('#crcDlgResultOutputPRC input')[0].disabled=true;
+ $('crcDlgResultOutputPRS').hide();
+};
+
+i2b2.SHRINE.renderTopics = function() {
+ // deal with the Query Tool's topic drop
+ try {
+ var dropdown = $('queryTopicSelect');
+ while (dropdown.hasChildNodes()) { dropdown.removeChild(dropdown.firstChild); }
+ // create the "Select Topic" option
+ var sno = document.createElement('OPTION');
+ sno.setAttribute('value', null);
+ var snt = document.createTextNode(" ------ Select an Approved Query Topic ------ ");
+ sno.appendChild(snt);
+ dropdown.appendChild(sno);
+ // populate with topics
+ for (var i in i2b2.SHRINE.model.topics) {
+ var rec = i2b2.SHRINE.model.topics[i];
+ if (rec.TopicID != undefined && rec.approval == "Approved") {
+ // ONT options dropdown
+ var sno = document.createElement('OPTION');
+ sno.setAttribute('value', rec.TopicID);
+ var snt = document.createTextNode(rec.Name);
+ sno.appendChild(snt);
+ dropdown.appendChild(sno);
+ }
+ }
+ } catch(e) {
+ console.error("could not populate QueryTool's topic panel");
+ }
+};
+
+i2b2.SHRINE.RequestTopic = function() {
+ // Change this value in the config file [\i2b2\cells\SHRINE\cell_config_data.js]
+ window.open(i2b2.SHRINE.cfg.config.newTopicURL, 'RequestTopic', 'toolbar=1,scrollbars=1,location=1,statusbar=1,menubar=1,resizable=1,width=800,height=600');
+};
+
+i2b2.SHRINE.TopicInfo = function() {
+ var s = $('queryTopicSelect');
+ if (s.selectedIndex == null || s.selectedIndex == 0) { return true; }
+ var topicID = s.options[s.selectedIndex].value;
+ if (topicID == "") { return; }
+ i2b2.SHRINE.view.modal.topicInfoDialog.showInfo(topicID);
+};
+
+i2b2.SHRINE.view.modal.topicInfoDialog = {
+ showInfo: function(id) {
+ var thisRef = i2b2.SHRINE.view.modal.topicInfoDialog;
+ if (!thisRef.yuiDialog) {
+ thisRef.yuiDialog = new YAHOO.widget.SimpleDialog("SHRINE-info-panel", {
+ zindex: 700,
+ width: "400px",
+ fixedcenter: true,
+ constraintoviewport: true
+ });
+ thisRef.yuiDialog.render(document.body);
+ // show the form
+ thisRef.yuiDialog.show();
+ }
+ // show the form
+ $('SHRINE-info-panel').show();
+ thisRef.yuiDialog.show();
+ thisRef.yuiDialog.center();
+ // display the topic info
+ var rec = i2b2.SHRINE.model.topics[id];
+ if (undefined == rec) { thisRef.yuiDialog.hide(); } // bad id == bail out here
+ $('SHRINE-info-title').innerHTML = rec.Name;
+ $('SHRINE-info-body').innerHTML = rec.Intent;
+ }
+};
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/cell_config_data.js
index d46bed530..c514fc7fc 100644
--- a/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/SHRINE/cell_config_data.js
@@ -1,17 +1,17 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files: [
- "SHRINE_ctrl.js",
- "i2b2_msgs.js"
- ],
- css: [],
- config: {
- // additional configuration variables that are set by the system
- name: "SHRINE Cell",
- description: "The SHRINE cell...",
- category: ["core","cell","shrine"],
- newTopicURL: "https://dev.shrine.catalyst.harvard.edu/shrine-hms-authorization/",
- readApprovedURL:"https://shrine-qa1.hms.harvard.edu:6443/shrine/rest/i2b2/request"
- }
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files: [
+ "SHRINE_ctrl.js",
+ "i2b2_msgs.js"
+ ],
+ css: [],
+ config: {
+ // additional configuration variables that are set by the system
+ name: "SHRINE Cell",
+ description: "The SHRINE cell...",
+ category: ["core","cell","shrine"],
+ newTopicURL: "https://shrine-hostname.here:6443/steward/client/index.html",
+ readApprovedURL:"https://shrine-hostname.here:6443/shrine/rest/i2b2/request"
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_ctrlr_general.js b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_ctrlr_general.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_sdx_WRK.js b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_sdx_WRK.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_sdx_XML.js b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_sdx_XML.js
old mode 100755
new mode 100644
index 92a30cbaf..c93d811df
--- a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_sdx_XML.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_sdx_XML.js
@@ -1,312 +1,312 @@
-/**
- * @projectDescription The SDX controller library for generic XML data-type.
- * @namespace i2b2.sdx.TypeControllers.XML
- * @inherits i2b2.sdx.TypeControllers
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * @see i2b2.sdx
- * ----------------------------------------------------------------------------------------
- * updated 1-12-09: RC5 launch [Nick Benik]
- */
-console.group('Load & Execute component file: WORK > SDX > Generic XML');
-console.time('execute time');
-
-
-i2b2.sdx.TypeControllers.XML = {};
-i2b2.sdx.TypeControllers.XML.model = {};
-// *********************************************************************************
-// ENCAPSULATE DATA
-// *********************************************************************************
-/**
- * Get the sdxInfo data template for all QueryMaster.
- * @memberOf i2b2.sdx.TypeControllers.XML
- * @method
- * @return {Object} Returns a data object containing sdxType, sdxKeyName, sdxControlCell info for GenericXML-type objects.
- * @author Nick Benik
- * @version 1.0
- * @alias i2b2.sdx.Master.EncapsulateData
- */
-i2b2.sdx.TypeControllers.XML.getEncapsulateInfo = function() {
- // this function returns the encapsulation head information
- return {sdxType: 'XML', sdxKeyName: 'key', sdxControlCell:'WORK', sdxDisplayNameKey:'name'};
-}
-
-
-// *********************************************************************************
-// GENERATE HTML (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.RenderHTML= function(sdxData, options, targetDiv) {
- // OPTIONS:
- // title: string
- // showchildren: true | false
- // cssClass: string
- // icon: [data object]
- // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
- // dragdrop: string (function name)
- // context: string
- // click: string
- // dblclick: string
-
- if (Object.isUndefined(options)) { options = {}; }
- var render = {html: retHtml, htmlID: id};
- var conceptId = sdxData.name;
- var id = "WORK_ID-" + i2b2.GUID();
-
- // process drag drop controllers
- if (!Object.isUndefined(options.dragdrop)) {
-// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
-// This would ensure removal of the onmouseover call in a cross-browser way
- var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
- } else {
- var sDD = '';
- }
-
- if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultXML';}
-
- // user can override
- bCanExp = true;
- if (Object.isBoolean(options.showchildren)) {
- bCanExp = options.showchildren;
- }
- render.canExpand = bCanExp;
- render.iconType = "XML";
-
- if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/WORK/assets/'+ options.icon }
- if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/WORK/assets/'+ options.iconExp }
- // in cases of one set icon, copy valid icon to the missing icon
- if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
- if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
-
- // handle the event controllers
- var sMainEvents = sDD;
- var sImgEvents = sDD;
- if (options.click) {sMainEvents += ' onclick="'+ options.click +'" '; }
- if (options.dblclick) {sMainEvents += ' ondblclick="'+ options.dblclick +'" '; }
- if (options.context) {sMainEvents += ' oncontext="'+ options.context +'" '; } else {retHtml += ' oncontextmenu="return false" '; }
- // **** Render the HTML ***
- var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
- retHtml += '<DIV ';
- if (Object.isString(options.cssClass)) {
- retHtml += ' class="'+options.cssClass+'" ';
- } else {
- retHtml += ' class= "sdxDefaultXML" ';
- }
- retHtml += sImgEvents;
- retHtml += '>';
- retHtml += '<IMG src="'+render.icon+'"/> ';
- if (!Object.isUndefined(options.title)) {
- retHtml += options.title;
- } else {
- console.warn('[SDX RenderHTML] no title was given in the creation options for an WORK>XML node!');
- retHtml += ' XML '+id;
- }
- retHtml += '</DIV></DIV>';
- render.html = retHtml;
- render.htmlID = id;
- var retObj = {};
- Object.extend(retObj, sdxData);
- retObj.renderData = render;
- return retObj;
-}
-
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.onHoverOver = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.addClassName(el,'ddXMLTarget'); }
-}
-
-
-// *********************************************************************************
-// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.onHoverOut = function(e, id, ddProxy) {
- var el = $(id);
- if (el) { Element.removeClassName(el,'ddXMLTarget'); }
-}
-
-
-// *********************************************************************************
-// ADD DATA TO TREENODE (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
- var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
- var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
- if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
- // add the callback to load child nodes
- sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
- }
- tmpNode.data.i2b2_SDX= sdxDataPack;
- tmpNode.toggle = function() {
- if (!this.tree.locked && ( this.hasChildren(true) ) ) {
- var data = this.data.i2b2_SDX.renderData;
- var img = this.getContentEl();
- img = Element.select(img,'img')[0];
- if (this.expanded) {
- img.src = data.icon;
- this.collapse();
- } else {
- img.src = data.iconExp;
- this.expand();
- }
- }
- };
- if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
- return tmpNode;
-}
-
-
-i2b2.sdx.TypeControllers.XML.SaveToDataModel = function(sdxData) { return undefined; }
-i2b2.sdx.TypeControllers.XML.LoadFromDataModel = function(key_value) { return undefined; }
-i2b2.sdx.TypeControllers.XML.ClearAllFromDataModel= function(sdxOptionalParent) { return true; }
-i2b2.sdx.TypeControllers.XML.getChildRecords = function(sdxParentNode, onCompleteCallback) {
- var retMsg = {
- error: true,
- msgRequest: '',
- msgResponse: '',
- msgUrl: '',
- results: null
- };
- if (getObjectClass(onCompleteCallback)=='i2b2_scopedCallback') {
- onCompleteCallback.callback.call(onCompleteCallback.scope, retMsg);
- } else {
- onCompleteCallback(retMsg);
- }
-}
-
-
-// *********************************************************************************
-// ATTACH DRAG TO DATA (DEFAULT HANDLER)
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.AttachDrag2Data = function(divParentID, divDataID){
- if (Object.isUndefined($(divDataID))) { return false; }
-
- // get the i2b2 data from the yuiTree node
- var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
- var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
- if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
-
- // attach DD
- var t = new i2b2.sdx.TypeControllers.XML.DragDrop(divDataID)
- t.yuiTree = tvTree;
- t.yuiTreeNode = tvNode;
- tvNode.DDProxy = t;
-
- // clear the mouseover attachment function
- var tdn = $(divDataID);
- if (!Object.isUndefined(tdn.onmouseover)) {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- if (!Object.isUndefined(tdn.attributes)) {
- for (var i=0;i<tdn.attributes.length; i++) {
- if (tdn.attributes[i].name=="onmouseover") {
- try {
- delete tdn.onmouseover;
- } catch(e) {
- tdn.onmouseover;
- }
- }
- }
- }
-}
-
-
-
-
-// *********************************************************************************
-// DRAG DROP PROXY CONTROLLER
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.DragDrop = function(id, config) {
- if (id) {
- this.init(id, 'XML', {isTarget:false});
- this.initFrame();
- }
- var s = this.getDragEl().style;
- s.borderColor = "transparent";
- s.opacity = 0.75;
- s.filter = "alpha(opacity=75)";
- s.whiteSpace = "nowrap";
- s.overflow = "hidden";
- s.textOverflow = "ellipsis";
-};
-YAHOO.extend(i2b2.sdx.TypeControllers.XML.DragDrop, YAHOO.util.DDProxy);
-i2b2.sdx.TypeControllers.XML.DragDrop.prototype.startDrag = function(x, y) {
- var dragEl = this.getDragEl();
- var clickEl = this.getEl();
- dragEl.innerHTML = clickEl.innerHTML;
- dragEl.className = clickEl.className;
- dragEl.style.backgroundColor = '#FFFFEE';
- dragEl.style.color = clickEl.style.color;
- dragEl.style.border = "1px solid blue";
- dragEl.style.width = "160px";
- dragEl.style.height = "20px";
- this.setDelta(15,10);
-};
-i2b2.sdx.TypeControllers.XML.DragDrop.prototype.endDrag = function(e, sdxType) {
- // remove DragDrop targeting CCS
- var targets = YAHOO.util.DDM.getRelated(this, true);
- for (var i=0; i<targets.length; i++) {
- var targetEl = targets[i]._domRef;
- i2b2.sdx.Master.onHoverOut('XML', e, targetEl, this);
- }
-};
-i2b2.sdx.TypeControllers.XML.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
- var oCoord = this.getTargetCoord(iPageX, iPageY);
- if (!this.deltaSetXY) {
- var aCoord = [oCoord.x, oCoord.y];
- YAHOO.util.Dom.setXY(el, aCoord);
- var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
- var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
- this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
- } else {
- var posX = (oCoord.x + this.deltaSetXY[0]);
- var posY = (oCoord.y + this.deltaSetXY[1]);
- var scrSize = document.viewport.getDimensions();
- var maxX = parseInt(scrSize.width-25-160);
- var maxY = parseInt(scrSize.height-25);
- if (posX > maxX) {posX = maxX;}
- if (posX < 6) {posX = 6;}
- if (posY > maxY) {posY = maxY;}
- if (posY < 6) {posY = 6;}
- YAHOO.util.Dom.setStyle(el, "left", posX + "px");
- YAHOO.util.Dom.setStyle(el, "top", posY + "px");
- }
- this.cachePosition(oCoord.x, oCoord.y);
- this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
-};
-i2b2.sdx.TypeControllers.XML.DragDrop.prototype.onDragOver = function(e, id) {
- // fire the onHoverOver (use SDX so targets can override default event handler)
- i2b2.sdx.Master.onHoverOver('XML', e, id, this);
-};
-i2b2.sdx.TypeControllers.XML.DragDrop.prototype.onDragOut = function(e, id) {
- // fire the onHoverOut handler (use SDX so targets can override default event handlers)
- i2b2.sdx.Master.onHoverOut('XML', e, id, this);
-};
-i2b2.sdx.TypeControllers.XML.DragDrop.prototype.onDragDrop = function(e, id) {
- i2b2.sdx.Master.onHoverOut('XML', e, id, this);
- // retreive the concept data from the dragged element
- draggedData = this.yuiTreeNode.data.i2b2_SDX;
- i2b2.sdx.Master.ProcessDrop(draggedData, id);
-};
-
-
-
-// *********************************************************************************
-// <BLANK> DROP HANDLER
-// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
-// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
-// *********************************************************************************
-i2b2.sdx.TypeControllers.XML.DropHandler = function(sdxData) {
- alert('[XML DROPPED] You need to create your own custom drop event handler.');
-}
-
-
-console.timeEnd('execute time');
+/**
+ * @projectDescription The SDX controller library for generic XML data-type.
+ * @namespace i2b2.sdx.TypeControllers.XML
+ * @inherits i2b2.sdx.TypeControllers
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * @see i2b2.sdx
+ * ----------------------------------------------------------------------------------------
+ * updated 1-12-09: RC5 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: WORK > SDX > Generic XML');
+console.time('execute time');
+
+
+i2b2.sdx.TypeControllers.XML = {};
+i2b2.sdx.TypeControllers.XML.model = {};
+// *********************************************************************************
+// ENCAPSULATE DATA
+// *********************************************************************************
+/**
+ * Get the sdxInfo data template for all QueryMaster.
+ * @memberOf i2b2.sdx.TypeControllers.XML
+ * @method
+ * @return {Object} Returns a data object containing sdxType, sdxKeyName, sdxControlCell info for GenericXML-type objects.
+ * @author Nick Benik
+ * @version 1.0
+ * @alias i2b2.sdx.Master.EncapsulateData
+ */
+i2b2.sdx.TypeControllers.XML.getEncapsulateInfo = function() {
+ // this function returns the encapsulation head information
+ return {sdxType: 'XML', sdxKeyName: 'key', sdxControlCell:'WORK', sdxDisplayNameKey:'name'};
+}
+
+
+// *********************************************************************************
+// GENERATE HTML (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.RenderHTML= function(sdxData, options, targetDiv) {
+ // OPTIONS:
+ // title: string
+ // showchildren: true | false
+ // cssClass: string
+ // icon: [data object]
+ // icon: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // iconExp: (filename of img, appended to i2b2_root+cellDir + '/assets')
+ // dragdrop: string (function name)
+ // context: string
+ // click: string
+ // dblclick: string
+
+ if (Object.isUndefined(options)) { options = {}; }
+ var render = {html: retHtml, htmlID: id};
+ var conceptId = sdxData.name;
+ var id = "WORK_ID-" + i2b2.GUID();
+
+ // process drag drop controllers
+ if (!Object.isUndefined(options.dragdrop)) {
+// NOTE TO SELF: should attachment of node dragdrop controller be handled by the SDX system as well?
+// This would ensure removal of the onmouseover call in a cross-browser way
+ var sDD = ' onmouseover="' + options.dragdrop + '(\''+ targetDiv.id +'\',\'' + id + '\')" ';
+ } else {
+ var sDD = '';
+ }
+
+ if (Object.isUndefined(options.cssClass)) { options.cssClass = 'sdxDefaultXML';}
+
+ // user can override
+ bCanExp = true;
+ if (Object.isBoolean(options.showchildren)) {
+ bCanExp = options.showchildren;
+ }
+ render.canExpand = bCanExp;
+ render.iconType = "XML";
+
+ if (!Object.isUndefined(options.icon)) { render.icon = i2b2.hive.cfg.urlFramework + 'cells/WORK/assets/'+ options.icon }
+ if (!Object.isUndefined(options.iconExp)) { render.iconExp = i2b2.hive.cfg.urlFramework + 'cells/WORK/assets/'+ options.iconExp }
+ // in cases of one set icon, copy valid icon to the missing icon
+ if (Object.isUndefined(render.icon) && !Object.isUndefined(render.iconExp)) { render.icon = render.iconExp; }
+ if (!Object.isUndefined(render.icon) && Object.isUndefined(render.iconExp)) { render.iconExp = render.icon; }
+
+ // handle the event controllers
+ var sMainEvents = sDD;
+ var sImgEvents = sDD;
+ if (options.click) {sMainEvents += ' onclick="'+ options.click +'" '; }
+ if (options.dblclick) {sMainEvents += ' ondblclick="'+ options.dblclick +'" '; }
+ if (options.context) {sMainEvents += ' oncontext="'+ options.context +'" '; } else {retHtml += ' oncontextmenu="return false" '; }
+ // **** Render the HTML ***
+ var retHtml = '<DIV id="' + id + '" ' + sMainEvents + ' style="white-space:nowrap;cursor:pointer;">';
+ retHtml += '<DIV ';
+ if (Object.isString(options.cssClass)) {
+ retHtml += ' class="'+options.cssClass+'" ';
+ } else {
+ retHtml += ' class= "sdxDefaultXML" ';
+ }
+ retHtml += sImgEvents;
+ retHtml += '>';
+ retHtml += '<IMG src="'+render.icon+'"/> ';
+ if (!Object.isUndefined(options.title)) {
+ retHtml += options.title;
+ } else {
+ console.warn('[SDX RenderHTML] no title was given in the creation options for an WORK>XML node!');
+ retHtml += ' XML '+id;
+ }
+ retHtml += '</DIV></DIV>';
+ render.html = retHtml;
+ render.htmlID = id;
+ var retObj = {};
+ Object.extend(retObj, sdxData);
+ retObj.renderData = render;
+ return retObj;
+}
+
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET ENTRY (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.onHoverOver = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.addClassName(el,'ddXMLTarget'); }
+}
+
+
+// *********************************************************************************
+// HANDLE HOVER OVER TARGET EXIT (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.onHoverOut = function(e, id, ddProxy) {
+ var el = $(id);
+ if (el) { Element.removeClassName(el,'ddXMLTarget'); }
+}
+
+
+// *********************************************************************************
+// ADD DATA TO TREENODE (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.AppendTreeNode = function(yuiTree, yuiRootNode, sdxDataPack, callbackLoader) {
+ var myobj = { html: sdxDataPack.renderData.html, nodeid: sdxDataPack.renderData.htmlID}
+ var tmpNode = new YAHOO.widget.HTMLNode(myobj, yuiRootNode, false, true);
+ if (sdxDataPack.renderData.canExpand && !Object.isUndefined(callbackLoader)) {
+ // add the callback to load child nodes
+ sdxDataPack.sdxInfo.sdxLoadChildren = callbackLoader;
+ }
+ tmpNode.data.i2b2_SDX= sdxDataPack;
+ tmpNode.toggle = function() {
+ if (!this.tree.locked && ( this.hasChildren(true) ) ) {
+ var data = this.data.i2b2_SDX.renderData;
+ var img = this.getContentEl();
+ img = Element.select(img,'img')[0];
+ if (this.expanded) {
+ img.src = data.icon;
+ this.collapse();
+ } else {
+ img.src = data.iconExp;
+ this.expand();
+ }
+ }
+ };
+ if (!sdxDataPack.renderData.canExpand) { tmpNode.dynamicLoadComplete = true; }
+ return tmpNode;
+}
+
+
+i2b2.sdx.TypeControllers.XML.SaveToDataModel = function(sdxData) { return undefined; }
+i2b2.sdx.TypeControllers.XML.LoadFromDataModel = function(key_value) { return undefined; }
+i2b2.sdx.TypeControllers.XML.ClearAllFromDataModel= function(sdxOptionalParent) { return true; }
+i2b2.sdx.TypeControllers.XML.getChildRecords = function(sdxParentNode, onCompleteCallback) {
+ var retMsg = {
+ error: true,
+ msgRequest: '',
+ msgResponse: '',
+ msgUrl: '',
+ results: null
+ };
+ if (getObjectClass(onCompleteCallback)=='i2b2_scopedCallback') {
+ onCompleteCallback.callback.call(onCompleteCallback.scope, retMsg);
+ } else {
+ onCompleteCallback(retMsg);
+ }
+}
+
+
+// *********************************************************************************
+// ATTACH DRAG TO DATA (DEFAULT HANDLER)
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.AttachDrag2Data = function(divParentID, divDataID){
+ if (Object.isUndefined($(divDataID))) { return false; }
+
+ // get the i2b2 data from the yuiTree node
+ var tvTree = YAHOO.widget.TreeView.getTree(divParentID);
+ var tvNode = tvTree.getNodeByProperty('nodeid', divDataID);
+ if (!Object.isUndefined(tvNode.DDProxy)) { return true; }
+
+ // attach DD
+ var t = new i2b2.sdx.TypeControllers.XML.DragDrop(divDataID)
+ t.yuiTree = tvTree;
+ t.yuiTreeNode = tvNode;
+ tvNode.DDProxy = t;
+
+ // clear the mouseover attachment function
+ var tdn = $(divDataID);
+ if (!Object.isUndefined(tdn.onmouseover)) {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ if (!Object.isUndefined(tdn.attributes)) {
+ for (var i=0;i<tdn.attributes.length; i++) {
+ if (tdn.attributes[i].name=="onmouseover") {
+ try {
+ delete tdn.onmouseover;
+ } catch(e) {
+ tdn.onmouseover;
+ }
+ }
+ }
+ }
+}
+
+
+
+
+// *********************************************************************************
+// DRAG DROP PROXY CONTROLLER
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.DragDrop = function(id, config) {
+ if (id) {
+ this.init(id, 'XML', {isTarget:false});
+ this.initFrame();
+ }
+ var s = this.getDragEl().style;
+ s.borderColor = "transparent";
+ s.opacity = 0.75;
+ s.filter = "alpha(opacity=75)";
+ s.whiteSpace = "nowrap";
+ s.overflow = "hidden";
+ s.textOverflow = "ellipsis";
+};
+YAHOO.extend(i2b2.sdx.TypeControllers.XML.DragDrop, YAHOO.util.DDProxy);
+i2b2.sdx.TypeControllers.XML.DragDrop.prototype.startDrag = function(x, y) {
+ var dragEl = this.getDragEl();
+ var clickEl = this.getEl();
+ dragEl.innerHTML = clickEl.innerHTML;
+ dragEl.className = clickEl.className;
+ dragEl.style.backgroundColor = '#FFFFEE';
+ dragEl.style.color = clickEl.style.color;
+ dragEl.style.border = "1px solid blue";
+ dragEl.style.width = "160px";
+ dragEl.style.height = "20px";
+ this.setDelta(15,10);
+};
+i2b2.sdx.TypeControllers.XML.DragDrop.prototype.endDrag = function(e, sdxType) {
+ // remove DragDrop targeting CCS
+ var targets = YAHOO.util.DDM.getRelated(this, true);
+ for (var i=0; i<targets.length; i++) {
+ var targetEl = targets[i]._domRef;
+ i2b2.sdx.Master.onHoverOut('XML', e, targetEl, this);
+ }
+};
+i2b2.sdx.TypeControllers.XML.DragDrop.prototype.alignElWithMouse = function(el, iPageX, iPageY) {
+ var oCoord = this.getTargetCoord(iPageX, iPageY);
+ if (!this.deltaSetXY) {
+ var aCoord = [oCoord.x, oCoord.y];
+ YAHOO.util.Dom.setXY(el, aCoord);
+ var newLeft = parseInt( YAHOO.util.Dom.getStyle(el, "left"), 10 );
+ var newTop = parseInt( YAHOO.util.Dom.getStyle(el, "top" ), 10 );
+ this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+ } else {
+ var posX = (oCoord.x + this.deltaSetXY[0]);
+ var posY = (oCoord.y + this.deltaSetXY[1]);
+ var scrSize = document.viewport.getDimensions();
+ var maxX = parseInt(scrSize.width-25-160);
+ var maxY = parseInt(scrSize.height-25);
+ if (posX > maxX) {posX = maxX;}
+ if (posX < 6) {posX = 6;}
+ if (posY > maxY) {posY = maxY;}
+ if (posY < 6) {posY = 6;}
+ YAHOO.util.Dom.setStyle(el, "left", posX + "px");
+ YAHOO.util.Dom.setStyle(el, "top", posY + "px");
+ }
+ this.cachePosition(oCoord.x, oCoord.y);
+ this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+};
+i2b2.sdx.TypeControllers.XML.DragDrop.prototype.onDragOver = function(e, id) {
+ // fire the onHoverOver (use SDX so targets can override default event handler)
+ i2b2.sdx.Master.onHoverOver('XML', e, id, this);
+};
+i2b2.sdx.TypeControllers.XML.DragDrop.prototype.onDragOut = function(e, id) {
+ // fire the onHoverOut handler (use SDX so targets can override default event handlers)
+ i2b2.sdx.Master.onHoverOut('XML', e, id, this);
+};
+i2b2.sdx.TypeControllers.XML.DragDrop.prototype.onDragDrop = function(e, id) {
+ i2b2.sdx.Master.onHoverOut('XML', e, id, this);
+ // retreive the concept data from the dragged element
+ draggedData = this.yuiTreeNode.data.i2b2_SDX;
+ i2b2.sdx.Master.ProcessDrop(draggedData, id);
+};
+
+
+
+// *********************************************************************************
+// <BLANK> DROP HANDLER
+// !!!! DO NOT EDIT - ATTACH YOUR OWN CUSTOM ROUTINE USING
+// !!!! THE i2b2.sdx.Master.setHandlerCustom FUNCTION
+// *********************************************************************************
+i2b2.sdx.TypeControllers.XML.DropHandler = function(sdxData) {
+ alert('[XML DROPPED] You need to create your own custom drop event handler.');
+}
+
+
+console.timeEnd('execute time');
console.groupEnd();
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_view.js b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/WORK_view.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_folder.gif b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_folder.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_folder_exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_folder_exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_root.gif b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_root.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_root_exp.gif b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/WORK_root_exp.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/main_list.css b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/main_list.css
old mode 100755
new mode 100644
index 2a5120c40..ecc9b7d4b
--- a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/main_list.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/main_list.css
@@ -1,2 +1,2 @@
-@import url(vwWork.css);
-@import url(sdx_WORK_XML.css);
+@import url(vwWork.css);
+@import url(sdx_WORK_XML.css);
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/sdx_WORK_XML.css b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/sdx_WORK_XML.css
old mode 100755
new mode 100644
index e013e3559..6c6a125f9
--- a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/sdx_WORK_XML.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/sdx_WORK_XML.css
@@ -1,26 +1,26 @@
-.sdxDefaultXML {
- font-family:arial,helvetica;
- font-size:12px;
- white-space:nowrap;
- vertical-align:bottom;
- cursor:pointer;
- line-height:16px;
-}
-.sdxDefaultXML img {
- height:16px;
- width:16px;
- border:none;
- padding-right:3px;
- vertical-align:bottom;
-}
-.sdxDefaultXML a {
- color:#000000;
- text-decoration:none;
-}
-.sdxDefaultXML a:hover {
- text-decoration:underline;
-}
-
-.ddXMLTarget {
- background:#FFFFBB !important;
-}
+.sdxDefaultXML {
+ font-family:arial,helvetica;
+ font-size:12px;
+ white-space:nowrap;
+ vertical-align:bottom;
+ cursor:pointer;
+ line-height:16px;
+}
+.sdxDefaultXML img {
+ height:16px;
+ width:16px;
+ border:none;
+ padding-right:3px;
+ vertical-align:bottom;
+}
+.sdxDefaultXML a {
+ color:#000000;
+ text-decoration:none;
+}
+.sdxDefaultXML a:hover {
+ text-decoration:underline;
+}
+
+.ddXMLTarget {
+ background:#FFFFBB !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/sdx_WORK_XML.gif b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/sdx_WORK_XML.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/vwWork.css b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/vwWork.css
old mode 100755
new mode 100644
index 029df1425..75173b739
--- a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/vwWork.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/vwWork.css
@@ -1,30 +1,30 @@
-
-DIV#wrkTreeview {
- background: #FFFFFF;
- border: 1px solid #667788;
- width:auto;
- padding:1px 5px;
- overflow: auto;
-}
-
-DIV#wrkWorkplace {
- position: absolute;
-}
-
-DIV#wrkWorkplace .bodyBox {
- background:#BBCCEE none repeat scroll 0% 50%;
- border:1px solid #667788;
- clear:both;
- display:block;
- height:auto;
- overflow:hidden;
- padding:5px;
- position:relative;
- top:-1px;
- width:auto;
- z-index:0;
-}
-
-.ddDropToWorkplace {
- background:#FFFF55 !important;
-}
+
+DIV#wrkTreeview {
+ background: #FFFFFF;
+ border: 1px solid #667788;
+ width:auto;
+ padding:1px 5px;
+ overflow: auto;
+}
+
+DIV#wrkWorkplace {
+ position: absolute;
+}
+
+DIV#wrkWorkplace .bodyBox {
+ background:#BBCCEE none repeat scroll 0% 50%;
+ border:1px solid #667788;
+ clear:both;
+ display:block;
+ height:auto;
+ overflow:hidden;
+ padding:5px;
+ position:relative;
+ top:-1px;
+ width:auto;
+ z-index:0;
+}
+
+.ddDropToWorkplace {
+ background:#FFFF55 !important;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/zoom_icon.gif b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/assets/zoom_icon.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/cell_config_data.js
old mode 100755
new mode 100644
index 81a89d67d..9cba467c9
--- a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/cell_config_data.js
@@ -1,20 +1,20 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files: [
- "WORK_ctrlr_general.js",
- "WORK_view.js",
- "WORK_sdx_WRK.js",
- "WORK_sdx_XML.js",
- "i2b2_msgs.js"
- ],
- css: ["main_list.css"], // ONLY USE 1 STYLE SHEET: http://support.microsoft.com/kb/262161
- config: {
- // additional configuration variables that are set by the system
- name: "Workplace Cell",
- icons: {
- size32x32: "WORK_icon_32x32.gif"
- },
- category: ["core","cell"]
- }
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files: [
+ "WORK_ctrlr_general.js",
+ "WORK_view.js",
+ "WORK_sdx_WRK.js",
+ "WORK_sdx_XML.js",
+ "i2b2_msgs.js"
+ ],
+ css: ["main_list.css"], // ONLY USE 1 STYLE SHEET: http://support.microsoft.com/kb/262161
+ config: {
+ // additional configuration variables that are set by the system
+ name: "Workplace Cell",
+ icons: {
+ size32x32: "WORK_icon_32x32.gif"
+ },
+ category: ["core","cell"]
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/WORK/i2b2_msgs.js b/shrine-webclient/src/main/html/js-i2b2/cells/WORK/i2b2_msgs.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/ExampComm_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/ExampComm_ctrlr.js
old mode 100755
new mode 100644
index 6bb9f6cc9..82ceffb86
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/ExampComm_ctrlr.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/ExampComm_ctrlr.js
@@ -1,296 +1,296 @@
-/**
- * @projectDescription Tool for interacting with standard Communicator objects within the web client (controller code).
- * @inherits i2b2
- * @namespace i2b2.ExampComm
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * ----------------------------------------------------------------------------------------
- * updated 3-3-09: Initial Launch [Nick Benik]
- */
-
-i2b2.ExampComm.Init = function(loadedDiv) {
- // this function is called after the HTML is loaded into the viewer DIV
- var selTrgt = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0];
- for (var mname in i2b2) {
- if (i2b2[mname].ajax) {
- if (Object.getClass(i2b2[mname].ajax) == "i2b2Base_communicator") {
- var t = "i2b2." + mname + ".ajax";
- var n = new Option(t, t);
- selTrgt.options[selTrgt.length] = n;
- }
- }
- }
- // populate function call list for defaultly selected communicator
- if (selTrgt.length > -1) {
- i2b2.ExampComm.model.commObj = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0].value;
- i2b2.ExampComm.loadCalls(i2b2.ExampComm.model.commObj);
- }
-
- // manage YUI tabs
- var cfgObj = {activeIndex : 0};
- this.yuiTabs = new YAHOO.widget.TabView("ExampComm-TABS", cfgObj);
- this.yuiTabs.on('activeTabChange', function(ev) {
- //Tabs have changed
- if (ev.newValue.get('id')=="ExampComm-TAB1") {
- i2b2.ExampComm.buildMsg();
- }
- });
-};
-
-
-
-i2b2.ExampComm.buildMsg = function(){
- var tag_values = {};
- var self = i2b2.ExampComm.model;
- var vals = {};
- var noesc = [];
- var cc = $$("DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow");
- for (var i = 0; i < cc.length; i++) {
- var tname = cc[i].select('.fieldname')[0].innerHTML;
- var tval = cc[i].select('textarea')[0].value;
- if (i2b2.ExampComm.model.tags[tname] && !i2b2.ExampComm.model.tags[tname].escaped) {
- tval = i2b2.h.Unescape(tval);
- noesc.push(tname);
- }
- i2b2.ExampComm.model.tags[tname].value = tval;
- vals[tname] = tval;
- }
-
- if (i == 0) {
- // no input grid variables were processed...
- $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-msgs")[0].hide();
- $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-directions")[0].show();
- return;
- }
-
- // apply message values to message template
- i2b2.h.EscapeTemplateVars(vals, noesc);
- var syntax = /(^|.|\r|\n)(\{{{\s*(\w+)\s*}}})/; //matches symbols like '{{{ field }}}'
- var t = new Template(self.msg, syntax);
- var sMessage = t.evaluate(vals);
- self.SendMsg = i2b2.h.Escape(sMessage);
-
- // display in GUI
- $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-directions")[0].hide();
- $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-msgs")[0].show();
- var msgPREs = $$("DIV#ExampComm-TABS DIV.results-msgs TABLE PRE");
- msgPREs[0].innerHTML = self.SendMsg;
- msgPREs[1].innerHTML = "Waiting for response...";
-
- // build callback handler to be executed when the Communicator results are returned (ASYNC method)
- var scoped_callback = new i2b2_scopedCallback;
- scoped_callback.scope = msgPREs[1];
- scoped_callback.callback = function(cbResults){
- this.innerHTML = i2b2.h.Escape(cbResults.msgResponse);
- console.dir(cbResults);
- }
- // fire the request
- var commObjRef = eval("("+self.commObj+")");
- commObjRef[self.commFunc]("PLUGIN:CommunicatorTool", vals, scoped_callback);
-};
-
-
-
-i2b2.ExampComm.Unload = function() {
- // this function is called before the plugin is unloaded by the framework
- return true;
-};
-
-
-
-i2b2.ExampComm.addCommObj = function(){
- var cn = prompt("Please enter the namespace of the Standard Communicator object within the web client.","i2b2.PLUGINCODE.ajax");
- if (!cn) { return; }
- try {
- if (i2b2.h.isBadObjPath(cn)) {
- alert("Sorry, an error occurred while trying to access the object. Recheck the object's location within the framework's namespace and try again.");
- return;
- }
- var co = eval("("+cn+")");
- if (Object.getClass(co) == "i2b2Base_communicator") {
- // we should really be checking to see if the object is already listed
- var selTrgt = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0];
- var n = new Option(cn, cn);
- selTrgt.options[selTrgt.length] = n;
- } else {
- alert("The object was found but is not a standard Communicator object created by i2b2.hive.communicatorFactory()");
- }
- } catch (e) {
- alert("Sorry, an general error has occurred.");
- }
-}
-
-i2b2.ExampComm.loadCalls = function(commNamespace){
- var selTrgt = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-funcList")[0];
- // delete function call list
- while (selTrgt.firstChild) {
- selTrgt.removeChild(selTrgt.firstChild);
- }
- // populate list
- try {
- if (i2b2.h.isBadObjPath(commNamespace)) {
- alert("Sorry, an error occurred while trying to access the object. Recheck the object's location within the framework's namespace and try again.");
- return;
- }
- var co = eval("("+commNamespace+")");
- if (Object.getClass(co) == "i2b2Base_communicator") {
- // read all the AJAX calls registered to the object
- for (var fn in co._commData) {
- var n = new Option(fn, fn);
- selTrgt.options[selTrgt.length] = n;
- }
- } else {
- alert("The object was found but is not a standard Communicator object created by i2b2.hive.communicatorFactory()");
- }
- } catch (e) {
- alert("Sorry, an general error has occurred.");
- }
-}
-
-
-i2b2.ExampComm.getTemplateVars = function(){
- try {
- var co = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0].value;
- var cc = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-funcList")[0].value;
-
- if (co.length < 1 || cc.length < 1) {
- return false;
- }
- var commObj = eval("(" + co + ")");
- var commMsg = commObj._commData[cc];
-
- var syntax = /(^|.|\r|\n)(\{{{\s*(\w+)\s*}}})/; //matches symbols like '{{{ field }}}'
- var tags = [];
- commMsg.msg.scan(syntax, function(match){ tags.push(match[3])});
- tags = tags.uniq();
- var ret = {
- tags: tags,
- noEscape: commMsg.dont_escape_params,
- msg: commMsg.msg
- }
- // proxy server data
- ret.proxy_info = ''
- var sUrl = i2b2[commObj.ParentCell].cfg.cellURL;
- sUrl = i2b2.h.Escape(sUrl);
- var t = new Template(commMsg.url, syntax);
- sUrl = t.evaluate({URL: sUrl});
- ret.funcURL = sUrl;
- var sProxy_Url = i2b2.h.getProxy();
- if (sProxy_Url) {
- ret.proxy_info = '<proxy>\n <redirect_url>' + sUrl + '</redirect_url>\n </proxy>\n';
- } else {
- sProxy_Url = sUrl;
- }
- ret.proxyURL = sProxy_Url;
- return ret;
- }
- catch (e) {
- return false;
- }
-}
-
-
-i2b2.ExampComm.createTemplateGrid = function(){
-
- var co = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0].value;
- var cc = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-funcList")[0].value;
- var domContainer = $$("DIV#ExampComm-mainDiv DIV.taglist")[0];
- var xTemplate = $('ExampComm-tagrowTEMPLATE');
- var xTags = i2b2.ExampComm.getTemplateVars();
-
- // save in global model
- i2b2.ExampComm.model.commObj = co;
- i2b2.ExampComm.model.commFunc = cc;
- i2b2.ExampComm.model.tags = {};
- i2b2.ExampComm.model.msg = xTags.msg;
-
- // clear existing input grid
- while (domContainer.firstChild) {
- domContainer.removeChild(domContainer.firstChild);
- }
- for (var i = 0; i < xTags.tags.length; i++) {
- var tagname = xTags.tags[i];
-
- i2b2.ExampComm.model.tags[tagname] = {};
-
- // clone the record DIV and add it to the display list
- var rec = xTemplate.cloneNode(true);
- rec.id ="";
- // change the fieldname
- var part = Element.select(rec, '.fieldname')[0];
- part.innerHTML = tagname;
- // is the field escaped
- var part = Element.select(rec,'.escaped')[0];
- if (xTags.noEscape.indexOf(tagname) != -1) {
- part.innerHTML = "&nbsp;";
- i2b2.ExampComm.model.tags[tagname].escaped = false;
- } else {
- i2b2.ExampComm.model.tags[tagname].escaped = true;
- }
- // populate the default values of common tags
- var tag_val = '';
- switch (tagname) {
- case "proxy_info":
- tag_val = xTags.proxy_info;
- break;
- case "sec_user":
- tag_val = i2b2.h.getUser();
- break;
- case "sec_pass_node":
- case "sec_pass":
- tag_val = i2b2.h.getPass();
- break;
- case "sec_domain":
- tag_val = i2b2.h.getDomain();
- break;
- case "sec_project":
- tag_val = i2b2.h.getProject();
- break;
- case "header_msg_id":
- tag_val = i2b2.h.GenerateAlphaNumId(20);
- break;
- case "result_wait_time":
- tag_val = 180;
- break;
- case "header_msg_datetime":
- tag_val = i2b2.h.GenerateISO8601DateTime();
- break;
- }
- var part = Element.select(rec, 'TEXTAREA')[0];
- part.value = tag_val;
- i2b2.ExampComm.model.tags[tagname].value = tag_val;
- // remove the break line if we are the last row
- if (i == xTags.tags.length - 1) {
- part = rec.select('.bline')[0];
- part.style.border = "none";
- }
-
- // attach the record into our DOM tree
- domContainer.appendChild(rec);
- Element.show(rec);
- }
- domContainer.show();
-}
-
-
-i2b2.ExampComm.getResults = function() {
- // Refresh the display with info of the SDX record that was DragDropped
- if (i2b2.ExampComm.model.dirtyResultsData) {
- var dropRecord = i2b2.ExampComm.model.currentRec;
- $$("DIV#ExampComm-mainDiv DIV#ExampComm-TABS DIV.results-directions")[0].hide();
- $$("DIV#ExampComm-mainDiv DIV#ExampComm-TABS DIV.results-finished")[0].show();
- var sdxDisplay = $$("DIV#ExampComm-mainDiv DIV#ExampComm-InfoSDX")[0];
- Element.select(sdxDisplay, '.sdxDisplayName')[0].innerHTML = dropRecord.sdxInfo.sdxDisplayName;
- Element.select(sdxDisplay, '.sdxType')[0].innerHTML = dropRecord.sdxInfo.sdxType;
- Element.select(sdxDisplay, '.sdxControlCell')[0].innerHTML = dropRecord.sdxInfo.sdxControlCell;
- Element.select(sdxDisplay, '.sdxKeyName')[0].innerHTML = dropRecord.sdxInfo.sdxKeyName;
- Element.select(sdxDisplay, '.sdxKeyValue')[0].innerHTML = dropRecord.sdxInfo.sdxKeyValue;
- // we must escape the xml text or the browser will attempt to interpret it as HTML
- var xmlDisplay = i2b2.h.Xml2String(dropRecord.origData.xmlOrig);
- xmlDisplay = '<pre>'+i2b2.h.Escape(xmlDisplay)+'</pre>';
- Element.select(sdxDisplay, '.originalXML')[0].innerHTML = xmlDisplay;
- }
-
- // optimization - only requery when the input data is changed
- i2b2.ExampComm.model.dirtyResultsData = false;
-}
+/**
+ * @projectDescription Tool for interacting with standard Communicator objects within the web client (controller code).
+ * @inherits i2b2
+ * @namespace i2b2.ExampComm
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ * updated 3-3-09: Initial Launch [Nick Benik]
+ */
+
+i2b2.ExampComm.Init = function(loadedDiv) {
+ // this function is called after the HTML is loaded into the viewer DIV
+ var selTrgt = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0];
+ for (var mname in i2b2) {
+ if (i2b2[mname].ajax) {
+ if (Object.getClass(i2b2[mname].ajax) == "i2b2Base_communicator") {
+ var t = "i2b2." + mname + ".ajax";
+ var n = new Option(t, t);
+ selTrgt.options[selTrgt.length] = n;
+ }
+ }
+ }
+ // populate function call list for defaultly selected communicator
+ if (selTrgt.length > -1) {
+ i2b2.ExampComm.model.commObj = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0].value;
+ i2b2.ExampComm.loadCalls(i2b2.ExampComm.model.commObj);
+ }
+
+ // manage YUI tabs
+ var cfgObj = {activeIndex : 0};
+ this.yuiTabs = new YAHOO.widget.TabView("ExampComm-TABS", cfgObj);
+ this.yuiTabs.on('activeTabChange', function(ev) {
+ //Tabs have changed
+ if (ev.newValue.get('id')=="ExampComm-TAB1") {
+ i2b2.ExampComm.buildMsg();
+ }
+ });
+};
+
+
+
+i2b2.ExampComm.buildMsg = function(){
+ var tag_values = {};
+ var self = i2b2.ExampComm.model;
+ var vals = {};
+ var noesc = [];
+ var cc = $$("DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow");
+ for (var i = 0; i < cc.length; i++) {
+ var tname = cc[i].select('.fieldname')[0].innerHTML;
+ var tval = cc[i].select('textarea')[0].value;
+ if (i2b2.ExampComm.model.tags[tname] && !i2b2.ExampComm.model.tags[tname].escaped) {
+ tval = i2b2.h.Unescape(tval);
+ noesc.push(tname);
+ }
+ i2b2.ExampComm.model.tags[tname].value = tval;
+ vals[tname] = tval;
+ }
+
+ if (i == 0) {
+ // no input grid variables were processed...
+ $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-msgs")[0].hide();
+ $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-directions")[0].show();
+ return;
+ }
+
+ // apply message values to message template
+ i2b2.h.EscapeTemplateVars(vals, noesc);
+ var syntax = /(^|.|\r|\n)(\{{{\s*(\w+)\s*}}})/; //matches symbols like '{{{ field }}}'
+ var t = new Template(self.msg, syntax);
+ var sMessage = t.evaluate(vals);
+ self.SendMsg = i2b2.h.Escape(sMessage);
+
+ // display in GUI
+ $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-directions")[0].hide();
+ $$("DIV#ExampComm-mainDiv DIV.ExampComm-MainContent DIV.results-msgs")[0].show();
+ var msgPREs = $$("DIV#ExampComm-TABS DIV.results-msgs TABLE PRE");
+ msgPREs[0].innerHTML = self.SendMsg;
+ msgPREs[1].innerHTML = "Waiting for response...";
+
+ // build callback handler to be executed when the Communicator results are returned (ASYNC method)
+ var scoped_callback = new i2b2_scopedCallback;
+ scoped_callback.scope = msgPREs[1];
+ scoped_callback.callback = function(cbResults){
+ this.innerHTML = i2b2.h.Escape(cbResults.msgResponse);
+ console.dir(cbResults);
+ }
+ // fire the request
+ var commObjRef = eval("("+self.commObj+")");
+ commObjRef[self.commFunc]("PLUGIN:CommunicatorTool", vals, scoped_callback);
+};
+
+
+
+i2b2.ExampComm.Unload = function() {
+ // this function is called before the plugin is unloaded by the framework
+ return true;
+};
+
+
+
+i2b2.ExampComm.addCommObj = function(){
+ var cn = prompt("Please enter the namespace of the Standard Communicator object within the web client.","i2b2.PLUGINCODE.ajax");
+ if (!cn) { return; }
+ try {
+ if (i2b2.h.isBadObjPath(cn)) {
+ alert("Sorry, an error occurred while trying to access the object. Recheck the object's location within the framework's namespace and try again.");
+ return;
+ }
+ var co = eval("("+cn+")");
+ if (Object.getClass(co) == "i2b2Base_communicator") {
+ // we should really be checking to see if the object is already listed
+ var selTrgt = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0];
+ var n = new Option(cn, cn);
+ selTrgt.options[selTrgt.length] = n;
+ } else {
+ alert("The object was found but is not a standard Communicator object created by i2b2.hive.communicatorFactory()");
+ }
+ } catch (e) {
+ alert("Sorry, an general error has occurred.");
+ }
+}
+
+i2b2.ExampComm.loadCalls = function(commNamespace){
+ var selTrgt = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-funcList")[0];
+ // delete function call list
+ while (selTrgt.firstChild) {
+ selTrgt.removeChild(selTrgt.firstChild);
+ }
+ // populate list
+ try {
+ if (i2b2.h.isBadObjPath(commNamespace)) {
+ alert("Sorry, an error occurred while trying to access the object. Recheck the object's location within the framework's namespace and try again.");
+ return;
+ }
+ var co = eval("("+commNamespace+")");
+ if (Object.getClass(co) == "i2b2Base_communicator") {
+ // read all the AJAX calls registered to the object
+ for (var fn in co._commData) {
+ var n = new Option(fn, fn);
+ selTrgt.options[selTrgt.length] = n;
+ }
+ } else {
+ alert("The object was found but is not a standard Communicator object created by i2b2.hive.communicatorFactory()");
+ }
+ } catch (e) {
+ alert("Sorry, an general error has occurred.");
+ }
+}
+
+
+i2b2.ExampComm.getTemplateVars = function(){
+ try {
+ var co = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0].value;
+ var cc = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-funcList")[0].value;
+
+ if (co.length < 1 || cc.length < 1) {
+ return false;
+ }
+ var commObj = eval("(" + co + ")");
+ var commMsg = commObj._commData[cc];
+
+ var syntax = /(^|.|\r|\n)(\{{{\s*(\w+)\s*}}})/; //matches symbols like '{{{ field }}}'
+ var tags = [];
+ commMsg.msg.scan(syntax, function(match){ tags.push(match[3])});
+ tags = tags.uniq();
+ var ret = {
+ tags: tags,
+ noEscape: commMsg.dont_escape_params,
+ msg: commMsg.msg
+ }
+ // proxy server data
+ ret.proxy_info = ''
+ var sUrl = i2b2[commObj.ParentCell].cfg.cellURL;
+ sUrl = i2b2.h.Escape(sUrl);
+ var t = new Template(commMsg.url, syntax);
+ sUrl = t.evaluate({URL: sUrl});
+ ret.funcURL = sUrl;
+ var sProxy_Url = i2b2.h.getProxy();
+ if (sProxy_Url) {
+ ret.proxy_info = '<proxy>\n <redirect_url>' + sUrl + '</redirect_url>\n </proxy>\n';
+ } else {
+ sProxy_Url = sUrl;
+ }
+ ret.proxyURL = sProxy_Url;
+ return ret;
+ }
+ catch (e) {
+ return false;
+ }
+}
+
+
+i2b2.ExampComm.createTemplateGrid = function(){
+
+ var co = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-objList")[0].value;
+ var cc = $$("DIV#ExampComm-mainDiv SELECT#ExampComm-funcList")[0].value;
+ var domContainer = $$("DIV#ExampComm-mainDiv DIV.taglist")[0];
+ var xTemplate = $('ExampComm-tagrowTEMPLATE');
+ var xTags = i2b2.ExampComm.getTemplateVars();
+
+ // save in global model
+ i2b2.ExampComm.model.commObj = co;
+ i2b2.ExampComm.model.commFunc = cc;
+ i2b2.ExampComm.model.tags = {};
+ i2b2.ExampComm.model.msg = xTags.msg;
+
+ // clear existing input grid
+ while (domContainer.firstChild) {
+ domContainer.removeChild(domContainer.firstChild);
+ }
+ for (var i = 0; i < xTags.tags.length; i++) {
+ var tagname = xTags.tags[i];
+
+ i2b2.ExampComm.model.tags[tagname] = {};
+
+ // clone the record DIV and add it to the display list
+ var rec = xTemplate.cloneNode(true);
+ rec.id ="";
+ // change the fieldname
+ var part = Element.select(rec, '.fieldname')[0];
+ part.innerHTML = tagname;
+ // is the field escaped
+ var part = Element.select(rec,'.escaped')[0];
+ if (xTags.noEscape.indexOf(tagname) != -1) {
+ part.innerHTML = "&nbsp;";
+ i2b2.ExampComm.model.tags[tagname].escaped = false;
+ } else {
+ i2b2.ExampComm.model.tags[tagname].escaped = true;
+ }
+ // populate the default values of common tags
+ var tag_val = '';
+ switch (tagname) {
+ case "proxy_info":
+ tag_val = xTags.proxy_info;
+ break;
+ case "sec_user":
+ tag_val = i2b2.h.getUser();
+ break;
+ case "sec_pass_node":
+ case "sec_pass":
+ tag_val = i2b2.h.getPass();
+ break;
+ case "sec_domain":
+ tag_val = i2b2.h.getDomain();
+ break;
+ case "sec_project":
+ tag_val = i2b2.h.getProject();
+ break;
+ case "header_msg_id":
+ tag_val = i2b2.h.GenerateAlphaNumId(20);
+ break;
+ case "result_wait_time":
+ tag_val = 180;
+ break;
+ case "header_msg_datetime":
+ tag_val = i2b2.h.GenerateISO8601DateTime();
+ break;
+ }
+ var part = Element.select(rec, 'TEXTAREA')[0];
+ part.value = tag_val;
+ i2b2.ExampComm.model.tags[tagname].value = tag_val;
+ // remove the break line if we are the last row
+ if (i == xTags.tags.length - 1) {
+ part = rec.select('.bline')[0];
+ part.style.border = "none";
+ }
+
+ // attach the record into our DOM tree
+ domContainer.appendChild(rec);
+ Element.show(rec);
+ }
+ domContainer.show();
+}
+
+
+i2b2.ExampComm.getResults = function() {
+ // Refresh the display with info of the SDX record that was DragDropped
+ if (i2b2.ExampComm.model.dirtyResultsData) {
+ var dropRecord = i2b2.ExampComm.model.currentRec;
+ $$("DIV#ExampComm-mainDiv DIV#ExampComm-TABS DIV.results-directions")[0].hide();
+ $$("DIV#ExampComm-mainDiv DIV#ExampComm-TABS DIV.results-finished")[0].show();
+ var sdxDisplay = $$("DIV#ExampComm-mainDiv DIV#ExampComm-InfoSDX")[0];
+ Element.select(sdxDisplay, '.sdxDisplayName')[0].innerHTML = dropRecord.sdxInfo.sdxDisplayName;
+ Element.select(sdxDisplay, '.sdxType')[0].innerHTML = dropRecord.sdxInfo.sdxType;
+ Element.select(sdxDisplay, '.sdxControlCell')[0].innerHTML = dropRecord.sdxInfo.sdxControlCell;
+ Element.select(sdxDisplay, '.sdxKeyName')[0].innerHTML = dropRecord.sdxInfo.sdxKeyName;
+ Element.select(sdxDisplay, '.sdxKeyValue')[0].innerHTML = dropRecord.sdxInfo.sdxKeyValue;
+ // we must escape the xml text or the browser will attempt to interpret it as HTML
+ var xmlDisplay = i2b2.h.Xml2String(dropRecord.origData.xmlOrig);
+ xmlDisplay = '<pre>'+i2b2.h.Escape(xmlDisplay)+'</pre>';
+ Element.select(sdxDisplay, '.originalXML')[0].innerHTML = xmlDisplay;
+ }
+
+ // optimization - only requery when the input data is changed
+ i2b2.ExampComm.model.dirtyResultsData = false;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/injected_screens.html
old mode 100755
new mode 100644
index bdd43286e..ddecb6d81
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/injected_screens.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/injected_screens.html
@@ -1,76 +1,76 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <body>
- <div id='ExampComm-mainDiv'>
-
-
- <div id="ExampComm-TABS" class="yui-navset">
- <ul class="yui-nav">
- <li id="ExampComm-TAB0" class="selected"><a href="#ExampComm-TAB0"><em>Message Setup</em></a></li>
- <li id="ExampComm-TAB1"><a href="#ExampComm-TAB1"><em>View Results</em></a></li>
- <li id="ExampComm-TAB2"><a href="#ExampComm-TAB2"><em>Help</em></a></li>
- </ul>
-
-
-
- <div class="yui-content" id="ExampComm-CONTENT">
- <div>
- <div class="ExampComm-MainContent">
- <div class="ExampComm-MainContentPad">
- <input type="button" style="float:right; margin-right:4px;position:relative; top: 50px; width:90px; height:60px" value="Load Grid" onclick="i2b2.ExampComm.createTemplateGrid()" />
- <div>Select a communicator object and populate its input data below, and then click the "View Results" tab for the resulting XML messages sent and recieved.</div>
- <div><br /></div>
- <div class="selector" style="width:550px"><input class="addComm" type="button" value="Add" style="width:46px" onclick="i2b2.ExampComm.addCommObj()"><select id="ExampComm-objList" onchange="i2b2.ExampComm.loadCalls(this.value)"></select><div>Communicator Object:</div></div>
- <div class="selector"><select id="ExampComm-funcList"></select><div></>Function Call:</div></div>
- </div>
- <div class="taglist" style="display:none"></div>
- <div>&nbsp;</div>
- <div class="tagrow" style="display:none" id="ExampComm-tagrowTEMPLATE">
- <textarea>template value</textarea>
- <div class="fieldname">qwerqwe_asdf</div>
- <div class="escaped">(Escaped)</div>
- <div class="bline"></div>
- </div>
- </div>
- </div>
- <div>
- <div class="ExampComm-MainContent">
- <div class="results-directions">You must first setup a Communicator-based AJAX call.<br />Please return to the "Message Setup" tab.</div>
- <div class="results-msgs" style="display:none;">
- <table><tbody>
- <tr><th>PDO Request</th>
- <td class="InfoPDO-Request">
- <div class="originalXML"><pre></pre></div>
- </td></tr>
- <tr><th>PDO Response</th>
- <td class="InfoPDO-Response">
- <div class="originalXML"><pre></pre></div>
- </td></tr>
- </tbody></table>
- </div>
- </div>
- </div>
- <div>
- <div class="ExampComm-MainContent">
- <div class="ExampComm-MainContentPad">
- <h1>Example #5 - Communicator Test Tool</h1>
- <hr size="1" noshade>
- <h2>Introduction</h2>
- This plugin demonstrates provides an interface to interact with Cell Communicator objects based on the web client's standardized i2b2 communicator objects.
- The this plugin will search all loaded plugins and core modules within the web client looking for a standard Cell Communicator object at the namespace <span style="font-family:monospace">i2b2.<i>PLUGINCODE</i>.ajax</span>.
- <h2>Instructions</h2>
- Navigate to the "Specify Data" tab. Then, drag and drop an i2b2 object such as a search term or previous query onto the input box. Finally, click the "View Results" tab for information about that object.
- <h2>About Us</h2>
- This plugin was created by Nick Benik and Griffin Weber, MD, PhD.
- <h2>Terms of Use</h2>
- This example plugin is distributed with the i2b2 web client framework and may be used free of charge.
- </div>
- </div>
- </div>
- </div>
- </div>
-
-
- </div>
- </body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <body>
+ <div id='ExampComm-mainDiv'>
+
+
+ <div id="ExampComm-TABS" class="yui-navset">
+ <ul class="yui-nav">
+ <li id="ExampComm-TAB0" class="selected"><a href="#ExampComm-TAB0"><em>Message Setup</em></a></li>
+ <li id="ExampComm-TAB1"><a href="#ExampComm-TAB1"><em>View Results</em></a></li>
+ <li id="ExampComm-TAB2"><a href="#ExampComm-TAB2"><em>Help</em></a></li>
+ </ul>
+
+
+
+ <div class="yui-content" id="ExampComm-CONTENT">
+ <div>
+ <div class="ExampComm-MainContent">
+ <div class="ExampComm-MainContentPad">
+ <input type="button" style="float:right; margin-right:4px;position:relative; top: 50px; width:90px; height:60px" value="Load Grid" onclick="i2b2.ExampComm.createTemplateGrid()" />
+ <div>Select a communicator object and populate its input data below, and then click the "View Results" tab for the resulting XML messages sent and recieved.</div>
+ <div><br /></div>
+ <div class="selector" style="width:550px"><input class="addComm" type="button" value="Add" style="width:46px" onclick="i2b2.ExampComm.addCommObj()"><select id="ExampComm-objList" onchange="i2b2.ExampComm.loadCalls(this.value)"></select><div>Communicator Object:</div></div>
+ <div class="selector"><select id="ExampComm-funcList"></select><div></>Function Call:</div></div>
+ </div>
+ <div class="taglist" style="display:none"></div>
+ <div>&nbsp;</div>
+ <div class="tagrow" style="display:none" id="ExampComm-tagrowTEMPLATE">
+ <textarea>template value</textarea>
+ <div class="fieldname">qwerqwe_asdf</div>
+ <div class="escaped">(Escaped)</div>
+ <div class="bline"></div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ExampComm-MainContent">
+ <div class="results-directions">You must first setup a Communicator-based AJAX call.<br />Please return to the "Message Setup" tab.</div>
+ <div class="results-msgs" style="display:none;">
+ <table><tbody>
+ <tr><th>PDO Request</th>
+ <td class="InfoPDO-Request">
+ <div class="originalXML"><pre></pre></div>
+ </td></tr>
+ <tr><th>PDO Response</th>
+ <td class="InfoPDO-Response">
+ <div class="originalXML"><pre></pre></div>
+ </td></tr>
+ </tbody></table>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ExampComm-MainContent">
+ <div class="ExampComm-MainContentPad">
+ <h1>Example #5 - Communicator Test Tool</h1>
+ <hr size="1" noshade>
+ <h2>Introduction</h2>
+ This plugin demonstrates provides an interface to interact with Cell Communicator objects based on the web client's standardized i2b2 communicator objects.
+ The this plugin will search all loaded plugins and core modules within the web client looking for a standard Cell Communicator object at the namespace <span style="font-family:monospace">i2b2.<i>PLUGINCODE</i>.ajax</span>.
+ <h2>Instructions</h2>
+ Navigate to the "Specify Data" tab. Then, drag and drop an i2b2 object such as a search term or previous query onto the input box. Finally, click the "View Results" tab for information about that object.
+ <h2>About Us</h2>
+ This plugin was created by Nick Benik and Griffin Weber, MD, PhD.
+ <h2>Terms of Use</h2>
+ This example plugin is distributed with the i2b2 web client framework and may be used free of charge.
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+ </body>
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/vwExampComm.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/vwExampComm.css
old mode 100755
new mode 100644
index 4376880f3..ee591c8b1
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/vwExampComm.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/assets/vwExampComm.css
@@ -1,151 +1,151 @@
-/*** CSS for main plugin wrapper ***/
-
-DIV#ExampComm-mainDiv {
- padding: 0px;
-}
-
-
-
-/*** CSS for tab background ***/
-
-DIV#ExampComm-TABS DIV.yui-content {
- background: #FFF;
-}
-DIV#ExampComm-TABS DIV.ExampComm-MainContent {
- background:#FFF;
- border:solid #63758C;
- border-width:1px 0;
- overflow:auto;
- height:100%;
-}
-DIV#ExampComm-TABS DIV.ExampComm-MainContentPad {
- padding:10px 10px;
-}
-
-
-
-/*** CSS for the Specify Data tab ***/
-
-DIV#ExampComm-mainDiv DIV.selector {
- clear:both;
- width: 500px;
-}
-DIV#ExampComm-mainDiv DIV.selector DIV {
- float: right;
- margin-right: 10px;
- font-weight: bold;
-}
-
-DIV#ExampComm-mainDiv DIV.selector SELECT {
- float: right;
- width: 300px;
-}
-
-DIV#ExampComm-mainDiv DIV.selector INPUT.addComm {
- float:right;
- margin-left:4px;
- position:relative;
- top:-2px;
- width:46px;
-}
-
-/** tags form **/
-DIV#ExampComm-mainDiv DIV.taglist {
- clear: both;
- border: 1px solid rgb(0, 0, 0);
- background: #ECF0FF;
- margin: 50px 10px 0px 10px;
-}
-DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow {
- width: 100%;
- padding-top: 4px;
-}
-DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow TEXTAREA {
- border: 1px solid rgb(0, 0, 0);
- float: right;
- width: 560px;
- height: 82px;
- margin-right: 6px;
-}
-DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow DIV.fieldname {
- margin-left: 10px;
- width: 130px;
- font-weight: bold;
-}
-DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow DIV.escaped { margin-left: 10px; }
-DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow DIV.bline {
- border-top: 1px solid rgb(204, 204, 204);
- margin: 58px 0px 3px;
- clear: both;
-}
-
-
-
-
-
-/*** CSS for the View Results tab ***/
-
-DIV#ExampComm-TABS DIV.results-directions {
- padding: 10px;
- text-align:center;
- margin-top:5%;
-}
-DIV#ExampComm-TABS DIV.results-msgs {
- margin:10px;
-}
-
-DIV#ExampComm-TABS DIV.results-msgs TABLE {
- border-collapse:collapse;
- margin:0 10px 10px;
-}
-
-DIV#ExampComm-TABS DIV.results-msgs TABLE TH {
- background-color:#CEDBEF;
- border:1px solid #63758C;
- padding:5px;
- width:150px;
-}
-
-DIV#ExampComm-TABS DIV.results-msgs TABLE TD {
- background-color:#DEEBEF;
- border:1px solid #63758C;
- overflow:auto;
- padding: 0px;
- width:300px;
-}
-
-DIV#ExampComm-TABS DIV.results-msgs TABLE .originalXML {
- height:150px;
- margin:0;
- overflow:hidden;
- padding:0;
-}
-
-DIV#ExampComm-TABS DIV.results-msgs TABLE PRE {
- display:block;
- height:140px;
- margin:0;
- overflow:scroll;
- padding:5px;
- width:300px;
-}
-
-
-
-/*** CSS for the Plugin Help tab ***/
-
-DIV#ExampComm-TABS H1 {
- margin:0 0 10px 0;
- font-size:16px;
- color:#42558C;
- font-weight:bold;
-}
-DIV#ExampComm-TABS H2 {
- margin:10px 0 10px 0;
- font-size:13px;
- color:#42558C;
- font-weight:bold;
-}
-DIV#ExampComm-TABS HR {
- margin:0;
+/*** CSS for main plugin wrapper ***/
+
+DIV#ExampComm-mainDiv {
+ padding: 0px;
+}
+
+
+
+/*** CSS for tab background ***/
+
+DIV#ExampComm-TABS DIV.yui-content {
+ background: #FFF;
+}
+DIV#ExampComm-TABS DIV.ExampComm-MainContent {
+ background:#FFF;
+ border:solid #63758C;
+ border-width:1px 0;
+ overflow:auto;
+ height:100%;
+}
+DIV#ExampComm-TABS DIV.ExampComm-MainContentPad {
+ padding:10px 10px;
+}
+
+
+
+/*** CSS for the Specify Data tab ***/
+
+DIV#ExampComm-mainDiv DIV.selector {
+ clear:both;
+ width: 500px;
+}
+DIV#ExampComm-mainDiv DIV.selector DIV {
+ float: right;
+ margin-right: 10px;
+ font-weight: bold;
+}
+
+DIV#ExampComm-mainDiv DIV.selector SELECT {
+ float: right;
+ width: 300px;
+}
+
+DIV#ExampComm-mainDiv DIV.selector INPUT.addComm {
+ float:right;
+ margin-left:4px;
+ position:relative;
+ top:-2px;
+ width:46px;
+}
+
+/** tags form **/
+DIV#ExampComm-mainDiv DIV.taglist {
+ clear: both;
+ border: 1px solid rgb(0, 0, 0);
+ background: #ECF0FF;
+ margin: 50px 10px 0px 10px;
+}
+DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow {
+ width: 100%;
+ padding-top: 4px;
+}
+DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow TEXTAREA {
+ border: 1px solid rgb(0, 0, 0);
+ float: right;
+ width: 560px;
+ height: 82px;
+ margin-right: 6px;
+}
+DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow DIV.fieldname {
+ margin-left: 10px;
+ width: 130px;
+ font-weight: bold;
+}
+DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow DIV.escaped { margin-left: 10px; }
+DIV#ExampComm-mainDiv DIV.taglist DIV.tagrow DIV.bline {
+ border-top: 1px solid rgb(204, 204, 204);
+ margin: 58px 0px 3px;
+ clear: both;
+}
+
+
+
+
+
+/*** CSS for the View Results tab ***/
+
+DIV#ExampComm-TABS DIV.results-directions {
+ padding: 10px;
+ text-align:center;
+ margin-top:5%;
+}
+DIV#ExampComm-TABS DIV.results-msgs {
+ margin:10px;
+}
+
+DIV#ExampComm-TABS DIV.results-msgs TABLE {
+ border-collapse:collapse;
+ margin:0 10px 10px;
+}
+
+DIV#ExampComm-TABS DIV.results-msgs TABLE TH {
+ background-color:#CEDBEF;
+ border:1px solid #63758C;
+ padding:5px;
+ width:150px;
+}
+
+DIV#ExampComm-TABS DIV.results-msgs TABLE TD {
+ background-color:#DEEBEF;
+ border:1px solid #63758C;
+ overflow:auto;
+ padding: 0px;
+ width:300px;
+}
+
+DIV#ExampComm-TABS DIV.results-msgs TABLE .originalXML {
+ height:150px;
+ margin:0;
+ overflow:hidden;
+ padding:0;
+}
+
+DIV#ExampComm-TABS DIV.results-msgs TABLE PRE {
+ display:block;
+ height:140px;
+ margin:0;
+ overflow:scroll;
+ padding:5px;
+ width:300px;
+}
+
+
+
+/*** CSS for the Plugin Help tab ***/
+
+DIV#ExampComm-TABS H1 {
+ margin:0 0 10px 0;
+ font-size:16px;
+ color:#42558C;
+ font-weight:bold;
+}
+DIV#ExampComm-TABS H2 {
+ margin:10px 0 10px 0;
+ font-size:13px;
+ color:#42558C;
+ font-weight:bold;
+}
+DIV#ExampComm-TABS HR {
+ margin:0;
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/cell_config_data.js
old mode 100755
new mode 100644
index e37acf1eb..03db4cb45
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampComm/cell_config_data.js
@@ -1,22 +1,22 @@
-// this file contains a list of all files that need to be loaded dynamically for this plugin
-// every file in this list will be loaded after the plugin's Init function is called
-{
- files:[ "ExampComm_ctrlr.js" ],
- css:[ "vwExampComm.css" ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "Communicator Tool",
- name: "Example #5 - Communicator Tool",
- description: "This plugin allows you to interact directly with standard Cell Communicator objects within the web client framework.",
- category: ["celless","plugin","examples"],
- plugin: {
- isolateHtml: false,
- isolateComm: false,
- standardTabs: true,
- html: {
- source: 'injected_screens.html',
- mainDivId: 'ExampComm-mainDiv'
- }
- }
- }
+// this file contains a list of all files that need to be loaded dynamically for this plugin
+// every file in this list will be loaded after the plugin's Init function is called
+{
+ files:[ "ExampComm_ctrlr.js" ],
+ css:[ "vwExampComm.css" ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "Communicator Tool",
+ name: "Example #5 - Communicator Tool",
+ description: "This plugin allows you to interact directly with standard Cell Communicator objects within the web client framework.",
+ category: ["celless","plugin","examples"],
+ plugin: {
+ isolateHtml: false,
+ isolateComm: false,
+ standardTabs: true,
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'ExampComm-mainDiv'
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/ExampHello.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/ExampHello.js
old mode 100755
new mode 100644
index 9ff9065e6..d7a8c4d29
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/ExampHello.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/ExampHello.js
@@ -1,39 +1,39 @@
-/**
- * @projectDescription Example of a "Hello World" plugin.
- * @inherits i2b2
- * @namespace i2b2.ExampHello
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * ----------------------------------------------------------------------------------------
- * updated 10-30-08: Initial Launch [Nick Benik]
- */
-
-i2b2.ExampHello.Init = function(loadedDiv) {
- // this function is called after the HTML is loaded into the viewer DIV
- // find all the drop targets by style for PRS type
- i2b2.ExampHello.view.containerDiv = loadedDiv;
-
- alert("Hello World! This message is from the initialization routine.");
-
-};
-
-i2b2.ExampHello.Unload = function() {
- // this function is called before the plugin is unloaded by the framework
- // alert("Hello World! This message is from the unload routine.");
- return true;
-
- // If you want to cancel the unload return false. The next line is boiler plate code that should work
- // in many instances. This routine can also be used to save the state of the plugin so that work can
- // seamlessly resume the plugin is loaded.
- // return confirm("Are you sure you want to unload the Hello World plugin?");
-}
-
-i2b2.ExampHello.Resize = function(resizeInfo) {
- // Optional function that is automatically called by the plugin framework when ever a resize occurs.
- // Data format for resizeInfo variable:
- // resizeInfo.top = top location in pixels (absolute)
- // resizeInfo.left = left location in pixels (absolute)
- // resizeInfo.width = new width in pixels
- // resizeInfo.height = new height in pixels
-}
-
+/**
+ * @projectDescription Example of a "Hello World" plugin.
+ * @inherits i2b2
+ * @namespace i2b2.ExampHello
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ * updated 10-30-08: Initial Launch [Nick Benik]
+ */
+
+i2b2.ExampHello.Init = function(loadedDiv) {
+ // this function is called after the HTML is loaded into the viewer DIV
+ // find all the drop targets by style for PRS type
+ i2b2.ExampHello.view.containerDiv = loadedDiv;
+
+ alert("Hello World! This message is from the initialization routine.");
+
+};
+
+i2b2.ExampHello.Unload = function() {
+ // this function is called before the plugin is unloaded by the framework
+ // alert("Hello World! This message is from the unload routine.");
+ return true;
+
+ // If you want to cancel the unload return false. The next line is boiler plate code that should work
+ // in many instances. This routine can also be used to save the state of the plugin so that work can
+ // seamlessly resume the plugin is loaded.
+ // return confirm("Are you sure you want to unload the Hello World plugin?");
+}
+
+i2b2.ExampHello.Resize = function(resizeInfo) {
+ // Optional function that is automatically called by the plugin framework when ever a resize occurs.
+ // Data format for resizeInfo variable:
+ // resizeInfo.top = top location in pixels (absolute)
+ // resizeInfo.left = left location in pixels (absolute)
+ // resizeInfo.width = new width in pixels
+ // resizeInfo.height = new height in pixels
+}
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/ExampHello.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/ExampHello.css
old mode 100755
new mode 100644
index 12e6c8ac7..832ae05f7
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/ExampHello.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/ExampHello.css
@@ -1,11 +1,11 @@
-DIV#ExampHello-mainDiv {
- padding: 8px;
- text-align:left;
-}
-
-DIV#ExampHello-mainDiv DIV.helloDiv{
- padding: 50px;
- background: #DDF;
- text-align:center;
- border: 1px solid #000000
+DIV#ExampHello-mainDiv {
+ padding: 8px;
+ text-align:left;
+}
+
+DIV#ExampHello-mainDiv DIV.helloDiv{
+ padding: 50px;
+ background: #DDF;
+ text-align:center;
+ border: 1px solid #000000
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/injected_screens.html
old mode 100755
new mode 100644
index 13acc1e41..ac88b5cbc
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/injected_screens.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/assets/injected_screens.html
@@ -1,14 +1,14 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
- <body>
-
-
- <div id='ExampHello-mainDiv'>
- This "Hello World" example demonstrates how to register a plugin with the i2b2 web client framework and display an HTML message.
- View the other example plugins to see how to create more complex user interfaces and interact with i2b2 objects using drag-and-drop.
- </div>
-
-
- </body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /></head>
+ <body>
+
+
+ <div id='ExampHello-mainDiv'>
+ This "Hello World" example demonstrates how to register a plugin with the i2b2 web client framework and display an HTML message.
+ View the other example plugins to see how to create more complex user interfaces and interact with i2b2 objects using drag-and-drop.
+ </div>
+
+
+ </body>
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/cell_config_data.js
old mode 100755
new mode 100644
index 215ca8d01..afab9ce21
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampHello/cell_config_data.js
@@ -1,21 +1,21 @@
-// this file contains a list of all files that need to be loaded dynamically for this plugin
-// every file in this list will be loaded after the plugin's Init function is called
-{
- files:[ "ExampHello.js" ],
- css:[ "ExampHello.css" ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "Hello World",
- name: "Example #1 - Hello World",
- description: "This plugin demonstrates how to register a plugin within the i2b2 web client framework.",
- category: ["celless","plugin","examples"],
- plugin: {
- isolateHtml: false, // this means do not use an IFRAME
- isolateComm: true, // this means to expect the plugin to use AJAX communications provided by the framework
- html: {
- source: 'injected_screens.html',
- mainDivId: 'ExampHello-mainDiv'
- }
- }
- }
+// this file contains a list of all files that need to be loaded dynamically for this plugin
+// every file in this list will be loaded after the plugin's Init function is called
+{
+ files:[ "ExampHello.js" ],
+ css:[ "ExampHello.css" ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "Hello World",
+ name: "Example #1 - Hello World",
+ description: "This plugin demonstrates how to register a plugin within the i2b2 web client framework.",
+ category: ["celless","plugin","examples"],
+ plugin: {
+ isolateHtml: false, // this means do not use an IFRAME
+ isolateComm: true, // this means to expect the plugin to use AJAX communications provided by the framework
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'ExampHello-mainDiv'
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/ExampPDO_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/ExampPDO_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/injected_screens.html
old mode 100755
new mode 100644
index f6e0ef89b..272c2feb0
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/injected_screens.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/injected_screens.html
@@ -1,76 +1,76 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <body>
-
- <div id='ExampPDO-mainDiv'>
-
- <div id="ExampPDO-TABS" class="yui-navset">
- <ul class="yui-nav">
- <li id="ExampPDO-TAB0" class="selected"><a href="#ExampPDO-TAB0"><em>Specify Data</em></a></li>
- <li id="ExampPDO-TAB1"><a href="#ExampPDO-TAB1"><em>View Results</em></a></li>
- <li id="ExampPDO-TAB2"><a href="#ExampPDO-TAB2"><em>Plugin Help</em></a></li>
- </ul>
- <div class="yui-content" id="ExampPDO-CONTENT">
- <div>
- <div class="ExampPDO-MainContent">
- <div class="ExampPDO-MainContentPad">
- <div>Drop a Patient Set and a Concept (Ontology Term) into the input boxes below, and then click the "View Results" tab to retrieve information about when that concept was observed in the selected patient set. In this example, the results are returned in the standard i2b2 PDO (Patient Data Object) XML format. You may select whether to return information about the patients, events, or observations.</div>
- <div class="droptrgtlbl">Patient Set:</div>
- <div class="droptrgt SDX-PRS" id="ExampPDO-PRSDROP">Drop a Patient Set here</DIV>
- <div class="droptrgtlbl">Concept:</div>
- <div class="droptrgt SDX-CONCPT" id="ExampPDO-CONCPTDROP">Drop a Concept here</DIV>
- <div class="outputOptionsLbl">Return:</div>
- <div class="outputOptions">
- <form>
- <span><input type="checkbox" checked id="ExampPDO-OutputPatient" onChange="i2b2.ExampPDO.chgOutputOption(this,'patients');">Patients</span>
- <span><input type="checkbox" checked id="ExampPDO-OutputEvents" onChange="i2b2.ExampPDO.chgOutputOption(this,'events');">Events</span>
- <span><input type="checkbox" checked id="ExampPDO-OutputObservations" onChange="i2b2.ExampPDO.chgOutputOption(this,'observations');">Observations</span>
- </form>
- </div>
- </div>
- </div>
- </div>
- <div>
- <div class="ExampPDO-MainContent">
- <div class="results-directions">Please return to the "Specify Data" tab and select both a Patient Set and a Concept.</div>
- <div class="results-working" style="display:none;">The PDO request is processing...</div>
- <div class="results-finished" style="display:none;">
- <div class="results-text">The following shows the PDO Request that was sent and the PDO Respoonse that was received:<UL></UL></div>
- <div id="ExampPDO-InfoPDO">
- <table>
- <tr><th>PDO Request</th><td class="InfoPDO-Request"><div class="originalXML"></div></td></tr>
- <tr><th>PDO Response</th><td class="InfoPDO-Response"><div class="originalXML"></div></td></tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div>
- <div class="ExampPDO-MainContent">
- <div class="ExampPDO-MainContentPad">
- <h1>Example #3 - PDO Request</h1>
- <hr size="1" noshade>
- <h2>Introduction</h2>
- This plugin demonstrates how to retrieve information using the Patient Data Object (PDO).
- The PDO is the standard way in which i2b2 encapsulates all patient data.
- All plugins that need to access patient data must construct PDO Requests and parse the returned PDO Response.
- The PDO Request takes several input options, including a list of patients, groups of concepts, the list of items to be returned.
- The PDO Response, dependeing on the input options, might return details about the patients, a list of observations corresponding to the selected concepts, or information about the events during which the observations occurred.
- <h2>Instructions</h2>
- Navigate to the "Specify Data" tab. Then, drag and drop a Patient Set and a Concept (Ontology Term) onto the input boxes. You may optionally select which types of information you want returned. Finally, click the "View Results" tab to view the PDO Response.
- <h2>About Us</h2>
- This plugin was created by Nick Benik and Griffin Weber, MD, PhD.
- <h2>Terms of Use</h2>
- This example plugin is distributed with the i2b2 web client framework and may be used free of charge.
- </div>
- </div>
- </div>
- </div>
- </div>
-
-
- </div>
-
-
- </body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <body>
+
+ <div id='ExampPDO-mainDiv'>
+
+ <div id="ExampPDO-TABS" class="yui-navset">
+ <ul class="yui-nav">
+ <li id="ExampPDO-TAB0" class="selected"><a href="#ExampPDO-TAB0"><em>Specify Data</em></a></li>
+ <li id="ExampPDO-TAB1"><a href="#ExampPDO-TAB1"><em>View Results</em></a></li>
+ <li id="ExampPDO-TAB2"><a href="#ExampPDO-TAB2"><em>Plugin Help</em></a></li>
+ </ul>
+ <div class="yui-content" id="ExampPDO-CONTENT">
+ <div>
+ <div class="ExampPDO-MainContent">
+ <div class="ExampPDO-MainContentPad">
+ <div>Drop a Patient Set and a Concept (Ontology Term) into the input boxes below, and then click the "View Results" tab to retrieve information about when that concept was observed in the selected patient set. In this example, the results are returned in the standard i2b2 PDO (Patient Data Object) XML format. You may select whether to return information about the patients, events, or observations.</div>
+ <div class="droptrgtlbl">Patient Set:</div>
+ <div class="droptrgt SDX-PRS" id="ExampPDO-PRSDROP">Drop a Patient Set here</DIV>
+ <div class="droptrgtlbl">Concept:</div>
+ <div class="droptrgt SDX-CONCPT" id="ExampPDO-CONCPTDROP">Drop a Concept here</DIV>
+ <div class="outputOptionsLbl">Return:</div>
+ <div class="outputOptions">
+ <form>
+ <span><input type="checkbox" checked id="ExampPDO-OutputPatient" onChange="i2b2.ExampPDO.chgOutputOption(this,'patients');">Patients</span>
+ <span><input type="checkbox" checked id="ExampPDO-OutputEvents" onChange="i2b2.ExampPDO.chgOutputOption(this,'events');">Events</span>
+ <span><input type="checkbox" checked id="ExampPDO-OutputObservations" onChange="i2b2.ExampPDO.chgOutputOption(this,'observations');">Observations</span>
+ </form>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ExampPDO-MainContent">
+ <div class="results-directions">Please return to the "Specify Data" tab and select both a Patient Set and a Concept.</div>
+ <div class="results-working" style="display:none;">The PDO request is processing...</div>
+ <div class="results-finished" style="display:none;">
+ <div class="results-text">The following shows the PDO Request that was sent and the PDO Respoonse that was received:<UL></UL></div>
+ <div id="ExampPDO-InfoPDO">
+ <table>
+ <tr><th>PDO Request</th><td class="InfoPDO-Request"><div class="originalXML"></div></td></tr>
+ <tr><th>PDO Response</th><td class="InfoPDO-Response"><div class="originalXML"></div></td></tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ExampPDO-MainContent">
+ <div class="ExampPDO-MainContentPad">
+ <h1>Example #3 - PDO Request</h1>
+ <hr size="1" noshade>
+ <h2>Introduction</h2>
+ This plugin demonstrates how to retrieve information using the Patient Data Object (PDO).
+ The PDO is the standard way in which i2b2 encapsulates all patient data.
+ All plugins that need to access patient data must construct PDO Requests and parse the returned PDO Response.
+ The PDO Request takes several input options, including a list of patients, groups of concepts, the list of items to be returned.
+ The PDO Response, dependeing on the input options, might return details about the patients, a list of observations corresponding to the selected concepts, or information about the events during which the observations occurred.
+ <h2>Instructions</h2>
+ Navigate to the "Specify Data" tab. Then, drag and drop a Patient Set and a Concept (Ontology Term) onto the input boxes. You may optionally select which types of information you want returned. Finally, click the "View Results" tab to view the PDO Response.
+ <h2>About Us</h2>
+ This plugin was created by Nick Benik and Griffin Weber, MD, PhD.
+ <h2>Terms of Use</h2>
+ This example plugin is distributed with the i2b2 web client framework and may be used free of charge.
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </body>
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/vwExampPDO.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/vwExampPDO.css
old mode 100755
new mode 100644
index 2c401ec08..6aa2eb106
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/vwExampPDO.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/assets/vwExampPDO.css
@@ -1,146 +1,146 @@
-/*** CSS for main plugin wrapper ***/
-
-DIV#ExampPDO-mainDiv {
- padding: 0px;
-}
-
-
-
-/*** CSS for tab background ***/
-
-DIV#ExampPDO-TABS DIV.yui-content {
- background: #FFF;
-}
-
-DIV#ExampPDO-TABS DIV.ExampPDO-MainContent {
- background:#FFF;
- border:solid #63758C;
- border-width:1px 0;
- overflow:auto;
- height:100%;
-}
-DIV#ExampPDO-TABS DIV.ExampPDO-MainContentPad {
- padding:10px 10px;
-}
-
-
-
-/*** CSS for the Specify Data tab ***/
-
-DIV#ExampPDO-mainDiv DIV.droptrgtlbl {
- padding: 6px 0px;
- width:80px;
- text-align:right;
- float: left;
- font-weight:bold;
- color:#666;
- margin: 15px 10px 0px 0px;
-}
-DIV#ExampPDO-mainDiv DIV.droptrgt {
- padding: 5px 10px;
- background: #DEEBEF;
- margin-top: 15px;
- text-align:left;
- border: 1px solid #63758C;
- width:300px;
- overflow:hidden;
- white-space:nowrap;
-
-}
-DIV#ExampPDO-mainDiv DIV.outputOptionsLbl {
- padding: 6px 0px;
- width:80px;
- text-align:right;
- float: left;
- font-weight:bold;
- color:#666;
- margin: 15px 10px 0px 0px;
-}
-DIV#ExampPDO-mainDiv DIV.outputOptions {
- padding: 5px 10px;
- margin-top: 15px;
- text-align:center;
- border: 1px solid #63758C;
- width:300px;
- overflow:hidden;
-}
-DIV#ExampPDO-mainDiv DIV.outputOptions form {
- margin:0;
- padding:0;
-}
-DIV#ExampPDO-mainDiv DIV.outputOptions span {
- margin-right: 15px;
-}
-
-
-
-/*** CSS for the View Results tab ***/
-
-DIV#ExampPDO-TABS DIV.results-directions {
- padding: 10px;
- text-align:left;
-}
-DIV#ExampPDO-TABS DIV.results-working {
- margin:10px;
- text-align:left;
-}
-DIV#ExampPDO-TABS DIV.results-text {
- margin:10px;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE {
- margin:0 10px 10px 10px;
- border-collapse:collapse;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE TH {
- width:150px;
- border:solid 1px #63758C;
- background-color:#CEDBEF;
- padding:5px;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE TD {
- width:300px;
- overflow:auto;
- border:solid 1px #63758C;
- background-color:#DEEBEF;
- padding:5px;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO .InfoPDO-Request {
- padding:0px;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO .InfoPDO-Response {
- padding:0px;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO .originalXML {
- height:150px;
- overflow:hidden;
- padding:0px;
- margin:0px;
-}
-DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE TD DIV PRE {
- margin:0px;
- width:300px;
- height:140px;
- display:block;
- overflow:scroll;
- padding:5px;
-}
-
-
-
-/*** CSS for the Plugin Help tab ***/
-
-DIV#ExampPDO-TABS H1 {
- margin:0 0 10px 0;
- font-size:16px;
- color:#42558C;
- font-weight:bold;
-}
-DIV#ExampPDO-TABS H2 {
- margin:10px 0 10px 0;
- font-size:13px;
- color:#42558C;
- font-weight:bold;
-}
-DIV#ExampPDO-TABS HR {
- margin:0;
-}
+/*** CSS for main plugin wrapper ***/
+
+DIV#ExampPDO-mainDiv {
+ padding: 0px;
+}
+
+
+
+/*** CSS for tab background ***/
+
+DIV#ExampPDO-TABS DIV.yui-content {
+ background: #FFF;
+}
+
+DIV#ExampPDO-TABS DIV.ExampPDO-MainContent {
+ background:#FFF;
+ border:solid #63758C;
+ border-width:1px 0;
+ overflow:auto;
+ height:100%;
+}
+DIV#ExampPDO-TABS DIV.ExampPDO-MainContentPad {
+ padding:10px 10px;
+}
+
+
+
+/*** CSS for the Specify Data tab ***/
+
+DIV#ExampPDO-mainDiv DIV.droptrgtlbl {
+ padding: 6px 0px;
+ width:80px;
+ text-align:right;
+ float: left;
+ font-weight:bold;
+ color:#666;
+ margin: 15px 10px 0px 0px;
+}
+DIV#ExampPDO-mainDiv DIV.droptrgt {
+ padding: 5px 10px;
+ background: #DEEBEF;
+ margin-top: 15px;
+ text-align:left;
+ border: 1px solid #63758C;
+ width:300px;
+ overflow:hidden;
+ white-space:nowrap;
+
+}
+DIV#ExampPDO-mainDiv DIV.outputOptionsLbl {
+ padding: 6px 0px;
+ width:80px;
+ text-align:right;
+ float: left;
+ font-weight:bold;
+ color:#666;
+ margin: 15px 10px 0px 0px;
+}
+DIV#ExampPDO-mainDiv DIV.outputOptions {
+ padding: 5px 10px;
+ margin-top: 15px;
+ text-align:center;
+ border: 1px solid #63758C;
+ width:300px;
+ overflow:hidden;
+}
+DIV#ExampPDO-mainDiv DIV.outputOptions form {
+ margin:0;
+ padding:0;
+}
+DIV#ExampPDO-mainDiv DIV.outputOptions span {
+ margin-right: 15px;
+}
+
+
+
+/*** CSS for the View Results tab ***/
+
+DIV#ExampPDO-TABS DIV.results-directions {
+ padding: 10px;
+ text-align:left;
+}
+DIV#ExampPDO-TABS DIV.results-working {
+ margin:10px;
+ text-align:left;
+}
+DIV#ExampPDO-TABS DIV.results-text {
+ margin:10px;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE {
+ margin:0 10px 10px 10px;
+ border-collapse:collapse;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE TH {
+ width:150px;
+ border:solid 1px #63758C;
+ background-color:#CEDBEF;
+ padding:5px;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE TD {
+ width:300px;
+ overflow:auto;
+ border:solid 1px #63758C;
+ background-color:#DEEBEF;
+ padding:5px;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO .InfoPDO-Request {
+ padding:0px;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO .InfoPDO-Response {
+ padding:0px;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO .originalXML {
+ height:150px;
+ overflow:hidden;
+ padding:0px;
+ margin:0px;
+}
+DIV#ExampPDO-mainDiv DIV#ExampPDO-InfoPDO TABLE TD DIV PRE {
+ margin:0px;
+ width:300px;
+ height:140px;
+ display:block;
+ overflow:scroll;
+ padding:5px;
+}
+
+
+
+/*** CSS for the Plugin Help tab ***/
+
+DIV#ExampPDO-TABS H1 {
+ margin:0 0 10px 0;
+ font-size:16px;
+ color:#42558C;
+ font-weight:bold;
+}
+DIV#ExampPDO-TABS H2 {
+ margin:10px 0 10px 0;
+ font-size:13px;
+ color:#42558C;
+ font-weight:bold;
+}
+DIV#ExampPDO-TABS HR {
+ margin:0;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/cell_config_data.js
old mode 100755
new mode 100644
index 59270af09..24455c19c
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampPDO/cell_config_data.js
@@ -1,26 +1,26 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files:[
- "ExampPDO_ctrlr.js"
- ],
- css:[
- "vwExampPDO.css"
- ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "PDO Request",
- name: "Example #3 - PDO Request",
- description: "This plugin demonstrates how to retrieve information using the Patient Data Object (PDO).",
- category: ["celless","plugin","examples"],
- plugin: {
- isolateHtml: false, // this means do not use an IFRAME
- isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
- standardTabs: true, // this means the plugin uses standard tabs at top
- html: {
- source: 'injected_screens.html',
- mainDivId: 'ExampPDO-mainDiv'
- }
- }
- }
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files:[
+ "ExampPDO_ctrlr.js"
+ ],
+ css:[
+ "vwExampPDO.css"
+ ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "PDO Request",
+ name: "Example #3 - PDO Request",
+ description: "This plugin demonstrates how to retrieve information using the Patient Data Object (PDO).",
+ category: ["celless","plugin","examples"],
+ plugin: {
+ isolateHtml: false, // this means do not use an IFRAME
+ isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
+ standardTabs: true, // this means the plugin uses standard tabs at top
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'ExampPDO-mainDiv'
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/ExampTabs_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/ExampTabs_ctrlr.js
old mode 100755
new mode 100644
index af532ef9d..21aa7401f
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/ExampTabs_ctrlr.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/ExampTabs_ctrlr.js
@@ -1,96 +1,96 @@
-/**
- * @projectDescription Example using tabs and SDX DragDrop integration (controller code).
- * @inherits i2b2
- * @namespace i2b2.ExampTabs
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * ----------------------------------------------------------------------------------------
- * updated 9-28-08: Initial Launch [Nick Benik]
- * updated 10-30-08: GUI revisions [Griffin Weber]
- */
-
-i2b2.ExampTabs.Init = function(loadedDiv) {
- // this function is called after the HTML is loaded into the viewer DIV
-
- // register DIV as valid DragDrop target for Patient Record Sets (PRS) objects
- var divName = "ExampTabs-PRSDROP";
- // register for drag drop events for the following data types: CONCPT, QM, QI, PRS, PRC
- var op_trgt = {dropTarget:true};
- i2b2.sdx.Master.AttachType(divName, 'CONCPT', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'QM', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'QI', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'PRS', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'PRC', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'PR', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'QDEF', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'QGDEF', op_trgt);
- i2b2.sdx.Master.AttachType(divName, 'XML', op_trgt);
- // route event callbacks to a single drop event handler used by this plugin
- var eventRouterFunc = (function(sdxData) { i2b2.ExampTabs.doDrop(sdxData); });
- i2b2.sdx.Master.setHandlerCustom(divName, 'CONCPT', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'QM', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'QI', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'PRS', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'PRC', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'PR', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'QDEF', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'QGDEF', 'DropHandler', eventRouterFunc);
- i2b2.sdx.Master.setHandlerCustom(divName, 'XML', 'DropHandler', eventRouterFunc);
-
- // manage YUI tabs
- var cfgObj = {activeIndex : 0};
- this.yuiTabs = new YAHOO.widget.TabView("ExampTabs-TABS", cfgObj);
- this.yuiTabs.on('activeTabChange', function(ev) {
- //Tabs have changed
- if (ev.newValue.get('id')=="ExampTabs-TAB1") {
- // user switched to Results tab
- if (i2b2.ExampTabs.model.currentRec) {
- // gather statistics only if we have data
- if (i2b2.ExampTabs.model.dirtyResultsData) {
- // recalculate the results only if the input data has changed
- i2b2.ExampTabs.getResults();
- }
- }
- }
- });
-};
-
-
-i2b2.ExampTabs.Unload = function() {
- // this function is called before the plugin is unloaded by the framework
- return true;
-};
-
-
-i2b2.ExampTabs.doDrop = function(sdxData) {
- sdxData = sdxData[0]; // only interested in first record
- // save the info to our local data model
- i2b2.ExampTabs.model.currentRec = sdxData;
- // let the user know that the drop was successful by displaying the name of the object
- $("ExampTabs-PRSDROP").innerHTML = i2b2.h.Escape(sdxData.sdxInfo.sdxDisplayName);
- // optimization to prevent requerying the hive for new results if the input dataset has not changed
- i2b2.ExampTabs.model.dirtyResultsData = true;
-}
-
-
-i2b2.ExampTabs.getResults = function() {
- // Refresh the display with info of the SDX record that was DragDropped
- if (i2b2.ExampTabs.model.dirtyResultsData) {
- var dropRecord = i2b2.ExampTabs.model.currentRec;
- $$("DIV#ExampTabs-mainDiv DIV#ExampTabs-TABS DIV.results-directions")[0].hide();
- $$("DIV#ExampTabs-mainDiv DIV#ExampTabs-TABS DIV.results-finished")[0].show();
- var sdxDisplay = $$("DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX")[0];
- Element.select(sdxDisplay, '.sdxDisplayName')[0].innerHTML = dropRecord.sdxInfo.sdxDisplayName;
- Element.select(sdxDisplay, '.sdxType')[0].innerHTML = dropRecord.sdxInfo.sdxType;
- Element.select(sdxDisplay, '.sdxControlCell')[0].innerHTML = dropRecord.sdxInfo.sdxControlCell;
- Element.select(sdxDisplay, '.sdxKeyName')[0].innerHTML = dropRecord.sdxInfo.sdxKeyName;
- Element.select(sdxDisplay, '.sdxKeyValue')[0].innerHTML = dropRecord.sdxInfo.sdxKeyValue;
- // we must escape the xml text or the browser will attempt to interpret it as HTML
- var xmlDisplay = i2b2.h.Xml2String(dropRecord.origData.xmlOrig);
- xmlDisplay = '<pre>'+i2b2.h.Escape(xmlDisplay)+'</pre>';
- Element.select(sdxDisplay, '.originalXML')[0].innerHTML = xmlDisplay;
- }
-
- // optimization - only requery when the input data is changed
- i2b2.ExampTabs.model.dirtyResultsData = false;
-}
+/**
+ * @projectDescription Example using tabs and SDX DragDrop integration (controller code).
+ * @inherits i2b2
+ * @namespace i2b2.ExampTabs
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * ----------------------------------------------------------------------------------------
+ * updated 9-28-08: Initial Launch [Nick Benik]
+ * updated 10-30-08: GUI revisions [Griffin Weber]
+ */
+
+i2b2.ExampTabs.Init = function(loadedDiv) {
+ // this function is called after the HTML is loaded into the viewer DIV
+
+ // register DIV as valid DragDrop target for Patient Record Sets (PRS) objects
+ var divName = "ExampTabs-PRSDROP";
+ // register for drag drop events for the following data types: CONCPT, QM, QI, PRS, PRC
+ var op_trgt = {dropTarget:true};
+ i2b2.sdx.Master.AttachType(divName, 'CONCPT', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'QM', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'QI', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'PRS', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'PRC', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'PR', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'QDEF', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'QGDEF', op_trgt);
+ i2b2.sdx.Master.AttachType(divName, 'XML', op_trgt);
+ // route event callbacks to a single drop event handler used by this plugin
+ var eventRouterFunc = (function(sdxData) { i2b2.ExampTabs.doDrop(sdxData); });
+ i2b2.sdx.Master.setHandlerCustom(divName, 'CONCPT', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'QM', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'QI', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'PRS', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'PRC', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'PR', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'QDEF', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'QGDEF', 'DropHandler', eventRouterFunc);
+ i2b2.sdx.Master.setHandlerCustom(divName, 'XML', 'DropHandler', eventRouterFunc);
+
+ // manage YUI tabs
+ var cfgObj = {activeIndex : 0};
+ this.yuiTabs = new YAHOO.widget.TabView("ExampTabs-TABS", cfgObj);
+ this.yuiTabs.on('activeTabChange', function(ev) {
+ //Tabs have changed
+ if (ev.newValue.get('id')=="ExampTabs-TAB1") {
+ // user switched to Results tab
+ if (i2b2.ExampTabs.model.currentRec) {
+ // gather statistics only if we have data
+ if (i2b2.ExampTabs.model.dirtyResultsData) {
+ // recalculate the results only if the input data has changed
+ i2b2.ExampTabs.getResults();
+ }
+ }
+ }
+ });
+};
+
+
+i2b2.ExampTabs.Unload = function() {
+ // this function is called before the plugin is unloaded by the framework
+ return true;
+};
+
+
+i2b2.ExampTabs.doDrop = function(sdxData) {
+ sdxData = sdxData[0]; // only interested in first record
+ // save the info to our local data model
+ i2b2.ExampTabs.model.currentRec = sdxData;
+ // let the user know that the drop was successful by displaying the name of the object
+ $("ExampTabs-PRSDROP").innerHTML = i2b2.h.Escape(sdxData.sdxInfo.sdxDisplayName);
+ // optimization to prevent requerying the hive for new results if the input dataset has not changed
+ i2b2.ExampTabs.model.dirtyResultsData = true;
+}
+
+
+i2b2.ExampTabs.getResults = function() {
+ // Refresh the display with info of the SDX record that was DragDropped
+ if (i2b2.ExampTabs.model.dirtyResultsData) {
+ var dropRecord = i2b2.ExampTabs.model.currentRec;
+ $$("DIV#ExampTabs-mainDiv DIV#ExampTabs-TABS DIV.results-directions")[0].hide();
+ $$("DIV#ExampTabs-mainDiv DIV#ExampTabs-TABS DIV.results-finished")[0].show();
+ var sdxDisplay = $$("DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX")[0];
+ Element.select(sdxDisplay, '.sdxDisplayName')[0].innerHTML = dropRecord.sdxInfo.sdxDisplayName;
+ Element.select(sdxDisplay, '.sdxType')[0].innerHTML = dropRecord.sdxInfo.sdxType;
+ Element.select(sdxDisplay, '.sdxControlCell')[0].innerHTML = dropRecord.sdxInfo.sdxControlCell;
+ Element.select(sdxDisplay, '.sdxKeyName')[0].innerHTML = dropRecord.sdxInfo.sdxKeyName;
+ Element.select(sdxDisplay, '.sdxKeyValue')[0].innerHTML = dropRecord.sdxInfo.sdxKeyValue;
+ // we must escape the xml text or the browser will attempt to interpret it as HTML
+ var xmlDisplay = i2b2.h.Xml2String(dropRecord.origData.xmlOrig);
+ xmlDisplay = '<pre>'+i2b2.h.Escape(xmlDisplay)+'</pre>';
+ Element.select(sdxDisplay, '.originalXML')[0].innerHTML = xmlDisplay;
+ }
+
+ // optimization - only requery when the input data is changed
+ i2b2.ExampTabs.model.dirtyResultsData = false;
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/injected_screens.html
old mode 100755
new mode 100644
index a33dfeb16..63ba08e2d
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/injected_screens.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/injected_screens.html
@@ -1,68 +1,68 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
- <body>
-
- <div id='ExampTabs-mainDiv'>
-
- <div id="ExampTabs-TABS" class="yui-navset">
- <ul class="yui-nav">
- <li id="ExampTabs-TAB0" class="selected"><a href="#ExampTabs-TAB0"><em>Specify Data</em></a></li>
- <li id="ExampTabs-TAB1"><a href="#ExampTabs-TAB1"><em>View Results</em></a></li>
- <li id="ExampTabs-TAB2"><a href="#ExampTabs-TAB2"><em>Plugin Help</em></a></li>
- </ul>
- <div class="yui-content" id="ExampTabs-CONTENT">
- <div>
- <div class="ExampTabs-MainContent">
- <div class="ExampTabs-MainContentPad">
- <div>Drop an i2b2 object such as a search term or previous query onto the input box below, and then click the "View Results" tab for information about that object.</div>
- <div class="droptrgtlbl">i2b2 Object:</div>
- <div class="droptrgt SDX-PRS" id="ExampTabs-PRSDROP" style="">Drop an object here</DIV>
- </div>
- </div>
- </div>
- <div>
- <div class="ExampTabs-MainContent">
- <div class="results-directions">You must first provide an i2b2 object. Please return to the "Specify Data" tab then drag and drop an i2b2 object onto the input box.</div>
- <div class="results-working" style="display:none;"></div>
- <div class="results-finished" style="display:none;">
- <div class="results-text">The following information was passed to the plugin in the i2b2 object:<UL></UL></div>
- <div id="ExampTabs-InfoSDX">
- <table>
- <tr><th>Display Name</th><td class="sdxDisplayName"></td></tr>
- <tr><th>SDX Datatype Code</th><td class="sdxType"></td></tr>
- <tr><th>Controlling Cell</th><td class="sdxControlCell"></td></tr>
- <tr><th>Primary Key Column</th><td class="sdxKeyName"></td></tr>
- <tr><th>Primary Key Value</th><td class="sdxKeyValue"></td></tr>
- <tr><th>Original XML Data</th><td class="sdxOriginalXML"><div class="originalXML"></div></td></tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div>
- <div class="ExampTabs-MainContent">
- <div class="ExampTabs-MainContentPad">
- <h1>Example #2 - Tabs and DragDrop</h1>
- <hr size="1" noshade>
- <h2>Introduction</h2>
- This plugin demonstrates how to use tabs and interact with i2b2 objects by accepting DragDrop messages (SDX Objects).
- The three tab layout, which separates plugin input (specify data), plugin output (view results), and help content is a model that can be used by many plugins.
- SDX stands for Standard Data Exchange, which is the i2b2 web client framework's mechanism for handling drag and drop objects. The SDX, AJAX, and other utility functions provided by the framework greatly simplify the process of creating new plugins.
- <h2>Instructions</h2>
- Navigate to the "Specify Data" tab. Then, drag and drop an i2b2 object such as a search term or previous query onto the input box. Finally, click the "View Results" tab for information about that object.
- <h2>About Us</h2>
- This plugin was created by Nick Benik and Griffin Weber, MD, PhD.
- <h2>Terms of Use</h2>
- This example plugin is distributed with the i2b2 web client framework and may be used free of charge.
- </div>
- </div>
- </div>
- </div>
- </div>
-
-
- </div>
-
-
- </body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <body>
+
+ <div id='ExampTabs-mainDiv'>
+
+ <div id="ExampTabs-TABS" class="yui-navset">
+ <ul class="yui-nav">
+ <li id="ExampTabs-TAB0" class="selected"><a href="#ExampTabs-TAB0"><em>Specify Data</em></a></li>
+ <li id="ExampTabs-TAB1"><a href="#ExampTabs-TAB1"><em>View Results</em></a></li>
+ <li id="ExampTabs-TAB2"><a href="#ExampTabs-TAB2"><em>Plugin Help</em></a></li>
+ </ul>
+ <div class="yui-content" id="ExampTabs-CONTENT">
+ <div>
+ <div class="ExampTabs-MainContent">
+ <div class="ExampTabs-MainContentPad">
+ <div>Drop an i2b2 object such as a search term or previous query onto the input box below, and then click the "View Results" tab for information about that object.</div>
+ <div class="droptrgtlbl">i2b2 Object:</div>
+ <div class="droptrgt SDX-PRS" id="ExampTabs-PRSDROP" style="">Drop an object here</DIV>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ExampTabs-MainContent">
+ <div class="results-directions">You must first provide an i2b2 object. Please return to the "Specify Data" tab then drag and drop an i2b2 object onto the input box.</div>
+ <div class="results-working" style="display:none;"></div>
+ <div class="results-finished" style="display:none;">
+ <div class="results-text">The following information was passed to the plugin in the i2b2 object:<UL></UL></div>
+ <div id="ExampTabs-InfoSDX">
+ <table>
+ <tr><th>Display Name</th><td class="sdxDisplayName"></td></tr>
+ <tr><th>SDX Datatype Code</th><td class="sdxType"></td></tr>
+ <tr><th>Controlling Cell</th><td class="sdxControlCell"></td></tr>
+ <tr><th>Primary Key Column</th><td class="sdxKeyName"></td></tr>
+ <tr><th>Primary Key Value</th><td class="sdxKeyValue"></td></tr>
+ <tr><th>Original XML Data</th><td class="sdxOriginalXML"><div class="originalXML"></div></td></tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ExampTabs-MainContent">
+ <div class="ExampTabs-MainContentPad">
+ <h1>Example #2 - Tabs and DragDrop</h1>
+ <hr size="1" noshade>
+ <h2>Introduction</h2>
+ This plugin demonstrates how to use tabs and interact with i2b2 objects by accepting DragDrop messages (SDX Objects).
+ The three tab layout, which separates plugin input (specify data), plugin output (view results), and help content is a model that can be used by many plugins.
+ SDX stands for Standard Data Exchange, which is the i2b2 web client framework's mechanism for handling drag and drop objects. The SDX, AJAX, and other utility functions provided by the framework greatly simplify the process of creating new plugins.
+ <h2>Instructions</h2>
+ Navigate to the "Specify Data" tab. Then, drag and drop an i2b2 object such as a search term or previous query onto the input box. Finally, click the "View Results" tab for information about that object.
+ <h2>About Us</h2>
+ This plugin was created by Nick Benik and Griffin Weber, MD, PhD.
+ <h2>Terms of Use</h2>
+ This example plugin is distributed with the i2b2 web client framework and may be used free of charge.
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+
+
+ </div>
+
+
+ </body>
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/vwExampTabs.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/vwExampTabs.css
old mode 100755
new mode 100644
index 1e315c559..1fc51f52c
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/vwExampTabs.css
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/assets/vwExampTabs.css
@@ -1,125 +1,125 @@
-/*** CSS for main plugin wrapper ***/
-
-DIV#ExampTabs-mainDiv {
- padding: 0px;
-}
-
-
-
-/*** CSS for tab background ***/
-
-DIV#ExampTabs-TABS DIV.yui-content {
- background: #FFF;
-}
-DIV#ExampTabs-TABS DIV.ExampTabs-MainContent {
- background:#FFF;
- border:solid #63758C;
- border-width:1px 0;
- overflow:auto;
- height:100%;
-}
-DIV#ExampTabs-TABS DIV.ExampTabs-MainContentPad {
- padding:10px 10px;
-}
-
-
-
-/*** CSS for the Specify Data tab ***/
-
-DIV#ExampTabs-mainDiv DIV.droptrgtlbl {
- padding: 6px 0px;
- float: left;
- font-weight:bold;
- color:#666;
- margin: 15px 10px 0px 0px;
-}
-DIV#ExampTabs-mainDiv DIV.droptrgt {
- padding: 5px 10px;
- background: #DEEBEF;
- margin-top: 15px;
- text-align:left;
- border: 1px solid #63758C;
- width:300px;
- overflow:hidden;
- float: left;
-}
-
-
-
-/*** CSS for the View Results tab ***/
-
-DIV#ExampTabs-TABS DIV.results-directions {
- padding: 10px;
- text-align:left;
-}
-DIV#ExampTabs-TABS DIV.results-text {
- margin:10px;
-}
-DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE {
- margin:0 10px 10px 10px;
- border-collapse:collapse;
-}
-DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE TH {
- width:150px;
- border:solid 1px #63758C;
- background-color:#CEDBEF;
- padding:5px;
-}
-DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE TD {
- width:300px;
- overflow:auto;
- border:solid 1px #63758C;
- background-color:#DEEBEF;
- padding:5px;
-}
-DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX .sdxOriginalXML {
- padding:0px;
-}
-DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX .originalXML {
- height:150px;
- overflow:hidden;
- padding:0px;
- margin:0px;
-}
-DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE TD DIV PRE {
- margin:0px;
- width:300px;
- height:140px;
- display:block;
- overflow:scroll;
- padding:5px;
-}
-
-
-
-/*** CSS for the Plugin Help tab ***/
-
-DIV#ExampTabs-TABS H1 {
- margin:0 0 10px 0;
- font-size:16px;
- color:#42558C;
- font-weight:bold;
-}
-DIV#ExampTabs-TABS H2 {
- margin:10px 0 10px 0;
- font-size:13px;
- color:#42558C;
- font-weight:bold;
-}
-DIV#ExampTabs-TABS HR {
- margin:0;
-}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+/*** CSS for main plugin wrapper ***/
+
+DIV#ExampTabs-mainDiv {
+ padding: 0px;
+}
+
+
+
+/*** CSS for tab background ***/
+
+DIV#ExampTabs-TABS DIV.yui-content {
+ background: #FFF;
+}
+DIV#ExampTabs-TABS DIV.ExampTabs-MainContent {
+ background:#FFF;
+ border:solid #63758C;
+ border-width:1px 0;
+ overflow:auto;
+ height:100%;
+}
+DIV#ExampTabs-TABS DIV.ExampTabs-MainContentPad {
+ padding:10px 10px;
+}
+
+
+
+/*** CSS for the Specify Data tab ***/
+
+DIV#ExampTabs-mainDiv DIV.droptrgtlbl {
+ padding: 6px 0px;
+ float: left;
+ font-weight:bold;
+ color:#666;
+ margin: 15px 10px 0px 0px;
+}
+DIV#ExampTabs-mainDiv DIV.droptrgt {
+ padding: 5px 10px;
+ background: #DEEBEF;
+ margin-top: 15px;
+ text-align:left;
+ border: 1px solid #63758C;
+ width:300px;
+ overflow:hidden;
+ float: left;
+}
+
+
+
+/*** CSS for the View Results tab ***/
+
+DIV#ExampTabs-TABS DIV.results-directions {
+ padding: 10px;
+ text-align:left;
+}
+DIV#ExampTabs-TABS DIV.results-text {
+ margin:10px;
+}
+DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE {
+ margin:0 10px 10px 10px;
+ border-collapse:collapse;
+}
+DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE TH {
+ width:150px;
+ border:solid 1px #63758C;
+ background-color:#CEDBEF;
+ padding:5px;
+}
+DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE TD {
+ width:300px;
+ overflow:auto;
+ border:solid 1px #63758C;
+ background-color:#DEEBEF;
+ padding:5px;
+}
+DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX .sdxOriginalXML {
+ padding:0px;
+}
+DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX .originalXML {
+ height:150px;
+ overflow:hidden;
+ padding:0px;
+ margin:0px;
+}
+DIV#ExampTabs-mainDiv DIV#ExampTabs-InfoSDX TABLE TD DIV PRE {
+ margin:0px;
+ width:300px;
+ height:140px;
+ display:block;
+ overflow:scroll;
+ padding:5px;
+}
+
+
+
+/*** CSS for the Plugin Help tab ***/
+
+DIV#ExampTabs-TABS H1 {
+ margin:0 0 10px 0;
+ font-size:16px;
+ color:#42558C;
+ font-weight:bold;
+}
+DIV#ExampTabs-TABS H2 {
+ margin:10px 0 10px 0;
+ font-size:13px;
+ color:#42558C;
+ font-weight:bold;
+}
+DIV#ExampTabs-TABS HR {
+ margin:0;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/cell_config_data.js
old mode 100755
new mode 100644
index 50aee8450..d9ffefa53
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/examples/ExampTabs/cell_config_data.js
@@ -1,22 +1,22 @@
-// this file contains a list of all files that need to be loaded dynamically for this plugin
-// every file in this list will be loaded after the plugin's Init function is called
-{
- files:[ "ExampTabs_ctrlr.js" ],
- css:[ "vwExampTabs.css" ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "Tabs and DragDrop",
- name: "Example #2 - Tabs and DragDrop",
- description: "This plugin demonstrates how to use tabs and interact with i2b2 objects by accepting DragDrop messages (SDX Objects).",
- category: ["celless","plugin","examples"],
- plugin: {
- isolateHtml: false, // this means do not use an IFRAME
- isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
- standardTabs: true, // this means the plugin uses standard tabs at top
- html: {
- source: 'injected_screens.html',
- mainDivId: 'ExampTabs-mainDiv'
- }
- }
- }
+// this file contains a list of all files that need to be loaded dynamically for this plugin
+// every file in this list will be loaded after the plugin's Init function is called
+{
+ files:[ "ExampTabs_ctrlr.js" ],
+ css:[ "vwExampTabs.css" ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "Tabs and DragDrop",
+ name: "Example #2 - Tabs and DragDrop",
+ description: "This plugin demonstrates how to use tabs and interact with i2b2 objects by accepting DragDrop messages (SDX Objects).",
+ category: ["celless","plugin","examples"],
+ plugin: {
+ isolateHtml: false, // this means do not use an IFRAME
+ isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
+ standardTabs: true, // this means the plugin uses standard tabs at top
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'ExampTabs-mainDiv'
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/Dem1Set_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/Dem1Set_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/assets/injected_screens.html
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/assets/vwDem1Set.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/assets/vwDem1Set.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/cell_config_data.js
old mode 100755
new mode 100644
index ed912e80f..255172778
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem1Set/cell_config_data.js
@@ -1,26 +1,26 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files:[
- "Dem1Set_ctrlr.js"
- ],
- css:[
- "vwDem1Set.css"
- ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "Demographics",
- name: "Demographics (1 Patient Set) - Simple Counts",
- description: "This plugin displays a demographic break-down of a Patient Set.",
- category: ["celless","plugin","standard","demographics"],
- plugin: {
- isolateHtml: false, // this means do not use an IFRAME
- isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
- standardTabs: true, // this means the plugin uses standard tabs at top
- html: {
- source: 'injected_screens.html',
- mainDivId: 'Dem1Set-mainDiv'
- }
- }
- }
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files:[
+ "Dem1Set_ctrlr.js"
+ ],
+ css:[
+ "vwDem1Set.css"
+ ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "Demographics",
+ name: "Demographics (1 Patient Set) - Simple Counts",
+ description: "This plugin displays a demographic break-down of a Patient Set.",
+ category: ["celless","plugin","standard","demographics"],
+ plugin: {
+ isolateHtml: false, // this means do not use an IFRAME
+ isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
+ standardTabs: true, // this means the plugin uses standard tabs at top
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'Dem1Set-mainDiv'
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/Dem2Set_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/Dem2Set_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/assets/injected_screens.html
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/assets/vwDem2Set.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/assets/vwDem2Set.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/cell_config_data.js
old mode 100755
new mode 100644
index 30aca17df..3448df93a
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Dem2Set/cell_config_data.js
@@ -1,26 +1,26 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files:[
- "Dem2Set_ctrlr.js"
- ],
- css:[
- "vwDem2Set.css"
- ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "Demographics",
- name: "Demographics (2 Patient Sets) - Simple Counts",
- description: "This plugin compares the demographic break-down of two Patient Sets.",
- category: ["celless","plugin","standard","demographics"],
- plugin: {
- isolateHtml: false, // this means do not use an IFRAME
- isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
- standardTabs: true, // this means the plugin uses standard tabs at top
- html: {
- source: 'injected_screens.html',
- mainDivId: 'Dem2Set-mainDiv'
- }
- }
- }
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files:[
+ "Dem2Set_ctrlr.js"
+ ],
+ css:[
+ "vwDem2Set.css"
+ ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "Demographics",
+ name: "Demographics (2 Patient Sets) - Simple Counts",
+ description: "This plugin compares the demographic break-down of two Patient Sets.",
+ category: ["celless","plugin","standard","demographics"],
+ plugin: {
+ isolateHtml: false, // this means do not use an IFRAME
+ isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
+ standardTabs: true, // this means the plugin uses standard tabs at top
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'Dem2Set-mainDiv'
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/ProjectRequest_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/ProjectRequest_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/assets/injected_screens.html
old mode 100755
new mode 100644
index 5cfe117db..85ccb5a40
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/assets/injected_screens.html
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/assets/injected_screens.html
@@ -1,125 +1,125 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-<body>
-<div id='ProjectRequest-mainDiv'>
- <div id="ProjectRequest-TABS" class="yui-navset">
- <ul class="yui-nav">
- <li id="ProjectRequest-TAB0" class="selected"><a href="#ProjectRequest-TAB0"><em>Specify Data</em></a></li>
- <li id="ProjectRequest-TAB1"><a href="#ProjectRequest-TAB1"><em>View Results</em></a></li>
- <li id="ProjectRequest-TAB2"><a href="#ProjectRequest-TAB2"><em>Plugin Help</em></a></li>
- </ul>
- <div class="yui-content" id="ProjectRequest-CONTENT">
- <div >
- <div class="ProjectRequest-MainContent">
- <div class="ProjectRequest-MainContentPad">
- <div><center><h1>Creating a new project based upon the existing project</h1></center><br/>This form allows a request for a new project data mart to be created. Please make the notations on the form by choosing from the options available or dragging items from existing patient sets or concepts in the current project into the boxes below. If these items are not yet created, please exit from the form to create them and then return to this form.<br/></div>
-
-<table cellpadding="0" cellspacing="0"><tr valign="top"><td width="60%"><div class="droptrgtlbl">Enter Title:</div><br clear="all"/><div class="TextMessage">Please begin by giving this project a name. This will be the name that is used throughout the program to reference the project, so generally the name should be short, although can be up to 255 characters:</div></td>
-
- <td><div class="outputOptions">
- <input type="text" id="title" maxlength="255" />
- <br/><div class="SubInputMessage">Enter upto 255 characters</div>
- </div></td></tr>
- <tr valign="top" bgcolor="#F0F0F0"><td><div class="droptrgtlbl">Select approval:</div><br clear="all"/><div class="TextMessage">Please choose from one of your registered approvals below. If as approval does not appear, it will need to be registered by an administrator before you may proceed:</div></td>
-
- <td><div class="outputOptions">
- <select id="ProjectRequest-OutputApproval" onchange="i2b2.ProjectRequest.showPart2();">
- <option>Select an Approval</option>
- </select>
- </div></td></tr>
-
- <tr id="ProjectRequest-part2a" style="display:none;" valign="top"><td width="60%"><div class="droptrgtlbl">Pick users:</div><br clear="all"/><div class="TextMessage">According to the data from the i2b2 project management cell, the following users are allowed to be registered for this project using the approval that was chosen. If a user is not found on the list below, an administrator will need to specifically add them to the approval before you can proceed. The newly created project will allow these users to access it with the roles you choose for each user below.</div></td>
-
- <td><div class="outputOptions">
- <div class="workarea" id="ProjectRequest-roleItem"></div>
- </div></td></tr>
-
- <tr id="ProjectRequest-part2b" style="display:none;" valign="top" bgcolor="#F0F0F0"><td width="60%"><div class="droptrgtlbl">Cases:</div><br clear="all"/><div class="TextMessage">The new project will be created to include the set of patients that was created in a patient set of a current project. It may also exclude patients from separate sets as desired. These sets are dragged from the previous queries or workplace areas to the boxes below:</div></td>
-
- <td><div class="droptrgt SDX-PRS" id="ProjectRequest-PRSDROP">
- <div class="prsItem">Drop one or more Patient Set here</div>
- </DIV>
- <br clear="all"/><div class="SubInputMessage">Identify Cases</div>
- <div id="ProjectRequest-DeleteMsgPRS"><br clear="all"/>Click a Patient Set to remove it from the list.</div>
- <br clear="all"/>
-
- <div class="droptrgt SDX-PRS" id="ProjectRequest-EXCPRSDROP">
- <div class="excprsItem">Drop one or more Patient Set here</div>
- </DIV>
- <br clear="all"/><div class="SubInputMessage">Exclude these patients from the cases</div>
- <div id="ProjectRequest-DeleteMsgExcPRS"><br clear="all"/>Click a Patient Set to remove it from the list.</div><br /></td></tr>
-
- <tr id="ProjectRequest-part2c" style="display:none;" valign="top"><td width="60%"><div class="droptrgtlbl">Controls:</div><br clear="all"/><div class="TextMessage">The new project may include a set of matched controls. These are included from the current project and will be selected based upon age, gender, race, and co-morbidities. You may define a specific set of the controls to be matched from, or create a set of all patients in the current project and drag the set to the box below. Patients can also be excluded from this set in a similar way to that described above.</div></td>
-
- <td><div class="droptrgt SDX-PRS" id="ProjectRequest-ICDROP">
- <div class="icItem">Drop one or more Patient Set here</div>
- </DIV>
- <br clear="all"/><div class="SubInputMessage">Identify Controls</div>
- <div id="ProjectRequest-DeleteMsgIC"><br clear="all"/>Click a Patient Set to remove it from the list.</div>
- <br clear="all"/>
-
- <div class="droptrgt SDX-PRS" id="ProjectRequest-EXCICDROP">
- <div class="excicItem">Drop one or more Patient Set here</div>
- </DIV>
- <br clear="all"/><div class="SubInputMessage">Exclude these patients from the controls</div>
- <div id="ProjectRequest-DeleteMsgExcIC"><br clear="all"/>Click a Patient Set to remove it from the list.</div><br/></td></tr>
-
- <tr id="ProjectRequest-part2d" style="display:none;" valign="top" bgcolor="#F0F0F0"><td width="60%"><div class="droptrgtlbl">Concepts:</div><br clear="all"/><div class="TextMessage">The concepts that will be included in the new project are chosen by dragging items from the Ontology or Workplace views into the boxes below:</div></td>
- <td><div class="droptrgt SDX-CONCPT" id="ProjectRequest-CONCPTDROP">
- <div class="concptItem">Drop one or more Concepts here</div>
- </DIV>
- <br clear="all"/><div class="SubInputMessage">Identify Concepts to be Included</div>
- <div id="ProjectRequest-DeleteMsgConcept"><br clear="all"/>Click a concept to remove it from the list.</div>
- <br clear="all"/>
-
- <div class="droptrgt SDX-CONCPT" id="ProjectRequest-EXCCONCPTDROP">
- <div class="excconcptItem">Drop one or more Concepts here</div>
- </DIV>
- <br clear="all"/><div class="SubInputMessage">Exclude these concepts</div>
- <div id="ProjectRequest-DeleteMsgExcConcept"><br clear="all"/>Click a concept to remove it from the list.</div><br/></td></tr>
-
-
- <tr id="ProjectRequest-part2e" style="display:none;" valign="top"><td width="60%"><div class="TextMessage">When the above form is complete, you may request this project be created by clicking the "submit" button below. A reference number will be returned that can be used to track the project.</div></td>
-
- <td><div id="runBox"><a href="JavaScript:i2b2.ProjectRequest.doSubmit()">Submit Query</a></div></td></tr></table>
- </div>
- </div>
- </div>
- <div>
- <div class="ProjectRequest-MainContent">
- <div class="results-directions">Please return to the "Specify Data" tab and fill out the request form.</div>
- <div class="results-working" style="display:none;">The Project request is processing...</div>
- <div class="results-finished" style="display:none;">
- <div class="results-text">Your request for a new project to be created has been received and will be serviced by the administrators. The reference number for tracking this project is shown below:
- <UL>
- </UL>
- </div>
- <div id="ProjectRequest-InfoPDO">
- <table>
- <tr>
- <th>Project ID</th>
- <td class="InfoPDO-Response"></td>
- </tr>
- </table>
- </div>
- </div>
- </div>
- </div>
- <div>
- <div class="ProjectRequest-MainContent">
- <div class="ProjectRequest-MainContentPad">
- <h1>Project Request</h1>
- <hr size="1" noshade>
- <h2>Instructions</h2>
- Navigate to the "Specify Data" tab. Then, drag and drop a Patient Set and a Concept (Ontology Term) onto the input boxes. Finally, click the "View Results" tab to view the PDO Response.
- <h2>About Us</h2>
- This plugin was created by Mike Mendis
- <h2>Terms of Use</h2>
- This plugin is distributed with the i2b2 web client framework and may be used free of charge. </div>
- </div>
- </div>
- </div>
- </div>
-</div>
-</body>
-</html>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<body>
+<div id='ProjectRequest-mainDiv'>
+ <div id="ProjectRequest-TABS" class="yui-navset">
+ <ul class="yui-nav">
+ <li id="ProjectRequest-TAB0" class="selected"><a href="#ProjectRequest-TAB0"><em>Specify Data</em></a></li>
+ <li id="ProjectRequest-TAB1"><a href="#ProjectRequest-TAB1"><em>View Results</em></a></li>
+ <li id="ProjectRequest-TAB2"><a href="#ProjectRequest-TAB2"><em>Plugin Help</em></a></li>
+ </ul>
+ <div class="yui-content" id="ProjectRequest-CONTENT">
+ <div >
+ <div class="ProjectRequest-MainContent">
+ <div class="ProjectRequest-MainContentPad">
+ <div><center><h1>Creating a new project based upon the existing project</h1></center><br/>This form allows a request for a new project data mart to be created. Please make the notations on the form by choosing from the options available or dragging items from existing patient sets or concepts in the current project into the boxes below. If these items are not yet created, please exit from the form to create them and then return to this form.<br/></div>
+
+<table cellpadding="0" cellspacing="0"><tr valign="top"><td width="60%"><div class="droptrgtlbl">Enter Title:</div><br clear="all"/><div class="TextMessage">Please begin by giving this project a name. This will be the name that is used throughout the program to reference the project, so generally the name should be short, although can be up to 255 characters:</div></td>
+
+ <td><div class="outputOptions">
+ <input type="text" id="title" maxlength="255" />
+ <br/><div class="SubInputMessage">Enter upto 255 characters</div>
+ </div></td></tr>
+ <tr valign="top" bgcolor="#F0F0F0"><td><div class="droptrgtlbl">Select approval:</div><br clear="all"/><div class="TextMessage">Please choose from one of your registered approvals below. If as approval does not appear, it will need to be registered by an administrator before you may proceed:</div></td>
+
+ <td><div class="outputOptions">
+ <select id="ProjectRequest-OutputApproval" onchange="i2b2.ProjectRequest.showPart2();">
+ <option>Select an Approval</option>
+ </select>
+ </div></td></tr>
+
+ <tr id="ProjectRequest-part2a" style="display:none;" valign="top"><td width="60%"><div class="droptrgtlbl">Pick users:</div><br clear="all"/><div class="TextMessage">According to the data from the i2b2 project management cell, the following users are allowed to be registered for this project using the approval that was chosen. If a user is not found on the list below, an administrator will need to specifically add them to the approval before you can proceed. The newly created project will allow these users to access it with the roles you choose for each user below.</div></td>
+
+ <td><div class="outputOptions">
+ <div class="workarea" id="ProjectRequest-roleItem"></div>
+ </div></td></tr>
+
+ <tr id="ProjectRequest-part2b" style="display:none;" valign="top" bgcolor="#F0F0F0"><td width="60%"><div class="droptrgtlbl">Cases:</div><br clear="all"/><div class="TextMessage">The new project will be created to include the set of patients that was created in a patient set of a current project. It may also exclude patients from separate sets as desired. These sets are dragged from the previous queries or workplace areas to the boxes below:</div></td>
+
+ <td><div class="droptrgt SDX-PRS" id="ProjectRequest-PRSDROP">
+ <div class="prsItem">Drop one or more Patient Set here</div>
+ </DIV>
+ <br clear="all"/><div class="SubInputMessage">Identify Cases</div>
+ <div id="ProjectRequest-DeleteMsgPRS"><br clear="all"/>Click a Patient Set to remove it from the list.</div>
+ <br clear="all"/>
+
+ <div class="droptrgt SDX-PRS" id="ProjectRequest-EXCPRSDROP">
+ <div class="excprsItem">Drop one or more Patient Set here</div>
+ </DIV>
+ <br clear="all"/><div class="SubInputMessage">Exclude these patients from the cases</div>
+ <div id="ProjectRequest-DeleteMsgExcPRS"><br clear="all"/>Click a Patient Set to remove it from the list.</div><br /></td></tr>
+
+ <tr id="ProjectRequest-part2c" style="display:none;" valign="top"><td width="60%"><div class="droptrgtlbl">Controls:</div><br clear="all"/><div class="TextMessage">The new project may include a set of matched controls. These are included from the current project and will be selected based upon age, gender, race, and co-morbidities. You may define a specific set of the controls to be matched from, or create a set of all patients in the current project and drag the set to the box below. Patients can also be excluded from this set in a similar way to that described above.</div></td>
+
+ <td><div class="droptrgt SDX-PRS" id="ProjectRequest-ICDROP">
+ <div class="icItem">Drop one or more Patient Set here</div>
+ </DIV>
+ <br clear="all"/><div class="SubInputMessage">Identify Controls</div>
+ <div id="ProjectRequest-DeleteMsgIC"><br clear="all"/>Click a Patient Set to remove it from the list.</div>
+ <br clear="all"/>
+
+ <div class="droptrgt SDX-PRS" id="ProjectRequest-EXCICDROP">
+ <div class="excicItem">Drop one or more Patient Set here</div>
+ </DIV>
+ <br clear="all"/><div class="SubInputMessage">Exclude these patients from the controls</div>
+ <div id="ProjectRequest-DeleteMsgExcIC"><br clear="all"/>Click a Patient Set to remove it from the list.</div><br/></td></tr>
+
+ <tr id="ProjectRequest-part2d" style="display:none;" valign="top" bgcolor="#F0F0F0"><td width="60%"><div class="droptrgtlbl">Concepts:</div><br clear="all"/><div class="TextMessage">The concepts that will be included in the new project are chosen by dragging items from the Ontology or Workplace views into the boxes below:</div></td>
+ <td><div class="droptrgt SDX-CONCPT" id="ProjectRequest-CONCPTDROP">
+ <div class="concptItem">Drop one or more Concepts here</div>
+ </DIV>
+ <br clear="all"/><div class="SubInputMessage">Identify Concepts to be Included</div>
+ <div id="ProjectRequest-DeleteMsgConcept"><br clear="all"/>Click a concept to remove it from the list.</div>
+ <br clear="all"/>
+
+ <div class="droptrgt SDX-CONCPT" id="ProjectRequest-EXCCONCPTDROP">
+ <div class="excconcptItem">Drop one or more Concepts here</div>
+ </DIV>
+ <br clear="all"/><div class="SubInputMessage">Exclude these concepts</div>
+ <div id="ProjectRequest-DeleteMsgExcConcept"><br clear="all"/>Click a concept to remove it from the list.</div><br/></td></tr>
+
+
+ <tr id="ProjectRequest-part2e" style="display:none;" valign="top"><td width="60%"><div class="TextMessage">When the above form is complete, you may request this project be created by clicking the "submit" button below. A reference number will be returned that can be used to track the project.</div></td>
+
+ <td><div id="runBox"><a href="JavaScript:i2b2.ProjectRequest.doSubmit()">Submit Query</a></div></td></tr></table>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ProjectRequest-MainContent">
+ <div class="results-directions">Please return to the "Specify Data" tab and fill out the request form.</div>
+ <div class="results-working" style="display:none;">The Project request is processing...</div>
+ <div class="results-finished" style="display:none;">
+ <div class="results-text">Your request for a new project to be created has been received and will be serviced by the administrators. The reference number for tracking this project is shown below:
+ <UL>
+ </UL>
+ </div>
+ <div id="ProjectRequest-InfoPDO">
+ <table>
+ <tr>
+ <th>Project ID</th>
+ <td class="InfoPDO-Response"></td>
+ </tr>
+ </table>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div>
+ <div class="ProjectRequest-MainContent">
+ <div class="ProjectRequest-MainContentPad">
+ <h1>Project Request</h1>
+ <hr size="1" noshade>
+ <h2>Instructions</h2>
+ Navigate to the "Specify Data" tab. Then, drag and drop a Patient Set and a Concept (Ontology Term) onto the input boxes. Finally, click the "View Results" tab to view the PDO Response.
+ <h2>About Us</h2>
+ This plugin was created by Mike Mendis
+ <h2>Terms of Use</h2>
+ This plugin is distributed with the i2b2 web client framework and may be used free of charge. </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+</body>
+</html>
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/assets/vwProjectRequest.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/assets/vwProjectRequest.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/cell_config_data.js
old mode 100755
new mode 100644
index 0f45e632e..6ca7f1965
--- a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/cell_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/ProjectRequest/cell_config_data.js
@@ -1,26 +1,26 @@
-// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
-// every file in this list will be loaded after the cell's Init function is called
-{
- files:[
- "ProjectRequest_ctrlr.js"
- ],
- css:[
- "vwProjectRequest.css"
- ],
- config: {
- // additional configuration variables that are set by the system
- short_name: "Project Request",
- name: "Project Request",
- description: "This plugin is uesed to generate a request for a new project based on concepts, patients and sets..",
- category: ["celless","plugin","examples"],
- plugin: {
- isolateHtml: false, // this means do not use an IFRAME
- isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
- standardTabs: true, // this means the plugin uses standard tabs at top
- html: {
- source: 'injected_screens.html',
- mainDivId: 'ProjectRequest-mainDiv'
- }
- }
- }
-}
+// this file contains a list of all files that need to be loaded dynamically for this i2b2 Cell
+// every file in this list will be loaded after the cell's Init function is called
+{
+ files:[
+ "ProjectRequest_ctrlr.js"
+ ],
+ css:[
+ "vwProjectRequest.css"
+ ],
+ config: {
+ // additional configuration variables that are set by the system
+ short_name: "Project Request",
+ name: "Project Request",
+ description: "This plugin is uesed to generate a request for a new project based on concepts, patients and sets..",
+ category: ["celless","plugin","examples"],
+ plugin: {
+ isolateHtml: false, // this means do not use an IFRAME
+ isolateComm: false, // this means to expect the plugin to use AJAX communications provided by the framework
+ standardTabs: true, // this means the plugin uses standard tabs at top
+ html: {
+ source: 'injected_screens.html',
+ mainDivId: 'ProjectRequest-mainDiv'
+ }
+ }
+ }
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/Timeline_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/Timeline_ctrlr.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/Timeline_modLabRange.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/Timeline_modLabRange.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/assets/Timeline-loading.gif b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/assets/Timeline-loading.gif
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/assets/injected_screens.html b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/assets/injected_screens.html
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/assets/vwTimeline.css b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/assets/vwTimeline.css
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/cell_config_data.js b/shrine-webclient/src/main/html/js-i2b2/cells/plugins/standard/Timeline/cell_config_data.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/help_viewer.js b/shrine-webclient/src/main/html/js-i2b2/hive/help_viewer.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/hive.ui.js b/shrine-webclient/src/main/html/js-i2b2/hive/hive.ui.js
old mode 100755
new mode 100644
index 45080f668..411175503
--- a/shrine-webclient/src/main/html/js-i2b2/hive/hive.ui.js
+++ b/shrine-webclient/src/main/html/js-i2b2/hive/hive.ui.js
@@ -1,176 +1,176 @@
-
-/*
- * Make the Splitter object
- */
-
-Splitter = function( name, config )
-{
- /* type is type of the event ("ONTResized" in this case), args is an array of all of the arguments that were passed to the event's fire method,
- * and me is the custom object we passed in when we subscribed to the event.
- */
- /*
- * This method is called when CRC is initialized and when browser window is resized
- */
- this.onResize = function( type, args, me )
- {
- var ve = $('ontMainBox');
- if (ve.style.width === "")
- {
- return;
- }
-
- var splitter = $( name );
-
- if ( this.leftProportion == null )
- {
- splitter.style.left = addToProperty( ve.style.width, 18, "px", "px" );
- this.leftProportion = (parseInt(splitter.style.left))/(YAHOO.util.Dom.getViewportWidth()-15);
- }
- else
- {
- splitter.style.left = this.leftProportion * (YAHOO.util.Dom.getViewportWidth()-15) + "px";
- }
- splitter.style.top = this.topOffset + "px";
- splitter.style.height = (YAHOO.util.Dom.getViewportHeight()-this.topOffset) + "px";
- }
-
- this.onCRCinit = function( type, args, me )
- {
- this.onResize( type, args, me);
- this.initConstraints();
- }
-
- // fires when splitter is dragged
- this.resizeOtherComponents = function()
- {
- if (i2b2.ONT != undefined)
- i2b2.ONT.view.main.splitterDragged(); // resize ONT
- if (i2b2.WORK != undefined)
- i2b2.WORK.view.main.splitterDragged(); // resize WORK
- i2b2.CRC.view.history.splitterDragged(); // resize Query History
- i2b2.CRC.view.QT.splitterDragged(); // resize Query Tool
- i2b2.CRC.view.status.splitterDragged(); // resize Query Status
- i2b2.PLUGINMGR.view.PlugView.splitterDragged(); // resize Plugin View
- i2b2.PLUGINMGR.view.list.splitterDragged(); // resize Plugin View
- }
-
- // fires when window is resized
- this.resizeComopnentHeight = function()
- {
- if (i2b2.ONT != undefined) {
- i2b2.ONT.view.main.ResizeHeight(); // resize ONT
- i2b2.ONT.view.find.ResizeHeight(); // resize ONT.find
- i2b2.ONT.view.nav.ResizeHeight(); // resize ONT.nav
- }
- if (i2b2.WORK != undefined)
- i2b2.WORK.view.main.ResizeHeight(); // resize WORK
- i2b2.CRC.view.history.ResizeHeight(); // resize Query History
- i2b2.CRC.view.QT.ResizeHeight(); // resize Query Panels
- i2b2.CRC.view.status.ResizeHeight(); // resize Query Status
- i2b2.PLUGINMGR.view.PlugView.ResizeHeight(); // resize Plugin View
- i2b2.PLUGINMGR.view.list.ResizeHeight(); // resize Plugin List
- }
-
- /* resize all components when splitter is dragged */
- this.dragged = function()
- {
- var splitter = $( name );
- this.leftProportion = parseInt(splitter.style.left)/(YAHOO.util.Dom.getViewportWidth()-15); // remember the new leftProportion
- this.resizeOtherComponents();
- }
-
- /*
- * Initializing instance variables and calling super's constructor
- */
- this.name = name;
- this.topOffset = 33;
- this.cont = config.cont;
- this.leftProportion = null;
- Splitter.superclass.constructor.apply(this, arguments);
-
- this.events.ONTInitialized = new YAHOO.util.CustomEvent("ONTInitialized", this); // create event for ONTInitialization
- this.events.ONTInitialized.subscribe( this.onCRCinit, this); // listen to the event and attach handlers
-}
-// extension must immediately follow constructor (this makes the Splitter Drag-and-Drop-able.)
-YAHOO.extend(Splitter, YAHOO.util.DD,
-{
- cont: null,
- init: function()
- {
- // Call parent's init method
- Splitter.superclass.init.apply(this, arguments);
- var splitter = $( this.name );
- if (YAHOO.env.ua.ie > 0) // ie does not supoprt ew-resize (see http://msdn.microsoft.com/en-us/library/ie/aa358795%28v=vs.85%29.aspx)
- splitter.style.cursor = "e-resize";
- else
- splitter.style.cursor = "ew-resize";
-
- YAHOO.util.Event.on( window, 'resize', function()
- {
- this.initConstraints();
- this.onResize();
- this.resizeOtherComponents();
- this.resizeComopnentHeight();
- },
- this,
- true );
- },
-
- initConstraints: function()
- {
- var dom = YAHOO.util.Dom;
- var region = dom.getRegion( this.cont );
- var el = this.getEl();
- var xy = dom.getXY(el);
- var width = parseInt( dom.getStyle(el, 'width'), 10 );
- var left = xy[0] - region.left;
- var right = region.right - xy[0] - width;
-
- this.setXConstraint( left, right);
- this.setYConstraint( 0, 0 ); // no vertical travel
- },
-
- onDrag: function(e)
- {
- this.dragged();
- }
-});
-
-
-
-/*
- * Property adjustment/setting utilities
- */
-var stripUnit = function(numberAndUnitString, unitString)
-{ return numberAndUnitString.substring(0, numberAndUnitString.indexOf(unitString)); }
-
-var appendUnit = function(number, unit)
-{ return number+unit; }
-
-var setProperty = function( oldPropertyValue, newPropertyValue, oldUnit, newUnit )
-{ return appendUnit(stripUnit(oldPropertyValue, oldUnit), newUnit); }
-
-// propertyDiff is a Number, other parameters are Strings
-var addToProperty = function( oldPropertyValue, propertyDiff, oldUnit, newUnit )
-{ return appendUnit( parseInt(stripUnit(oldPropertyValue, oldUnit)) + propertyDiff, newUnit); }
-
-
-/*
- * Debugging utilities
- */
-var debugOnScreen = function( text )
-{
- $('main.debug').appendChild( document.createTextNode( text ) );
- $('main.debug').appendChild( document.createElement("br") );
-}
-
-var debugOnScreenWithDate = function( text )
-{
- var date = new Date();
- debugOnScreen( text + " " + date );
-}
-
-var debugOnScreenClear = function()
-{
- $('main.debug').innerHTML = "";
-}
+
+/*
+ * Make the Splitter object
+ */
+
+Splitter = function( name, config )
+{
+ /* type is type of the event ("ONTResized" in this case), args is an array of all of the arguments that were passed to the event's fire method,
+ * and me is the custom object we passed in when we subscribed to the event.
+ */
+ /*
+ * This method is called when CRC is initialized and when browser window is resized
+ */
+ this.onResize = function( type, args, me )
+ {
+ var ve = $('ontMainBox');
+ if (ve.style.width === "")
+ {
+ return;
+ }
+
+ var splitter = $( name );
+
+ if ( this.leftProportion == null )
+ {
+ splitter.style.left = addToProperty( ve.style.width, 18, "px", "px" );
+ this.leftProportion = (parseInt(splitter.style.left))/(YAHOO.util.Dom.getViewportWidth()-15);
+ }
+ else
+ {
+ splitter.style.left = this.leftProportion * (YAHOO.util.Dom.getViewportWidth()-15) + "px";
+ }
+ splitter.style.top = this.topOffset + "px";
+ splitter.style.height = (YAHOO.util.Dom.getViewportHeight()-this.topOffset) + "px";
+ }
+
+ this.onCRCinit = function( type, args, me )
+ {
+ this.onResize( type, args, me);
+ this.initConstraints();
+ }
+
+ // fires when splitter is dragged
+ this.resizeOtherComponents = function()
+ {
+ if (i2b2.ONT != undefined)
+ i2b2.ONT.view.main.splitterDragged(); // resize ONT
+ if (i2b2.WORK != undefined)
+ i2b2.WORK.view.main.splitterDragged(); // resize WORK
+ i2b2.CRC.view.history.splitterDragged(); // resize Query History
+ i2b2.CRC.view.QT.splitterDragged(); // resize Query Tool
+ i2b2.CRC.view.status.splitterDragged(); // resize Query Status
+ i2b2.PLUGINMGR.view.PlugView.splitterDragged(); // resize Plugin View
+ i2b2.PLUGINMGR.view.list.splitterDragged(); // resize Plugin View
+ }
+
+ // fires when window is resized
+ this.resizeComopnentHeight = function()
+ {
+ if (i2b2.ONT != undefined) {
+ i2b2.ONT.view.main.ResizeHeight(); // resize ONT
+ i2b2.ONT.view.find.ResizeHeight(); // resize ONT.find
+ i2b2.ONT.view.nav.ResizeHeight(); // resize ONT.nav
+ }
+ if (i2b2.WORK != undefined)
+ i2b2.WORK.view.main.ResizeHeight(); // resize WORK
+ i2b2.CRC.view.history.ResizeHeight(); // resize Query History
+ i2b2.CRC.view.QT.ResizeHeight(); // resize Query Panels
+ i2b2.CRC.view.status.ResizeHeight(); // resize Query Status
+ i2b2.PLUGINMGR.view.PlugView.ResizeHeight(); // resize Plugin View
+ i2b2.PLUGINMGR.view.list.ResizeHeight(); // resize Plugin List
+ }
+
+ /* resize all components when splitter is dragged */
+ this.dragged = function()
+ {
+ var splitter = $( name );
+ this.leftProportion = parseInt(splitter.style.left)/(YAHOO.util.Dom.getViewportWidth()-15); // remember the new leftProportion
+ this.resizeOtherComponents();
+ }
+
+ /*
+ * Initializing instance variables and calling super's constructor
+ */
+ this.name = name;
+ this.topOffset = 33;
+ this.cont = config.cont;
+ this.leftProportion = null;
+ Splitter.superclass.constructor.apply(this, arguments);
+
+ this.events.ONTInitialized = new YAHOO.util.CustomEvent("ONTInitialized", this); // create event for ONTInitialization
+ this.events.ONTInitialized.subscribe( this.onCRCinit, this); // listen to the event and attach handlers
+}
+// extension must immediately follow constructor (this makes the Splitter Drag-and-Drop-able.)
+YAHOO.extend(Splitter, YAHOO.util.DD,
+{
+ cont: null,
+ init: function()
+ {
+ // Call parent's init method
+ Splitter.superclass.init.apply(this, arguments);
+ var splitter = $( this.name );
+ if (YAHOO.env.ua.ie > 0) // ie does not supoprt ew-resize (see http://msdn.microsoft.com/en-us/library/ie/aa358795%28v=vs.85%29.aspx)
+ splitter.style.cursor = "e-resize";
+ else
+ splitter.style.cursor = "ew-resize";
+
+ YAHOO.util.Event.on( window, 'resize', function()
+ {
+ this.initConstraints();
+ this.onResize();
+ this.resizeOtherComponents();
+ this.resizeComopnentHeight();
+ },
+ this,
+ true );
+ },
+
+ initConstraints: function()
+ {
+ var dom = YAHOO.util.Dom;
+ var region = dom.getRegion( this.cont );
+ var el = this.getEl();
+ var xy = dom.getXY(el);
+ var width = parseInt( dom.getStyle(el, 'width'), 10 );
+ var left = xy[0] - region.left;
+ var right = region.right - xy[0] - width;
+
+ this.setXConstraint( left, right);
+ this.setYConstraint( 0, 0 ); // no vertical travel
+ },
+
+ onDrag: function(e)
+ {
+ this.dragged();
+ }
+});
+
+
+
+/*
+ * Property adjustment/setting utilities
+ */
+var stripUnit = function(numberAndUnitString, unitString)
+{ return numberAndUnitString.substring(0, numberAndUnitString.indexOf(unitString)); }
+
+var appendUnit = function(number, unit)
+{ return number+unit; }
+
+var setProperty = function( oldPropertyValue, newPropertyValue, oldUnit, newUnit )
+{ return appendUnit(stripUnit(oldPropertyValue, oldUnit), newUnit); }
+
+// propertyDiff is a Number, other parameters are Strings
+var addToProperty = function( oldPropertyValue, propertyDiff, oldUnit, newUnit )
+{ return appendUnit( parseInt(stripUnit(oldPropertyValue, oldUnit)) + propertyDiff, newUnit); }
+
+
+/*
+ * Debugging utilities
+ */
+var debugOnScreen = function( text )
+{
+ $('main.debug').appendChild( document.createTextNode( text ) );
+ $('main.debug').appendChild( document.createElement("br") );
+}
+
+var debugOnScreenWithDate = function( text )
+{
+ var date = new Date();
+ debugOnScreen( text + " " + date );
+}
+
+var debugOnScreenClear = function()
+{
+ $('main.debug').innerHTML = "";
+}
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/hive_SDX.js b/shrine-webclient/src/main/html/js-i2b2/hive/hive_SDX.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/hive_config_data.js b/shrine-webclient/src/main/html/js-i2b2/hive/hive_config_data.js
old mode 100755
new mode 100644
index 2e5956671..eead25086
--- a/shrine-webclient/src/main/html/js-i2b2/hive/hive_config_data.js
+++ b/shrine-webclient/src/main/html/js-i2b2/hive/hive_config_data.js
@@ -1,17 +1,17 @@
-// this file contains a list of all files that need to be loaded dynamically for the i2b2 framework
-// every file in this list will be loaded after page load
-{
- files: [
- "hive_globals.js",
- "hive_helpers.js",
- "hive_SDX.js",
- "msg_sniffer.js",
- "help_viewer.js",
- "master_view_ctrlr.js",
- "i2b2_cell_communicator.js"
- ],
- config: {
- // additional configuration variables that are set by the system
- validMasterViews: ['Patients', 'Analysis']
- }
+// this file contains a list of all files that need to be loaded dynamically for the i2b2 framework
+// every file in this list will be loaded after page load
+{
+ files: [
+ "hive_globals.js",
+ "hive_helpers.js",
+ "hive_SDX.js",
+ "msg_sniffer.js",
+ "help_viewer.js",
+ "master_view_ctrlr.js",
+ "i2b2_cell_communicator.js"
+ ],
+ config: {
+ // additional configuration variables that are set by the system
+ validMasterViews: ['Patients', 'Analysis']
+ }
}
\ No newline at end of file
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/hive_globals.js b/shrine-webclient/src/main/html/js-i2b2/hive/hive_globals.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/hive_helpers.js b/shrine-webclient/src/main/html/js-i2b2/hive/hive_helpers.js
old mode 100755
new mode 100644
index cac0ed179..0cb5ee92c
--- a/shrine-webclient/src/main/html/js-i2b2/hive/hive_helpers.js
+++ b/shrine-webclient/src/main/html/js-i2b2/hive/hive_helpers.js
@@ -1,814 +1,807 @@
/**
* @projectDescription Various helper functions used by the i2b2 framework and cells.
* @inherits i2b2
* @namespace i2b2
* @author Nick Benik, Griffin Weber MD PhD
* @version 1.3
* ----------------------------------------------------------------------------------------
* updated 9-15-08: RC4 launch [Nick Benik]
*/
console.group('Load & Execute component file: hive > helpers');
console.time('execute time');
if (Object.isUndefined(i2b2.h)) i2b2.h = {};
// ================================================================================================== //
// Hack PrototypeJS to accept multiple parameters for its Object.isUndefined function call
// (utilize a closure to store a protected reference to prototype's original Object.isUndefined object)
i2b2.protoObjhack = (function() {
var origFunction = Object.isUndefined;
var newFunction = function(){
for(var i=0; i<arguments.length; i++) {
if (origFunction(arguments[i])) { return true; }
}
return false;
};
return newFunction;
});
Object.isUndefined = i2b2.protoObjhack();
delete i2b2.protoObjhack;
// ================================================================================================== //
i2b2.h.parseXml = function(xmlString){
var xmlDocRet = false;
- if (typeof window.ActiveXObject != "undefined" && new window.ActiveXObject("Microsoft.XMLDOM")) {
+ var isActiveXSupported = false;
+
+ try { new ActiveXObject ("MSXML2.DOMDocument.6.0"); isActiveXSupported = true; } catch (e) { isActiveXSupported = false; }
+
+ if (isActiveXSupported) {
//Internet Explorer
xmlDocRet = new ActiveXObject("Microsoft.XMLDOM");
xmlDocRet.async = "false";
xmlDocRet.loadXML(xmlString);
xmlDocRet.setProperty("SelectionLanguage", "XPath");
} else {
//Firefox, Mozilla, Opera, etc.
parser = new DOMParser();
xmlDocRet = parser.parseFromString(xmlString, "text/xml");
}
- /* oring
- try //Internet Explorer
- {
- xmlDocRet = new ActiveXObject("Microsoft.XMLDOM");
- xmlDocRet.async = "false";
- xmlDocRet.loadXML(xmlString);
- xmlDocRet.setProperty("SelectionLanguage", "XPath");
- }
- catch (e) {
- try //Firefox, Mozilla, Opera, etc.
- {
- parser = new DOMParser();
- xmlDocRet = parser.parseFromString(xmlString, "text/xml");
- }
- catch (e) {
- console.error(e.message)
- }
- }
- */
+
return xmlDocRet;
};
i2b2.h.XPath = function(xmlDoc, xPath) {
var retArray = [];
if (!xmlDoc) {
console.warn("An invalid XMLDoc was passed to i2b2.h.XPath");
return retArray;
}
try {
- if (window.ActiveXObject) {
+ if (window.ActiveXObject || "ActiveXObject" in window) {
+ if((!!navigator.userAgent.match(/Trident.*rv\:11\./)) && (typeof xmlDoc.selectNodes == "undefined")) { // IE11 handling
+ var doc = new ActiveXObject('Microsoft.XMLDOM');
+ doc.loadXML(new XMLSerializer().serializeToString(xmlDoc));
+ xmlDoc = doc;
+ }
+
// Microsoft's XPath implementation
// HACK: setProperty attempts execution when placed in IF statements' test condition, forced to use try-catch
try {
xmlDoc.setProperty("SelectionLanguage", "XPath");
} catch(e) {
try {
xmlDoc.ownerDocument.setProperty("SelectionLanguage", "XPath");
} catch(e) {}
- }
+ }
retArray = xmlDoc.selectNodes(xPath);
+
}
else if (document.implementation && document.implementation.createDocument) {
// W3C XPath implementation (Internet standard)
var ownerDoc = xmlDoc.ownerDocument;
if (!ownerDoc) {ownerDoc = xmlDoc; }
var nodes = ownerDoc.evaluate(xPath, xmlDoc, null, XPathResult.ANY_TYPE, null);
var rec = nodes.iterateNext();
while (rec) {
retArray.push(rec);
rec = nodes.iterateNext();
}
}
} catch (e) {
console.error("An error occurred while trying to perform XPath query.");
console.dir(e);
}
return retArray;
};
i2b2.h.getXNodeVal = function(xmlElement, nodeName, includeChildren) {
var gotten = i2b2.h.XPath(xmlElement, "descendant-or-self::"+nodeName+"/text()");
var final = "";
if (gotten.length > 0) {
if (includeChildren == true || includeChildren == true) {
for (var i=0; i<gotten.length; i++) {
final += gotten[i].nodeValue;
}
} else {
final = gotten[0].nodeValue;
}
} else {
final = undefined;
}
return final;
}
i2b2.h.GenerateAlphaNumId = function(ReqIdLength) {
var IdLen = 0;
var retId = "";
while (IdLen <= ReqIdLength) {
IdLen++;
switch(Math.floor(Math.random() * 3)) {
case 0:
// add a number
retId += Math.floor(Math.random() * 10).toString();
break;
case 1:
// upper case letter
retId += String.fromCharCode(Math.floor(Math.random() * 26)+65);
break;
case 2:
// lower case letter
retId += String.fromCharCode(Math.floor(Math.random() * 26)+97);
break;
}
}
return retId;
};
i2b2.h.GenerateISO8601DateTime = function(inDate) {
if (!inDate) { inDate = new Date(); }
var year = inDate.getYear();
if (year < 2000) year = year + 1900;
var month = inDate.getMonth() + 1;
var day = inDate.getDate();
var hour = inDate.getHours();
var hourUTC = inDate.getUTCHours();
var diff = hour - hourUTC;
var hourdifference = Math.abs(diff);
var minute = inDate.getMinutes();
var minuteUTC = inDate.getUTCMinutes();
var minutedifference;
var second = inDate.getSeconds();
var timezone;
if (minute != minuteUTC && minuteUTC < 30 && diff < 0) { hourdifference--; }
if (minute != minuteUTC && minuteUTC > 30 && diff > 0) { hourdifference--; }
if (minute != minuteUTC) {
minutedifference = ":30";
} else {
minutedifference = ":00";
}
if (hourdifference < 10) {
timezone = "0" + hourdifference + minutedifference;
} else {
timezone = "" + hourdifference + minutedifference;
}
if (diff < 0) {
timezone = "-" + timezone;
} else {
timezone = "+" + timezone;
}
if (month <= 9) month = "0" + month;
if (day <= 9) day = "0" + day;
if (hour <= 9) hour = "0" + hour;
if (minute <= 9) minute = "0" + minute;
if (second <= 9) second = "0" + second;
return (year + "-" + month + "-" + day + "T" + hour + ":" + minute + ":" + second + timezone);
};
i2b2.h.Escape = function(inStrValue) {
if (typeof inStrValue == "number") {
var t = inStrValue.toString();
} else {
var t = new String(inStrValue);
}
t = t.replace(/&/g, "&amp;");
t = t.replace(/</g, "&lt;");
t = t.replace(/>/g, "&gt;");
return t;
};
i2b2.h.Unescape = function(inStrValue) {
var t = new String(inStrValue);
t = t.replace(/&gt;/g, ">");
t = t.replace(/&lt;/g, "<");
t = t.replace(/&amp;/g, "&");
return t;
};
i2b2.h.EscapeTemplateVars = function(refTemplateVals, arryIgnoreVars) {
for (var vname in refTemplateVals) {
var ignore = false;
for (var i=0; i<arryIgnoreVars.length; i++) {
if (vname == arryIgnoreVars[i]) {
ignore = true;
break;
}
}
if (!ignore) {
// escaping value
refTemplateVals[vname] = this.Escape(refTemplateVals[vname]);
}
}
};
i2b2.h.LoadingMask = {
show: function() {
var sz = document.viewport.getDimensions();
var w = sz.width;
var h = sz.height;
if (w < 840) {w = 840;}
if (h < 517) {h = 517;}
var mn = $('topMask');
mn.style.width=w-10;
mn.style.height=h-10;
mn.innerHTML = "<TABLE height='100%' width='100%'><TR><TD align='center' valign='center'><BR/><H1><FONT size='12' color='white'>LOADING</FONT></H1></TD></TR></TABLE>";
mn.zindex = 50000;
// mn.style.cursor = 'wait';
mn.show();
},
hide: function() {
// hide the loading mask
var mn = $('topMask');
mn.innerHTML='';
mn.hide();
}
};
// created this object to allow the joining of forked execution paths (Waiting for Multiple AJAX calls)
i2b2.h.JoiningMutex = {
_contexts: {},
_contextGenID: 0,
_createContextProxy: function(contextRef) {
// create a proxy object (via closure) to encapsulate data
// and route actions to the JoinMutex singleton
var cl_JoinMutextRef = contextRef;
function JoiningMutexContextProxy() {
this._JoiningMutexContext = cl_JoinMutextRef;
this._alreadyRun = false;
this.name = function() { return this._JoiningMutexContext.name; };
this.openThreads = function() { return this._JoiningMutexContext.openThreads; };
this.executeOnce = function() { return this._JoiningMutexContext.executeOnce; };
this.executionCount = function() { return this._JoiningMutexContext.executionCount; };
this.isActive = function() { return this._JoiningMutexContext.active; };
this.ThreadFinished = function() {
if (!this._JoiningMutexContext.active) {
return {error: true, errorObj: undefined, errorMsg: 'JoiningMutexProxy.ThreadFinished() failed because the giving context is no longer active'};
}
if (this._JoiningMutexContext._alreadyRun) {
return {error: true, errorObj: undefined, errorMsg: 'JoiningMutexProxy.ThreadFinished() failed because the MutexProxy has already been run'};
}
if (this._JoiningMutexContext.openThreads > 0) {
this._JoiningMutexContext.openThreads--;
this._alreadyRun = true;
if (this._JoiningMutexContext.openThreads == 0) {
// all threads finished
if (this._JoiningMutexContext.executeOnce) {
// this is going to be our only run of the callback function
this._JoiningMutexContext.active = false;
}
this._JoiningMutexContext.executionCount++;
this._JoiningMutexContext.callbackFinished();
return true;
} else {
// everything is OK but there are still outstanding threads to finish
return false;
}
} else {
return {error: true, errorObj: undefined, errorMsg: 'JoiningMutexProxy.ThreadFinished() failed because there are no outstanding thread executions'};
}
};
}
return new JoiningMutexContextProxy;
},
contextCreate: function(sContextName, fZeroRunFunction, bSingleRun) {
// make sure context is new
var validName = sContextName;
try {
if (!validName) {
this._contextGenID++;
validName = "AUTOGEN-"+this._contextGenID;
}
if (this._contexts[validName]) {
return {error: true, errorObj: undefined, errorMsg: 'JoiningMutex.contextCreate() failed because the giving context name already exists'};
}
// verify that the name can be used as an object identifier (with throw an error if invalid)
this._contexts[validName] = true;
delete this._contexts[validName];
} catch(e) {
return {error: true, errorObj: e, errorMsg: 'an error occurred within JoiningMutex.contextCreate()'};
}
// create new context object
function JoiningMutexContext(inName, inFinishFunction, inSingleExecution) {
this.name = inName;
this.callbackFinished = inFinishFunction;
this.openThreads = 0;
this.executeOnce = inSingleExecution;
this.executionCount = 0;
this.active = true;
}
var bSingleRun = Boolean.parseTo(bSingleRun);
this._contexts[validName] = new JoiningMutexContext(validName, fZeroRunFunction, bSingleRun);
// add ourselves to the thread count
var cl_JoinMutextRef = this._contexts[validName];
cl_JoinMutextRef.openThreads++;
return this._createContextProxy(cl_JoinMutextRef);
},
contextJoin: function(sContextName) {
// make sure context already exists
var validName = sContextName;
if (!this._contexts[validName]) {
return {error: true, errorObj: undefined, errorMsg: 'JoiningMutex.contextCreate() failed because the context name does not exist'};
}
var cl_JoinMutextRef = this._contexts[validName];
// Add this thread to the count
cl_JoinMutextRef.openThreads++;
return this._createContextProxy(cl_JoinMutextRef);
},
contextJoinCreate: function(sContextName, fZeroRunFunction, bSingleRun) {
// Join context or create it if it exists
var ctx = false;
if (!sContextName || !this._contexts[sContextName]) {
ctx = this.contextCreate.call(this, sContextName, fZeroRunFunction, bSingleRun);
} else {
ctx = this.contextJoin.call(this, sContextName);
}
return ctx;
},
contextDestroy: function(sContextName) {
if (!sContextName || !this._contexts[sContextName]) {
return false;
} else {
// Garbage collection will not execute until all
// the JoiningMutexContextProxy are deleted so
// invalidate the context as well as delete it!
this._contexts[sContextName].active = false;
this._contexts[sContextName].callbackFinished = function() { return null; };
delete this._contexts[sContextName];
return true;
}
}
};
// this function will hide/show elements tagged with the "debug" classname
i2b2.h.debugElements = function(rootElement) {
var el = $(rootElement);
if (!el) { return; }
var tns = el.select('.debug');
var sflg = i2b2.h.inDebugMode();
for (var i=0; i<tns.length; i++) {
if (sflg) {
tns[i].show();
} else {
tns[i].hide();
}
}
}
i2b2.events.afterLogin.subscribe(
(function(en,co,a) {
// remove debugging functionality from GUI
i2b2.h.debugElements(document.documentElement);
// remove the analysis link if configuration tells us to
if (!i2b2.h.allowAnalysis()) { $('allowAnalysis').hide(); }
})
);
i2b2.h.isBadObjPath = function(sObjectHierarchy) {
try {
var t = eval("("+sObjectHierarchy+")");
return Object.isUndefined(t);
} catch (e) {
return true;
}
}
// Extend JS Objects
// ================================================================================================== //
String.prototype.repeat = function(l){
return new Array(l+1).join(this);
};
// ================================================================================================== //
function padNumber(num, req_digits) {
num = parseInt(num, 10)+"";
var pad = req_digits - num.length;
if (pad > 0 ) num = "0".repeat(pad)+num;
return num;
}
// wrap YUI functions into the JS Object constructor to augment Protype-JS functions
// ================================================================================================== //
Object.isObject = function(testObj) { return YAHOO.lang.isObject(testObj); }
Object.isNull = function(testObj) { return YAHOO.lang.isNull(testObj); }
Object.isBoolean = function(testObj) { return YAHOO.lang.isBoolean(testObj); }
Boolean.parseTo = function(inputValue) {
if (typeof inputValue == "string") {
return /\btrue/i.match(inputValue);
}
return (inputValue==true);
}
// This is a special closure-based function to return a unique ID every time called.
// The closure counter gets wrapped into a private "bubble" within the JsVM that
// is not accessable from other calls... Let the scope-chain bending begin!
// ================================================================================================== //
i2b2.GUID = (function() {
var closure_Counter = 0 ;
function closure_nextID() {
var prevID = closure_Counter;
closure_Counter++;
if (prevID > closure_Counter) console.error("[i2b2.GUID function's internal counter encountered an overflow!!!]");
return closure_Counter;
}
return (function() { return closure_nextID(); });
})();
// Global helper functions
// ================================================================================================== //
function parseBoolean(inputStr) { return /\btrue/i.match(inputStr); }
// function needed to perform processing
// only on objects that match a specific type
// ================================================================================================== //
Object.getClass = getObjectClass;
function getObjectClass(obj) {
if (obj && obj.constructor && obj.constructor.toString) {
var arr = obj.constructor.toString().match(/function\s*(\w+)/);
if (arr && arr.length == 2) { return arr[1]; }
}
return undefined;
}
// Extend the YAHOO.widget.TreeView object
// ================================================================================================== //
YAHOO.widget.TreeView.findTreeByChildDiv = function(divChild) {
var parentNode;
var isDone = false;
var tdiv = $(divChild);
if (!tdiv) { return undefined; }
do {
if (tdiv.id) {
var tree = this.getTree(tdiv.id);
if (tree) { isDone = true; }
}
if (tdiv.parentNode) {
tdiv = tdiv.parentNode;
} else {
isDone = true;
}
} while (!isDone)
return tree;
}
YAHOO.widget.TreeView.getNode_orig = YAHOO.widget.TreeView.getNode;
YAHOO.widget.TreeView.getNode = function(treeId, nodeIndex) {
// This is an enhanced version which overrides the default function within the
// YUI library, This is needed to handle HTML <-> data structure mismatches
// which occurs because we are separating and redisplaying our Root nodes
// in different treesview controller instances. This function falls back on
// the original function calls which should prevent any problems with future versions
var retNode = YAHOO.widget.TreeView.getNode_orig(treeId, nodeIndex);
if (!retNode) {
// start special processing to find our node in the list of other tree controllers
for (var ntn in YAHOO.widget.TreeView.trees) {
var nexttree = YAHOO.widget.TreeView.trees[ntn];
if (nexttree.toString) {
var n = nexttree.toString();
var s = n.split(' ',2);
if (s[0] == "TreeView") {
retNode = YAHOO.widget.TreeView.getNode_orig(s[1], nodeIndex);
if (retNode) { break; }
}
}
}
}
return retNode;
}
// ================================================================================================== //
YAHOO.widget.Node.prototype.refresh_orig = YAHOO.widget.Node.prototype.refresh;
YAHOO.widget.Node.prototype.refresh = function() {
// Intercept call to default node.refresh() and extend it to fire original call
// then fire the YAHOO.util.DDM.reattachHandlers() function to reattach
// drag & drop handlers that are used by the trees.
var ret = this.refresh_orig.call(this);
YAHOO.util.DDM.reattachHandlers();
console.warn("reattach DD handlers");
return ret;
}
// ================================================================================================== //
YAHOO.widget.TreeView.attachRootNodeToTree = function(obRootNode, objTree) {
if (obRootNode == objTree.root) return true;
// this is our recursive set tree function
var recursiveSetTree = function(oTree, oNode, recFunc) {
if (oNode.tree) { oNode.tree = oTree; }
try {
for (var i=0; i<oNode.children.length; i++) {
recFunc(oTree, oNode.children[i], recFunc);
}
} catch(e) {}
}
var recursiveTreePopulate = function(oTreeArrayNode, oNode, recFunc) {
if (oNode.index) { oTreeArrayNode[oNode.index] = oNode; }
try {
for (var i=0; i<oNode.children.length; i++) {
recFunc(oTreeArrayNode, oNode.children[i], recFunc);
}
} catch(e) {}
}
var recursiveApplyParent = function(oNode, recFunc) {
try {
for (var i=0; i<oNode.children.length; i++) {
oNode.children[i].applyParent(oNode);
recFunc(oNode.children[i], recFunc);
}
} catch(e) {}
}
objTree._nodes.clear();
// attach the new root node to the tree
objTree.root = obRootNode;
obRootNode.tree = objTree;
for (var i=0; i<obRootNode.children.length; i++) {
obRootNode.children[i].applyParent(obRootNode);
}
//recursiveSetTree(objTree, objTree.root, recursiveSetTree);
recursiveTreePopulate(objTree._nodes, objTree.root, recursiveTreePopulate);
// reattach the dynamic load event if it was lost
objTree.setDynamicLoad(i2b2.CRC.ctrlr.QT._loadTreeDataForNode,1);
return true;
}
YAHOO.widget.Node.prototype.isDescendant = function(srchNode) {
// is the current node a descendant of srchNode? Used to prevent parents being dragged into its child nodes.
var thisNode = this;
if (!srchNode) { return undefined; }
while (thisNode.parent) {
if (thisNode == srchNode) {
return true;
}
thisNode = thisNode.parent;
}
return false;
}
// this function is a very clever hack to reattach all YUI drag & drop handlers which have
// gotten detached and have (newer copies of) their elements in the visible DOM tree
YAHOO.util.DDM.reattachHandlers = function() {
for (var grps in YAHOO.util.DDM.ids) {
// interaction groups
for (var el in YAHOO.util.DDM.ids[grps]) {
try {
var t = YAHOO.util.DDM.ids[grps][el];
// copy the info
var ddId = t.id;
var ddGrps = Object.clone(t.groups);
var ddCfg = Object.clone(t.config);
var ddTargeted = t.isTarget;
var fEl = $(el);
if (!fEl) {
if (t.available) {
// remove DD for non-existent HTML elements and
// only after the DD has been initialized
t._domRef = null;
t.unreg();
}
} else {
// reattach
if (t._domRef != fEl) {
t._domRef = fEl;
t.init(ddId);
t.groups = Object.clone(ddGrps);
t.isTarget = ddTargeted;
}
}
} catch(e) { console.warn("Error while reattaching DD handlers: "+e.message); }
}
}
}
// ================================================================================================== //
// Patch a bug in the YUI overlay subsystem which ignores/destroys zIndex parameter given
// to modal forms during initial creation. TODO: REMOVE THIS WHEN YAHOO FIXES THIS BUG!
i2b2.bugfix1 = function () {};
i2b2.bugfix1.prototype.bringToTop = function() {
var Dom = YAHOO.util.Dom;
var Overlay = YAHOO.widget.Overlay;
var Lang = YAHOO.lang;
var aOverlays = [],
oElement = this.element;
function compareZIndexDesc(p_oOverlay1, p_oOverlay2) {
var sZIndex1 = Dom.getStyle(p_oOverlay1, "zIndex"),
sZIndex2 = Dom.getStyle(p_oOverlay2, "zIndex"),
nZIndex1 = (!sZIndex1 || isNaN(sZIndex1)) ? 0 : parseInt(sZIndex1, 10),
nZIndex2 = (!sZIndex2 || isNaN(sZIndex2)) ? 0 : parseInt(sZIndex2, 10);
if (nZIndex1 > nZIndex2) {
return -1;
} else if (nZIndex1 < nZIndex2) {
return 1;
} else {
return 0;
}
}
function isOverlayElement(p_oElement) {
var oOverlay = Dom.hasClass(p_oElement, Overlay.CSS_OVERLAY),
Panel = YAHOO.widget.Panel;
if (oOverlay && !Dom.isAncestor(oElement, oOverlay)) {
if (Panel && Dom.hasClass(p_oElement, Panel.CSS_PANEL)) {
aOverlays[aOverlays.length] = p_oElement.parentNode;
} else {
aOverlays[aOverlays.length] = p_oElement;
}
}
}
Dom.getElementsBy(isOverlayElement, "DIV", document.body);
aOverlays.sort(compareZIndexDesc);
var oTopOverlay = aOverlays[0],
nTopZIndex;
if (oTopOverlay) {
nTopZIndex = Dom.getStyle(oTopOverlay, "zIndex");
if (!isNaN(nTopZIndex)) {
var bRequiresBump = false;
if (oTopOverlay != oElement) {
bRequiresBump = true;
} else if (aOverlays.length > 1) {
var nNextZIndex = Dom.getStyle(aOverlays[1], "zIndex");
// Don't rely on DOM order to stack if 2 overlays are at the same zindex.
if (!isNaN(nNextZIndex) && (nTopZIndex == nNextZIndex)) {
bRequiresBump = true;
}
}
// <PATCH: make sure the zIndex is >= any zIndex given in the initial creation settings>
if (!Lang.isUndefined(this.cfg.config.zindex)) {
if (parseInt(this.cfg.config.zindex.value, 10) >= parseInt(nTopZIndex,10)) {
nTopZIndex = this.cfg.config.zindex.value;
bRequiresBump = true;
}
}
// </PATCH: make sure the zIndex is >= any zIndex given in the initial creation settings>
if (bRequiresBump) {
this.cfg.setProperty("zindex", (parseInt(nTopZIndex, 10) + 2));
}
}
}
};
i2b2.bugfix2 = function() {
YAHOO.lang.augmentProto(YAHOO.widget.Overlay, i2b2.bugfix1, true);
delete i2b2.bugfix1;
delete i2b2.bugfix2;
};
setTimeout('i2b2.bugfix2()',200);
// AJAX/XML
// ================================================================================================== //
function getHtmlText(node) {
if (node.innerText) { // IE;
return node.innerText;
} else {
if (node.textContent) {
return node.textContent;
}
}
console.error('getHtmlText(): no innerText or textContent.');
}
// ================================================================================================== //
function showXML(c,r,t) {
switch (t) {
case "Request":
var s = i2b2[c].view[r]['query'+t];
if (s) {
s = s.replace(new RegExp('<','g'),'&lt;');
s = s.replace(new RegExp('>','g'),'&gt;');
} else {
s = '';
}
i2b2.hive.MsgSniffer.showSingleMsgRequest(s);
break;
case "Response":
var s = i2b2[c].view[r]['query'+t];
if (s) {
s = s.replace(new RegExp('<','g'),'&lt;');
s = s.replace(new RegExp('>','g'),'&gt;');
} else {
s = '';
}
i2b2.hive.MsgSniffer.showSingleMsgResponse(s);
break;
case "Stack":
if (c=="WORK" && r=="main") {
i2b2.hive.MsgSniffer.showStack("Workplace", ["WORK:Workplace"], ["WORK"]);
return;
}
if (c=="ONT" && r=="nav") {
i2b2.hive.MsgSniffer.showStack("Ontology Navigation", ["ONT:SDX:Concept","ONT:generalView"], ["ONT"]);
return;
}
if (c=="ONT" && r=="find") {
i2b2.hive.MsgSniffer.showStack("Ontology Search", ["ONT:SDX:Concept","ONT:FindBy","ONT:generalView"], ["ONT"]);
return;
}
if (c=="CRC" && r=="history") {
i2b2.hive.MsgSniffer.showStack("History", ["CRC:History", "CRC:SDX:QueryMaster", "CRC:SDX:QueryInstance", "CRC:SDX:PatientRecordSet"], ["CRC"]);
return;
}
if (c=="CRC" && r=="QT") {
i2b2.hive.MsgSniffer.showStack("Query Tool", ["CRC:QueryTool"]);
return;
}
if (c=="PLUGINMGR" && r=="PlugView") {
i2b2.hive.MsgSniffer.show();
return;
}
if (c=="PM" && r=="Admin") {
i2b2.hive.MsgSniffer.showStack("PM Admin", ["PM:Admin"]);
return;
}
alert("captured "+c+" :: "+r+" :: "+t);
break;
}
}
// ================================================================================================== //
i2b2.h.Xml2String = function(x) {
var xmlSerializer;
try {
xmlSerializer = new XMLSerializer();
var s = xmlSerializer.serializeToString(x);
if (s) {
return s;
} else {
return 'Browser not supported yet. (Try Firefox)';
}
}
catch (e) {
return x.xml;
}
}
// helper function to build a sniffer package for Cell Communications events
i2b2.h.BuildSniffPack = function(cellName, cellFuncName, results, signalOrigin) {
//i2b2.h.BuildSniffPack = function(viewName, cellName, cellFuncName, results) {
function i2b2_CellCommPackage() {}
var sniffPackage = new i2b2_CellCommPackage();
// if (undefined == viewName) {
// sniffPackage.ViewName = viewName;
// }
sniffPackage.CellName = cellName;
sniffPackage.CellAction = cellFuncName;
sniffPackage.CommDetails = results;
sniffPackage.SignalOrigin = signalOrigin;
return sniffPackage;
}
console.timeEnd('execute time');
console.groupEnd();
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/i2b2_cell_communicator.js b/shrine-webclient/src/main/html/js-i2b2/hive/i2b2_cell_communicator.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/master_view_ctrlr.js b/shrine-webclient/src/main/html/js-i2b2/hive/master_view_ctrlr.js
old mode 100755
new mode 100644
index 57f2c2635..be93648a3
--- a/shrine-webclient/src/main/html/js-i2b2/hive/master_view_ctrlr.js
+++ b/shrine-webclient/src/main/html/js-i2b2/hive/master_view_ctrlr.js
@@ -1,134 +1,134 @@
-/**
- * @projectDescription Module used to manage GUI view modes and window "zooming".
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * updated 10-29-08: RC4 launch [Nick Benik]
- */
-console.group('Load & Execute component file: hive > master view controller');
-console.time('execute time');
-
-
-// Master View Mode controller
-// ================================================================================================== //
-i2b2.hive.MasterView = {
- _validViews: ['Patients', 'Admin', 'Analysis', 'AnalysisZoomed'],
- _currentView: false,
- _ZoomWindows: [],
- eventChangeMode: {},
- eventZoomWindows: {},
- // ================================================================================================== //
- initViewMode: function()
- {
- var newMode = 'Patients';
- var tn = $("viewMode-"+newMode);
- if (tn)
- {
- // remove highlighting from old screen mode links
- var old = $$('.selectedView');
- old.each(function(el)
- {
- el.removeClassName('selectedView');
- });
- // highlight the new screen mode's label
- tn.addClassName('selectedView');
- }
-
- // update data
- this._currentView = newMode;
- this.eventInitView.fire( newMode );
- return true;
- },
-
-// ================================================================================================== //
- setViewMode: function(requestedMode) {
- if (this._currentView == requestedMode) { return true; }
- var newMode = false;
- for (var i=0; i<this._validViews.length; i++) {
- if (this._validViews[i] == requestedMode) {
- newMode = this._validViews[i];
- break;
- }
- }
- if (newMode) {
- if (newMode == "Analysis" && !i2b2.h.allowAnalysis() ) {
- alert('Analysis tools are disabled - This access attempt has been logged to the server.');
- return false;
- }
-// TODO: move this into a view controller?
- // change new link to selected state
- var tn = $("viewMode-"+newMode);
- if (tn) {
- // remove highlighting from old screen mode links
- var old = $$('.selectedView');
- old.each(function(el){
- el.removeClassName('selectedView');
- });
-
- // highlight the new screen mode's label
- tn.addClassName('selectedView');
-
-// // change old link to non-selected state (this is only done if the new mode has a tab)
-// var tn = $("viewMode-"+this._currentView);
-// if (tn) {
-// tn.removeClassName('selectedView');
-// }
- }
-
- // update data
- this._currentView = newMode;
- this.eventChangeMode.fire(newMode);
- return true;
- } else {
- return false;
- }
- },
-// ================================================================================================== //
- getViewMode: function() {
- var readMode = false;
- for (var i=0; i<this._validViews.length; i++) {
- if (this._validViews[i] == this._currentView) {
- readMode = this._currentView;
- break;
- }
- }
- return readMode;
- },
-// ================================================================================================== //
- getZoomWindows: function() {
- return this._ZoomWindows.clone();
- },
-// ================================================================================================== //
- addZoomWindow: function(s) {
- this._ZoomWindows.push(s);
- this.eventZoomWindows.fire({action: "ADD", window:s});
- },
-// ================================================================================================== //
- removeZoomWindow: function(s) {
- this._ZoomWindows = this._ZoomWindows.without(s);
- this.eventZoomWindows.fire({action: "REMOVE", window:s});
- },
-// ================================================================================================== //
- toggleZoomWindow: function(s) {
- if (this._ZoomWindows.indexOf(s) == -1) {
- this.addZoomWindow.call(this, s);
- } else {
- this.removeZoomWindow.call(this, s);
- }
- }
-}
-
-// create custom events
-i2b2.hive.MasterView.eventInitView = new YAHOO.util.CustomEvent('ViewModeInit');
-i2b2.hive.MasterView.eventChangeMode = new YAHOO.util.CustomEvent('ViewModeChange');
-i2b2.hive.MasterView.eventZoomWindows = new YAHOO.util.CustomEvent('ZoomListChange');
-// expose only the subscriber function in the i2b2 framework event collection
-i2b2.events.initView = {};
-i2b2.events.initView.subscribe = (function(a1,a2,a3,a4,a5,a6) {i2b2.hive.MasterView.eventInitView.subscribe.call(i2b2.hive.MasterView.eventInitView, a1,a2,a3,a4,a5,a6); });
-i2b2.events.changedViewMode = {};
-i2b2.events.changedViewMode.subscribe = (function(a1,a2,a3,a4,a5,a6) {i2b2.hive.MasterView.eventChangeMode.subscribe.call(i2b2.hive.MasterView.eventChangeMode, a1,a2,a3,a4,a5,a6); });
-i2b2.events.changedZoomWindows = {};
-i2b2.events.changedZoomWindows.subscribe = (function(a1,a2,a3,a4,a5,a6) {i2b2.hive.MasterView.eventChangeMode.subscribe.call(i2b2.hive.MasterView.eventZoomWindows, a1,a2,a3,a4,a5,a6); });
-
-
-console.timeEnd('execute time');
-console.groupEnd();
+/**
+ * @projectDescription Module used to manage GUI view modes and window "zooming".
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * updated 10-29-08: RC4 launch [Nick Benik]
+ */
+console.group('Load & Execute component file: hive > master view controller');
+console.time('execute time');
+
+
+// Master View Mode controller
+// ================================================================================================== //
+i2b2.hive.MasterView = {
+ _validViews: ['Patients', 'Admin', 'Analysis', 'AnalysisZoomed'],
+ _currentView: false,
+ _ZoomWindows: [],
+ eventChangeMode: {},
+ eventZoomWindows: {},
+ // ================================================================================================== //
+ initViewMode: function()
+ {
+ var newMode = 'Patients';
+ var tn = $("viewMode-"+newMode);
+ if (tn)
+ {
+ // remove highlighting from old screen mode links
+ var old = $$('.selectedView');
+ old.each(function(el)
+ {
+ el.removeClassName('selectedView');
+ });
+ // highlight the new screen mode's label
+ tn.addClassName('selectedView');
+ }
+
+ // update data
+ this._currentView = newMode;
+ this.eventInitView.fire( newMode );
+ return true;
+ },
+
+// ================================================================================================== //
+ setViewMode: function(requestedMode) {
+ if (this._currentView == requestedMode) { return true; }
+ var newMode = false;
+ for (var i=0; i<this._validViews.length; i++) {
+ if (this._validViews[i] == requestedMode) {
+ newMode = this._validViews[i];
+ break;
+ }
+ }
+ if (newMode) {
+ if (newMode == "Analysis" && !i2b2.h.allowAnalysis() ) {
+ alert('Analysis tools are disabled - This access attempt has been logged to the server.');
+ return false;
+ }
+// TODO: move this into a view controller?
+ // change new link to selected state
+ var tn = $("viewMode-"+newMode);
+ if (tn) {
+ // remove highlighting from old screen mode links
+ var old = $$('.selectedView');
+ old.each(function(el){
+ el.removeClassName('selectedView');
+ });
+
+ // highlight the new screen mode's label
+ tn.addClassName('selectedView');
+
+// // change old link to non-selected state (this is only done if the new mode has a tab)
+// var tn = $("viewMode-"+this._currentView);
+// if (tn) {
+// tn.removeClassName('selectedView');
+// }
+ }
+
+ // update data
+ this._currentView = newMode;
+ this.eventChangeMode.fire(newMode);
+ return true;
+ } else {
+ return false;
+ }
+ },
+// ================================================================================================== //
+ getViewMode: function() {
+ var readMode = false;
+ for (var i=0; i<this._validViews.length; i++) {
+ if (this._validViews[i] == this._currentView) {
+ readMode = this._currentView;
+ break;
+ }
+ }
+ return readMode;
+ },
+// ================================================================================================== //
+ getZoomWindows: function() {
+ return this._ZoomWindows.clone();
+ },
+// ================================================================================================== //
+ addZoomWindow: function(s) {
+ this._ZoomWindows.push(s);
+ this.eventZoomWindows.fire({action: "ADD", window:s});
+ },
+// ================================================================================================== //
+ removeZoomWindow: function(s) {
+ this._ZoomWindows = this._ZoomWindows.without(s);
+ this.eventZoomWindows.fire({action: "REMOVE", window:s});
+ },
+// ================================================================================================== //
+ toggleZoomWindow: function(s) {
+ if (this._ZoomWindows.indexOf(s) == -1) {
+ this.addZoomWindow.call(this, s);
+ } else {
+ this.removeZoomWindow.call(this, s);
+ }
+ }
+}
+
+// create custom events
+i2b2.hive.MasterView.eventInitView = new YAHOO.util.CustomEvent('ViewModeInit');
+i2b2.hive.MasterView.eventChangeMode = new YAHOO.util.CustomEvent('ViewModeChange');
+i2b2.hive.MasterView.eventZoomWindows = new YAHOO.util.CustomEvent('ZoomListChange');
+// expose only the subscriber function in the i2b2 framework event collection
+i2b2.events.initView = {};
+i2b2.events.initView.subscribe = (function(a1,a2,a3,a4,a5,a6) {i2b2.hive.MasterView.eventInitView.subscribe.call(i2b2.hive.MasterView.eventInitView, a1,a2,a3,a4,a5,a6); });
+i2b2.events.changedViewMode = {};
+i2b2.events.changedViewMode.subscribe = (function(a1,a2,a3,a4,a5,a6) {i2b2.hive.MasterView.eventChangeMode.subscribe.call(i2b2.hive.MasterView.eventChangeMode, a1,a2,a3,a4,a5,a6); });
+i2b2.events.changedZoomWindows = {};
+i2b2.events.changedZoomWindows.subscribe = (function(a1,a2,a3,a4,a5,a6) {i2b2.hive.MasterView.eventChangeMode.subscribe.call(i2b2.hive.MasterView.eventZoomWindows, a1,a2,a3,a4,a5,a6); });
+
+
+console.timeEnd('execute time');
+console.groupEnd();
diff --git a/shrine-webclient/src/main/html/js-i2b2/hive/msg_sniffer.js b/shrine-webclient/src/main/html/js-i2b2/hive/msg_sniffer.js
old mode 100755
new mode 100644
index 30945fb1b..7d5ceb054
--- a/shrine-webclient/src/main/html/js-i2b2/hive/msg_sniffer.js
+++ b/shrine-webclient/src/main/html/js-i2b2/hive/msg_sniffer.js
@@ -1,167 +1,167 @@
-/**
- * @projectDescription Message Sniffer object - sniffs communication for objects which expose a _DebugMessaging event. Example: i2b2.CRC.ajax._DebugMessaging is a custom YUI event object.
- * @author Nick Benik, Griffin Weber MD PhD
- * @version 1.3
- * updated 9-15-08: RC4 launch [Nick Benik]
- */
-
-i2b2.hive.MsgSniffer = {
- yuiModalMsg: false,
- crtlDown: false,
- windowRef: null,
- sniffSources: [],
- signalOrigins: [],
- signalMessageDB: [],
- asyncStackFilter: false,
- initialize: function(doActivate) {},
- _showSingleMsgModal: function() {
- if (!i2b2.hive.MsgSniffer.yuiModalMsg) {
- // show non-modal dialog with help documentation
- var panel = new YAHOO.widget.Panel("commViewerSingleMsg-panel", {
- draggable: true,
- zindex:10000,
- width: "650px",
- height: "450px",
- autofillheight: "body",
- constraintoviewport: true,
- context: ["tl", "bl"],
- visible: false
- });
- $("commViewerSingleMsg-panel").show();
- panel.render(document.body);
- i2b2.hive.MsgSniffer.yuiModalMsg = panel;
-
- // resizer object and event handlers
- i2b2.hive.MsgSniffer.yuiSingleMsgResizer = new YAHOO.util.Resize("commViewerSingleMsg-panel", {
- handles: ['br'],
- autoRatio: false,
- minWidth: 350,
- minHeight: 250,
- status: false
- });
-
- i2b2.hive.MsgSniffer.yuiSingleMsgResizer.on('resize', function(args) {
- var panelHeight = args.height;
- this.cfg.setProperty("height", panelHeight + "px");
- }, i2b2.hive.MsgSniffer.yuiModalMsg, true);
-
- i2b2.hive.MsgSniffer.yuiSingleMsgResizer.on('startResize', function(args) {
- if (this.cfg.getProperty("constraintoviewport")) {
- var D = YAHOO.util.Dom;
- var clientRegion = D.getClientRegion();
- var elRegion = D.getRegion(this.element);
- resize.set("maxWidth", clientRegion.right - elRegion.left - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
- resize.set("maxHeight", clientRegion.bottom - elRegion.top - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
- } else {
- resize.set("maxWidth", null);
- resize.set("maxHeight", null);
- }
- }, i2b2.hive.MsgSniffer.yuiModalMsg, true);
- }
- },
- showSingleMsgRequest: function(strXML) {
- this._showSingleMsgModal();
- try {
- var t = $("commViewerSingleMsg-panel").select(".hd")[0];
- t.innerHTML = "Last Request Message";
- var t = $("commViewerSingleMsg-body").select(".xmlMsg")[0];
-// t.style.background = "#AFFFAF";
- t.innerHTML = '<PRE class="msgXML msgSent">'+strXML+'</PRE>';
- } catch (e) { console.error("Could not display information!"); }
- i2b2.hive.MsgSniffer.yuiModalMsg.show();
-
- },
- showSingleMsgResponse: function(strXML) {
- this._showSingleMsgModal();
- try {
- var t = $("commViewerSingleMsg-panel").select(".hd")[0];
- t.innerHTML = "Last Response Message";
- var t = $("commViewerSingleMsg-body").select(".xmlMsg")[0];
-// t.style.background = "#FFAFAF";
- t.innerHTML = '<PRE class="msgXML msgReceive">'+strXML+'</PRE>';
- } catch (e) { console.error("Could not display information!"); }
- i2b2.hive.MsgSniffer.yuiModalMsg.show();
- },
- show: function() {
- this.asyncStackFilter = false;
- this._spawnWin.call(this);
- },
- _spawnWin: function() {
- try {
- // spawn new
- i2b2.hive.MsgSniffer.windowRef = window.open('assets/msg-viewer.html', 'i2b2_msgsniffer', 'toolbar=no,resizable=yes,scrollbars=yes,height=480,width=740', false);
- i2b2.hive.MsgSniffer.windowRef.focus();
- } catch(e) {
- // bring to front, resize, make visible, etc
- i2b2.hive.MsgSniffer.windowRef.focus();
- }
- if (!i2b2.hive.MsgSniffer.windowRef) {
- alert('Could not display the Communications Channel Viewer.\n Please disable any popup blockers and try again.');
- return;
- }
- },
- showStack: function(viewtitle, origins, cells, actions) {
- // put info into asyncStackFilter that msgViewer code will check upon it's initialization
- this.asyncStackFilter = {
- title: viewtitle+" Msg Stack",
- origins: origins,
- cells: cells,
- actions: actions
- };
- i2b2.hive.MsgSniffer._spawnWin();
- },
- // Register event for message sources
- RegisterMessageSource: function(regMsg) {
- // expected data format: {
- // channelName: "CELLNAME",
- // channelActions: ["the names", "of the", "Cell's server calls"],
- // channelSniffEvent: {yui custom event}
- // }
- if (!regMsg.channelName || !regMsg.channelActions || !regMsg.channelSniffEvent || !regMsg.channelSniffEvent.subscribe) {
- console.error('MsgSniffer: bad registration info / '+Object.inspect(regMsg));
- return false;
- }
- var t = regMsg.channelName;
- regMsg.channelCode = t;
- if (i2b2[t]) {
- if (i2b2[t].cfg.config.name) {
- regMsg.channelName = i2b2[t].cfg.config.name;
-
- }
- }
- var was_found = false;
- for (var i = 0; i < this.sniffSources.length; i++) {
- if (this.sniffSources[i].channelSniffEvent === regMsg.channelSniffEvent) {
- was_found = true;
- var t = this.sniffSources[i].channelActions.concat(regMsg.channelActions);
- t = t.uniq();
- this.sniffSources[i].channelActions = t;
- }
- }
- if (!was_found) {
- this.sniffSources.push(regMsg);
- regMsg.channelSniffEvent.subscribe(i2b2.hive.MsgSniffer.MsgHandler);
- }
- return true;
- },
- MsgHandler: function(msgType, sniffMsg) {
- // Function where the messages enter the sniffer subsystem
- // (SCOPE IS NOT IN NAMESPACE WHEN FUNCTION IS CALLED)
- var thisobj = i2b2.hive.MsgSniffer;
- if (!i2b2.PM.model.login_debugging) { return true; }
- // save the data if the framework is in debug mode
- sniffMsg = sniffMsg[0];
- sniffMsg.SignalType = msgType;
- var d = new Date();
- sniffMsg.SignalTimestamp = d;
- thisobj.signalMessageDB.push(sniffMsg);
-
- if (thisobj.signalOrigins.indexOf(sniffMsg.SignalOrigin) == -1) {
- thisobj.signalOrigins.push(sniffMsg.SignalOrigin);
- }
- // refresh the message viewer window if it is open
- if (!i2b2.hive.MsgSniffer.windowRef || !i2b2.hive.MsgSniffer.windowRef.focus) { return true; }
- i2b2.hive.MsgSniffer.windowRef.SnifferDisplay.renderFilteredList();
- return true;
- }
-};
+/**
+ * @projectDescription Message Sniffer object - sniffs communication for objects which expose a _DebugMessaging event. Example: i2b2.CRC.ajax._DebugMessaging is a custom YUI event object.
+ * @author Nick Benik, Griffin Weber MD PhD
+ * @version 1.3
+ * updated 9-15-08: RC4 launch [Nick Benik]
+ */
+
+i2b2.hive.MsgSniffer = {
+ yuiModalMsg: false,
+ crtlDown: false,
+ windowRef: null,
+ sniffSources: [],
+ signalOrigins: [],
+ signalMessageDB: [],
+ asyncStackFilter: false,
+ initialize: function(doActivate) {},
+ _showSingleMsgModal: function() {
+ if (!i2b2.hive.MsgSniffer.yuiModalMsg) {
+ // show non-modal dialog with help documentation
+ var panel = new YAHOO.widget.Panel("commViewerSingleMsg-panel", {
+ draggable: true,
+ zindex:10000,
+ width: "650px",
+ height: "450px",
+ autofillheight: "body",
+ constraintoviewport: true,
+ context: ["tl", "bl"],
+ visible: false
+ });
+ $("commViewerSingleMsg-panel").show();
+ panel.render(document.body);
+ i2b2.hive.MsgSniffer.yuiModalMsg = panel;
+
+ // resizer object and event handlers
+ i2b2.hive.MsgSniffer.yuiSingleMsgResizer = new YAHOO.util.Resize("commViewerSingleMsg-panel", {
+ handles: ['br'],
+ autoRatio: false,
+ minWidth: 350,
+ minHeight: 250,
+ status: false
+ });
+
+ i2b2.hive.MsgSniffer.yuiSingleMsgResizer.on('resize', function(args) {
+ var panelHeight = args.height;
+ this.cfg.setProperty("height", panelHeight + "px");
+ }, i2b2.hive.MsgSniffer.yuiModalMsg, true);
+
+ i2b2.hive.MsgSniffer.yuiSingleMsgResizer.on('startResize', function(args) {
+ if (this.cfg.getProperty("constraintoviewport")) {
+ var D = YAHOO.util.Dom;
+ var clientRegion = D.getClientRegion();
+ var elRegion = D.getRegion(this.element);
+ resize.set("maxWidth", clientRegion.right - elRegion.left - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
+ resize.set("maxHeight", clientRegion.bottom - elRegion.top - YAHOO.widget.Overlay.VIEWPORT_OFFSET);
+ } else {
+ resize.set("maxWidth", null);
+ resize.set("maxHeight", null);
+ }
+ }, i2b2.hive.MsgSniffer.yuiModalMsg, true);
+ }
+ },
+ showSingleMsgRequest: function(strXML) {
+ this._showSingleMsgModal();
+ try {
+ var t = $("commViewerSingleMsg-panel").select(".hd")[0];
+ t.innerHTML = "Last Request Message";
+ var t = $("commViewerSingleMsg-body").select(".xmlMsg")[0];
+// t.style.background = "#AFFFAF";
+ t.innerHTML = '<PRE class="msgXML msgSent">'+strXML+'</PRE>';
+ } catch (e) { console.error("Could not display information!"); }
+ i2b2.hive.MsgSniffer.yuiModalMsg.show();
+
+ },
+ showSingleMsgResponse: function(strXML) {
+ this._showSingleMsgModal();
+ try {
+ var t = $("commViewerSingleMsg-panel").select(".hd")[0];
+ t.innerHTML = "Last Response Message";
+ var t = $("commViewerSingleMsg-body").select(".xmlMsg")[0];
+// t.style.background = "#FFAFAF";
+ t.innerHTML = '<PRE class="msgXML msgReceive">'+strXML+'</PRE>';
+ } catch (e) { console.error("Could not display information!"); }
+ i2b2.hive.MsgSniffer.yuiModalMsg.show();
+ },
+ show: function() {
+ this.asyncStackFilter = false;
+ this._spawnWin.call(this);
+ },
+ _spawnWin: function() {
+ try {
+ // spawn new
+ i2b2.hive.MsgSniffer.windowRef = window.open('assets/msg-viewer.html', 'i2b2_msgsniffer', 'toolbar=no,resizable=yes,scrollbars=yes,height=480,width=740', false);
+ i2b2.hive.MsgSniffer.windowRef.focus();
+ } catch(e) {
+ // bring to front, resize, make visible, etc
+ i2b2.hive.MsgSniffer.windowRef.focus();
+ }
+ if (!i2b2.hive.MsgSniffer.windowRef) {
+ alert('Could not display the Communications Channel Viewer.\n Please disable any popup blockers and try again.');
+ return;
+ }
+ },
+ showStack: function(viewtitle, origins, cells, actions) {
+ // put info into asyncStackFilter that msgViewer code will check upon it's initialization
+ this.asyncStackFilter = {
+ title: viewtitle+" Msg Stack",
+ origins: origins,
+ cells: cells,
+ actions: actions
+ };
+ i2b2.hive.MsgSniffer._spawnWin();
+ },
+ // Register event for message sources
+ RegisterMessageSource: function(regMsg) {
+ // expected data format: {
+ // channelName: "CELLNAME",
+ // channelActions: ["the names", "of the", "Cell's server calls"],
+ // channelSniffEvent: {yui custom event}
+ // }
+ if (!regMsg.channelName || !regMsg.channelActions || !regMsg.channelSniffEvent || !regMsg.channelSniffEvent.subscribe) {
+ console.error('MsgSniffer: bad registration info / '+Object.inspect(regMsg));
+ return false;
+ }
+ var t = regMsg.channelName;
+ regMsg.channelCode = t;
+ if (i2b2[t]) {
+ if (i2b2[t].cfg.config.name) {
+ regMsg.channelName = i2b2[t].cfg.config.name;
+
+ }
+ }
+ var was_found = false;
+ for (var i = 0; i < this.sniffSources.length; i++) {
+ if (this.sniffSources[i].channelSniffEvent === regMsg.channelSniffEvent) {
+ was_found = true;
+ var t = this.sniffSources[i].channelActions.concat(regMsg.channelActions);
+ t = t.uniq();
+ this.sniffSources[i].channelActions = t;
+ }
+ }
+ if (!was_found) {
+ this.sniffSources.push(regMsg);
+ regMsg.channelSniffEvent.subscribe(i2b2.hive.MsgSniffer.MsgHandler);
+ }
+ return true;
+ },
+ MsgHandler: function(msgType, sniffMsg) {
+ // Function where the messages enter the sniffer subsystem
+ // (SCOPE IS NOT IN NAMESPACE WHEN FUNCTION IS CALLED)
+ var thisobj = i2b2.hive.MsgSniffer;
+ if (!i2b2.PM.model.login_debugging) { return true; }
+ // save the data if the framework is in debug mode
+ sniffMsg = sniffMsg[0];
+ sniffMsg.SignalType = msgType;
+ var d = new Date();
+ sniffMsg.SignalTimestamp = d;
+ thisobj.signalMessageDB.push(sniffMsg);
+
+ if (thisobj.signalOrigins.indexOf(sniffMsg.SignalOrigin) == -1) {
+ thisobj.signalOrigins.push(sniffMsg.SignalOrigin);
+ }
+ // refresh the message viewer window if it is open
+ if (!i2b2.hive.MsgSniffer.windowRef || !i2b2.hive.MsgSniffer.windowRef.focus) { return true; }
+ i2b2.hive.MsgSniffer.windowRef.SnifferDisplay.renderFilteredList();
+ return true;
+ }
+};
diff --git a/shrine-webclient/src/main/html/js-i2b2/i2b2_loader.js b/shrine-webclient/src/main/html/js-i2b2/i2b2_loader.js
old mode 100755
new mode 100644
diff --git a/shrine-webclient/src/main/html/js-i2b2/ui.styles/ui.styles.css b/shrine-webclient/src/main/html/js-i2b2/ui.styles/ui.styles.css
old mode 100755
new mode 100644
index e73d48d3c..0314cbc10
--- a/shrine-webclient/src/main/html/js-i2b2/ui.styles/ui.styles.css
+++ b/shrine-webclient/src/main/html/js-i2b2/ui.styles/ui.styles.css
@@ -1,20 +1,20 @@
-
-/*
- * Style for a splitter that's draggable over a left-hand-side UI and a right-hand-side UI.
- * Height of the splitter spans the entire width of its containing element.
- * Use inline style elements to override the defaults
- */
-.vertical_splitter
-{
- position: absolute;
- top: 0px;
- left: 200px;
- width: 6px;
- bottom: 0%;
- background-color: #BBCCEE;
- background-image: url('../../assets/images/splitter.handle.image.gif');
- background-repeat: no-repeat;
- background-position:center;
- cursor: ew-resize;
- z-index:99;
-}
+
+/*
+ * Style for a splitter that's draggable over a left-hand-side UI and a right-hand-side UI.
+ * Height of the splitter spans the entire width of its containing element.
+ * Use inline style elements to override the defaults
+ */
+.vertical_splitter
+{
+ position: absolute;
+ top: 0px;
+ left: 200px;
+ width: 6px;
+ bottom: 0%;
+ background-color: #BBCCEE;
+ background-image: url('../../assets/images/splitter.handle.image.gif');
+ background-repeat: no-repeat;
+ background-position:center;
+ cursor: ew-resize;
+ z-index:99;
+}

Event Timeline