diff --git a/.gitignore b/.gitignore index 89559c0b..eef9e5bd 100644 --- a/.gitignore +++ b/.gitignore @@ -62,3 +62,6 @@ target/ # Vagrant .vagrant Vagrantfile + +# Node JS stuff +node_modules diff --git a/nengo_gui/static/ace.js b/nengo_gui/static/ace.js index 07ca9b8a..b61dec7f 100644 --- a/nengo_gui/static/ace.js +++ b/nengo_gui/static/ace.js @@ -17,7 +17,7 @@ Nengo.disable_editor = function() { } Nengo.Ace = function (uid, args) { - this.AceRange = ace.require('ace/range').Range; + this.AceRange = ace.Range; if (uid[0] === '<') { console.log("invalid uid for Ace: " + uid); } diff --git a/nengo_gui/static/components/netgraph.js b/nengo_gui/static/components/netgraph.js index 8b50075c..7bd6b9bb 100644 --- a/nengo_gui/static/components/netgraph.js +++ b/nengo_gui/static/components/netgraph.js @@ -144,10 +144,7 @@ Nengo.NetGraph = function(parent, args) { * this is needed for saving the SVG plot to disk*/ /** load contents of the CSS file as string */ - var file = document.getElementById('netgraphcss'); - var css = Array.prototype.map.call(file.sheet.cssRules, function - css_text(x) {return x.cssText; } ).join('\n'); - + var css = require('css-to-string-loader!./netgraph.css'); /** embed CSS code into SVG tag */ var s = document.createElement('style'); s.setAttribute('type', 'text/css'); diff --git a/nengo_gui/static/data_to_csv.js b/nengo_gui/static/data_to_csv.js index 08ae8d4d..f05e0a6e 100644 --- a/nengo_gui/static/data_to_csv.js +++ b/nengo_gui/static/data_to_csv.js @@ -66,3 +66,5 @@ var data_to_csv = function(data_set){ return csv_string; } + +module.exports = data_to_csv; diff --git a/nengo_gui/static/lib/fonts/glyphicons-halflings-regular.woff2 b/nengo_gui/static/dist/448c34a56d699c29117adc64c43affeb.woff2 similarity index 100% rename from nengo_gui/static/lib/fonts/glyphicons-halflings-regular.woff2 rename to nengo_gui/static/dist/448c34a56d699c29117adc64c43affeb.woff2 diff --git a/nengo_gui/static/lib/fonts/glyphicons-halflings-regular.svg b/nengo_gui/static/dist/89889688147bd7575d6327160d64e760.svg similarity index 100% rename from nengo_gui/static/lib/fonts/glyphicons-halflings-regular.svg rename to nengo_gui/static/dist/89889688147bd7575d6327160d64e760.svg diff --git a/nengo_gui/static/lib/fonts/glyphicons-halflings-regular.ttf b/nengo_gui/static/dist/e18bbf611f2a2e43afc071aa2f4e1512.ttf similarity index 100% rename from nengo_gui/static/lib/fonts/glyphicons-halflings-regular.ttf rename to nengo_gui/static/dist/e18bbf611f2a2e43afc071aa2f4e1512.ttf diff --git a/nengo_gui/static/lib/fonts/glyphicons-halflings-regular.eot b/nengo_gui/static/dist/f4769f9bdb7466be65088239c12046d1.eot similarity index 100% rename from nengo_gui/static/lib/fonts/glyphicons-halflings-regular.eot rename to nengo_gui/static/dist/f4769f9bdb7466be65088239c12046d1.eot diff --git a/nengo_gui/static/lib/fonts/glyphicons-halflings-regular.woff b/nengo_gui/static/dist/fa2772327f55d8198301fdb8bcfc8158.woff similarity index 100% rename from nengo_gui/static/lib/fonts/glyphicons-halflings-regular.woff rename to nengo_gui/static/dist/fa2772327f55d8198301fdb8bcfc8158.woff diff --git a/nengo_gui/static/dist/favicon.ico b/nengo_gui/static/dist/favicon.ico new file mode 100644 index 00000000..e221c47d Binary files /dev/null and b/nengo_gui/static/dist/favicon.ico differ diff --git a/nengo_gui/static/dist/nengo.js b/nengo_gui/static/dist/nengo.js new file mode 100644 index 00000000..be169768 --- /dev/null +++ b/nengo_gui/static/dist/nengo.js @@ -0,0 +1,71 @@ +var Nengo=function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={exports:{},id:n,loaded:!1};return t[n].call(o.exports,o,o.exports,e),o.loaded=!0,o.exports}var i={};return e.m=t,e.c=i,e.p="/static/dist/",e(0)}([function(t,e,i){t.exports=i(2)},function(t,e,i){var n,o;/*! + * jQuery JavaScript Library v2.1.3 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-12-18T15:11Z + */ +!function(e,i){"object"==typeof t&&"object"==typeof t.exports?t.exports=e.document?i(e,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return i(t)}:i(e)}("undefined"!=typeof window?window:this,function(i,r){function s(t){var e=t.length,i=nt.type(t);return"function"!==i&&!nt.isWindow(t)&&(!(1!==t.nodeType||!e)||("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t))}function a(t,e,i){if(nt.isFunction(e))return nt.grep(t,function(t,n){return!!e.call(t,n,t)!==i});if(e.nodeType)return nt.grep(t,function(t){return t===e!==i});if("string"==typeof e){if(ut.test(e))return nt.filter(e,t,i);e=nt.filter(e,t)}return nt.grep(t,function(t){return Q.call(e,t)>=0!==i})}function l(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function h(t){var e=bt[t]={};return nt.each(t.match(vt)||[],function(t,i){e[i]=!0}),e}function c(){et.removeEventListener("DOMContentLoaded",c,!1),i.removeEventListener("load",c,!1),nt.ready()}function u(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=nt.expando+u.uid++}function d(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(Ct,"-$1").toLowerCase(),i=t.getAttribute(n),"string"==typeof i){try{i="true"===i||"false"!==i&&("null"===i?null:+i+""===i?+i:_t.test(i)?nt.parseJSON(i):i)}catch(o){}At.set(t,e,i)}else i=void 0;return i}function p(){return!0}function f(){return!1}function g(){try{return et.activeElement}catch(t){}}function m(t,e){return nt.nodeName(t,"table")&&nt.nodeName(11!==e.nodeType?e:e.firstChild,"tr")?t.getElementsByTagName("tbody")[0]||t.appendChild(t.ownerDocument.createElement("tbody")):t}function v(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function b(t){var e=Pt.exec(t.type);return e?t.type=e[1]:t.removeAttribute("type"),t}function y(t,e){for(var i=0,n=t.length;i")).appendTo(e.documentElement),e=Ut[0].contentDocument,e.write(),e.close(),i=_(t,e),Ut.detach()),jt[t]=i),i}function E(t,e,i){var n,o,r,s,a=t.style;return i=i||Kt(t),i&&(s=i.getPropertyValue(e)||i[e]),i&&(""!==s||nt.contains(t.ownerDocument,t)||(s=nt.style(t,e)),qt.test(s)&&Vt.test(e)&&(n=a.width,o=a.minWidth,r=a.maxWidth,a.minWidth=a.maxWidth=a.width=s,s=i.width,a.width=n,a.minWidth=o,a.maxWidth=r)),void 0!==s?s+"":s}function k(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function F(t,e){if(e in t)return e;for(var i=e[0].toUpperCase()+e.slice(1),n=e,o=Zt.length;o--;)if(e=Zt[o]+i,e in t)return e;return n}function S(t,e,i){var n=Gt.exec(e);return n?Math.max(0,n[1]-(i||0))+(n[2]||"px"):e}function D(t,e,i,n,o){for(var r=i===(n?"border":"content")?4:"width"===e?1:0,s=0;r<4;r+=2)"margin"===i&&(s+=nt.css(t,i+kt[r],!0,o)),n?("content"===i&&(s-=nt.css(t,"padding"+kt[r],!0,o)),"margin"!==i&&(s-=nt.css(t,"border"+kt[r]+"Width",!0,o))):(s+=nt.css(t,"padding"+kt[r],!0,o),"padding"!==i&&(s+=nt.css(t,"border"+kt[r]+"Width",!0,o)));return s}function M(t,e,i){var n=!0,o="width"===e?t.offsetWidth:t.offsetHeight,r=Kt(t),s="border-box"===nt.css(t,"boxSizing",!1,r);if(o<=0||null==o){if(o=E(t,e,r),(o<0||null==o)&&(o=t.style[e]),qt.test(o))return o;n=s&&(tt.boxSizingReliable()||o===t.style[e]),o=parseFloat(o)||0}return o+D(t,e,i||(s?"border":"content"),n,r)+"px"}function T(t,e){for(var i,n,o,r=[],s=0,a=t.length;s=0&&i=0},isPlainObject:function(t){return"object"===nt.type(t)&&!t.nodeType&&!nt.isWindow(t)&&!(t.constructor&&!Z.call(t.constructor.prototype,"isPrototypeOf"))},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},type:function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?X[J.call(t)]||"object":typeof t},globalEval:function(t){var e,i=eval;t=nt.trim(t),t&&(1===t.indexOf("use strict")?(e=et.createElement("script"),e.text=t,et.head.appendChild(e).parentNode.removeChild(e)):i(t))},camelCase:function(t){return t.replace(rt,"ms-").replace(st,at)},nodeName:function(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()},each:function(t,e,i){var n,o=0,r=t.length,a=s(t);if(i){if(a)for(;oA.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[O]=!0,t}function o(t){var e=B.createElement("div");try{return!!t(e)}catch(i){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function r(t,e){for(var i=t.split("|"),n=t.length;n--;)A.attrHandle[i[n]]=e}function s(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&(~e.sourceIndex||K)-(~t.sourceIndex||K);if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function a(t){return function(e){var i=e.nodeName.toLowerCase();return"input"===i&&e.type===t}}function l(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}function h(t){return n(function(e){return e=+e,n(function(i,n){for(var o,r=t([],i.length,e),s=r.length;s--;)i[o=r[s]]&&(i[o]=!(n[o]=i[o]))})})}function c(t){return t&&"undefined"!=typeof t.getElementsByTagName&&t}function u(){}function d(t){for(var e=0,i=t.length,n="";e1?function(e,i,n){for(var o=t.length;o--;)if(!t[o](e,i,n))return!1;return!0}:t[0]}function g(t,i,n){for(var o=0,r=i.length;o-1&&(n[h]=!(s[h]=u))}}else y=m(y===s?y.splice(f,y.length):y),r?r(null,s,y,l):J.apply(s,y)})}function b(t){for(var e,i,n,o=t.length,r=A.relative[t[0].type],s=r||A.relative[" "],a=r?1:0,l=p(function(t){return t===e},s,!0),h=p(function(t){return tt(e,t)>-1},s,!0),c=[function(t,i,n){var o=!r&&(n||i!==S)||((e=i).nodeType?l(t,i,n):h(t,i,n));return e=null,o}];a1&&f(c),a>1&&d(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(lt,"$1"),i,a0,r=t.length>0,s=function(n,s,a,l,h){var c,u,d,p=0,f="0",g=n&&[],v=[],b=S,y=n||r&&A.find.TAG("*",h),w=H+=null==b?1:Math.random()||.1,x=y.length;for(h&&(S=s!==B&&s);f!==x&&null!=(c=y[f]);f++){if(r&&c){for(u=0;d=t[u++];)if(d(c,s,a)){l.push(c);break}h&&(H=w)}o&&((c=!d&&c)&&p--,n&&g.push(c))}if(p+=f,o&&f!==p){for(u=0;d=i[u++];)d(g,v,s,a);if(n){if(p>0)for(;f--;)g[f]||v[f]||(v[f]=Q.call(l));v=m(v)}J.apply(l,v),h&&!n&&v.length>0&&p+i.length>1&&e.uniqueSort(l)}return h&&(H=w,S=b),g};return o?n(s):s}var w,x,A,_,C,E,k,F,S,D,M,T,B,L,$,R,I,z,N,O="sizzle"+1*new Date,P=t.document,H=0,W=0,U=i(),j=i(),V=i(),q=function(t,e){return t===e&&(M=!0),0},K=1<<31,Y={}.hasOwnProperty,G=[],Q=G.pop,X=G.push,J=G.push,Z=G.slice,tt=function(t,e){for(var i=0,n=t.length;i+~]|"+it+")"+it+"*"),ut=new RegExp("="+it+"*([^\\]'\"]*?)"+it+"*\\]","g"),dt=new RegExp(st),pt=new RegExp("^"+ot+"$"),ft={ID:new RegExp("^#("+nt+")"),CLASS:new RegExp("^\\.("+nt+")"),TAG:new RegExp("^("+nt.replace("w","w*")+")"),ATTR:new RegExp("^"+rt),PSEUDO:new RegExp("^"+st),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+it+"*(even|odd|(([+-]|)(\\d*)n|)"+it+"*(?:([+-]|)"+it+"*(\\d+)|))"+it+"*\\)|)","i"),bool:new RegExp("^(?:"+et+")$","i"),needsContext:new RegExp("^"+it+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+it+"*((?:-\\d)?\\d*)"+it+"*\\)|)(?=[^-]|$)","i")},gt=/^(?:input|select|textarea|button)$/i,mt=/^h\d$/i,vt=/^[^{]+\{\s*\[native \w/,bt=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,yt=/[+~]/,wt=/'|\\/g,xt=new RegExp("\\\\([\\da-f]{1,6}"+it+"?|("+it+")|.)","ig"),At=function(t,e,i){var n="0x"+e-65536;return n!==n||i?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320)},_t=function(){T()};try{J.apply(G=Z.call(P.childNodes),P.childNodes),G[P.childNodes.length].nodeType}catch(Ct){J={apply:G.length?function(t,e){X.apply(t,Z.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}x=e.support={},C=e.isXML=function(t){var e=t&&(t.ownerDocument||t).documentElement;return!!e&&"HTML"!==e.nodeName},T=e.setDocument=function(t){var e,i,n=t?t.ownerDocument||t:P;return n!==B&&9===n.nodeType&&n.documentElement?(B=n,L=n.documentElement,i=n.defaultView,i&&i!==i.top&&(i.addEventListener?i.addEventListener("unload",_t,!1):i.attachEvent&&i.attachEvent("onunload",_t)),$=!C(n),x.attributes=o(function(t){return t.className="i",!t.getAttribute("className")}),x.getElementsByTagName=o(function(t){return t.appendChild(n.createComment("")),!t.getElementsByTagName("*").length}),x.getElementsByClassName=vt.test(n.getElementsByClassName),x.getById=o(function(t){return L.appendChild(t).id=O,!n.getElementsByName||!n.getElementsByName(O).length}),x.getById?(A.find.ID=function(t,e){if("undefined"!=typeof e.getElementById&&$){var i=e.getElementById(t);return i&&i.parentNode?[i]:[]}},A.filter.ID=function(t){var e=t.replace(xt,At);return function(t){return t.getAttribute("id")===e}}):(delete A.find.ID,A.filter.ID=function(t){var e=t.replace(xt,At);return function(t){var i="undefined"!=typeof t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}}),A.find.TAG=x.getElementsByTagName?function(t,e){return"undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t):x.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],o=0,r=e.getElementsByTagName(t);if("*"===t){for(;i=r[o++];)1===i.nodeType&&n.push(i);return n}return r},A.find.CLASS=x.getElementsByClassName&&function(t,e){if($)return e.getElementsByClassName(t)},I=[],R=[],(x.qsa=vt.test(n.querySelectorAll))&&(o(function(t){L.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&R.push("[*^$]="+it+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||R.push("\\["+it+"*(?:value|"+et+")"),t.querySelectorAll("[id~="+O+"-]").length||R.push("~="),t.querySelectorAll(":checked").length||R.push(":checked"),t.querySelectorAll("a#"+O+"+*").length||R.push(".#.+[+~]")}),o(function(t){var e=n.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&R.push("name"+it+"*[*^$|!~]?="),t.querySelectorAll(":enabled").length||R.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),R.push(",.*:")})),(x.matchesSelector=vt.test(z=L.matches||L.webkitMatchesSelector||L.mozMatchesSelector||L.oMatchesSelector||L.msMatchesSelector))&&o(function(t){x.disconnectedMatch=z.call(t,"div"),z.call(t,"[s!='']:x"),I.push("!=",st)}),R=R.length&&new RegExp(R.join("|")),I=I.length&&new RegExp(I.join("|")),e=vt.test(L.compareDocumentPosition),N=e||vt.test(L.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},q=e?function(t,e){if(t===e)return M=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i?i:(i=(t.ownerDocument||t)===(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!x.sortDetached&&e.compareDocumentPosition(t)===i?t===n||t.ownerDocument===P&&N(P,t)?-1:e===n||e.ownerDocument===P&&N(P,e)?1:D?tt(D,t)-tt(D,e):0:4&i?-1:1)}:function(t,e){if(t===e)return M=!0,0;var i,o=0,r=t.parentNode,a=e.parentNode,l=[t],h=[e];if(!r||!a)return t===n?-1:e===n?1:r?-1:a?1:D?tt(D,t)-tt(D,e):0;if(r===a)return s(t,e);for(i=t;i=i.parentNode;)l.unshift(i);for(i=e;i=i.parentNode;)h.unshift(i);for(;l[o]===h[o];)o++;return o?s(l[o],h[o]):l[o]===P?-1:h[o]===P?1:0},n):B},e.matches=function(t,i){return e(t,null,null,i)},e.matchesSelector=function(t,i){if((t.ownerDocument||t)!==B&&T(t),i=i.replace(ut,"='$1']"),x.matchesSelector&&$&&(!I||!I.test(i))&&(!R||!R.test(i)))try{var n=z.call(t,i);if(n||x.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(o){}return e(i,B,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!==B&&T(t),N(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!==B&&T(t);var i=A.attrHandle[e.toLowerCase()],n=i&&Y.call(A.attrHandle,e.toLowerCase())?i(t,e,!$):void 0;return void 0!==n?n:x.attributes||!$?t.getAttribute(e):(n=t.getAttributeNode(e))&&n.specified?n.value:null},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,i=[],n=0,o=0;if(M=!x.detectDuplicates,D=!x.sortStable&&t.slice(0),t.sort(q),M){for(;e=t[o++];)e===t[o]&&(n=i.push(o));for(;n--;)t.splice(i[n],1)}return D=null,t},_=e.getText=function(t){var e,i="",n=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=_(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[n++];)i+=_(e);return i},A=e.selectors={cacheLength:50,createPseudo:n,match:ft,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(xt,At),t[3]=(t[3]||t[4]||t[5]||"").replace(xt,At),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return ft.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&dt.test(i)&&(e=E(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(xt,At).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=U[t+" "];return e||(e=new RegExp("(^|"+it+")"+t+"("+it+"|$)"))&&U(t,function(t){return e.test("string"==typeof t.className&&t.className||"undefined"!=typeof t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,i,n){return function(o){var r=e.attr(o,t);return null==r?"!="===i:!i||(r+="","="===i?r===n:"!="===i?r!==n:"^="===i?n&&0===r.indexOf(n):"*="===i?n&&r.indexOf(n)>-1:"$="===i?n&&r.slice(-n.length)===n:"~="===i?(" "+r.replace(at," ")+" ").indexOf(n)>-1:"|="===i&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,i,n,o){var r="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===o?function(t){return!!t.parentNode}:function(e,i,l){var h,c,u,d,p,f,g=r!==s?"nextSibling":"previousSibling",m=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!l&&!a;if(m){if(r){for(;g;){for(u=e;u=u[g];)if(a?u.nodeName.toLowerCase()===v:1===u.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[s?m.firstChild:m.lastChild],s&&b){for(c=m[O]||(m[O]={}),h=c[t]||[],p=h[0]===H&&h[1],d=h[0]===H&&h[2],u=p&&m.childNodes[p];u=++p&&u&&u[g]||(d=p=0)||f.pop();)if(1===u.nodeType&&++d&&u===e){c[t]=[H,p,d];break}}else if(b&&(h=(e[O]||(e[O]={}))[t])&&h[0]===H)d=h[1];else for(;(u=++p&&u&&u[g]||(d=p=0)||f.pop())&&((a?u.nodeName.toLowerCase()!==v:1!==u.nodeType)||!++d||(b&&((u[O]||(u[O]={}))[t]=[H,d]),u!==e)););return d-=o,d===n||d%n===0&&d/n>=0}}},PSEUDO:function(t,i){var o,r=A.pseudos[t]||A.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return r[O]?r(i):r.length>1?(o=[t,t,"",i],A.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,e){for(var n,o=r(t,i),s=o.length;s--;)n=tt(t,o[s]),t[n]=!(e[n]=o[s])}):function(t){return r(t,0,o)}):r}},pseudos:{not:n(function(t){var e=[],i=[],o=k(t.replace(lt,"$1"));return o[O]?n(function(t,e,i,n){for(var r,s=o(t,null,n,[]),a=t.length;a--;)(r=s[a])&&(t[a]=!(e[a]=r))}):function(t,n,r){return e[0]=t,o(e,null,r,i),e[0]=null,!i.pop()}}),has:n(function(t){return function(i){return e(t,i).length>0}}),contains:n(function(t){return t=t.replace(xt,At),function(e){return(e.textContent||e.innerText||_(e)).indexOf(t)>-1}}),lang:n(function(t){return pt.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(xt,At).toLowerCase(),function(e){var i;do if(i=$?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return i=i.toLowerCase(),i===t||0===i.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType);return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===L},focus:function(t){return t===B.activeElement&&(!B.hasFocus||B.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:function(t){return t.disabled===!1},disabled:function(t){return t.disabled===!0},checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!A.pseudos.empty(t)},header:function(t){return mt.test(t.nodeName)},input:function(t){return gt.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:h(function(){return[0]}),last:h(function(t,e){return[e-1]}),eq:h(function(t,e,i){return[i<0?i+e:i]}),even:h(function(t,e){for(var i=0;i=0;)t.push(n);return t}),gt:h(function(t,e,i){for(var n=i<0?i+e:i;++n2&&"ID"===(s=r[0]).type&&x.getById&&9===e.nodeType&&$&&A.relative[r[1].type]){if(e=(A.find.ID(s.matches[0].replace(xt,At),e)||[])[0],!e)return i;h&&(e=e.parentNode),t=t.slice(r.shift().value.length)}for(o=ft.needsContext.test(t)?0:r.length;o--&&(s=r[o],!A.relative[a=s.type]);)if((l=A.find[a])&&(n=l(s.matches[0].replace(xt,At),yt.test(r[0].type)&&c(e.parentNode)||e))){if(r.splice(o,1),t=n.length&&d(r),!t)return J.apply(i,n),i;break}}return(h||k(t,u))(n,e,!$,i,yt.test(t)&&c(e.parentNode)||e),i},x.sortStable=O.split("").sort(q).join("")===O,x.detectDuplicates=!!M,T(),x.sortDetached=o(function(t){return 1&t.compareDocumentPosition(B.createElement("div"))}),o(function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")})||r("type|href|height|width",function(t,e,i){if(!i)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),x.attributes&&o(function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||r("value",function(t,e,i){if(!i&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),o(function(t){return null==t.getAttribute("disabled")})||r(et,function(t,e,i){var n;if(!i)return t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(i);nt.find=lt,nt.expr=lt.selectors,nt.expr[":"]=nt.expr.pseudos,nt.unique=lt.uniqueSort,nt.text=lt.getText,nt.isXMLDoc=lt.isXML,nt.contains=lt.contains;var ht=nt.expr.match.needsContext,ct=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,ut=/^.[^:#\[\.,]*$/;nt.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?nt.find.matchesSelector(n,t)?[n]:[]:nt.find.matches(t,nt.grep(e,function(t){return 1===t.nodeType}))},nt.fn.extend({find:function(t){var e,i=this.length,n=[],o=this;if("string"!=typeof t)return this.pushStack(nt(t).filter(function(){for(e=0;e1?nt.unique(n):n),n.selector=this.selector?this.selector+" "+t:t,n},filter:function(t){return this.pushStack(a(this,t||[],!1))},not:function(t){return this.pushStack(a(this,t||[],!0))},is:function(t){return!!a(this,"string"==typeof t&&ht.test(t)?nt(t):t||[],!1).length}});var dt,pt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,ft=nt.fn.init=function(t,e){var i,n;if(!t)return this;if("string"==typeof t){if(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:pt.exec(t),!i||!i[1]&&e)return!e||e.jquery?(e||dt).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof nt?e[0]:e,nt.merge(this,nt.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:et,!0)),ct.test(i[1])&&nt.isPlainObject(e))for(i in e)nt.isFunction(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return n=et.getElementById(i[2]),n&&n.parentNode&&(this.length=1,this[0]=n),this.context=et,this.selector=t,this}return t.nodeType?(this.context=this[0]=t,this.length=1,this):nt.isFunction(t)?"undefined"!=typeof dt.ready?dt.ready(t):t(nt):(void 0!==t.selector&&(this.selector=t.selector,this.context=t.context),nt.makeArray(t,this))};ft.prototype=nt.fn,dt=nt(et);var gt=/^(?:parents|prev(?:Until|All))/,mt={children:!0,contents:!0,next:!0,prev:!0};nt.extend({dir:function(t,e,i){for(var n=[],o=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(o&&nt(t).is(i))break;n.push(t)}return n},sibling:function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i}}),nt.fn.extend({has:function(t){var e=nt(t,this),i=e.length;return this.filter(function(){for(var t=0;t-1:1===i.nodeType&&nt.find.matchesSelector(i,t))){r.push(i);break}return this.pushStack(r.length>1?nt.unique(r):r)},index:function(t){return t?"string"==typeof t?Q.call(nt(t),this[0]):Q.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(nt.unique(nt.merge(this.get(),nt(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),nt.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return nt.dir(t,"parentNode")},parentsUntil:function(t,e,i){return nt.dir(t,"parentNode",i)},next:function(t){return l(t,"nextSibling")},prev:function(t){return l(t,"previousSibling")},nextAll:function(t){return nt.dir(t,"nextSibling")},prevAll:function(t){return nt.dir(t,"previousSibling")},nextUntil:function(t,e,i){return nt.dir(t,"nextSibling",i)},prevUntil:function(t,e,i){return nt.dir(t,"previousSibling",i)},siblings:function(t){return nt.sibling((t.parentNode||{}).firstChild,t)},children:function(t){return nt.sibling(t.firstChild)},contents:function(t){return t.contentDocument||nt.merge([],t.childNodes)}},function(t,e){nt.fn[t]=function(i,n){var o=nt.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(o=nt.filter(n,o)),this.length>1&&(mt[t]||nt.unique(o),gt.test(t)&&o.reverse()),this.pushStack(o)}});var vt=/\S+/g,bt={};nt.Callbacks=function(t){t="string"==typeof t?bt[t]||h(t):nt.extend({},t);var e,i,n,o,r,s,a=[],l=!t.once&&[],c=function(h){for(e=t.memory&&h,i=!0,s=o||0,o=0,r=a.length,n=!0;a&&s-1;)a.splice(i,1),n&&(i<=r&&r--,i<=s&&s--)}),this},has:function(t){return t?nt.inArray(t,a)>-1:!(!a||!a.length)},empty:function(){return a=[],r=0,this},disable:function(){return a=l=e=void 0,this},disabled:function(){return!a},lock:function(){return l=void 0,e||u.disable(),this},locked:function(){return!l},fireWith:function(t,e){return!a||i&&!l||(e=e||[],e=[t,e.slice?e.slice():e],n?l.push(e):c(e)),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},nt.extend({Deferred:function(t){var e=[["resolve","done",nt.Callbacks("once memory"),"resolved"],["reject","fail",nt.Callbacks("once memory"),"rejected"],["notify","progress",nt.Callbacks("memory")]],i="pending",n={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},then:function(){var t=arguments;return nt.Deferred(function(i){nt.each(e,function(e,r){var s=nt.isFunction(t[e])&&t[e];o[r[1]](function(){var t=s&&s.apply(this,arguments);t&&nt.isFunction(t.promise)?t.promise().done(i.resolve).fail(i.reject).progress(i.notify):i[r[0]+"With"](this===n?i.promise():this,s?[t]:arguments)})}),t=null}).promise()},promise:function(t){return null!=t?nt.extend(t,n):n}},o={};return n.pipe=n.then,nt.each(e,function(t,r){var s=r[2],a=r[3];n[r[1]]=s.add,a&&s.add(function(){i=a},e[1^t][2].disable,e[2][2].lock),o[r[0]]=function(){return o[r[0]+"With"](this===o?n:this,arguments),this},o[r[0]+"With"]=s.fireWith}),n.promise(o),t&&t.call(o,o),o},when:function(t){var e,i,n,o=0,r=K.call(arguments),s=r.length,a=1!==s||t&&nt.isFunction(t.promise)?s:0,l=1===a?t:nt.Deferred(),h=function(t,i,n){return function(o){i[t]=this,n[t]=arguments.length>1?K.call(arguments):o,n===e?l.notifyWith(i,n):--a||l.resolveWith(i,n)}};if(s>1)for(e=new Array(s),i=new Array(s),n=new Array(s);o0||(yt.resolveWith(et,[nt]),nt.fn.triggerHandler&&(nt(et).triggerHandler("ready"),nt(et).off("ready"))))}}),nt.ready.promise=function(t){return yt||(yt=nt.Deferred(),"complete"===et.readyState?setTimeout(nt.ready):(et.addEventListener("DOMContentLoaded",c,!1),i.addEventListener("load",c,!1))),yt.promise(t)},nt.ready.promise();var wt=nt.access=function(t,e,i,n,o,r,s){var a=0,l=t.length,h=null==i;if("object"===nt.type(i)){o=!0;for(a in i)nt.access(t,e,a,i[a],!0,r,s)}else if(void 0!==n&&(o=!0,nt.isFunction(n)||(s=!0),h&&(s?(e.call(t,n),e=null):(h=e,e=function(t,e,i){return h.call(nt(t),i)})),e))for(;a1,null,!0)},removeData:function(t){return this.each(function(){At.remove(this,t)})}}),nt.extend({queue:function(t,e,i){var n;if(t)return e=(e||"fx")+"queue",n=xt.get(t,e),i&&(!n||nt.isArray(i)?n=xt.access(t,e,nt.makeArray(i)):n.push(i)),n||[]},dequeue:function(t,e){e=e||"fx";var i=nt.queue(t,e),n=i.length,o=i.shift(),r=nt._queueHooks(t,e),s=function(){nt.dequeue(t,e)};"inprogress"===o&&(o=i.shift(),n--),o&&("fx"===e&&i.unshift("inprogress"),delete r.stop,o.call(t,s,r)),!n&&r&&r.empty.fire()},_queueHooks:function(t,e){var i=e+"queueHooks";return xt.get(t,i)||xt.access(t,i,{empty:nt.Callbacks("once memory").add(function(){xt.remove(t,[e+"queue",i])})})}}),nt.fn.extend({queue:function(t,e){var i=2;return"string"!=typeof t&&(e=t,t="fx",i--),arguments.lengthx",tt.noCloneChecked=!!e.cloneNode(!0).lastChild.defaultValue}();var Dt="undefined";tt.focusinBubbles="onfocusin"in i;var Mt=/^key/,Tt=/^(?:mouse|pointer|contextmenu)|click/,Bt=/^(?:focusinfocus|focusoutblur)$/,Lt=/^([^.]*)(?:\.(.+)|)$/;nt.event={global:{},add:function(t,e,i,n,o){var r,s,a,l,h,c,u,d,p,f,g,m=xt.get(t);if(m)for(i.handler&&(r=i,i=r.handler,o=r.selector),i.guid||(i.guid=nt.guid++),(l=m.events)||(l=m.events={}),(s=m.handle)||(s=m.handle=function(e){return typeof nt!==Dt&&nt.event.triggered!==e.type?nt.event.dispatch.apply(t,arguments):void 0}),e=(e||"").match(vt)||[""],h=e.length;h--;)a=Lt.exec(e[h])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p&&(u=nt.event.special[p]||{},p=(o?u.delegateType:u.bindType)||p,u=nt.event.special[p]||{},c=nt.extend({type:p,origType:g,data:n,handler:i,guid:i.guid,selector:o,needsContext:o&&nt.expr.match.needsContext.test(o),namespace:f.join(".")},r),(d=l[p])||(d=l[p]=[],d.delegateCount=0,u.setup&&u.setup.call(t,n,f,s)!==!1||t.addEventListener&&t.addEventListener(p,s,!1)),u.add&&(u.add.call(t,c),c.handler.guid||(c.handler.guid=i.guid)),o?d.splice(d.delegateCount++,0,c):d.push(c),nt.event.global[p]=!0)},remove:function(t,e,i,n,o){var r,s,a,l,h,c,u,d,p,f,g,m=xt.hasData(t)&&xt.get(t);if(m&&(l=m.events)){for(e=(e||"").match(vt)||[""],h=e.length;h--;)if(a=Lt.exec(e[h])||[],p=g=a[1],f=(a[2]||"").split(".").sort(),p){for(u=nt.event.special[p]||{},p=(n?u.delegateType:u.bindType)||p,d=l[p]||[],a=a[2]&&new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=r=d.length;r--;)c=d[r],!o&&g!==c.origType||i&&i.guid!==c.guid||a&&!a.test(c.namespace)||n&&n!==c.selector&&("**"!==n||!c.selector)||(d.splice(r,1),c.selector&&d.delegateCount--,u.remove&&u.remove.call(t,c));s&&!d.length&&(u.teardown&&u.teardown.call(t,f,m.handle)!==!1||nt.removeEvent(t,p,m.handle),delete l[p])}else for(p in l)nt.event.remove(t,p+e[h],i,n,!0);nt.isEmptyObject(l)&&(delete m.handle,xt.remove(t,"events"))}},trigger:function(t,e,n,o){var r,s,a,l,h,c,u,d=[n||et],p=Z.call(t,"type")?t.type:t,f=Z.call(t,"namespace")?t.namespace.split("."):[];if(s=a=n=n||et,3!==n.nodeType&&8!==n.nodeType&&!Bt.test(p+nt.event.triggered)&&(p.indexOf(".")>=0&&(f=p.split("."),p=f.shift(),f.sort()),h=p.indexOf(":")<0&&"on"+p,t=t[nt.expando]?t:new nt.Event(p,"object"==typeof t&&t),t.isTrigger=o?2:3, +t.namespace=f.join("."),t.namespace_re=t.namespace?new RegExp("(^|\\.)"+f.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=n),e=null==e?[t]:nt.makeArray(e,[t]),u=nt.event.special[p]||{},o||!u.trigger||u.trigger.apply(n,e)!==!1)){if(!o&&!u.noBubble&&!nt.isWindow(n)){for(l=u.delegateType||p,Bt.test(l+p)||(s=s.parentNode);s;s=s.parentNode)d.push(s),a=s;a===(n.ownerDocument||et)&&d.push(a.defaultView||a.parentWindow||i)}for(r=0;(s=d[r++])&&!t.isPropagationStopped();)t.type=r>1?l:u.bindType||p,c=(xt.get(s,"events")||{})[t.type]&&xt.get(s,"handle"),c&&c.apply(s,e),c=h&&s[h],c&&c.apply&&nt.acceptData(s)&&(t.result=c.apply(s,e),t.result===!1&&t.preventDefault());return t.type=p,o||t.isDefaultPrevented()||u._default&&u._default.apply(d.pop(),e)!==!1||!nt.acceptData(n)||h&&nt.isFunction(n[p])&&!nt.isWindow(n)&&(a=n[h],a&&(n[h]=null),nt.event.triggered=p,n[p](),nt.event.triggered=void 0,a&&(n[h]=a)),t.result}},dispatch:function(t){t=nt.event.fix(t);var e,i,n,o,r,s=[],a=K.call(arguments),l=(xt.get(this,"events")||{})[t.type]||[],h=nt.event.special[t.type]||{};if(a[0]=t,t.delegateTarget=this,!h.preDispatch||h.preDispatch.call(this,t)!==!1){for(s=nt.event.handlers.call(this,t,l),e=0;(o=s[e++])&&!t.isPropagationStopped();)for(t.currentTarget=o.elem,i=0;(r=o.handlers[i++])&&!t.isImmediatePropagationStopped();)t.namespace_re&&!t.namespace_re.test(r.namespace)||(t.handleObj=r,t.data=r.data,n=((nt.event.special[r.origType]||{}).handle||r.handler).apply(o.elem,a),void 0!==n&&(t.result=n)===!1&&(t.preventDefault(),t.stopPropagation()));return h.postDispatch&&h.postDispatch.call(this,t),t.result}},handlers:function(t,e){var i,n,o,r,s=[],a=e.delegateCount,l=t.target;if(a&&l.nodeType&&(!t.button||"click"!==t.type))for(;l!==this;l=l.parentNode||this)if(l.disabled!==!0||"click"!==t.type){for(n=[],i=0;i=0:nt.find(o,this,null,[l]).length),n[o]&&n.push(r);n.length&&s.push({elem:l,handlers:n})}return a]*)\/>/gi,Rt=/<([\w:]+)/,It=/<|&#?\w+;/,zt=/<(?:script|style|link)/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,Ot=/^$|\/(?:java|ecma)script/i,Pt=/^true\/(.*)/,Ht=/^\s*\s*$/g,Wt={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};Wt.optgroup=Wt.option,Wt.tbody=Wt.tfoot=Wt.colgroup=Wt.caption=Wt.thead,Wt.th=Wt.td,nt.extend({clone:function(t,e,i){var n,o,r,s,a=t.cloneNode(!0),l=nt.contains(t.ownerDocument,t);if(!(tt.noCloneChecked||1!==t.nodeType&&11!==t.nodeType||nt.isXMLDoc(t)))for(s=x(a),r=x(t),n=0,o=r.length;n0&&y(s,!l&&x(t,"script")),a},buildFragment:function(t,e,i,n){for(var o,r,s,a,l,h,c=e.createDocumentFragment(),u=[],d=0,p=t.length;d")+a[2],h=a[0];h--;)r=r.lastChild;nt.merge(u,r.childNodes),r=c.firstChild,r.textContent=""}else u.push(e.createTextNode(o));for(c.textContent="",d=0;o=u[d++];)if((!n||nt.inArray(o,n)===-1)&&(l=nt.contains(o.ownerDocument,o),r=x(c.appendChild(o),"script"),l&&y(r),i))for(h=0;o=r[h++];)Ot.test(o.type||"")&&i.push(o);return c},cleanData:function(t){for(var e,i,n,o,r=nt.event.special,s=0;void 0!==(i=t[s]);s++){if(nt.acceptData(i)&&(o=i[xt.expando],o&&(e=xt.cache[o]))){if(e.events)for(n in e.events)r[n]?nt.event.remove(i,n):nt.removeEvent(i,n,e.handle);xt.cache[o]&&delete xt.cache[o]}delete At.cache[i[At.expando]]}}}),nt.fn.extend({text:function(t){return wt(this,function(t){return void 0===t?nt.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)})},null,t,arguments.length)},append:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=m(this,t);e.appendChild(t)}})},prepend:function(){return this.domManip(arguments,function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=m(this,t);e.insertBefore(t,e.firstChild)}})},before:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this)})},after:function(){return this.domManip(arguments,function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)})},remove:function(t,e){for(var i,n=t?nt.filter(t,this):this,o=0;null!=(i=n[o]);o++)e||1!==i.nodeType||nt.cleanData(x(i)),i.parentNode&&(e&&nt.contains(i.ownerDocument,i)&&y(x(i,"script")),i.parentNode.removeChild(i));return this},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(nt.cleanData(x(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map(function(){return nt.clone(this,t,e)})},html:function(t){return wt(this,function(t){var e=this[0]||{},i=0,n=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!zt.test(t)&&!Wt[(Rt.exec(t)||["",""])[1].toLowerCase()]){t=t.replace($t,"<$1>");try{for(;i1&&"string"==typeof d&&!tt.checkClone&&Nt.test(d))return this.each(function(i){var n=c.eq(i);p&&(t[0]=d.call(this,i,n.html())),n.domManip(t,e)});if(h&&(i=nt.buildFragment(t,this[0].ownerDocument,!1,this),n=i.firstChild,1===i.childNodes.length&&(i=n),n)){for(o=nt.map(x(i,"script"),v),r=o.length;l1)},show:function(){return T(this,!0)},hide:function(){return T(this)},toggle:function(t){return"boolean"==typeof t?t?this.show():this.hide():this.each(function(){Ft(this)?nt(this).show():nt(this).hide()})}}),nt.Tween=B,B.prototype={constructor:B,init:function(t,e,i,n,o,r){this.elem=t,this.prop=i,this.easing=o||"swing",this.options=e,this.start=this.now=this.cur(),this.end=n,this.unit=r||(nt.cssNumber[i]?"":"px")},cur:function(){var t=B.propHooks[this.prop];return t&&t.get?t.get(this):B.propHooks._default.get(this)},run:function(t){var e,i=B.propHooks[this.prop];return this.options.duration?this.pos=e=nt.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),i&&i.set?i.set(this):B.propHooks._default.set(this),this}},B.prototype.init.prototype=B.prototype,B.propHooks={_default:{get:function(t){var e;return null==t.elem[t.prop]||t.elem.style&&null!=t.elem.style[t.prop]?(e=nt.css(t.elem,t.prop,""),e&&"auto"!==e?e:0):t.elem[t.prop]},set:function(t){nt.fx.step[t.prop]?nt.fx.step[t.prop](t):t.elem.style&&(null!=t.elem.style[nt.cssProps[t.prop]]||nt.cssHooks[t.prop])?nt.style(t.elem,t.prop,t.now+t.unit):t.elem[t.prop]=t.now}}},B.propHooks.scrollTop=B.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},nt.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2}},nt.fx=B.prototype.init,nt.fx.step={};var te,ee,ie=/^(?:toggle|show|hide)$/,ne=new RegExp("^(?:([+-])=|)("+Et+")([a-z%]*)$","i"),oe=/queueHooks$/,re=[I],se={"*":[function(t,e){var i=this.createTween(t,e),n=i.cur(),o=ne.exec(e),r=o&&o[3]||(nt.cssNumber[t]?"":"px"),s=(nt.cssNumber[t]||"px"!==r&&+n)&&ne.exec(nt.css(i.elem,t)),a=1,l=20;if(s&&s[3]!==r){r=r||s[3],o=o||[],s=+n||1;do a=a||".5",s/=a,nt.style(i.elem,t,s+r);while(a!==(a=i.cur()/n)&&1!==a&&--l)}return o&&(s=i.start=+s||+n||0,i.unit=r,i.end=o[1]?s+(o[1]+1)*o[2]:+o[2]),i}]};nt.Animation=nt.extend(N,{tweener:function(t,e){nt.isFunction(t)?(e=t,t=["*"]):t=t.split(" ");for(var i,n=0,o=t.length;n1)},removeAttr:function(t){return this.each(function(){nt.removeAttr(this,t)})}}),nt.extend({attr:function(t,e,i){var n,o,r=t.nodeType;if(t&&3!==r&&8!==r&&2!==r)return typeof t.getAttribute===Dt?nt.prop(t,e,i):(1===r&&nt.isXMLDoc(t)||(e=e.toLowerCase(),n=nt.attrHooks[e]||(nt.expr.match.bool.test(e)?le:ae)),void 0===i?n&&"get"in n&&null!==(o=n.get(t,e))?o:(o=nt.find.attr(t,e),null==o?void 0:o):null!==i?n&&"set"in n&&void 0!==(o=n.set(t,i,e))?o:(t.setAttribute(e,i+""),i):void nt.removeAttr(t,e))},removeAttr:function(t,e){var i,n,o=0,r=e&&e.match(vt);if(r&&1===t.nodeType)for(;i=r[o++];)n=nt.propFix[i]||i,nt.expr.match.bool.test(i)&&(t[n]=!1),t.removeAttribute(i)},attrHooks:{type:{set:function(t,e){if(!tt.radioValue&&"radio"===e&&nt.nodeName(t,"input")){var i=t.value;return t.setAttribute("type",e),i&&(t.value=i),e}}}}}),le={set:function(t,e,i){return e===!1?nt.removeAttr(t,i):t.setAttribute(i,i),i}},nt.each(nt.expr.match.bool.source.match(/\w+/g),function(t,e){var i=he[e]||nt.find.attr;he[e]=function(t,e,n){var o,r;return n||(r=he[e],he[e]=o,o=null!=i(t,e,n)?e.toLowerCase():null,he[e]=r),o}});var ce=/^(?:input|select|textarea|button)$/i;nt.fn.extend({prop:function(t,e){return wt(this,nt.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each(function(){delete this[nt.propFix[t]||t]})}}),nt.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(t,e,i){var n,o,r,s=t.nodeType;if(t&&3!==s&&8!==s&&2!==s)return r=1!==s||!nt.isXMLDoc(t),r&&(e=nt.propFix[e]||e,o=nt.propHooks[e]),void 0!==i?o&&"set"in o&&void 0!==(n=o.set(t,i,e))?n:t[e]=i:o&&"get"in o&&null!==(n=o.get(t,e))?n:t[e]},propHooks:{tabIndex:{get:function(t){return t.hasAttribute("tabindex")||ce.test(t.nodeName)||t.href?t.tabIndex:-1}}}}),tt.optSelected||(nt.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null}}),nt.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){nt.propFix[this.toLowerCase()]=this});var ue=/[\t\r\n\f]/g;nt.fn.extend({addClass:function(t){var e,i,n,o,r,s,a="string"==typeof t&&t,l=0,h=this.length;if(nt.isFunction(t))return this.each(function(e){nt(this).addClass(t.call(this,e,this.className))});if(a)for(e=(t||"").match(vt)||[];l=0;)n=n.replace(" "+o+" "," ");s=t?nt.trim(n):"",i.className!==s&&(i.className=s)}return this},toggleClass:function(t,e){var i=typeof t;return"boolean"==typeof e&&"string"===i?e?this.addClass(t):this.removeClass(t):nt.isFunction(t)?this.each(function(i){nt(this).toggleClass(t.call(this,i,this.className,e),e)}):this.each(function(){if("string"===i)for(var e,n=0,o=nt(this),r=t.match(vt)||[];e=r[n++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else i!==Dt&&"boolean"!==i||(this.className&&xt.set(this,"__className__",this.className),this.className=this.className||t===!1?"":xt.get(this,"__className__")||"")})},hasClass:function(t){for(var e=" "+t+" ",i=0,n=this.length;i=0)return!0;return!1}});var de=/\r/g;nt.fn.extend({val:function(t){var e,i,n,o=this[0];{if(arguments.length)return n=nt.isFunction(t),this.each(function(i){var o;1===this.nodeType&&(o=n?t.call(this,i,nt(this).val()):t,null==o?o="":"number"==typeof o?o+="":nt.isArray(o)&&(o=nt.map(o,function(t){return null==t?"":t+""})),e=nt.valHooks[this.type]||nt.valHooks[this.nodeName.toLowerCase()],e&&"set"in e&&void 0!==e.set(this,o,"value")||(this.value=o))});if(o)return e=nt.valHooks[o.type]||nt.valHooks[o.nodeName.toLowerCase()],e&&"get"in e&&void 0!==(i=e.get(o,"value"))?i:(i=o.value,"string"==typeof i?i.replace(de,""):null==i?"":i)}}}),nt.extend({valHooks:{option:{get:function(t){var e=nt.find.attr(t,"value");return null!=e?e:nt.trim(nt.text(t))}},select:{get:function(t){for(var e,i,n=t.options,o=t.selectedIndex,r="select-one"===t.type||o<0,s=r?null:[],a=r?o+1:n.length,l=o<0?a:r?o:0;l=0)&&(i=!0);return i||(t.selectedIndex=-1),r}}}}),nt.each(["radio","checkbox"],function(){nt.valHooks[this]={set:function(t,e){if(nt.isArray(e))return t.checked=nt.inArray(nt(t).val(),e)>=0}},tt.checkOn||(nt.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})}),nt.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(t,e){nt.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}}),nt.fn.extend({hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)},bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)}});var pe=nt.now(),fe=/\?/;nt.parseJSON=function(t){return JSON.parse(t+"")},nt.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{i=new DOMParser,e=i.parseFromString(t,"text/xml")}catch(n){e=void 0}return e&&!e.getElementsByTagName("parsererror").length||nt.error("Invalid XML: "+t),e};var ge=/#.*$/,me=/([?&])_=[^&]*/,ve=/^(.*?):[ \t]*([^\r\n]*)$/gm,be=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,ye=/^(?:GET|HEAD)$/,we=/^\/\//,xe=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,Ae={},_e={},Ce="*/".concat("*"),Ee=i.location.href,ke=xe.exec(Ee.toLowerCase())||[];nt.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ee,type:"GET",isLocal:be.test(ke[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Ce,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":nt.parseJSON,"text xml":nt.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?H(H(t,nt.ajaxSettings),e):H(nt.ajaxSettings,t)},ajaxPrefilter:O(Ae),ajaxTransport:O(_e),ajax:function(t,e){function i(t,e,i,s){var l,c,v,b,w,A=e;2!==y&&(y=2,a&&clearTimeout(a),n=void 0,r=s||"",x.readyState=t>0?4:0,l=t>=200&&t<300||304===t,i&&(b=W(u,x,i)),b=U(u,b,x,l),l?(u.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(nt.lastModified[o]=w),w=x.getResponseHeader("etag"),w&&(nt.etag[o]=w)),204===t||"HEAD"===u.type?A="nocontent":304===t?A="notmodified":(A=b.state,c=b.data,v=b.error,l=!v)):(v=A,!t&&A||(A="error",t<0&&(t=0))),x.status=t,x.statusText=(e||A)+"",l?f.resolveWith(d,[c,A,x]):f.rejectWith(d,[x,A,v]),x.statusCode(m),m=void 0,h&&p.trigger(l?"ajaxSuccess":"ajaxError",[x,u,l?c:v]),g.fireWith(d,[x,A]),h&&(p.trigger("ajaxComplete",[x,u]),--nt.active||nt.event.trigger("ajaxStop")))}"object"==typeof t&&(e=t,t=void 0),e=e||{};var n,o,r,s,a,l,h,c,u=nt.ajaxSetup({},e),d=u.context||u,p=u.context&&(d.nodeType||d.jquery)?nt(d):nt.event,f=nt.Deferred(),g=nt.Callbacks("once memory"),m=u.statusCode||{},v={},b={},y=0,w="canceled",x={readyState:0,getResponseHeader:function(t){var e;if(2===y){if(!s)for(s={};e=ve.exec(r);)s[e[1].toLowerCase()]=e[2];e=s[t.toLowerCase()]}return null==e?null:e},getAllResponseHeaders:function(){return 2===y?r:null},setRequestHeader:function(t,e){var i=t.toLowerCase();return y||(t=b[i]=b[i]||t,v[t]=e),this},overrideMimeType:function(t){return y||(u.mimeType=t),this},statusCode:function(t){var e;if(t)if(y<2)for(e in t)m[e]=[m[e],t[e]];else x.always(t[x.status]);return this},abort:function(t){var e=t||w;return n&&n.abort(e),i(0,e),this}};if(f.promise(x).complete=g.add,x.success=x.done,x.error=x.fail,u.url=((t||u.url||Ee)+"").replace(ge,"").replace(we,ke[1]+"//"),u.type=e.method||e.type||u.method||u.type,u.dataTypes=nt.trim(u.dataType||"*").toLowerCase().match(vt)||[""],null==u.crossDomain&&(l=xe.exec(u.url.toLowerCase()),u.crossDomain=!(!l||l[1]===ke[1]&&l[2]===ke[2]&&(l[3]||("http:"===l[1]?"80":"443"))===(ke[3]||("http:"===ke[1]?"80":"443")))),u.data&&u.processData&&"string"!=typeof u.data&&(u.data=nt.param(u.data,u.traditional)),P(Ae,u,e,x),2===y)return x;h=nt.event&&u.global,h&&0===nt.active++&&nt.event.trigger("ajaxStart"),u.type=u.type.toUpperCase(),u.hasContent=!ye.test(u.type),o=u.url,u.hasContent||(u.data&&(o=u.url+=(fe.test(o)?"&":"?")+u.data,delete u.data),u.cache===!1&&(u.url=me.test(o)?o.replace(me,"$1_="+pe++):o+(fe.test(o)?"&":"?")+"_="+pe++)),u.ifModified&&(nt.lastModified[o]&&x.setRequestHeader("If-Modified-Since",nt.lastModified[o]),nt.etag[o]&&x.setRequestHeader("If-None-Match",nt.etag[o])),(u.data&&u.hasContent&&u.contentType!==!1||e.contentType)&&x.setRequestHeader("Content-Type",u.contentType),x.setRequestHeader("Accept",u.dataTypes[0]&&u.accepts[u.dataTypes[0]]?u.accepts[u.dataTypes[0]]+("*"!==u.dataTypes[0]?", "+Ce+"; q=0.01":""):u.accepts["*"]);for(c in u.headers)x.setRequestHeader(c,u.headers[c]);if(u.beforeSend&&(u.beforeSend.call(d,x,u)===!1||2===y))return x.abort();w="abort";for(c in{success:1,error:1,complete:1})x[c](u[c]);if(n=P(_e,u,e,x)){x.readyState=1,h&&p.trigger("ajaxSend",[x,u]),u.async&&u.timeout>0&&(a=setTimeout(function(){x.abort("timeout")},u.timeout));try{y=1,n.send(v,i)}catch(A){if(!(y<2))throw A;i(-1,A)}}else i(-1,"No Transport");return x},getJSON:function(t,e,i){return nt.get(t,e,i,"json")},getScript:function(t,e){return nt.get(t,void 0,e,"script")}}),nt.each(["get","post"],function(t,e){nt[e]=function(t,i,n,o){return nt.isFunction(i)&&(o=o||n,n=i,i=void 0),nt.ajax({url:t,type:e,dataType:o,data:i,success:n})}}),nt._evalUrl=function(t){return nt.ajax({url:t,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},nt.fn.extend({wrapAll:function(t){var e;return nt.isFunction(t)?this.each(function(e){nt(this).wrapAll(t.call(this,e))}):(this[0]&&(e=nt(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this)},wrapInner:function(t){return nt.isFunction(t)?this.each(function(e){nt(this).wrapInner(t.call(this,e))}):this.each(function(){var e=nt(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=nt.isFunction(t);return this.each(function(i){nt(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(){return this.parent().each(function(){ +nt.nodeName(this,"body")||nt(this).replaceWith(this.childNodes)}).end()}}),nt.expr.filters.hidden=function(t){return t.offsetWidth<=0&&t.offsetHeight<=0},nt.expr.filters.visible=function(t){return!nt.expr.filters.hidden(t)};var Fe=/%20/g,Se=/\[\]$/,De=/\r?\n/g,Me=/^(?:submit|button|image|reset|file)$/i,Te=/^(?:input|select|textarea|keygen)/i;nt.param=function(t,e){var i,n=[],o=function(t,e){e=nt.isFunction(e)?e():null==e?"":e,n[n.length]=encodeURIComponent(t)+"="+encodeURIComponent(e)};if(void 0===e&&(e=nt.ajaxSettings&&nt.ajaxSettings.traditional),nt.isArray(t)||t.jquery&&!nt.isPlainObject(t))nt.each(t,function(){o(this.name,this.value)});else for(i in t)j(i,t[i],e,o);return n.join("&").replace(Fe,"+")},nt.fn.extend({serialize:function(){return nt.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var t=nt.prop(this,"elements");return t?nt.makeArray(t):this}).filter(function(){var t=this.type;return this.name&&!nt(this).is(":disabled")&&Te.test(this.nodeName)&&!Me.test(t)&&(this.checked||!St.test(t))}).map(function(t,e){var i=nt(this).val();return null==i?null:nt.isArray(i)?nt.map(i,function(t){return{name:e.name,value:t.replace(De,"\r\n")}}):{name:e.name,value:i.replace(De,"\r\n")}}).get()}}),nt.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(t){}};var Be=0,Le={},$e={0:200,1223:204},Re=nt.ajaxSettings.xhr();i.attachEvent&&i.attachEvent("onunload",function(){for(var t in Le)Le[t]()}),tt.cors=!!Re&&"withCredentials"in Re,tt.ajax=Re=!!Re,nt.ajaxTransport(function(t){var e;if(tt.cors||Re&&!t.crossDomain)return{send:function(i,n){var o,r=t.xhr(),s=++Be;if(r.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(o in t.xhrFields)r[o]=t.xhrFields[o];t.mimeType&&r.overrideMimeType&&r.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");for(o in i)r.setRequestHeader(o,i[o]);e=function(t){return function(){e&&(delete Le[s],e=r.onload=r.onerror=null,"abort"===t?r.abort():"error"===t?n(r.status,r.statusText):n($e[r.status]||r.status,r.statusText,"string"==typeof r.responseText?{text:r.responseText}:void 0,r.getAllResponseHeaders()))}},r.onload=e(),r.onerror=e("error"),e=Le[s]=e("abort");try{r.send(t.hasContent&&t.data||null)}catch(a){if(e)throw a}},abort:function(){e&&e()}}}),nt.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(t){return nt.globalEval(t),t}}}),nt.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),nt.ajaxTransport("script",function(t){if(t.crossDomain){var e,i;return{send:function(n,o){e=nt(" - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/package.json b/package.json new file mode 100644 index 00000000..92833662 --- /dev/null +++ b/package.json @@ -0,0 +1,38 @@ +{ + "name": "nengo", + "version": "0.2.1", + "description": "Frontend components for Nengo GUI", + "author": "Nengo developers", + "license": "Free for non-commercial use", + "main": "nengo_gui/static/dist/nengo.js", + "repository": { + "type": "git", + "url": "https://github.com/nengo/nengo_gui.git" + }, + "bugs": { + "url": "https://github.com/nengo/nengo_gui/issues" + }, + "private": true, + "scripts": { + "build": "webpack --debug --devtool source-map --output-pathinfo", + "release": "webpack --optimize-minimize --optimize-occurence-order" + }, + "devDependencies": { + "bootstrap": "^3.3.4", + "bootstrap-validator": "^0.8.1", + "brace": "^0.8.0", + "css-loader": "^0.23.1", + "css-to-string-loader": "^0.1.1", + "d3": "^3.5.3", + "expose-loader": "^0.7.1", + "file-loader": "^0.9.0", + "imports-loader": "^0.6.5", + "interact.js": "^1.2.4", + "jquery": "^2.1.3", + "jquery-ui": "^1.10.4", + "jqueryfiletree": "jqueryfiletree/jqueryfiletree#2.1.4", + "style-loader": "^0.13.1", + "url-loader": "^0.5.7", + "webpack": "^1.13.1" + } +} diff --git a/webpack.config.js b/webpack.config.js new file mode 100644 index 00000000..8ef9dcfd --- /dev/null +++ b/webpack.config.js @@ -0,0 +1,41 @@ +var path = require('path'); +var webpack = require('webpack'); + +module.exports = { + context: __dirname, // Paths are relative to nengo_gui + // Putting the entry point in a list is a workaround for this error: + // Error: a dependency to an entry point is not allowed + entry: ['./nengo_gui/static/nengo.js'], + output: { + path: './nengo_gui/static/dist', + filename: 'nengo.js', + libraryTarget: 'var', + library: 'Nengo', + publicPath: '/static/dist/' // Fixes issue finding emitted files + }, + resolve: { + extensions: ['', '.js'] + }, + module: { + loaders: [ + { test: /\.css$/, loader: 'style-loader!css-loader' }, + { test: /\.ico$/, loader: 'file-loader?name=[name].[ext]' }, + { test: /\.(png|jpg|gif)$/, loader: 'url-loader?limit=8192' }, + { + test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loader: 'url-loader?limit=8192&mimetype=application/font-woff&name=./[hash].[ext]' + }, + { + test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, + loader: 'file-loader?name=./[hash].[ext]' + } + ] + }, + plugins: [ + new webpack.ProvidePlugin({ + $: 'jquery', + jQuery: 'jquery', + "window.jQuery": 'jquery', + }) + ] +}