Initial Commit

This commit is contained in:
Barak Michener 2014-06-20 18:21:47 -04:00
commit bbb0a2f580
126 changed files with 14189 additions and 0 deletions

62
templates/head.tmpl Normal file
View file

@ -0,0 +1,62 @@
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
{{define "head"}}
<title>Cayley</title>
<meta charset="utf-8" />
<!-- Latest compiled and minified CSS -->
<!--<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">-->
<link rel="stylesheet" href="/static/third_party/flatly/bootstrap.min.css">
<!-- IE -->
<link rel="shortcut icon" type="image/x-icon" href="/static/favicon.ico" />
<!-- other browsers -->
<link rel="icon" type="image/x-icon" href="/static/favicon.ico" />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<!--<link href="//netdna.bootstrapcdn.com/bootstrap/3.1.0/css/bootstrap.min.css" rel="stylesheet">-->
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.21.0/codemirror.min.css">
<link rel="stylesheet" href="/static/css/grid.css">
<link rel="stylesheet" href="/static/css/query_editor.css">
<!-- Optional theme -->
<!--<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css">-->
<!-- Latest compiled and minified JavaScript -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<!-- Codemirror -->
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.21.0/codemirror.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.21.0/addon/edit/matchbrackets.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.21.0/addon/comment/continuecomment.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/codemirror/3.21.0/mode/javascript/javascript.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/snap.svg/0.2.0/snap.svg-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/fabric.js/1.4.0/fabric.min.js"></script>
<!-- D3.js -->
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.4.1/d3.min.js"></script>
{{end}}
{{define "foot"}}
<script type='text/javascript'>
$(document).ready(function() {
$('[data-toggle=offcanvas]').click(function() {
$('.row-offcanvas').toggleClass('active');
});
});
</script>
{{end}}

49
templates/query.html Normal file
View file

@ -0,0 +1,49 @@
<!DOCTYPE html>
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<html>
<head>
{{template "head"}}
</head>
<body>
<div class="page-container">
{{template "top_navbar"}}
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">
{{template "sidebar"}}
<!-- main area -->
<div class="col-sm-10 col-xs-12" id="main">
<div class="row">
<div class="col-sm-12 col-xs-12 codecol">
<textarea id="code">g.Emit("Hello World")</textarea>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-xs-12">
<textarea id="output" name="output"></textarea>
</div>
</div>
</div> <!--/#main-->
</div> <!--/.row-->
</div><!--/.container-->
</div><!--/.page-container-->
</body>
{{template "foot"}}
<script src="/static/js/cayley_main.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/cayley_query.js" type="text/javascript" charset="utf-8"></script>
</html>

View file

@ -0,0 +1,49 @@
<!DOCTYPE html>
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<html>
<head>
{{template "head"}}
</head>
<body>
<div class="page-container">
{{template "top_navbar"}}
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">
{{template "sidebar"}}
<!-- main area -->
<div class="col-sm-10 col-xs-12" id="main">
<div class="row">
<div class="col-sm-12 col-xs-12 codecol">
<textarea id="code">g.Emit("Hello World")</textarea>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12" id="viz">
</div><!-- /.col-xs-12 main -->
</div>
</div> <!--/#main-->
</div> <!--/.row-->
</div><!--/.container-->
</div><!--/.page-container-->
</body>
{{template "foot"}}
<script src="/static/js/cayley_main.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/cayley_shape.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/query_viz.js" type="text/javascript" charset="utf-8"></script>
</html>

63
templates/sidebar.tmpl Normal file
View file

@ -0,0 +1,63 @@
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
{{define "sidebar"}}
<!-- sidebar -->
<div class="col-xs-6 col-sm-2 sidebar-offcanvas" id="sidebar" role="navigation">
<div class="row bottompad">
<div class="col-xs-8 col-sm-8 col-xs-offset-2 col-sm-offset-2">
<div class="btn-group-vertical center-block">
<button id="run_button" type="button" class="btn btn-primary center-block">Run Query</button>
<div class="btn-group center-block">
<button id="selected-query-lang" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
Gremlin &nbsp; <span class="caret"></span>
</button>
<ul class="dropdown-menu" role="menu">
<li class="dropdown-header">Query Languauge</li>
<li><a id="gremlin-dropdown" href="#">Gremlin</a></li>
<li><a id="mql-dropdown" href="#">MQL</a></li>
</ul>
</div>
</div>
</div>
</div>
<ul class="nav">
<li id="sbQuery"><a href="/">Query</a></li>
<li id="sbQueryShape"><a href="/ui/query_shape">Query Shape</a></li>
<li id="sbVisualize"><a href="/ui/visualize">Visualize</a></li>
<li ></li>
<li id="sbWrite"><a href="/ui/write">Write</a></li>
</ul>
<div class="row bottompad at-bottom">
<div class="col-xs-8 col-sm-8 col-xs-offset-2 col-sm-offset-2">
<!--<div class="btn-group-vertical center-block">-->
<div class="btn-group center-block dropup">
<button class="btn btn-sm center-block dropdown-toggle" type="button" data-toggle="dropdown"> Documentation <span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a href="/docs/Overview" target="_blank">Overview</a></li>
<li><a href="/docs/GremlinAPI" target="_blank">Gremlin API</a></li>
<li><a href="/docs/MQL" target="_blank">MQL</a></li>
<li><a href="/docs/Configuration" target="_blank">Configuration</a></li>
<li><a href="/docs/HTTP" target="_blank">HTTP API</a></li>
</ul>
</div>
<!--</div>-->
</div>
</div>
</div>
{{end}}

