Skip to content

Commit

Permalink
Merge pull request #73 from emrysr/dark-sidebar
Browse files Browse the repository at this point in the history
Dark sidebar
  • Loading branch information
glynhudson committed May 1, 2019
2 parents 7e0a211 + db0a0db commit 16d8714
Show file tree
Hide file tree
Showing 13 changed files with 304 additions and 456 deletions.
4 changes: 2 additions & 2 deletions Views/sidebar.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<table class="table table-condensed" id="feeds"></table>
<table class="table table-condensed mx-3" id="feeds"></table>

<div id="mygraphs">
<div id="mygraphs" class="px-3">
<h4><a href="#" class="collapsed" data-toggle="collapse" data-target="#graph-list">
<?php echo _('My Graphs') ?> <span class="arrow arrow-down pull-right"></span>
</a></h4>
Expand Down
Binary file removed example.png
Binary file not shown.
34 changes: 0 additions & 34 deletions example_controller.php

This file was deleted.

25 changes: 0 additions & 25 deletions example_menu.php

This file was deleted.

30 changes: 0 additions & 30 deletions example_model.php

This file was deleted.

7 changes: 0 additions & 7 deletions example_schema.php

This file was deleted.

39 changes: 0 additions & 39 deletions example_view.php

This file was deleted.

70 changes: 70 additions & 0 deletions graph.css
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,34 @@
}


#sub_nav li{
transition: all .2s ease-out;
height: 0;
border-bottom-width: 0;
overflow: hidden;
}
/* show all menu items when 'in' class added */
#sub_nav.in li,
#sub_nav li.active{
height: 3.125rem;
border-bottom-width: 1px;
}

/* sidebar #mygraphs */
#graph-list{
width: 14rem;
overflow: hidden;
position: relative;
/* margin-bottom: 3rem; */
}
#graph-list input{
width:12rem;
}
#graph-list select{
width:13rem;
}
/* end of sidebar #mygraphs */

.feed-options {
background-color:#eee;
overflow-x: scroll;
Expand Down Expand Up @@ -179,6 +207,48 @@ input.feed-tag-checkbox-left, input.feed-tag-checkbox-right{
outline: none;
}

table#feeds.table thead th{
border-top: 4px solid #333;
font-weight: normal !important;
color: #adadad;
cursor: pointer;
transition: all .3s ease-in;
padding-left: 0;
}
table#feeds.table thead th:hover{
color: #f8f9fa;
text-decoration: underline;
}
table#feeds.table input[type="checkbox"] { margin: 0 }
table#feeds.table tbody tr > *{
border-color: #444;
}
table#feeds.table tbody tr th{
cursor: pointer;
transition: all .3s ease-in;
font-weight: normal;
}
table#feeds.table tbody tr th:hover{
text-decoration: underline;
}
table#feeds.table tbody tr th.feed-title span{
max-width:9em;
}

table#feeds.table .caret {
border-top-color: currentColor !important;
display: inline-block;
vertical-align: middle;
margin-right: .4em;
}

#graph-wrapper{
transition: all .3s ease-out;
}
#graph-wrapper.empty{
opacity: .3;
transform: scale(.99);
}
#download-buttons form{
margin: 0;
padding: 0;
Expand Down
34 changes: 3 additions & 31 deletions graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ $('#graph_right').click(function () {floatingtime=0; view.panright(); graph_relo
$('#graph_left').click(function () {floatingtime=0; view.panleft(); graph_reloaddraw();});
$('.graph_time').click(function () {
floatingtime=1;
view.timewindow($(this).attr("time"));
view.timewindow($(this).data("time"));
graph_reloaddraw();
});

Expand Down Expand Up @@ -257,7 +257,7 @@ function graph_init_editor()
if (name.length>20) {
name = name.substr(0,20)+"..";
}
out += "<th class='feed-title' data-feedid='"+feedsbytag[tag][z].id+"'>"+name+"</th>";
out += "<th class='feed-title' title='"+name+"' data-feedid='"+feedsbytag[tag][z].id+"'><span class='text-truncate d-inline-block'>"+name+"</span></th>";
out += "<td><input class='feed-select-left' data-feedid='"+feedsbytag[tag][z].id+"' type='checkbox'></td>";
out += "<td><input class='feed-select-right' data-feedid='"+feedsbytag[tag][z].id+"' type='checkbox'></td>";
out += "</tr>";
Expand Down Expand Up @@ -609,7 +609,7 @@ function graph_reload()
var title = _lang['Select a feed'] + '.';
var message = _lang['Please select a feed from the Feeds List'];
var icon = '<svg class="icon show_chart"><use xlink:href="#icon-show_chart"></use></svg>';
var markup = ['<div class="alert alert-info"><a href="#" class="open-sidebar"><strong>',title,'</strong>',message,'</a></div>'].join(' ');
var markup = ['<div class="alert alert-info"><a href="#" class="open-sidebar"><strong>',icon,title,'</strong>',message,'</a></div>'].join(' ');
$('#error').show()
.html(markup);
return false;
Expand Down Expand Up @@ -1470,35 +1470,7 @@ function graph_delete(id) {

graph_load_savedgraphs();
}
// ----------------------------------------------------------------------------------------
// Sidebar
// ----------------------------------------------------------------------------------------
$("#sidebar-open").click(function(){
$("#sidebar-wrapper").css("left","250px");
$("#sidebar-close").show();
});

$("#sidebar-close").click(function(){
$("#sidebar-wrapper").css("left","0");
$("#sidebar-close").hide();
});

function sidebar_resize() {
var width = $(window).width();
var height = $(window).height();
$("#sidebar-wrapper").height(height-41);

if (width<1024) {
$("#sidebar-wrapper").css("left","0");
$("#wrapper").css("padding-left","0");
$("#sidebar-open").show();
} else {
$("#sidebar-wrapper").css("left","250px");
$("#wrapper").css("padding-left","250px");
$("#sidebar-open").hide();
$("#sidebar-close").hide();
}
}

// ----------------------------------------------------------------------------------------
function load_feed_selector() {
Expand Down
2 changes: 1 addition & 1 deletion graph_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ function graph_controller()
}
}
else {
$route->sidebar = view("Modules/graph/Views/sidebar.php");
$route->sidebar = view("Modules/graph/Views/sidebar.php",array());
$result = view("Modules/graph/view.php", array("session" => $session["write"]));
}

Expand Down
4 changes: 2 additions & 2 deletions graph_menu.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

$menu['sidebar']['setup'][] = array(
$menu['sidebar']['emoncms'][] = array(
'text' => _("Graphs"),
'path' => 'graph',
'active'=>'graph',
Expand All @@ -10,4 +10,4 @@
'data'=> array('sidebar' => '#sidebar_graph')
);

$menu['sidebar']['includes']['setup']['graph'] = view('Modules/graph/Views/sidebar.php');
$menu['sidebar']['includes']['emoncms']['graph'] = view('Modules/graph/Views/sidebar.php',array());
11 changes: 0 additions & 11 deletions prepare.sh

This file was deleted.

0 comments on commit 16d8714

Please sign in to comment.