1
0
Fork 0

Merge branch 'devel' of https://github.com/triAGENS/ArangoDB into devel

This commit is contained in:
Claudius Weinberger 2014-02-21 12:48:29 +01:00
commit 5f8c49b51c
35 changed files with 913 additions and 991 deletions

1
.gitignore vendored
View File

@ -104,3 +104,4 @@ js/apps/*
!js/apps/system
!js/apps/system/*
.sass-cache/

View File

@ -807,7 +807,7 @@ ol ul {
}
li {
line-height: 20px;
line-height: 19px;
}
ul.unstyled,

View File

@ -1,36 +0,0 @@
#tableView {
cursor: pointer;
background-color: #EEEEEE;
}
#sourceFooter {
margin-top: 0;
margin-bottom: 0;
padding-right: 0;
padding-top: 30px;
padding-bottom: 5px;
}
#sourceEditor {
height: 400px;
width: auto;
overflow:hidden;
margin-right: 0px;
padding-bottom: 20px;
border-top: 1px solid #888;
border-left: 1px solid #C0C0C0;
}
#sourceEditor .ui-resizable-handle {
border-left: 0;
}
#sourceDiv {
margin-top: 0px;
padding-bottom: 5px;
min-height: 400px;
margin-bottom: 20px;
}
.sourceBox {
}

View File

@ -1,39 +1,3 @@
.writeable .jediTextarea {
width: 100%;
}
#documentTableID tr td:first-child textarea {
resize: none !important;
height: 20px !important;
}
#documentTableID tr .jediTextarea .btn-success {
margin-right: -13px !important;
}
.writeable .jediTextarea textarea {
width: 100%;
}
#documentTableID .rightCell textarea {
resize: vertical !important;
}
.sorting_1 textarea {
display: inline !important;
max-width: 120px !important;
max-height: 20px !important;
resize: none !important;
}
.textInline {
display:inline !important;
}
.validateError {
border: 2px solid red !important;
}
.disabledBtn {
opacity: 0.4 !important;
cursor: default !important;
@ -87,68 +51,6 @@
cursor: pointer;
}
#addRow {
color: #8AA050;
}
.deleteAttribute {
color: #B30000;
margin-right: -4px;
}
.deleteAttribute:hover {
color: #B30000;
}
.editSecondAttribute, .editFirstAttribute, .docPreview {
text-align: right;
float: right;
}
.editSecondAttribute, .editFirstAttribute {
color: #444444;
font-size: 16px;
padding-top: 4px;
}
.editSecondAttribute:hover, .editFirstAttribute:hover {
cursor: pointer;
color: #444444;
}
.editFirstAttribute, .docPreview{
margin-right: -17px !important;
}
.editSecondAttribute {
margin-right: -30px !important;
padding-bottom: 1px;
}
.addAttribute, .deleteAttribute {
font-size: 22px;
float:right;
padding-top: 2px;
cursor: pointer;
}
.addAttribute:hover {
color: #5E7B36;
}
#documentTableID .icon_arangodb_edit {
font-size: 27px;
margin-top: -2px;
}
#documentTableID {
font-weight: 300;
font-size: 15px !important;
border-collapse:separate;
border-spacing:0 0px;
border-top: 1px solid #888;
background-color: #FFFFFF;
}
table.dataTable thead th {
font-weight: 400 !important;
}
@ -159,37 +61,6 @@ table.dataTable thead th {
padding-bottom: 6px;
}
#documentTableID td {
cursor: default;
}
#documentTableID .writeable {
cursor: pointer;
}
.read_only {
cursor: default !important;
}
#documentTableID .icon-edit {
margin-top: 0;
}
#documentTableID .icon-edit:hover {
cursor: pointer;
}
#documentTableID.dataTable thead tr {
background-color: #FFFFFF;
}
#documentTableID .odd,
#documentTableID .even {
-webkit-box-shadow: none;
-moz-box-shadow: none;
box-shadow: none;
}
.arangoTab > li > a,
.arangoTab > li:hover > a {
border-radius: 0 !important;
@ -224,17 +95,6 @@ table.dataTable thead th {
height: 21px;
}
.rightCell{
overflow: hidden;
text-overflow: ellipsis;
-o-text-overflow: ellipsis;
white-space: nowrap;
}
.rightCell form {
width: 100% !important;
}
.arangoTab {
padding-bottom: 0 !important;
margin-bottom: -1px !important;
@ -254,11 +114,40 @@ table.dataTable thead th {
/*padding: 7px 18px 5px 15px;*/
}
.tdRoundButton {
padding-top: 7px !important;
float: right;
}
#documentTableID.dataTable thead tr th {
border-bottom: 1px solid #C2C2C2;
}
#documentEditor {
width:100%;
height: 500px;
}
.jsoneditor {
background-color: white !important;
border: 1px solid rgba(0,0,0,0.2) !important;
}
.jsoneditor .menu {
background-color: #686766 !important;
border-bottom: 1px solid rgba(0,0,0,0.2) !important;
}
.jsoneditor .search .frame {
border: 0 !important;
margin: 3px !important;
}
.jsoneditor .search .results {
color: white !important;
margin-top: 3px !important;
} 
.jsoneditor .menu button {
background-color: white !important;
border: 1px solid black !important;
}
#saveDocumentButton {
margin-top: 5px;
}

View File