37
templates/top_navbar.tmpl Normal file
View file

@ -0,0 +1,37 @@
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
{{define "top_navbar"}}
<!-- top navbar -->
<div class="navbar navbar-fixed-top" role="navigation">
<div id="alertBox" class="alert" >
Wrote a triple!
</div>
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle navbar-color-back" data-toggle="offcanvas" data-target=".sidebar-nav">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
More
</button>
<div id="logo-div">
<div id="logo" width="105" height="65" class="hide-small"></div>
<h1>Cayley</h1>
</div>
</div>
</div>
</div>
{{end}}

54
templates/visualize.html Normal file
View file

@ -0,0 +1,54 @@
<!DOCTYPE html>
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<html>
<head>
{{template "head"}}
<script src="/static/third_party/sigmajs/sigma.min.js"></script>
<script src="/static/third_party/sigmajs/plugins/sigma.layout.forceAtlas2.min.js"></script>
<script src="/static/third_party/sigmajs/plugins/sigma.parsers.json.min.js"></script>
<script src="/static/third_party/sigmajs/plugins/sigma.plugins.animate.min.js"></script>
</head>
<body>
<div class="page-container">
{{template "top_navbar"}}
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">
{{template "sidebar"}}
<!-- main area -->
<div class="col-sm-10 col-xs-12" id="main">
<div class="row">
<div class="col-sm-12 col-xs-12 codecol">
<textarea id="code">g.Emit("Hello World")</textarea>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12">
<div id="visualize" width=100% height=100%>
</div>
</div><!-- /.col-xs-12 main -->
</div>
</div> <!--/#main-->
</div> <!--/.row-->
</div><!--/.container-->
</div><!--/.page-container-->
</body>
{{template "foot"}}
<script src="/static/js/cayley_main.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/cayley_visualize.js" type="text/javascript" charset="utf-8"></script>
</html>

79
templates/write.html Normal file
View file

@ -0,0 +1,79 @@
<!DOCTYPE html>
<!--
// Copyright 2014 The Cayley Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
-->
<html>
<head>
{{template "head"}}
</head>
<body>
<div class="page-container">
{{template "top_navbar"}}
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">
{{template "sidebar"}}
<!-- main area -->
<div class="col-sm-10 col-xs-12" id="main">
<div class="row">
<div class="col-xs-12 col-sm-12">
<h2> Write an N-Quads file: </h2>
<input id="nquad_file" type="file"></input>
</div>
</div><!-- /.col-xs-12 main -->
<div class="row button-row">
<div class="col-sm-12 col-xs-12">
<button id="write_file" type="button" class="btn btn-primary">Write File</button>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-xs-12">
<h2> Write a quad: </h2>
<input id="subject" type="text" placeholder="Subject"></input>
<input id="predicate" type="text" placeholder="Predicate"></input>
<input id="object" type="text" placeholder="Object"></input>
<input id="provenance" type="text" placeholder="Provenance"></input>
</div>
</div>
<div class="row button-row">
<div class="col-sm-12 col-xs-12">
<button id="add_triple" type="button" class="btn">Add Triple</button>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-sm-12">
<h2> Remove a quad: </h2>
<input id="rsubject" type="text" placeholder="Subject"></input>
<input id="rpredicate" type="text" placeholder="Predicate"></input>
<input id="robject" type="text" placeholder="Object"></input>
<input id="rprovenance" type="text" placeholder="Provenance"></input>
</div>
</div><!-- /.col-xs-12 main -->
<div class="row button-row">
<div class="col-sm-12 col-xs-12">
<button id="delete_triple" type="button" class="btn">Delete Triple</button>
</div>
</div>
</div>
</div> <!--/#main-->
</div> <!--/.row-->
</div><!--/.container-->
</div><!--/.page-container-->
</body>
{{template "foot"}}
<script src="/static/js/cayley_main.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/js/cayley_write.js" type="text/javascript" charset="utf-8"></script>
</html>