34 lines
641 KiB
JavaScript
34 lines
641 KiB
JavaScript
|
/*!
|
|||
|
* jQuery JavaScript Library v1.8.1
|
|||
|
* http://jquery.com/
|
|||
|
*
|
|||
|
* Includes Sizzle.js
|
|||
|
* http://sizzlejs.com/
|
|||
|
*
|
|||
|
* Copyright 2012 jQuery Foundation and other contributors
|
|||
|
* Released under the MIT license
|
|||
|
* http://jquery.org/license
|
|||
|
*
|
|||
|
* Date: Thu Aug 30 2012 17:17:22 GMT-0400 (Eastern Daylight Time)
|
|||
|
*/
|
|||
|
function BestInPlaceEditor(e){this.element=e,this.initOptions(),this.bindForm(),this.initNil(),jQuery(this.activator).bind("click",{editor:this},this.clickHandler)}function openAnalyze(){analyzeOpen=!0,findOpen&&closeFind(),organizeOpen&&closeOrganize(),$("#sideOptionFind").css("z-index","8"),$("#sideOptionAnalyze, #closeAnalyze").css("z-index","10"),$("#sideOptionOrganize").css("z-index","8"),$("#sideOptionAnalyze").animate({width:"100px",height:"76px"},100),$("#closeAnalyze").css("display","block"),$("#sideOptionAnalyze").css("cursor","default")}function closeAnalyze(){analyzeOpen=!1,$("#closeAnalyze").css("display","none"),$("#sideOptionAnalyze").css("cursor","pointer"),$("#sideOptionAnalyze").animate({width:"64px",height:"32px"},100)}function switchVisible(e,t){categoryVisible[e]==1?hideCategory(e,t):categoryVisible[e]==0&&showCategory(e,t)}function hideCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",.4,"end"),t.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function showCategory(e,t){t==null&&(t=500),Mconsole.graph.eachNode(function(t){t.getData("metacode")==e&&(t.setData("alpha",1,"end"),t.eachAdjacency(function(e){e.setData("alpha",1,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:t})}function hideAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){!e.getData("inCommons")&&!e.getData("onCanvas")&&(e.setData("alpha",.4,"end"),e.eachAdjacency(function(e){e.setData("alpha",.4,"end")}))}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function showAll(e){e==null&&(e=500),Mconsole.graph.eachNode(function(e){e.setData("alpha",1,"end"),e.eachAdjacency(function(e){e.setData("alpha",1,"end")})}),Mconsole.fx.animate({modes:["node-property:alpha","edge-property:alpha"],duration:e})}function onCanvasSearch(e,t,n){Mconsole.graph.eachNode(function(r){e!=null?r.name.indexOf(e)!==-1&&e!=""?r.setData("onCanvas",!0):r.setData("onCanvas",!1):t!=null?r.getData("inmaps").indexOf(parseInt(t))!==-1?r.setData("onCanvas",!0):r.setData("onCanvas",!1):n!=null&&(r.getData("userid").toString()==n?r.setData("onCanvas",!0):r.setData("onCanvas",!1)),Mconsole.plot()})}function clearCanvas(){Mconsole.graph.eachNode(function(e){Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id)}),Mconsole.plot()}function clearFoundData(){Mconsole.graph.eachNode(function(e){e.getData("inCommons")===!0&&(Mconsole.graph.removeNode(e.id),Mconsole.labels.disposeLabel(e.id))}),Mconsole.plot()}function openFind(){findOpen=!0,analyzeOpen&&closeAnalyze(),organizeOpen&&closeOrganize(),$("#sideOptionFind, #closeFind").css("z-index","10"),$("#sideOptionAnalyze").css("z-index","9"),$("#sideOptionOrganize").css("z-index","8"),firstVal=$('#sideOptionFind option[value="name"]').attr("selected"),secondVal=$('#sideOptionFind option[value="metacode"]').attr("selected"),thirdVal=$('#sideOptionFind option[value="map (by name)"]').attr("selected"),fourthVal=$('#sideOptionFind option[value="mapper (by name)"]').attr("selected"),firstVal==="selected"||thirdVal==="selected"||fourthVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#topic_by_name_input").focus()}):secondVal==="selected"?$("#sideOptionFind").animate({width:"380px",height:"463px"},100,function(){}):thirdVal==="selected"?$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#map_by_name_input").focus()}):fourthVal==="selected"&&$("#sideOptionFind").animate({width:"305px",height:"76px"},100,function(){$("#mapper_by_name_input").focus()}),$("#closeFind, #findWhere").css("display","block"),$("#sideOptionFind").css("cursor","default")}function closeFind(){findOpen=!1,Mconsole.graph.eachNode(function(e){e.setData("inCommons",!1),e.setData("onCanvas",!1)}),Mconsole.plot(),$("#closeFind, #findWhere").css("display","none"),$("#sideOptionFind").css("cursor","pointer"),$("#sideOptionFind").animate({width:
|
|||
|
);v.isReady=!0;if(e!==!0&&--v.readyWait>0)return;r.resolveWith(i,[v]),v.fn.trigger&&v(i).trigger("ready").off("ready")},isFunction:function(e){return v.type(e)==="function"},isArray:Array.isArray||function(e){return v.type(e)==="array"},isWindow:function(e){return e!=null&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return e==null?String(e):O[h.call(e)]||"object"},isPlainObject:function(e){if(!e||v.type(e)!=="object"||e.nodeType||v.isWindow(e))return!1;try{if(e.constructor&&!p.call(e,"constructor")&&!p.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(n){return!1}var r;for(r in e);return r===t||p.call(e,r)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw new Error(e)},parseHTML:function(e,t,n){var r;return!e||typeof e!="string"?null:(typeof t=="boolean"&&(n=t,t=0),t=t||i,(r=E.exec(e))?[t.createElement(r[1])]:(r=v.buildFragment([e],t,n?null:[]),v.merge([],(r.cacheable?v.clone(r.fragment):r.fragment).childNodes)))},parseJSON:function(t){if(!t||typeof t!="string")return null;t=v.trim(t);if(e.JSON&&e.JSON.parse)return e.JSON.parse(t);if(S.test(t.replace(T,"@").replace(N,"]").replace(x,"")))return(new Function("return "+t))();v.error("Invalid JSON: "+t)},parseXML:function(n){var r,i;if(!n||typeof n!="string")return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(s){r=t}return(!r||!r.documentElement||r.getElementsByTagName("parsererror").length)&&v.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&g.test(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(C,"ms-").replace(k,L)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toUpperCase()===t.toUpperCase()},each:function(e,n,r){var i,s=0,o=e.length,u=o===t||v.isFunction(e);if(r){if(u){for(i in e)if(n.apply(e[i],r)===!1)break}else for(;s<o;)if(n.apply(e[s++],r)===!1)break}else if(u){for(i in e)if(n.call(e[i],i,e[i])===!1)break}else for(;s<o;)if(n.call(e[s],s,e[s++])===!1)break;return e},trim:d&&!d.call(" ")?function(e){return e==null?"":d.call(e)}:function(e){return e==null?"":e.toString().replace(b,"")},makeArray:function(e,t){var n,r=t||[];return e!=null&&(n=v.type(e),e.length==null||n==="string"||n==="function"||n==="regexp"||v.isWindow(e)?f.call(r,e):v.merge(r,e)),r},inArray:function(e,t,n){var r;if(t){if(c)return c.call(t,e,n);r=t.length,n=n?n<0?Math.max(0,r+n):n:0;for(;n<r;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,s=0;if(typeof r=="number")for(;s<r;s++)e[i++]=n[s];else while(n[s]!==t)e[i++]=n[s++];return e.length=i,e},grep:function(e,t,n){var r,i=[],s=0,o=e.length;n=!!n;for(;s<o;s++)r=!!t(e[s],s),n!==r&&i.push(e[s]);return i},map:function(e,n,r){var i,s,o=[],u=0,a=e.length,f=e instanceof v||a!==t&&typeof a=="number"&&(a>0&&e[0]&&e[a-1]||a===0||v.isArray(e));if(f)for(;u<a;u++)i=n(e[u],u,r),i!=null&&(o[o.length]=i);else for(s in e)i=n(e[s],s,r),i!=null&&(o[o.length]=i);return o.concat.apply([],o)},guid:1,proxy:function(e,n){var r,i,s;return typeof n=="string"&&(r=e[n],n=e,e=r),v.isFunction(e)?(i=l.call(arguments,2),s=function(){return e.apply(n,i.concat(l.call(arguments)))},s.guid=e.guid=e.guid||s.guid||v.guid++,s):t},access:function(e,n,r,i,s,o,u){var a,f=r==null,l=0,c=e.length;if(r&&typeof r=="object"){for(l in r)v.access(e,n,l,r[l],1,o,i);s=1}else if(i!==t){a=u===t&&v.isFunction(i),f&&(a?(a=n,n=function(e,t,n){return a.call(v(e),n)}):(n.call(e,i),n=null));if(n)for(;l<c;l++)n(e[l],r,a?i.call(e[l],l,n(e[l],r)):i,u);s=1}return s?e:f?n.call(e):c?n(e[0],r):o},now:function(){return(new Date).getTime()}}),v.ready.promise=function(t){if(!r){r=v.Deferred();if(i.readyState==="complete")setTimeout(v.ready,1);else if(i.addEventListener)i.addEventListener("DOMContentLoaded",A,!1),e.addEventListener("load",v.ready,!1);else{i.attachEvent("onreadystatechange",A),e.attachEvent("onload",v.ready);var n=!1;try{n=e.frameElement==null&&i.documentElement}catch(s){}n&&n.doScroll&
|
|||
|
.fixHooks[t]=v.event.mouseHooks)}),function(e,t){function Y(e,t,n,r){n=n||[],t=t||m;var i,s,o,f,l=t.nodeType;if(l!==1&&l!==9)return[];if(!e||typeof e!="string")return n;o=u(t);if(!o&&!r)if(i=j.exec(e))if(f=i[1]){if(l===9){s=t.getElementById(f);if(!s||!s.parentNode)return n;if(s.id===f)return n.push(s),n}else if(t.ownerDocument&&(s=t.ownerDocument.getElementById(f))&&a(t,s)&&s.id===f)return n.push(s),n}else{if(i[2])return w.apply(n,b.call(t.getElementsByTagName(e),0)),n;if((f=i[3])&&K&&t.getElementsByClassName)return w.apply(n,b.call(t.getElementsByClassName(f),0)),n}return lt(e,t,n,r,o)}function Z(e){return function(t){var n=t.nodeName.toLowerCase();return n==="input"&&t.type===e}}function et(e){return function(t){var n=t.nodeName.toLowerCase();return(n==="input"||n==="button")&&t.type===e}}function tt(e,t,n){if(e===t)return n;var r=e.nextSibling;while(r){if(r===t)return-1;r=r.nextSibling}return 1}function nt(e,t,n,r){var i,o,u,a,f,l,c,h,p,v,g=!n&&t!==m,y=(g?"<s>":"")+e.replace(D,"$1<s>"),w=T[d][y];if(w)return r?0:b.call(w,0);f=e,l=[],h=0,p=s.preFilter,v=s.filter;while(f){if(!i||(o=P.exec(f)))o&&(f=f.slice(o[0].length),u.selector=c),l.push(u=[]),c="",g&&(f=" "+f);i=!1;if(o=H.exec(f))c+=o[0],f=f.slice(o[0].length),i=u.push({part:o.pop().replace(D," "),string:o[0],captures:o});for(a in v)(o=W[a].exec(f))&&(!p[a]||(o=p[a](o,t,n)))&&(c+=o[0],f=f.slice(o[0].length),i=u.push({part:a,string:o.shift(),captures:o}));if(!i)break}return c&&(u.selector=c),r?f.length:f?Y.error(e):b.call(T(y,l),0)}function rt(e,t,i,s){var o=t.dir,u=y++;return e||(e=function(e){return e===i}),t.first?function(t){while(t=t[o])if(t.nodeType===1)return e(t)&&t}:s?function(t){while(t=t[o])if(t.nodeType===1&&e(t))return t}:function(t){var i,s=u+"."+n,a=s+"."+r;while(t=t[o])if(t.nodeType===1){if((i=t[d])===a)return t.sizset;if(typeof i=="string"&&i.indexOf(s)===0){if(t.sizset)return t}else{t[d]=a;if(e(t))return t.sizset=!0,t;t.sizset=!1}}}}function it(e,t){return e?function(n){var r=t(n);return r&&e(r===!0?n:r)}:t}function st(e,t,n){var r,i,o=0;for(;r=e[o];o++)s.relative[r.part]?i=rt(i,s.relative[r.part],t,n):i=it(i,s.filter[r.part].apply(null,r.captures.concat(t,n)));return i}function ot(e){return function(t){var n,r=0;for(;n=e[r];r++)if(n(t))return!0;return!1}}function ut(e,t,n,r){var i=0,s=t.length;for(;i<s;i++)Y(e,t[i],n,r)}function at(e,t,n,r,i,o){var u,a=s.setFilters[t.toLowerCase()];return a||Y.error(t),(e||!(u=i))&&ut(e||"*",r,u=[],i),u.length>0?a(u,n,o):[]}function ft(e,n,r,i){var s,o,u,a,f,l,c,h,p,d,v,m,g,y=0,b=e.length,E=W.POS,S=new RegExp("^"+E.source+"(?!"+C+")","i"),x=function(){var e=1,n=arguments.length-2;for(;e<n;e++)arguments[e]===t&&(p[e]=t)};for(;y<b;y++){s=e[y],o="",h=i;for(u=0,a=s.length;u<a;u++){f=s[u],l=f.string;if(f.part==="PSEUDO"){E.exec(""),c=0;while(p=E.exec(l)){d=!0,v=E.lastIndex=p.index+p[0].length;if(v>c){o+=l.slice(c,p.index),c=v,m=[n],H.test(o)&&(h&&(m=h),h=i);if(g=q.test(o))o=o.slice(0,-5).replace(H,"$&*"),c++;p.length>1&&p[0].replace(S,x),h=at(o,p[1],p[2],m,h,g)}o=""}}d||(o+=l),d=!1}o?H.test(o)?ut(o,h||[n],r,i):Y(o,n,r,i?i.concat(h):h):w.apply(r,h)}return b===1?r:Y.uniqueSort(r)}function lt(e,t,i,o,u){e=e.replace(D,"$1");var a,l,c,h,p,d,v,m,g,y,E=nt(e,t,u),S=t.nodeType;if(W.POS.test(e))return ft(E,t,i,o);if(o)a=b.call(o,0);else if(E.length===1){if((d=b.call(E[0],0)).length>2&&(v=d[0]).part==="ID"&&S===9&&!u&&s.relative[d[1].part]){t=s.find.ID(v.captures[0].replace(z,""),t,u)[0];if(!t)return i;e=e.slice(d.shift().string.length)}g=(E=I.exec(d[0].string))&&!E.index&&t.parentNode||t,m="";for(p=d.length-1;p>=0;p--){v=d[p],y=v.part,m=v.string+m;if(s.relative[y])break;if(s.order.test(y)){a=s.find[y](v.captures[0].replace(z,""),g,u);if(a==null)continue;e=e.slice(0,e.length-m.length)+m.replace(W[y],""),e||w.apply(i,b.call(a,0));break}}}if(e){l=f(e,t,u),n=l.dirruns++,a==null&&(a=s.find.TAG("*",I.test(e)&&t.parentNode||t));for(p=0;h=a[p];p++)r=l.runs++,l(h)&&i.push(h)}return i}var n,r,i,s,o,u,a,f,l,c,h=!0,p="undefined",d=("sizcache"+Math.random()).replace(".",""),m=e.document,g=m.documentElement,y=0,b=[].slice,w=[].push,E=function(e
|
|||
|
,vn=/^(?:GET|HEAD)$/,mn=/^\/\//,gn=/\?/,yn=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,bn=/([?&])_=[^&]*/,wn=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,En=v.fn.load,Sn={},xn={},Tn=["*/"]+["*"];try{ln=s.href}catch(Nn){ln=i.createElement("a"),ln.href="",ln=ln.href}cn=wn.exec(ln.toLowerCase())||[],v.fn.load=function(e,n,r){if(typeof e!="string"&&En)return En.apply(this,arguments);if(!this.length)return this;var i,s,o,u=this,a=e.indexOf(" ");return a>=0&&(i=e.slice(a,e.length),e=e.slice(0,a)),v.isFunction(n)?(r=n,n=t):n&&typeof n=="object"&&(s="POST"),v.ajax({url:e,type:s,dataType:"html",data:n,complete:function(e,t){r&&u.each(r,o||[e.responseText,t,e])}}).done(function(e){o=arguments,u.html(i?v("<div>").append(e.replace(yn,"")).find(i):e)}),this},v.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(e,t){v.fn[t]=function(e){return this.on(t,e)}}),v.each(["get","post"],function(e,n){v[n]=function(e,r,i,s){return v.isFunction(r)&&(s=s||i,i=r,r=t),v.ajax({type:n,url:e,data:r,success:i,dataType:s})}}),v.extend({getScript:function(e,n){return v.get(e,t,n,"script")},getJSON:function(e,t,n){return v.get(e,t,n,"json")},ajaxSetup:function(e,t){return t?Ln(e,v.ajaxSettings):(t=e,e=v.ajaxSettings),Ln(e,t),e},ajaxSettings:{url:ln,isLocal:dn.test(cn[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","*":Tn},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":e.String,"text html":!0,"text json":v.parseJSON,"text xml":v.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:Cn(Sn),ajaxTransport:Cn(xn),ajax:function(e,n){function T(e,n,s,a){var l,y,b,w,S,T=n;if(E===2)return;E=2,u&&clearTimeout(u),o=t,i=a||"",x.readyState=e>0?4:0,s&&(w=An(c,x,s));if(e>=200&&e<300||e===304)c.ifModified&&(S=x.getResponseHeader("Last-Modified"),S&&(v.lastModified[r]=S),S=x.getResponseHeader("Etag"),S&&(v.etag[r]=S)),e===304?(T="notmodified",l=!0):(l=On(c,w),T=l.state,y=l.data,b=l.error,l=!b);else{b=T;if(!T||e)T="error",e<0&&(e=0)}x.status=e,x.statusText=""+(n||T),l?d.resolveWith(h,[y,T,x]):d.rejectWith(h,[x,T,b]),x.statusCode(g),g=t,f&&p.trigger("ajax"+(l?"Success":"Error"),[x,c,l?y:b]),m.fireWith(h,[x,T]),f&&(p.trigger("ajaxComplete",[x,c]),--v.active||v.event.trigger("ajaxStop"))}typeof e=="object"&&(n=e,e=t),n=n||{};var r,i,s,o,u,a,f,l,c=v.ajaxSetup({},n),h=c.context||c,p=h!==c&&(h.nodeType||h instanceof v)?v(h):v.event,d=v.Deferred(),m=v.Callbacks("once memory"),g=c.statusCode||{},b={},w={},E=0,S="canceled",x={readyState:0,setRequestHeader:function(e,t){if(!E){var n=e.toLowerCase();e=w[n]=w[n]||e,b[e]=t}return this},getAllResponseHeaders:function(){return E===2?i:null},getResponseHeader:function(e){var n;if(E===2){if(!s){s={};while(n=pn.exec(i))s[n[1].toLowerCase()]=n[2]}n=s[e.toLowerCase()]}return n===t?null:n},overrideMimeType:function(e){return E||(c.mimeType=e),this},abort:function(e){return e=e||S,o&&o.abort(e),T(0,e),this}};d.promise(x),x.success=x.done,x.error=x.fail,x.complete=m.add,x.statusCode=function(e){if(e){var t;if(E<2)for(t in e)g[t]=[g[t],e[t]];else t=e[x.status],x.always(t)}return this},c.url=((e||c.url)+"").replace(hn,"").replace(mn,cn[1]+"//"),c.dataTypes=v.trim(c.dataType||"*").toLowerCase().split(y),c.crossDomain==null&&(a=wn.exec(c.url.toLowerCase()),c.crossDomain=!(!a||a[1]==cn[1]&&a[2]==cn[2]&&(a[3]||(a[1]==="http:"?80:443))==(cn[3]||(cn[1]==="http:"?80:443)))),c.data&&c.processData&&typeof c.data!="string"&&(c.data=v.param(c.data,c.traditional)),kn(Sn,c,n,x);if(E===2)return x;f=c.global,c.type=c.type.toUpperCase(),c.hasContent=!vn.test(c.type),f&&v.active++===0&&v.event.trigger("ajaxStart");if(!c.hasContent){c.data&&(c.url+=(gn.test(c.url)?"&":"?")+c.data,delete c.data),r=c.url;if(c.cache===!1){var N=v.now(),C=c.url.replace(bn,"$1_="+N);c.url=C+(C===c.url?(gn.test(c.url)?"&":"?")+"_="+N:"")}}(c.data&&c.hasContent&&c.contentType!==!1
|
|||
|
[0]!=document&&!!e.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,o=/(html|body)/i.test(s[0].tagName);return{top:n.top+this.offset.relative.top*r+this.offset.parent.top*r-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():o?0:s.scrollTop())*r),left:n.left+this.offset.relative.left*r+this.offset.parent.left*r-(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():o?0:s.scrollLeft())*r)}},_generatePosition:function(t){var n=this.options,r=this.cssPosition!="absolute"||this.scrollParent[0]!=document&&!!e.ui.contains(this.scrollParent[0],this.offsetParent[0])?this.scrollParent:this.offsetParent,i=/(html|body)/i.test(r[0].tagName),s=t.pageX,o=t.pageY;if(this.originalPosition){var u;if(this.containment){if(this.relative_container){var a=this.relative_container.offset();u=[this.containment[0]+a.left,this.containment[1]+a.top,this.containment[2]+a.left,this.containment[3]+a.top]}else u=this.containment;t.pageX-this.offset.click.left<u[0]&&(s=u[0]+this.offset.click.left),t.pageY-this.offset.click.top<u[1]&&(o=u[1]+this.offset.click.top),t.pageX-this.offset.click.left>u[2]&&(s=u[2]+this.offset.click.left),t.pageY-this.offset.click.top>u[3]&&(o=u[3]+this.offset.click.top)}if(n.grid){var f=n.grid[1]?this.originalPageY+Math.round((o-this.originalPageY)/n.grid[1])*n.grid[1]:this.originalPageY;o=u?f-this.offset.click.top<u[1]||f-this.offset.click.top>u[3]?f-this.offset.click.top<u[1]?f+n.grid[1]:f-n.grid[1]:f:f;var l=n.grid[0]?this.originalPageX+Math.round((s-this.originalPageX)/n.grid[0])*n.grid[0]:this.originalPageX;s=u?l-this.offset.click.left<u[0]||l-this.offset.click.left>u[2]?l-this.offset.click.left<u[0]?l+n.grid[0]:l-n.grid[0]:l:l}}return{top:o-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():i?0:r.scrollTop()),left:s-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(e.browser.safari&&e.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():i?0:r.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging"),this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove(),this.helper=null,this.cancelHelperRemoval=!1},_trigger:function(t,n,r){return r=r||this._uiHash(),e.ui.plugin.call(this,t,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.extend(e.ui.draggable,{version:"1.8.23"}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,a=t.top,f=t.left;return e.ui.isOver(i+n,s+r,a,f,o,u)};e.each(r.sortables,function(s){this.instance.positionAbs=r.p
|
|||
|
.add("resizable","grid",{resize:function(t,n){var r=e(this).data("resizable"),i=r.options,s=r.size,o=r.originalSize,u=r.originalPosition,a=r.axis,f=i._aspectRatio||t.shiftKey;i.grid=typeof i.grid=="number"?[i.grid,i.grid]:i.grid;var l=Math.round((s.width-o.width)/(i.grid[0]||1))*(i.grid[0]||1),c=Math.round((s.height-o.height)/(i.grid[1]||1))*(i.grid[1]||1);/^(se|s|e)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c):/^(ne)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c):/^(sw)$/.test(a)?(r.size.width=o.width+l,r.size.height=o.height+c,r.position.left=u.left-l):(r.size.width=o.width+l,r.size.height=o.height+c,r.position.top=u.top-c,r.position.left=u.left-l)}});var n=function(e){return parseInt(e,10)||0},r=function(e){return!isNaN(parseInt(e,10))}}(jQuery),function(e,t){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:!0,distance:0,filter:"*",tolerance:"touch"},_create:function(){var t=this;this.element.addClass("ui-selectable"),this.dragged=!1;var n;this.refresh=function(){n=e(t.options.filter,t.element[0]),n.addClass("ui-selectee"),n.each(function(){var t=e(this),n=t.offset();e.data(this,"selectable-item",{element:this,$element:t,left:n.left,top:n.top,right:n.left+t.outerWidth(),bottom:n.top+t.outerHeight(),startselected:!1,selected:t.hasClass("ui-selected"),selecting:t.hasClass("ui-selecting"),unselecting:t.hasClass("ui-unselecting")})})},this.refresh(),this.selectees=n.addClass("ui-selectee"),this._mouseInit(),this.helper=e("<div class='ui-selectable-helper'></div>")},destroy:function(){return this.selectees.removeClass("ui-selectee").removeData("selectable-item"),this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable"),this._mouseDestroy(),this},_mouseStart:function(t){var n=this;this.opos=[t.pageX,t.pageY];if(this.options.disabled)return;var r=this.options;this.selectees=e(r.filter,this.element[0]),this._trigger("start",t),e(r.appendTo).append(this.helper),this.helper.css({left:t.clientX,top:t.clientY,width:0,height:0}),r.autoRefresh&&this.refresh(),this.selectees.filter(".ui-selected").each(function(){var r=e.data(this,"selectable-item");r.startselected=!0,!t.metaKey&&!t.ctrlKey&&(r.$element.removeClass("ui-selected"),r.selected=!1,r.$element.addClass("ui-unselecting"),r.unselecting=!0,n._trigger("unselecting",t,{unselecting:r.element}))}),e(t.target).parents().andSelf().each(function(){var r=e.data(this,"selectable-item");if(r){var i=!t.metaKey&&!t.ctrlKey||!r.$element.hasClass("ui-selected");return r.$element.removeClass(i?"ui-unselecting":"ui-selected").addClass(i?"ui-selecting":"ui-unselecting"),r.unselecting=!i,r.selecting=i,r.selected=i,i?n._trigger("selecting",t,{selecting:r.element}):n._trigger("unselecting",t,{unselecting:r.element}),!1}})},_mouseDrag:function(t){var n=this;this.dragged=!0;if(this.options.disabled)return;var r=this.options,i=this.opos[0],s=this.opos[1],o=t.pageX,u=t.pageY;if(i>o){var a=o;o=i,i=a}if(s>u){var a=u;u=s,s=a}return this.helper.css({left:i,top:s,width:o-i,height:u-s}),this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!a||a.element==n.element[0])return;var f=!1;r.tolerance=="touch"?f=!(a.left>o||a.right<i||a.top>u||a.bottom<s):r.tolerance=="fit"&&(f=a.left>i&&a.right<o&&a.top>s&&a.bottom<u),f?(a.selected&&(a.$element.removeClass("ui-selected"),a.selected=!1),a.unselecting&&(a.$element.removeClass("ui-unselecting"),a.unselecting=!1),a.selecting||(a.$element.addClass("ui-selecting"),a.selecting=!0,n._trigger("selecting",t,{selecting:a.element}))):(a.selecting&&((t.metaKey||t.ctrlKey)&&a.startselected?(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.$element.addClass("ui-selected"),a.selected=!0):(a.$element.removeClass("ui-selecting"),a.selecting=!1,a.startselected&&(a.$element.addClass("ui-unselecting"),a.unselecting=!0),n._trigger("unselecting",t,{unselecting:a.element}))),a.selected&&!t.metaKey&&!t.ctrlKey&&!a.startselected&&(a.$element.removeClass("ui-selected"),a.selected=!1,a.$element.addClass("ui-unselecting"),a.unselecting=
|
|||
|
.apply(this,[{remove:t},n,r,i]):this._removeClass(t)},_toggleClass:e.fn.toggleClass,toggleClass:function(n,r,i,s,o){return typeof r=="boolean"||r===t?i?e.effects.animateClass.apply(this,[r?{add:n}:{remove:n},i,s,o]):this._toggleClass(n,r):e.effects.animateClass.apply(this,[{toggle:n},r,i,s])},switchClass:function(t,n,r,i,s){return e.effects.animateClass.apply(this,[{add:n,remove:t},r,i,s])}}),e.extend(e.effects,{version:"1.8.23",save:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.data("ec.storage."+t[n],e[0].style[t[n]])},restore:function(e,t){for(var n=0;n<t.length;n++)t[n]!==null&&e.css(t[n],e.data("ec.storage."+t[n]))},setMode:function(e,t){return t=="toggle"&&(t=e.is(":hidden")?"show":"hide"),t},getBaseline:function(e,t){var n,r;switch(e[0]){case"top":n=0;break;case"middle":n=.5;break;case"bottom":n=1;break;default:n=e[0]/t.height}switch(e[1]){case"left":r=0;break;case"center":r=.5;break;case"right":r=1;break;default:r=e[1]/t.width}return{x:r,y:n}},createWrapper:function(t){if(t.parent().is(".ui-effects-wrapper"))return t.parent();var n={width:t.outerWidth(!0),height:t.outerHeight(!0),"float":t.css("float")},r=e("<div></div>").addClass("ui-effects-wrapper").css({fontSize:"100%",background:"transparent",border:"none",margin:0,padding:0}),i=document.activeElement;try{i.id}catch(s){i=document.body}return t.wrap(r),(t[0]===i||e.contains(t[0],i))&&e(i).focus(),r=t.parent(),t.css("position")=="static"?(r.css({position:"relative"}),t.css({position:"relative"})):(e.extend(n,{position:t.css("position"),zIndex:t.css("z-index")}),e.each(["top","left","bottom","right"],function(e,r){n[r]=t.css(r),isNaN(parseInt(n[r],10))&&(n[r]="auto")}),t.css({position:"relative",top:0,left:0,right:"auto",bottom:"auto"})),r.css(n).show()},removeWrapper:function(t){var n,r=document.activeElement;return t.parent().is(".ui-effects-wrapper")?(n=t.parent().replaceWith(t),(t[0]===r||e.contains(t[0],r))&&e(r).focus(),n):t},setTransition:function(t,n,r,i){return i=i||{},e.each(n,function(e,n){var s=t.cssUnit(n);s[0]>0&&(i[n]=s[0]*r+s[1])}),i}}),e.fn.extend({effect:function(t,n,r,i){var s=l.apply(this,arguments),o={options:s[1],duration:s[2],callback:s[3]},u=o.options.mode,a=e.effects[t];return e.fx.off||!a?u?this[u](o.duration,o.callback):this.each(function(){o.callback&&o.callback.call(this)}):a.call(this,o)},_show:e.fn.show,show:function(e){if(c(e))return this._show.apply(this,arguments);var t=l.apply(this,arguments);return t[1].mode="show",this.effect.apply(this,t)},_hide:e.fn.hide,hide:function(e){if(c(e))return this._hide.apply(this,arguments);var t=l.apply(this,arguments);return t[1].mode="hide",this.effect.apply(this,t)},__toggle:e.fn.toggle,toggle:function(t){if(c(t)||typeof t=="boolean"||e.isFunction(t))return this.__toggle.apply(this,arguments);var n=l.apply(this,arguments);return n[1].mode="toggle",this.effect.apply(this,n)},cssUnit:function(t){var n=this.css(t),r=[];return e.each(["em","px","%","pt"],function(e,t){n.indexOf(t)>0&&(r=[parseFloat(n),t])}),r}});var h={};e.each(["Quad","Cubic","Quart","Quint","Expo"],function(e,t){h[t]=function(t){return Math.pow(t,e+2)}}),e.extend(h,{Sine:function(e){return 1-Math.cos(e*Math.PI/2)},Circ:function(e){return 1-Math.sqrt(1-e*e)},Elastic:function(e){return e===0||e===1?e:-Math.pow(2,8*(e-1))*Math.sin(((e-1)*80-7.5)*Math.PI/15)},Back:function(e){return e*e*(3*e-2)},Bounce:function(e){var t,n=4;while(e<((t=Math.pow(2,--n))-1)/11);return 1/Math.pow(4,3-n)-7.5625*Math.pow((t*3-2)/22-e,2)}}),e.each(h,function(t,n){e.easing["easeIn"+t]=n,e.easing["easeOut"+t]=function(e){return 1-n(1-e)},e.easing["easeInOut"+t]=function(e){return e<.5?n(e*2)/2:n(e*-2+2)/-2+1}})}(jQuery),function(e,t){e.effects.blind=function(t){return this.queue(function(){var n=e(this),r=["position","top","bottom","left","right"],i=e.effects.setMode(n,t.options.mode||"hide"),s=t.options.direction||"vertical";e.effects.save(n,r),n.show();var u=e.effects.createWrapper(n).css({overflow:"hidden"}),a=s=="vertical"?"height":"width",f=s=="vertical"?u.height():u.width();i=="show"&&u.css(a,0);var l={};l[a]=i=="show"?f:0,u.animate(l,t.d
|
|||
|
null},next:function(e){this.move("next",".ui-menu-item:first",e)},previous:function(e){this.move("prev",".ui-menu-item:last",e)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(e,t,n){if(!this.active){this.activate(n,this.element.children(t));return}var r=this.active[e+"All"](".ui-menu-item").eq(0);r.length?this.activate(n,r):this.activate(n,this.element.children(t))},nextPage:function(t){if(this.hasScroll()){if(!this.active||this.last()){this.activate(t,this.element.children(".ui-menu-item:first"));return}var n=this.active.offset().top,r=this.element.height(),i=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-n-r+e(this).height();return t<10&&t>-10});i.length||(i=this.element.children(".ui-menu-item:last")),this.activate(t,i)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(t){if(this.hasScroll()){if(!this.active||this.first()){this.activate(t,this.element.children(".ui-menu-item:last"));return}var n=this.active.offset().top,r=this.element.height(),i=this.element.children(".ui-menu-item").filter(function(){var t=e(this).offset().top-n+r-e(this).height();return t<10&&t>-10});i.length||(i=this.element.children(".ui-menu-item:first")),this.activate(t,i)}else this.activate(t,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()<this.element[e.fn.prop?"prop":"attr"]("scrollHeight")},select:function(e){this._trigger("selected",e,{item:this.active})}})}(jQuery),function(e,t){var n,r,i,s,o="ui-button ui-widget ui-state-default ui-corner-all",u="ui-state-hover ui-state-active ",a="ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only",f=function(){var t=e(this).find(":ui-button");setTimeout(function(){t.button("refresh")},1)},l=function(t){var n=t.name,r=t.form,i=e([]);return n&&(r?i=e(r).find("[name='"+n+"']"):i=e("[name='"+n+"']",t.ownerDocument).filter(function(){return!this.form})),i};e.widget("ui.button",{options:{disabled:null,text:!0,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",f),typeof this.options.disabled!="boolean"?this.options.disabled=!!this.element.propAttr("disabled"):this.element.propAttr("disabled",this.options.disabled),this._determineButtonType(),this.hasTitle=!!this.buttonElement.attr("title");var t=this,u=this.options,a=this.type==="checkbox"||this.type==="radio",c="ui-state-hover"+(a?"":" ui-state-active"),h="ui-state-focus";u.label===null&&(u.label=this.buttonElement.html()),this.buttonElement.addClass(o).attr("role","button").bind("mouseenter.button",function(){if(u.disabled)return;e(this).addClass("ui-state-hover"),this===n&&e(this).addClass("ui-state-active")}).bind("mouseleave.button",function(){if(u.disabled)return;e(this).removeClass(c)}).bind("click.button",function(e){u.disabled&&(e.preventDefault(),e.stopImmediatePropagation())}),this.element.bind("focus.button",function(){t.buttonElement.addClass(h)}).bind("blur.button",function(){t.buttonElement.removeClass(h)}),a&&(this.element.bind("change.button",function(){if(s)return;t.refresh()}),this.buttonElement.bind("mousedown.button",function(e){if(u.disabled)return;s=!1,r=e.pageX,i=e.pageY}).bind("mouseup.button",function(e){if(u.disabled)return;if(r!==e.pageX||i!==e.pageY)s=!0})),this.type==="checkbox"?this.buttonElement.bind("click.button",function(){if(u.disabled||s)return!1;e(this).toggleClass("ui-state-active"),t.buttonElement.attr("aria-pressed",t.element[0].checked)}):this.type==="radio"?this.buttonElement.bind("click.button",function(){if(u.disabled||s)return!1;e(this).addClass("ui-state-active"),t.buttonElement.attr("aria-pressed","true");var n=t.element[0];l(n).not(n).map(function(){return e(this).button("widget")[0]}).removeCl
|
|||
|
.length;i++)if(n)e.charAt(i)=="'"&&!r("'")?n=!1:t+=e.charAt(i);else switch(e.charAt(i)){case"d":case"m":case"y":case"@":t+="0123456789";break;case"D":case"M":return null;case"'":r("'")?t+="'":n=!0;break;default:t+=e.charAt(i)}return t},_get:function(e,t){return e.settings[t]!==undefined?e.settings[t]:this._defaults[t]},_setDateFromField:function(e,t){if(e.input.val()==e.lastVal)return;var n=this._get(e,"dateFormat"),r=e.lastVal=e.input?e.input.val():null,i,s;i=s=this._getDefaultDate(e);var o=this._getFormatConfig(e);try{i=this.parseDate(n,r,o)||s}catch(u){this.log(u),r=t?"":r}e.selectedDay=i.getDate(),e.drawMonth=e.selectedMonth=i.getMonth(),e.drawYear=e.selectedYear=i.getFullYear(),e.currentDay=r?i.getDate():0,e.currentMonth=r?i.getMonth():0,e.currentYear=r?i.getFullYear():0,this._adjustInstDate(e)},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,t,n){var r=function(e){var t=new Date;return t.setDate(t.getDate()+e),t},i=function(t){try{return $.datepicker.parseDate($.datepicker._get(e,"dateFormat"),t,$.datepicker._getFormatConfig(e))}catch(n){}var r=(t.toLowerCase().match(/^c/)?$.datepicker._getDate(e):null)||new Date,i=r.getFullYear(),s=r.getMonth(),o=r.getDate(),u=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,a=u.exec(t);while(a){switch(a[2]||"d"){case"d":case"D":o+=parseInt(a[1],10);break;case"w":case"W":o+=parseInt(a[1],10)*7;break;case"m":case"M":s+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s));break;case"y":case"Y":i+=parseInt(a[1],10),o=Math.min(o,$.datepicker._getDaysInMonth(i,s))}a=u.exec(t)}return new Date(i,s,o)},s=t==null||t===""?n:typeof t=="string"?i(t):typeof t=="number"?isNaN(t)?n:r(t):new Date(t.getTime());return s=s&&s.toString()=="Invalid Date"?n:s,s&&(s.setHours(0),s.setMinutes(0),s.setSeconds(0),s.setMilliseconds(0)),this._daylightSavingAdjust(s)},_daylightSavingAdjust:function(e){return e?(e.setHours(e.getHours()>12?e.getHours()+2:0),e):null},_setDate:function(e,t,n){var r=!t,i=e.selectedMonth,s=e.selectedYear,o=this._restrictMinMax(e,this._determineDate(e,t,new Date));e.selectedDay=e.currentDay=o.getDate(),e.drawMonth=e.selectedMonth=e.currentMonth=o.getMonth(),e.drawYear=e.selectedYear=e.currentYear=o.getFullYear(),(i!=e.selectedMonth||s!=e.selectedYear)&&!n&&this._notifyChange(e),this._adjustInstDate(e),e.input&&e.input.val(r?"":this._formatDate(e))},_getDate:function(e){var t=!e.currentYear||e.input&&e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return t},_attachHandlers:function(e){var t=this._get(e,"stepMonths"),n="#"+e.id.replace(/\\\\/g,"\\");e.dpDiv.find("[data-handler]").map(function(){var e={prev:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,-t,"M")},next:function(){window["DP_jQuery_"+dpuuid].datepicker._adjustDate(n,+t,"M")},hide:function(){window["DP_jQuery_"+dpuuid].datepicker._hideDatepicker()},today:function(){window["DP_jQuery_"+dpuuid].datepicker._gotoToday(n)},selectDay:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectDay(n,+this.getAttribute("data-month"),+this.getAttribute("data-year"),this),!1},selectMonth:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"M"),!1},selectYear:function(){return window["DP_jQuery_"+dpuuid].datepicker._selectMonthYear(n,this,"Y"),!1}};$(this).bind(this.getAttribute("data-event"),e[this.getAttribute("data-handler")])})},_generateHTML:function(e){var t=new Date;t=this._daylightSavingAdjust(new Date(t.getFullYear(),t.getMonth(),t.getDate()));var n=this._get(e,"isRTL"),r=this._get(e,"showButtonPanel"),i=this._get(e,"hideIfNoPrevNext"),s=this._get(e,"navigationAsDateFormat"),o=this._getNumberOfMonths(e),u=this._get(e,"showCurrentAtPos"),a=this._get(e,"stepMonths"),f=o[0]!=1||o[1]!=1,l=this._daylightSavingAdjust(e.currentDay?new Date(e.currentYear,e.currentMonth,e.currentDay):new Date(9999,9,9)),c=this._getMinMaxDate(e,"min"),h=this._getMinMaxDate(e,"max"),p=e.drawMonth-u,d=e.drawYear;p<0&&(p+=12,d--);if(h){var v=this._daylig
|
|||
|
(),this.range.remove(),this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"),this._mouseDestroy(),this},_mouseCapture:function(t){var n=this.options,r,i,s,o,u,a,f,l,c;return n.disabled?!1:(this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()},this.elementOffset=this.element.offset(),r={x:t.pageX,y:t.pageY},i=this._normValueFromMouse(r),s=this._valueMax()-this._valueMin()+1,u=this,this.handles.each(function(t){var n=Math.abs(i-u.values(t));s>n&&(s=n,o=e(this),a=t)}),n.range===!0&&this.values(1)===n.min&&(a+=1,o=e(this.handles[a])),f=this._start(t,a),f===!1?!1:(this._mouseSliding=!0,u._handleIndex=a,o.addClass("ui-state-active").focus(),l=o.offset(),c=!e(t.target).parents().andSelf().is(".ui-slider-handle"),this._clickOffset=c?{left:0,top:0}:{left:t.pageX-l.left-o.width()/2,top:t.pageY-l.top-o.height()/2-(parseInt(o.css("borderTopWidth"),10)||0)-(parseInt(o.css("borderBottomWidth"),10)||0)+(parseInt(o.css("marginTop"),10)||0)},this.handles.hasClass("ui-state-hover")||this._slide(t,a,i),this._animateOff=!0,!0))},_mouseStart:function(e){return!0},_mouseDrag:function(e){var t={x:e.pageX,y:e.pageY},n=this._normValueFromMouse(t);return this._slide(e,this._handleIndex,n),!1},_mouseStop:function(e){return this.handles.removeClass("ui-state-active"),this._mouseSliding=!1,this._stop(e,this._handleIndex),this._change(e,this._handleIndex),this._handleIndex=null,this._clickOffset=null,this._animateOff=!1,!1},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(e){var t,n,r,i,s;return this.orientation==="horizontal"?(t=this.elementSize.width,n=e.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)):(t=this.elementSize.height,n=e.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)),r=n/t,r>1&&(r=1),r<0&&(r=0),this.orientation==="vertical"&&(r=1-r),i=this._valueMax()-this._valueMin(),s=this._valueMin()+r*i,this._trimAlignValue(s)},_start:function(e,t){var n={handle:this.handles[t],value:this.value()};return this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("start",e,n)},_slide:function(e,t,n){var r,i,s;this.options.values&&this.options.values.length?(r=this.values(t?0:1),this.options.values.length===2&&this.options.range===!0&&(t===0&&n>r||t===1&&n<r)&&(n=r),n!==this.values(t)&&(i=this.values(),i[t]=n,s=this._trigger("slide",e,{handle:this.handles[t],value:n,values:i}),r=this.values(t?0:1),s!==!1&&this.values(t,n,!0))):n!==this.value()&&(s=this._trigger("slide",e,{handle:this.handles[t],value:n}),s!==!1&&this.value(n))},_stop:function(e,t){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("stop",e,n)},_change:function(e,t){if(!this._keySliding&&!this._mouseSliding){var n={handle:this.handles[t],value:this.value()};this.options.values&&this.options.values.length&&(n.value=this.values(t),n.values=this.values()),this._trigger("change",e,n)}},value:function(e){if(arguments.length){this.options.value=this._trimAlignValue(e),this._refreshValue(),this._change(null,0);return}return this._value()},values:function(t,n){var r,i,s;if(arguments.length>1){this.options.values[t]=this._trimAlignValue(n),this._refreshValue(),this._change(null,t);return}if(!arguments.length)return this._values();if(!e.isArray(arguments[0]))return this.options.values&&this.options.values.length?this._values(t):this.value();r=this.options.values,i=arguments[0];for(s=0;s<r.length;s+=1)r[s]=this._trimAlignValue(i[s]),this._change(null,s);this._refreshValue()},_setOption:function(t,n){var r,i=0;e.isArray(this.options.values)&&(i=this.options.values.length),e.Widget.prototype._setOption.apply(this,arguments);switch(t){case"disabled":n?(this.handles.filter(".ui-state-focus").blur(),this.handles.removeClass("ui-state-hover"),this.handles.p
|
|||
|
(this))})},e.railsAutocomplete=function(e){_e=e,this.init(_e)},e.railsAutocomplete.fn=e.railsAutocomplete.prototype={railsAutocomplete:"0.0.1"},e.railsAutocomplete.fn.extend=e.railsAutocomplete.extend=e.extend,e.railsAutocomplete.fn.extend({init:function(t){function n(e){return e.split(t.delimiter)}function r(e){return n(e).pop().replace(/^\s+/,"")}t.delimiter=e(t).attr("data-delimiter")||null,e(t).autocomplete({source:function(n,i){e.getJSON(e(t).attr("data-autocomplete"),{term:r(n.term)},function(){arguments[0].length==0&&(arguments[0]=[]),e(arguments[0]).each(function(n,r){var i={};i[r.id]=r,e(t).data(i)}),i.apply(null,arguments)})},change:function(t,n){if(e(e(this).attr("data-id-element")).val()=="")return;e(e(this).attr("data-id-element")).val(n.item?n.item.id:"");var r=e.parseJSON(e(this).attr("data-update-elements")),i=n.item?e(this).data(n.item.id.toString()):{};if(r&&e(r["id"]).val()=="")return;for(var s in r)e(r[s]).val(n.item?i[s]:"")},search:function(){var e=r(this.value);if(e.length<2)return!1},focus:function(){return!1},select:function(r,i){var s=n(this.value);s.pop(),s.push(i.item.value);if(t.delimiter!=null)s.push(""),this.value=s.join(t.delimiter);else{this.value=s.join(""),e(this).attr("data-id-element")&&e(e(this).attr("data-id-element")).val(i.item.id);if(e(this).attr("data-update-elements")){var o=e(this).data(i.item.id.toString()),u=e.parseJSON(e(this).attr("data-update-elements"));for(var a in u)e(u[a]).val(o[a])}}var f=this.value;return e(this).bind("keyup.clearId",function(){e(this).val().trim()!=f.trim()&&(e(e(this).attr("data-id-element")).val(""),e(this).unbind("keyup.clearId"))}),e(t).trigger("railsAutocomplete.select",i),!1}})}}),e(document).ready(function(){e("input[data-autocomplete]").railsAutocomplete()})}(jQuery),function(e,t){var n=function(){var t=e._data(document,"events");return t&&t.click&&e.grep(t.click,function(e){return e.namespace==="rails"}).length};n()&&e.error("jquery-ujs has already been loaded!");var r;e.rails=r={linkClickSelector:"a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]",inputChangeSelector:"select[data-remote], input[data-remote], textarea[data-remote]",formSubmitSelector:"form",formInputClickSelector:"form input[type=submit], form input[type=image], form button[type=submit], form button:not([type])",disableSelector:"input[data-disable-with], button[data-disable-with], textarea[data-disable-with]",enableSelector:"input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled",requiredInputSelector:"input[name][required]:not([disabled]),textarea[name][required]:not([disabled])",fileInputSelector:"input:file",linkDisableSelector:"a[data-disable-with]",CSRFProtection:function(t){var n=e('meta[name="csrf-token"]').attr("content");n&&t.setRequestHeader("X-CSRF-Token",n)},fire:function(t,n,r){var i=e.Event(n);return t.trigger(i,r),i.result!==!1},confirm:function(e){return confirm(e)},ajax:function(t){return e.ajax(t)},href:function(e){return e.attr("href")},handleRemote:function(n){var i,s,o,u,a,f,l,c;if(r.fire(n,"ajax:before")){u=n.data("cross-domain"),a=u===t?null:u,f=n.data("with-credentials")||null,l=n.data("type")||e.ajaxSettings&&e.ajaxSettings.dataType;if(n.is("form")){i=n.attr("method"),s=n.attr("action"),o=n.serializeArray();var h=n.data("ujs:submit-button");h&&(o.push(h),n.data("ujs:submit-button",null))}else n.is(r.inputChangeSelector)?(i=n.data("method"),s=n.data("url"),o=n.serialize(),n.data("params")&&(o=o+"&"+n.data("params"))):(i=n.data("method"),s=r.href(n),o=n.data("params")||null);c={type:i||"GET",data:o,dataType:l,beforeSend:function(e,i){return i.dataType===t&&e.setRequestHeader("accept","*/*;q=0.5, "+i.accepts.script),r.fire(n,"ajax:beforeSend",[e,i])},success:function(e,t,r){n.trigger("ajax:success",[e,t,r])},complete:function(e,t){n.trigger("ajax:complete",[e,t])},error:function(e,t,r){n.trigger("ajax:error",[e,t,r])},xhrFields:{withCredentials:f},crossDomain:a},s&&(c.url=s);var p=r.ajax(c);return n.trigger("ajax:send",p),p}return!1},handleMethod:function(n){var i=r.href(n),s=n.
|
|||
|
(setTimeout(function(){onCanvasSearch(null,t.item.id,null)},0),$("#topicsByMap").val(t.item.id),$("#topicsByUser").val(""),$("#topicsByName").val(""),$("#get_topics_form").submit()):firstNewVal=="checked"?setTimeout(function(){onCanvasSearch(null,t.item.id,null)},0):secondNewVal=="checked"?($("#topicsByMap").val(t.item.id),$("#topicsByUser").val(""),$("#topicsByName").val(""),$("#get_topics_form").submit()):alert("You either need to have searching On Your Canvas or In the Commons enabled")):secondVal=="selected"?(t.item.id!=undefined&&window.open("/maps/"+t.item.id),$(".find_map_by_name #map_by_name_input").val("")):thirdVal=="selected"}),$(".find_map_by_name").bind("submit",function(e,t){e.preventDefault()}),$(".find_mapper_by_name #mapper_by_name_input").bind("railsAutocomplete.select",function(e,t){firstVal=$("#sideOptionFind .select_content").children("option[value='topics']").attr("selected"),secondVal=$("#sideOptionFind .select_content").children("option[value='maps']").attr("selected"),thirdVal=$("#sideOptionFind .select_content").children("option[value='mappers']").attr("selected"),firstVal=="selected"?(firstNewVal=$("#onCanvas").attr("checked"),secondNewVal=$("#inCommons").attr("checked"),firstNewVal=="checked"&&secondNewVal=="checked"?(setTimeout(function(){onCanvasSearch(null,null,t.item.id.toString())},0),$("#topicsByUser").val(t.item.id),$("#topicsByMap").val(""),$("#topicsByName").val(""),$("#get_topics_form").submit()):firstNewVal=="checked"?setTimeout(function(){onCanvasSearch(null,null,t.item.id.toString())},0):secondNewVal=="checked"?($("#topicsByUser").val(t.item.id),$("#topicsByMap").val(""),$("#topicsByName").val(""),$("#get_topics_form").submit()):alert("You either need to have searching On Your Canvas or In the Commons enabled")):secondVal!="selected"&&thirdVal=="selected"&&(t.item.id!=undefined&&window.open("/users/"+t.item.id),$(".find_mapper_by_name #mapper_by_name_input").val(""))}),$(".find_mapper_by_name").bind("submit",function(e,t){e.preventDefault()}),$(".find_topic_by_metacode ul li").click(function(e){obj=document.getElementById("container");var t=$(this).attr("id");if(t==="showAll"||t==="hideAll"){if(t=="showAll"){showAll(),$(".find_topic_by_metacode ul li").not("#hideAll, #showAll").removeClass("toggledOff");for(var n in categoryVisible)categoryVisible[n]=!0}else if(t=="hideAll"){hideAll(),$(".find_topic_by_metacode ul li").not("#hideAll, #showAll").addClass("toggledOff");for(var n in categoryVisible)categoryVisible[n]=!1}}else{var r=$(this).children("img").attr("alt");switchVisible(r),categoryVisible[r]==1?($(this).addClass("toggledOff"),categoryVisible[r]=!1):categoryVisible[r]==0&&($(this).removeClass("toggledOff"),categoryVisible[r]=!0)}})});var renderMidArrow=function(e,t,n,r,i){var s=i.getCtx();if(r){var o=e;e=t,t=o}var u=new $jit.Complex(t.x-e.x,t.y-e.y);u.$scale(n/u.norm());var a=new $jit.Complex((t.x+e.x)/2,(t.y+e.y)/2);a.x+=u.x/.7,a.y+=u.y/.7;var f=new $jit.Complex(a.x-u.x,a.y-u.y),l=new $jit.Complex(-u.y/2,u.x/2),c=f.add(l),h=f.$add(l.$scale(-1));s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.stroke(),s.beginPath(),s.moveTo(c.x,c.y),s.lineTo(a.x,a.y),s.lineTo(h.x,h.y),s.stroke()},nodeSettings={customNode:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim"),i=e.getData("metacode"),s=e.getData("inCommons"),o=e.getData("onCanvas"),u=t.getCtx();s&&(u.beginPath(),u.arc(n.x,n.y,r+3,0,2*Math.PI,!1),u.strokeStyle="#67be5f",u.lineWidth=2,u.stroke()),o&&(u.beginPath(),u.arc(n.x,n.y,r+3,0,2*Math.PI,!1),u.strokeStyle="white",u.lineWidth=2,u.stroke()),u.drawImage(imgArray[i],n.x-r,n.y-r,r*2,r*2)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.circle.contains(n,t,r)}}},edgeSettings={customEdge:{render:function(e,t){var n=e.nodeFrom.pos.getc(!0),r=e.nodeTo.pos.getc(!0),i=e.getData("category");if(i=="none")this.edgeHelper.line.render({x:n.x,y:n.y},{x:r.x,y:r.y},t);else if(i=="both")renderMidArrow({x:n.x,y:n.y},{x:r.x,y:r.y},13,!0,t),renderMidArrow({x:n.x,y:n.y},{x:r.x,y:r.y},13,!1,t);else if(i=="from-to"){var s=e.data.$direction,o=s&&s.l
|
|||
|
$add:function(e){return this.x+=e.x,this.y+=e.y,this},$prod:function(e){var t=this.x,n=this.y;return this.x=t*e.x-n*e.y,this.y=n*e.x+t*e.y,this},$conjugate:function(){return this.y=-this.y,this},$scale:function(e){return this.x*=e,this.y*=e,this},$div:function(e){var t=this.x,n=this.y,r=e.squaredNorm();return this.x=t*e.x+n*e.y,this.y=n*e.x-t*e.y,this.$scale(1/r)}};var p=function(e,t){return new h(e,t)};h.KER=p(0,0),$jit.Graph=new t({initialize:function(t,n,r,i){var s={complex:!1,Node:{}};this.Node=n,this.Edge=r,this.Label=i,this.opt=e.merge(s,t||{}),this.nodes={},this.edges={};var o=this;this.nodeList={};for(var u in v)o.nodeList[u]=function(e){return function(){var t=Array.prototype.slice.call(arguments);o.eachNode(function(n){n[e].apply(n,t)})}}(u)},getNode:function(e){return this.hasNode(e)?this.nodes[e]:!1},getByName:function(e){for(var t in this.nodes){var n=this.nodes[t];if(n.name==e)return n}return!1},getAdjacence:function(e,t){return e in this.edges?this.edges[e][t]:!1},addNode:function(t){if(!this.nodes[t.id]){var n=this.edges[t.id]={};this.nodes[t.id]=new d.Node(e.extend({id:t.id,name:t.name,data:e.merge(t.data||{},{}),adjacencies:n},this.opt.Node),this.opt.complex,this.Node,this.Edge,this.Label)}return this.nodes[t.id]},addAdjacence:function(e,t,n){this.hasNode(e.id)||this.addNode(e),this.hasNode(t.id)||this.addNode(t),e=this.nodes[e.id],t=this.nodes[t.id];if(!e.adjacentTo(t)){var r=this.edges[e.id]=this.edges[e.id]||{},i=this.edges[t.id]=this.edges[t.id]||{};return r[t.id]=i[e.id]=new d.Adjacence(e,t,n,this.Edge,this.Label),r[t.id]}return this.edges[e.id][t.id]},removeNode:function(e){if(this.hasNode(e)){delete this.nodes[e];var t=this.edges[e];for(var n in t)delete this.edges[n][e];delete this.edges[e]}},removeAdjacence:function(e,t){delete this.edges[e][t],delete this.edges[t][e]},hasNode:function(e){return e in this.nodes},empty:function(){this.nodes={},this.edges={}}});var d=$jit.Graph,v;(function(){var t=function(e,t,n,r,i){var s;n=n||"current",e="$"+(e?e+"-":""),n=="current"?s=this.data:n=="start"?s=this.startData:n=="end"&&(s=this.endData);var o=e+t;return r?s[o]:this.Config.overridable?o in s?s[o]:o in this.data?this.data[o]:i[t]||0:i[t]||0},n=function(e,t,n,r){r=r||"current",e="$"+(e?e+"-":"");var i;r=="current"?i=this.data:r=="start"?i=this.startData:r=="end"&&(i=this.endData),i[e+t]=n},r=function(t,n){t="$"+(t?t+"-":"");var r=this;e.each(n,function(e){var n=t+e;delete r.data[n],delete r.endData[n],delete r.startData[n]})};v={getData:function(e,n,r){return t.call(this,"",e,n,r,this.Config)},setData:function(e,t,r){n.call(this,"",e,t,r)},setDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setData(r,s[i],t[i])},removeData:function(){r.call(this,"",Array.prototype.slice.call(arguments))},getCanvasStyle:function(e,n,r){return t.call(this,"canvas",e,n,r,this.Config.CanvasStyles)},setCanvasStyle:function(e,t,r){n.call(this,"canvas",e,t,r)},setCanvasStyles:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setCanvasStyle(r,s[i],t[i])},removeCanvasStyle:function(){r.call(this,"canvas",Array.prototype.slice.call(arguments))},getLabelData:function(e,n,r){return t.call(this,"label",e,n,r,this.Label)},setLabelData:function(e,t,r){n.call(this,"label",e,t,r)},setLabelDataset:function(t,n){t=e.splat(t);for(var r in n)for(var i=0,s=e.splat(n[r]),o=t.length;i<o;i++)this.setLabelData(r,s[i],t[i])},removeLabelData:function(){r.call(this,"label",Array.prototype.slice.call(arguments))}}})(),d.Node=new t({initialize:function(t,n,r,i,s){var o={id:"",name:"",data:{},startData:{},endData:{},adjacencies:{},selected:!1,drawn:!1,exist:!1,angleSpan:{begin:0,end:0},pos:n&&p(0,0)||c(0,0),startPos:n&&p(0,0)||c(0,0),endPos:n&&p(0,0)||c(0,0)};e.extend(this,e.extend(o,t)),this.Config=this.Node=r,this.Edge=i,this.Label=s},adjacentTo:function(e){return e.id in this.adjacencies},getAdjacency:function(e){return this.adjacencies[e]},getPos:function(e){e=e||"current";if(e=="current")return this.pos;if(e=="end")return this.endPos;if(e=="start")
|
|||
|
e.merge({type:"Circles"},s.background)),this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectInto:s.injectInto.id)+"-label"),this.graphOptions={complex:!0},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new n.Label[s.Label.type](this),this.fx=new n.Plot(this,n),this.op=new n.Op(this),this.group=new n.Group(this),this.geom=new n.Geom(this),this.clickedNode=null,this.initializeExtras()},plot:function(){this.fx.plot(this.controller)},switchPosition:function(e,t,n){var r=this.geom,i=this.fx,s=this;i.busy||(i.busy=!0,this.contract({onComplete:function(){r.switchOrientation(e),s.compute("end",!1),i.busy=!1,t=="animate"?s.onClick(s.clickedNode.id,n):t=="replot"&&s.select(s.clickedNode.id,n)}},e))},switchAlignment:function(e,t,n){this.config.align=e,t=="animate"?this.select(this.clickedNode.id,n):t=="replot"&&this.onClick(this.clickedNode.id,n)},addNodeInPath:function(e){n.push(e),this.select(this.clickedNode&&this.clickedNode.id||this.root)},clearNodesInPath:function(e){n.length=0,this.select(this.clickedNode&&this.clickedNode.id||this.root)},refresh:function(){this.reposition(),this.select(this.clickedNode&&this.clickedNode.id||this.root)},reposition:function(){this.graph.computeLevels(this.root,0,"ignore"),this.geom.setRightLevelToShow(this.clickedNode,this.canvas),this.graph.eachNode(function(e){e.exist&&(e.drawn=!0)}),this.compute("end")},requestNodes:function(t,n){var r=e.merge(this.controller,n),i=this.config.levelsToShow;if(r.request){var s=[],o=t._depth;t.eachLevel(0,i,function(e){e.drawn&&!e.anySubnode()&&(s.push(e),e._level=i-(e._depth-o))}),this.group.requestNodes(s,r)}else r.onComplete()},contract:function(t,n){var i=this.config.orientation,s=this.geom,o=this.group;n&&s.switchOrientation(n);var u=r.call(this);n&&s.switchOrientation(i),o.contract(u,e.merge(this.controller,t))},move:function(t,n){this.compute("end",!1);var r=n.Move,i={x:r.offsetX,y:r.offsetY};r.enable&&this.geom.translate(t.endPos.add(i).$scale(-1),"end"),this.fx.animate(e.merge(this.controller,{modes:["linear"]},n))},expand:function(t,n){var r=s.call(this,t);this.group.expand(r,e.merge(this.controller,n))},selectPath:function(t){function i(t){if(t==null||t.selected)return;t.selected=!0,e.each(r.group.getSiblings([t])[t.id],function(e){e.exist=!0,e.drawn=!0});var n=t.getParents();n=n.length>0?n[0]:null,i(n)}var r=this;this.graph.eachNode(function(e){e.selected=!1});for(var s=0,o=[t.id].concat(n);s<o.length;s++)i(this.graph.getNode(o[s]))},setRoot:function(e,t,n){function u(){if(this.config.multitree&&o.data.$orn){var t=o.data.$orn,u={left:"right",right:"left",top:"bottom",bottom:"top"}[t];s.data.$orn=u,function a(t){t.eachSubnode(function(t){t.id!=e&&(t.data.$orn=u,a(t))})}(s),delete o.data.$orn}this.root=e,this.clickedNode=o,this.graph.computeLevels(this.root,0,"ignore"),this.geom.setRightLevelToShow(o,i,{execHide:!1,onShow:function(e){e.drawn||(e.drawn=!0,e.setData("alpha",1,"end"),e.setData("alpha",0),e.pos.setc(o.pos.x,o.pos.y))}}),this.compute("end"),this.busy=!0,this.fx.animate({modes:["linear","node-property:alpha"],onComplete:function(){r.busy=!1,r.onClick(e,{onComplete:function(){n&&n.onComplete()}})}})}if(this.busy)return;this.busy=!0;var r=this,i=this.canvas,s=this.graph.getNode(this.root),o=this.graph.getNode(e);delete s.data.$orns,t=="animate"?(u.call(this),r.selectPath(o)):t=="replot"&&(u.call(this),this.select(this.root))},addSubtree:function(t,n,r){n=="replot"?this.op.sum(t,e.extend({type:"replot"},r||{})):n=="animate"&&this.op.sum(t,e.extend({type:"fade:seq"},r||{}))},removeSubtree:function(t,n,r,i){var s=this.graph.getNode(t),o=[];s.eachLevel(+!n,!1,function(e){o.push(e.id)}),r=="replot"?this.op.removeNode(o,e.extend({type:"replot"},i||{})):r=="animate"&&this.op.removeNode(o,e.extend({type:"fade:seq"},i||{}))},select:function(t,n){var i=this.group,o=this.geom,u=this.graph.getNode(t),a=this.canvas,f=this.graph.getNode(this.root),l=e.merge(this.controller,n),c=this;l.onBeforeCompute(u),this.selectPath(u),this.clickedNode=u,this.requestNodes(u,{onComplete:functio
|
|||
|
,t.showAggregates(n.name,y,n)?u.display="":u.display="none",t.orientation=="horizontal"?(u.textAlign="right",o.textAlign="left",o.textIndex=u.textIndent=t.labelOffset+"px",u.top=o.top=(p-d)/2+"px",e.style.height=i.height=p+"px"):(u.top=-d-t.labelOffset+"px",o.top=t.labelOffset+p+"px",e.style.top=parseInt(e.style.top,10)-p+"px",e.style.height=i.height=p+"px"),r.aggregate.innerHTML=y}}}),u=o.canvas.getSize(),a=t.Margin;i?(o.config.offsetX=u.width/2-a.left-(t.showLabels&&t.labelOffset+t.Label.size),o.config.offsetY=(a.bottom-a.top)/2):(o.config.offsetY=-u.height/2+a.bottom+(t.showLabels&&t.labelOffset+t.Label.size),o.config.offsetX=(a.right-a.left)/2),this.st=o,this.canvas=this.st.canvas},loadJSON:function(t){if(this.busy)return;this.busy=!0;var n=e.time(),r=[],i=this.st,s=e.splat(t.label),o=e.splat(t.color||this.colors),u=this.config,a=!!u.type.split(":")[1],f=u.animate,l=u.orientation=="horizontal",c=this;for(var h=0,p=t.values,d=p.length;h<d;h++){var v=p[h],m=e.splat(p[h].values),g=0;r.push({id:n+v.label,name:v.label,data:{value:m,$valueArray:m,$colorArray:o,$stringArray:s,$gradient:a,$config:u},children:[]})}var y={id:n+"$root",name:"",data:{$type:"none",$width:1,$height:1},children:r};i.loadJSON(y),this.normalizeDims(),i.compute(),i.select(i.root),f?l?i.fx.animate({modes:["node-property:width:dimArray"],duration:1500,onComplete:function(){c.busy=!1}}):i.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){c.busy=!1}}):this.busy=!1},updateJSON:function(t,n){if(this.busy)return;this.busy=!0;var r=this.st,i=r.graph,s=t.values,o=this.config.animate,u=this,a=this.config.orientation=="horizontal";e.each(s,function(n){var r=i.getByName(n.label);r&&(r.setData("valueArray",e.splat(n.values)),t.label&&r.setData("stringArray",e.splat(t.label)))}),this.normalizeDims(),r.compute(),r.select(r.root),o&&(a?r.fx.animate({modes:["node-property:width:dimArray"],duration:1500,onComplete:function(){u.busy=!1,n&&n.onComplete()}}):r.fx.animate({modes:["node-property:height:dimArray"],duration:1500,onComplete:function(){u.busy=!1,n&&n.onComplete()}}))},select:function(e,t){if(!this.config.hoveredColor)return;var n=this.selected;if(n.id!=e||n.name!=t)n.id=e,n.name=t,n.color=this.config.hoveredColor,this.st.graph.eachNode(function(t){e==t.id?t.setData("border",n):t.setData("border",!1)}),this.st.plot()},getLegend:function(){var t={},n;this.st.graph.getNode(this.st.root).eachAdjacency(function(e){n=e.nodeTo});var r=n.getData("colorArray"),i=r.length;return e.each(n.getData("stringArray"),function(e,n){t[e]=r[n%i]}),t},getMaxValue:function(){var t=0,n=this.config.type.split(":")[0]=="stacked";return this.st.graph.eachNode(function(r){var i=r.getData("valueArray"),s=0;if(!i)return;n?e.each(i,function(e){s+=+e}):s=Math.max.apply(null,i),t=t>s?t:s}),t},setBarType:function(e){this.config.type=e,this.st.config.Node.type="barchart-"+e.split(":")[0]},normalizeDims:function(){var t=this.st.graph.getNode(this.st.root),n=0;t.eachAdjacency(function(){n++});var r=this.getMaxValue()||1,i=this.st.canvas.getSize(),s=this.config,o=s.Margin,u=o.left+o.right,a=o.top+o.bottom,f=s.orientation=="horizontal",l=(i[f?"height":"width"]-(f?a:u)-(n-1)*s.barsOffset)/n,c=s.animate,h=i[f?"width":"height"]-(f?u:a)-(!f&&s.showAggregates&&s.Label.size+s.labelOffset)-(s.showLabels&&s.Label.size+s.labelOffset),p=f?"height":"width",d=f?"width":"height";this.st.graph.eachNode(function(t){var n=0,i=[];e.each(t.getData("valueArray"),function(e){n+=+e,i.push(0)}),t.setData(p,l);if(c){t.setData(d,n*h/r,"end"),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return e*h/r}),"end");var s=t.getData("dimArray");s||t.setData("dimArray",i)}else t.setData(d,n*h/r),t.setData("dimArray",e.map(t.getData("valueArray"),function(e){return e*h/r}))})}}),i.PieChart={$extend:!0,animate:!0,offset:25,sliceOffset:0,labelOffset:3,type:"stacked",hoveredColor:"#9fd4ff",Events:{enable:!1,onClick:e.empty},Tips:{enable:!1,onShow:e.empty,onHide:e.empty},showLabels:!0,resizeLabels:!1,updateHeights:!1},b.Radial=new t({compute:function(t){var n=e.splat(t||["current",
|
|||
|
norm()||1;i.disp[e].$add(o.$scale(n.nodef(u)/u))})})});var u=!!r.getNode(this.root).visited;r.eachNode(function(r){r.eachAdjacency(function(i){var s=i.nodeTo;!!s.visited===u&&e.each(t,function(e){var t=r.getPos(e),i=s.getPos(e);o.x=t.x-i.x,o.y=t.y-i.y;var u=o.norm()||1;r.disp[e].$add(o.$scale(-n.edgef(u)/u)),s.disp[e].$add(o.$scale(-1))})}),r.visited=!u});var a=n.t,f=n.width/2,l=n.height/2;r.eachNode(function(n){e.each(t,function(e){var t=n.disp[e],r=t.norm()||1,e=n.getPos(e);e.$add(p(t.x*i(Math.abs(t.x),a)/r,t.y*i(Math.abs(t.y),a)/r)),e.x=i(f,s(-f,e.x)),e.y=i(l,s(-l,e.y))})})}}),$jit.ForceDirected=new t({Implements:[y,a,b.ForceDirected],initialize:function(t){var n=$jit.ForceDirected,r={iterations:50,levelDistance:50};this.controller=this.config=e.merge(i("Canvas","Node","Edge","Fx","Tips","NodeStyles","Events","Navigation","Controller","Label"),r,t);var s=this.config;s.useCanvas?(this.canvas=s.useCanvas,this.config.labelContainer=this.canvas.id+"-label"):(s.background&&(s.background=e.merge({type:"Circles"},s.background)),this.canvas=new f(this,s),this.config.labelContainer=(typeof s.injectInto=="string"?s.injectInto:s.injectInto.id)+"-label"),this.graphOptions={complex:!0,Node:{selected:!1,exist:!0,drawn:!0}},this.graph=new d(this.graphOptions,this.config.Node,this.config.Edge),this.labels=new n.Label[s.Label.type](this),this.fx=new n.Plot(this,n),this.op=new n.Op(this),this.json=null,this.busy=!1,this.initializeExtras()},refresh:function(){this.compute(),this.plot()},reposition:function(){this.compute("end")},computeIncremental:function(t){t=e.merge({iter:20,property:"end",onStep:e.empty,onComplete:e.empty},t||{}),this.config.onBeforeCompute(this.graph.getNode(this.root)),this.compute(t.property,t)},plot:function(){this.fx.plot()},animate:function(t){this.fx.animate(e.merge({modes:["linear"]},t||{}))}}),$jit.ForceDirected.$extend=!0,function(n){n.Op=new t({Implements:d.Op}),n.Plot=new t({Implements:d.Plot}),n.Label={},n.Label.Native=new t({Implements:d.Label.Native}),n.Label.SVG=new t({Implements:d.Label.SVG,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)};e.setAttribute("x",l.x),e.setAttribute("y",l.y),n.onPlaceLabel(e,t)}}),n.Label.HTML=new t({Implements:d.Label.HTML,initialize:function(e){this.viz=e},placeLabel:function(e,t,n){var r=t.pos.getc(!0),i=this.viz.canvas,s=i.translateOffsetX,o=i.translateOffsetY,u=i.scaleOffsetX,a=i.scaleOffsetY,f=i.getSize(),l={x:Math.round(r.x*u+s+f.width/2),y:Math.round(r.y*a+o+f.height/2)},c=e.style;c.left=l.x+"px",c.top=l.y+"px",c.display=this.fitsInCanvas(l,i)?"":"none",n.onPlaceLabel(e,t)}}),n.Plot.NodeTypes=new t({none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.circle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.circle.contains(n,t,r)}},ellipse:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.ellipse.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.ellipse.contains(n,t,r,i)}},square:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.square.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.square.contains(n,t,r)}},rectangle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");this.nodeHelper.rectangle.render("fill",n,r,i,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("width"),i=e.getData("height");return this.nodeHelper.rectangle.contains(n,t,r,i)}},triangle:{render:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");this.nodeHelper.triangle.render("fill",n,r,t)},contains:function(e,t){var n=e.pos.getc(!0),r=e.getData("dim");return this.nodeHelper.triangle.contains
|
|||
|
,background:!1},i.Tree={$extend:!0,orientation:"left",subtreeOffset:8,siblingOffset:5,indent:10,multitree:!1,align:"center"},i.Node={$extend:!1,overridable:!1,type:"circle",color:"#ccb",alpha:1,dim:3,height:20,width:90,autoHeight:!1,autoWidth:!1,lineWidth:1,transform:!0,align:"center",angularWidth:1,span:1,CanvasStyles:{}},i.Edge={$extend:!1,overridable:!1,type:"line",color:"#ccb",lineWidth:1,dim:15,alpha:1,epsilon:7,CanvasStyles:{}},i.Fx={$extend:!0,fps:40,duration:2500,transition:$jit.Trans.Quart.easeInOut,clearCanvas:!0},i.Label={$extend:!1,overridable:!1,type:"HTML",style:" ",size:10,family:"sans-serif",textAlign:"center",textBaseline:"alphabetic",color:"#fff"},i.Tips={$extend:!1,enable:!1,type:"auto",offsetX:20,offsetY:20,force:!1,onShow:e.empty,onHide:e.empty},i.NodeStyles={$extend:!1,enable:!1,type:"auto",stylesHover:!1,stylesClick:!1},i.Events={$extend:!1,enable:!1,enableForEdges:!1,type:"auto",onClick:e.empty,onRightClick:e.empty,onMouseMove:e.empty,onMouseEnter:e.empty,onMouseLeave:e.empty,onDragStart:e.empty,onDragMove:e.empty,onDragCancel:e.empty,onDragEnd:e.empty,onTouchStart:e.empty,onTouchMove:e.empty,onTouchEnd:e.empty,onMouseWheel:e.empty},i.Navigation={$extend:!1,enable:!1,type:"auto",panning:!1,zooming:!1},i.Controller={$extend:!0,onBeforeCompute:e.empty,onAfterCompute:e.empty,onCreateLabel:e.empty,onPlaceLabel:e.empty,onComplete:e.empty,onBeforePlotLine:e.empty,onAfterPlotLine:e.empty,onBeforePlotNode:e.empty,onAfterPlotNode:e.empty,request:!1};var s={initialize:function(e,t){this.viz=t,this.canvas=t.canvas,this.config=t.config[e],this.nodeTypes=t.fx.nodeTypes;var n=this.config.type;this.dom=n=="auto"?t.config.Label.type!="Native":n!="Native",this.labelContainer=this.dom&&t.labels.getLabelContainer(),this.isEnabled()&&this.initializePost()},initializePost:e.empty,setAsProperty:e.lambda(!1),isEnabled:function(){return this.config.enable},isLabel:function(t,n){t=e.event.get(t,n);var r=this.labelContainer,i=t.target||t.srcElement;return i&&i.parentNode==r?i:!1}},o={onMouseUp:e.empty,onMouseDown:e.empty,onMouseMove:e.empty,onMouseOver:e.empty,onMouseOut:e.empty,onMouseWheel:e.empty,onTouchStart:e.empty,onTouchMove:e.empty,onTouchEnd:e.empty,onTouchCancel:e.empty},u=new t({initialize:function(e){this.viz=e,this.canvas=e.canvas,this.node=!1,this.edge=!1,this.registeredObjects=[],this.attachEvents()},attachEvents:function(){var t=this.canvas.getElement(),n=this;t.oncontextmenu=e.lambda(!1),e.addEvents(t,{mouseup:function(t,r){var i=e.event.get(t,r);n.handleEvent("MouseUp",t,r,n.makeEventObject(t,r),e.event.isRightClick(i))},mousedown:function(t,r){var i=e.event.get(t,r);n.handleEvent("MouseDown",t,r,n.makeEventObject(t,r),e.event.isRightClick(i))},mousemove:function(e,t){n.handleEvent("MouseMove",e,t,n.makeEventObject(e,t))},mouseover:function(e,t){n.handleEvent("MouseOver",e,t,n.makeEventObject(e,t))},mouseout:function(e,t){n.handleEvent("MouseOut",e,t,n.makeEventObject(e,t))},touchstart:function(e,t){n.handleEvent("TouchStart",e,t,n.makeEventObject(e,t))},touchmove:function(e,t){n.handleEvent("TouchMove",e,t,n.makeEventObject(e,t))},touchend:function(e,t){n.handleEvent("TouchEnd",e,t,n.makeEventObject(e,t))}});var r=function(t,r){var i=e.event.get(t,r),s=e.event.getWheel(i);n.handleEvent("MouseWheel",t,r,s)};!document.getBoxObjectFor&&window.mozInnerScreenX==null?e.addEvent(t,"mousewheel",r):t.addEventListener("DOMMouseScroll",r,!1)},register:function(e){this.registeredObjects.push(e)},handleEvent:function(){var e=Array.prototype.slice.call(arguments),t=e.shift();for(var n=0,r=this.registeredObjects,i=r.length;n<i;n++)r[n]["on"+t].apply(r[n],e)},makeEventObject:function(t,n){var r=this,i=this.viz.graph,s=this.viz.fx,o=s.nodeTypes,u=s.edgeTypes;return{pos:!1,node:!1,edge:!1,contains:!1,getNodeCalled:!1,getEdgeCalled:!1,getPos:function(){var i=r.viz.canvas,s=i.getSize(),o=i.getPos(),u=i.translateOffsetX,a=i.translateOffsetY,f=i.scaleOffsetX,l=i.scaleOffsetY,c=e.event.getPos(t,n);return this.pos={x:(c.x-o.x-s.width/2-u)*1/f,y:(c.y-o.y-s.height/2-a)*1/l},this.pos},getNode:function(){if(this.getNodeCalled)retu
|
|||
|
r&&c.push("label-property:"+e.splat(r["label-property"]).join(":")),i.reposition(),i.graph.eachNode(function(e){e.id!=o&&e.pos.getp().equals(l.KER)&&(e.pos.set(e.endPos),e.startPos.set(e.endPos))}),i.fx.animate(e.merge(s,{modes:["polar"].concat(c),onComplete:function(){i.graph.eachNode(function(e){e.ignore&&i.graph.removeNode(e.id)}),i.graph.eachNode(function(e){e.eachAdjacency(function(e){e.ignore&&i.graph.removeAdjacence(e.nodeFrom.id,e.nodeTo.id)})}),s.onComplete()}}));break;default:}},contract:function(t,n){var r=this.viz;if(t.collapsed||!t.anySubnode(e.lambda(!0)))return;n=e.merge(this.options,r.config,n||{},{modes:["node-property:alpha:span","linear"]}),t.collapsed=!0,function i(e){e.eachSubnode(function(e){e.ignore=!0,e.setData("alpha",0,n.type=="animate"?"end":"current"),i(e)})}(t),n.type=="animate"?(r.compute("end"),r.rotated&&r.rotate(r.rotated,"none",{property:"end"}),function s(e){e.eachSubnode(function(e){e.setPos(t.getPos("end"),"end"),s(e)})}(t),r.fx.animate(n)):n.type=="replot"&&r.refresh()},expand:function(t,n){if(!("collapsed"in t))return;var r=this.viz;n=e.merge(this.options,r.config,n||{},{modes:["node-property:alpha:span","linear"]}),delete t.collapsed,function i(e){e.eachSubnode(function(e){delete e.ignore,e.setData("alpha",1,n.type=="animate"?"end":"current"),i(e)})}(t),n.type=="animate"?(r.compute("end"),r.rotated&&r.rotate(r.rotated,"none",{property:"end"}),r.fx.animate(n)):n.type=="replot"&&r.refresh()},preprocessSum:function(e){var t=this.viz;e.eachNode(function(e){if(!t.graph.hasNode(e.id)){t.graph.addNode(e);var n=t.graph.getNode(e.id);n.setData("alpha",0),n.setData("alpha",0,"start"),n.setData("alpha",1,"end")}});var n=!1;return e.eachNode(function(e){e.eachAdjacency(function(e){var r=t.graph.getNode(e.nodeFrom.id),i=t.graph.getNode(e.nodeTo.id);if(!r.adjacentTo(i)){var e=t.graph.addAdjacence(r,i,e.data);r.startAlpha==r.endAlpha&&i.startAlpha==i.endAlpha&&(n=!0,e.setData("alpha",0),e.setData("alpha",0,"start"),e.setData("alpha",1,"end"))}})}),n}};var m={none:{render:e.empty,contains:e.lambda(!1)},circle:{render:function(e,t,n,r){var i=r.getCtx();i.beginPath(),i.arc(t.x,t.y,n,0,Math.PI*2,!0),i.closePath(),i[e]()},contains:function(e,t,n){var r=e.x-t.x,i=e.y-t.y,s=r*r+i*i;return s<=n*n}},ellipse:{render:function(e,t,n,r,i){var s=i.getCtx();r/=2,n/=2,s.save(),s.scale(n/r,r/n),s.beginPath(),s.arc(t.x*(r/n),t.y*(n/r),r,0,Math.PI*2,!0),s.closePath(),s[e](),s.restore()},contains:function(e,t,n,r){n/=2,r/=2;var i=(n+r)/2,s=e.x-t.x,o=e.y-t.y,u=s*s+o*o;return u<=i*i}},square:{render:function(e,t,n,r){r.getCtx()[e+"Rect"](t.x-n,t.y-n,2*n,2*n)},contains:function(e,t,n){return Math.abs(t.x-e.x)<=n&&Math.abs(t.y-e.y)<=n}},rectangle:{render:function(e,t,n,r,i){i.getCtx()[e+"Rect"](t.x-n/2,t.y-r/2,n,r)},contains:function(e,t,n,r){return Math.abs(t.x-e.x)<=n/2&&Math.abs(t.y-e.y)<=r/2}},triangle:{render:function(e,t,n,r){var i=r.getCtx(),s=t.x,o=t.y-n,u=s-n,a=t.y+n,f=s+n,l=a;i.beginPath(),i.moveTo(s,o),i.lineTo(u,a),i.lineTo(f,l),i.closePath(),i[e]()},contains:function(e,t,n){return m.circle.contains(e,t,n)}},star:{render:function(e,t,n,r){var i=r.getCtx(),s=Math.PI/5;i.save(),i.translate(t.x,t.y),i.beginPath(),i.moveTo(n,0);for(var o=0;o<9;o++)i.rotate(s),o%2==0?i.lineTo(n/.525731*.200811,0):i.lineTo(n,0);i.closePath(),i[e](),i.restore()},contains:function(e,t,n){return m.circle.contains(e,t,n)}}},g={line:{render:function(e,t,n){var r=n.getCtx();r.beginPath(),r.moveTo(e.x,e.y),r.lineTo(t.x,t.y),r.stroke()},contains:function(e,t,n,r){var i=Math.min,s=Math.max,o=i(e.x,t.x),u=s(e.x,t.x),a=i(e.y,t.y),f=s(e.y,t.y);if(n.x>=o&&n.x<=u&&n.y>=a&&n.y<=f){if(Math.abs(t.x-e.x)<=r)return!0;var l=(t.y-e.y)/(t.x-e.x)*(n.x-e.x)+e.y;return Math.abs(l-n.y)<=r}return!1}},arrow:{render:function(e,t,n,r,i){var s=i.getCtx();if(r){var o=e;e=t,t=o}var u=new h(t.x-e.x,t.y-e.y);u.$scale(n/u.norm());var a=new h(t.x-u.x,t.y-u.y),f=new h(-u.y/2.5,u.x/2.5),l=a.add(f),c=a.$add(f.$scale(-1)),p=new h(t.x-e.x,t.y-e.y);p.$scale(15/p.norm());var d=new h(t.x-p.x,t.y-p.y);t.x=d.x,t.y=d.y,s.beginPath(),s.moveTo(e.x,e.y),s.lineTo(t.x,t.y),s.stroke
|
|||
|
(s))}},i)}}(),function(){var e=navigator.userAgent,t=e.match(/iPhone/i)||e.match(/iPad/i),n=typeof HTMLCanvasElement,r=n=="object"||n=="function",i=r&&typeof document.createElement("canvas").getContext("2d").fillText=="function";labelType=!r||i&&!t?"Native":"HTML",nativeTextSupport=labelType=="Native",useGradients=r,animate=!t&&!!r}();var imgArray=new Object;imgArray.Group=new Image,imgArray.Group.src="/assets/group.png",imgArray.Person=new Image,imgArray.Person.src="/assets/person.png",imgArray.Bizarre=new Image,imgArray.Bizarre.src="/assets/bizarre.png",imgArray.Catalyst=new Image,imgArray.Catalyst.src="/assets/catalyst.png",imgArray.Closed=new Image,imgArray.Closed.src="/assets/closed.png",imgArray.Experience=new Image,imgArray.Experience.src="/assets/experience.png",imgArray["Future Dev"]=new Image,imgArray["Future Dev"].src="/assets/futuredev.png",imgArray.Idea=new Image,imgArray.Idea.src="/assets/idea.png",imgArray.Implication=new Image,imgArray.Implication.src="/assets/implication.png",imgArray.Insight=new Image,imgArray.Insight.src="/assets/insight.png",imgArray.Intention=new Image,imgArray.Intention.src="/assets/intention.png",imgArray.Knowledge=new Image,imgArray.Knowledge.src="/assets/knowledge.png",imgArray.Location=new Image,imgArray.Location.src="/assets/location.png",imgArray["Open Issue"]=new Image,imgArray["Open Issue"].src="/assets/openissue.png",imgArray.Opinion=new Image,imgArray.Opinion.src="/assets/opinion.png",imgArray.Opportunity=new Image,imgArray.Opportunity.src="/assets/opportunity.png",imgArray.Platform=new Image,imgArray.Platform.src="/assets/platform.png",imgArray.Problem=new Image,imgArray.Problem.src="/assets/problem.png",imgArray.Question=new Image,imgArray.Question.src="/assets/question.png",imgArray.Reference=new Image,imgArray.Reference.src="/assets/reference.png",imgArray.Requirement=new Image,imgArray.Requirement.src="/assets/requirement.png",imgArray.Resource=new Image,imgArray.Resource.src="/assets/resource.png",imgArray.Role=new Image,imgArray.Role.src="/assets/role.png",imgArray.Task=new Image,imgArray.Task.src="/assets/task.png",imgArray.Tool=new Image,imgArray.Tool.src="/assets/tool.png",imgArray.Trajectory=new Image,imgArray.Trajectory.src="/assets/trajectory.png",imgArray.Action=new Image,imgArray.Action.src="/assets/action.png",imgArray.Activity=new Image,imgArray.Activity.src="/assets/activity.png",$jit.ForceDirected.Plot.NodeTypes.implement(nodeSettings),$jit.ForceDirected.Plot.EdgeTypes.implement(edgeSettings),$jit.RGraph.Plot.NodeTypes.implement(nodeSettings),$jit.RGraph.Plot.EdgeTypes.implement(edgeSettings),$(document).ready(function(){$("#sideOptionOrganize").bind("click",function(){organizeOpen||openOrganize()}),$("#closeOrganize").bind("click",function(){organizeOpen&&closeOrganize()})}),function(e){function t(t,n,r){var i,s,o=t.width,u=t.width,a,f;f=e(t.parentNode),this.element=i=f.append("<canvas class='reflection' style='position:absolute'/>").find(":last")[0];if(!i.getContext&&e.browser.msie)this.element=i=f.append("<img class='reflection' style='position:absolute'/>").find(":last")[0],i.src=t.src,i.style.filter="flipv progid:DXImageTransform.Microsoft.Alpha(opacity="+r*100+", style=1, finishOpacity=0, startx=0, starty=0, finishx=0, finishy="+n/u*100+")";else{s=i.getContext("2d");try{e(i).attr({width:o,height:n}),s.save(),s.translate(0,u-1),s.scale(1,-1),s.drawImage(t,0,0,o,u),s.restore(),s.globalCompositeOperation="destination-out",a=s.createLinearGradient(0,0,0,n),a.addColorStop(0,"rgba(255, 255, 255, "+(1-r)+")"),a.addColorStop(1,"rgba(255, 255, 255, 1.0)"),s.fillStyle=a,s.fillRect(0,0,o,n)}catch(l){return}}e(i).attr({alt:e(t).attr("alt"),title:e(t).attr("title")})}var n=function(n,r){this.orgWidth=n.width,this.orgHeight=n.height,this.image=n,this.reflection=null,this.alt=n.alt,this.title=n.title,this.imageOK=!1,this.options=r,this.imageOK=!0,this.options.reflHeight>0&&(this.reflection=new t(this.image,this.options.reflHeight,this.options.reflOpacity)),e(this.image).css("position","absolute")},r=function(t,r,i){var s=[],o=Math.sin,u=Math.cos,a=this;this.cont
|
|||
|
,[n,r]),t=="drag"&&(this.positionAbs=this._convertPositionTo("absolute")),e.Widget.prototype._trigger.call(this,t,n,r)},plugins:{},_uiHash:function(e){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}}),e.extend(e.ui.draggable,{version:"1.8.23"}),e.ui.plugin.add("draggable","connectToSortable",{start:function(t,n){var r=e(this).data("draggable"),i=r.options,s=e.extend({},n,{item:r.element});r.sortables=[],e(i.connectToSortable).each(function(){var n=e.data(this,"sortable");n&&!n.options.disabled&&(r.sortables.push({instance:n,shouldRevert:n.options.revert}),n.refreshPositions(),n._trigger("activate",t,s))})},stop:function(t,n){var r=e(this).data("draggable"),i=e.extend({},n,{item:r.element});e.each(r.sortables,function(){this.instance.isOver?(this.instance.isOver=0,r.cancelHelperRemoval=!0,this.instance.cancelHelperRemoval=!1,this.shouldRevert&&(this.instance.options.revert=!0),this.instance._mouseStop(t),this.instance.options.helper=this.instance.options._helper,r.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})):(this.instance.cancelHelperRemoval=!1,this.instance._trigger("deactivate",t,i))})},drag:function(t,n){var r=e(this).data("draggable"),i=this,s=function(t){var n=this.offset.click.top,r=this.offset.click.left,i=this.positionAbs.top,s=this.positionAbs.left,o=t.height,u=t.width,f=t.top,l=t.left;return e.ui.isOver(i+n,s+r,f,l,o,u)};e.each(r.sortables,function(s){this.instance.positionAbs=r.positionAbs,this.instance.helperProportions=r.helperProportions,this.instance.offset.click=r.offset.click,this.instance._intersectsWith(this.instance.containerCache)?(this.instance.isOver||(this.instance.isOver=1,this.instance.currentItem=e(i).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",!0),this.instance.options._helper=this.instance.options.helper,this.instance.options.helper=function(){return n.helper[0]},t.target=this.instance.currentItem[0],this.instance._mouseCapture(t,!0),this.instance._mouseStart(t,!0,!0),this.instance.offset.click.top=r.offset.click.top,this.instance.offset.click.left=r.offset.click.left,this.instance.offset.parent.left-=r.offset.parent.left-this.instance.offset.parent.left,this.instance.offset.parent.top-=r.offset.parent.top-this.instance.offset.parent.top,r._trigger("toSortable",t),r.dropped=this.instance.element,r.currentItem=r.element,this.instance.fromOutside=r),this.instance.currentItem&&this.instance._mouseDrag(t)):this.instance.isOver&&(this.instance.isOver=0,this.instance.cancelHelperRemoval=!0,this.instance.options.revert=!1,this.instance._trigger("out",t,this.instance._uiHash(this.instance)),this.instance._mouseStop(t,!0),this.instance.options.helper=this.instance.options._helper,this.instance.currentItem.remove(),this.instance.placeholder&&this.instance.placeholder.remove(),r._trigger("fromSortable",t),r.dropped=!1)})}}),e.ui.plugin.add("draggable","cursor",{start:function(t,n){var r=e("body"),i=e(this).data("draggable").options;r.css("cursor")&&(i._cursor=r.css("cursor")),r.css("cursor",i.cursor)},stop:function(t,n){var r=e(this).data("draggable").options;r._cursor&&e("body").css("cursor",r._cursor)}}),e.ui.plugin.add("draggable","opacity",{start:function(t,n){var r=e(n.helper),i=e(this).data("draggable").options;r.css("opacity")&&(i._opacity=r.css("opacity")),r.css("opacity",i.opacity)},stop:function(t,n){var r=e(this).data("draggable").options;r._opacity&&e(n.helper).css("opacity",r._opacity)}}),e.ui.plugin.add("draggable","scroll",{start:function(t,n){var r=e(this).data("draggable");r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"&&(r.overflowOffset=r.scrollParent.offset())},drag:function(t,n){var r=e(this).data("draggable"),i=r.options,s=!1;if(r.scrollParent[0]!=document&&r.scrollParent[0].tagName!="HTML"){if(!i.axis||i.axis!="x")r.overflowOffset.top+r.scrollParent[0].offsetHeight-t.pageY<i.scrollSensitivity?r.scrollParent[0].scrollTop=s=r.scrollParent[0].scrollTop+i.scrollSpeed:t.pageY-r.overflowOffset.top<i.scrollSensitivity&&(r.scrollParent
|
|||
|
,a;o.keypress(r),o.keydown(function(e){(e.keyCode===8||e.keyCode===46)&&r(e)}),o.keyup(i),o.blur(function(e){i(e,0)})}e.fn.typing=function(e){return this.each(function(n,r){t(r,e)})}}(jQuery),function(){}.call(this);var viewMode="list",labelType,useGradients,nativeTextSupport,animate,json,Mconsole=null,gType,tempNode=null,tempInit=!1,tempNode2=null,metacodeIMGinit=!1,findOpen=!1,analyzeOpen=!1,organizeOpen=!1,goRealtime=!1,mapid=null;$(document).ready(function(){$("#new_topic, #new_synapse").bind("contextmenu",function(e){return!1}),$("#topic_name").bind("railsAutocomplete.select",function(e,t){t.item.id!=undefined&&$("#topic_grabTopic").val(t.item.id)}),$(".new_topic").bind("submit",function(e,t){e.preventDefault()}),$(".focus .desc").mCustomScrollbar(),$(".scroll").mCustomScrollbar(),$(".nodemargin").css("padding-top",$(".focus").css("height"));var e=!1,t;$(".logo").hover(function(){clearTimeout(t),e||(e=!0,userid!=null?$(".footer .menu").animate({height:"252px"},300,function(){e=!1}):$(".footer .menu").animate({height:"140px"},300,function(){e=!1}))},function(){t=setTimeout(function(){e||(e=!0,$(".footer .menu").animate({height:"0px"},300,function(){e=!1}))},800)}),$("#saveLayout").click(function(e){e.preventDefault(),saveLayoutAll()})});
|