@ -0,0 +1,625 @@
.jsoneditor .field,
.jsoneditor .value,
.jsoneditor .readonly {
border: 1px solid transparent;
min-height: 16px;
min-width: 32px;
padding: 2px;
margin: 1px;
word-wrap: break-word;
float: left;
}
/* adjust margin of p elements inside editable divs, needed for Opera, IE */
.jsoneditor .field p,
.jsoneditor .value p {
margin: 0;
}
.jsoneditor .value {
word-break: break-word;
}
.jsoneditor .readonly {
min-width: 16px;
color: gray;
}
.jsoneditor .empty {
border-color: lightgray;
border-style: dashed;
border-radius: 2px;
}
.jsoneditor .field.empty {
background-image: url('../img/jsoneditor-icons.png');
background-position: 0 -144px;
}
.jsoneditor .value.empty {
background-image: url('../img/jsoneditor-icons.png');
background-position: -48px -144px;
}
.jsoneditor .value.url {
color: green;
text-decoration: underline;
}
.jsoneditor a.value.url:hover,
.jsoneditor a.value.url:focus {
color: red;
}
.jsoneditor .separator {
padding: 3px 0;
vertical-align: top;
color: gray;
}
.jsoneditor .field[contenteditable=true]:focus,
.jsoneditor .field[contenteditable=true]:hover,
.jsoneditor .value[contenteditable=true]:focus,
.jsoneditor .value[contenteditable=true]:hover,
.jsoneditor .field.highlight,
.jsoneditor .value.highlight {
background-color: #FFFFAB;
border: 1px solid yellow;
border-radius: 2px;
}
.jsoneditor .field.highlight-active,
.jsoneditor .field.highlight-active:focus,
.jsoneditor .field.highlight-active:hover,
.jsoneditor .value.highlight-active,
.jsoneditor .value.highlight-active:focus,
.jsoneditor .value.highlight-active:hover {
background-color: #ffee00;
border: 1px solid #ffc700;
border-radius: 2px;
}
.jsoneditor div.tree button {
width: 24px;
height: 24px;
padding: 0;
margin: 0;
border: none;
cursor: pointer;
background: transparent url('../img/jsoneditor-icons.png');
}
.jsoneditor div.tree button.collapsed {
background-position: 0 -48px;
}
.jsoneditor div.tree button.expanded {
background-position: 0 -72px;
}
.jsoneditor div.tree button.contextmenu {
background-position: -48px -72px;
}
.jsoneditor div.tree button.contextmenu:hover,
.jsoneditor div.tree button.contextmenu:focus,
.jsoneditor div.tree button.contextmenu.selected {
background-position: -48px -48px;
}
.jsoneditor div.tree *:focus {
outline: none;
}
.jsoneditor div.tree button:focus {
/* TODO: nice outline for buttons with focus
outline: #97B0F8 solid 2px;
box-shadow: 0 0 8px #97B0F8;
*/
background-color: #f5f5f5;
outline: #e5e5e5 solid 1px;
}
.jsoneditor div.tree button.invisible {
visibility: hidden;
background: none;
}
.jsoneditor {
color: #1A1A1A;
border: 1px solid #97B0F8;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
height: 100%;
overflow: auto;
position: relative;
padding: 0;
line-height: 100%;
}
.jsoneditor div.tree table.tree {
border-collapse: collapse;
border-spacing: 0;
width: 100%;
margin: 0;
}
.jsoneditor div.outer {
width: 100%;
height: 100%;
margin: -35px 0 0 0;
padding: 35px 0 0 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
}
.jsoneditor div.tree {
width: 100%;
height: 100%;
position: relative;
overflow: auto;
}
.jsoneditor textarea.text {
width: 100%;
height: 100%;
margin: 0;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: none;
background-color: white;
resize: none;
}
.jsoneditor tr.highlight {
background-color: #FFFFAB;
}
.jsoneditor div.tree button.dragarea {
visibility: hidden;
background: url('../img/jsoneditor-icons.png') -72px -72px;
cursor: move;
}
.jsoneditor div.tree button.dragarea:hover,
.jsoneditor div.tree button.dragarea:focus {
background-position: -72px -48px;
}
.jsoneditor tr,
.jsoneditor th,
.jsoneditor td {
padding: 0;
margin: 0;
}
.jsoneditor td {
vertical-align: top;
}
.jsoneditor td.tree {
vertical-align: top;
}
.jsoneditor .field,
.jsoneditor .value,
.jsoneditor td,
.jsoneditor th,
.jsoneditor textarea {
font-family: droid sans mono, monospace, courier new, courier, sans-serif;
font-size: 10pt;
color: #1A1A1A;
}
/* ContextMenu - main menu */
.jsoneditor-contextmenu {
position: absolute;
z-index: 99999;
}
.jsoneditor-contextmenu ul {
position: relative;
left: 0;
top: 0;
width: 124px;
background: white;
border: 1px solid #d3d3d3;
box-shadow: 2px 2px 12px rgba(128, 128, 128, 0.3);
list-style: none;
margin: 0;
padding: 0;
}
.jsoneditor-contextmenu ul li button {
padding: 0;
margin: 0;
width: 124px;
height: 24px;
border: none;
cursor: pointer;
color: #4d4d4d;
background: transparent;
line-height: 26px;
text-align: left;
}
/* Fix button padding in firefox */
.jsoneditor-contextmenu ul li button::-moz-focus-inner {
padding: 0;
border: 0;
}
.jsoneditor-contextmenu ul li button:hover,
.jsoneditor-contextmenu ul li button:focus {
color: #1a1a1a;
background-color: #f5f5f5;
outline: none;
}
.jsoneditor-contextmenu ul li button.default {
width: 92px;
}
.jsoneditor-contextmenu ul li button.expand {
float: right;
width: 32px;
height: 24px;
border-left: 1px solid #e5e5e5;
}
.jsoneditor-contextmenu div.icon {
float: left;
width: 24px;
height: 24px;
border: none;
padding: 0;
margin: 0;
background-image: url('../img/jsoneditor-icons.png');
}
.jsoneditor-contextmenu ul li button div.expand {
float: right;
width: 24px;
height: 24px;
padding: 0;
margin: 0 4px 0 0;
background: url('../img/jsoneditor-icons.png') 0 -72px;
opacity: 0.4;
}
.jsoneditor-contextmenu ul li button:hover div.expand,
.jsoneditor-contextmenu ul li button:focus div.expand,
.jsoneditor-contextmenu ul li.selected div.expand,
.jsoneditor-contextmenu ul li button.expand:hover div.expand,
.jsoneditor-contextmenu ul li button.expand:focus div.expand {
opacity: 1;
}
.jsoneditor-contextmenu .separator {
height: 0;
border-top: 1px solid #e5e5e5;
padding-top: 5px;
margin-top: 5px;
}
.jsoneditor-contextmenu button.remove > .icon {
background-position: -24px -24px;
}
.jsoneditor-contextmenu button.remove:hover > .icon,
.jsoneditor-contextmenu button.remove:focus > .icon {
background-position: -24px 0;
}
.jsoneditor-contextmenu button.append > .icon {
background-position: 0 -24px;
}
.jsoneditor-contextmenu button.append:hover > .icon,
.jsoneditor-contextmenu button.append:focus > .icon {
background-position: 0 0;
}
.jsoneditor-contextmenu button.insert > .icon {
background-position: 0 -24px;
}
.jsoneditor-contextmenu button.insert:hover > .icon,
.jsoneditor-contextmenu button.insert:focus > .icon {
background-position: 0 0;
}
.jsoneditor-contextmenu button.duplicate > .icon {
background-position: -48px -24px;
}
.jsoneditor-contextmenu button.duplicate:hover > .icon,
.jsoneditor-contextmenu button.duplicate:focus > .icon {
background-position: -48px 0;
}
.jsoneditor-contextmenu button.sort-asc > .icon {
background-position: -168px -24px;
}
.jsoneditor-contextmenu button.sort-asc:hover > .icon,
.jsoneditor-contextmenu button.sort-asc:focus > .icon {
background-position: -168px 0;
}
.jsoneditor-contextmenu button.sort-desc > .icon {
background-position: -192px -24px;
}
.jsoneditor-contextmenu button.sort-desc:hover > .icon,
.jsoneditor-contextmenu button.sort-desc:focus > .icon {
background-position: -192px 0;
}
/* ContextMenu - sub menu */
.jsoneditor-contextmenu ul li .selected {
background-color: #D4D6D8;
}
.jsoneditor-contextmenu ul li {
overflow: hidden;
}
.jsoneditor-contextmenu ul li ul {
display: none;
position: relative;
left: -10px;
top: 0;
border: none;
box-shadow: inset 0 0 10px rgba(128, 128, 128, 0.5);
padding: 0 10px;
/* TODO: transition is not supported on IE8-9 */
-webkit-transition: all 0.3s ease-out;
-moz-transition: all 0.3s ease-out;
-o-transition: all 0.3s ease-out;
transition: all 0.3s ease-out;
}
.jsoneditor-contextmenu ul li.selected ul {
}
.jsoneditor-contextmenu ul li ul li button {
padding-left: 24px;
}
.jsoneditor-contextmenu ul li ul li button:hover,
.jsoneditor-contextmenu ul li ul li button:focus {
background-color: #f5f5f5;
}
.jsoneditor-contextmenu button.type-string > .icon {
background-position: -144px -24px;
}
.jsoneditor-contextmenu button.type-string:hover > .icon,
.jsoneditor-contextmenu button.type-string:focus > .icon,
.jsoneditor-contextmenu button.type-string.selected > .icon{
background-position: -144px 0;
}
.jsoneditor-contextmenu button.type-auto > .icon {
background-position: -120px -24px;
}
.jsoneditor-contextmenu button.type-auto:hover > .icon,
.jsoneditor-contextmenu button.type-auto:focus > .icon,
.jsoneditor-contextmenu button.type-auto.selected > .icon {
background-position: -120px 0;
}
.jsoneditor-contextmenu button.type-object > .icon {
background-position: -72px -24px;
}
.jsoneditor-contextmenu button.type-object:hover > .icon,
.jsoneditor-contextmenu button.type-object:focus > .icon,
.jsoneditor-contextmenu button.type-object.selected > .icon{
background-position: -72px 0;
}
.jsoneditor-contextmenu button.type-array > .icon {
background-position: -96px -24px;
}
.jsoneditor-contextmenu button.type-array:hover > .icon,
.jsoneditor-contextmenu button.type-array:focus > .icon,
.jsoneditor-contextmenu button.type-array.selected > .icon{
background-position: -96px 0;
}
.jsoneditor-contextmenu button.type-modes > .icon {
background-image: none;
width: 6px;
}
.jsoneditor .menu {
width: 100%;
height: 35px;
padding: 2px;
margin: 0;
overflow: hidden;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
color: #1A1A1A;
background-color: #D5DDF6;
border-bottom: 1px solid #97B0F8;
}
.jsoneditor .menu button {
width: 26px;
height: 26px;
margin: 2px;
padding: 0;
border-radius: 2px;
border: 1px solid black;
background: white url('../img/jsoneditor-icons.png');
color: #4D4D4D;
opacity: 0.8;
font-family: arial, sans-serif;
font-size: 10pt;
float: left;
}
.jsoneditor .menu button:hover {
background-color: #f0f2f5;
}
.jsoneditor .menu button:active {
background-color: #ffffff;
}
.jsoneditor .menu button:disabled {
background-color: white;
}
.jsoneditor .menu button.collapse-all {
background-position: 0 -96px;
}
.jsoneditor .menu button.expand-all {
background-position: 0 -120px;
}
.jsoneditor .menu button.undo {
background-position: -24px -96px;
}
.jsoneditor .menu button.undo:disabled {
background-position: -24px -120px;
}
.jsoneditor .menu button.redo {
background-position: -48px -96px;
}
.jsoneditor .menu button.redo:disabled {
background-position: -48px -120px;
}
.jsoneditor .menu button.compact {
background-position: -72px -96px;
}
.jsoneditor .menu button.format {
background-position: -72px -120px;
}
.jsoneditor .menu button.modes {
background-image: none;
width: auto;
padding-left: 6px;
padding-right: 6px;
}
.jsoneditor .menu button.separator {
margin-left: 10px;
}
.jsoneditor .menu a {
font-family: arial, sans-serif;
font-size: 10pt;
color: #97B0F8;
vertical-align: middle;
}
.jsoneditor .menu a:hover {
color: red;
}
.jsoneditor .menu a.poweredBy {
visibility: hidden;
font-size: 8pt;
position: absolute;
right: 0;
top: 0;
padding: 10px;
}
/* TODO: css for button:disabled is not supported by IE8 */
.jsoneditor .search input,
.jsoneditor .search .results {
font-family: arial, sans-serif;
font-size: 10pt;
color: #1A1A1A;
}
.jsoneditor .search {
position: absolute;
right: 2px;
top: 2px;
}
.jsoneditor .search .frame {
border: 1px solid #97B0F8;
background-color: white;
padding: 0 2px;
margin: 0;
}
.jsoneditor .search .frame table {
border-collapse: collapse;
}
.jsoneditor .search input {
width: 120px;
border: none;
outline: none;
margin: 1px;
}
.jsoneditor .search .results {
color: #4d4d4d;
padding-right: 5px;
line-height: 24px;
}
.jsoneditor .search button {
width: 16px;
height: 24px;
padding: 0;
margin: 0;
border: none;
background: url('../img/jsoneditor-icons.png');
vertical-align: top;
}
.jsoneditor .search button:hover {
background-color: transparent;
}
.jsoneditor .search button.refresh {
width: 18px;
background-position: -99px -73px;
}
.jsoneditor .search button.next {
cursor: pointer;
background-position: -124px -73px;
}
.jsoneditor .search button.next:hover {
background-position: -124px -49px;
}
.jsoneditor .search button.previous {
cursor: pointer;
background-position: -148px -73px;
margin-right: 2px;
}
.jsoneditor .search button.previous:hover {
background-position: -148px -49px;
}

