diff options
author | Ankita <ankita@ankita-Inspiron-N5010.(none)> | 2012-07-03 12:42:57 -0400 |
---|---|---|
committer | Ankita <ankita@ankita-Inspiron-N5010.(none)> | 2012-07-03 12:42:57 -0400 |
commit | ef3793b349be5744d6ef98a034f0c009159ed85b (patch) | |
tree | 04a873d770c330ce97eef3e78d43edb2d619d1a3 /gstudio/templates/gstudio/skeleton.html | |
parent | e5c470536ee2d3571817b1a60f6b910f17a33f31 (diff) | |
parent | 471a772b4d2e1430a3a119593e8694c4af2c951a (diff) | |
download | gnowsys-ef3793b349be5744d6ef98a034f0c009159ed85b.tar.gz |
Merge branch 'master' of https://github.com/gnowgi/gnowsys-studio
Conflicts:
django_gstudio.egg-info/PKG-INFO
django_gstudio.egg-info/requires.txt
Diffstat (limited to 'gstudio/templates/gstudio/skeleton.html')
-rw-r--r-- | gstudio/templates/gstudio/skeleton.html | 262 |
1 files changed, 203 insertions, 59 deletions
diff --git a/gstudio/templates/gstudio/skeleton.html b/gstudio/templates/gstudio/skeleton.html index eba5e28..c99bab9 100644 --- a/gstudio/templates/gstudio/skeleton.html +++ b/gstudio/templates/gstudio/skeleton.html @@ -16,7 +16,7 @@ .mainnode{ font: 15px sans-serif; - fill:"black"; + fill:black; border-width: 1px; font-weight:bold; border-color: gray; @@ -89,15 +89,39 @@ <script src="{% admin_media_prefix %}js/grappelli/jquery.grp_autocomplete_fk.js" type="text/javascript"></script> <script src="{% admin_media_prefix %}js/grappelli/jquery.grp_autocomplete_m2m.js" type="text/javascript"></script> <script src="{% admin_media_prefix %}js/grappelli/jquery.grp_autocomplete_generic.js" type="text/javascript"></script> - <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-timepicker-0.2.9/include/jquery-1.5.1.min.js"></script> - <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-timepicker-0.2.9/include/jquery.ui.core.min.js"></script> - <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-timepicker-0.2.9/include/jquery.ui.widget.min.js"></script> - <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-timepicker-0.2.9/include/jquery.ui.tabs.min.js"></script> - <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery-ui-timepicker-0.2.9/include/jquery.ui.position.min.js"></script> - - <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/jquery.ui.timepicker.js"></script> <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script> + <!-- Gnowmacs css, js --> + + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/test/dl/js/thelib.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/jquery-1.7.1.min.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/jquery-ui-1.8.18.custom.min.js"></script> + + <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}gstudio/js/Gnowmacs/test/dl/css/default.css" /> + <link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}gstudio/js/Gnowmacs/src/css/ymacs.css" /> + + + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/jquery.ui.gnowmacs.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-keyboard.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-regexp.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-frame.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-textprop.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-exception.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-interactive.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-buffer.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-marker.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-commands.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-commands-utils.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-keymap.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-keymap-isearch.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-minibuffer.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-tokenizer.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-mode-paren-match.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/gnowmacs.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/savedata.js"></script> + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/Gnowmacs/src/js/ymacs-keymap-emacs.js"></script> + <script src="{{STATIC_URL}}gstudio/js/gstudio.js" type="text/javascript"></script> <!-- EXTRAHEAD --> {% block extrahead %}{% endblock %} @@ -114,9 +138,9 @@ <link rel="pingback" href="/xmlrpc/" /> <link rel="shortcut icon" href="{{ STATIC_URL }}gstudio/img/favicon.ico" /> <link rel="home" href="{% url gstudio_nodetype_archive_index %}" /> - <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/grappelli_skin_default.css" /> + <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/screen.css" /> - <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/screen_gstudio.css" /> + <link rel="stylesheet" type="text/css" media="print" href="{{ STATIC_URL }}gstudio/css/print.css" /> <!--[if lt IE 8]> <link rel="stylesheet" type="text/css" media="screen, projection" href="{{ STATIC_URL }}gstudio/css/ie.css" /> @@ -141,7 +165,7 @@ {% include "gstudio/_header.html" %} - <div id="breadcrumbs" class="span-24 last"> + <div id="breadcrumbs" class=""> / {% block breadcrumbs %}{% endblock %} </div> <div id="body" class="span-24 last"> @@ -150,7 +174,9 @@ {% endblock %} </div> - + <div id="gnoweditor"> + </div> + <div id="graphcss"> <div id="chart"> @@ -178,8 +204,8 @@ function init(a,b) { + - nodes_by_id = _.reduce(a, function(acc, n) { acc[n._id] = n; return acc; @@ -198,16 +224,19 @@ function init(a,b) return nodes_by_id[e.from] && nodes_by_id[e.to]&& e.type!="title" && e.type!="content" }).value(); - + } $(function fgraph() { - +neighbour_node= new Array(); +clicked_node=new Array(); +prev_node=new Array(); +neighbour_node= neighbour_node.concat({{object.id}}); $.getJSON('/nodetypes/graphs/graph_json/' + {{object.id}}, function (json1) { metadata=json1.node_metadata; relations=json1.relations; - relnset=json1.relset + init(metadata,relations); load({{object.id}}) }); @@ -338,29 +367,128 @@ function load(key) .attr("fill", "#6D6666"); - -$(window).bind('keydown',function(event){ - if(17==event.keyCode){ - new_g.on("click",function(d){ - if(d._id>0 && d.expanded=="false") - { - d3.select("#amazingViz").remove(); - d.expanded="true"; - $.getJSON('/nodetypes/graphs/graph_json/' + d._id , function (json2) { - new_metadata=json2.node_metadata; - new_relations=json2.relations; - new_relnset=json2.relset - metadata=_.union(new_metadata,metadata); - relations=_.union(new_relations,relations); - init(metadata,relations); - load(d._id) - }) +$(window).bind('keydown',function(event) { + if(event.keyCode==17){ + + new_g.on("click",function(d){ + + + + + if(d._id>0 && d.expanded=="true" && d._id!= {{object.id}}) + { + + $.getJSON('/nodetypes/graphs/graph_json/' + d._id , function (json2) { + new_metadata=json2.node_metadata; + + }); + + _.filter(new_metadata, function(e){if(e._id>0) + { + clicked_node=clicked_node.concat(e._id) ; + } + }); + + + index = _.indexOf(neighbour_node , d._id); + prev_node=neighbour_node.slice(0,index); + + neighbour_node = _.difference(neighbour_node,clicked_node) ; + + neighbour_node= neighbour_node.concat(prev_node); + neighbour_node = _.uniq(neighbour_node); + metadata=[] + relations=[] + metadata1=[] + relations1=[] + for(i=0;i<(neighbour_node.length);i++) + { + + d3.select("#amazingViz").remove(); + g=neighbour_node[i] + + + + $.ajax({ + async:false, + url:'/nodetypes/graphs/graph_json/' + g , + datatype:'json', + success:function (json2) { + new_metadata=json2.node_metadata; + new_relations=json2.relations; + metadata=_.union(new_metadata,metadata); + + relations=_.union(new_relations,relations); + relations= check_Relationtype(metadata,relations); + }}); + } - - }); + _.each(metadata, function(m){ + + for(i=0;i<neighbour_node.length;i++) + { + if(m._id==neighbour_node[i]) + {m.expanded="true";} + else + {m.expanded="false";} + } + + + }); + + init(metadata,relations); + load({{object.id}}) ; -} + + + } + + + + + else if(d._id>0 && d._id!= {{object.id}}) + { + + neighbour_node =neighbour_node.concat(d._id); + + d3.select("#amazingViz").remove(); + + $.ajax({ + async:false, + url:'/nodetypes/graphs/graph_json/' + d._id , + datatype:'json', + success:function (json2) { + + new_metadata=json2.node_metadata; + new_relations=json2.relations; + + metadata=_.union(new_metadata,metadata); + relations=_.union(new_relations,relations); + relations= check_Relationtype(metadata,relations); + _.each(metadata, function(m){ + + for(i=0;i<neighbour_node.length;i++) + { + if(m._id==neighbour_node[i]) + m.expanded="true"; + } + }); + + + }}); + console.log(metadata); + init(metadata,relations); + load({{object.id}}); + + + + + } }); +} + +}); + @@ -370,37 +498,27 @@ $(window).bind('keydown',function(event){ }); - /*new_g.append("svg:ellipse") - .attr("cx", function(d) { return d.x - w/2.0 +15; }) - .attr("cy", function(d) { return d.y - h/2.0 +15 ; }) - .call(force.drag) - .attr("rx", function(d) { return ((d.screen_name).length) +10 }) - .attr("ry", function(d) { if (d._id==key) return 8; else if (isNaN(d._id) || (d._id)<0) return 1; else return 7 }); - //.style("fill", function color(d) { if (d._id==key) return "red"; else if (isNaN(d._id) || (d._id)<0) return "white" ; else return "green"});*/ - - + - var text1 = new_g.append("svg:text") + text1 = new_g.append("svg:text") .attr("class",function(d) {var e=(d._id).charAt(0); if (d._id==key) return "mainnode";else if (e=="-") return "nodetext"; else if (isNaN(d._id)) return "relnode"; else return "node"; }) .attr("y", 20) .attr("x", 25) .attr("dy", ".35em") .attr("text-anchor","middle") - // .attr("style",function text(d) { if ((d._id)>0) return "font-size:9.00pt;fill:blue;" ; else return "font-size:9.00pt;fill:black;"}) - + .text(function(d) { return d.screen_name; }); - var bbox = text1.node().getBBox(); - + bbox = text1.node().getBBox(); + console.log(bbox); new_g.filter(function(d) { return (d._id).charAt(0)=="-"; }).append("svg:rect") - .attr("x",bbox.x-22 - ) + .attr("x",bbox.x-22) .attr("y", bbox.y) .attr("width", function(d) {var ttx=d.screen_name ; return (ttx.length+bbox.width+40)}) .attr("height", bbox.height) @@ -423,7 +541,7 @@ $(window).bind('keydown',function(event){ .style("fill-opacity", ".2") .style("stroke", "#666") .style("stroke-width", "1.5px") - .style("fill", function color(d) {var e=(d._id).charAt(0); if (d.expanded=="true") return "red"; else return "none"}); + .style("fill", function(d) {if ((d.expanded=="true" && d.refType=="Objecttype") ||(d._id=={{object.id}}) ) return "blue"; else if(d.expanded=="true" && d.refType=="Gbobject") return "red"; else return "none"}); @@ -462,17 +580,43 @@ $(window).bind('keydown',function(event){ } +function check_Relationtype(metadata,relations) +{ + + + _.each(metadata,function(d){ + if (d.refType=="Relationtype") + { + a=d.inverse; + if (d.flag==1) + { + relations= _.reject(relations,function(e) + { + return e.type==a + }); + } + else if (d.flag==0) + { + relations= _.reject(relations,function(e) + { + return e.type==d.screen_name + }); + } + } + + }); +return relations; + + +} + }); -//fgraph({{object.id}}); </script> </div> - <div id="sidebar"> - {% block sidebar %} - {% endblock %} - </div> + </div> <div id="footer"> @@ -488,6 +632,6 @@ $(window).bind('keydown',function(event){ </p> </div> - </div> + </body> </html> |