Commit cb4d9ad3 authored by Paul Asmuth's avatar Paul Asmuth
Browse files

sql editor button bar

parent d879b007
Loading
Loading
Loading
Loading
+16 −8
Original line number Diff line number Diff line
@@ -134,12 +134,11 @@ FnordMetric.views.QueryPlayground = function() {

    /* render buttons */
    button_bar = document.createElement("div");
    button_bar.innerHTML = "<div class='editor_type_picker'><i class='fa fa-database'></i> SQL Editor</div>";
    button_bar.innerHTML = "<div class='editor_type_picker'><i class='fa fa-database'></i> SQL Editor <i class='fa fa-chevron-down'></i></div>";
    button_bar.className = "navbar";

    var split_btn = FnordMetric.createButton(
      "#", "fancy_button", "Change View");
    split_btn.style.float = "right";
    var split_btn = document.createElement("i");
    split_btn.className = "fa fa-columns icobtn";
    button_bar.appendChild(split_btn);

    split_btn.onclick = function(e) {
@@ -153,9 +152,16 @@ FnordMetric.views.QueryPlayground = function() {
      console.log("change view");
    }

    var query_btn = FnordMetric.createButton(
      "#", "run_query", "Run Query");
    query_btn.onclick = function(e) {
    var refresh_btn = document.createElement("i");
    refresh_btn.className = "fa fa-refresh icobtn";
    button_bar.appendChild(refresh_btn);

    var exec_btn = document.createElement("span");
    exec_btn.className = "run_query_btn";
    exec_btn.innerHTML = "<i class='fa fa-bolt'></i> Run Query";
    button_bar.appendChild(exec_btn);

    exec_btn.onclick = function(e) {
      e.preventDefault();
      runQuery(
        result_pane,
@@ -163,6 +169,8 @@ FnordMetric.views.QueryPlayground = function() {
        current_view);
    }


/*
    var embed_btn = FnordMetric.createButton(
      "#", "fancy_button", "Embed Query");

@@ -171,7 +179,7 @@ FnordMetric.views.QueryPlayground = function() {
      FnordMetric.util.openPopup(
        viewport, "Todo: Ruby/JS/html snippet");
    }

*/
    //button_bar.appendChild(query_btn);
    //button_bar.appendChild(embed_btn);

+61 −1
Original line number Diff line number Diff line
@@ -53,6 +53,25 @@
.fa-sort-amount-desc:before {
  content: "\f161";
}
.fa-th-large:before {
  content: "\f009";
}
.fa-code:before {
  content: "\f121";
}
.fa-columns:before {
  content: "\f0db";
}
.fa-chevron-down:before {
  content: "\f078";
}
.fa-rocket:before {
  content: "\f135";
}
.fa-flash:before,
.fa-bolt:before {
  content: "\f0e7";
}

.fa-spin {
  -webkit-animation: fa-spin 1s infinite linear;
@@ -126,12 +145,13 @@ body {
}

.editor_type_picker {
  float: left;
  background: #f6f8fa;
  border-right: 1px solid #dbdedf;
  height: 39px;
  display: block;
  width: 90px;
  text-align: center;
  border-right: 1px solid #dbdedf;
  padding: 0 15px 0 15px;
  line-height: 41px;
  font-size: 95%;
@@ -144,6 +164,11 @@ body {
  left: -3px;
}

.editor_type_picker i.fa-chevron-down{
  left: 6px;
  opacity: 0.6;
}

.navbar {
  height: 39px;
  width: 100%;
@@ -267,6 +292,20 @@ input {
  background: #e9ebed;
}

.icobtn + .icobtn {
  margin-left: 5px;
}

.icobtn {
  float: left;
  display: block;
  height: 40px;
  width: 30px;
  margin-left: 10px;
  line-height: 40px;
  text-align: center;
}

.viewport.horizontal_split .editor_pane {
  left: 0;
}
@@ -700,6 +739,27 @@ h1.page_header em {
  color: #394b59;
}

.run_query_btn i {
  margin-right: 4px;
}

.run_query_btn:hover {
  background: #edf0f2;
  color: #545758;
}

.run_query_btn {
  cursor: pointer;
  height: 29px;
  line-height: 30px;
  margin-right: 8px;
  margin-top: 6px;
  float: right;
  padding: 0 12px;
  border-radius: 4px;
  color: #009fe9;
}

/* BASICS */

.CodeMirror {