View File

@ -9,6 +9,8 @@
</div>
<div class="usermenu" id="userBar" style="float:right;">
</div>
<div class="notificationmenu" id="notificationBar" style="float:right;">
</div>
<div class="navmenu" id="navigationBar">
</div>
</div>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -1,5 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true*/
/*global EJS, window*/
/*global EJS, window, _, $*/
(function() {
"use strict";
var TemplateEngine = function() {

File diff suppressed because one or more lines are too long

View File

@ -15,7 +15,6 @@
"login" : "login",
"collection/:colid/documents/:pageid" : "documents",
"collection/:colid/:docid" : "document",
"collection/:colid/:docid/source" : "source",
"shell" : "shell",
"query" : "query",
"logs" : "logs",
@ -57,8 +56,9 @@
});
window.arangoCollectionsStore.fetch();
window.documentsView = new window.DocumentsView();
window.documentView = new window.DocumentView();
window.documentSourceView = new window.DocumentSourceView();
window.documentView = new window.DocumentView({
collection: window.arangoDocumentStore
});
window.arangoLogsStore = new window.ArangoLogs();
window.arangoLogsStore.fetch({
success: function () {
@ -72,7 +72,8 @@
this.footerView = new window.FooterView();
this.naviView = new window.NavigationView({
notificationCollection: this.notificationList
notificationCollection: this.notificationList,
userCollection: window.userCollection
});
this.footerView.render();
this.naviView.render();
@ -251,9 +252,6 @@
},
document: function(colid, docid) {
if (!window.documentView) {
window.documentView.initTable();
}
window.documentView.colid = colid;
window.documentView.docid = docid;
window.documentView.render();
@ -262,15 +260,6 @@
window.documentView.typeCheck(type);
},
source: function(colid, docid) {
window.documentSourceView.render();
window.documentSourceView.colid = colid;
window.documentSourceView.docid = docid;
var type = arangoHelper.collectionApiType(colid);
window.documentSourceView.type = type;
window.documentSourceView.typeCheck(type);
},
shell: function() {
if (!this.shellView) {
this.shellView = new window.shellView();

View File

@ -1,4 +1,4 @@
<script id="addGraphView.ejs" type="text/template">
<script id="addNewGraphView.ejs" type="text/template">
<div id="add-graph" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display:none">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>

View File

@ -23,24 +23,24 @@
<ul>
<li class="nav-header">Type</li>
<li><a href="#">
<li><a>
<label class="checkbox checkboxLabel">
<input class="css-checkbox" type="checkbox" id="checkSystem">
<label class="css-label"></label>System
<label class="css-label" id="checkSystem"></label>System
</label>
</a></li>
<li><a href="#">
<li><a>
<label class="checkbox checkboxLabel">
<input class="css-checkbox" type="checkbox" id="checkDocument">
<label class="css-label"></label>Document
<label class="css-label" id="checkDocument"></label>Document
</label>
</a></li>
<li><a href="#">
<li><a>
<label class="checkbox checkboxLabel">
<input class="css-checkbox" type="checkbox" id="checkEdge">
<label class="css-label"></label>Edge
<label class="css-label" id="checkEdge"></label>Edge
</label>
</a></li>
</ul>

View File

@ -1,25 +0,0 @@
<script id="documentSourceView.ejs" type="text/template">
<div class="thumbnails2 sourceBox">
<div id="transparentHeader" class="headerBar">
</div>
<div id="sourceDiv">
<ul class="nav nav-tabs arangoTab">
<li class="active pull-right"><a>Source</a></li>
<li class="pull-right">
<a id="tableView">List</a>
</li>
</ul>
<div id="sourceEditor">
</div>
<div class="form-actions" id="sourceFooter">
<button id="saveSourceDoc" class="btn btn-success" style="float:right">Save</button>
</div>
</div>
</div>
</script>

View File

@ -6,29 +6,8 @@
<div id="tableDiv">
<ul class="nav nav-tabs arangoTab">
<li class="pull-right" ><a id="sourceView">Source</a></li>
<li class="active pull-right">
<a>List</a>
</li>
</ul>
<table cellpadding="0" cellspacing="0" border="0" class="display arangoDataTable" id="documentTableID" width="100%">
<thead>
<tr>
<th>Attribute</th>
<th>&nbsp;</th>
<th>Value</th>
<th>type</th>
<th>&nbsp;</th>
<th>
<a id="addNewRowEntry" class="addAttribute"><span class="icon_arangodb_roundplus" title="Add attribute"></span></a>
</th>
</tr>
</thead>
</table>
<div id="documentEditor"></div>
<button id="saveDocumentButton" class="btn btn-success pull-right">Save</button>
</div>
</div>

View File

@ -23,6 +23,9 @@
<li class="dropdown-item">
<a id="api" class="internalLink" href="#api">API</a>
</li>
<li class="dropdown-item">
<a id="userManagement" class="internalLink" href="#api">User Management</a>
</li>
</ul>
</li>
<li class="dropdown" id="linkDropdown">

View File

@ -0,0 +1,17 @@
<script id="notificationView.ejs" type="text/template">
<ul class="navlist" id="notificationViewUl">
<div class="navlogo">
<div id="stat_hd" class="notificationButton"><a id="stat_hd_counter">0</a></div>
</div>
<li class="dropdown">
<ul class="user-dropdown-menu fixedDropdown" id="notification_menu">
<li class="dropdown-header"><a>Notifications</a></li>
<ul class="innerDropdownInnerUL"></ul>
<button id="removeAllNotifications" class="btn btn-danger">Clear</button>
</ul>
</li>
</ul>
</script>

View File

@ -1,54 +1,26 @@
<script id="userBarView.ejs" type="text/template">
<ul class="navlist" id="userBarUl">
<div class="navlogo">
<div id="stat_hd" class="notificationButton"><a id="stat_hd_counter">0</a></div>
</div>
<li class="dropdown user-menu">
<a href="#" class="tab" id="user" >
<li class="dropdown user-menu userImg">
<a href="#" class="tab userImg" id="user" >
<img class="userMenuImg" src="<%=img%>" id="userimage" /> <b class="caret"></b>
</a>
<ul class="user-dropdown-menu" id="user_dropdown">
<li class="dropdown-header" style="text-transform: none">
<%
if(username === null) {
%>User Management<%
} else {
if (name) {%>
if (name) {%>
<%=name%> (<%=username%>)
<% } else {%>
<%=username%>
<%}
}
%>
<% if(username !== null) { %>
<% } %>
<li class="dropdown-item">
<a id="userProfile" class="tab" href="#user">User profile</a>
</li>
<% } %>
<li class="dropdown-item">
<a id="userManagement" class="internalLink" href="#userManagement">User management</a>
</li>
<% if(username !== null) { %>
<li class="dropdown-item">
<a id="userLogout" class="tab" href="#user">Logout</a>
</li>
<% } %>
</ul>
</li>
<li class="dropdown">
<ul class="user-dropdown-menu fixedDropdown" id="notification_menu">
<li class="dropdown-header"><a>Notifications</a></li>
<ul class="innerDropdownInnerUL"></ul>
<button id="removeAllNotifications" class="btn btn-danger">Clear</button>
</ul>
</li>
</ul>
</script>

View File

@ -43,7 +43,7 @@
</tr>
<tr>
<th>Gravatar-Link:</th>
<th><input type="text" id="editImg" name="img" value="" placeholder="Gravatar"/></th>
<th><input type="text" id="editUserProfileImg" name="img" value="" placeholder="Gravatar"/></th>
</tr>
</table>
</div>

View File

@ -75,13 +75,20 @@
"click #sortName" : "sortName",
"click #sortType" : "sortType",
"click #sortOrder" : "sortOrder",
"click #collectionsToggle" : "toggleView"
"click #collectionsToggle" : "toggleView",
"click .css-label" : "checkBoxes"
},
toggleView: function() {
$('#collectionsDropdown2').slideToggle(200);
},
checkBoxes: function (e) {
//chrome bugfix
var clicked = e.currentTarget.id;
$('#'+clicked).click();
},
checkSystem: function () {
var searchOptions = this.collection.searchOptions;
var oldValue = searchOptions.includeSystem;

View File

@ -1,119 +0,0 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global require, exports, Backbone, EJS, $, window*/
/*global arangoHelper, ace, arangoDocumentStore, templateEngine, _ */
(function() {
"use strict";
window.DocumentSourceView = Backbone.View.extend({
el: '#content',
init: function () {
},
events: {
"click #tableView" : "tableView",
"click #saveSourceDoc" : "saveSourceDoc",
"keypress #sourceEditor" : "sourceShortcut"
},
template: templateEngine.createTemplate("documentSourceView.ejs"),
render: function() {
$(this.el).html(this.template.render({}));
this.breadcrumb();
this.editor();
$('#sourceEditor').resizable({
handles: "s",
ghost: true,
stop: function () {
window.setTimeout(function () {
var editor = ace.edit("sourceEditor");
editor.resize();
},200);
}
});
return this;
},
sourceShortcut: function (e) {
if (e.ctrlKey && e.keyCode === 13) {
this.saveSourceDoc();
}
else if (e.metaKey && !e.ctrlKey && e.keyCode === 13) {
this.saveSourceDoc();
}
},
typeCheck: function (type) {
this.type = type;
if (type === 'edge') {
window.arangoDocumentStore.getEdge(this.colid, this.docid);
window.documentSourceView.fillSourceBox();
}
else if (type === 'document') {
window.arangoDocumentStore.getDocument(this.colid, this.docid);
window.documentSourceView.fillSourceBox();
}
else {
arangoHelper.arangoError('Unknown document type: ' + type);
}
},
editor: function () {
var editor = ace.edit("sourceEditor");
editor.getSession().setMode("ace/mode/javascript");
},
breadcrumb: function () {
var name = window.location.hash.split("/");
$('#transparentHeader').append(
'<div class="breadcrumb">'+
'<a href="#collections" class="activeBread">Collections</a>'+
' > '+
'<a class="activeBread" href="#collection/'+name[1]+'/documents/1">'+name[1]+'</a>'+
' > '+
'<a class="disabledBread">'+name[2]+'</a>'+
'</div>'
);
},
saveSourceDoc: function() {
var editor, model, parsed, result;
if (this.type === 'document') {
editor = ace.edit("sourceEditor");
model = editor.getValue();
try {
parsed = JSON.parse(model);
}
catch (err) {
arangoHelper.arangoError('Invalid document');
return;
}
if (arangoDocumentStore.models[0].internalAttributeChanged(parsed)) {
arangoHelper.arangoError('Cannot change internal attributes of a document');
return;
}
result = window.arangoDocumentStore.saveDocument(this.colid, this.docid, model);
if (result === false) {
arangoHelper.arangoError('Document error');
}
}
else if (this.type === 'edge') {
editor = ace.edit("sourceEditor");
model = editor.getValue();
result = window.arangoDocumentStore.saveEdge(this.colid, this.docid, model);
if (result === false) {
arangoHelper.arangoError('Edge error');
}
}
},
tableView: function () {
var hash = window.location.hash.split("/");
window.location.hash = hash[0] + "/" + hash[1] + "/" + hash[2];
},
fillSourceBox: function () {
var editor = ace.edit("sourceEditor");
editor.setValue(arangoHelper.FormatJSON(arangoDocumentStore.models[0].getSorted()));
editor.clearSelection();
}
});
}());

View File

@ -1,5 +1,5 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true, forin: true */
/*global require, exports, Backbone, EJS, $, window, arangoHelper, value2html, templateEngine */
/*global require, exports, Backbone, EJS, $, window, arangoHelper, jsoneditor, templateEngine */
/*global document */
(function() {
@ -9,224 +9,79 @@
table: '#documentTableID',
colid: 0,
docid: 0,
currentKey: 0,
currentKeyState: "",
oldDocumentState: "",
documentCache: { },
init: function () {
this.initTable();
},
events: {
"click #saveDocument" : "saveDocument",
"click #addDocumentLine" : "addLine",
"click .addAttribute" : "addLine",
"click #documentTableID .deleteAttribute" : "deleteLine",
"click #sourceView" : "sourceView",
"click .editFirstAttribute" : "editFirst",
"click #documentTableID tr" : "clicked",
"click .editSecondAttribute" : "editSecond",
"keydown #documentviewMain" : "listenGlobalKey",
"blur #documentviewMain textarea" : "checkFocus",
"keydown #documentTableID tr td:first-child textarea" : "keyPressedTextareaLeft",
"keydown #documentTableID tr .rightCell textarea" : "keyPressedTextareaRight"
},
keyPressedTextareaLeft: function(e) {
//attributes inline-textarea-tab edit-mode
//check if action is required (empty field)
if (e.keyCode === 9) {
if (!this.validateKey()) {
e.preventDefault();
return;
}
var altTarget = $(e.currentTarget).parent().parent().next().next();
e.preventDefault();
$('.btn-success').click();
$(altTarget).click();
}
else if (e.keyCode === 13) {
if (!this.validateKey()) {
e.preventDefault();
return;
}
$('.btn-success').click();
}
},
validateKey: function () {
var self = this;
var returnval = true;
var data = $('#documentTableID').dataTable().fnGetData();
var focused = $('textarea').val();
if (!focused.trim()) {
//Heiko Form-Validator empty field
returnval = false;
}
var checkWhiteSpaces = focused.replace(/ /g,'');
if (checkWhiteSpaces !== focused) {
//Heiko Form-Validator whitespaces
returnval = false;
}
$.each(data, function(key, val) {
if (val[0] === focused) {
if (val[0] === self.currentKeyState) {
returnval = true;
}
else {
//Heiko Form-Validator duplicate key exists
returnval = false;
}
}
});
return returnval;
},
keyPressedTextareaRight: function(e) {
//values inline-textarea-tab edit-mode
if (e.keyCode === 9) {
e.preventDefault();
var temp = $(e.currentTarget).parent().parent().parent().next().children();
$('.btn-success').click();
var altTarget = temp[0];
while ($(altTarget).text() === '_id' ||
$(altTarget).text() === '_rev' ||
$(altTarget).text() === '_key') {
var temp2 = $(altTarget).parent().next().children();
altTarget = temp2[0];
}
$(altTarget).click();
}
else if (e.ctrlKey && e.keyCode === 13) {
$('.btn-success').click();
}
},
checkFocus: function(e) {
//check if new row has to be saved
var self = this;
var data = $(this.table).dataTable().fnGetData();
$.each(data, function(key, val) {
var rowContent = $('.jediTextarea textarea').val();
if (val[0] === self.currentKey && rowContent === '') {
$(self.table).dataTable().fnDeleteRow( key );
$('#addRow').removeClass('disabledBtn');
}
});
$('td').removeClass('validateError');
return true;
},
listenGlobalKey: function(e) {
if (e.keyCode === 27) {
this.checkFocus();
}
},
template: templateEngine.createTemplate("documentView.ejs"),
events: {
"click #saveDocumentButton" : "saveDocument"
},
editor: 0,
typeCheck: function (type) {
var result;
if (type === 'edge') {
result = window.arangoDocumentStore.getEdge(this.colid, this.docid);
if (result === true) {
this.initTable();
this.drawTable();
}
}
else if (type === 'document') {
result = window.arangoDocumentStore.getDocument(this.colid, this.docid);
if (result === true) {
this.initTable();
this.drawTable();
}
}
if (result === true) {
this.fillEditor();
}
},
arangoHelper.fixTooltips(".icon_arangodb", "left");
arangoHelper.fixTooltips(".docLink", "top");
},
clicked: function (a) {
var self = a.currentTarget;
var checkData = $(this.table).dataTable().fnGetData(self);
try {
if (checkData[0] === '<div class="notwriteable"></div>') {
this.addLine();
return;
}
}
catch (e) {
return;
}
fillEditor: function() {
var insert = this.collection.first().attributes;
insert = this.removeReadonlyKeys(insert);
this.editor.set(this.collection.first().attributes);
},
render: function() {
$(this.el).html(this.template.render({}));
this.breadcrumb();
var container = document.getElementById('documentEditor');
var options = {
search: true,
mode: 'tree',
modes: ['tree', 'code']
};
this.editor = new jsoneditor.JSONEditor(container, options);
return this;
},
editFirst: function (e) {
var element = e.currentTarget;
var prevElement = $(element).parent().prev();
$(prevElement).click();
},
editSecond: function (e) {
var element = e.currentTarget;
var prevElement = $(element).parent().prev();
$(prevElement).click();
},
sourceView: function () {
window.location.hash = window.location.hash + "/source";
removeReadonlyKeys: function (object) {
delete object._key;
delete object._rev;
delete object._id;
return object;
},
saveDocument: function () {
var self = this;
var model, result;
model = window.arangoDocumentStore.models[0].attributes;
model = JSON.stringify(model);
model = this.editor.get();
//check if there are any changes, if not quit
if (model === this.oldDocumentState) {
$('.addAttribute').removeClass('disabledBtn');
return;
}
model = JSON.stringify(model);
if (this.type === 'document') {
result = window.arangoDocumentStore.saveDocument(this.colid, this.docid, model);
if (result === true) {
$('.addAttribute').removeClass('disabledBtn');
$('td').removeClass('validateError');
self.scrollToFocused();
}
else if (result === false) {
arangoHelper.arangoAlert('Document error');
if (result === false) {
arangoHelper.arangoError('Document error:','Could not save');
return;
}
}
else if (this.type === 'edge') {
result = window.arangoDocumentStore.saveEdge(this.colid, this.docid, model);
if (result === true) {
$('.addAttribute').removeClass('disabledBtn');
$('td').removeClass('validateError');
self.scrollToFocused();
}
else if (result === false) {
arangoHelper.arangoError('Edge error');
if (result === false) {
arangoHelper.arangoError('Edge error:', 'Could not save');
return;
}
}
},
scrollToFocused: function () {
//function to center focused element
window.setTimeout(function() {
var heightPosition = $(window).scrollTop();
$(window).scrollTop(heightPosition-55);
}, 150);
},
breadcrumb: function () {
var name = window.location.hash.split("/");
$('#transparentHeader').append(
@ -262,324 +117,10 @@
return self.documentCache[handle];
},
drawTable: function () {
var self = this;
$.each(window.arangoDocumentStore.models[0].attributes, function(key, value) {
if (arangoHelper.isSystemAttribute(key)) {
var preview = "";
var html;
if (key === "_from" || key === "_to") {
var linkedDoc = self.getLinkedDoc(value);
if (linkedDoc !== null && linkedDoc !== undefined) {
preview = '<span class="docPreview arangoicon icon_arangodb_info" title="' +
self.escaped(JSON.stringify(linkedDoc)) + '"></span>';
html = '<a href="#collection/' + value +
'" class="docLink" title="Go to document">' + self.escaped(value) +
'</a>';
}
else {
html = self.escaped(value);
}
}
else {
html = self.value2html(value, true);
}
$(self.table).dataTable().fnAddData([
key,
preview,
html,
JSON.stringify(value, null, 4),
"",
""
]);
}
else {
$(self.table).dataTable().fnAddData([
key,
'<a class="editFirstAttribute"><span class="icon_arangodb_edit"></span></a>',
self.value2html(value),
JSON.stringify(value, null, 4),
'<a class="editSecondAttribute"><span class="icon_arangodb_edit"></span></a>',
'<a class="deleteAttribute"><span class="icon_arangodb_roundminus" ' +
'title="Delete attribute"></span></a>'
]);
}
});
this.makeEditable();
$(document).bind('keydown', function(e) {
if ((e.ctrlKey && e.keyCode === 65) || (e.ctrlKey && e.keyCode === 78)) {
if ($('#addNewRowEntry')) {
$('#addNewRowEntry').click();
}
}
});
},
jumpToPageBottom: function () {
$('html, body').scrollTop($(document).height() - $(window).height());
},
addLine: function (event) {
if ($('.addAttribute').hasClass('disabledBtn') === true) {
return;
}
$('.addAttribute').addClass('disabledBtn');
//event.stopPropagation();
var randomKey = arangoHelper.getRandomToken();
var self = this;
self.currentKey = "zkey" + randomKey;
$(this.table).dataTable().fnAddData(
[
self.currentKey,
'<a class="editFirstAttribute"><span class="icon_arangodb_edit"></span></a>',
this.value2html("editme"),
JSON.stringify("editme"),
'<a class="editSecondAttribute"><span class="icon_arangodb_edit"></span></a>',
'<a class="deleteAttribute"><span class="icon_arangodb_roundminus" ' +
'title="Delete attribute"></span></a>'
]
);
this.makeEditable();
var tableContent = $('table').find('td');
$.each(tableContent, function(key, val) {
if ($(val).text() === self.currentKey) {
$(val).click();
$('.jediTextarea textarea').val("");
return;
}
});
self.jumpToPageBottom();
arangoHelper.fixTooltips(".icon_arangodb", "left");
},
deleteLine: function (a) {
var row = $(a.currentTarget).closest("tr").get(0);
$(this.table).dataTable().fnDeleteRow($(this.table).dataTable().fnGetPosition(row));
this.updateLocalDocumentStorage();
},
initTable: function () {
$(this.table).dataTable({
"bSortClasses": false,
"bAutoWidth": false,
"bFilter": false,
"bPaginate":false,
"bSortable": false,
"bLengthChange": false,
"bDeferRender": true,
"iDisplayLength": -1,
"aoColumns": [
{"sClass":"writeable keyRow", "bSortable": false, "sWidth":"200px" },
{"sClass":"read_only leftCell", "bSortable": false, "sWidth": "20px"},
{"sClass":"writeable rightCell", "bSortable": false},
{"bVisible": false },
{"sClass":"read_only leftCell", "bSortable": false, "sWidth": "20px"},
{"sClass":"read_only leftCell", "bSortable": false, "sWidth": "30px"}
],
"oLanguage": {"sEmptyTable": "No documents"}
});
},
value2html: function (value, isReadOnly) {
var self = this;
var typify = function (value) {
var checked = typeof value;
switch(checked) {
case 'number':
return ("<a class=\"sh_number\">" + value + "</a>");
case 'string':
return ("<a class=\"sh_string\">" + self.escaped(value) + "</a>");
case 'boolean':
return ("<a class=\"sh_keyword\">" + value + "</a>");
case 'object':
if (value instanceof Array) {
return ("<a class=\"sh_array\">" + self.escaped(JSON.stringify(value)) + "</a>");
}
return ("<a class=\"sh_object\">"+ self.escaped(JSON.stringify(value)) + "</a>");
}
};
return (isReadOnly ? '<i class="readOnlyClass">' : '') + typify(value) + '</i>';
},
escaped: function (value) {
return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")
.replace(/"/g, "&quot;").replace(/'/g, "&#39;");
},
updateLocalDocumentStorage: function () {
var data = $(this.table).dataTable().fnGetData();
var result = {};
var row;
for (row in data) {
var row_data = data[row];
var key = row_data[0];
var value = row_data[3];
result[key] = JSON.parse(value);
}
window.arangoDocumentStore.updateLocalDocument(result);
//then sent to server
this.saveDocument();
},
makeEditable: function () {
var documentEditTable = $(this.table).dataTable();
var self = this;
var i = 0;
$('.writeable', documentEditTable.fnGetNodes() ).each(function () {
if (i === 1) {
$(this).removeClass('writeable');
i = 0;
}
if (arangoHelper.isSystemAttribute(this.innerHTML)) {
$(this).removeClass('writeable');
i = 1;
}
});
$('.writeable', documentEditTable.fnGetNodes()).editable(function(value, settings) {
var aPos = documentEditTable.fnGetPosition(this);
if (aPos[1] === 0) {
documentEditTable.fnUpdate(self.escaped(value), aPos[0], aPos[1]);
self.updateLocalDocumentStorage();
return value;
}
if (aPos[1] === 2) {
var oldContent = JSON.parse(documentEditTable.fnGetData(aPos[0], aPos[1] + 1));
var test = self.getTypedValue(value);
if (String(value) === String(oldContent)) {
// no change
return self.value2html(oldContent);
}
// change update hidden row
documentEditTable.fnUpdate(JSON.stringify(test), aPos[0], aPos[1] + 1);
self.updateLocalDocumentStorage();
// return visible row
return self.value2html(test);
}
},{
data: function() {
$(".btn-success").click();
var aPos = documentEditTable.fnGetPosition(this);
var value = documentEditTable.fnGetData(aPos[0], aPos[1]);
var model;
if (aPos[1] === 0) {
//save current document state
model = window.arangoDocumentStore.models[0].attributes;
self.oldDocumentState = JSON.stringify(model);
//save current key state
self.currentKeyState = value;
//check if this row was newly created
if (value === self.currentKey) {
return value;
}
return value;
}
if (aPos[1] === 2) {
var oldContent = documentEditTable.fnGetData(aPos[0], aPos[1] + 1);
//save current document state
model = window.arangoDocumentStore.models[0].attributes;
self.oldDocumentState = JSON.stringify(model);
if (typeof oldContent === 'object') {
//grep hidden row and paste in visible row
return value2html(oldContent);
}
return oldContent;
}
},
width: "none", // if not set, each row will get bigger & bigger (Safari & Firefox)
type: "autogrow",
tooltip: 'click to edit',
cssclass : 'jediTextarea',
submitcssclass: 'btn btn-success pull-right',
cancelcssclass: 'btn btn-danger pull-right',
cancel: 'Cancel',
submit: 'Save',
onblur: 'cancel',
onsubmit: self.validate,
onreset: self.resetFunction
});
},
resetFunction: function (settings, original) {
try {
var currentKey2 = window.documentView.currentKey;
var data = $('#documentTableID').dataTable().fnGetData();
$.each(data, function(key, val) {
if (val[0] === currentKey2) {
$('#documentTableID').dataTable().fnDeleteRow(key);
$('.addAttribute').removeClass('disabledBtn');
}
});
}
catch (e) {
}
},
//broken
validate: function (settings, td) {
var returnval = true;
return returnval;
},
getTypedValue: function (value) {
value = value.replace(/(^\s+|\s+$)/g, '');
if (value === 'true') {
return true;
}
if (value === 'false') {
return false;
}
if (value === 'null') {
return null;
}
if (value.match(/^-?((\d+)?\.)?\d+$/)) {
//support exp notation
return parseFloat(value);
}
try {
// assume list or object
var test = JSON.parse(value);
if (test instanceof Array) {
// value is an array
return test;
}
if (typeof test === 'object') {
// value is an object
return test;
}
}
catch (err) {
}
// fallback: value is a string
value = String(value);
if (value !== '' && (value.substr(0, 1) !== '"' || value.substr(-1) !== '"')) {
//Heiko: Form-Validator - invalid string value
throw "error";
}
try {
value = JSON.parse(value);
}
catch (e) {
//Heiko: Form-Validator - invalid string value
throw e;
}
return value;
}
});
}());

View File

@ -14,14 +14,17 @@
},
initialize: function () {
this.userCollection = this.options.userCollection,
this.dbSelectionView = new window.DBSelectionView({
collection: window.arangoDatabase,
current: window.currentDB
});
this.userBarView = new window.UserBarView({
collection: this.options.notificationCollection,
userCollection: window.userCollection
});
this.notificationView = new window.NotificationView({
collection: this.options.notificationCollection,
});
this.statisticBarView = new window.StatisticBarView({});
},
@ -29,7 +32,6 @@
this.dbSelectionView.render($("#dbSelect"));
},
template: templateEngine.createTemplate("navigationView.ejs"),
render: function () {
@ -37,7 +39,10 @@
isSystem: window.currentDB.get("isSystem")
}));
this.dbSelectionView.render($("#dbSelect"));
this.userBarView.render($("#userBar"));
this.notificationView.render($("#notificationBar"));
if (this.userCollection.whoAmI() !== null) {
this.userBarView.render();
}
this.statisticBarView.render($("#statisticBar"));
return this;
},

View File

@ -0,0 +1,64 @@
/*jslint indent: 2, nomen: true, maxlen: 100, vars: true, white: true, plusplus: true */
/*global Backbone, templateEngine, $, window*/
(function () {
"use strict";
window.NotificationView = Backbone.View.extend({
events: {
"click .navlogo #stat_hd" : "toggleNotification",
"click .notificationItem .fa" : "removeNotification",
"click #removeAllNotifications" : "removeAllNotifications"
},
initialize: function () {
this.collection.bind("add", this.renderNotifications.bind(this));
this.collection.bind("remove", this.renderNotifications.bind(this));
this.collection.bind("reset", this.renderNotifications.bind(this));
},
notificationItem: templateEngine.createTemplate("notificationItem.ejs"),
el: '#notificationBar',
template: templateEngine.createTemplate("notificationView.ejs"),
toggleNotification: function (e) {
$('#notification_menu').toggle();
},
removeAllNotifications: function () {
this.collection.reset();
},
removeNotification: function(e) {
var cid = e.target.id;
this.collection.get(cid).destroy();
},
renderNotifications: function() {
$('#stat_hd_counter').text(this.collection.length);
if (this.collection.length === 0) {
$('#stat_hd').removeClass('fullNotification');
}
else {
$('#stat_hd').addClass('fullNotification');
}
$('.innerDropdownInnerUL').html(this.notificationItem.render({
notifications : this.collection
}));
},
render: function () {
$(this.el).html(this.template.render({
notifications : this.collection
}));
this.renderNotifications();
this.delegateEvents();
return this.el;
}
});
}());

View File

@ -10,22 +10,15 @@
"click .tab" : "navigateByTab",
"mouseenter .dropdown" : "showDropdown",
"mouseleave .dropdown" : "hideDropdown",
"click .navlogo #stat_hd" : "toggleNotification",
"click .notificationItem .fa" : "removeNotification",
"click #removeAllNotifications" : "removeAllNotifications",
"click #userLogout" : "userLogout"
},
initialize: function () {
this.collection.bind("add", this.renderNotifications.bind(this));
this.collection.bind("remove", this.renderNotifications.bind(this));
this.collection.bind("reset", this.renderNotifications.bind(this));
this.userCollection = this.options.userCollection;
this.userCollection.bind("change", this.render(this.$el));
this.userCollection.fetch({async:false});
this.userCollection.bind("change:extra", this.render.bind(this));
},
notificationItem: templateEngine.createTemplate("notificationItem.ejs"),
template: templateEngine.createTemplate("userBarView.ejs"),
navigateBySelect: function () {
@ -46,10 +39,6 @@
e.preventDefault();
},
toggleNotification: function (e) {
$('#notification_menu').toggle();
},
showDropdown: function (e) {
var tab = e.target || e.srcElement;
var navigateTo = tab.id;
@ -63,30 +52,6 @@
$("#user_dropdown").hide();
},
removeAllNotifications: function () {
this.collection.reset();
},
removeNotification: function(e) {
var cid = e.target.id;
this.collection.get(cid).destroy();
},
renderNotifications: function() {
$('#stat_hd_counter').text(this.collection.length);
if (this.collection.length === 0) {
$('#stat_hd').removeClass('fullNotification');
}
else {
$('#stat_hd').addClass('fullNotification');
}
$('.innerDropdownInnerUL').html(this.notificationItem.render({
notifications : this.collection
}));
},
render: function (el) {
var username = this.userCollection.whoAmI(),
img = null,
@ -94,7 +59,6 @@
active = false,
currentUser = null;
if (username !== null) {
this.userCollection.fetch({async:false});
currentUser = this.userCollection.findWhere({user: username});
currentUser.set({loggedIn : true});
name = currentUser.get("extra").name;
@ -104,25 +68,21 @@
if (!img) {
img = "img/arangodblogoAvatar.png";
} else {
img = "https://s.gravatar.com/avatar/" + img + "?s=28";
img = "https://s.gravatar.com/avatar/" + img + "?s=24";
}
if (!name) {
name = "";
}
this.$el = el;
this.$el = $("#userBar");
this.$el.html(this.template.render({
img : img,
name : name,
username : username,
active : active,
notifications : this.collection
active : active
}));
this.renderNotifications();
this.delegateEvents();
this.renderNotifications();
return this.$el;
},

View File

@ -34,8 +34,8 @@
renderTable: function () {
this.collection.forEach(function(user) {
var deleteButton =
'<span class="arangoicon icon_arangodb_roundminus" data-original-title="Delete user"></span>';
var deleteButton = '<span class="arangoicon icon_arangodb_roundminus"' +
'data-original-title="Delete user"></span>';
if(user.get("loggedIn")) {
deleteButton = '';
}
@ -198,7 +198,9 @@
return false;
}
if (!username.match(/^[a-zA-Z][a-zA-Z0-9_\-]*$/)) {
arangoHelper.arangoError("Wrong Username", "Username may only contain numbers, letters, _ and -");
arangoHelper.arangoError(
"Wrong Username", "Username may only contain numbers, letters, _ and -"
);
return false;
}
return true;
@ -213,7 +215,9 @@
return true;
}
if (!name.match(/^[a-zA-Z][a-zA-Z0-9_\-\ ]*$/)) {
arangoHelper.arangoError("Wrong Username", "Username may only contain numbers, letters, _ and -");
arangoHelper.arangoError(
"Wrong Username", "Username may only contain numbers, letters, _ and -"
);
return false;
}
return true;

View File

@ -17,7 +17,6 @@
initialize: function() {
this.collection.fetch({async:false});
this.user = this.collection.findWhere({loggedIn: true});
},
render: function(){
@ -34,25 +33,23 @@
this.collection.fetch();
$('#editUsername').html(this.user.get("user"));
$('#editName').val(this.user.get("extra").name);
$('#editImg').val(this.user.get("extra").img);
$('#editUserProfileImg').val(this.user.get("extra").img);
this.showModal();
},
submitEditUserProfile : function() {
var self = this;
var userName = this.user.get("user");
var name = $('#editName').val();
var img = $('#editImg').val();
var active = this.user.get("active");
var img = $('#editUserProfileImg').val();
img = this.parseImgString(img);
/* if (!this.validateName(name)) {
$('#editName').closest("th").css("backgroundColor", "red");
return;
}*/
this.user.set({"extra": {"name":name, "img":img}, "active":active});
this.user.save();
this.user.save({"extra": {"name":name, "img":img}});
this.hideModal();
this.updateUserProfile();
},

View File

@ -8,8 +8,8 @@ nav.navbar {
div.navlogo {
@extend %pull-left;
margin-left: 5px;
margin-right: 5px;
margin-right: 1px;
padding-top: 3px;
}
div.navmenu {
@ -39,6 +39,9 @@ a.tab {
bottom: 10px;
right: 10px;
}
&.userImg {
padding-bottom: 4px;
}
color: $c_white;
display: block;
}

View File

@ -1,5 +1,5 @@
.fixedDropdown {
margin: 34px 0 0 0 !important;
margin: 37px 0 0 0 !important;
border-radius: 0 !important;
width: 210px;
}
@ -72,9 +72,9 @@
}
#stat_hd {
width: 22px;
height: 22px;
margin-top: 5px;
width: 24px;
height: 24px;
margin-top: 2px;
background-color: #333232;
border-radius: 3px;
border: 2px solid #8AA051;
@ -95,6 +95,6 @@
#stat_hd #stat_hd_counter {
color: white;
margin-left: 7px;
line-height: 23px;
margin-left: 8px;
line-height: 24px;
}

View File

@ -17,14 +17,14 @@ div.resizecontainer {
@media (min-width: 799px) and (max-width: 1041px) {
#arangoCollectionUl a {
font-size: 11px;
padding: 7px 5px 10px;
font-size: 12px;
padding: 10px 5px 10px;
}
}
@media (min-width: 1042px) and (max-width: 1284px) {
#arangoCollectionUl a {
font-size: 13px;
font-size: 14px;
}
}

View File

@ -1,5 +1,8 @@
.userMenuImg {
height : "28";
width : "28";
height : "26";
width : "26";
background-color: #333232;
border-radius: 3px;
border: 2px solid #8AA051;
margin-top: -3px;
}

View File

@ -110,11 +110,11 @@ div.resizecontainer {
display: inline-block; } }
@media (min-width: 799px) and (max-width: 1041px) {
#arangoCollectionUl a {
font-size: 11px;
padding: 7px 5px 10px; } }
font-size: 12px;
padding: 10px 5px 10px; } }
@media (min-width: 1042px) and (max-width: 1284px) {
#arangoCollectionUl a {
font-size: 13px; } }
font-size: 14px; } }
@media (min-width: 6px) and (max-width: 247px) {
div.resizecontainer {
width: 0px; } }
@ -193,8 +193,8 @@ nav.navbar {
div.navlogo {
margin-left: 5px;
margin-right: 5px;
margin-right: 1px; }
margin-right: 1px;
padding-top: 3px; }
ul.navlist {
list-style: none; }
@ -214,6 +214,8 @@ a.tab {
padding-right: 10px;
color: white;
display: block; }
a.tab.userImg {
padding-bottom: 4px; }
#arangoCollectionSelect {
display: none;
@ -376,9 +378,9 @@ li.tile {
cursor: pointer; }
#stat_hd {
width: 22px;
height: 22px;
margin-top: 5px;
width: 24px;
height: 24px;
margin-top: 2px;
background-color: #333232;
border-radius: 3px;
border: 2px solid #8AA051; }
@ -395,8 +397,8 @@ li.tile {
#stat_hd #stat_hd_counter {
color: white;
margin-left: 7px;
line-height: 23px; }
margin-left: 8px;
line-height: 24px; }
.contentButtons {
clear: both;
@ -494,6 +496,9 @@ select.filterSelect {
margin-left: 10px !important; }
.userMenuImg {
height: "28";
width: "28";
height: "26";
width: "26";
background-color: #333232;
border-radius: 3px;
border: 2px solid #8AA051;
margin-top: -3px; }

View File

@ -79,6 +79,7 @@
"frontend/js/lib/handlebars-1.0.rc.1.js",
"frontend/js/lib/underscore.js",
"frontend/js/lib/backbone.js",
"frontend/js/lib/jsoneditor-min.js",
"frontend/js/lib/d3.v3.min.js",
"frontend/js/lib/nv.d3.js",
"frontend/js/lib/d3.fisheye.js",
@ -122,7 +123,6 @@
"frontend/css/collectionView.css",
"frontend/css/documentsView.css",
"frontend/css/documentView.css",
"frontend/css/documentSourceView.css",
"frontend/css/swaggerView.css",
"frontend/css/foxxView.css",
"frontend/css/graphView.css",
@ -139,6 +139,7 @@
"frontend/css/buttons.css",
"frontend/css/dropdowns.css",
"frontend/css/screenSizes.css",
"frontend/css/jsoneditor.css",
"frontend/ttf/arangofont/style.css"
]
}

View File

@ -155,7 +155,6 @@ module.exports = function(karma) {
'frontend/js/views/collectionsItemView.js',
'frontend/js/views/documentsView.js',
'frontend/js/views/documentView.js',
'frontend/js/views/documentSourceView.js',
'frontend/js/views/logsView.js',
'frontend/js/views/applicationsView.js',
'frontend/js/views/foxxActiveView.js',

View File

@ -43,6 +43,8 @@ var internal = require("internal");
////////////////////////////////////////////////////////////////////////////////
exports.historian = function (param) {
"use strict";
try {
var result = {};