diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network.zip b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network.zip index 8eea2abe18..14ea854f52 100644 Binary files a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network.zip and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network.zip differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/README.txt b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/README.txt new file mode 100644 index 0000000000..8e2240bbfd --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/README.txt @@ -0,0 +1,11 @@ +Template provided by InteractiveVis project +http://blogs.oii.ox.ac.uk/vis/ +https://github.com/oxfordinternetinstitute/InteractiveVis/ + +Important. The files must be uploaded to a webserver (or run one locally) in order to be viewed. JavaScript security prevents running the pages locally without a webserver. + +The InteractiveVis project of the Oxford Internet Institute with funding by JISC aims to allow easy creation of interactive visualisations for geospatial and network data using native web technologies (HTML5, CSS3, and SVG) and allow these visualisations to be self-contained so that they may run entirely offline in ebooks and other media. The project will survey existing solutions and build the necessary components to fill in missing features and smooth over incompatibilities in between existing libraries. The project will further provide online hosted wizards to allow for the easy creation of these interactive visualizations. + +More information about the project is available on the project blog: +http//blogs.oii.ox.ac.uk/vis/ + diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/css/style.css b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/css/style.css new file mode 100644 index 0000000000..3415b535d6 --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/css/style.css @@ -0,0 +1,577 @@ +* { +padding: 0px; +margin: 0px; +} + +.cf:before, .cf:after { + content: ""; + display: table; +} + +.cf:after { + clear: both; +} + +.cf { + zoom: 1; +} + +html,body { + width: 100%; + height: 100%; + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: sans-serif; + line-height:1.25em; +} + +.sigma-parent { + position: relative; + height: 100%; +} + +.sigma-expand { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; + background-color: #eee; + background-position: center center; + background-repeat: no-repeat; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +canvas#sigma_bg_1 { + display: none; +} + +#attributepane { + display: block; + display: none; + position:absolute; + height:auto; + bottom:0; + top:0; + right:0; + width: 240px; + background-color: #fff; + margin: 0; + word-wrap: break-word; + background-color:rgba(255,255,255,0.8); + border-left: 1px solid #ccc; + padding: 0px 18px 0px 18px; + z-index: 1; +} + + +#attributepane .text { + height:100%; +} + +#attributepane .headertext { + color: #000; + margin-bottom: 5px; + height: 14px; + border-bottom: 1px solid #999; + padding: 0px 0 10px 0; + font-size:16px; + font-weight:bold; +} + + +#attributepane .returntext em { + background-image: url('../images/sprite.png'); + background-repeat: no-repeat; + display: block; + width: 20px; + height: 20px; + background-position: -91px -13px; + float: left; +} + +#attributepane .returntext span { + padding-left: 5px; + display: block; +} + +#attributepane .close { + padding-left: 14px; + margin-top: 10px; +} + +#attributepane .close .c { + border-top: 2px solid #999; + padding: 10px 0 14px 0; +} + +#attributepane .close em { +background-image: url('../images/sprite.png'); +background-repeat: no-repeat; +background-position: -11px -13px; +display: block; +width: 24px; +height: 16px; +float: left; +} + +#attributepane .close span { +display: block; +width: 151px; +float: left; +} + +#attributepane .nodeattributes { + display:block; + height:85%; + overflow-y: scroll; + overflow-x: hidden; + border-bottom:1px solid #999; +} + +#attributepane .name { +font-size: 14px; +cursor: default; +padding-bottom: 10px; +padding-top: 18px; +font-weight:bold; +} + +#attributepane .data { + +} + +#attributepane .data .plus { +background-repeat: no-repeat; +background-image: url('../images/sprite.png'); +background-position: -171px -122px; +width: 22px; +height: 20px; +float: left; +display: block; +} + +#attributepane .link { +padding: 0 0 0 4px; +} + +#attributepane .link li { +padding-top: 2px; +cursor:pointer; +} + +#attributepane .p { +padding-top: 10px; +font-weight: bold; +font-size:14px; +} + +.left-close { +background-image: url('../images/fancybox_sprite.png'); +margin-left:-37px; +z-index:99999; +cursor: pointer; +padding-left:31px; +line-height:36px; +background-repeat: no-repeat; +margin-bottom:25px; +font-weight: bold; +font-size:14px; + +} + +#developercontainer { + margin-left:25px; + margin-bottom:25px; + position:fixed; + bottom:0; +} + +#jisc { +width: 71px; +height: 56px; +background-image: url('../images/jisc-logo-small.png'); +background-repeat: no-repeat; +display:inline-block; +} + +#jisc span { + display:none; +} + +#oii { +width: 227px; +height: 56px; +background-image: url('../images/oii_text.png'); +background-repeat: no-repeat; +display:inline-block; +margin-right:10px; + +} + +#oii span { + display:none; +} + +#maintitle { +width: 100%; +height: 72px; +background-repeat: no-repeat; +margin-bottom:20px; +} + +#maintitle h1 { +display: none; +} + +#mainpanel { +margin-top: 50px; +margin-left: 25px; +background:#fff; +background-color:rgba(255,255,255,0.8); +border:1px solid #ccc; +z-index:20; +position:fixed; +top:0; +} + +#mainpanel .b1 { +padding: 0px 0 0 0; +} + +#mainpanel .col { +width: 240px; +padding: 18px 18px 18px 18px; +margin: 0; + +} + +#title { +font-weight: bold; +} + +#titletext { +padding: 6px 0 10px 0; +} + +#info { + padding-bottom:15px; +} + + +#search { + border-top: 1px solid #999; + padding: 20px 0 0px 2px; +} + +#search input[name=search] { +border: 1px solid #999; +background-color: #fff; +padding: 5px 7px 4px 7px; +width: 205px; +color: #000; +} + +#search input.empty { +color: #000; +} + +#search .state { +width: 14px; +height: 14px; +background-image: url('../images/sprite.png'); +float: right; +margin-top: 6px; +cursor: pointer; +background-position: -131px -13px; +} + +#search .state.searching { +background-position: -11px -13px; +} + +#search .results { + display: none; +/* border: 1px solid #999;*/ + margin: 6px; + /*height: 150px;*/ + overflow-y: scroll; + overflow-x: hidden; +} + +#search .results b { +padding-left: 2px; +} + +#search .results a { +padding: 1px 2px; +display: block; +cursor: pointer; +text-decoration: none; +color: #000; +} + +#search .results a:hover { +background-color: #999; +color: #fff; +} + +#attributeselect { +margin: 20px 0 13px 0 ; +-webkit-touch-callout: none; +-webkit-user-select: none; +-khtml-user-select: none; +-moz-user-select: none; +-ms-user-select: none; +user-select: none; +} + +#attributeselect .select { + border: 1px solid #999; + padding: 5px 7px 4px 7px; + color: #fff; + cursor: pointer; + background-color: #999; + background-image: url('../images/sprite.png'); + background-repeat: no-repeat; + background-position: 200px -144px; +} + +#attributeselect .close { +background-position: 200px -8px; +} + +#attributeselect .list { + display: none; + border: 1px solid + #999; + padding: 6px; + height: 150px; + width: 226px; + overflow-y: scroll; + overflow-x: hidden; + background-color: #999; + /*position: relative; + left: 240px; + bottom: 164px;*/ + position:absolute; + margin-left: 240px; + margin-top:-164px; + color: white; +} + +#attributeselect .list a { +display:block; +padding: 2px; +text-decoration: none; +color: #fff; +} + +#attributeselect .list a:hover { +background-color: #fff; +color: #000; +} + +.link h2 { +font-size: 1em; +padding-top: 1em; +} + +#mainpanel dl { + padding-bottom:10px; +} + +#mainpanel h2 { + font-size:14px; +} + +#mainpanel dt { +width: 20px; +height: 20px; +float: left; +background-repeat: no-repeat; +background-image: url('../images/sprite.png'); +} + +#legend dl { +} + +#mainpanel h2 { + padding-bottom:10px; +} + +#legend dd { +margin-bottom: 8px; +color: #000; +} + +#mainpanel .infos dd { +margin-bottom: 12px; +} + +#mainpanel .node { +background-position: -11px -119px; +} + +#mainpanel .edge { +background-position: -51px -122px; +} + +#mainpanel .colours { + +background-image:url('../images/rainbow.png'); + +} +#legend .note { +margin-bottom: 8px; + +} + +#mainpanel .regions { +background-position: -171px -13px; +} + +#mainpanel .download { +background-position: -51px -13px; +} + +#mainpanel .moreinformation { +background: url('../images/info.png'); +background-repeat: no-repeat; +margin-left: 5px; +} + +#copyright { + margin:0 auto; + position: fixed; + right: 40px; + bottom: 25px; + z-index:0; +} + +#copyright a { +color: #000; +} + +#copyright .explanation { +display: none; +} + +#zoom { + z-index:999; + position: fixed; + left: 45%; + bottom: 25px; + margin:0 auto; + padding: 0; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + text-align:left; +} + +#zoom .z { + background:#fff; + background-color:rgba(255,255,255,0.7); + width: 60px; + height: 60px; + cursor: pointer; + border:1px solid #ccc; + float:left; + margin-right:4px; + background-repeat:no-repeat; +} + +#zoom .z[rel=center] { + background-image: url('../images/zoom_reset.png'); + background-position:center; +} + +#zoom .z[rel=in] { + background-image: url('../images/zoom_in.png'); + background-position:center; +} + +#zoom .z[rel=out] { + background-image: url('../images/zoom_out.png'); + background-position:center; +} + +.line { + font-size: 12px; + color: #000; + text-decoration: none; + font-weight: bold; + cursor: pointer; + cursor: hand; +} + +#information { +display: none; +background: #fff; +padding: 1px 10px 10px 10px; +} + +#information h3 { +margin: 14px 0 4px 0; +} + +#information p { +margin: 0 0 4px 0; +} + +#information .button { +width: 14px; +height: 14px; +background-image: url('../images/sprite.png'); +border: 1px solid #999; +display: inline-block; +*display: inline; +*zoom: 1; +} + +#information .button span { +display: none; +} + +#information .button.plus { +background-position: -91px -122px; +} + +#information .button.moins { +background-position: -131px -122px; +} + +#minify { +background-color: #fff; +padding: 4px 4px 4px 25px; +cursor: pointer; +background-image: url('../images/sprite.png'); +background-repeat: no-repeat; +background-position: -167px -118px; +position: absolute; +top: 65px; +left: 15px; +display: none; +} + +#minifier { +position: absolute; +width: 20px; +height: 16px; +background-image: url('../images/sprite.png'); +background-repeat: no-repeat; +background-position: -45px -147px; +cursor: pointer; +display: none; +} + diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/css/tablet.css b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/css/tablet.css new file mode 100644 index 0000000000..f89216db68 --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/css/tablet.css @@ -0,0 +1,3 @@ +#developercontainer { + display:none; +} \ No newline at end of file diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/htaccess_example b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/htaccess_example new file mode 100644 index 0000000000..e2974bcfa2 --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/htaccess_example @@ -0,0 +1,2 @@ +AddType application/json json +AddType text/xml gexf diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/CC.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/CC.png new file mode 100644 index 0000000000..affea55d1a Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/CC.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/blank.gif b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/blank.gif new file mode 100755 index 0000000000..35d42e808f Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/blank.gif differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/fancybox_loading.gif b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/fancybox_loading.gif new file mode 100755 index 0000000000..01586176d7 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/fancybox_loading.gif differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/fancybox_sprite.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/fancybox_sprite.png new file mode 100755 index 0000000000..a1aae1a24f Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/fancybox_sprite.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/info.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/info.png new file mode 100644 index 0000000000..707316ecb9 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/info.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/jisc-logo-small.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/jisc-logo-small.png new file mode 100644 index 0000000000..4dc3395757 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/jisc-logo-small.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii.png new file mode 100644 index 0000000000..ee716ab5b2 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii_brand.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii_brand.png new file mode 100644 index 0000000000..940d8bc3f2 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii_brand.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii_text.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii_text.png new file mode 100644 index 0000000000..3c071b263c Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/oii_text.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/rainbow.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/rainbow.png new file mode 100644 index 0000000000..a344bfcd98 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/rainbow.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/sprite.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/sprite.png new file mode 100644 index 0000000000..0c6353ef0b Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/sprite.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_in.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_in.png new file mode 100755 index 0000000000..21f0d25ee7 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_in.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_out.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_out.png new file mode 100755 index 0000000000..d4231f82ed Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_out.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_reset.png b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_reset.png new file mode 100755 index 0000000000..26244c2559 Binary files /dev/null and b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/images/zoom_reset.png differ diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/index.html b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/index.html new file mode 100644 index 0000000000..f201f61e6e --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/index.html @@ -0,0 +1,112 @@ + + + + +OII Network Visualisation Example + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ +
+
+

Legend:

+
+
+
+
+
+
+
+
+
+
+
+
+ +

Group Selector:

+
Select Group
+
+
+
+
+
+
+
+
+
+
+
+ + +
+
+
Return to the full network
+
+ Information Pane +
+
+
+
+
Connections:
+ +
+
+
+
+
OII
+
JISC
+
+ + + diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/excanvas.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/excanvas.js new file mode 100644 index 0000000000..9ad56dfed1 --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/excanvas.js @@ -0,0 +1,35 @@ +document.createElement("canvas").getContext||function(){function S(){return this.context_||(this.context_=new z(this))}function T(a,b,c){var g=J.call(arguments,2);return function(){return a.apply(b,g.concat(J.call(arguments)))}}function K(a){return(""+a).replace(/&/g,"&").replace(/"/g,""")}function L(a){a.namespaces.g_vml_||a.namespaces.add("g_vml_","urn:schemas-microsoft-com:vml","#default#VML");a.namespaces.g_o_||a.namespaces.add("g_o_","urn:schemas-microsoft-com:office:office","#default#VML"); +a.styleSheets.ex_canvas_||(a=a.createStyleSheet(),a.owningElement.id="ex_canvas_",a.cssText="canvas{display:inline-block;overflow:hidden;text-align:left;width:300px;height:150px}")}function U(a){var b=a.srcElement;switch(a.propertyName){case "width":b.getContext().clearRect();b.style.width=b.attributes.width.nodeValue+"px";b.firstChild.style.width=b.clientWidth+"px";break;case "height":b.getContext().clearRect(),b.style.height=b.attributes.height.nodeValue+"px",b.firstChild.style.height=b.clientHeight+ +"px"}}function V(a){a=a.srcElement;a.firstChild&&(a.firstChild.style.width=a.clientWidth+"px",a.firstChild.style.height=a.clientHeight+"px")}function A(){return[[1,0,0],[0,1,0],[0,0,1]]}function q(a,b){for(var c=A(),g=0;3>g;g++)for(var e=0;3>e;e++){for(var f=0,d=0;3>d;d++)f+=a[g][d]*b[d][e];c[g][e]=f}return c}function M(a,b){b.fillStyle=a.fillStyle;b.lineCap=a.lineCap;b.lineJoin=a.lineJoin;b.lineWidth=a.lineWidth;b.miterLimit=a.miterLimit;b.shadowBlur=a.shadowBlur;b.shadowColor=a.shadowColor;b.shadowOffsetX= +a.shadowOffsetX;b.shadowOffsetY=a.shadowOffsetY;b.strokeStyle=a.strokeStyle;b.globalAlpha=a.globalAlpha;b.font=a.font;b.textAlign=a.textAlign;b.textBaseline=a.textBaseline;b.arcScaleX_=a.arcScaleX_;b.arcScaleY_=a.arcScaleY_;b.lineScale_=a.lineScale_}function N(a){var b=a.indexOf("(",3),c=a.indexOf(")",b+1),b=a.substring(b+1,c).split(",");if(4!=b.length||"a"!=a.charAt(3))b[3]=1;return b}function B(a,b,c){return Math.min(c,Math.max(b,a))}function C(a,b,c){0>c&&c++;16*c?a+6*(b-a)*c: +1>2*c?b:2>3*c?a+6*(b-a)*(2/3-c):a}function D(a){if(a in E)return E[a];var b,c=1,a=""+a;if("#"==a.charAt(0))b=a;else if(/^rgb/.test(a)){c=N(a);b="#";for(var g,e=0;3>e;e++)g=-1!=c[e].indexOf("%")?Math.floor(255*(parseFloat(c[e])/100)):+c[e],b+=s[B(g,0,255)];c=+c[3]}else if(/^hsl/.test(a)){e=c=N(a);b=parseFloat(e[0])/360%360;0>b&&b++;g=B(parseFloat(e[1])/100,0,1);e=B(parseFloat(e[2])/100,0,1);if(0==g)g=e=b=e;else{var f=0.5>e?e*(1+g):e+g-e*g,d=2*e-f;g=C(d,f,b+1/3);e=C(d,f,b);b=C(d,f,b-1/3)}b="#"+s[Math.floor(255* +g)]+s[Math.floor(255*e)]+s[Math.floor(255*b)];c=c[3]}else b=W[a]||a;return E[a]={color:b,alpha:c}}function z(a){this.m_=A();this.mStack_=[];this.aStack_=[];this.currentPath_=[];this.fillStyle=this.strokeStyle="#000";this.lineWidth=1;this.lineJoin="miter";this.lineCap="butt";this.miterLimit=1*n;this.globalAlpha=1;this.font="10px sans-serif";this.textAlign="left";this.textBaseline="alphabetic";this.canvas=a;var b="width:"+a.clientWidth+"px;height:"+a.clientHeight+"px;overflow:hidden;position:absolute", +c=a.ownerDocument.createElement("div");c.style.cssText=b;a.appendChild(c);b=c.cloneNode(!1);b.style.backgroundColor="red";b.style.filter="alpha(opacity=0)";a.appendChild(b);this.element_=c;this.lineScale_=this.arcScaleY_=this.arcScaleX_=1}function O(a,b,c,g){a.currentPath_.push({type:"bezierCurveTo",cp1x:b.x,cp1y:b.y,cp2x:c.x,cp2y:c.y,x:g.x,y:g.y});a.currentX_=g.x;a.currentY_=g.y}function P(a,b){var c=D(a.strokeStyle),g=c.color,c=c.alpha*a.globalAlpha,e=a.lineScale_*a.lineWidth;1>e&&(c*=e);b.push("')}function Q(a,b,c,g){var e=a.fillStyle,f=a.arcScaleX_,d=a.arcScaleY_,h=g.x-c.x,l=g.y-c.y;if(e instanceof t){var i=0,j=g=0,r=0,k=1;if("gradient"==e.type_){var i=e.x1_/f,c=e.y1_/d,m=p(a,e.x0_/f,e.y0_/d),i=p(a,i,c),i=180*Math.atan2(i.x-m.x,i.y-m.y)/Math.PI;0>i&&(i+=360);1.0E-6>i&&(i=0)}else m=p(a,e.x0_,e.y0_),g=(m.x-c.x)/h,j=(m.y-c.y)/l,h/=f* +n,l/=d*n,k=u.max(h,l),r=2*e.r0_/k,k=2*e.r1_/k-r;f=e.colors_;f.sort(function(a,b){return a.offset-b.offset});for(var d=f.length,m=f[0].color,c=f[d-1].color,h=f[0].alpha*a.globalAlpha,a=f[d-1].alpha*a.globalAlpha,l=[],o=0;o')}else e instanceof +F?h&&l&&b.push("'):(e=D(a.fillStyle),b.push(''))}function p(a,b,c){a=a.m_;return{x:n*(b*a[0][0]+c*a[1][0]+a[2][0])-o,y:n*(b*a[0][1]+c*a[1][1]+a[2][1])-o}}function w(a,b,c){isFinite(b[0][0])&&isFinite(b[0][1])&&isFinite(b[1][0])&&isFinite(b[1][1])&&isFinite(b[2][0])&&isFinite(b[2][1])&&(a.m_=b,c&&(a.lineScale_=Y(Z(b[0][0]*b[1][1]-b[0][1]* +b[1][0]))))}function t(a){this.type_=a;this.r1_=this.y1_=this.x1_=this.r0_=this.y0_=this.x0_=0;this.colors_=[]}function F(a,b){if(!a||1!=a.nodeType||"IMG"!=a.tagName)throw new x("TYPE_MISMATCH_ERR");if("complete"!=a.readyState)throw new x("INVALID_STATE_ERR");switch(b){case "repeat":case null:case "":this.repetition_="repeat";break;case "repeat-x":case "repeat-y":case "no-repeat":this.repetition_=b;break;default:throw new x("SYNTAX_ERR");}this.src_=a.src;this.width_=a.width;this.height_=a.height} +function x(a){this.code=this[a];this.message=a+": DOM Exception "+this.code}var u=Math,h=u.round,G=u.sin,H=u.cos,Z=u.abs,Y=u.sqrt,n=10,o=n/2;navigator.userAgent.match(/MSIE ([\d.]+)?/);var J=Array.prototype.slice;L(document);var R={init:function(a){a=a||document;a.createElement("canvas");a.attachEvent("onreadystatechange",T(this.init_,this,a))},init_:function(a){for(var a=a.getElementsByTagName("canvas"),b=0;bd;d++)for(var y=0;16>y;y++)s[16*d+y]=d.toString(16)+y.toString(16);var W={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC", +bisque:"#FFE4C4",black:"#000000",blanchedalmond:"#FFEBCD",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#00FFFF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgreen:"#006400",darkgrey:"#A9A9A9",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000", +darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",grey:"#808080",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082", +ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgreen:"#90EE90",lightgrey:"#D3D3D3",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#FF00FF",mediumaquamarine:"#66CDAA", +mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",oldlace:"#FDF5E6",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5", +peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",whitesmoke:"#F5F5F5",yellowgreen:"#9ACD32"}, +E={},I={},X={butt:"flat",round:"round"},d=z.prototype;d.clearRect=function(){this.textMeasureEl_&&(this.textMeasureEl_.removeNode(!0),this.textMeasureEl_=null);this.element_.innerHTML=""};d.beginPath=function(){this.currentPath_=[]};d.moveTo=function(a,b){var c=p(this,a,b);this.currentPath_.push({type:"moveTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.lineTo=function(a,b){var c=p(this,a,b);this.currentPath_.push({type:"lineTo",x:c.x,y:c.y});this.currentX_=c.x;this.currentY_=c.y};d.bezierCurveTo= +function(a,b,c,g,e,f){e=p(this,e,f);a=p(this,a,b);c=p(this,c,g);O(this,a,c,e)};d.quadraticCurveTo=function(a,b,c,g){a=p(this,a,b);c=p(this,c,g);g={x:this.currentX_+2/3*(a.x-this.currentX_),y:this.currentY_+2/3*(a.y-this.currentY_)};O(this,g,{x:g.x+(c.x-this.currentX_)/3,y:g.y+(c.y-this.currentY_)/3},c)};d.arc=function(a,b,c,g,e,f){var c=c*n,d=f?"at":"wa",h=a+H(g)*c-o,l=b+G(g)*c-o,g=a+H(e)*c-o,e=b+G(e)*c-o;h==g&&!f&&(h+=0.125);a=p(this,a,b);h=p(this,h,l);g=p(this,g,e);this.currentPath_.push({type:d, +x:a.x,y:a.y,radius:c,xStart:h.x,yStart:h.y,xEnd:g.x,yEnd:g.y})};d.rect=function(a,b,c,g){this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath()};d.strokeRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+c,b+g);this.lineTo(a,b+g);this.closePath();this.stroke();this.currentPath_=e};d.fillRect=function(a,b,c,g){var e=this.currentPath_;this.beginPath();this.moveTo(a,b);this.lineTo(a+c,b);this.lineTo(a+ +c,b+g);this.lineTo(a,b+g);this.closePath();this.fill();this.currentPath_=e};d.createLinearGradient=function(a,b,c,g){var e=new t("gradient");e.x0_=a;e.y0_=b;e.x1_=c;e.y1_=g;return e};d.createRadialGradient=function(a,b,c,g,e,f){var d=new t("gradientradial");d.x0_=a;d.y0_=b;d.r0_=c;d.x1_=g;d.y1_=e;d.r1_=f;return d};d.drawImage=function(a,b){var c,g,e,d,o,v,l,i;e=a.runtimeStyle.width;d=a.runtimeStyle.height;a.runtimeStyle.width="auto";a.runtimeStyle.height="auto";var j=a.width,r=a.height;a.runtimeStyle.width= +e;a.runtimeStyle.height=d;if(3==arguments.length)c=arguments[1],g=arguments[2],o=v=0,l=e=j,i=d=r;else if(5==arguments.length)c=arguments[1],g=arguments[2],e=arguments[3],d=arguments[4],o=v=0,l=j,i=r;else if(9==arguments.length)o=arguments[1],v=arguments[2],l=arguments[3],i=arguments[4],c=arguments[5],g=arguments[6],e=arguments[7],d=arguments[8];else throw Error("Invalid number of arguments");var k=p(this,c,g),m=[];m.push(" ','","");this.element_.insertAdjacentHTML("BeforeEnd",m.join(""))};d.stroke=function(a){var b=[];b.push("d.x)d.x=f.x;if(null==c.y||f.yd.y)d.y=f.y}}b.push(' ">');a?Q(this,b,c,d):P(this,b);b.push("");this.element_.insertAdjacentHTML("beforeEnd",b.join(""))};d.fill=function(){this.stroke(!0)};d.closePath=function(){this.currentPath_.push({type:"close"})};d.save=function(){var a= +{};M(this,a);this.aStack_.push(a);this.mStack_.push(this.m_);this.m_=q(A(),this.m_)};d.restore=function(){this.aStack_.length&&(M(this.aStack_.pop(),this),this.m_=this.mStack_.pop())};d.translate=function(a,b){w(this,q([[1,0,0],[0,1,0],[a,b,1]],this.m_),!1)};d.rotate=function(a){var b=H(a),a=G(a);w(this,q([[b,a,0],[-a,b,0],[0,0,1]],this.m_),!1)};d.scale=function(a,b){this.arcScaleX_*=a;this.arcScaleY_*=b;w(this,q([[a,0,0],[0,b,0],[0,0,1]],this.m_),!0)};d.transform=function(a,b,c,d,e,f){w(this,q([[a, +b,0],[c,d,0],[e,f,1]],this.m_),!0)};d.setTransform=function(a,b,c,d,e,f){w(this,[[a,b,0],[c,d,0],[e,f,1]],!0)};d.drawText_=function(a,b,c,d,e){var f=this.m_,d=0,o=1E3,q=0,l=[],i;i=this.font;if(I[i])i=I[i];else{var j=document.createElement("div").style;try{j.font=i}catch(r){}i=I[i]={style:j.fontStyle||"normal",variant:j.fontVariant||"normal",weight:j.fontWeight||"normal",size:j.fontSize||10,family:j.fontFamily||"sans-serif"}}var j=i,k=this.element_;i={};for(var m in j)i[m]=j[m];m=parseFloat(k.currentStyle.fontSize); +k=parseFloat(j.size);i.size="number"==typeof j.size?j.size:-1!=j.size.indexOf("px")?k:-1!=j.size.indexOf("em")?m*k:-1!=j.size.indexOf("%")?m/100*k:-1!=j.size.indexOf("pt")?k/0.75:m;i.size*=0.981;m=i.style+" "+i.variant+" "+i.weight+" "+i.size+"px "+i.family;k=this.element_.currentStyle;j=this.textAlign.toLowerCase();switch(j){case "left":case "center":case "right":break;case "end":j="ltr"==k.direction?"right":"left";break;case "start":j="rtl"==k.direction?"right":"left";break;default:j="left"}switch(this.textBaseline){case "hanging":case "top":q= +i.size/1.75;break;case "middle":break;default:case null:case "alphabetic":case "ideographic":case "bottom":q=-i.size/2.25}switch(j){case "right":d=1E3;o=0.05;break;case "center":d=o=500}b=p(this,b+0,c+q);l.push('');e?P(this,l):Q(this,l,{x:-d,y:0},{x:o,y:i.size});e=f[0][0].toFixed(3)+","+f[1][0].toFixed(3)+","+f[0][1].toFixed(3)+ +","+f[1][1].toFixed(3)+",0,0";b=h(b.x/n)+","+h(b.y/n);l.push('','','');this.element_.insertAdjacentHTML("beforeEnd",l.join(""))};d.fillText=function(a,b,c,d){this.drawText_(a,b,c,d,!1)};d.strokeText=function(a,b,c,d){this.drawText_(a,b,c,d,!0)};d.measureText=function(a){this.textMeasureEl_||(this.element_.insertAdjacentHTML("beforeEnd", +''),this.textMeasureEl_=this.element_.lastChild);var b=this.element_.ownerDocument;this.textMeasureEl_.innerHTML="";this.textMeasureEl_.style.font=this.font;this.textMeasureEl_.appendChild(b.createTextNode(a));return{width:this.textMeasureEl_.offsetWidth}};d.clip=function(){};d.arcTo=function(){};d.createPattern=function(a,b){return new F(a,b)};t.prototype.addColorStop=function(a,b){b=D(b);this.colors_.push({offset:a, +color:b.color,alpha:b.alpha})};d=x.prototype=Error();d.INDEX_SIZE_ERR=1;d.DOMSTRING_SIZE_ERR=2;d.HIERARCHY_REQUEST_ERR=3;d.WRONG_DOCUMENT_ERR=4;d.INVALID_CHARACTER_ERR=5;d.NO_DATA_ALLOWED_ERR=6;d.NO_MODIFICATION_ALLOWED_ERR=7;d.NOT_FOUND_ERR=8;d.NOT_SUPPORTED_ERR=9;d.INUSE_ATTRIBUTE_ERR=10;d.INVALID_STATE_ERR=11;d.SYNTAX_ERR=12;d.INVALID_MODIFICATION_ERR=13;d.NAMESPACE_ERR=14;d.INVALID_ACCESS_ERR=15;d.VALIDATION_ERR=16;d.TYPE_MISMATCH_ERR=17;G_vmlCanvasManager=R;CanvasRenderingContext2D=z;CanvasGradient= +t;CanvasPattern=F;DOMException=x}(); \ No newline at end of file diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/fancybox/jquery.fancybox.css b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/fancybox/jquery.fancybox.css new file mode 100755 index 0000000000..a025cafb37 --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/fancybox/jquery.fancybox.css @@ -0,0 +1,234 @@ +/*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */ +.fancybox-tmp iframe, .fancybox-tmp object { + vertical-align: top; + padding: 0; + margin: 0; +} + +.fancybox-wrap { + position: absolute; + top: 0; + left: 0; + z-index: 8020; +} + +.fancybox-skin { + position: relative; + padding: 0; + margin: 0; + background: #f9f9f9; + color: #444; + text-shadow: none; + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; +} + +.fancybox-opened { + z-index: 8030; +} + +.fancybox-opened .fancybox-skin { + -webkit-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); + -moz-box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); + box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5); +} + +.fancybox-outer, .fancybox-inner { + padding: 0; + margin: 0; + position: relative; + outline: none; +} + +.fancybox-inner { + overflow: hidden; +} + +.fancybox-type-iframe .fancybox-inner { + -webkit-overflow-scrolling: touch; +} + +.fancybox-error { + color: #444; + font: 14px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; + margin: 0; + padding: 10px; +} + +.fancybox-image, .fancybox-iframe { + display: block; + width: 100%; + height: 100%; + border: 0; + padding: 0; + margin: 0; + vertical-align: top; +} + +.fancybox-image { + max-width: 100%; + max-height: 100%; +} + +#fancybox-loading, .fancybox-close, .fancybox-prev span, .fancybox-next span { + background-image: url('../../images/fancybox_sprite.png'); +} + +#fancybox-loading { + position: fixed; + top: 50%; + left: 50%; + margin-top: -22px; + margin-left: -22px; + background-position: 0 -108px; + opacity: 0.8; + cursor: pointer; + z-index: 8020; +} + +#fancybox-loading div { + width: 44px; + height: 44px; + background: url('../../images/fancybox_loading.gif') center center no-repeat; +} + +.fancybox-close { + position: absolute; + top: -18px; + right: -18px; + width: 36px; + height: 36px; + cursor: pointer; + z-index: 8040; +} + +.fancybox-nav { + position: absolute; + top: 0; + width: 40%; + height: 100%; + cursor: pointer; + background: transparent url('../../images/blank.gif'); /* helps IE */ + -webkit-tap-highlight-color: rgba(0,0,0,0); + z-index: 8040; +} + +.fancybox-prev { + left: 0; +} + +.fancybox-next { + right: 0; +} + +.fancybox-nav span { + position: absolute; + top: 50%; + width: 36px; + height: 34px; + margin-top: -18px; + cursor: pointer; + z-index: 8040; + visibility: hidden; +} + +.fancybox-prev span { + left: 20px; + background-position: 0 -36px; +} + +.fancybox-next span { + right: 20px; + background-position: 0 -72px; +} + +.fancybox-nav:hover span { + visibility: visible; +} + +.fancybox-tmp { + position: absolute; + top: -9999px; + left: -9999px; + padding: 0; + overflow: visible; + visibility: hidden; +} + +/* Overlay helper */ + +#fancybox-overlay { + position: absolute; + top: 0; + left: 0; + overflow: hidden; + display: none; + z-index: 8010; + background: #000; +} + +#fancybox-overlay.overlay-fixed { + position: fixed; + bottom: 0; + right: 0; +} + +/* Title helper */ + +.fancybox-title { + visibility: hidden; + font: normal 13px/20px "Helvetica Neue",Helvetica,Arial,sans-serif; + position: relative; + text-shadow: none; + z-index: 8050; +} + +.fancybox-opened .fancybox-title { + visibility: visible; +} + +.fancybox-title-float-wrap { + position: absolute; + bottom: 0; + right: 50%; + margin-bottom: -35px; + z-index: 8030; + text-align: center; +} + +.fancybox-title-float-wrap .child { + display: inline-block; + margin-right: -100%; + padding: 2px 20px; + background: transparent; /* Fallback for web browsers that doesn't support RGBa */ + background: rgba(0, 0, 0, 0.8); + -webkit-border-radius: 15px; + -moz-border-radius: 15px; + border-radius: 15px; + text-shadow: 0 1px 2px #222; + color: #FFF; + font-weight: bold; + line-height: 24px; + white-space: nowrap; +} + +.fancybox-title-outside-wrap { + position: relative; + margin-top: 10px; + color: #fff; +} + +.fancybox-title-inside-wrap { + margin-top: 10px; +} + +.fancybox-title-over-wrap { + position: absolute; + bottom: 0; + left: 0; + color: #fff; + padding: 10px; + background: #000; + background: rgba(0, 0, 0, .8); +} \ No newline at end of file diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/fancybox/jquery.fancybox.pack.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/fancybox/jquery.fancybox.pack.js new file mode 100755 index 0000000000..6521c21e0d --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/fancybox/jquery.fancybox.pack.js @@ -0,0 +1,35 @@ +/*! fancyBox v2.0.6 fancyapps.com | fancyapps.com/fancybox/#license */ +(function(s,l,d,t){var m=d(s),q=d(l),a=d.fancybox=function(){a.open.apply(this,arguments)},u=!1,k=l.createTouch!==t,o=function(a){return"string"===d.type(a)},n=function(b,c){c&&o(b)&&0
',image:'',iframe:'",swf:'',error:'

The requested content cannot be loaded.
Please try again later.

', +closeBtn:'
',next:'',prev:''},openEffect:"fade",openSpeed:300,openEasing:"swing",openOpacity:!0,openMethod:"zoomIn",closeEffect:"fade",closeSpeed:300,closeEasing:"swing",closeOpacity:!0,closeMethod:"zoomOut",nextEffect:"elastic",nextSpeed:300,nextEasing:"swing",nextMethod:"changeIn",prevEffect:"elastic", +prevSpeed:300,prevEasing:"swing",prevMethod:"changeOut",helpers:{overlay:{speedIn:0,speedOut:300,opacity:0.8,css:{cursor:"pointer"},closeClick:!0},title:{type:"float"}}},group:{},opts:{},coming:null,current:null,isOpen:!1,isOpened:!1,player:{timer:null,isActive:!1},ajaxLoad:null,imgPreload:null,transitions:{},helpers:{},open:function(b,c){a.close(!0);b&&!d.isArray(b)&&(b=b instanceof d?d(b).get():[b]);a.isActive=!0;a.opts=d.extend(!0,{},a.defaults,c);d.isPlainObject(c)&&c.keys!==t&&(a.opts.keys=c.keys? +d.extend({},a.defaults.keys,c.keys):!1);a.group=b;a._start(a.opts.index||0)},cancel:function(){a.coming&&!1===a.trigger("onCancel")||(a.coming=null,a.hideLoading(),a.ajaxLoad&&a.ajaxLoad.abort(),a.ajaxLoad=null,a.imgPreload&&(a.imgPreload.onload=a.imgPreload.onabort=a.imgPreload.onerror=null))},close:function(b){a.cancel();a.current&&!1!==a.trigger("beforeClose")&&(a.unbindEvents(),!a.isOpen||b&&!0===b[0]?(d(".fancybox-wrap").stop().trigger("onReset").remove(),a._afterZoomOut()):(a.isOpen=a.isOpened= +!1,d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.closeMethod]()))},play:function(b){var c=function(){clearTimeout(a.player.timer)},e=function(){c();a.current&&a.player.isActive&&(a.player.timer=setTimeout(a.next,a.current.playSpeed))},f=function(){c();d("body").unbind(".player");a.player.isActive=!1;a.trigger("onPlayEnd")};if(a.player.isActive||b&&!1===b[0])f();else if(a.current&&(a.current.loop|| +a.current.index=a.group.length?b=0:0>b&&(b=a.group.length-1)),a.group[b]!==t&&(a.cancel(),a._start(b)))},reposition:function(b, +c){var e;a.isOpen&&(e=a._getPosition(c),b&&"scroll"===b.type?(delete e.position,a.wrap.stop(!0,!0).animate(e,200)):a.wrap.css(e))},update:function(b){a.isOpen&&(u||setTimeout(function(){var c=a.current,e=!b||b&&"orientationchange"===b.type;if(u&&(u=!1,c)){if(!b||"scroll"!==b.type||e)c.autoSize&&"iframe"!==c.type&&(a.inner.height("auto"),c.height=a.inner.height()),(c.autoResize||e)&&a._setDimension(),c.canGrow&&"iframe"!==c.type&&a.inner.height("auto");(c.autoCenter||e)&&a.reposition(b);a.trigger("onUpdate")}}, +200),u=!0)},toggle:function(){a.isOpen&&(a.current.fitToView=!a.current.fitToView,a.update())},hideLoading:function(){q.unbind("keypress.fb");d("#fancybox-loading").remove()},showLoading:function(){a.hideLoading();q.bind("keypress.fb",function(b){27===b.keyCode&&(b.preventDefault(),a.cancel())});d('
').click(a.cancel).appendTo("body")},getViewport:function(){return{x:m.scrollLeft(),y:m.scrollTop(),w:k&&s.innerWidth?s.innerWidth:m.width(),h:k&&s.innerHeight? +s.innerHeight:m.height()}},unbindEvents:function(){a.wrap&&a.wrap.unbind(".fb");q.unbind(".fb");m.unbind(".fb")},bindEvents:function(){var b=a.current,c=b.keys;b&&(m.bind("resize.fb orientationchange.fb"+(b.autoCenter&&!b.fixed?" scroll.fb":""),a.update),c&&q.bind("keydown.fb",function(b){var f;f=b.target||b.srcElement;if(!b.ctrlKey&&!b.altKey&&!b.shiftKey&&!b.metaKey&&(!f||!f.type&&!d(f).is("[contenteditable]")))f=b.keyCode,-1b.length))for(i=1;i<=h;i+=1)if(f=b[(c.index+i)%e],g=f.href||d(f).attr("href")||f,"image"===f.type||a.isImage(g))(new Image).src=g},_afterLoad:function(){a.hideLoading(); +!a.coming||!1===a.trigger("afterLoad",a.current)?a.coming=!1:(a.isOpened?(d(".fancybox-item, .fancybox-nav").remove(),a.wrap.stop(!0).removeClass("fancybox-opened"),a.inner.css("overflow","hidden"),a.transitions[a.current.prevMethod]()):(d(".fancybox-wrap").stop().trigger("onReset").remove(),a.trigger("afterClose")),a.unbindEvents(),a.isOpen=!1,a.current=a.coming,a.wrap=d(a.current.tpl.wrap).addClass("fancybox-"+(k?"mobile":"desktop")+" fancybox-type-"+a.current.type+" fancybox-tmp "+a.current.wrapCSS).appendTo("body"), +a.skin=d(".fancybox-skin",a.wrap).css("padding",n(a.current.padding)),a.outer=d(".fancybox-outer",a.wrap),a.inner=d(".fancybox-inner",a.wrap),a._setContent())},_setContent:function(){var b=a.current,c=b.content,e=b.type,f=b.minWidth,g=b.minHeight,i=b.maxWidth,h=b.maxHeight;switch(e){case "inline":case "ajax":case "html":b.selector?c=d("
").html(c).find(b.selector):c instanceof d&&(c.parent().hasClass("fancybox-inner")&&c.parents(".fancybox-wrap").unbind("onReset"),c=c.show().detach(),d(a.wrap).bind("onReset", +function(){c.appendTo("body").hide()}));b.autoSize&&(f=d('
').appendTo("body").css({minWidth:n(f,"w"),minHeight:n(g,"h"),maxWidth:n(i,"w"),maxHeight:n(h,"h")}).append(c),b.width=f.width(),b.height=f.height(),f.width(a.current.width),f.height()>b.height&&(f.width(b.width+1),b.width=f.width(),b.height=f.height()),c=f.contents().detach(),f.remove());break;case "image":c=b.tpl.image.replace("{href}",b.href);b.aspectRatio=!0;break;case "swf":c= +b.tpl.swf.replace(/\{width\}/g,b.width).replace(/\{height\}/g,b.height).replace(/\{href\}/g,b.href);break;case "iframe":c=d(b.tpl.iframe.replace("{rnd}",(new Date).getTime())).attr("scrolling",b.scrolling).attr("src",b.href),b.scrolling=k?"scroll":"auto"}if("image"===e||"swf"===e)b.autoSize=!1,b.scrolling="visible";"iframe"===e&&b.autoSize?(a.showLoading(),a._setDimension(),a.inner.css("overflow",b.scrolling),c.bind({onCancel:function(){d(this).unbind();a._afterZoomOut()},load:function(){a.hideLoading(); +try{this.contentWindow.document.location&&(a.current.height=d(this).contents().find("body").height())}catch(b){a.current.autoSize=!1}a[a.isOpen?"_afterZoomIn":"_beforeShow"]()}}).appendTo(a.inner)):(a.inner.append(c),a._beforeShow())},_beforeShow:function(){a.coming=null;a.trigger("beforeShow");a._setDimension();a.wrap.hide().removeClass("fancybox-tmp");a.bindEvents();a._preloadImages();a.transitions[a.isOpened?a.current.nextMethod:a.current.openMethod]()},_setDimension:function(){var b=a.wrap,c= +a.inner,e=a.current,f=a.getViewport(),g=e.margin,i=2*e.padding,h=e.width,j=e.height,r=e.maxWidth+i,k=e.maxHeight+i,l=e.minWidth+i,m=e.minHeight+i,p;f.w-=g[1]+g[3];f.h-=g[0]+g[2];o(h)&&0r&&(h=r,j=(h-i)/g+i),j>k&&(j=k,h=(j-i)*g+i),hr||p>k)for(;(h>r||p>k)&&h>l&&p>m;)j-=10,e.aspectRatio?(h=Math.round((j-i)*g+i),hm&&jf.w||p>f.h)&&h>l&&j>m)e.canShrink=!0;a.innerSpace=p-i- +c.height()},_getPosition:function(b){var c=a.current,e=a.getViewport(),f=c.margin,d=a.wrap.width()+f[1]+f[3],i=a.wrap.height()+f[0]+f[2],h={position:"absolute",top:f[0]+e.y,left:f[3]+e.x};c.autoCenter&&c.fixed&&!b&&i<=e.h&&d<=e.w&&(h={position:"fixed",top:f[0],left:f[3]});h.top=n(Math.max(h.top,h.top+(e.h-i)*c.topRatio));h.left=n(Math.max(h.left,h.left+0.5*(e.w-d)));return h},_afterZoomIn:function(){var b=a.current,c=b?b.scrolling:"no";if(b&&(a.isOpen=a.isOpened=!0,a.wrap.addClass("fancybox-opened"), +a.inner.css("overflow","yes"===c?"scroll":"no"===c?"hidden":c),a.trigger("afterShow"),a.update(),(b.closeClick||b.nextClick)&&a.inner.css("cursor","pointer").bind("click.fb",function(c){if(!d(c.target).is("a")&&!d(c.target).parent().is("a"))a[b.closeClick?"close":"next"]()}),b.closeBtn&&d(b.tpl.closeBtn).appendTo(a.skin).bind("click.fb",a.close),b.arrows&&1c.end&&(g=1-g),d-=a.innerSpace*g),a.inner[e](d)},zoomIn:function(){var b=a.wrap,c=a.current,e=c.openEffect,f="elastic"===e,g=d.extend({},c.dim, +a._getPosition(f)),i=d.extend({opacity:1},g);delete i.position;f?(g=this.getOrigPosition(),c.openOpacity&&(g.opacity=0),a.outer.add(a.inner).width("auto").height("auto")):"fade"===e&&(g.opacity=0);b.css(g).show().animate(i,{duration:"none"===e?0:c.openSpeed,easing:c.openEasing,step:f?this.step:null,complete:a._afterZoomIn})},zoomOut:function(){var b=a.wrap,c=a.current,d=c.openEffect,f="elastic"===d,g={opacity:0};f&&("fixed"===b.css("position")&&b.css(a._getPosition(!0)),g=this.getOrigPosition(),c.closeOpacity&& +(g.opacity=0));b.animate(g,{duration:"none"===d?0:c.closeSpeed,easing:c.closeEasing,step:f?this.step:null,complete:a._afterZoomOut})},changeIn:function(){var b=a.wrap,c=a.current,d=c.nextEffect,f="elastic"===d,g=a._getPosition(f),i={opacity:1};g.opacity=0;f&&(g.top=n(parseInt(g.top,10)-200),i.top="+=200px");b.css(g).show().animate(i,{duration:"none"===d?0:c.nextSpeed,easing:c.nextEasing,complete:a._afterZoomIn})},changeOut:function(){var b=a.wrap,c=a.current,e=c.prevEffect,f={opacity:0};b.removeClass("fancybox-opened"); +"elastic"===e&&(f.top="+=200px");b.animate(f,{duration:"none"===e?0:c.prevSpeed,easing:c.prevEasing,complete:function(){d(this).trigger("onReset").remove()}})}};a.helpers.overlay={overlay:null,update:function(){var a,c;this.overlay.width("100%").height("100%");d.browser.msie||k?(a=Math.max(l.documentElement.scrollWidth,l.body.scrollWidth),c=Math.max(l.documentElement.offsetWidth,l.body.offsetWidth),a=a
').css(b.css).appendTo("body"),b.closeClick&&this.overlay.bind("click.fb",a.close),a.current.fixed&&!k?this.overlay.addClass("overlay-fixed"):(this.update(),this.onUpdate=function(){this.update()}),this.overlay.fadeTo(b.speedIn,b.opacity))},afterClose:function(a){this.overlay&&this.overlay.fadeOut(a.speedOut||0,function(){d(this).remove()});this.overlay=null}};a.helpers.title={beforeShow:function(b){var c; +if(c=a.current.title)c=d('
'+c+"
").appendTo("body"),"float"===b.type&&(c.width(c.width()),c.wrapInner(''),a.current.margin[2]+=Math.abs(parseInt(c.css("margin-bottom"),10))),c.appendTo("over"===b.type?a.inner:"outside"===b.type?a.wrap:a.skin)}};d.fn.fancybox=function(b){var c=d(this),e=this.selector||"",f,g=function(g){var h=this,j=f,k;!g.ctrlKey&&!g.altKey&&!g.shiftKey&&!g.metaKey&&!d(h).is(".fancybox-wrap")&& +(g.preventDefault(),g=b.groupAttr||"data-fancybox-group",k=d(h).attr(g),k||(g="rel",k=h[g]),k&&""!==k&&"nofollow"!==k&&(h=e.length?d(e):c,h=h.filter("["+g+'="'+k+'"]'),j=h.index(this)),b.index=j,a.open(h,b))},b=b||{};f=b.index||0;e?q.undelegate(e,"click.fb-start").delegate(e,"click.fb-start",g):c.unbind("click.fb-start").bind("click.fb-start",g);return this};d(l).ready(function(){a.defaults.fixed=d.support.fixedPosition||!(d.browser.msie&&6>=d.browser.version)&&!k})})(window,document,jQuery); \ No newline at end of file diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/jquery/jquery.min.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/jquery/jquery.min.js new file mode 100644 index 0000000000..16ad06c5ac --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/jquery/jquery.min.js @@ -0,0 +1,4 @@ +/*! jQuery v1.7.2 jquery.com | jquery.org/license */ +(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cu(a){if(!cj[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){ck||(ck=c.createElement("iframe"),ck.frameBorder=ck.width=ck.height=0),b.appendChild(ck);if(!cl||!ck.createElement)cl=(ck.contentWindow||ck.contentDocument).document,cl.write((f.support.boxModel?"":"")+""),cl.close();d=cl.createElement(a),cl.body.appendChild(d),e=f.css(d,"display"),b.removeChild(ck)}cj[a]=e}return cj[a]}function ct(a,b){var c={};f.each(cp.concat.apply([],cp.slice(0,b)),function(){c[this]=a});return c}function cs(){cq=b}function cr(){setTimeout(cs,0);return cq=f.now()}function ci(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ch(){try{return new a.XMLHttpRequest}catch(b){}}function cb(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;e=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?+d:j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.2",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){if(typeof c!="string"||!c)return null;var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
a",d=p.getElementsByTagName("*"),e=p.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=p.getElementsByTagName("input")[0],b={leadingWhitespace:p.firstChild.nodeType===3,tbody:!p.getElementsByTagName("tbody").length,htmlSerialize:!!p.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:p.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,pixelMargin:!0},f.boxModel=b.boxModel=c.compatMode==="CSS1Compat",i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete p.test}catch(r){b.deleteExpando=!1}!p.addEventListener&&p.attachEvent&&p.fireEvent&&(p.attachEvent("onclick",function(){b.noCloneEvent=!1}),p.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),i.setAttribute("name","t"),p.appendChild(i),j=c.createDocumentFragment(),j.appendChild(p.lastChild),b.checkClone=j.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,j.removeChild(i),j.appendChild(p);if(p.attachEvent)for(n in{submit:1,change:1,focusin:1})m="on"+n,o=m in p,o||(p.setAttribute(m,"return;"),o=typeof p[m]=="function"),b[n+"Bubbles"]=o;j.removeChild(p),j=g=h=p=i=null,f(function(){var d,e,g,h,i,j,l,m,n,q,r,s,t,u=c.getElementsByTagName("body")[0];!u||(m=1,t="padding:0;margin:0;border:",r="position:absolute;top:0;left:0;width:1px;height:1px;",s=t+"0;visibility:hidden;",n="style='"+r+t+"5px solid #000;",q="
"+""+"
",d=c.createElement("div"),d.style.cssText=s+"width:0;height:0;position:static;top:0;margin-top:"+m+"px",u.insertBefore(d,u.firstChild),p=c.createElement("div"),d.appendChild(p),p.innerHTML="
t
",k=p.getElementsByTagName("td"),o=k[0].offsetHeight===0,k[0].style.display="",k[1].style.display="none",b.reliableHiddenOffsets=o&&k[0].offsetHeight===0,a.getComputedStyle&&(p.innerHTML="",l=c.createElement("div"),l.style.width="0",l.style.marginRight="0",p.style.width="2px",p.appendChild(l),b.reliableMarginRight=(parseInt((a.getComputedStyle(l,null)||{marginRight:0}).marginRight,10)||0)===0),typeof p.style.zoom!="undefined"&&(p.innerHTML="",p.style.width=p.style.padding="1px",p.style.border=0,p.style.overflow="hidden",p.style.display="inline",p.style.zoom=1,b.inlineBlockNeedsLayout=p.offsetWidth===3,p.style.display="block",p.style.overflow="visible",p.innerHTML="
",b.shrinkWrapBlocks=p.offsetWidth!==3),p.style.cssText=r+s,p.innerHTML=q,e=p.firstChild,g=e.firstChild,i=e.nextSibling.firstChild.firstChild,j={doesNotAddBorder:g.offsetTop!==5,doesAddBorderForTableAndCells:i.offsetTop===5},g.style.position="fixed",g.style.top="20px",j.fixedPosition=g.offsetTop===20||g.offsetTop===15,g.style.position=g.style.top="",e.style.overflow="hidden",e.style.position="relative",j.subtractsBorderForOverflowNotVisible=g.offsetTop===-5,j.doesNotIncludeMarginInBodyOffset=u.offsetTop!==m,a.getComputedStyle&&(p.style.marginTop="1%",b.pixelMargin=(a.getComputedStyle(p,null)||{marginTop:0}).marginTop!=="1%"),typeof d.style.zoom!="undefined"&&(d.style.zoom=1),u.removeChild(d),l=p=d=null,f.extend(b,j))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e1,null,!1)},removeData:function(a){return this.each(function(){f.removeData(this,a)})}}),f.extend({_mark:function(a,b){a&&(b=(b||"fx")+"mark",f._data(a,b,(f._data(a,b)||0)+1))},_unmark:function(a,b,c){a!==!0&&(c=b,b=a,a=!1);if(b){c=c||"fx";var d=c+"mark",e=a?0:(f._data(b,d)||1)-1;e?f._data(b,d,e):(f.removeData(b,d,!0),n(b,c,"mark"))}},queue:function(a,b,c){var d;if(a){b=(b||"fx")+"queue",d=f._data(a,b),c&&(!d||f.isArray(c)?d=f._data(a,b,f.makeArray(c)):d.push(c));return d||[]}},dequeue:function(a,b){b=b||"fx";var c=f.queue(a,b),d=c.shift(),e={};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),f._data(a,b+".run",e),d.call(a,function(){f.dequeue(a,b)},e)),c.length||(f.removeData(a,b+"queue "+b+".run",!0),n(a,b,"queue"))}}),f.fn.extend({queue:function(a,c){var d=2;typeof a!="string"&&(c=a,a="fx",d--);if(arguments.length1)},removeAttr:function(a){return this.each(function(){f.removeAttr(this,a)})},prop:function(a,b){return f.access(this,f.prop,a,b,arguments.length>1)},removeProp:function(a){a=f.propFix[a]||a;return this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,g,h,i;if(f.isFunction(a))return this.each(function(b){f(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(p);for(c=0,d=this.length;c-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.type]||f.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.type]||f.valHooks[g.nodeName.toLowerCase()];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h,i=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;i=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/(?:^|\s)hover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function( +a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")};f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler,g=p.selector),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&j.push({elem:this,matches:d.slice(e)});for(k=0;k0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));o.match.globalPOS=p;var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/]","i"),bd=/checked\s*(?:[^=]|=\s*.checked.)/i,be=/\/(java|ecma)script/i,bf=/^\s*",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){return f.access(this,function(a){return a===b?f.text(this):this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f +.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){return f.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(;d1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||f.isXMLDoc(a)||!bc.test("<"+a.nodeName+">")?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g,h,i,j=[];b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);for(var k=0,l;(l=a[k])!=null;k++){typeof l=="number"&&(l+="");if(!l)continue;if(typeof l=="string")if(!_.test(l))l=b.createTextNode(l);else{l=l.replace(Y,"<$1>");var m=(Z.exec(l)||["",""])[1].toLowerCase(),n=bg[m]||bg._default,o=n[0],p=b.createElement("div"),q=bh.childNodes,r;b===c?bh.appendChild(p):U(b).appendChild(p),p.innerHTML=n[1]+l+n[2];while(o--)p=p.lastChild;if(!f.support.tbody){var s=$.test(l),t=m==="table"&&!s?p.firstChild&&p.firstChild.childNodes:n[1]===""&&!s?p.childNodes:[];for(i=t.length-1;i>=0;--i)f.nodeName(t[i],"tbody")&&!t[i].childNodes.length&&t[i].parentNode.removeChild(t[i])}!f.support.leadingWhitespace&&X.test(l)&&p.insertBefore(b.createTextNode(X.exec(l)[0]),p.firstChild),l=p.childNodes,p&&(p.parentNode.removeChild(p),q.length>0&&(r=q[q.length-1],r&&r.parentNode&&r.parentNode.removeChild(r)))}var u;if(!f.support.appendChecked)if(l[0]&&typeof (u=l.length)=="number")for(i=0;i1)},f.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=by(a,"opacity");return c===""?"1":c}return a.style.opacity}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":f.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!!a&&a.nodeType!==3&&a.nodeType!==8&&!!a.style){var g,h,i=f.camelCase(c),j=a.style,k=f.cssHooks[i];c=f.cssProps[i]||i;if(d===b){if(k&&"get"in k&&(g=k.get(a,!1,e))!==b)return g;return j[c]}h=typeof d,h==="string"&&(g=bu.exec(d))&&(d=+(g[1]+1)*+g[2]+parseFloat(f.css(a,c)),h="number");if(d==null||h==="number"&&isNaN(d))return;h==="number"&&!f.cssNumber[i]&&(d+="px");if(!k||!("set"in k)||(d=k.set(a,d))!==b)try{j[c]=d}catch(l){}}},css:function(a,c,d){var e,g;c=f.camelCase(c),g=f.cssHooks[c],c=f.cssProps[c]||c,c==="cssFloat"&&(c="float");if(g&&"get"in g&&(e=g.get(a,!0,d))!==b)return e;if(by)return by(a,c)},swap:function(a,b,c){var d={},e,f;for(f in b)d[f]=a.style[f],a.style[f]=b[f];e=c.call(a);for(f in b)a.style[f]=d[f];return e}}),f.curCSS=f.css,c.defaultView&&c.defaultView.getComputedStyle&&(bz=function(a,b){var c,d,e,g,h=a.style;b=b.replace(br,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b))),!f.support.pixelMargin&&e&&bv.test(b)&&bt.test(c)&&(g=h.width,h.width=c,c=e.width,h.width=g);return c}),c.documentElement.currentStyle&&(bA=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f==null&&g&&(e=g[b])&&(f=e),bt.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),by=bz||bA,f.each(["height","width"],function(a,b){f.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0?bB(a,b,d):f.swap(a,bw,function(){return bB(a,b,d)})},set:function(a,b){return bs.test(b)?b+"px":b}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return bq.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bp,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bp.test(g)?g.replace(bp,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){return f.swap(a,{display:"inline-block"},function(){return b?by(a,"margin-right"):a.style.marginRight})}})}),f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)}),f.each({margin:"",padding:"",border:"Width"},function(a,b){f.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bx[d]+b]=e[d]||e[d-2]||e[0];return f}}});var bC=/%20/g,bD=/\[\]$/,bE=/\r?\n/g,bF=/#.*$/,bG=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bH=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bI=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bJ=/^(?:GET|HEAD)$/,bK=/^\/\//,bL=/\?/,bM=/)<[^<]*)*<\/script>/gi,bN=/^(?:select|textarea)/i,bO=/\s+/,bP=/([?&])_=[^&]*/,bQ=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bR=f.fn.load,bS={},bT={},bU,bV,bW=["*/"]+["*"];try{bU=e.href}catch(bX){bU=c.createElement("a"),bU.href="",bU=bU.href}bV=bQ.exec(bU.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bR)return bR.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bM,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bN.test(this.nodeName)||bH.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bE,"\r\n")}}):{name:b.name,value:c.replace(bE,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b$(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b$(a,b);return a},ajaxSettings:{url:bU,isLocal:bI.test(bV[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bW},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bY(bS),ajaxTransport:bY(bT),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?ca(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cb(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bG.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bF,"").replace(bK,bV[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bO),d.crossDomain==null&&(r=bQ.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bV[1]&&r[2]==bV[2]&&(r[3]||(r[1]==="http:"?80:443))==(bV[3]||(bV[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),bZ(bS,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bJ.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bL.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bP,"$1_="+x);d.url=y+(y===d.url?(bL.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bW+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=bZ(bT,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)b_(g,a[g],c,e);return d.join("&").replace(bC,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cc=f.now(),cd=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cc++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=typeof b.data=="string"&&/^application\/x\-www\-form\-urlencoded/.test(b.contentType);if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(cd.test(b.url)||e&&cd.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(cd,l),b.url===j&&(e&&(k=k.replace(cd,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var ce=a.ActiveXObject?function(){for(var a in cg)cg[a](0,1)}:!1,cf=0,cg;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ch()||ci()}:ch,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,ce&&delete cg[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n);try{m.text=h.responseText}catch(a){}try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cf,ce&&(cg||(cg={},f(a).unload(ce)),cg[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var cj={},ck,cl,cm=/^(?:toggle|show|hide)$/,cn=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,co,cp=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cq;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(ct("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);f.fn[a]=function(e){return f.access(this,function(a,e,g){var h=cy(a);if(g===b)return h?c in h?h[c]:f.support.boxModel&&h.document.documentElement[e]||h.document.body[e]:a[e];h?h.scrollTo(d?f(h).scrollLeft():g,d?g:f(h).scrollTop()):a[e]=g},a,e,arguments.length,null)}}),f.each({Height:"height",Width:"width"},function(a,c){var d="client"+a,e="scroll"+a,g="offset"+a;f.fn["inner"+a]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,c,"padding")):this[c]():null},f.fn["outer"+a]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,c,a?"margin":"border")):this[c]():null},f.fn[c]=function(a){return f.access(this,function(a,c,h){var i,j,k,l;if(f.isWindow(a)){i=a.document,j=i.documentElement[d];return f.support.boxModel&&j||i.body&&i.body[d]||j}if(a.nodeType===9){i=a.documentElement;if(i[d]>=i[e])return i[d];return Math.max(a.body[e],i[e],a.body[g],i[g])}if(h===b){k=f.css(a,c),l=parseFloat(k);return f.isNumeric(l)?l:k}f(a).css(c,h)},c,a,arguments.length,null)}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); \ No newline at end of file diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/main.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/main.js new file mode 100644 index 0000000000..311605a54d --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/main.js @@ -0,0 +1,623 @@ +var sigInst, canvas, $GP + +//Load configuration file +var config={}; + +//For debug allow a config=file.json parameter to specify the config +function GetQueryStringParams(sParam,defaultVal) { + var sPageURL = ""+window.location;//.search.substring(1);//This might be causing error in Safari? + if (sPageURL.indexOf("?")==-1) return defaultVal; + sPageURL=sPageURL.substr(sPageURL.indexOf("?")+1); + var sURLVariables = sPageURL.split('&'); + for (var i = 0; i < sURLVariables.length; i++) { + var sParameterName = sURLVariables[i].split('='); + if (sParameterName[0] == sParam) { + return sParameterName[1]; + } + } + return defaultVal; +} + + +jQuery.getJSON(GetQueryStringParams("config","config.json"), function(data, textStatus, jqXHR) { + config=data; + + if (config.type!="network") { + //bad config + alert("Invalid configuration settings.") + return; + } + + //As soon as page is ready (and data ready) set up it + $(document).ready(setupGUI(config)); +});//End JSON Config load + + +// FUNCTION DECLARATIONS + +Object.size = function(obj) { + var size = 0, key; + for (key in obj) { + if (obj.hasOwnProperty(key)) size++; + } + return size; +}; + +function initSigma(config) { + var data=config.data + + var drawProps, graphProps,mouseProps; + if (config.sigma && config.sigma.drawingProperties) + drawProps=config.sigma.drawingProperties; + else + drawProps={ + defaultLabelColor: "#000", + defaultLabelSize: 14, + defaultLabelBGColor: "#ddd", + defaultHoverLabelBGColor: "#002147", + defaultLabelHoverColor: "#fff", + labelThreshold: 10, + defaultEdgeType: "curve", + hoverFontStyle: "bold", + fontStyle: "bold", + activeFontStyle: "bold" + }; + + if (config.sigma && config.sigma.graphProperties) + graphProps=config.sigma.graphProperties; + else + graphProps={ + minNodeSize: 1, + maxNodeSize: 7, + minEdgeSize: 0.2, + maxEdgeSize: 0.5 + }; + + if (config.sigma && config.sigma.mouseProperties) + mouseProps=config.sigma.mouseProperties; + else + mouseProps={ + minRatio: 0.75, // How far can we zoom out? + maxRatio: 20, // How far can we zoom in? + }; + + var a = sigma.init(document.getElementById("sigma-canvas")).drawingProperties(drawProps).graphProperties(graphProps).mouseProperties(mouseProps); + sigInst = a; + a.active = !1; + a.neighbors = {}; + a.detail = !1; + + + dataReady = function() {//This is called as soon as data is loaded + a.clusters = {}; + + a.iterNodes( + function (b) { //This is where we populate the array used for the group select box + + // note: index may not be consistent for all nodes. Should calculate each time. + // alert(JSON.stringify(b.attr.attributes[5].val)); + // alert(b.x); + a.clusters[b.color] || (a.clusters[b.color] = []); + a.clusters[b.color].push(b.id);//SAH: push id not label + } + + ); + + a.bind("upnodes", function (a) { + nodeActive(a.content[0]) + }); + + a.draw(); + configSigmaElements(config); + } + + if (data.indexOf("gexf")>0 || data.indexOf("xml")>0) + a.parseGexf(data,dataReady); + else + a.parseJson(data,dataReady); + gexf = sigmaInst = null; +} + + +function setupGUI(config) { + // Initialise main interface elements + var logo=""; // Logo elements + if (config.logo.file) { + + logo = ""; + } + if (config.logo.link) logo=""+logo+""; + $("#maintitle").html(logo); + + // #title + $("#title").html("

