From 690104553514f257f9e789dbd961edc4c5581b42 Mon Sep 17 00:00:00 2001 From: Heiko Kernbach Date: Thu, 20 Feb 2014 23:02:15 +0100 Subject: [PATCH 01/25] new edit view for documents --- .../frontend/css/documentSourceView.css | 36 - .../aardvark/frontend/css/documentView.css | 30 + .../aardvark/frontend/css/jsoneditor.css | 625 ++++++++++++++++++ .../frontend/img/jsoneditor-icons.png | Bin 0 -> 14438 bytes .../frontend/js/lib/jsoneditor-min.js | 34 + .../aardvark/frontend/js/routers/router.js | 18 +- .../js/templates/documentSourceView.ejs | 25 - .../frontend/js/templates/documentView.ejs | 25 +- .../frontend/js/views/documentSourceView.js | 119 ---- .../frontend/js/views/documentView.js | 540 ++------------- js/apps/system/aardvark/manifest.json | 2 + 11 files changed, 738 insertions(+), 716 deletions(-) delete mode 100644 js/apps/system/aardvark/frontend/css/documentSourceView.css create mode 100644 js/apps/system/aardvark/frontend/css/jsoneditor.css create mode 100644 js/apps/system/aardvark/frontend/img/jsoneditor-icons.png create mode 100644 js/apps/system/aardvark/frontend/js/lib/jsoneditor-min.js delete mode 100644 js/apps/system/aardvark/frontend/js/templates/documentSourceView.ejs delete mode 100644 js/apps/system/aardvark/frontend/js/views/documentSourceView.js diff --git a/js/apps/system/aardvark/frontend/css/documentSourceView.css b/js/apps/system/aardvark/frontend/css/documentSourceView.css deleted file mode 100644 index ac2accdc4c..0000000000 --- a/js/apps/system/aardvark/frontend/css/documentSourceView.css +++ /dev/null @@ -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 { -} diff --git a/js/apps/system/aardvark/frontend/css/documentView.css b/js/apps/system/aardvark/frontend/css/documentView.css index e2d26d21ed..789f81069d 100644 --- a/js/apps/system/aardvark/frontend/css/documentView.css +++ b/js/apps/system/aardvark/frontend/css/documentView.css @@ -262,3 +262,33 @@ table.dataTable thead th { #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; +} diff --git a/js/apps/system/aardvark/frontend/css/jsoneditor.css b/js/apps/system/aardvark/frontend/css/jsoneditor.css new file mode 100644 index 0000000000..d17c6950b7 --- /dev/null +++ b/js/apps/system/aardvark/frontend/css/jsoneditor.css @@ -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; +} + diff --git a/js/apps/system/aardvark/frontend/img/jsoneditor-icons.png b/js/apps/system/aardvark/frontend/img/jsoneditor-icons.png new file mode 100644 index 0000000000000000000000000000000000000000..7120088f9475d17ba3bd5f716bdf8bf4eeb1f32a GIT binary patch literal 14438 zcmajm1yodFxG($xq@+XXl5UXh25AHYq`SL22M_@%=@OCdF6jp8?(UQr8ooWA^PO1h z-gW=K1)CWdW)HLW`#x_Fp`s*%_L}fD2n0ft{UE6d9Or?LLQDkU^JM&^18{g{A*Lt> z0#(JJJQ~3Rw_#jVWyC?{qr?Zm4RVtYs)`_xHw_3B2nK=ffx80tK_E9a5a`el1maHt zf$$tNnm-Bx-#{>ymyraHK<*@30)PXu-E;9|#YivRbg{RwfxrOrXCGkuU;uiW~{(#8hp*MuuKc(Oy3eMTF(dpRHYU`mjC~$ds(>ROA_U6jfeU}%Ms&L=o@a?4ko5VUh<_m6jOdA|Kh9C}NJjE?7~99bQmiiRR^{7b!XY!PUXyB1Ac0 zt{fd542mKXaV>O2euMjVwW<3Or`o13Y(GIr8(_Kl>Z2!@WX zu$((wzDS)R4g`8Uad>`qlQ@aMNlmS*+jW8KynXQTk*5Mlgx}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ClBSlXeBOJdaN{I^#>;cxUM}2$ zD1R(wb>#88meGuZeHT`S{~Wh^r|Rb?*VKIW-=@F7_4*neT{(xsinMcm(ok;D}ob^ut!dyeYvF+sBrXc_g7@LfG!snBqv*k0;I%)&l&oWQBp?JJ_+Qx z%bk4JYx$K6B`8Gnkilic37EF78pflTcB=Cg8}|GXej5z?uPj#G6URl4!yGi1t!UpC zO6~x540w4JV}FV$2J0cg7(!PTKo>|}V8NdT?fEp_x4vRL!S=6K_NQg*wE&(MrbbDR z=|DMj*F8dJpY;8U-ug%{*+$H{%zKWe&&y2q8lr)f*TgBC3;|HjN~V#Htq{26_lBvVyqHe3*^{|oP6XDjz+?&0W(gCn#RdBf~?RPx<} zyfqb9d>V&E2SG+BpTLrH@Xo7YVndxkQnq5SVmM2Q)W*M1HTBf`i5E2kr;0H9xAjxz#lUDgX8%4mgEuLzrXO~BmFaOz|e4H&2A~* zQJWv-e@^$M-#=f0ghVmaHAB$m1EX7?G8SCS$5NRSLMMUwNC7wFhfn5E1aB{FkH!dq zVd^S)Ui{|l4-XwT9k)XEX#G^ED}~+wOQ4n2?>7#;I(z~(0v`2b&{4p9+HhF-*Liu@ zqdbJt-Ijri`%r2H*nT(whqbpYKXguTZeIxx{sH4{NO?}Ik|I!ZXEh2tZUjyOBrByPSuSoE{Qm)- CdkcvG literal 0 HcmV?d00001 diff --git a/js/apps/system/aardvark/frontend/js/lib/jsoneditor-min.js b/js/apps/system/aardvark/frontend/js/lib/jsoneditor-min.js new file mode 100644 index 0000000000..b20da71614 --- /dev/null +++ b/js/apps/system/aardvark/frontend/js/lib/jsoneditor-min.js @@ -0,0 +1,34 @@ +/*! + * jsoneditor.js + * + * @brief + * JSONEditor is a web-based tool to view, edit, and format JSON. + * It shows data a clear, editable treeview. + * + * Supported browsers: Chrome, Firefox, Safari, Opera, Internet Explorer 8+ + * + * @license + * This json editor is open sourced with the intention to use the editor as + * a component in your own application. Not to just copy and monetize the editor + * as it is. + * + * 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. + * + * Copyright (c) 2011-2013 Jos de Jong, http://jsoneditoronline.org + * + * @author Jos de Jong, + * @version 2.3.6 + * @date 2014-01-03 + */ +!function(){function e(t,i,o){if(!(this instanceof e))throw new Error('JSONEditor constructor called without "new".');var n=util.getInternetExplorerVersion();if(-1!=n&&9>n)throw new Error("Unsupported browser, IE9 or newer required. Please install the newest version of your browser.");arguments.length&&this._create(t,i,o)}function t(e,i,o){if(!(this instanceof t))throw new Error('TreeEditor constructor called without "new".');this._create(e,i,o)}function i(e,t,o){if(!(this instanceof i))throw new Error('TextEditor constructor called without "new".');this._create(e,t,o)}function o(e,t){this.editor=e,this.dom={},this.expanded=!1,t&&t instanceof Object?(this.setField(t.field,t.fieldEditable),this.setValue(t.value,t.type)):(this.setField(""),this.setValue(null))}function n(e){this.editor=e,this.dom={}}function s(e,t){function i(e,t,n){n.forEach(function(n){if("separator"==n.type){var s=document.createElement("div");s.className="separator",a=document.createElement("li"),a.appendChild(s),e.appendChild(a)}else{var r={},a=document.createElement("li");e.appendChild(a);var l=document.createElement("button");if(l.className=n.className,r.button=l,n.title&&(l.title=n.title),n.click&&(l.onclick=function(){o.hide(),n.click()}),a.appendChild(l),n.submenu){var d=document.createElement("div");d.className="icon",l.appendChild(d),l.appendChild(document.createTextNode(n.text));var h;if(n.click){l.className+=" default";var c=document.createElement("button");r.buttonExpand=c,c.className="expand",c.innerHTML='
',a.appendChild(c),n.submenuTitle&&(c.title=n.submenuTitle),h=c}else{var u=document.createElement("div");u.className="expand",l.appendChild(u),h=l}h.onclick=function(){o._onExpandItem(r),h.focus()};var p=[];r.subItems=p;var m=document.createElement("ul");r.ul=m,m.className="menu",m.style.height="0",a.appendChild(m),i(m,p,n.submenu)}else l.innerHTML='
'+n.text;t.push(r)}})}this.dom={};var o=this,n=this.dom;this.anchor=void 0,this.items=e,this.eventListeners={},this.selection=void 0,this.visibleSubmenu=void 0,this.onClose=t?t.close:void 0;var s=document.createElement("div");s.className="jsoneditor-contextmenu",n.menu=s;var r=document.createElement("ul");r.className="menu",s.appendChild(r),n.list=r,n.items=[];var a=document.createElement("button");n.focusButton=a;var l=document.createElement("li");l.style.overflow="hidden",l.style.height="0",l.appendChild(a),r.appendChild(l),i(r,this.dom.items,e),this.maxHeight=0,e.forEach(function(t){var i=24*(e.length+(t.submenu?t.submenu.length:0));o.maxHeight=Math.max(o.maxHeight,i)})}function r(e){this.editor=e,this.clear(),this.actions={editField:{undo:function(e){e.node.updateField(e.oldValue)},redo:function(e){e.node.updateField(e.newValue)}},editValue:{undo:function(e){e.node.updateValue(e.oldValue)},redo:function(e){e.node.updateValue(e.newValue)}},appendNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.appendChild(e.node)}},insertBeforeNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.insertBefore(e.node,e.beforeNode)}},insertAfterNode:{undo:function(e){e.parent.removeChild(e.node)},redo:function(e){e.parent.insertAfter(e.node,e.afterNode)}},removeNode:{undo:function(e){var t=e.parent,i=t.childs[e.index]||t.append;t.insertBefore(e.node,i)},redo:function(e){e.parent.removeChild(e.node)}},duplicateNode:{undo:function(e){e.parent.removeChild(e.clone)},redo:function(e){e.parent.insertAfter(e.clone,e.node)}},changeType:{undo:function(e){e.node.changeType(e.oldType)},redo:function(e){e.node.changeType(e.newType)}},moveNode:{undo:function(e){e.startParent.moveTo(e.node,e.startIndex)},redo:function(e){e.endParent.moveTo(e.node,e.endIndex)}},sort:{undo:function(e){var t=e.node;t.hideChilds(),t.sort=e.oldSort,t.childs=e.oldChilds,t.showChilds()},redo:function(e){var t=e.node;t.hideChilds(),t.sort=e.newSort,t.childs=e.newChilds,t.showChilds()}}}}function a(e,t,i){function o(t){e.setMode(t);var i=e.dom&&e.dom.modeBox;i&&i.focus()}for(var n={code:{text:"Code",title:"Switch to code highlighter",click:function(){o("code")}},form:{text:"Form",title:"Switch to form editor",click:function(){o("form")}},text:{text:"Text",title:"Switch to plain text editor",click:function(){o("text")}},tree:{text:"Tree",title:"Switch to tree editor",click:function(){o("tree")}},view:{text:"View",title:"Switch to tree view",click:function(){o("view")}}},r=[],a=0;ae&&i.scrollTop>0?(o+r-e)/3:e>s-r&&n+i.scrollTop3?(i.scrollTop+=n/3,o.animateCallback=t,o.animateTimeout=setTimeout(a,50)):(t&&t(!0),i.scrollTop=r,delete o.animateTimeout,delete o.animateCallback)};a()}else t&&t(!1)},t.prototype._createFrame=function(){this.frame=document.createElement("div"),this.frame.className="jsoneditor",this.container.appendChild(this.frame);var e=this,t=function(t){e._onEvent(t)};this.frame.onclick=function(e){var i=e.target;t(e),"BUTTON"==i.nodeName&&e.preventDefault()},this.frame.oninput=t,this.frame.onchange=t,this.frame.onkeydown=t,this.frame.onkeyup=t,this.frame.oncut=t,this.frame.onpaste=t,this.frame.onmousedown=t,this.frame.onmouseup=t,this.frame.onmouseover=t,this.frame.onmouseout=t,util.addEventListener(this.frame,"focus",t,!0),util.addEventListener(this.frame,"blur",t,!0),this.frame.onfocusin=t,this.frame.onfocusout=t,this.menu=document.createElement("div"),this.menu.className="menu",this.frame.appendChild(this.menu);var i=document.createElement("button");i.className="expand-all",i.title="Expand all fields",i.onclick=function(){e.expandAll()},this.menu.appendChild(i);var o=document.createElement("button");if(o.title="Collapse all fields",o.className="collapse-all",o.onclick=function(){e.collapseAll()},this.menu.appendChild(o),this.history){var n=document.createElement("button");n.className="undo separator",n.title="Undo last action (Ctrl+Z)",n.onclick=function(){e._onUndo()},this.menu.appendChild(n),this.dom.undo=n;var s=document.createElement("button");s.className="redo",s.title="Redo (Ctrl+Shift+Z)",s.onclick=function(){e._onRedo()},this.menu.appendChild(s),this.dom.redo=s,this.history.onChange=function(){n.disabled=!e.history.canUndo(),s.disabled=!e.history.canRedo()},this.history.onChange()}if(this.options&&this.options.modes&&this.options.modes.length){var r=a(this,this.options.modes,this.options.mode);this.menu.appendChild(r),this.dom.modeBox=r}this.options.search&&(this.searchBox=new l(this,this.menu))},t.prototype._onUndo=function(){this.history&&(this.history.undo(),this.options.change&&this.options.change())},t.prototype._onRedo=function(){this.history&&(this.history.redo(),this.options.change&&this.options.change())},t.prototype._onEvent=function(e){var i=e.target;"keydown"==e.type&&this._onKeyDown(e),"focus"==e.type&&(t.domFocus=i);var n=o.getNodeFromTarget(i);n&&n.onEvent(e)},t.prototype._onKeyDown=function(e){var i=e.which||e.keyCode,o=e.ctrlKey,n=e.shiftKey,s=!1;if(9==i&&setTimeout(function(){util.selectContentEditable(t.domFocus)},0),this.searchBox)if(o&&70==i)this.searchBox.dom.search.focus(),this.searchBox.dom.search.select(),s=!0;else if(114==i||o&&71==i){var r=!0;n?this.searchBox.previous(r):this.searchBox.next(r),s=!0}this.history&&(o&&!n&&90==i?(this._onUndo(),s=!0):o&&n&&90==i&&(this._onRedo(),s=!0)),s&&(e.preventDefault(),e.stopPropagation())},t.prototype._createTable=function(){var e=document.createElement("div");e.className="outer",this.contentOuter=e,this.content=document.createElement("div"),this.content.className="tree",e.appendChild(this.content),this.table=document.createElement("table"),this.table.className="tree",this.content.appendChild(this.table);var t;this.colgroupContent=document.createElement("colgroup"),this.mode.edit&&(t=document.createElement("col"),t.width="24px",this.colgroupContent.appendChild(t)),t=document.createElement("col"),t.width="24px",this.colgroupContent.appendChild(t),t=document.createElement("col"),this.colgroupContent.appendChild(t),this.table.appendChild(this.colgroupContent),this.tbody=document.createElement("tbody"),this.table.appendChild(this.tbody),this.frame.appendChild(e)},e.modes.tree={editor:t,data:"json"},e.modes.view={editor:t,data:"json"},e.modes.form={editor:t,data:"json"},e.modes.editor={editor:t,data:"json"},e.modes.viewer={editor:t,data:"json"},i.prototype._create=function(e,t,i){t=t||{},this.options=t,this.indentation=t.indentation?Number(t.indentation):2,this.mode="code"==t.mode?"code":"text","code"==this.mode&&"undefined"==typeof ace&&(this.mode="text",util.log("WARNING: Cannot load code editor, Ace library not loaded. Falling back to plain text editor"));var o=this;this.container=e,this.dom={},this.editor=void 0,this.textarea=void 0,this.width=e.clientWidth,this.height=e.clientHeight,this.frame=document.createElement("div"),this.frame.className="jsoneditor",this.frame.onclick=function(e){e.preventDefault()},this.menu=document.createElement("div"),this.menu.className="menu",this.frame.appendChild(this.menu);var n=document.createElement("button");n.className="format",n.title="Format JSON data, with proper indentation and line feeds",this.menu.appendChild(n),n.onclick=function(){try{o.format()}catch(e){o._onError(e)}};var s=document.createElement("button");if(s.className="compact",s.title="Compact JSON data, remove all whitespaces",this.menu.appendChild(s),s.onclick=function(){try{o.compact()}catch(e){o._onError(e)}},this.options&&this.options.modes&&this.options.modes.length){var r=a(this,this.options.modes,this.options.mode);this.menu.appendChild(r),this.dom.modeBox=r}if(this.content=document.createElement("div"),this.content.className="outer",this.frame.appendChild(this.content),this.container.appendChild(this.frame),"code"==this.mode){this.editorDom=document.createElement("div"),this.editorDom.style.height="100%",this.editorDom.style.width="100%",this.content.appendChild(this.editorDom);var l=ace.edit(this.editorDom);l.setTheme("ace/theme/jsoneditor"),l.setShowPrintMargin(!1),l.setFontSize(13),l.getSession().setMode("ace/mode/json"),l.getSession().setUseSoftTabs(!0),l.getSession().setUseWrapMode(!0),this.editor=l;var d=document.createElement("a");d.appendChild(document.createTextNode("powered by ace")),d.href="http://ace.ajax.org",d.target="_blank",d.className="poweredBy",d.onclick=function(){window.open(d.href,d.target)},this.menu.appendChild(d),t.change&&l.on("change",function(){t.change()})}else{var h=document.createElement("textarea");h.className="text",h.spellcheck=!1,this.content.appendChild(h),this.textarea=h,t.change&&(null===this.textarea.oninput?this.textarea.oninput=function(){t.change()}:this.textarea.onchange=function(){t.change()})}"string"==typeof i?this.setText(i):this.set(i)},i.prototype._delete=function(){this.frame&&this.container&&this.frame.parentNode==this.container&&this.container.removeChild(this.frame)},i.prototype._onError=function(e){if("function"==typeof this.onError&&(util.log("WARNING: JSONEditor.onError is deprecated. Use options.error instead."),this.onError(e)),!this.options||"function"!=typeof this.options.error)throw e;this.options.error(e)},i.prototype.compact=function(){var e=util.parse(this.getText());this.setText(JSON.stringify(e))},i.prototype.format=function(){var e=util.parse(this.getText());this.setText(JSON.stringify(e,null,this.indentation))},i.prototype.focus=function(){this.textarea&&this.textarea.focus(),this.editor&&this.editor.focus()},i.prototype.resize=function(){if(this.editor){var e=!1;this.editor.resize(e)}},i.prototype.set=function(e){this.setText(JSON.stringify(e,null,this.indentation))},i.prototype.get=function(){return util.parse(this.getText())},i.prototype.getText=function(){return this.textarea?this.textarea.value:this.editor?this.editor.getValue():""},i.prototype.setText=function(e){this.textarea&&(this.textarea.value=e),this.editor&&this.editor.setValue(e,-1)},e.modes.text={editor:i,data:"text",load:i.prototype.format},e.modes.code={editor:i,data:"text",load:i.prototype.format},o.prototype.setParent=function(e){this.parent=e},o.prototype.setField=function(e,t){this.field=e,this.fieldEditable=1==t},o.prototype.getField=function(){return void 0===this.field&&this._getDomField(),this.field},o.prototype.setValue=function(e,t){var i,n,s=this.childs;if(s)for(;s.length;)this.removeChild(s[0]);if(this.type=this._getType(e),t&&t!=this.type){if("string"!=t||"auto"!=this.type)throw new Error('Type mismatch: cannot cast value of type "'+this.type+' to the specified type "'+t+'"');this.type=t}if("array"==this.type){this.childs=[];for(var r=0,a=e.length;a>r;r++)i=e[r],void 0===i||i instanceof Function||(n=new o(this.editor,{value:i}),this.appendChild(n));this.value=""}else if("object"==this.type){this.childs=[];for(var l in e)e.hasOwnProperty(l)&&(i=e[l],void 0===i||i instanceof Function||(n=new o(this.editor,{field:l,value:i}),this.appendChild(n)));this.value=""}else this.childs=void 0,this.value=e},o.prototype.getValue=function(){if("array"==this.type){var e=[];return this.childs.forEach(function(t){e.push(t.getValue())}),e}if("object"==this.type){var t={};return this.childs.forEach(function(e){t[e.getField()]=e.getValue()}),t}return void 0===this.value&&this._getDomValue(),this.value},o.prototype.getLevel=function(){return this.parent?this.parent.getLevel()+1:0},o.prototype.clone=function(){var e=new o(this.editor);if(e.type=this.type,e.field=this.field,e.fieldInnerText=this.fieldInnerText,e.fieldEditable=this.fieldEditable,e.value=this.value,e.valueInnerText=this.valueInnerText,e.expanded=this.expanded,this.childs){var t=[];this.childs.forEach(function(i){var o=i.clone();o.setParent(e),t.push(o)}),e.childs=t}else e.childs=void 0;return e},o.prototype.expand=function(e){this.childs&&(this.expanded=!0,this.dom.expand&&(this.dom.expand.className="expanded"),this.showChilds(),0!=e&&this.childs.forEach(function(t){t.expand(e)}))},o.prototype.collapse=function(e){this.childs&&(this.hideChilds(),0!=e&&this.childs.forEach(function(t){t.collapse(e)}),this.dom.expand&&(this.dom.expand.className="collapsed"),this.expanded=!1)},o.prototype.showChilds=function(){var e=this.childs;if(e&&this.expanded){var t=this.dom.tr,i=t?t.parentNode:void 0;if(i){var o=this.getAppend(),n=t.nextSibling;n?i.insertBefore(o,n):i.appendChild(o),this.childs.forEach(function(e){i.insertBefore(e.getDom(),o),e.showChilds()})}}},o.prototype.hide=function(){var e=this.dom.tr,t=e?e.parentNode:void 0;t&&t.removeChild(e),this.hideChilds()},o.prototype.hideChilds=function(){var e=this.childs;if(e&&this.expanded){var t=this.getAppend();t.parentNode&&t.parentNode.removeChild(t),this.childs.forEach(function(e){e.hide()})}},o.prototype.appendChild=function(e){if(this._hasChilds()){if(e.setParent(this),e.fieldEditable="object"==this.type,"array"==this.type&&(e.index=this.childs.length),this.childs.push(e),this.expanded){var t=e.getDom(),i=this.getAppend(),o=i?i.parentNode:void 0;i&&o&&o.insertBefore(t,i),e.showChilds()}this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})}},o.prototype.moveBefore=function(e,t){if(this._hasChilds()){var i=this.dom.tr?this.dom.tr.parentNode:void 0;if(i){var o=document.createElement("tr");o.style.height=i.clientHeight+"px",i.appendChild(o)}e.parent&&e.parent.removeChild(e),t instanceof n?this.appendChild(e):this.insertBefore(e,t),i&&i.removeChild(o)}},o.prototype.moveTo=function(e,t){if(e.parent==this){var i=this.childs.indexOf(e);t>i&&t++}var o=this.childs[t]||this.append;this.moveBefore(e,o)},o.prototype.insertBefore=function(e,t){if(this._hasChilds()){if(t==this.append)e.setParent(this),e.fieldEditable="object"==this.type,this.childs.push(e);else{var i=this.childs.indexOf(t);if(-1==i)throw new Error("Node not found");e.setParent(this),e.fieldEditable="object"==this.type,this.childs.splice(i,0,e)}if(this.expanded){var o=e.getDom(),n=t.getDom(),s=n?n.parentNode:void 0;n&&s&&s.insertBefore(o,n),e.showChilds()}this.updateDom({updateIndexes:!0}),e.updateDom({recurse:!0})}},o.prototype.insertAfter=function(e,t){if(this._hasChilds()){var i=this.childs.indexOf(t),o=this.childs[i+1];o?this.insertBefore(e,o):this.appendChild(e)}},o.prototype.search=function(e){var t,i=[],o=e?e.toLowerCase():void 0;if(delete this.searchField,delete this.searchValue,void 0!=this.field){var n=String(this.field).toLowerCase();t=n.indexOf(o),-1!=t&&(this.searchField=!0,i.push({node:this,elem:"field"})),this._updateDomField()}if(this._hasChilds()){if(this.childs){var s=[];this.childs.forEach(function(t){s=s.concat(t.search(e))}),i=i.concat(s)}if(void 0!=o){var r=!1;0==s.length?this.collapse(r):this.expand(r)}}else{if(void 0!=this.value){var a=String(this.value).toLowerCase();t=a.indexOf(o),-1!=t&&(this.searchValue=!0,i.push({node:this,elem:"value"}))}this._updateDomValue()}return i},o.prototype.scrollTo=function(e){if(!this.dom.tr||!this.dom.tr.parentNode)for(var t=this.parent,i=!1;t;)t.expand(i),t=t.parent;this.dom.tr&&this.dom.tr.parentNode&&this.editor.scrollTo(this.dom.tr.offsetTop,e)},o.focusElement=void 0,o.prototype.focus=function(e){if(o.focusElement=e,this.dom.tr&&this.dom.tr.parentNode){var t=this.dom;switch(e){case"drag":t.drag?t.drag.focus():t.menu.focus();break;case"menu":t.menu.focus();break;case"expand":this._hasChilds()?t.expand.focus():t.field&&this.fieldEditable?(t.field.focus(),util.selectContentEditable(t.field)):t.value&&!this._hasChilds()?(t.value.focus(),util.selectContentEditable(t.value)):t.menu.focus();break;case"field":t.field&&this.fieldEditable?(t.field.focus(),util.selectContentEditable(t.field)):t.value&&!this._hasChilds()?(t.value.focus(),util.selectContentEditable(t.value)):this._hasChilds()?t.expand.focus():t.menu.focus();break;case"value":default:t.value&&!this._hasChilds()?(t.value.focus(),util.selectContentEditable(t.value)):t.field&&this.fieldEditable?(t.field.focus(),util.selectContentEditable(t.field)):this._hasChilds()?t.expand.focus():t.menu.focus()}}},o.select=function(e){setTimeout(function(){util.selectContentEditable(e)},0)},o.prototype.blur=function(){this._getDomValue(!1),this._getDomField(!1)},o.prototype._duplicate=function(e){var t=e.clone();return this.insertAfter(t,e),t},o.prototype.containsNode=function(e){if(this==e)return!0;var t=this.childs;if(t)for(var i=0,o=t.length;o>i;i++)if(t[i].containsNode(e))return!0;return!1},o.prototype._move=function(e,t){if(e!=t){if(e.containsNode(this))throw new Error("Cannot move a field into a child of itself");e.parent&&e.parent.removeChild(e);var i=e.clone();e.clearDom(),t?this.insertBefore(i,t):this.appendChild(i)}},o.prototype.removeChild=function(e){if(this.childs){var t=this.childs.indexOf(e);if(-1!=t){e.hide(),delete e.searchField,delete e.searchValue;var i=this.childs.splice(t,1)[0];return this.updateDom({updateIndexes:!0}),i}}return void 0},o.prototype._remove=function(e){this.removeChild(e)},o.prototype.changeType=function(e){var t=this.type;if(t!=e){if("string"!=e&&"auto"!=e||"string"!=t&&"auto"!=t){var i,o=this.dom.tr?this.dom.tr.parentNode:void 0;i=this.expanded?this.getAppend():this.getDom();var n=i&&i.parentNode?i.nextSibling:void 0;this.hide(),this.clearDom(),this.type=e,"object"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e){e.clearDom(),delete e.index,e.fieldEditable=!0,void 0==e.field&&(e.field="")}),("string"==t||"auto"==t)&&(this.expanded=!0)):"array"==e?(this.childs||(this.childs=[]),this.childs.forEach(function(e,t){e.clearDom(),e.fieldEditable=!1,e.index=t}),("string"==t||"auto"==t)&&(this.expanded=!0)):this.expanded=!1,o&&(n?o.insertBefore(this.getDom(),n):o.appendChild(this.getDom())),this.showChilds()}else this.type=e;("auto"==e||"string"==e)&&(this.value="string"==e?String(this.value):this._stringCast(String(this.value)),this.focus()),this.updateDom({updateIndexes:!0})}},o.prototype._getDomValue=function(e){if(this.dom.value&&"array"!=this.type&&"object"!=this.type&&(this.valueInnerText=util.getInnerText(this.dom.value)),void 0!=this.valueInnerText)try{var t;if("string"==this.type)t=this._unescapeHTML(this.valueInnerText);else{var i=this._unescapeHTML(this.valueInnerText);t=this._stringCast(i)}if(t!==this.value){var o=this.value;this.value=t,this.editor._onAction("editValue",{node:this,oldValue:o,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(n){if(this.value=void 0,1!=e)throw n}},o.prototype._updateDomValue=function(){var e=this.dom.value;if(e){var t=this.value,i="auto"==this.type?util.type(t):this.type,o="string"==i&&util.isUrl(t),n="";n=o&&!this.editor.mode.edit?"":"string"==i?"green":"number"==i?"red":"boolean"==i?"darkorange":this._hasChilds()?"":null===t?"#004ED0":"black",e.style.color=n;var s=""==String(this.value)&&"array"!=this.type&&"object"!=this.type;if(s?util.addClassName(e,"empty"):util.removeClassName(e,"empty"),o?util.addClassName(e,"url"):util.removeClassName(e,"url"),"array"==i||"object"==i){var r=this.childs?this.childs.length:0;e.title=this.type+" containing "+r+" items"}else"string"==i&&util.isUrl(t)?this.editor.mode.edit&&(e.title="Ctrl+Click or Ctrl+Enter to open url in new window"):e.title="";this.searchValueActive?util.addClassName(e,"highlight-active"):util.removeClassName(e,"highlight-active"),this.searchValue?util.addClassName(e,"highlight"):util.removeClassName(e,"highlight"),util.stripFormatting(e)}},o.prototype._updateDomField=function(){var e=this.dom.field;if(e){var t=""==String(this.field)&&"array"!=this.parent.type;t?util.addClassName(e,"empty"):util.removeClassName(e,"empty"),this.searchFieldActive?util.addClassName(e,"highlight-active"):util.removeClassName(e,"highlight-active"),this.searchField?util.addClassName(e,"highlight"):util.removeClassName(e,"highlight"),util.stripFormatting(e)}},o.prototype._getDomField=function(e){if(this.dom.field&&this.fieldEditable&&(this.fieldInnerText=util.getInnerText(this.dom.field)),void 0!=this.fieldInnerText)try{var t=this._unescapeHTML(this.fieldInnerText);if(t!==this.field){var i=this.field;this.field=t,this.editor._onAction("editField",{node:this,oldValue:i,newValue:t,oldSelection:this.editor.selection,newSelection:this.editor.getSelection()})}}catch(o){if(this.field=void 0,1!=e)throw o}},o.prototype.clearDom=function(){this.dom={}},o.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;if(e.tr=document.createElement("tr"),e.tr.node=this,this.editor.mode.edit){var t=document.createElement("td");if(this.parent){var i=document.createElement("button");e.drag=i,i.className="dragarea",i.title="Drag to move this field (Alt+Shift+Arrows)",t.appendChild(i)}e.tr.appendChild(t);var o=document.createElement("td"),n=document.createElement("button");e.menu=n,n.className="contextmenu",n.title="Click to open the actions menu (Ctrl+M)",o.appendChild(e.menu),e.tr.appendChild(o)}var s=document.createElement("td");return e.tr.appendChild(s),e.tree=this._createDomTree(),s.appendChild(e.tree),this.updateDom({updateIndexes:!0}),e.tr},o.prototype._onDragStart=function(e){var t=this;this.mousemove||(this.mousemove=util.addEventListener(document,"mousemove",function(e){t._onDrag(e)})),this.mouseup||(this.mouseup=util.addEventListener(document,"mouseup",function(e){t._onDragEnd(e)})),this.editor.highlighter.lock(),this.drag={oldCursor:document.body.style.cursor,startParent:this.parent,startIndex:this.parent.childs.indexOf(this),mouseX:e.pageX,level:this.getLevel()},document.body.style.cursor="move",e.preventDefault()},o.prototype._onDrag=function(e){var t,i,s,r,a,l,d,h,c,u,p,m,f,v,g=e.pageY,y=e.pageX,x=!1;if(t=this.dom.tr,c=util.getAbsoluteTop(t),m=t.offsetHeight,c>g){i=t;do i=i.previousSibling,d=o.getNodeFromTarget(i),u=i?util.getAbsoluteTop(i):0;while(i&&u>g);d&&!d.parent&&(d=void 0),d||(l=t.parentNode.firstChild,i=l?l.nextSibling:void 0,d=o.getNodeFromTarget(i),d==this&&(d=void 0)),d&&(i=d.dom.tr,u=i?util.getAbsoluteTop(i):0,g>u+m&&(d=void 0)),d&&(d.parent.moveBefore(this,d),x=!0)}else if(a=this.expanded&&this.append?this.append.getDom():this.dom.tr,r=a?a.nextSibling:void 0){p=util.getAbsoluteTop(r),s=r;do h=o.getNodeFromTarget(s),s&&(f=s.nextSibling?util.getAbsoluteTop(s.nextSibling):0,v=s?f-p:0,1==h.parent.childs.length&&h.parent.childs[0]==this&&(c+=23)),s=s.nextSibling;while(s&&g>c+v);if(h&&h.parent){var C=y-this.drag.mouseX,b=Math.round(C/24/2),N=this.drag.level+b,E=h.getLevel();for(i=h.dom.tr.previousSibling;N>E&&i;){if(d=o.getNodeFromTarget(i),d==this||d._isChildOf(this));else{if(!(d instanceof n))break;var _=d.parent.childs;if(!(_.length>1||1==_.length&&_[0]!=this))break;h=o.getNodeFromTarget(i),E=h.getLevel()}i=i.previousSibling}a.nextSibling!=h.dom.tr&&(h.parent.moveBefore(this,h),x=!0) +}}x&&(this.drag.mouseX=y,this.drag.level=this.getLevel()),this.editor.startAutoScroll(g),e.preventDefault()},o.prototype._onDragEnd=function(e){var t={node:this,startParent:this.drag.startParent,startIndex:this.drag.startIndex,endParent:this.parent,endIndex:this.parent.childs.indexOf(this)};(t.startParent!=t.endParent||t.startIndex!=t.endIndex)&&this.editor._onAction("moveNode",t),document.body.style.cursor=this.drag.oldCursor,this.editor.highlighter.unlock(),delete this.drag,this.mousemove&&(util.removeEventListener(document,"mousemove",this.mousemove),delete this.mousemove),this.mouseup&&(util.removeEventListener(document,"mouseup",this.mouseup),delete this.mouseup),this.editor.stopAutoScroll(),e.preventDefault()},o.prototype._isChildOf=function(e){for(var t=this.parent;t;){if(t==e)return!0;t=t.parent}return!1},o.prototype._createDomField=function(){return document.createElement("div")},o.prototype.setHighlight=function(e){this.dom.tr&&(this.dom.tr.className=e?"highlight":"",this.append&&this.append.setHighlight(e),this.childs&&this.childs.forEach(function(t){t.setHighlight(e)}))},o.prototype.updateValue=function(e){this.value=e,this.updateDom()},o.prototype.updateField=function(e){this.field=e,this.updateDom()},o.prototype.updateDom=function(e){var t=this.dom.tree;t&&(t.style.marginLeft=24*this.getLevel()+"px");var i=this.dom.field;if(i){1==this.fieldEditable?(i.contentEditable=this.editor.mode.edit,i.spellcheck=!1,i.className="field"):i.className="readonly";var o;o=void 0!=this.index?this.index:void 0!=this.field?this.field:this._hasChilds()?this.type:"",i.innerHTML=this._escapeHTML(o)}var n=this.dom.value;if(n){var s=this.childs?this.childs.length:0;n.innerHTML="array"==this.type?"["+s+"]":"object"==this.type?"{"+s+"}":this._escapeHTML(this.value)}this._updateDomField(),this._updateDomValue(),e&&1==e.updateIndexes&&this._updateDomIndexes(),e&&1==e.recurse&&this.childs&&this.childs.forEach(function(t){t.updateDom(e)}),this.append&&this.append.updateDom()},o.prototype._updateDomIndexes=function(){var e=this.dom.value,t=this.childs;e&&t&&("array"==this.type?t.forEach(function(e,t){e.index=t;var i=e.dom.field;i&&(i.innerHTML=t)}):"object"==this.type&&t.forEach(function(e){void 0!=e.index&&(delete e.index,void 0==e.field&&(e.field=""))}))},o.prototype._createDomValue=function(){var e;return"array"==this.type?(e=document.createElement("div"),e.className="readonly",e.innerHTML="[...]"):"object"==this.type?(e=document.createElement("div"),e.className="readonly",e.innerHTML="{...}"):!this.editor.mode.edit&&util.isUrl(this.value)?(e=document.createElement("a"),e.className="value",e.href=this.value,e.target="_blank",e.innerHTML=this._escapeHTML(this.value)):(e=document.createElement("div"),e.contentEditable=!this.editor.mode.view,e.spellcheck=!1,e.className="value",e.innerHTML=this._escapeHTML(this.value)),e},o.prototype._createDomExpandButton=function(){var e=document.createElement("button");return this._hasChilds()?(e.className=this.expanded?"expanded":"collapsed",e.title="Click to expand/collapse this field (Ctrl+E). \nCtrl+Click to expand/collapse including all childs."):(e.className="invisible",e.title=""),e},o.prototype._createDomTree=function(){var e=this.dom,t=document.createElement("table"),i=document.createElement("tbody");t.style.borderCollapse="collapse",t.className="values",t.appendChild(i);var o=document.createElement("tr");i.appendChild(o);var n=document.createElement("td");n.className="tree",o.appendChild(n),e.expand=this._createDomExpandButton(),n.appendChild(e.expand),e.tdExpand=n;var s=document.createElement("td");s.className="tree",o.appendChild(s),e.field=this._createDomField(),s.appendChild(e.field),e.tdField=s;var r=document.createElement("td");r.className="tree",o.appendChild(r),"object"!=this.type&&"array"!=this.type&&(r.appendChild(document.createTextNode(":")),r.className="separator"),e.tdSeparator=r;var a=document.createElement("td");return a.className="tree",o.appendChild(a),e.value=this._createDomValue(),a.appendChild(e.value),e.tdValue=a,t},o.prototype.onEvent=function(e){var t,i=e.type,o=e.target||e.srcElement,n=this.dom,s=this,r=this._hasChilds();if((o==n.drag||o==n.menu)&&("mouseover"==i?this.editor.highlighter.highlight(this):"mouseout"==i&&this.editor.highlighter.unhighlight()),"mousedown"==i&&o==n.drag&&this._onDragStart(e),"click"==i&&o==n.menu){var a=s.editor.highlighter;a.highlight(s),a.lock(),util.addClassName(n.menu,"selected"),this.showContextMenu(n.menu,function(){util.removeClassName(n.menu,"selected"),a.unlock(),a.unhighlight()})}if("click"==i&&o==n.expand&&r){var l=e.ctrlKey;this._onExpand(l)}var d=n.value;if(o==d)switch(i){case"focus":t=this;break;case"blur":case"change":this._getDomValue(!0),this._updateDomValue(),this.value&&(d.innerHTML=this._escapeHTML(this.value));break;case"input":this._getDomValue(!0),this._updateDomValue();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getSelection();break;case"click":e.ctrlKey&&this.editor.mode.edit&&util.isUrl(this.value)&&window.open(this.value,"_blank");break;case"keyup":this._getDomValue(!0),this._updateDomValue();break;case"cut":case"paste":setTimeout(function(){s._getDomValue(!0),s._updateDomValue()},1)}var h=n.field;if(o==h)switch(i){case"focus":t=this;break;case"blur":case"change":this._getDomField(!0),this._updateDomField(),this.field&&(h.innerHTML=this._escapeHTML(this.field));break;case"input":this._getDomField(!0),this._updateDomField();break;case"keydown":case"mousedown":this.editor.selection=this.editor.getSelection();break;case"keyup":this._getDomField(!0),this._updateDomField();break;case"cut":case"paste":setTimeout(function(){s._getDomField(!0),s._updateDomField()},1)}var c=n.tree;if(o==c.parentNode)switch(i){case"click":var u=void 0!=e.offsetX?e.offsetX<24*(this.getLevel()+1):e.pageXo[i]?t:e[i]/g,">").replace(/ /g,"  ").replace(/^ /," ").replace(/ $/," "),i=JSON.stringify(t);return i.substring(1,i.length-1)},o.prototype._unescapeHTML=function(e){var t='"'+this._escapeJSON(e)+'"',i=util.parse(t);return i.replace(/</g,"<").replace(/>/g,">").replace(/ |\u00A0/g," ")},o.prototype._escapeJSON=function(e){for(var t="",i=0,o=e.length;o>i;){var n=e.charAt(i);"\n"==n?t+="\\n":"\\"==n?(t+=n,i++,n=e.charAt(i),-1=='"\\/bfnrtu'.indexOf(n)&&(t+="\\"),t+=n):t+='"'==n?'\\"':n,i++}return t},n.prototype=new o,n.prototype.getDom=function(){var e=this.dom;if(e.tr)return e.tr;var t=document.createElement("tr");if(t.node=this,e.tr=t,this.editor.mode.edit){e.tdDrag=document.createElement("td");var i=document.createElement("td");e.tdMenu=i;var o=document.createElement("button");o.className="contextmenu",o.title="Click to open the actions menu (Ctrl+M)",e.menu=o,i.appendChild(e.menu)}var n=document.createElement("td"),s=document.createElement("div");return s.innerHTML="(empty)",s.className="readonly",n.appendChild(s),e.td=n,e.text=s,this.updateDom(),t},n.prototype.updateDom=function(){var e=this.dom,t=e.td;t&&(t.style.paddingLeft=24*this.getLevel()+26+"px");var i=e.text;i&&(i.innerHTML="(empty "+this.parent.type+")");var o=e.tr;this.isVisible()?e.tr.firstChild||(e.tdDrag&&o.appendChild(e.tdDrag),e.tdMenu&&o.appendChild(e.tdMenu),o.appendChild(t)):e.tr.firstChild&&(e.tdDrag&&o.removeChild(e.tdDrag),e.tdMenu&&o.removeChild(e.tdMenu),o.removeChild(t))},n.prototype.isVisible=function(){return 0==this.parent.childs.length},n.prototype.showContextMenu=function(e,t){var i=this,n=o.TYPE_TITLES,r=[{text:"Append",title:"Append a new field with type 'auto' (Ctrl+Shift+Ins)",submenuTitle:"Select the type of the field to be appended",className:"insert",click:function(){i._onAppend("","","auto")},submenu:[{text:"Auto",className:"type-auto",title:n.auto,click:function(){i._onAppend("","","auto")}},{text:"Array",className:"type-array",title:n.array,click:function(){i._onAppend("",[])}},{text:"Object",className:"type-object",title:n.object,click:function(){i._onAppend("",{})}},{text:"String",className:"type-string",title:n.string,click:function(){i._onAppend("","","string")}}]}],a=new s(r,{close:t});a.show(e)},n.prototype.onEvent=function(e){var t=e.type,i=e.target||e.srcElement,o=this.dom,n=o.menu;if(i==n&&("mouseover"==t?this.editor.highlighter.highlight(this.parent):"mouseout"==t&&this.editor.highlighter.unhighlight()),"click"==t&&i==o.menu){var s=this.editor.highlighter;s.highlight(this.parent),s.lock(),util.addClassName(o.menu,"selected"),this.showContextMenu(o.menu,function(){util.removeClassName(o.menu,"selected"),s.unlock(),s.unhighlight()})}"keydown"==t&&this.onKeyDown(e)},s.prototype._getVisibleButtons=function(){var e=[],t=this;return this.dom.items.forEach(function(i){e.push(i.button),i.buttonExpand&&e.push(i.buttonExpand),i.subItems&&i==t.expandedItem&&i.subItems.forEach(function(t){e.push(t.button),t.buttonExpand&&e.push(t.buttonExpand)})}),e},s.visibleMenu=void 0,s.prototype.show=function(e){this.hide();var t=window.innerHeight,i=window.pageYOffset||document.scrollTop||0,o=t+i,n=e.offsetHeight,r=this.maxHeight,a=util.getAbsoluteLeft(e),l=util.getAbsoluteTop(e);o>l+n+r?(this.dom.menu.style.left=a+"px",this.dom.menu.style.top=l+n+"px",this.dom.menu.style.bottom=""):(this.dom.menu.style.left=a+"px",this.dom.menu.style.top="",this.dom.menu.style.bottom=t-l+"px"),document.body.appendChild(this.dom.menu);var d=this,h=this.dom.list;this.eventListeners.mousedown=util.addEventListener(document,"mousedown",function(e){var t=e.target;t==h||d._isChildOf(t,h)||(d.hide(),e.stopPropagation(),e.preventDefault())}),this.eventListeners.mousewheel=util.addEventListener(document,"mousewheel",function(e){e.stopPropagation(),e.preventDefault()}),this.eventListeners.keydown=util.addEventListener(document,"keydown",function(e){d._onKeyDown(e)}),this.selection=util.getSelection(),this.anchor=e,setTimeout(function(){d.dom.focusButton.focus()},0),s.visibleMenu&&s.visibleMenu.hide(),s.visibleMenu=this},s.prototype.hide=function(){this.dom.menu.parentNode&&(this.dom.menu.parentNode.removeChild(this.dom.menu),this.onClose&&this.onClose());for(var e in this.eventListeners)if(this.eventListeners.hasOwnProperty(e)){var t=this.eventListeners[e];t&&util.removeEventListener(document,e,t),delete this.eventListeners[e]}s.visibleMenu==this&&(s.visibleMenu=void 0)},s.prototype._onExpandItem=function(e){var t=this,i=e==this.expandedItem,o=this.expandedItem;if(o&&(o.ul.style.height="0",o.ul.style.padding="",setTimeout(function(){t.expandedItem!=o&&(o.ul.style.display="",util.removeClassName(o.ul.parentNode,"selected"))},300),this.expandedItem=void 0),!i){var n=e.ul;n.style.display="block";{n.clientHeight}setTimeout(function(){t.expandedItem==e&&(n.style.height=24*n.childNodes.length+"px",n.style.padding="5px 10px")},0),util.addClassName(n.parentNode,"selected"),this.expandedItem=e}},s.prototype._onKeyDown=function(e){var t,i,o,n,s=e.target,r=e.which,a=!1;27==r?(this.selection&&util.setSelection(this.selection),this.anchor&&this.anchor.focus(),this.hide(),a=!0):9==r?e.shiftKey?(t=this._getVisibleButtons(),i=t.indexOf(s),0==i&&(t[t.length-1].focus(),a=!0)):(t=this._getVisibleButtons(),i=t.indexOf(s),i==t.length-1&&(t[0].focus(),a=!0)):37==r?("expand"==s.className&&(t=this._getVisibleButtons(),i=t.indexOf(s),o=t[i-1],o&&o.focus()),a=!0):38==r?(t=this._getVisibleButtons(),i=t.indexOf(s),o=t[i-1],o&&"expand"==o.className&&(o=t[i-2]),o||(o=t[t.length-1]),o&&o.focus(),a=!0):39==r?(t=this._getVisibleButtons(),i=t.indexOf(s),n=t[i+1],n&&"expand"==n.className&&n.focus(),a=!0):40==r&&(t=this._getVisibleButtons(),i=t.indexOf(s),n=t[i+1],n&&"expand"==n.className&&(n=t[i+2]),n||(n=t[0]),n&&(n.focus(),a=!0),a=!0),a&&(e.stopPropagation(),e.preventDefault())},s.prototype._isChildOf=function(e,t){for(var i=e.parentNode;i;){if(i==t)return!0;i=i.parentNode}return!1},r.prototype.onChange=function(){},r.prototype.add=function(e,t){this.index++,this.history[this.index]={action:e,params:t,timestamp:new Date},this.index=0},r.prototype.canRedo=function(){return this.indexthis.results.length-1&&(t=0),this._setActiveResult(t,e)}},l.prototype.previous=function(e){if(void 0!=this.results){var t=this.results.length-1,i=void 0!=this.resultIndex?this.resultIndex-1:t;0>i&&(i=t),this._setActiveResult(i,e)}},l.prototype._setActiveResult=function(e,t){if(this.activeResult){var i=this.activeResult.node,o=this.activeResult.elem;"field"==o?delete i.searchFieldActive:delete i.searchValueActive,i.updateDom()}if(!this.results||!this.results[e])return this.resultIndex=void 0,this.activeResult=void 0,void 0;this.resultIndex=e;var n=this.results[this.resultIndex].node,s=this.results[this.resultIndex].elem;"field"==s?n.searchFieldActive=!0:n.searchValueActive=!0,this.activeResult=this.results[this.resultIndex],n.updateDom(),n.scrollTo(function(){t&&n.focus(s)})},l.prototype._clearDelay=function(){void 0!=this.timeout&&(clearTimeout(this.timeout),delete this.timeout)},l.prototype._onDelayedSearch=function(){this._clearDelay();var e=this;this.timeout=setTimeout(function(t){e._onSearch(t)},this.delay)},l.prototype._onSearch=function(e,t){this._clearDelay();var i=this.dom.search.value,o=i.length>0?i:void 0;if(o!=this.lastText||t)if(this.lastText=o,this.results=this.editor.search(o),this._setActiveResult(void 0),void 0!=o){var n=this.results.length;switch(n){case 0:this.dom.results.innerHTML="no results";break;case 1:this.dom.results.innerHTML="1 result";break;default:this.dom.results.innerHTML=n+" results"}}else this.dom.results.innerHTML=""},l.prototype._onKeyDown=function(e){var t=e.which;27==t?(this.dom.search.value="",this._onSearch(e),e.preventDefault(),e.stopPropagation()):13==t&&(e.ctrlKey?this._onSearch(e,!0):e.shiftKey?this.previous():this.next(),e.preventDefault(),e.stopPropagation())},l.prototype._onKeyUp=function(e){var t=e.keyCode;27!=t&&13!=t&&this._onDelayedSearch(e)},d.prototype.highlight=function(e){this.locked||(this.node!=e&&(this.node&&this.node.setHighlight(!1),this.node=e,this.node.setHighlight(!0)),this._cancelUnhighlight())},d.prototype.unhighlight=function(){if(!this.locked){var e=this;this.node&&(this._cancelUnhighlight(),this.unhighlightTimer=setTimeout(function(){e.node.setHighlight(!1),e.node=void 0,e.unhighlightTimer=void 0},0))}},d.prototype._cancelUnhighlight=function(){this.unhighlightTimer&&(clearTimeout(this.unhighlightTimer),this.unhighlightTimer=void 0)},d.prototype.lock=function(){this.locked=!0},d.prototype.unlock=function(){this.locked=!1},util={},util.parse=function(e){try{return JSON.parse(e)}catch(t){throw util.validate(e),t}},util.validate=function(e){"undefined"!=typeof jsonlint?jsonlint.parse(e):JSON.parse(e)},util.extend=function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i]);return e},util.clear=function(e){for(var t in e)e.hasOwnProperty(t)&&delete e[t];return e},util.log=function(){"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)},util.type=function(e){return null===e?"null":void 0===e?"undefined":e instanceof Number||"number"==typeof e?"number":e instanceof String||"string"==typeof e?"string":e instanceof Boolean||"boolean"==typeof e?"boolean":e instanceof RegExp||"regexp"==typeof e?"regexp":Array.isArray(e)?"array":"object"};var h=/^https?:\/\/\S+$/;util.isUrl=function(e){return("string"==typeof e||e instanceof String)&&h.test(e)},util.getAbsoluteLeft=function(e){var t=e.getBoundingClientRect();return t.left+window.pageXOffset||document.scrollLeft||0},util.getAbsoluteTop=function(e){var t=e.getBoundingClientRect();return t.top+window.pageYOffset||document.scrollTop||0},util.addClassName=function(e,t){var i=e.className.split(" ");-1==i.indexOf(t)&&(i.push(t),e.className=i.join(" "))},util.removeClassName=function(e,t){var i=e.className.split(" "),o=i.indexOf(t);-1!=o&&(i.splice(o,1),e.className=i.join(" "))},util.stripFormatting=function(e){for(var t=e.childNodes,i=0,o=t.length;o>i;i++){var n=t[i];n.style&&n.removeAttribute("style");var s=n.attributes;if(s)for(var r=s.length-1;r>=0;r--){var a=s[r];1==a.specified&&n.removeAttribute(a.name)}util.stripFormatting(n)}},util.setEndOfContentEditable=function(e){var t,i;document.createRange&&(t=document.createRange(),t.selectNodeContents(e),t.collapse(!1),i=window.getSelection(),i.removeAllRanges(),i.addRange(t))},util.selectContentEditable=function(e){if(e&&"DIV"==e.nodeName){var t,i;window.getSelection&&document.createRange&&(i=document.createRange(),i.selectNodeContents(e),t=window.getSelection(),t.removeAllRanges(),t.addRange(i))}},util.getSelection=function(){if(window.getSelection){var e=window.getSelection();if(e.getRangeAt&&e.rangeCount)return e.getRangeAt(0)}return null},util.setSelection=function(e){if(e&&window.getSelection){var t=window.getSelection();t.removeAllRanges(),t.addRange(e)}},util.getSelectionOffset=function(){var e=util.getSelection();return e&&"startOffset"in e&&"endOffset"in e&&e.startContainer&&e.startContainer==e.endContainer?{startOffset:e.startOffset,endOffset:e.endOffset,container:e.startContainer.parentNode}:null},util.setSelectionOffset=function(e){if(document.createRange&&window.getSelection){var t=window.getSelection();if(t){var i=document.createRange();i.setStart(e.container.firstChild,e.startOffset),i.setEnd(e.container.firstChild,e.endOffset),util.setSelection(i)}}},util.getInnerText=function(e,t){var i=void 0==t;if(i&&(t={text:"",flush:function(){var e=this.text;return this.text="",e},set:function(e){this.text=e}}),e.nodeValue)return t.flush()+e.nodeValue;if(e.hasChildNodes()){for(var o=e.childNodes,n="",s=0,r=o.length;r>s;s++){var a=o[s];if("DIV"==a.nodeName||"P"==a.nodeName){var l=o[s-1],d=l?l.nodeName:void 0;d&&"DIV"!=d&&"P"!=d&&"BR"!=d&&(n+="\n",t.flush()),n+=util.getInnerText(a,t),t.set("\n")}else"BR"==a.nodeName?(n+=t.flush(),t.set("\n")):n+=util.getInnerText(a,t)}return n}return"P"==e.nodeName&&-1!=util.getInternetExplorerVersion()?t.flush():""},util.getInternetExplorerVersion=function(){if(-1==c){var e=-1;if("Microsoft Internet Explorer"==navigator.appName){var t=navigator.userAgent,i=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");null!=i.exec(t)&&(e=parseFloat(RegExp.$1))}c=e}return c},util.isFirefox=function(){return-1!=navigator.userAgent.indexOf("Firefox")};var c=-1;util.addEventListener=function(e,t,i,o){if(e.addEventListener)return void 0===o&&(o=!1),"mousewheel"===t&&util.isFirefox()&&(t="DOMMouseScroll"),e.addEventListener(t,i,o),i;if(e.attachEvent){var n=function(){return i.call(e,window.event)};return e.attachEvent("on"+t,n),n}},util.removeEventListener=function(e,t,i,o){e.removeEventListener?(void 0===o&&(o=!1),"mousewheel"===t&&util.isFirefox()&&(t="DOMMouseScroll"),e.removeEventListener(t,i,o)):e.detachEvent&&e.detachEvent("on"+t,i)};var u={JSONEditor:e,JSONFormatter:function(){throw new Error('JSONFormatter is deprecated. Use JSONEditor with mode "text" or "code" instead')},util:util},p=function(){for(var e=document.getElementsByTagName("script"),t=0;t -
-
- -
- -
- - -
- -
-
- -
- -
- -
- diff --git a/js/apps/system/aardvark/frontend/js/templates/documentView.ejs b/js/apps/system/aardvark/frontend/js/templates/documentView.ejs index fddadb430f..c5bb22531e 100644 --- a/js/apps/system/aardvark/frontend/js/templates/documentView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/documentView.ejs @@ -6,29 +6,8 @@
- - - - - - - - - - - - - - -
Attribute Valuetype  - -
- +
+
diff --git a/js/apps/system/aardvark/frontend/js/views/documentSourceView.js b/js/apps/system/aardvark/frontend/js/views/documentSourceView.js deleted file mode 100644 index 1385967624..0000000000 --- a/js/apps/system/aardvark/frontend/js/views/documentSourceView.js +++ /dev/null @@ -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( - '' - ); - }, - 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(); - } - }); -}()); diff --git a/js/apps/system/aardvark/frontend/js/views/documentView.js b/js/apps/system/aardvark/frontend/js/views/documentView.js index 1ba9b00c6b..1732b3b616 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentView.js @@ -9,222 +9,80 @@ 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] === '
') { - 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); + if (result === true) { + console.log(123); + } }, breadcrumb: function () { @@ -262,324 +120,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 = ''; - html = '' + self.escaped(value) + - ''; - } - 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, - '', - self.value2html(value), - JSON.stringify(value, null, 4), - '', - '' - ]); - } - }); - 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, - '', - this.value2html("editme"), - JSON.stringify("editme"), - '', - '' - ] - ); - 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 ("" + value + ""); - case 'string': - return ("" + self.escaped(value) + ""); - case 'boolean': - return ("" + value + ""); - case 'object': - if (value instanceof Array) { - return ("" + self.escaped(JSON.stringify(value)) + ""); - } - return (""+ self.escaped(JSON.stringify(value)) + ""); - } - }; - return (isReadOnly ? '' : '') + typify(value) + ''; - }, - escaped: function (value) { return value.replace(/&/g, "&").replace(//g, ">") .replace(/"/g, """).replace(/'/g, "'"); - }, - - 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; } - }); }()); diff --git a/js/apps/system/aardvark/manifest.json b/js/apps/system/aardvark/manifest.json index 4533a1fee9..b72def58be 100644 --- a/js/apps/system/aardvark/manifest.json +++ b/js/apps/system/aardvark/manifest.json @@ -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", @@ -139,6 +140,7 @@ "frontend/css/buttons.css", "frontend/css/dropdowns.css", "frontend/css/screenSizes.css", + "frontend/css/jsoneditor.css", "frontend/ttf/arangofont/style.css" ] } From a189b8136d6d6d896069c627f71e7b61f2faa11d Mon Sep 17 00:00:00 2001 From: Heiko Kernbach Date: Thu, 20 Feb 2014 23:07:15 +0100 Subject: [PATCH 02/25] cleanup --- .../aardvark/frontend/css/documentView.css | 149 +----------------- 1 file changed, 4 insertions(+), 145 deletions(-) diff --git a/js/apps/system/aardvark/frontend/css/documentView.css b/js/apps/system/aardvark/frontend/css/documentView.css index 789f81069d..6276420c76 100644 --- a/js/apps/system/aardvark/frontend/css/documentView.css +++ b/js/apps/system/aardvark/frontend/css/documentView.css @@ -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,6 @@ 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; } @@ -292,3 +147,7 @@ table.dataTable thead th { background-color: white !important; border: 1px solid black !important; } + +#saveDocumentButton { + margin-top: 5px; +} From ba14989b22fae8b6119645cb1f55b793bf3a5a70 Mon Sep 17 00:00:00 2001 From: Heiko Kernbach Date: Thu, 20 Feb 2014 23:19:46 +0100 Subject: [PATCH 03/25] jslint --- .../aardvark/frontend/js/arango/templateEngine.js | 2 +- .../aardvark/frontend/js/views/documentView.js | 7 ++----- .../aardvark/frontend/js/views/userManagementView.js | 12 ++++++++---- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/arango/templateEngine.js b/js/apps/system/aardvark/frontend/js/arango/templateEngine.js index b412c6ef40..ce86d48ac5 100644 --- a/js/apps/system/aardvark/frontend/js/arango/templateEngine.js +++ b/js/apps/system/aardvark/frontend/js/arango/templateEngine.js @@ -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() { diff --git a/js/apps/system/aardvark/frontend/js/views/documentView.js b/js/apps/system/aardvark/frontend/js/views/documentView.js index 1732b3b616..ff9c93764b 100644 --- a/js/apps/system/aardvark/frontend/js/views/documentView.js +++ b/js/apps/system/aardvark/frontend/js/views/documentView.js @@ -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() { @@ -46,7 +46,7 @@ search: true, mode: 'tree', modes: ['tree', 'code'] - } + }; this.editor = new jsoneditor.JSONEditor(container, options); return this; @@ -80,9 +80,6 @@ return; } } - if (result === true) { - console.log(123); - } }, breadcrumb: function () { diff --git a/js/apps/system/aardvark/frontend/js/views/userManagementView.js b/js/apps/system/aardvark/frontend/js/views/userManagementView.js index 7db18f7747..739925606e 100644 --- a/js/apps/system/aardvark/frontend/js/views/userManagementView.js +++ b/js/apps/system/aardvark/frontend/js/views/userManagementView.js @@ -34,8 +34,8 @@ renderTable: function () { this.collection.forEach(function(user) { - var deleteButton = - ''; + var deleteButton = ''; 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; From 3e559d9afd44258390457b4b5b83ca57f07433e6 Mon Sep 17 00:00:00 2001 From: Heiko Kernbach Date: Thu, 20 Feb 2014 23:23:13 +0100 Subject: [PATCH 04/25] cleanup old source view --- js/apps/system/aardvark/manifest.json | 1 - js/apps/system/aardvark/test/karma/karma.conf.js | 1 - 2 files changed, 2 deletions(-) diff --git a/js/apps/system/aardvark/manifest.json b/js/apps/system/aardvark/manifest.json index b72def58be..be58778e03 100644 --- a/js/apps/system/aardvark/manifest.json +++ b/js/apps/system/aardvark/manifest.json @@ -123,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", diff --git a/js/apps/system/aardvark/test/karma/karma.conf.js b/js/apps/system/aardvark/test/karma/karma.conf.js index e871ad4cc3..55c4b77c4d 100644 --- a/js/apps/system/aardvark/test/karma/karma.conf.js +++ b/js/apps/system/aardvark/test/karma/karma.conf.js @@ -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', From 48d23be18fa2fe1a314515be90aa1cfd95c271b9 Mon Sep 17 00:00:00 2001 From: Guido Schwab Date: Fri, 21 Feb 2014 08:34:13 +0100 Subject: [PATCH 05/25] ignore .sass-cache --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1e9697d56a..17c4f47f8f 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ js/apps/* !js/apps/system !js/apps/system/* +.sass-cache From 779b3aaddb8dc0f5ba8ca234dbad5a57911e0742 Mon Sep 17 00:00:00 2001 From: Guido Schwab Date: Fri, 21 Feb 2014 08:36:52 +0100 Subject: [PATCH 06/25] ignore .sass-cache/ --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 17c4f47f8f..76518b4a3a 100644 --- a/.gitignore +++ b/.gitignore @@ -102,4 +102,4 @@ js/apps/* !js/apps/system !js/apps/system/* -.sass-cache +.sass-cache/ From ea0520636c3aa1b395b9537f5c548cca4475a5e9 Mon Sep 17 00:00:00 2001 From: Guido Schwab Date: Fri, 21 Feb 2014 08:43:29 +0100 Subject: [PATCH 07/25] fixed userBar refresh and doing some pixelpushing --- .../aardvark/frontend/css/bootstrap.css | 2 +- .../frontend/img/arangodblogoAvatar.png | Bin 5228 -> 4667 bytes .../frontend/js/templates/userBarView.ejs | 4 +-- .../frontend/js/templates/userProfileView.ejs | 2 +- .../frontend/js/views/collectionsView.js | 3 ++ .../frontend/js/views/navigationView.js | 2 +- .../aardvark/frontend/js/views/userBarView.js | 12 +++----- .../frontend/js/views/userProfileView.js | 11 +++---- .../aardvark/frontend/scss/_navbar.scss | 5 ++- .../aardvark/frontend/scss/_notification.scss | 10 +++--- .../aardvark/frontend/scss/_resizing.scss | 6 ++-- .../aardvark/frontend/scss/_userMenu.scss | 7 +++-- .../aardvark/frontend/scss/generated.css | 29 ++++++++++-------- 13 files changed, 51 insertions(+), 42 deletions(-) diff --git a/js/apps/system/aardvark/frontend/css/bootstrap.css b/js/apps/system/aardvark/frontend/css/bootstrap.css index 186878c289..45fcfe2bbf 100644 --- a/js/apps/system/aardvark/frontend/css/bootstrap.css +++ b/js/apps/system/aardvark/frontend/css/bootstrap.css @@ -807,7 +807,7 @@ ol ul { } li { - line-height: 20px; + line-height: 19px; } ul.unstyled, diff --git a/js/apps/system/aardvark/frontend/img/arangodblogoAvatar.png b/js/apps/system/aardvark/frontend/img/arangodblogoAvatar.png index f84ce8f0fa8df6d29c802c679a9ca747f505ef50..e91f7d1bc31a88c510f1b626165fb0a13e238cbf 100644 GIT binary patch delta 2044 zcmVi2soF3x9Q zAVDgX#WaokD4^=%I4-57Gco%5dicjb{wB4xRqFK$B7)ygqBI3UcJP-|q3sD|Nj0-am;(!_?J1L^kWF>$<4A($Ue!h7GUdF$@p2 zwN)C87SPer%atoVn$6l;SGSPdTtBH)Mk^|cSh}=AB9R>K+!@fWu6wGgYTLH@{a$_i z@jqy8Za}YH>*MOx9zr3%u76xPS1rp_L&SsEE1W)kh26W4;<`#h!(w*tZXg&8Vi-O= z9)oZ=SL*9)bYNhNZ@=v%6bfJ%K7zp@jsr)I{KSVJwvfr#y!he@Hf)ID^?L9CA|j%S zxUP!ps;H{`zY>Y0yz|bNT)P&R*I(ZzFTJ!zMn@+lowmj6^$3W7{C|%J{jY}@p!od; z3m4ARhK9wWs;pQsmr%%5+jamX7Msn}PcPEBb4zfXIK92Y5{p$52>3{+vjl^FYHBK| zuV19uti!T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JZgJ<4)PK zWfdhQAw-aM>sr{nd8K~)+w;Zm_v(fXJLTScZ=tDai4F{mN;GP#NS92^7S%$ZB<+kf{3J9mD}rAt={2Gc1l%*6W1Pj*Xh?*Q4^0g_2q zu6Y9iRp{@(Dw{Ul$&4B0R8-{3$&(j}Ms51~hI#F^|KgQb9;C7|pZ4~XY~OwWfS>+! zHIC!*-S7TZN=mZXv*!rOq{CBB-Gdd2C3M-c8)g0arNraOuPtw7XlRUQo`3nXj*LX4 zrlyn~JJ#tBfA|K+j`hggxl{Ss&sLL{7bF~xGJSe6zy5V2fq<92dp~2}zAvyWQ?Fi) z$oP01fXqxEmgBfmTpS`dH^{ba?@LNN9i~jlqp`68pU)$vX>jr42yeV`SZ=?4CaYK9 z%*e<%@4ovP>((tLJ3Eui%zpsI#rZ%wSFRky@AvZNn~zFw?;w_C(APK2`t_|?lj?B! za+p8;sY4S9N1{=iIdiILY@Cnls(L(@eD&2ZJ9Zq>_Vy>Ks;ZO^KKO)JUp+`sQHavg zoC$?D@OmxIpC82QO(P@2r^}Yjl29nbp+o<}-~WClCBP|5DB|^67=MPS>$>9cSgLx> z!KrB)1Oi?X2?vN12zV(d$mFS~-qv6+9m_H#9FD5r@0Gl~40T`208LH5m8Pa8l$K`mi(mYwY}s-* zQ>PY+<2YEBNp^NXVt=s&iA0h}Bu=Uf5h^Q-*t#|4t{lfDH#Y;zGO;WJ)s#khJQmMB zyO)d%AC_fc7zT-i!@+}Hs4CH@O;uF^$B*~W-hKkhGKfTMzVn?0%$s*zY7Tuq4_#ds z*uTFM*G)NQ(=-?!9^0 - diff --git a/js/apps/system/aardvark/frontend/js/views/navigationView.js b/js/apps/system/aardvark/frontend/js/views/navigationView.js index 2ae28ddea1..edb74986f5 100644 --- a/js/apps/system/aardvark/frontend/js/views/navigationView.js +++ b/js/apps/system/aardvark/frontend/js/views/navigationView.js @@ -14,6 +14,7 @@ }, initialize: function () { + this.userCollection = this.options.userCollection, this.dbSelectionView = new window.DBSelectionView({ collection: window.arangoDatabase, current: window.currentDB @@ -37,7 +38,10 @@ isSystem: window.currentDB.get("isSystem") })); this.dbSelectionView.render($("#dbSelect")); - this.userBarView.render(); + + if (this.userCollection.whoAmI() !== null) { + this.userBarView.render(); + } this.statisticBarView.render($("#statisticBar")); return this; }, From eac41f5bd531261a832303b369c54105aeb77534 Mon Sep 17 00:00:00 2001 From: Guido Schwab Date: Fri, 21 Feb 2014 11:18:16 +0100 Subject: [PATCH 11/25] fixed wrong commit --- js/apps/system/aardvark/frontend/js/views/collectionsView.js | 1 - 1 file changed, 1 deletion(-) diff --git a/js/apps/system/aardvark/frontend/js/views/collectionsView.js b/js/apps/system/aardvark/frontend/js/views/collectionsView.js index a77f20fd8c..6bb922c422 100644 --- a/js/apps/system/aardvark/frontend/js/views/collectionsView.js +++ b/js/apps/system/aardvark/frontend/js/views/collectionsView.js @@ -198,7 +198,6 @@ }, restrictToSearchPhraseKey: function (e) { - this.currentSearchString = // key pressed in search box var self = this; From 5c1e74ccc3907b7aee02532e44a98fe778caf54f Mon Sep 17 00:00:00 2001 From: Heiko Kernbach Date: Fri, 21 Feb 2014 12:12:52 +0100 Subject: [PATCH 12/25] fixed checkboxes in collectionsview-toggle-menue --- .../frontend/js/templates/collectionsView.ejs | 12 ++++++------ .../aardvark/frontend/js/views/collectionsView.js | 9 ++++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/js/apps/system/aardvark/frontend/js/templates/collectionsView.ejs b/js/apps/system/aardvark/frontend/js/templates/collectionsView.ejs index c1d7607116..ce8bb07c66 100644 --- a/js/apps/system/aardvark/frontend/js/templates/collectionsView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/collectionsView.ejs @@ -23,24 +23,24 @@ diff --git a/js/apps/system/aardvark/frontend/js/views/collectionsView.js b/js/apps/system/aardvark/frontend/js/views/collectionsView.js index 6bb922c422..6151c09086 100644 --- a/js/apps/system/aardvark/frontend/js/views/collectionsView.js +++ b/js/apps/system/aardvark/frontend/js/views/collectionsView.js @@ -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; From 14c9343e0623c980369c6e6f819b0c00f202e69a Mon Sep 17 00:00:00 2001 From: Heiko Kernbach Date: Fri, 21 Feb 2014 12:19:44 +0100 Subject: [PATCH 13/25] fixed wrong template name --- .../system/aardvark/frontend/js/templates/addNewGraphView.ejs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/apps/system/aardvark/frontend/js/templates/addNewGraphView.ejs b/js/apps/system/aardvark/frontend/js/templates/addNewGraphView.ejs index 7cd19375fc..194b32e5c7 100644 --- a/js/apps/system/aardvark/frontend/js/templates/addNewGraphView.ejs +++ b/js/apps/system/aardvark/frontend/js/templates/addNewGraphView.ejs @@ -1,4 +1,4 @@ -