Skip to content

Commit

Permalink
Merge branch 'master' into master-dist
Browse files Browse the repository at this point in the history
  • Loading branch information
patternfly-build committed Aug 25, 2016
2 parents 3be1671 + ac89f30 commit 6797e24
Show file tree
Hide file tree
Showing 17 changed files with 306 additions and 329 deletions.
6 changes: 1 addition & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,4 @@ script:
- 'npm run test'

after_success:
- sh -x ./scripts/publish.sh

notifications:
email:
- [email protected]
- sh -x ./scripts/publish.sh
15 changes: 15 additions & 0 deletions demo/data.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,21 @@ var json = [
{"date": "2016-04-05T23:49:26.308Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-04T01:46:50.852Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-06T18:29:16.542Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-04T08:45:45.998Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-04-27T18:56:10.822Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
{"date": "2016-05-01T09:21:34.462Z", "details": {"event": "vmPowerOn", "object": "vmName"}},
Expand Down
75 changes: 36 additions & 39 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,65 +3,62 @@

<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="../node_modules/patternfly/dist/css/patternfly.min.css" />
<link rel="stylesheet" href="../node_modules/patternfly/dist/css/patternfly-additions.min.css" />
<link rel="stylesheet" href="../node_modules/patternfly/node_modules/c3/c3.css" media="all">
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/patternfly/3.9.0/css/patternfly.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/patternfly/3.9.0/css/patternfly-additions.min.css" />
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/c3/0.4.11/c3.min.css" media="all">
<link rel="stylesheet" href="../dist/timeline.css">
<link rel="stylesheet" href="../demo/style.css">
</head>

<body>
<div class="container">
<br/>
<br/>
<br/>
<br/>

<div class="row">
<select id="timeline-selectpicker" class="selectpicker" multiple></select>
<!-- <div class="dropdown">
<button class="btn btn-default dropdown-toggle" id="range-dropdown" type="button" data-toggle="dropdown">
1 Month
<span class="caret"></span>
</button>
<ul class="dropdown-menu zoom-filter" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='one_hour'>1 Hour</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='one_day'>1 Day</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='one_week'>1 Week</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='one_month'>1 Month</a></li>
</ul>
</div>
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" id="position-dropdown" type="button" data-toggle="dropdown">ending <span class="caret"></span>
</button>
<ul class="dropdown-menu zoom-filter" role="menu" aria-labelledby="dropdownMenu2">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='centered'>centered</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='starting'>starting</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id='ending'>ending</a></li>
</ul>
</div>
<div id="datepicker" class="input-group date">
<input type="text" class="form-control bootstrap-datepicker" readonly><span class="input-group-addon"><span class="fa fa-calendar"></span></span>
</div> -->
<select id="timeline-selectpicker" class="selectpicker pull-left" multiple></select>
<div class="dropdown pull-left">
<button class="btn btn-default dropdown-toggle" id="range-dropdown" type="button" data-toggle="dropdown">
1 Month
<span class="caret"></span>
</button>
<ul class="dropdown-menu zoom-filter" role="menu" aria-labelledby="dropdownMenu1">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="one_hour">1 Hour</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="one_day">1 Day</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="one_week">1 Week</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="one_month">1 Month</a></li>
</ul>
</div>
<div class="dropdown pull-left">
<button class="btn btn-default dropdown-toggle" id="position-dropdown" type="button" data-toggle="dropdown">ending <span class="caret"></span>
</button>
<ul class="dropdown-menu zoom-filter" role="menu" aria-labelledby="dropdownMenu2">
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="centered">centered</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="starting">starting</a></li>
<li role="presentation"><a role="menuitem" tabindex="-1" href="#" id="ending">ending</a></li>
</ul>
</div>
<div id="datepicker" class="input-group date pull-left">
<input type="text" class="form-control bootstrap-datepicker" readonly><span class="input-group-addon"><span class="fa fa-calendar"></span></span>
</div>
</div>
<div class="row">
<div id="pf-timeline"></div>
</div>
<br/>
<div class='well'>
<div class="well">
<div style="text-align: center" id="legend"></div>
</div>
</div>
</body>

<script src="../node_modules/patternfly/node_modules/jquery/dist/jquery.js"></script>
<script src="../node_modules/patternfly/node_modules/bootstrap/dist/js/bootstrap.js"></script>
<script src="../node_modules/patternfly/node_modules/bootstrap-select/dist/js/bootstrap-select.js"></script>
<script src="../node_modules/patternfly/node_modules/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"></script>
<script src="../node_modules/d3/d3.min.js"></script>
<script src="../node_modules/patternfly/node_modules/c3/c3.min.js"></script>
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.11.0/js/bootstrap-select.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/c3/0.4.11/c3.min.js"></script>
<script src="../dist/timeline.js"></script>
<script src="../node_modules/patternfly/dist/js/patternfly.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/patternfly/3.9.0/js/patternfly.min.js"></script>
<script src="../demo/data.js"></script>

<!-- external file containing json object for data -->
Expand Down
20 changes: 15 additions & 5 deletions demo/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(document).ready(function() {

var data = [],
start = new Date('2016-04-14T04:25:27.663Z'),
today = new Date('2016-05-02T13:59:06.818Z'),
today = new Date('2016-05-03T04:00:00Z'),
one_hour = 60 * 60 * 1000,
one_day = 24 * 60 * 60 * 1000,
one_week = one_day * 7,
Expand All @@ -27,16 +27,16 @@ for (var x in json) { //json lives in external file for testing
data[x].data[y].date = new Date(json[x].data[y].date);
data[x].data[y].details = json[x].data[y].details;
}
$('#timeline-selectpicker').append("<option>" + data[x].name + "</option>")
$('#timeline-selectpicker').append("<option>" + data[x].name + "</option>");
data[x].display = true;
}
$('#timeline-selectpicker').selectpicker('selectAll');

var timeline = d3.chart.timeline()
.end(today)
.start(today - one_month)
.minScale(1)
.maxScale(720)
.start(today - one_week)
.minScale(one_week / one_month)
.maxScale(one_week / one_hour)
.eventColor(function(data, index) {
if (data.details.event === "vmPowerOff") {
return "#cc0000";
Expand Down Expand Up @@ -92,5 +92,15 @@ $('#datepicker').datepicker({
todayHighlight: true
});

d3.selectAll('.zoom-filter > li > a').on('click', function() {
var time = $('#datepicker').datepicker('getDate');
timeline.Zoom.zoomFilter(time, this.id.toLowerCase());
});

$('#datepicker').on('changeDate', function() {
var time = $('#datepicker').datepicker('getDate');
timeline.Zoom.zoomFilter(time);
});

startdate = new Date(today.getTime() - one_month);
$('#datepicker').datepicker('setDate', today);
2 changes: 1 addition & 1 deletion dist/timeline.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6797e24

Please sign in to comment.