Skip to content
Browse files

design fixes for delete projection and other tiny bugs, refactored js…

… code, cleaned up a bit
  • Loading branch information...
1 parent 91693c6 commit 5bebca8747856cdb7e665e4aa75e8f81417aeb2f @MarkiyanMatsekh MarkiyanMatsekh committed
View
125 src/EventStore/EventStore.SingleNode.Web/singlenode-web/delete-projection.htm
@@ -20,10 +20,10 @@
</div>
</div>
<div class="control-group">
- <label class="control-label" for="raw_state">
+ <label class="control-label" for="projection-state">
<strong>State</strong></label>
<div class="controls">
- <div id="raw_state">
+ <div id="projection-state">
</div>
</div>
</div>
@@ -31,18 +31,17 @@
<label class="control-label" for="source">
<strong>Source</strong></label>
<div class="controls">
- <pre id="source" style="font-family: consolas, 'courier new'; width: 400px; height: 200px;"
- class="span5"></pre>
+ <textarea disabled="disabled" id="source" ></textarea>
</div>
</div>
<div class="control-group">
<div class="controls" id="delete-container">
- <div>
+ <label class="checkbox">
<input type="checkbox" id="delete-checkpoint-stream-checkbox" disabled="disabled">Delete Checkpoint Stream
- </div>
- <div>
+ </label>
+ <label class="checkbox">
<input type="checkbox" id="delete-state-stream-checkbox" disabled="disabled">Delete State Stream
- </div>
+ </label>
<div>
<button id="delete-button" class="btn btn-success">
Confirm Delete</button>
@@ -58,59 +57,43 @@
<script type="text/javascript">
- (function () {
+ (function() {
var projectionStatusUrl = "";
- function success(data, status, xhr) {
- var projection = data.projections[0];
- }
-
- function successDeleteProjection(data, status, xhr) {
- window.location = "view-projection.htm#" + projectionStatusUrl;
- }
-
- function error(xhr, status) {
- delayedRequestProjection();
- }
-
- function successState(data, status, xhr) {
- $("#raw_state").text(JSON.stringify(data));
- }
+ $(function() {
+ $.templates("editSourceTemplate", "#editSourceTemplate");
+ projectionStatusUrl = location.hash.substr(1);
- function errorState(xhr, status) {
- delayedRequestProjectionState();
- }
+ $('#delete-button').click(function() {
- function successSource(data, status, xhr) {
- $("#source").text(data);
- }
-
- function errorSource(xhr, status) {
- delayedRequestProjectionSource();
- }
+ var params = $.param({
+ deleteCheckpointStream: $("#delete-checkpoint-stream-checkbox").attr("checked") ? "yes" : "no",
+ deleteStateStream: $("#delete-state-stream-checkbox").attr("checked") ? "yes" : "no",
+ });
+ var url = projectionStatusUrl + "?" + params;
- function delayedRequestProjection() {
- setTimeout(requestProjection, 1000);
- }
+ $.ajax(url, {
+ headers: {
+ Accept: "application/json",
+ },
+ type: "DELETE",
+ success: successDeleteProjection,
+ error: function(xhr) {
+ var msg = es.util.formatError("Couldn't delete projection", xhr);
+ alert(msg);
+ }
+ });
+ });
- function delayedRequestProjectionState() {
- setTimeout(requestProjectionState, 1000);
- }
+ requestProjectionState();
+ requestProjectionSource();
- function delayedRequestProjectionSource() {
- setTimeout(requestProjectionSource, 1000);
- }
+ function successDeleteProjection(data, status, xhr) {
+ window.document.location = "projections.htm";
+ }
+ });
- function requestProjection() {
- $.ajax(projectionStatusUrl + "/statistics", {
- headers: {
- Accept: "application/json",
- },
- success: success,
- error: error
- });
- }
function requestProjectionState() {
$.ajax(projectionStatusUrl + "/state", {
@@ -120,6 +103,14 @@
success: successState,
error: errorState
});
+
+ function successState(data, status, xhr) {
+ $("#projection-state").text(JSON.stringify(data));
+ }
+
+ function errorState(xhr, status) {
+ setTimeout(requestProjectionState, 1000);
+ }
}
function requestProjectionSource() {
@@ -131,32 +122,16 @@
success: successSource,
error: errorSource
});
- }
- $(function () {
- $.templates("editSourceTemplate", "#editSourceTemplate");
- projectionStatusUrl = location.hash.substr(1);
+ function successSource(data, status, xhr) {
+ $("#source").text(data);
+ }
- $('#delete-button').click(function () {
- $.ajax(projectionStatusUrl + "?" + $.param({
- deleteCheckpointStream: $("#delete-checkpoint-stream-checkbox").attr("checked") ? "yes" : "no",
- deleteStateStream: $("#delete-state-stream-checkbox").attr("checked") ? "yes" : "no",
- }), {
- headers: {
- Accept: "application/json",
- },
-
-
- type: "DELETE",
- success: successDeleteProjection,
- error: function () { alert("Failed!"); }
- });
- });
+ function errorSource(xhr, status) {
+ setTimeout(requestProjectionSource, 1000);
+ }
+ }
- requestProjection();
- requestProjectionState();
- requestProjectionSource();
- });
})();
</script>
View
129 src/EventStore/EventStore.SingleNode.Web/singlenode-web/edit-projection-source.htm
@@ -14,17 +14,11 @@
<h1>
Edit Projection Source</h1>
<div class="form-horizontal">
- <div class="row">
- <div class="span12">
- <div id="projection-status">
- </div>
- </div>
- </div>
<div class="control-group">
- <label class="control-label" for="raw_state">
+ <label class="control-label" for="projection-state">
<strong>State</strong></label>
<div class="controls">
- <div id="raw_state">
+ <div id="projection-state">
</div>
</div>
</div>
@@ -32,8 +26,7 @@
<label class="control-label" for="source">
<strong>Source</strong></label>
<div class="controls">
- <textarea rows="20" cols="100" id="source" style="font-family: consolas, 'courier new';"
- class="span5"></textarea>
+ <textarea id="source" ></textarea>
</div>
</div>
<div class="control-group">
@@ -42,16 +35,6 @@
Update</button>
</div>
</div>
- <div class="control-group">
- <label class="control-label" for="raw_data">
- <strong>Log:</strong></label>
- <div class="controls">
- <div id="raw_data" style="display: none; font-family: consolas, 'courier new';">
- </div>
- <div id="debug" style="display: none;">
- </div>
- </div>
- </div>
</div>
<script id="r-body">
@@ -65,55 +48,29 @@
var projectionStatusUrl = "";
- function success(data, status, xhr) {
- var projection = data.projections[0];
- }
-
- function successUpdateSource(data, status, xhr) {
- window.location = "view-projection.htm#" + projectionStatusUrl;
- }
-
- function error(xhr, status) {
- delayedRequestProjection();
- }
-
- function successState(data, status, xhr) {
- $("#raw_state").text(JSON.stringify(data));
- }
-
- function errorState(xhr, status) {
- delayedRequestProjectionState();
- }
-
- function successSource(data, status, xhr) {
- $("#source").text(data);
- }
-
- function errorSource(xhr, status) {
- delayedRequestProjectionSource();
- }
-
- function delayedRequestProjection() {
- setTimeout(requestProjection, 1000);
- }
-
- function delayedRequestProjectionState() {
- setTimeout(requestProjectionState, 1000);
- }
+ $(function() {
+ $.templates("editSourceTemplate", "#editSourceTemplate");
+ projectionStatusUrl = location.hash.substr(1);
- function delayedRequestProjectionSource() {
- setTimeout(requestProjectionSource, 1000);
- }
+ $('#update-button').click(function(ev) {
+ $.ajax(projectionStatusUrl + "/query", {
+ headers: {
+ Accept: "application/json",
+ },
- function requestProjection() {
- $.ajax(projectionStatusUrl + "/statistics", {
- headers: {
- Accept: "application/json",
- },
- success: success,
- error: error
+ type: "PUT",
+ data: $("#source").val(),
+ success: successUpdateSource,
+ error: function(xhr) {
+ var msg = es.util.formatError("Couldn't delete projection", xhr);
+ alert(msg);
+ }
+ });
});
- }
+
+ requestProjectionState();
+ requestProjectionSource();
+ });
function requestProjectionState() {
$.ajax(projectionStatusUrl + "/state", {
@@ -123,6 +80,15 @@
success: successState,
error: errorState
});
+
+ function successState(data, status, xhr) {
+ var state = JSON.stringify(data);
+ $("#projection-state").text(state);
+ }
+
+ function errorState(xhr, status) {
+ setTimeout(requestProjectionState, 1000);
+ }
}
function requestProjectionSource() {
@@ -134,29 +100,20 @@
success: successSource,
error: errorSource
});
- }
- $(function() {
- $.templates("editSourceTemplate", "#editSourceTemplate");
- projectionStatusUrl = location.hash.substr(1);
+ function successSource(data, status, xhr) {
+ $("#source").text(data);
+ }
- $('#update-button').click(function() {
- $.ajax(projectionStatusUrl + "/query", {
- headers: {
- Accept: "application/json",
- },
-
- type: "PUT",
- data: $("#source").val(),
- success: successUpdateSource,
- error: function() { alert("Failed!"); }
- });
- });
+ function errorSource(xhr, status) {
+ setTimeout(requestProjectionSource, 1000);
+ }
+ }
- requestProjection();
- requestProjectionState();
- requestProjectionSource();
- });
+ function successUpdateSource(data, status, xhr) {
+ window.location = "view-projection.htm#" + projectionStatusUrl;
+ }
+
})();
</script>
View
14 src/EventStore/EventStore.SingleNode.Web/singlenode-web/js/es.chartsSetup.js
@@ -28,12 +28,7 @@ $(function () {
function error(xhr, status, err) {
if (unloading)
return;
- var msg;
-
- if (xhr.status === 0)
- msg = "cannot connect to server";
- else
- msg = "error: " + err;
+ var msg = es.util.formatError("Couldn't build charts.", xhr);
$(".error").text(msg).show();
};
@@ -130,6 +125,13 @@ $(function () {
$(".error").hide();
publishNewStat(data);
}
+
+ function error(xhr, status, err) {
+ if (unloading)
+ return;
+ var msg = es.util.formatError("Couldn't update charts.", xhr);
+ $(".error").text(msg).show();
+ }
function publishNewStat(stat) {
$(document).trigger(newDataEvent, [stat]);
View
2 src/EventStore/EventStore.SingleNode.Web/singlenode-web/js/es.menu.js
@@ -1,4 +1,4 @@
-es.utils.loadMenu([
+es.util.loadMenu([
{ "name": "Home", "link": "home.htm", "class": "" },
{ "name": "Projections", "link": "projections.htm", "class": "" },
{ "name": "New Projection", "link": "new-projection.htm", "class": "" },
View
28 src/EventStore/EventStore.SingleNode.Web/singlenode-web/new-projection.htm
@@ -18,14 +18,14 @@
<label class="control-label" for="name">
<strong>Name</strong></label>
<div class="controls">
- <input id="name" type="text" class="span4" />
+ <input id="name" type="text" />
</div>
</div>
<div class="control-group">
- <label class="control-label" for="query">
+ <label class="control-label" for="source">
<strong>Source</strong></label>
<div class="controls">
- <textarea id="query" cols="80" rows="20" class="span5">
+ <textarea id="source">
fromAll().whenAny(function(state,event) { return state; });
</textarea>
</div>
@@ -34,7 +34,7 @@
<label class="control-label" for="mode">
<strong>Select Mode</strong></label>
<div class="controls">
- <select id="mode" class="span4">
+ <select id="mode" >
<option selected="selected" value="onetime">One-Time</option>
<option value="adhoc">Ad-Hoc</option>
<option value="continuous">Continuous</option>
@@ -48,8 +48,6 @@
Post</button>
</div>
</div>
- <div id="log">
- </div>
</div>
<div>
@@ -67,21 +65,25 @@
<script type="text/javascript">
$(function(){
$("#post").click(function () {
- function on_posted(data, textStatus, jqXHR) {
- var statusUrl = jqXHR.getResponseHeader('Location');
- $('#log').append("<a href='" + statusUrl + "'>" + statusUrl + "</a>");
- window.location = "view-projection.htm#" + statusUrl;
- }
+
var name = $("#name").val();
$.ajax("/projections/" + $("#mode").val() + (name == "" ? "" : "?name=" + name), {
headers: {
Accept: "application/json",
},
- data: $('#query').val(),
+ data: $('#source').val(),
type: 'POST',
success: on_posted,
- error: function () { alert('error'); }
+ error: function (xhr) {
+ var msg = es.util.formatError("Couldn't create new projection.", xhr);
+ alert(msg);
+ }
});
+
+ function on_posted(data, textStatus, jqXHR) {
+ var statusUrl = jqXHR.getResponseHeader('Location');
+ window.location = "view-projection.htm#" + statusUrl;
+ }
});
});
</script>
View
34 src/EventStore/EventStore.SingleNode.Web/singlenode-web/post-standard-projection.htm
@@ -18,14 +18,14 @@
<label class="control-label" for="name">
<strong>Name</strong></label>
<div class="controls">
- <input id="name" type="text" class="span4" />
+ <input id="name" type="text" />
</div>
</div>
<div class="control-group">
- <label class="control-label" for="query">
+ <label class="control-label" for="source">
<strong>Source</strong></label>
<div class="controls">
- <textarea id="query" cols="80" rows="20" class="span5"></textarea>
+ <textarea id="source" ></textarea>
</div>
</div>
<div class="control-group">
@@ -60,22 +60,26 @@
<script>
$(function(){
$('#post').click(function () {
+
+ var name = $("#name").val();
+ $.ajax("/projections/persistent?name=" + name + "&type=" + encodeURIComponent($("#type").val()), {
+ headers: {
+ Accept: "application/json",
+ "Content-Type": "text/plain",
+ },
+ data: $('#source').val(),
+ type: 'POST',
+ success: on_posted,
+ error: function(xhr) {
+ var msg = es.util.formatError("Couldn't create new projection.", xhr);
+ alert(msg);
+ }
+ });
+
function on_posted(data, textStatus, jqXHR) {
var statusUrl = jqXHR.getResponseHeader('Location');
- $('#log').append("<a href='" + statusUrl + "'>" + statusUrl + "</a>");
window.location = "view-projection.htm#" + statusUrl;
}
- var name = $("#name").val();
- $.ajax("/projections/persistent?name=" + name + "&type=" + encodeURIComponent($("#type").val()), {
- headers: {
- Accept: "application/json",
- "Content-Type": "text/plain",
- },
- data: $('#query').val(),
- type: 'POST',
- success: on_posted,
- error: function () { alert('error'); }
- });
});
});
</script>
View
2 src/EventStore/EventStore.SingleNode.Web/singlenode-web/projections.htm
@@ -79,7 +79,7 @@
</table>
<script id="projectionTemplate" type="text/x-jsrender">
<tr>
- <td class="name"><a href="view-projection.htm?name={{>~encode(name)}}">{{>name}}</a></td>
+ <td class="name"><a href="view-projection.htm#{{>statusUrl}}">{{>name}}</a></td>
<td>{{>status}}</td>
<td>{{>mode}}</td>
<td class="r">{{>progress.toFixed(1)}}%</td>
View
101 src/EventStore/EventStore.SingleNode.Web/singlenode-web/view-projection.htm
@@ -19,27 +19,16 @@
<ul style="display: inline;">
<li id="edit-source-btn-container"></li>
<li id="delete-projection-btn-container"></li>
- <li style="display: none;" id="command-disable-container"><a href="#" id="command-disable">
- <img src="/web/es/img/stop_btn.png" title="Disable" alt="Disable" /></a> </li>
- <li style="display: none;" id="command-enable-container"><a href="#" id="command-enable">
- <img src="/web/es/img/start_btn.png" title="Enable" alt="Enable" /></a> </li>
+ <li id="command-disable-container"><a id="command-disable">
+ <img src="/web/es/img/stop_btn.png" title="Disable & Stop" alt="Disable & Stop" /></a> </li>
+ <li id="command-enable-container"><a id="command-enable">
+ <img src="/web/es/img/start_btn.png" title="Enable & Start" alt="Enable & Start" /></a> </li>
</ul>
</div>
</div>
</div>
<div id="projection-status">
</div>
- <script id="projectionTemplate" type="text/x-jsrender">
- <div class="row">
- <div class="span12">
- <ul class="breadcrumb">
- <li><strong> {{>name}}</strong> <span class="divider">/</span></li>
- <li><strong>Mode:</strong> {{>mode}} <span class="divider">/</span></li>
- <li><strong>Status:</strong> {{>status}} <span class="divider">/</span></li>
- </ul>
- </div>
- </div>
- </script>
<h4>
State</h4>
<div class="row ">
@@ -52,7 +41,30 @@
</div>
</div>
</div>
- <script id="projectionTemplateStatistics" type="text/x-jsrender">
+ <div class="row">
+ <div class="span12">
+ <h4>
+ Source: <span id="edit-source-container"></span>
+ </h4>
+ <pre id="source" style="font-family: consolas, 'courier new';"></pre>
+ </div>
+ </div>
+ <div class="row">
+ <div class="span12" id="projection-reason">
+ </div>
+ </div>
+ <script id="statusTemplate" type="text/x-jsrender">
+ <div class="row">
+ <div class="span12">
+ <ul class="breadcrumb">
+ <li><strong> {{>name}}</strong> <span class="divider">/</span></li>
+ <li><strong>Mode:</strong> {{>mode}} <span class="divider">/</span></li>
+ <li><strong>Status:</strong> {{>status}} <span class="divider">/</span></li>
+ </ul>
+ </div>
+ </div>
+ </script>
+ <script id="statisticsTemplate" type="text/x-jsrender">
<table class="table 1table-bordered 1table-striped table-thin">
<tbody>
<tr>
@@ -73,19 +85,7 @@
</tbody>
</table>
</script>
- <div class="row">
- <div class="span12">
- <h4>
- Source: <span id="edit-source-container"></span>
- </h4>
- <pre id="source" style="font-family: consolas, 'courier new';"></pre>
- </div>
- </div>
- <div class="row">
- <div class="span12" id="projection-reason">
- </div>
- </div>
- <script id="projectionTemplateReason" type="text/x-jsrender">
+ <script id="reasonTemplate" type="text/x-jsrender">
<h4>Failure Reason:<h4>
<div class="projection-reason-data">
@@ -110,15 +110,15 @@
var projectionStatusUrl = "";
$(function() {
- $.templates("projectionTemplate", "#projectionTemplate");
- $.templates("projectionTemplateStatistics", "#projectionTemplateStatistics");
- $.templates("projectionTemplateReason", "#projectionTemplateReason");
+ $.templates("statusTemplate", "#statusTemplate");
+ $.templates("statisticsTemplate", "#statisticsTemplate");
+ $.templates("reasonTemplate", "#reasonTemplate");
$.templates("editSourceTemplate", "#editSourceTemplate");
$.templates("deleteProjectionTemplate", "#deleteProjectionTemplate");
- projectionStatusUrl = "/projection/" + getUrlParam('name');
+ projectionStatusUrl = document.location.hash.substring(1);
- initialRequest();
+ init();
requestProjectionStats();
requestProjectionState();
requestProjectionSource();
@@ -136,7 +136,10 @@
},
type: "POST",
success: successPostCommand,
- error: function() { alert("Failed!"); }
+ error: function(xhr, status, error) {
+ var err = es.util.formatError("Couldn't disable projection.", xhr);
+ alert(err);
+ }
});
return false;
@@ -151,20 +154,22 @@
},
type: "POST",
success: successPostCommand,
- error: function() { alert("Failed!"); }
+ error: function(xhr) {
+ var err = es.util.formatError("Couldn't enable projection.", xhr);
+ alert(err);
+ }
});
return false;
}
function successPostCommand(data, status, xhr) {
- $('#command-disable-container').toggle();
- $('#command-enable-container').toggle();
- //window.location = "view-projection.htm#" + projectionStatusUrl;
+
}
});
- function initialRequest() {
+ function init() {
+
$.ajax(projectionStatusUrl + "/statistics", {
cache: false,
headers: {
@@ -178,18 +183,13 @@
var projection = data.projections[0];
document.title = projection.name + " - Projection Status";
- if (projection.status === 'Running/Running') {
- $('#command-disable-container').show();
- } else {
- $('#command-enable-container').show();
- }
-
$("#edit-source-btn-container").html(
$.render.editSourceTemplate(projection)
);
$("#delete-projection-btn-container").html(
$.render.deleteProjectionTemplate(projection)
);
+
}
function error(xhr, status) {
@@ -213,18 +213,17 @@
function success(data, status, xhr) {
var projection = data.projections[0];
- document.title = projection.name + " - Projection Status";
$("#projection-status").html(
- $.render.projectionTemplate(projection)
+ $.render.statusTemplate(projection)
);
$("#projection-statistics").html(
- $.render.projectionTemplateStatistics(projection)
+ $.render.statisticsTemplate(projection)
);
- var html = projection.stateReason !== ''
- ? $.render.projectionTemplateReason(projection)
+ var html = !!projection.stateReason // on disabled its undefined, on enabled its ''
+ ? $.render.reasonTemplate(projection)
: '';
$("#projection-reason").html(html);
View
6 src/EventStore/EventStore.Web/EventStore.Web.csproj
@@ -46,6 +46,9 @@
<Content Include="es-common-web\js\controls\es.Zoomer.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <Content Include="es-common-web\js\es.util.js">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </Content>
<Content Include="es-common-web\lib\bootstrap\css\bootstrap-responsive.css">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@@ -103,9 +106,6 @@
<Content Include="es-common-web\js\controls\es.TimeSeries.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
- <Content Include="es-common-web\js\es.loadmenu.js">
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </Content>
<Content Include="es-common-web\js\projections\es.api.js">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
View
116 src/EventStore/EventStore.Web/es-common-web/css/es.sitelayout.css
@@ -1,4 +1,35 @@
+body {
+ /*padding: 0;*/
+}
+
+.navbar
+{
+ /*note MM: fixes extra blank space at page bottom problem, but with small side effects*/
+ position: static !important;
+}
+
+.control_btn_wrapper {
+ display: block;
+}
+
+.control_btn_list {
+ display: inline;
+}
+
+footer {
+ width: 100%;
+ background: #d6d6d6;
+}
+
+footer p {
+ font-family: Arial;
+ font-size: 13px;
+ color: #363636;
+ margin-top: 15px;
+}
+
+
/* Typography */
h1,h2,h3,h4,h5,h6 { font-weight: normal; color: #000000; }
@@ -30,11 +61,22 @@ h6 { font-size: 1em; font-weight: bold; }
margin-bottom: -30px;
}
-#projection-reason > .projection-reason-data, #source{
+#projection-reason > .projection-reason-data{
max-height: 250px;
height: 250px;
overflow-y: auto;
}
+#source {
+ height: 250px;
+ overflow-y: auto;
+ font-family: consolas, 'courier new';
+}
+#source, #name {
+ min-width: 500px;
+}
+#mode {
+ min-width: 515px; /*width of #source + 15px - todo: find out why*/
+}
.error {
min-width: 40%;
margin: 10px auto;
@@ -48,6 +90,33 @@ h6 { font-size: 1em; font-weight: bold; }
white-space: normal;
text-shadow: none;
}
+
+#commands-container {
+ margin-left: -25px;
+}
+
+#commands-container li {
+ display: inline;
+}
+#commands-container a {
+ cursor: pointer;
+}
+#commands-container i.icon-remove {
+ margin-top: 2px;
+ margin-bottom: 2px;
+ margin-left: -3px;
+}
+
+.form-horizontal .control-label {
+ padding-top: 0;
+}
+textarea[disabled='disabled'] {
+ cursor: default;
+}
+#projection-state {
+ word-wrap: break-word;
+}
+
/*===================================== charts =================================*/
.dropdown {
margin-left: 10px;
@@ -114,51 +183,6 @@ h6 { font-size: 1em; font-weight: bold; }
overflow-x: hidden!important;
}
-
-/* ==========================================================================
- Author's custom styles
- ========================================================================== */
-
-body {
- /*padding: 0;*/
-
-
-}
-
-.navbar
-{
- /*note MM: fixes extra blank space at page bottom problem, but with small side effects*/
- position: static !important;
-}
-
-
-.control_btn_wrapper {
- display: block;
-}
-
-.control_btn_list {
- display: inline;
-}
-
-footer {
- width: 100%;
- background: #d6d6d6;
-}
-
-footer p {
- font-family: Arial;
- font-size: 13px;
- color: #363636;
- margin-top: 15px;
-}
-
-#commands-container {
- margin-left: -25px;
-}
-
-#commands-container li {
- display: inline;
-}
/* ==========================================================================
Footer Stick to the Bottom
========================================================================== */
View
17 ...Store.Web/es-common-web/js/es.loadmenu.js → ...ventStore.Web/es-common-web/js/es.util.js
@@ -1,8 +1,11 @@
if (!window.es) { window.es = {}; };
-if (!es.utils) { es.utils = {}; };
+if (es.util)
+ throw 'es.util is already declared.';
+
+es.util = {};
+
+es.util.loadMenu = function (pages) {
-es.utils.loadMenu = function(pages) {
-
var tmplStr = '<li class="{{>class}}"> <a href="{{>link}}"> {{>name}} </a> </li>';
var tmpl = $.templates(tmplStr);
var htmlString = tmpl.render(pages);
@@ -18,4 +21,12 @@ es.utils.loadMenu = function(pages) {
if (active.length == 1)
active.parent().addClass("active");
}
+};
+
+es.util.formatError = function (text, xhr) {
+ var reason = xhr.responseText
+ || xhr.statusText
+ || (xhr.status === 0 ? "Couldn't connect to server." : null)
+ || '(unknown)';
+ return [text, "\r\nReason: ", reason].join('');
};
View
9 src/EventStore/EventStore.Web/es-common-web/js/projections/es.api.js
@@ -1,6 +1,10 @@
if (!window.es) { window.es = {}; };
es.postEvent = function (settings) {
+ var eventType = settings.eventType || (function () { throw "eventType is required"; })();
+ var stream = settings.stream || (function () { throw "stream is required"; })();
+ var data = settings.data || (function () { throw "data is required"; })();
+
var expectedVersion = settings.expectedVersion || -2;
var eventId = settings.eventId || guid();
var correlationId = settings.correlationId || guid();
@@ -8,10 +12,7 @@ es.postEvent = function (settings) {
var onError = settings.error || function() {};
var onSuccess = settings.success || function() {};
-
- var eventType = settings.eventType || (function() { throw "eventType is required"; })();
- var stream = settings.stream || (function() { throw "stream is required"; })();
- var data = settings.data || (function() { throw "data is required"; })();
+
var dataStr = null;
if (typeof data === "object") {
View
8 src/EventStore/EventStore.Web/es-common-web/tmpl/_body.tmpl.html
@@ -4,8 +4,10 @@
<div class="navbar-inner">
<div class="container">
<!-- ==== show menu for device ====-->
- <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"><span
- class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span>
+ <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
</a>
<!-- ==== site logo ====-->
<a class="brand" href="/">
@@ -17,7 +19,7 @@
</ul>
</div>
<!--/.nav-collapse -->
- <script src="/web/es/js/es.loadmenu.js"></script>
+ <script src="/web/es/js/es.util.js"></script>
<script src="/web/js/es.menu.js"></script> <!--we expect that each project keep file in this location in which loads menu-->
</div>
</div>

0 comments on commit 5bebca8

Please sign in to comment.
Something went wrong with that request. Please try again.