"+config.text.title+"

"); + + // #titletext + $("#titletext").html(config.text.intro); + + // More information + if (config.text.more) { + $("#information").html(config.text.more); + } else { + //hide more information link + $(".info").hide(); + } + + // Legend + + // Node + if (config.legend.nodeLabel) { + $(".node").next().html(config.legend.nodeLabel); + } else { + //hide more information link + $(".node").hide(); + } + // Edge + if (config.legend.edgeLabel) { + $(".edge").next().html(config.legend.edgeLabel); + } else { + //hide more information link + $(".edge").hide(); + } + // Colours + if (config.legend.nodeLabel) { + $(".colours").next().html(config.legend.colorLabel); + } else { + //hide more information link + $(".colours").hide(); + } + + $GP = { + calculating: !1, + showgroup: !1 + }; + $GP.intro = $("#intro"); + $GP.minifier = $GP.intro.find("#minifier"); + $GP.mini = $("#minify"); + $GP.info = $("#attributepane"); + $GP.info_donnees = $GP.info.find(".nodeattributes"); + $GP.info_name = $GP.info.find(".name"); + $GP.info_link = $GP.info.find(".link"); + $GP.info_data = $GP.info.find(".data"); + $GP.info_close = $GP.info.find(".returntext"); + $GP.info_close2 = $GP.info.find(".close"); + $GP.info_p = $GP.info.find(".p"); + $GP.info_close.click(nodeNormal); + $GP.info_close2.click(nodeNormal); + $GP.form = $("#mainpanel").find("form"); + $GP.search = new Search($GP.form.find("#search")); + if (!config.features.search) { + $("#search").hide(); + } + if (!config.features.groupSelectorAttribute) { + $("#attributeselect").hide(); + } + $GP.cluster = new Cluster($GP.form.find("#attributeselect")); + config.GP=$GP; + initSigma(config); +} + +function configSigmaElements(config) { + $GP=config.GP; + + // Node hover behaviour + if (config.features.hoverBehavior == "dim") { + + var greyColor = '#ccc'; + sigInst.bind('overnodes',function(event){ + var nodes = event.content; + var neighbors = {}; + sigInst.iterEdges(function(e){ + if(nodes.indexOf(e.source)<0 && nodes.indexOf(e.target)<0){ + if(!e.attr['grey']){ + e.attr['true_color'] = e.color; + e.color = greyColor; + e.attr['grey'] = 1; + } + }else{ + e.color = e.attr['grey'] ? e.attr['true_color'] : e.color; + e.attr['grey'] = 0; + + neighbors[e.source] = 1; + neighbors[e.target] = 1; + } + }).iterNodes(function(n){ + if(!neighbors[n.id]){ + if(!n.attr['grey']){ + n.attr['true_color'] = n.color; + n.color = greyColor; + n.attr['grey'] = 1; + } + }else{ + n.color = n.attr['grey'] ? n.attr['true_color'] : n.color; + n.attr['grey'] = 0; + } + }).draw(2,2,2); + }).bind('outnodes',function(){ + sigInst.iterEdges(function(e){ + e.color = e.attr['grey'] ? e.attr['true_color'] : e.color; + e.attr['grey'] = 0; + }).iterNodes(function(n){ + n.color = n.attr['grey'] ? n.attr['true_color'] : n.color; + n.attr['grey'] = 0; + }).draw(2,2,2); + }); + + } else if (config.features.hoverBehavior == "hide") { + + sigInst.bind('overnodes',function(event){ + var nodes = event.content; + var neighbors = {}; + sigInst.iterEdges(function(e){ + if(nodes.indexOf(e.source)>=0 || nodes.indexOf(e.target)>=0){ + neighbors[e.source] = 1; + neighbors[e.target] = 1; + } + }).iterNodes(function(n){ + if(!neighbors[n.id]){ + n.hidden = 1; + }else{ + n.hidden = 0; + } + }).draw(2,2,2); + }).bind('outnodes',function(){ + sigInst.iterEdges(function(e){ + e.hidden = 0; + }).iterNodes(function(n){ + n.hidden = 0; + }).draw(2,2,2); + }); + + } + $GP.bg = $(sigInst._core.domElements.bg); + $GP.bg2 = $(sigInst._core.domElements.bg2); + var a = [], + b,x=1; + for (b in sigInst.clusters) a.push(''); + //a.sort(); + $GP.cluster.content(a.join("")); + b = { + minWidth: 400, + maxWidth: 800, + maxHeight: 600 + };// minHeight: 300, + $("a.fb").fancybox(b); + $("#zoom").find("div.z").each(function () { + var a = $(this), + b = a.attr("rel"); + a.click(function () { + if (b == "center") { + sigInst.position(0,0,1).draw(); + } else { + var a = sigInst._core; + sigInst.zoomTo(a.domElements.nodes.width / 2, a.domElements.nodes.height / 2, a.mousecaptor.ratio * ("in" == b ? 1.5 : 0.5)); + } + + }) + }); + $GP.mini.click(function () { + $GP.mini.hide(); + $GP.intro.show(); + $GP.minifier.show() + }); + $GP.minifier.click(function () { + $GP.intro.hide(); + $GP.minifier.hide(); + $GP.mini.show() + }); + $GP.intro.find("#showGroups").click(function () { + !0 == $GP.showgroup ? showGroups(!1) : showGroups(!0) + }); + a = window.location.hash.substr(1); + if (0 < a.length) switch (a) { + case "Groups": + showGroups(!0); + break; + case "information": + $.fancybox.open($("#information"), b); + break; + default: + $GP.search.exactMatch = !0, $GP.search.search(a) + $GP.search.clean(); + } + +} + +function Search(a) { + this.input = a.find("input[name=search]"); + this.state = a.find(".state"); + this.results = a.find(".results"); + this.exactMatch = !1; + this.lastSearch = ""; + this.searching = !1; + var b = this; + this.input.focus(function () { + var a = $(this); + a.data("focus") || (a.data("focus", !0), a.removeClass("empty")); + b.clean() + }); + this.input.keydown(function (a) { + if (13 == a.which) return b.state.addClass("searching"), b.search(b.input.val()), !1 + }); + this.state.click(function () { + var a = b.input.val(); + b.searching && a == b.lastSearch ? b.close() : (b.state.addClass("searching"), b.search(a)) + }); + this.dom = a; + this.close = function () { + this.state.removeClass("searching"); + this.results.hide(); + this.searching = !1; + this.input.val("");//SAH -- let's erase string when we close + nodeNormal() + }; + this.clean = function () { + this.results.empty().hide(); + this.state.removeClass("searching"); + this.input.val(""); + }; + this.search = function (a) { + var b = !1, + c = [], + b = this.exactMatch ? ("^" + a + "$").toLowerCase() : a.toLowerCase(), + g = RegExp(b); + this.exactMatch = !1; + this.searching = !0; + this.lastSearch = a; + this.results.empty(); + if (2 >= a.length) this.results.html("You must search for a name with a minimum of 3 letters."); + else { + sigInst.iterNodes(function (a) { + g.test(a.label.toLowerCase()) && c.push({ + id: a.id, + name: a.label + }) + }); + c.length ? (b = !0, nodeActive(c[0].id)) : b = showCluster(a); + a = ["Search Results: "]; + if (1 < c.length) for (var d = 0, h = c.length; d < h; d++) a.push('" + c[d].name + ""); + 0 == c.length && !b && a.push("No results found."); + 1 < a.length && this.results.html(a.join("")); + } + if(c.length!=1) this.results.show(); + if(c.length==1) this.results.hide(); + } +} + +function Cluster(a) { + this.cluster = a; + this.display = !1; + this.list = this.cluster.find(".list"); + this.list.empty(); + this.select = this.cluster.find(".select"); + this.select.click(function () { + $GP.cluster.toggle() + }); + this.toggle = function () { + this.display ? this.hide() : this.show() + }; + this.content = function (a) { + this.list.html(a); + this.list.find("a").click(function () { + var a = $(this).attr("href").substr(1); + showCluster(a) + }) + }; + this.hide = function () { + this.display = !1; + this.list.hide(); + this.select.removeClass("close") + }; + this.show = function () { + this.display = !0; + this.list.show(); + this.select.addClass("close") + } +} +function showGroups(a) { + a ? ($GP.intro.find("#showGroups").text("Hide groups"), $GP.bg.show(), $GP.bg2.hide(), $GP.showgroup = !0) : ($GP.intro.find("#showGroups").text("View Groups"), $GP.bg.hide(), $GP.bg2.show(), $GP.showgroup = !1) +} + +function nodeNormal() { + !0 != $GP.calculating && !1 != sigInst.detail && (showGroups(!1), $GP.calculating = !0, sigInst.detail = !0, $GP.info.delay(400).animate({width:'hide'},350),$GP.cluster.hide(), sigInst.iterEdges(function (a) { + a.attr.color = !1; + a.hidden = !1 + }), sigInst.iterNodes(function (a) { + a.hidden = !1; + a.attr.color = !1; + a.attr.lineWidth = !1; + a.attr.size = !1 + }), sigInst.draw(2, 2, 2, 2), sigInst.neighbors = {}, sigInst.active = !1, $GP.calculating = !1, window.location.hash = "") +} + +function nodeActive(a) { + + var groupByDirection=false; + if (config.informationPanel.groupByEdgeDirection && config.informationPanel.groupByEdgeDirection==true) groupByDirection=true; + + sigInst.neighbors = {}; + sigInst.detail = !0; + var b = sigInst._core.graph.nodesIndex[a]; + showGroups(!1); + var outgoing={},incoming={},mutual={};//SAH + sigInst.iterEdges(function (b) { + b.attr.lineWidth = !1; + b.hidden = !0; + + n={ + name: b.label, + colour: b.color + }; + + if (a==b.source) outgoing[b.target]=n; //SAH + else if (a==b.target) incoming[b.source]=n; //SAH + if (a == b.source || a == b.target) sigInst.neighbors[a == b.target ? b.source : b.target] = n; + b.hidden = !1, b.attr.color = "rgba(0, 0, 0, 1)"; + }); + var f = []; + sigInst.iterNodes(function (a) { + a.hidden = !0; + a.attr.lineWidth = !1; + a.attr.color = a.color + }); + + if (groupByDirection) { + //SAH - Compute intersection for mutual and remove these from incoming/outgoing + for (e in outgoing) { + //name=outgoing[e]; + if (e in incoming) { + mutual[e]=outgoing[e]; + delete incoming[e]; + delete outgoing[e]; + } + } + } + + var createList=function(c) { + var f = []; + var e = [], + //c = sigInst.neighbors, + g; + for (g in c) { + var d = sigInst._core.graph.nodesIndex[g]; + d.hidden = !1; + d.attr.lineWidth = !1; + d.attr.color = c[g].colour; + a != g && e.push({ + id: g, + name: d.label, + group: (c[g].name)? c[g].name:"", + colour: c[g].colour + }) + } + e.sort(function (a, b) { + var c = a.group.toLowerCase(), + d = b.group.toLowerCase(), + e = a.name.toLowerCase(), + f = b.name.toLowerCase(); + return c != d ? c < d ? -1 : c > d ? 1 : 0 : e < f ? -1 : e > f ? 1 : 0 + }); + d = ""; + for (g in e) { + c = e[g]; + /*if (c.group != d) { + d = c.group; + f.push('
  • ' + d + "
  • "); + }*/ + f.push('
  • ' + c.name + "
  • "); + } + return f; + } + + /*console.log("mutual:"); + console.log(mutual); + console.log("incoming:"); + console.log(incoming); + console.log("outgoing:"); + console.log(outgoing);*/ + + + var f=[]; + + //console.log("neighbors:"); + //console.log(sigInst.neighbors); + + if (groupByDirection) { + size=Object.size(mutual); + f.push("

    Mututal (" + size + ")

    "); + (size>0)? f=f.concat(createList(mutual)) : f.push("No mutual links
    "); + size=Object.size(incoming); + f.push("

    Incoming (" + size + ")

    "); + (size>0)? f=f.concat(createList(incoming)) : f.push("No incoming links
    "); + size=Object.size(outgoing); + f.push("

    Outgoing (" + size + ")

    "); + (size>0)? f=f.concat(createList(outgoing)) : f.push("No outgoing links
    "); + } else { + f=f.concat(createList(sigInst.neighbors)); + } + //b is object of active node -- SAH + b.hidden = !1; + b.attr.color = b.color; + b.attr.lineWidth = 6; + b.attr.strokeStyle = "#000000"; + sigInst.draw(2, 2, 2, 2); + + $GP.info_link.find("ul").html(f.join("")); + $GP.info_link.find("li").each(function () { + var a = $(this), + b = a.attr("rel"); + }); + f = b.attr; + if (f.attributes) { + var image_attribute = false; + if (config.informationPanel.imageAttribute) { + image_attribute=config.informationPanel.imageAttribute; + } + e = []; + temp_array = []; + g = 0; + for (var attr in f.attributes) { + var d = f.attributes[attr], + h = ""; + if (attr!=image_attribute) { + h = '' + attr + ': ' + d + '
    ' + } + //temp_array.push(f.attributes[g].attr); + e.push(h) + } + + if (image_attribute) { + //image_index = jQuery.inArray(image_attribute, temp_array); + $GP.info_name.html("
    ' + b.label + "
    "); + } else { + $GP.info_name.html("
    ' + b.label + "
    "); + } + // Image field for attribute pane + $GP.info_data.html(e.join("
    ")) + } + $GP.info_data.show(); + $GP.info_p.html("Connections:"); + $GP.info.animate({width:'show'},350); + $GP.info_donnees.hide(); + $GP.info_donnees.show(); + sigInst.active = a; + window.location.hash = b.label; +} + +function showCluster(a) { + var b = sigInst.clusters[a]; + if (b && 0 < b.length) { + showGroups(!1); + sigInst.detail = !0; + b.sort(); + sigInst.iterEdges(function (a) { + a.hidden = !1; + a.attr.lineWidth = !1; + a.attr.color = !1 + }); + sigInst.iterNodes(function (a) { + a.hidden = !0 + }); + for (var f = [], e = [], c = 0, g = b.length; c < g; c++) { + var d = sigInst._core.graph.nodesIndex[b[c]]; + !0 == d.hidden && (e.push(b[c]), d.hidden = !1, d.attr.lineWidth = !1, d.attr.color = d.color, f.push('
  • ' + d.label + "
  • ")) + } + sigInst.clusters[a] = e; + sigInst.draw(2, 2, 2, 2); + $GP.info_name.html("" + a + ""); + $GP.info_data.hide(); + $GP.info_p.html("Group Members:"); + $GP.info_link.find("ul").html(f.join("")); + $GP.info.animate({width:'show'},350); + $GP.search.clean(); + $GP.cluster.hide(); + return !0 + } + return !1 +} + + diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/_sigma.min.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/_sigma.min.js new file mode 100644 index 0000000000..d1befd7dcb --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/_sigma.min.js @@ -0,0 +1,64 @@ +/* sigmajs.org - an open-source light-weight JavaScript graph drawing library - Version: 0.1 - Author: Alexis Jacomy - License: MIT */ +var sigma={tools:{},classes:{},instances:{}}; +(function(){Array.prototype.some||(Array.prototype.some=function(g,i){var k=this.length;if("function"!=typeof g)throw new TypeError;for(var m=0;m";a+="

    LOCAL :

    ";for(b in c.p.localProbes)a+="

    "+b+" : "+c.p.localProbes[b]()+"

    ";c.p.dom.innerHTML=a;return c}sigma.classes.Cascade.call(this);var c=this;this.instance=b;this.monitoring=!1;this.p={fps:40,dom:j,globalProbes:{"Time (ms)":sigma.chronos.getExecutionTime,Queue:sigma.chronos.getQueuedTasksCount,Tasks:sigma.chronos.getTasksCount,FPS:sigma.chronos.getFPS},localProbes:{"Nodes count":function(){return c.instance.graph.nodes.length},"Edges count":function(){return c.instance.graph.edges.length}}}; +this.activate=function(){c.monitoring||(c.monitoring=window.setInterval(f,1E3/c.p.fps));return c};this.desactivate=function(){c.monitoring&&(window.clearInterval(c.monitoring),c.monitoring=null,c.p.dom.innerHTML="");return c}}function g(b){var j=b.changedTouches[0],f="";switch(b.type){case "touchstart":f="mousedown";break;case "touchmove":f="mousemove";break;case "touchend":f="mouseup";break;default:return}var c=document.createEvent("MouseEvent");c.initMouseEvent(f,!0,!0,window,1,j.posX,j.posY,j.clientX, +j.clientY,!1,!1,!1,!1,0,null);j.target.dispatchEvent(c);b.preventDefault()}function p(b){function j(b){a.p.mouseEnabled&&(f(a.mouseX,a.mouseY,a.ratio*(0<(void 0!=b.wheelDelta&&b.wheelDelta||void 0!=b.detail&&-b.detail)?a.p.zoomMultiply:1/a.p.zoomMultiply)),a.p.blockScroll&&(b.preventDefault?b.preventDefault():b.returnValue=!1))}function f(b,d,f){if(!a.isMouseDown&&(window.clearInterval(a.interpolationID),m=void 0!=f,w=a.stageX,n=b,o=a.stageY,l=d,h=f||a.ratio,h=Math.min(Math.max(h,a.p.minRatio),a.p.maxRatio), +u=a.p.directZooming?1-(m?a.p.zoomDelta:a.p.dragDelta):0,a.ratio!=h||a.stageX!=n||a.stageY!=l))c(),a.interpolationID=window.setInterval(c,50),a.dispatch("startinterpolate")}function c(){u+=m?a.p.zoomDelta:a.p.dragDelta;u=Math.min(u,1);var b=sigma.easing.quadratic.easeout(u),c=a.ratio;a.ratio=c*(1-b)+h*b;m?(a.stageX=n+(a.stageX-n)*a.ratio/c,a.stageY=l+(a.stageY-l)*a.ratio/c):(a.stageX=w*(1-b)+n*b,a.stageY=o*(1-b)+l*b);a.dispatch("interpolate");1<=u&&(window.clearInterval(a.interpolationID),b=a.ratio, +m?(a.ratio=h,a.stageX=n+(a.stageX-n)*a.ratio/b,a.stageY=l+(a.stageY-l)*a.ratio/b):(a.stageX=n,a.stageY=l),a.dispatch("stopinterpolate"))}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var a=this;this.p={minRatio:1,maxRatio:32,marginRatio:1,zoomDelta:0.1,dragDelta:0.3,zoomMultiply:2,directZooming:!1,blockScroll:!0,inertia:1.1,mouseEnabled:!0,touchEnabled:!0};var i=0,d=0,w=0,o=0,h=1,n=0,l=0,s=0,t=0,A=0,k=0,u=0,m=!1;this.stageY=this.stageX=0;this.ratio=1;this.mouseY=this.mouseX= +0;this.isTouchDown=this.isMouseDown=!1;b.addEventListener("DOMMouseScroll",j,!0);b.addEventListener("mousewheel",j,!0);b.addEventListener("mousemove",function(b){a.mouseX=void 0!=b.offsetX&&b.offsetX||void 0!=b.layerX&&b.layerX||void 0!=b.clientX&&b.clientX;a.mouseY=void 0!=b.offsetY&&b.offsetY||void 0!=b.layerY&&b.layerY||void 0!=b.clientY&&b.clientY;if(a.isMouseDown){var c=a.mouseX-i+w,h=a.mouseY-d+o;if(c!=a.stageX||h!=a.stageY)t=s,k=A,s=c,A=h,a.stageX=c,a.stageY=h,a.dispatch("drag")}a.dispatch("move"); +b.preventDefault?b.preventDefault():b.returnValue=!1},!0);b.addEventListener("mousedown",function(b){a.p.mouseEnabled&&(a.isMouseDown=!0,a.dispatch("mousedown"),w=a.stageX,o=a.stageY,i=a.mouseX,d=a.mouseY,t=s=a.stageX,k=A=a.stageY,a.dispatch("startdrag"),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);document.addEventListener("mouseup",function(b){a.p.mouseEnabled&&a.isMouseDown&&(a.isMouseDown=!1,a.dispatch("mouseup"),(w!=a.stageX||o!=a.stageY)&&f(a.stageX+a.p.inertia*(a.stageX-t),a.stageY+ +a.p.inertia*(a.stageY-k)),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);b.addEventListener("touchstart",g,!0);b.addEventListener("touchmove",g,!0);document.addEventListener("touchend",g,!0);b.addEventListener("touchcancel",g,!0);this.checkBorders=function(){return a};this.interpolate=f}function z(b,j,f,c,a,g,d){function i(a){var b=c,d="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*a.displaySize;b.font=(h.p.hoverFontStyle||h.p.fontStyle||"")+" "+d+"px "+(h.p.hoverFont|| +h.p.font||"");b.fillStyle="node"==h.p.labelHoverBGColor?a.color||h.p.defaultNodeColor:h.p.defaultHoverLabelBGColor;b.beginPath();h.p.labelHoverShadow&&(b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=4,b.shadowColor=h.p.labelHoverShadowColor);sigma.tools.drawRoundRect(b,Math.round(a.displayX-d/2-2),Math.round(a.displayY-d/2-2),Math.round(b.measureText(a.label).width+1.5*a.displaySize+d/2+4),Math.round(d+4),Math.round(d/2+2),"left");b.closePath();b.fill();b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur= +0;b.beginPath();b.fillStyle="node"==h.p.nodeBorderColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeBorderColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize+h.p.borderSize,0,2*Math.PI,!0);b.closePath();b.fill();b.beginPath();b.fillStyle="node"==h.p.nodeHoverColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeHoverColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize,0,2*Math.PI,!0);b.closePath();b.fill();b.fillStyle="node"==h.p.labelHoverColor?a.color||h.p.defaultNodeColor: +h.p.defaultLabelHoverColor;b.fillText(a.label,Math.round(a.displayX+1.5*a.displaySize),Math.round(a.displayY+d/2-3));return h}function o(a){if(isNaN(a.x)||isNaN(a.y))throw Error("A node's coordinate is not a number (id: "+a.id+")");return!a.hidden&&a.displayX+a.displaySize>-n/3&&a.displayX-a.displaySize<4*n/3&&a.displayY+a.displaySize>-l/3&&a.displayY-a.displaySize<4*l/3}sigma.classes.Cascade.call(this);var h=this;this.p={labelColor:"default",defaultLabelColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff", +labelHoverShadow:!0,labelHoverShadowColor:"#000",labelHoverColor:"default",defaultLabelHoverColor:"#000",labelActiveBGColor:"default",defaultActiveLabelBGColor:"#fff",labelActiveShadow:!0,labelActiveShadowColor:"#000",labelActiveColor:"default",defaultLabelActiveColor:"#000",labelSize:"fixed",defaultLabelSize:12,labelSizeRatio:2,labelThreshold:6,font:"Arial",hoverFont:"",activeFont:"",fontStyle:"",hoverFontStyle:"",activeFontStyle:"",edgeColor:"source",defaultEdgeColor:"#aaa",defaultEdgeType:"line", +defaultNodeColor:"#aaa",nodeHoverColor:"node",defaultNodeHoverColor:"#fff",nodeActiveColor:"node",defaultNodeActiveColor:"#fff",borderSize:0,nodeBorderColor:"node",defaultNodeBorderColor:"#fff",edgesSpeed:200,nodesSpeed:200,labelsSpeed:200};var n=g,l=d;this.currentLabelIndex=this.currentNodeIndex=this.currentEdgeIndex=0;this.task_drawLabel=function(){for(var b=a.nodes.length,c=0;c++=h.p.labelThreshold||d.forceLabel){var g="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*d.displaySize;j.font=h.p.fontStyle+g+"px "+h.p.font;j.fillStyle="node"==h.p.labelColor?d.color||h.p.defaultNodeColor:h.p.defaultLabelColor;j.fillText(d.label,Math.round(d.displayX+1.5*d.displaySize),Math.round(d.displayY+g/2-3))}}else h.currentLabelIndex++;return h.currentLabelIndex(b*=2)?0.5*b*b:-0.5*(--b*(b-2)-1)};sigma.tools.drawRoundRect=function(b,g,f,c,a,i,d){var i=i?i:0,k=d?d:[],k="string"==typeof k?k.split(" "):k,d=i&&(0<=k.indexOf("topleft")||0<=k.indexOf("top")||0<=k.indexOf("left")),m=i&&(0<=k.indexOf("topright")|| +0<=k.indexOf("top")||0<=k.indexOf("right")),h=i&&(0<=k.indexOf("bottomleft")||0<=k.indexOf("bottom")||0<=k.indexOf("left")),k=i&&(0<=k.indexOf("bottomright")||0<=k.indexOf("bottom")||0<=k.indexOf("right"));b.moveTo(g,f+i);d?b.arcTo(g,f,g+i,f,i):b.lineTo(g,f);m?(b.lineTo(g+c-i,f),b.arcTo(g+c,f,g+c,f+i,i)):b.lineTo(g+c,f);k?(b.lineTo(g+c,f+a-i),b.arcTo(g+c,f+a,g+c-i,f+a,i)):b.lineTo(g+c,f+a);h?(b.lineTo(g+i,f+a),b.arcTo(g,f+a,g,f+a-i,i)):b.lineTo(g,f+a);b.lineTo(g,f+i)};sigma.tools.getRGB=function(b, +g){var b=b.toString(),f={r:0,g:0,b:0};if(3<=b.length&&"#"==b.charAt(0)){var c=b.length-1;6==c?f={r:parseInt(b.charAt(1)+b.charAt(2),16),g:parseInt(b.charAt(3)+b.charAt(4),16),b:parseInt(b.charAt(5)+b.charAt(5),16)}:3==c&&(f={r:parseInt(b.charAt(1)+b.charAt(1),16),g:parseInt(b.charAt(2)+b.charAt(2),16),b:parseInt(b.charAt(3)+b.charAt(3),16)})}g&&(f=[f.r,f.g,f.b]);return f};sigma.tools.rgbToHex=function(b,g,f){return sigma.tools.toHex(b)+sigma.tools.toHex(g)+sigma.tools.toHex(f)};sigma.tools.toHex= +function(b){b=parseInt(b,10);if(isNaN(b))return"00";b=Math.max(0,Math.min(b,255));return"0123456789ABCDEF".charAt((b-b%16)/16)+"0123456789ABCDEF".charAt(b%16)};sigma.publicPrototype=x.prototype})(); diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/parseGexf_fin.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/parseGexf_fin.js new file mode 100644 index 0000000000..9475495f5d --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/parseGexf_fin.js @@ -0,0 +1,170 @@ +// Mathieu Jacomy @ Sciences Po MĂŠdialab & WebAtlas +// (requires sigma.js to be loaded) +sigma.publicPrototype.parseGexf = function(gexfPath) { + // Load XML file: + var gexfhttp, gexf; + var sigmaInstance = this; + gexfhttp = window.XMLHttpRequest ? + new XMLHttpRequest() : + new ActiveXObject('Microsoft.XMLHTTP'); + + gexfhttp.overrideMimeType('text/xml'); + gexfhttp.open('GET', gexfPath, false); + gexfhttp.send(); + gexf = gexfhttp.responseXML; + + var viz='http://www.gexf.net/1.2draft/viz'; // Vis namespace + var i, j, k; + + // Parse Attributes + // This is confusing, so I'll comment heavily + var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json + var nodesAttributesDict = {}; + var edgesAttributes = []; // The list of attributes of the edges of the graph that we build in json + var edgesAttributesDict = {}; + var attributesNodes = gexf.getElementsByTagName('attributes'); // In the gexf (that is an xml), the list of xml nodes 'attributes' (note the plural 's') + + for(i = 0; i0){ + sizeNode = sizeNodes[0]; + size = parseFloat(sizeNode.getAttribute('value')); + } + + var positionNodes = nodeNode.getElementsByTagName('position'); + positionNodes = positionNodes.length ? + positionNodes : + nodeNode.getElementsByTagNameNS('*','position'); + if(positionNodes.length>0){ + var positionNode = positionNodes[0]; + x = parseFloat(positionNode.getAttribute('x')); + y = parseFloat(positionNode.getAttribute('y')); + } + + var colorNodes = nodeNode.getElementsByTagName('color'); + colorNodes = colorNodes.length ? + colorNodes : + nodeNode.getElementsByTagNameNS('*','color'); + if(colorNodes.length>0){ + colorNode = colorNodes[0]; + color = '#'+sigma.tools.rgbToHex(parseFloat(colorNode.getAttribute('r')), + parseFloat(colorNode.getAttribute('g')), + parseFloat(colorNode.getAttribute('b'))); + } + + // Create Node + var node = {label:label, size:size, x:x, y:y, attributes:{}, color:color}; // The graph node + + // Attribute values + var attvalueNodes = nodeNode.getElementsByTagName('attvalue'); + for(k=0; k"; + b += "

    LOCAL :

    "; + for (h in c.p.localProbes) b += "

    " + h + " : " + c.p.localProbes[h]() + "

    "; + c.p.dom.innerHTML = b; + return c + } + sigma.classes.Cascade.call(this); + var c = this; + this.instance = b; + this.monitoring = !1; + this.p = { + fps: 40, + dom: i, + globalProbes: { + "Time (ms)": sigma.chronos.getExecutionTime, + Queue: sigma.chronos.getQueuedTasksCount, + Tasks: sigma.chronos.getTasksCount, + FPS: sigma.chronos.getFPS + }, + localProbes: { + "Nodes count": function () { + return c.instance.graph.nodes.length + }, + "Edges count": function () { + return c.instance.graph.edges.length + } + } + }; + this.activate = function () { + c.monitoring || (c.monitoring = window.setInterval(h, 1E3 / c.p.fps)); + return c + }; + this.desactivate = function () { + c.monitoring && (window.clearInterval(c.monitoring), c.monitoring = null, c.p.dom.innerHTML = ""); + return c + } + } + function k(b) { + function i(a) { + f.mouseX = void 0 != a.offsetX && a.offsetX || void 0 != a.layerX && a.layerX || void 0 != a.clientX && a.clientX; + f.mouseY = void 0 != a.offsetY && a.offsetY || void 0 != a.layerY && a.layerY || void 0 != a.clientY && a.clientY; + if (f.isMouseDown) { + var b = f.mouseX - k + m, + c = f.mouseY - l + j; + if (b != f.stageX || c != f.stageY) w = A, x = u, A = b, u = c, f.stageX = b, f.stageY = c, f.dispatch("drag") + } + f.dispatch("move"); + a.preventDefault ? a.preventDefault() : a.returnValue = !1 + } + function h(a) { + f.p.mouseEnabled && f.isMouseDown && (f.isMouseDown = !1, f.dispatch("mouseup"), (m != f.stageX || j != f.stageY) && g(f.stageX + f.p.inertia * (f.stageX - w), f.stageY + f.p.inertia * (f.stageY - x)), a.preventDefault ? a.preventDefault() : a.returnValue = !1) + } + function c(a) { + f.p.mouseEnabled && (f.isMouseDown = !0, f.dispatch("mousedown"), m = f.stageX, j = f.stageY, k = f.mouseX, l = f.mouseY, w = A = f.stageX, x = u = f.stageY, f.dispatch("startdrag"), a.preventDefault ? a.preventDefault() : a.returnValue = !1) + } + function d(a) { + f.p.mouseEnabled && (g(f.mouseX, f.mouseY, f.ratio * (0 < (void 0 != a.wheelDelta && a.wheelDelta || void 0 != a.detail && -a.detail) ? f.p.zoomMultiply : 1 / f.p.zoomMultiply)), f.p.blockScroll && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)) + } + function g(b, c, d) { + if (!f.isMouseDown && (window.clearInterval(f.interpolationID), p = void 0 != d, m = f.stageX, y = b, j = f.stageY, q = c, n = d || f.ratio, n = Math.min(Math.max(n, f.p.minRatio), f.p.maxRatio), B = f.p.directZooming ? 1 - (p ? f.p.zoomDelta : f.p.dragDelta) : 0, f.ratio != n || f.stageX != y || f.stageY != q)) a(), f.interpolationID = window.setInterval(a, 50), f.dispatch("startinterpolate") + } + function a() { + B += p ? f.p.zoomDelta : f.p.dragDelta; + B = Math.min(B, 1); + var a = sigma.easing.quadratic.easeout(B), + b = f.ratio; + f.ratio = b * (1 - a) + n * a; + p ? (f.stageX = y + (f.stageX - y) * f.ratio / b, f.stageY = q + (f.stageY - q) * f.ratio / b) : (f.stageX = m * (1 - a) + y * a, f.stageY = j * (1 - a) + q * a); + f.dispatch("interpolate"); + 1 <= B && (window.clearInterval(f.interpolationID), a = f.ratio, p ? (f.ratio = n, f.stageX = y + (f.stageX - y) * f.ratio / a, f.stageY = q + (f.stageY - q) * f.ratio / a) : (f.stageX = y, f.stageY = q), f.dispatch("stopinterpolate")) + } + sigma.classes.Cascade.call(this); + sigma.classes.EventDispatcher.call(this); + var f = this; + this.p = { + minRatio: 1, + maxRatio: 32, + marginRatio: 1, + zoomDelta: 0.1, + dragDelta: 0.3, + zoomMultiply: 2, + directZooming: !1, + blockScroll: !0, + inertia: 1.1, + mouseEnabled: !0 + }; + var k = 0, + l = 0, + m = 0, + j = 0, + n = 1, + y = 0, + q = 0, + A = 0, + w = 0, + u = 0, + x = 0, + B = 0, + p = !1; + this.stageY = this.stageX = 0; + this.ratio = 1; + this.mouseY = this.mouseX = 0; + this.isMouseDown = !1; + b.addEventListener && document.addEventListener ? (b.addEventListener("DOMMouseScroll", d, !0), b.addEventListener("mousewheel", d, !0), b.addEventListener("mousemove", i, !0), b.addEventListener("mousedown", c, !0), document.addEventListener("mouseup", h, !0)) : (b.attachEvent("onDOMMouseScroll", d), b.attachEvent("onmousewheel", d), b.attachEvent("onmousemove", i), b.attachEvent("onmousedown", c), document.attachEvent("onmouseup", h)); + this.checkBorders = function () { + return f + }; + this.interpolate = g + } + function o(b, i, h, c, d, g, a, f, k) { + function l(a) { + var b = c, + d = Math.round, + f = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * a.displaySize; + b.font = (j.p.hoverFontStyle || j.p.fontStyle || "") + " " + f + "px " + (j.p.hoverFont || j.p.font || ""); + b.fillStyle = "node" == j.p.labelHoverBGColor ? a.color || j.p.defaultNodeColor : j.p.defaultHoverLabelBGColor; + j.p.labelHoverShadow && (b.shadowOffsetX = 0, b.shadowOffsetY = 0, b.shadowBlur = 4, b.shadowColor = j.p.labelHoverShadowColor); + var h = d(a.displayX + 10), + g = d(a.displayY - f / 2 - 2), + i = d(b.measureText(a.label).width + 6), + m = d(f + 4); + d(f / 2 + 2); + b.fillRect(h, g, i, m); + b.shadowOffsetX = 0; + b.shadowOffsetY = 0; + b.shadowBlur = 0; + b.fillStyle = "node" == j.p.labelHoverColor ? a.color || j.p.defaultNodeColor : j.p.defaultLabelHoverColor; + b.fillText(a.label, h + 4, g + m - 3); + return j + } + function m(a) { + if (isNaN(a.x) || isNaN(a.y)) throw Error("A node's coordinate is not a number (id: " + a.id + ")"); + return !a.hidden && a.displayX + a.displaySize > -n / 3 && a.displayX - a.displaySize < 4 * n / 3 && a.displayY + a.displaySize > -y / 3 && a.displayY - a.displaySize < 4 * y / 3 + } + sigma.classes.Cascade.call(this); + var j = this; + this.contexts = { + node: b, + edge: i, + label: h, + hover: c, + bg: d, + bg2: g + }; + this.p = { + labelColor: "default", + defaultLabelColor: "#fff", + labelHoverBGColor: "default", + defaultHoverLabelBGColor: "#fff", + labelHoverShadow: !0, + labelHoverShadowColor: "#000", + labelHoverColor: "default", + defaultLabelHoverColor: "#000", + labelActiveBGColor: "default", + defaultActiveLabelBGColor: "#fff", + labelActiveShadow: !0, + labelActiveShadowColor: "#000", + labelActiveColor: "default", + defaultLabelActiveColor: "#000", + labelSize: "fixed", + defaultLabelSize: 12, + labelSizeRatio: 2, + labelThreshold: 6, + font: "Arial", + hoverFont: "", + activeFont: "", + fontStyle: "", + hoverFontStyle: "", + activeFontStyle: "", + edgeColor: "source", + defaultEdgeColor: "#aaa", + defaultEdgeType: "line", + defaultNodeColor: "#aaa", + nodeHoverColor: "node", + defaultNodeHoverColor: "#fff", + nodeActiveColor: "node", + defaultNodeActiveColor: "#fff", + borderSize: 0, + nodeBorderColor: "node", + defaultNodeBorderColor: "#fff", + edgesSpeed: 200, + nodesSpeed: 200, + nodesBGSpeed: 200, + labelsSpeed: 200 + }; + var n = f, + y = k; + this.currentBGIndex = this.currentLabelIndex = this.currentBGIndex = this.currentNodeIndex = this.currentEdgeIndex = 0; + this.task_drawLabel = function () { + for (var b = a.nodes.length, c = 0; c++ < j.p.labelsSpeed && j.currentLabelIndex < b;) if (j.isOnScreen(a.nodes[j.currentLabelIndex])) { + var d = a.nodes[j.currentLabelIndex++], + f = h; + if (d.displaySize >= j.p.labelThreshold) { + var g = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * d.displaySize; + f.font = (j.p.hoverFontStyle || j.p.fontStyle || "") + " " + g + "px " + (j.p.hoverFont || j.p.font || ""); + var i = Math.round, + m = i(d.displayX + 10), + l = i(d.displayY + g / 2 - 2), + k = i(f.measureText(d.label).width + 6), + v = i(g + 4); + i(g / 2 + 2); + f.font = j.p.fontStyle + g + "px " + j.p.font; + f.fillStyle = "#258EA4"; + f.fillRect(m, l - v + 3, k, v); + f.fillStyle = "#fff"; + f.fillText(d.label, m + 4, l) + } + } else j.currentLabelIndex++; + return j.currentLabelIndex < b + }; + this.task_drawEdge = function () { + for (var b = a.edges.length, c, d, f = 0, h; f++ < j.p.edgesSpeed && j.currentEdgeIndex < b;) if (h = a.edges[j.currentEdgeIndex], c = h.source, d = h.target, h.hidden || c.hidden || d.hidden || !j.isOnScreen(c) && !j.isOnScreen(d)) j.currentEdgeIndex++; + else { + c = a.edges[j.currentEdgeIndex++]; + d = c.source.displayX; + h = c.source.displayY; + var g = c.target.displayX, + m = c.target.displayY, + l = void 0; + // l = c.attr.color ? c.attr.color : "rgba(255, 0, 0, .6)"; + if (!l) switch (j.p.edgeColor) { + case "source": + l = c.source.color || j.p.defaultNodeColor; + break; + case "target": + l = c.target.color || j.p.defaultNodeColor; + break; + default: + l = j.p.defaultEdgeColor + } + var k = i; + k.strokeStyle = l; + k.lineWidth = c.attr.lineWidth ? c.attr.lineWidth : 0.2; + switch (c.type || j.p.defaultEdgeType) { + case "curve": + k.beginPath(); + k.moveTo(d, h); + k.quadraticCurveTo((d + g) / 2 + (m - h) / 4, (h + m) / 2 + (d - g) / 4, g, m); + k.stroke(); + break; + default: + k.beginPath(), k.moveTo(d, h), k.lineTo(g, m), k.stroke() + } + } + return j.currentEdgeIndex < b + }; + this.task_drawNode = function () { + for (var b = a.nodes.length, c = 0; c++ < j.p.nodesSpeed && j.currentNodeIndex < b;) j.isOnScreen(a.nodes[j.currentNodeIndex]) ? j.drawNode(a.nodes[j.currentNodeIndex++]) : j.currentNodeIndex++; + return j.currentNodeIndex < b + }; + this.task_drawBG = function () { + for (var b = a.nodesBG.length, c = 0; c++ < j.p.nodesBGSpeed && j.currentBGIndex < b;) j.drawBG(a.nodesBG[j.currentBGIndex++]); + return j.currentBGIndex < b + }; + this.drawBG = function (a) { + var b = Math, + c = b.round(10 * a.displaySize) / 10, + f = a.displayX, + h = a.displayY; + d.fillStyle = "#fff"; + d.beginPath(); + d.arc(f, h, c, 0, 2 * b.PI, !0); + d.closePath(); + d.fill(); + var g = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * a.displaySize, + b = b.round, + i, m, l; + i = d.measureText(a.label).width; + l = c * a.attr.deltaX / 100; + var k = c * a.attr.deltaY / 100; + switch (a.attr.position) { + default: c = b(f - l - c - i - 13); + l = b(h + k); + i = c; + m = l - 3; + f = b(f); + h = b(h + k); + break; + case "right": + c = b(f + l + a.displaySize + 8 + i), l = b(h + k), i = c - i, m = l - 3, f = b(f), h = b(h + k) + } + d.font = g + "px sans-serif"; + d.fillStyle = "#fff"; + d.fillText(a.label, i, m); + d.strokeStyle = "#fff"; + d.lineWidth = 0.7; + d.save(); + d.moveTo(c, l); + d.lineTo(f, h); + d.stroke(); + d.restore(); + return j + }; + this.drawNode = function (a) { + var c = Math.round(10 * a.displaySize) / 10; + b.fillStyle = a.attr.color ? a.attr.color : "#ff0000"; + b.strokeStyle = a.attr.strokeStyle ? a.attr.strokeStyle : "#000"; + a.attr.lineWidth && (b.lineWidth = a.attr.lineWidth); + var d = 2 * Math.PI; + 1 > c && (c = 1); + var f = a.displayX, + h = a.displayY, + i = 9 * c; + // m = b.createRadialGradient(f, h, i - 7, f, h, i); + // m.addColorStop(0, "#ff0000"); + // m.addColorStop(1, "rgba(255, 255, 255, 0)"); + //g.fillStyle = m; + b.beginPath(); + b.arc(f, h, 1.4 * c, 0, d, !0); + b.closePath(); + a.attr.lineWidth && b.stroke(); + b.fill(); + a.hover && l(a); + return j + }; + this.getCtx = function (a) { + return j.contexts[a] ? j.contexts[a] : !1 + }; + this.drawActiveNode = function (a) { + var b = c; + if (!m(a)) return j; + var d = "fixed" == j.p.labelSize ? j.p.defaultLabelSize : j.p.labelSizeRatio * a.displaySize; + b.font = (j.p.activeFontStyle || j.p.fontStyle || "") + " " + d + "px " + (j.p.activeFont || j.p.font || ""); + b.fillStyle = "node" == j.p.labelHoverBGColor ? a.color || j.p.defaultNodeColor : j.p.defaultActiveLabelBGColor; + b.beginPath(); + j.p.labelActiveShadow && (b.shadowOffsetX = 0, b.shadowOffsetY = 0, b.shadowBlur = 4, b.shadowColor = j.p.labelActiveShadowColor); + sigma.tools.drawRoundRect(b, Math.round(a.displayX - d / 2 - 2), Math.round(a.displayY - d / 2 - 2), Math.round(b.measureText(a.label).width + 1.5 * a.displaySize + d / 2 + 4), Math.round(d + 4), Math.round(d / 2 + 2), "left"); + b.closePath(); + b.fill(); + b.shadowOffsetX = 0; + b.shadowOffsetY = 0; + b.shadowBlur = 0; + b.beginPath(); + b.fillStyle = "node" == j.p.nodeBorderColor ? a.color || j.p.defaultNodeColor : j.p.defaultNodeBorderColor; + b.arc(Math.round(a.displayX), Math.round(a.displayY), a.displaySize + j.p.borderSize, 0, 2 * Math.PI, !0); + b.closePath(); + b.fill(); + b.beginPath(); + b.fillStyle = "node" == j.p.nodeActiveColor ? a.color || j.p.defaultNodeColor : j.p.defaultNodeActiveColor; + b.arc(Math.round(a.displayX), Math.round(a.displayY), a.displaySize, 0, 2 * Math.PI, !0); + b.closePath(); + b.fill(); + b.fillStyle = "node" == j.p.labelActiveColor ? a.color || j.p.defaultNodeColor : j.p.defaultLabelActiveColor; + b.fillText(a.label, Math.round(a.displayX + 1.5 * a.displaySize), Math.round(a.displayY + d / 2 - 3)); + return j + }; + this.drawHoverNode = l; + this.isOnScreen = m; + this.resize = function (a, b) { + n = a; + y = b; + return j + } + } + function t(b, v) { + function h() { + sigma.chronos.removeTask("node_" + a.id, 2).removeTask("edge_" + a.id, 2).removeTask("label_" + a.id, 2).stopTasks(); + return a + } + function c(b, c) { + var d = document.createElement(c); + d.style.position = "absolute"; + d.setAttribute("id", "sigma_" + b + "_" + a.id); + d.setAttribute("class", "sigma_" + b + "_" + c); + d.setAttribute("width", a.width); + d.setAttribute("height", a.height); + a.domRoot.appendChild(d); + "undefined" != typeof G_vmlCanvasManager && "canvas" == c && (d = G_vmlCanvasManager.initElement(d)); + a.domElements[b] = d; + d.getContext && (a.contexts[b] = d.getContext("2d")); + return a + } + + function d() { + a.p.drawHoverNodes && (a.graph.checkHover(a.mousecaptor.mouseX, a.mousecaptor.mouseY), a.domElements.mouse.style.cursor = "default", a.graph.nodes.forEach(function (b) { + b.hover && !b.active && (a.domElements.mouse.style.cursor = "pointer", a.plotter.drawHoverNode(b)) + })); + return a + } + function s() { + a.p.drawActiveNodes && a.graph.nodes.forEach(function (b) { + b.active && a.plotter.drawActiveNode(b) + }); + return a + } + sigma.classes.Cascade.call(this); + sigma.classes.EventDispatcher.call(this); + var a = this; + this.id = v.toString(); + this.p = { + auto: !0, + drawNodes: 2, + drawEdges: 1, + drawLabels: 2, + drawBG: 2, + lastNodes: 2, + lastEdges: 0, + lastLabels: 2, + lastBG: 2, + drawHoverNodes: !0, + drawActiveNodes: !0 + }; + this.domRoot = b; + this.width = this.domRoot.offsetWidth; + this.height = this.domRoot.offsetHeight; + this.graph = new n; + this.domElements = {}; + this.contexts = {}; + c("bg", "canvas"); + c("bg2", "canvas"); + c("edges", "canvas"); + c("nodes", "canvas"); + c("labels", "canvas"); + c("hover", "canvas"); + c("monitor", "div"); + c("mouse", "canvas"); + this.plotter = new o(this.contexts.nodes, this.contexts.edges, this.contexts.labels, this.contexts.hover, this.contexts.bg, this.contexts.bg2, this.graph, this.width, this.height); + this.monitor = new i(this, this.domElements.monitor); + this.mousecaptor = new k(this.domElements.mouse, this.id); + this.mousecaptor.bind("drag interpolate", function () { + a.draw(a.p.auto ? 2 : a.p.drawNodes, a.p.auto ? 0 : a.p.drawEdges, a.p.auto ? 2 : a.p.drawLabels, a.p.auto ? 2 : a.p.drawBG, !0) + }).bind("stopdrag stopinterpolate", function () { + a.draw(a.p.auto ? 2 : a.p.drawNodes, a.p.auto ? 1 : a.p.drawEdges, a.p.auto ? 2 : a.p.drawLabels, a.p.auto ? 2 : a.p.drawBG, !0) + }).bind("mousedown mouseup", function (b) { + var c = a.graph.nodes.filter(function (a) { + return !!a.hover + }).map(function (a) { + return a.id + }); + a.dispatch("mousedown" == b.type ? "downgraph" : "upgraph"); + c.length && a.dispatch("mousedown" == b.type ? "downnodes" : "upnodes", c) + }).bind("move", function () { + a.contexts.hover.clearRect(0, 0, a.domElements.hover.width, a.domElements.hover.height); + d(); + s() + }); + sigma.chronos.bind("startgenerators", function () { + sigma.chronos.getGeneratorsIDs().some(function (b) { + return !!b.match(RegExp("_ext_" + a.id + "$", "")) + }) && a.draw(a.p.auto ? 2 : a.p.drawNodes, a.p.auto ? 0 : a.p.drawEdges, a.p.auto ? 2 : a.p.drawLabels) + }).bind("stopgenerators", function () { + a.draw() + }); + for (var f = 0; f < g.length; f++) g[f](this); + this.draw = function (b, c, d, f, i) { + if (i && sigma.chronos.getGeneratorsIDs().some(function (b) { + return !!b.match(RegExp("_ext_" + a.id + "$", "")) + })) return a; + b = void 0 == b ? a.p.drawNodes : b; + c = void 0 == c ? a.p.drawEdges : c; + d = void 0 == d ? a.p.drawLabels : d; + f = void 0 == f ? a.p.drawBG : f; + i = { + nodes: b, + edges: c, + labels: d, + bg: f + }; + a.p.lastNodes = b; + a.p.lastEdges = c; + a.p.lastLabels = d; + a.p.lastBG = f; + h(); + a.graph.rescale(a.width, a.height, 0 < b, 0 < c, 0 < f).setBorders(); + a.mousecaptor.checkBorders(a.graph.borders, a.width, a.height); + a.graph.translate(a.mousecaptor.stageX, a.mousecaptor.stageY, a.mousecaptor.ratio, 0 < b, 0 < c, 0 < f); + a.dispatch("graphscaled"); + for (var g in a.domElements) "canvas" == a.domElements[g].nodeName.toLowerCase() && (void 0 == i[g] || 0 <= i[g]) && a.contexts[g].clearRect(0, 0, a.domElements[g].width, a.domElements[g].height); + a.plotter.currentEdgeIndex = 0; + a.plotter.currentNodeIndex = 0; + a.plotter.currentLabelIndex = 0; + a.plotter.currentBGIndex = 0; + g = null; + i = !1; + if (f) if (1 < f) for (; a.plotter.task_drawBG();); + else sigma.chronos.addTask(a.plotter.task_drawBG, "bg_" + a.id, !1), i = !0, g = "bg_" + a.id; + if (b) if (1 < b) for (; a.plotter.task_drawNode();); + else sigma.chronos.addTask(a.plotter.task_drawNode, "node_" + a.id, !1), i = !0, g = "node_" + a.id; + if (d) if (1 < d) for (; a.plotter.task_drawLabel();); + else g ? sigma.chronos.queueTask(a.plotter.task_drawLabel, "label_" + a.id, g) : sigma.chronos.addTask(a.plotter.task_drawLabel, "label_" + a.id, !1), i = !0, g = "label_" + a.id; + if (c) if (1 < c) for (; a.plotter.task_drawEdge();); + else g ? sigma.chronos.queueTask(a.plotter.task_drawEdge, "edge_" + a.id, g) : sigma.chronos.addTask(a.plotter.task_drawEdge, "edge_" + a.id, !1), i = !0, g = "edge_" + a.id; + a.dispatch("draw"); + a.refresh(); + i && sigma.chronos.runTasks(); + return a + }; + this.resize = function (b, c) { + var d = a.width, + f = a.height; + void 0 != b && void 0 != c ? (a.width = b, a.height = c) : (a.width = a.domRoot.offsetWidth, a.height = a.domRoot.offsetHeight); + if (d != a.width || f != a.height) { + for (var h in a.domElements) a.domElements[h].setAttribute("width", a.width + "px"), a.domElements[h].setAttribute("height", a.height + "px"); + a.plotter.resize(a.width, a.height); + a.draw(a.p.lastNodes, a.p.lastEdges, a.p.lastLabels, a.p.drawBG, !0) + } + return a + }; + this.refresh = function () { + a.contexts.hover.clearRect(0, 0, a.domElements.hover.width, a.domElements.hover.height); + d(); + s(); + return a + }; + this.drawHover = d; + this.drawActive = s; + this.clearSchedule = h; + window.addEventListener ? window.addEventListener("resize", function () { + a.resize() + }, !1) : window.attachEvent("onresize", function () { + a.resize() + }) + } + function s(b) { + var g = this; + sigma.classes.EventDispatcher.call(this); + this._core = b; + this.kill = function () {}; + this.getID = function () { + return b.id + }; + this.configProperties = function (h, c) { + var d = b.config(h, c); + return d == b ? g : d + }; + this.drawingProperties = function (h, c) { + var d = b.plotter.config(h, c); + return d == b.plotter ? g : d + }; + this.mouseProperties = function (h, c) { + var d = b.mousecaptor.config(h, c); + return d == b.mousecaptor ? g : d + }; + this.graphProperties = function (h, c) { + var d = b.graph.config(h, c); + return d == b.graph ? g : d + }; + this.getMouse = function () { + return { + mouseX: b.mousecaptor.mouseX, + mouseY: b.mousecaptor.mouseY, + down: b.mousecaptor.isMouseDown + } + }; + this.position = function (h, c, d) { + if (0 == arguments.length) return { + stageX: b.mousecaptor.stageX, + stageY: b.mousecaptor.stageY, + ratio: b.mousecaptor.ratio + }; + b.mousecaptor.stageX = void 0 != h ? h : b.mousecaptor.stageX; + b.mousecaptor.stageY = void 0 != c ? c : b.mousecaptor.stageY; + b.mousecaptor.ratio = void 0 != d ? d : b.mousecaptor.ratio; + return g + }; + this.goTo = function (h, c, d) { + b.mousecaptor.interpolate(h, c, d); + return g + }; + this.zoomTo = function (h, c, d) { + d = Math.min(Math.max(b.mousecaptor.config("minRatio"), d), b.mousecaptor.config("maxRatio")); + d == b.mousecaptor.ratio ? b.mousecaptor.interpolate(h - b.width / 2 + b.mousecaptor.stageX, c - b.height / 2 + b.mousecaptor.stageY) : b.mousecaptor.interpolate((d * h - b.mousecaptor.ratio * b.width / 2) / (d - b.mousecaptor.ratio), (d * c - b.mousecaptor.ratio * b.height / 2) / (d - b.mousecaptor.ratio), d); + return g + }; + this.resize = function (h, c) { + b.resize(h, c); + return g + }; + this.draw = function (h, c, d, i, a) { + b.draw(h, c, d, i, a); + return g + }; + this.refresh = function () { + b.refresh(); + return g + }; + this.addGenerator = function (h, c, d) { + sigma.chronos.addGenerator(h + "_ext_" + b.id, c, d); + return g + }; + this.removeGenerator = function (h) { + sigma.chronos.removeGenerator(h + "_ext_" + b.id); + return g + }; + this.addNode = function (h, c) { + b.graph.addNode(h, c); + return g + }; + this.addNodeBG = function (h, c) { + b.graph.addNodeBG(h, c); + return g + }; + this.addEdge = function (h, c, d, i) { + b.graph.addEdge(h, c, d, i); + return g + }; + this.dropNode = function (h) { + b.graph.dropNode(h); + return g + }; + this.dropEdge = function (h) { + b.graph.dropEdge(h); + return g + }; + this.pushGraph = function (h, c) { + h.nodes && h.nodes.forEach(function (d) { + d.id && (!c || !b.graph.nodesIndex[d.id]) && g.addNode(d.id, d) + }); + h.edges && h.edges.forEach(function (d) { + (validID = d.source && d.target && d.id) && (!c || !b.graph.edgesIndex[d.id]) && g.addNode(d.id, d.source, d.target, d) + }); + return g + }; + this.emptyGraph = function () { + b.graph.empty(); + return g + }; + this.getNodesCount = function () { + return b.graph.nodes.length + }; + this.getEdgesCount = function () { + return b.graph.edges.length + }; + this.iterNodes = function (h, c) { + b.graph.iterNodes(h, c); + return g + }; + this.iterEdges = function (h, c) { + b.graph.iterEdges(h, c); + return g + }; + this.getNodes = function (h) { + return b.graph.getNodes(h) + }; + this.getEdges = function (h) { + return b.graph.getEdges(h) + }; + this.activateMonitoring = function () { + return b.monitor.activate() + }; + this.desactivateMonitoring = function () { + return b.monitor.desactivate() + }; + b.bind("downnodes upnodes downgraph upgraph", function (b) { + g.dispatch(b.type, b.content) + }); + b.graph.bind("overnodes outnodes", function (b) { + g.dispatch(b.type, b.content) + }) + } + var C = 0; + g = void 0; + g = []; + sigma.init = function (b) { + b = new t(b, (++C).toString()); + sigma.instances[C] = new s(b); + return sigma.instances[C] + }; + sigma.addPlugin = function (b, i, h) { + s.prototype[b] = i; + g.push(h) + }; + sigma.chronos = new function () { + function b(a) { + window.setTimeout(a, 0); + return l + } + function g() { + for (l.dispatch("frameinserted"); m && r.length && h();); + !m || !r.length ? d() : (x = (new Date).getTime(), o++, B = w - q, s = q - B, l.dispatch("insertframe"), b(g)) + } + function h() { + t %= r.length; + if (!r[t].task()) { + var a = r[t].taskName; + z = z.filter(function (b) { + b.taskParent == a && r.push({ + taskName: b.taskName, + task: b.task + }); + return b.taskParent != a + }); + l.dispatch("killed", r.splice(t--, 1)[0]) + } + t++; + w = (new Date).getTime() - x; + return w <= s + } + function c() { + m = !0; + o = t = 0; + u = x = (new Date).getTime(); + l.dispatch("start"); + l.dispatch("insertframe"); + b(g); + return l + } + function d() { + l.dispatch("stop"); + m = !1; + return l + } + function i(a, b, d) { + if ("function" != typeof a) throw Error('Task "' + b + '" is not a function'); + r.push({ + taskName: b, + task: a + }); + m = !(!m && !(d && c() || 1)); + return l + } + function a(a) { + return a ? Object.keys(p).filter(function (a) { + return !!p[a].on + }).length : Object.keys(p).length + } + function f() { + Object.keys(p).length ? (l.dispatch("startgenerators"), l.unbind("killed", k), b(function () { + for (var a in p) p[a].on = !0, i(p[a].task, a, !1) + }), l.bind("killed", k).runTasks()) : l.dispatch("stopgenerators"); + return l + } + function k(b) { + void 0 != p[b.content.taskName] && (p[b.content.taskName].del || !p[b.content.taskName].condition() ? delete p[b.content.taskName] : p[b.content.taskName].on = !1, 0 == a(!0) && f()) + } + sigma.classes.EventDispatcher.call(this); + var l = this, + m = !1, + j = 80, + n = 0, + o = 0, + q = 1E3 / j, + s = q, + w = 0, + u = 0, + x = 0, + B = 0, + p = {}, + r = [], + z = [], + t = 0; + this.frequency = function (a) { + return void 0 != a ? (j = Math.abs(1 * a), q = 1E3 / j, o = 0, l) : j + }; + this.runTasks = c; + this.stopTasks = d; + this.insertFrame = b; + this.addTask = i; + this.queueTask = function (a, b, c) { + if ("function" != typeof a) throw Error('Task "' + b + '" is not a function'); + if (!r.concat(z).some(function (a) { + return a.taskName == c + })) throw Error('Parent task "' + c + '" of "' + b + '" is not attached.'); + z.push({ + taskParent: c, + taskName: b, + task: a + }); + return l + }; + this.removeTask = function (a, b) { + if (void 0 == a) r = [], 1 == b ? z = [] : 2 == b && (r = z, z = []), d(); + else { + var c = "string" == typeof a ? a : ""; + r = r.filter(function (b) { + return ("string" == typeof a ? b.taskName == a : b.task == a) ? (c = b.taskName, !1) : !0 + }); + 0 < b && (z = z.filter(function (a) { + 1 == b && a.taskParent == c && r.push(a); + return a.taskParent != c + })) + } + m = !(r.length && (!d() || 1)); + return l + }; + this.addGenerator = function (b, c, d) { + if (void 0 != p[b]) return l; + p[b] = { + task: c, + condition: d + }; + 0 == a(!0) && f(); + return l + }; + this.removeGenerator = function (a) { + p[a] && (p[a].on = !1, p[a].del = !0); + return l + }; + this.startGenerators = f; + this.getGeneratorsIDs = function () { + return Object.keys(p) + }; + this.getFPS = function () { + m && (n = Math.round(1E4 * (o / ((new Date).getTime() - u))) / 10); + return n + }; + this.getTasksCount = function () { + return r.length + }; + this.getQueuedTasksCount = function () { + return z.length + }; + this.getExecutionTime = function () { + return x - u + }; + return this + }; + sigma.debugMode = 0; + sigma.log = function () { + if (1 == sigma.debugMode) for (var b in arguments) console.log(arguments[b]); + else if (1 < sigma.debugMode) for (b in arguments) throw Error(arguments[b]); + return sigma + }; + sigma.easing = { + linear: {}, + quadratic: {} + }; + sigma.easing.linear.easenone = function (b) { + return b + }; + sigma.easing.quadratic.easein = function (b) { + return b * b + }; + sigma.easing.quadratic.easeout = function (b) { + return -b * (b - 2) + }; + sigma.easing.quadratic.easeinout = function (b) { + return 1 > (b *= 2) ? 0.5 * b * b : -0.5 * (--b * (b - 2) - 1) + }; + sigma.tools.drawRoundRect = function (b, g, h, c, d) { + b.fillStyle = "#009BE1"; + b.fillRect(g + e, h + e, c, d) + }; + sigma.tools.getRGB = function (b, g) { + var b = b.toString(), + h = { + r: 0, + g: 0, + b: 0 + }; + if (3 <= b.length && "#" == b.charAt(0)) { + var c = b.length - 1; + 6 == c ? h = { + r: parseInt(b.charAt(1) + b.charAt(2), 16), + g: parseInt(b.charAt(3) + b.charAt(4), 16), + b: parseInt(b.charAt(5) + b.charAt(5), 16) + } : 3 == c && (h = { + r: parseInt(b.charAt(1) + b.charAt(1), 16), + g: parseInt(b.charAt(2) + b.charAt(2), 16), + b: parseInt(b.charAt(3) + b.charAt(3), 16) + }) + } + g && (h = [h.r, h.g, h.b]); + return h + }; + sigma.tools.rgbToHex = function (b, g, h) { + return sigma.tools.toHex(b) + sigma.tools.toHex(g) + sigma.tools.toHex(h) + }; + sigma.tools.toHex = function (b) { + b = parseInt(b, 10); + if (isNaN(b)) return "00"; + b = Math.max(0, Math.min(b, 255)); + return "0123456789ABCDEF".charAt((b - b % 16) / 16) + "0123456789ABCDEF".charAt(b % 16) + }; + sigma.publicPrototype = s.prototype +})(); \ No newline at end of file diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/sigma.min.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/sigma.min.js new file mode 100644 index 0000000000..d1befd7dcb --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/sigma.min.js @@ -0,0 +1,64 @@ +/* sigmajs.org - an open-source light-weight JavaScript graph drawing library - Version: 0.1 - Author: Alexis Jacomy - License: MIT */ +var sigma={tools:{},classes:{},instances:{}}; +(function(){Array.prototype.some||(Array.prototype.some=function(g,i){var k=this.length;if("function"!=typeof g)throw new TypeError;for(var m=0;m";a+="

    LOCAL :

    ";for(b in c.p.localProbes)a+="

    "+b+" : "+c.p.localProbes[b]()+"

    ";c.p.dom.innerHTML=a;return c}sigma.classes.Cascade.call(this);var c=this;this.instance=b;this.monitoring=!1;this.p={fps:40,dom:j,globalProbes:{"Time (ms)":sigma.chronos.getExecutionTime,Queue:sigma.chronos.getQueuedTasksCount,Tasks:sigma.chronos.getTasksCount,FPS:sigma.chronos.getFPS},localProbes:{"Nodes count":function(){return c.instance.graph.nodes.length},"Edges count":function(){return c.instance.graph.edges.length}}}; +this.activate=function(){c.monitoring||(c.monitoring=window.setInterval(f,1E3/c.p.fps));return c};this.desactivate=function(){c.monitoring&&(window.clearInterval(c.monitoring),c.monitoring=null,c.p.dom.innerHTML="");return c}}function g(b){var j=b.changedTouches[0],f="";switch(b.type){case "touchstart":f="mousedown";break;case "touchmove":f="mousemove";break;case "touchend":f="mouseup";break;default:return}var c=document.createEvent("MouseEvent");c.initMouseEvent(f,!0,!0,window,1,j.posX,j.posY,j.clientX, +j.clientY,!1,!1,!1,!1,0,null);j.target.dispatchEvent(c);b.preventDefault()}function p(b){function j(b){a.p.mouseEnabled&&(f(a.mouseX,a.mouseY,a.ratio*(0<(void 0!=b.wheelDelta&&b.wheelDelta||void 0!=b.detail&&-b.detail)?a.p.zoomMultiply:1/a.p.zoomMultiply)),a.p.blockScroll&&(b.preventDefault?b.preventDefault():b.returnValue=!1))}function f(b,d,f){if(!a.isMouseDown&&(window.clearInterval(a.interpolationID),m=void 0!=f,w=a.stageX,n=b,o=a.stageY,l=d,h=f||a.ratio,h=Math.min(Math.max(h,a.p.minRatio),a.p.maxRatio), +u=a.p.directZooming?1-(m?a.p.zoomDelta:a.p.dragDelta):0,a.ratio!=h||a.stageX!=n||a.stageY!=l))c(),a.interpolationID=window.setInterval(c,50),a.dispatch("startinterpolate")}function c(){u+=m?a.p.zoomDelta:a.p.dragDelta;u=Math.min(u,1);var b=sigma.easing.quadratic.easeout(u),c=a.ratio;a.ratio=c*(1-b)+h*b;m?(a.stageX=n+(a.stageX-n)*a.ratio/c,a.stageY=l+(a.stageY-l)*a.ratio/c):(a.stageX=w*(1-b)+n*b,a.stageY=o*(1-b)+l*b);a.dispatch("interpolate");1<=u&&(window.clearInterval(a.interpolationID),b=a.ratio, +m?(a.ratio=h,a.stageX=n+(a.stageX-n)*a.ratio/b,a.stageY=l+(a.stageY-l)*a.ratio/b):(a.stageX=n,a.stageY=l),a.dispatch("stopinterpolate"))}sigma.classes.Cascade.call(this);sigma.classes.EventDispatcher.call(this);var a=this;this.p={minRatio:1,maxRatio:32,marginRatio:1,zoomDelta:0.1,dragDelta:0.3,zoomMultiply:2,directZooming:!1,blockScroll:!0,inertia:1.1,mouseEnabled:!0,touchEnabled:!0};var i=0,d=0,w=0,o=0,h=1,n=0,l=0,s=0,t=0,A=0,k=0,u=0,m=!1;this.stageY=this.stageX=0;this.ratio=1;this.mouseY=this.mouseX= +0;this.isTouchDown=this.isMouseDown=!1;b.addEventListener("DOMMouseScroll",j,!0);b.addEventListener("mousewheel",j,!0);b.addEventListener("mousemove",function(b){a.mouseX=void 0!=b.offsetX&&b.offsetX||void 0!=b.layerX&&b.layerX||void 0!=b.clientX&&b.clientX;a.mouseY=void 0!=b.offsetY&&b.offsetY||void 0!=b.layerY&&b.layerY||void 0!=b.clientY&&b.clientY;if(a.isMouseDown){var c=a.mouseX-i+w,h=a.mouseY-d+o;if(c!=a.stageX||h!=a.stageY)t=s,k=A,s=c,A=h,a.stageX=c,a.stageY=h,a.dispatch("drag")}a.dispatch("move"); +b.preventDefault?b.preventDefault():b.returnValue=!1},!0);b.addEventListener("mousedown",function(b){a.p.mouseEnabled&&(a.isMouseDown=!0,a.dispatch("mousedown"),w=a.stageX,o=a.stageY,i=a.mouseX,d=a.mouseY,t=s=a.stageX,k=A=a.stageY,a.dispatch("startdrag"),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);document.addEventListener("mouseup",function(b){a.p.mouseEnabled&&a.isMouseDown&&(a.isMouseDown=!1,a.dispatch("mouseup"),(w!=a.stageX||o!=a.stageY)&&f(a.stageX+a.p.inertia*(a.stageX-t),a.stageY+ +a.p.inertia*(a.stageY-k)),b.preventDefault?b.preventDefault():b.returnValue=!1)},!0);b.addEventListener("touchstart",g,!0);b.addEventListener("touchmove",g,!0);document.addEventListener("touchend",g,!0);b.addEventListener("touchcancel",g,!0);this.checkBorders=function(){return a};this.interpolate=f}function z(b,j,f,c,a,g,d){function i(a){var b=c,d="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*a.displaySize;b.font=(h.p.hoverFontStyle||h.p.fontStyle||"")+" "+d+"px "+(h.p.hoverFont|| +h.p.font||"");b.fillStyle="node"==h.p.labelHoverBGColor?a.color||h.p.defaultNodeColor:h.p.defaultHoverLabelBGColor;b.beginPath();h.p.labelHoverShadow&&(b.shadowOffsetX=0,b.shadowOffsetY=0,b.shadowBlur=4,b.shadowColor=h.p.labelHoverShadowColor);sigma.tools.drawRoundRect(b,Math.round(a.displayX-d/2-2),Math.round(a.displayY-d/2-2),Math.round(b.measureText(a.label).width+1.5*a.displaySize+d/2+4),Math.round(d+4),Math.round(d/2+2),"left");b.closePath();b.fill();b.shadowOffsetX=0;b.shadowOffsetY=0;b.shadowBlur= +0;b.beginPath();b.fillStyle="node"==h.p.nodeBorderColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeBorderColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize+h.p.borderSize,0,2*Math.PI,!0);b.closePath();b.fill();b.beginPath();b.fillStyle="node"==h.p.nodeHoverColor?a.color||h.p.defaultNodeColor:h.p.defaultNodeHoverColor;b.arc(Math.round(a.displayX),Math.round(a.displayY),a.displaySize,0,2*Math.PI,!0);b.closePath();b.fill();b.fillStyle="node"==h.p.labelHoverColor?a.color||h.p.defaultNodeColor: +h.p.defaultLabelHoverColor;b.fillText(a.label,Math.round(a.displayX+1.5*a.displaySize),Math.round(a.displayY+d/2-3));return h}function o(a){if(isNaN(a.x)||isNaN(a.y))throw Error("A node's coordinate is not a number (id: "+a.id+")");return!a.hidden&&a.displayX+a.displaySize>-n/3&&a.displayX-a.displaySize<4*n/3&&a.displayY+a.displaySize>-l/3&&a.displayY-a.displaySize<4*l/3}sigma.classes.Cascade.call(this);var h=this;this.p={labelColor:"default",defaultLabelColor:"#000",labelHoverBGColor:"default",defaultHoverLabelBGColor:"#fff", +labelHoverShadow:!0,labelHoverShadowColor:"#000",labelHoverColor:"default",defaultLabelHoverColor:"#000",labelActiveBGColor:"default",defaultActiveLabelBGColor:"#fff",labelActiveShadow:!0,labelActiveShadowColor:"#000",labelActiveColor:"default",defaultLabelActiveColor:"#000",labelSize:"fixed",defaultLabelSize:12,labelSizeRatio:2,labelThreshold:6,font:"Arial",hoverFont:"",activeFont:"",fontStyle:"",hoverFontStyle:"",activeFontStyle:"",edgeColor:"source",defaultEdgeColor:"#aaa",defaultEdgeType:"line", +defaultNodeColor:"#aaa",nodeHoverColor:"node",defaultNodeHoverColor:"#fff",nodeActiveColor:"node",defaultNodeActiveColor:"#fff",borderSize:0,nodeBorderColor:"node",defaultNodeBorderColor:"#fff",edgesSpeed:200,nodesSpeed:200,labelsSpeed:200};var n=g,l=d;this.currentLabelIndex=this.currentNodeIndex=this.currentEdgeIndex=0;this.task_drawLabel=function(){for(var b=a.nodes.length,c=0;c++=h.p.labelThreshold||d.forceLabel){var g="fixed"==h.p.labelSize?h.p.defaultLabelSize:h.p.labelSizeRatio*d.displaySize;j.font=h.p.fontStyle+g+"px "+h.p.font;j.fillStyle="node"==h.p.labelColor?d.color||h.p.defaultNodeColor:h.p.defaultLabelColor;j.fillText(d.label,Math.round(d.displayX+1.5*d.displaySize),Math.round(d.displayY+g/2-3))}}else h.currentLabelIndex++;return h.currentLabelIndex(b*=2)?0.5*b*b:-0.5*(--b*(b-2)-1)};sigma.tools.drawRoundRect=function(b,g,f,c,a,i,d){var i=i?i:0,k=d?d:[],k="string"==typeof k?k.split(" "):k,d=i&&(0<=k.indexOf("topleft")||0<=k.indexOf("top")||0<=k.indexOf("left")),m=i&&(0<=k.indexOf("topright")|| +0<=k.indexOf("top")||0<=k.indexOf("right")),h=i&&(0<=k.indexOf("bottomleft")||0<=k.indexOf("bottom")||0<=k.indexOf("left")),k=i&&(0<=k.indexOf("bottomright")||0<=k.indexOf("bottom")||0<=k.indexOf("right"));b.moveTo(g,f+i);d?b.arcTo(g,f,g+i,f,i):b.lineTo(g,f);m?(b.lineTo(g+c-i,f),b.arcTo(g+c,f,g+c,f+i,i)):b.lineTo(g+c,f);k?(b.lineTo(g+c,f+a-i),b.arcTo(g+c,f+a,g+c-i,f+a,i)):b.lineTo(g+c,f+a);h?(b.lineTo(g+i,f+a),b.arcTo(g,f+a,g,f+a-i,i)):b.lineTo(g,f+a);b.lineTo(g,f+i)};sigma.tools.getRGB=function(b, +g){var b=b.toString(),f={r:0,g:0,b:0};if(3<=b.length&&"#"==b.charAt(0)){var c=b.length-1;6==c?f={r:parseInt(b.charAt(1)+b.charAt(2),16),g:parseInt(b.charAt(3)+b.charAt(4),16),b:parseInt(b.charAt(5)+b.charAt(5),16)}:3==c&&(f={r:parseInt(b.charAt(1)+b.charAt(1),16),g:parseInt(b.charAt(2)+b.charAt(2),16),b:parseInt(b.charAt(3)+b.charAt(3),16)})}g&&(f=[f.r,f.g,f.b]);return f};sigma.tools.rgbToHex=function(b,g,f){return sigma.tools.toHex(b)+sigma.tools.toHex(g)+sigma.tools.toHex(f)};sigma.tools.toHex= +function(b){b=parseInt(b,10);if(isNaN(b))return"00";b=Math.max(0,Math.min(b,255));return"0123456789ABCDEF".charAt((b-b%16)/16)+"0123456789ABCDEF".charAt(b%16)};sigma.publicPrototype=x.prototype})(); diff --git a/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/sigma.parseGexf.js b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/sigma.parseGexf.js new file mode 100644 index 0000000000..1924c3e8c8 --- /dev/null +++ b/modules/sigmaExporter/src/main/resources/uk/ac/ox/oii/sigmaexporter/resources/network/js/sigma/sigma.parseGexf.js @@ -0,0 +1,166 @@ +// Mathieu Jacomy @ Sciences Po Médialab & WebAtlas +// (requires sigma.js to be loaded) +sigma.publicPrototype.parseGexf = function(gexfPath,callback) { + // Load XML file: + var gexfhttp, gexf; + var sigmaInstance = this; + gexfhttp = window.XMLHttpRequest ? + new XMLHttpRequest() : + new ActiveXObject('Microsoft.XMLHTTP'); + + gexfhttp.overrideMimeType('text/xml'); + gexfhttp.open('GET', gexfPath, false); + gexfhttp.send(); + gexf = gexfhttp.responseXML; + + var viz='http://www.gexf.net/1.2draft/viz'; // Vis namespace + var i, j, k; + + // Parse Attributes + // This is confusing, so I'll comment heavily + var nodesAttributes = []; // The list of attributes of the nodes of the graph that we build in json + var nodesAttributesDict = {}; + var edgesAttributes = []; // The list of attributes of the edges of the graph that we build in json + var edgesAttributesDict = {}; + var attributesNodes = gexf.getElementsByTagName('attributes'); // In the gexf (that is an xml), the list of xml nodes 'attributes' (note the plural 's') + + for(i = 0; i0){ + sizeNode = sizeNodes[0]; + size = parseFloat(sizeNode.getAttribute('value')); + } + + var positionNodes = nodeNode.getElementsByTagName('position'); + positionNodes = positionNodes.length ? + positionNodes : + nodeNode.getElementsByTagNameNS('*','position'); + if(positionNodes.length>0){ + var positionNode = positionNodes[0]; + x = parseFloat(positionNode.getAttribute('x')); + y = parseFloat(positionNode.getAttribute('y')); + } + + var colorNodes = nodeNode.getElementsByTagName('color'); + colorNodes = colorNodes.length ? + colorNodes : + nodeNode.getElementsByTagNameNS('*','color'); + if(colorNodes.length>0){ + colorNode = colorNodes[0]; + color = '#'+sigma.tools.rgbToHex(parseFloat(colorNode.getAttribute('r')), + parseFloat(colorNode.getAttribute('g')), + parseFloat(colorNode.getAttribute('b'))); + } + + // Create Node + var node = {label:label, size:size, x:x, y:y, attributes:{}, color:color}; // The graph node + + // Attribute values + var attvalueNodes = nodeNode.getElementsByTagName('attvalue'); + for(k=0; k + + + + + + + + + + +