Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions group_view.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<script language="javascript" type="text/javascript" src="<?php echo $path;?>Lib/flot/flot.min.js"></script>
-->
<script language="javascript" type="text/javascript" src="<?php echo $path;?>Modules/graph/vis.helper.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $path;?>Lib/misc/clipboard.js"></script>

<!-- toggle button to choose User or Group. Documentation: http://bootstrapswitch.com/options.html -->
<link href="<?php echo $path; ?>Modules/graph/Lib/bootstrap-switch.css" rel="stylesheet">
Expand Down Expand Up @@ -204,6 +205,10 @@
<option value="lastvalue">Replace with last value</option>
<option value="remove">Remove whole line</option>
</select>
<div class="input-append"><!-- just to match the styling of the other items -->
<button onclick="copyToClipboardCustomMsg(document.getElementById('csv'), 'copy-csv-feedback','Copied')" class="csvoptions btn" id="copy-csv" type="button">Copy <i class="icon-share-alt"></i></button>
</div>
<span id="copy-csv-feedback" class="csvoptions"></span>
</div>


Expand Down Expand Up @@ -341,6 +346,14 @@
}
});

// stops a part upgrade error - this change requires emoncms/emoncms repo to also be updated
// keep button hidden if new version of clipboard.js is not available
if (typeof copyToClipboardCustomMsg === 'function') {
document.getElementById('copy-csv').classList.remove('hidden');
} else {
copyToClipboardCustomMsg = function () {}
}

/******************************************
Functions
******************************************/
Expand Down
18 changes: 15 additions & 3 deletions view.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
-->
<script language="javascript" type="text/javascript" src="<?php echo $path; ?>Lib/flot/jquery.flot.stack.min.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $path;?>Modules/graph/vis.helper.js"></script>
<script language="javascript" type="text/javascript" src="<?php echo $path;?>Lib/misc/clipboard.js"></script>
<link href="<?php echo $path; ?>Lib/bootstrap-datetimepicker-0.0.11/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<script language="javascript" type="text/javascript" src="<?php echo $path; ?>Lib/bootstrap-datetimepicker-0.0.11/js/bootstrap-datetimepicker.min.js"></script>
<link href="<?php echo $path; ?>Modules/graph/graph.css" rel="stylesheet">
Expand Down Expand Up @@ -204,8 +205,12 @@
<option value="showName">Show name</option>
<option value="hide">Hide</option>
</select>
</div>

</div>

<div class="input-append"><!-- just to match the styling of the other items -->
<button onclick="copyToClipboardCustomMsg(document.getElementById('csv'), 'copy-csv-feedback','Copied')" class="csvoptions btn hidden" id="copy-csv" type="button">Copy <i class="icon-share-alt"></i></button>
</div>
<span id="copy-csv-feedback" class="csvoptions"></span>

<textarea id="csv" style="width:98%; height:500px; display:none; margin-top:10px"></textarea>
</div>
Expand Down Expand Up @@ -235,8 +240,15 @@
});
}

// stops a part upgrade error - this change requires emoncms/emoncms repo to also be updated
// keep button hidden if new version of clipboard.js is not available
if (typeof copyToClipboardCustomMsg === 'function') {
document.getElementById('copy-csv').classList.remove('hidden');
} else {
copyToClipboardCustomMsg = function () {}
}

// Assign active feedid from URL
console.log(window.location.pathname);
var urlparts = window.location.pathname.split("graph/");
if (urlparts.length==2) {
var feedids = urlparts[1].split(",");
Expand Down