Skip to content
Permalink
Browse files

Automated error tracking!

  • Loading branch information...
ironman5366 committed Apr 25, 2019
1 parent ea04dce commit ffc20f980d39b35af9f620cb778325169c77e821
Showing with 30 additions and 5 deletions.
  1. +4 −0 index.html
  2. +9 −2 index.js
  3. +3 −2 package.json
  4. +9 −1 page.js
  5. +5 −0 schedule.html
@@ -144,6 +144,10 @@ <h1>Upcoming</h1>
let yourAudio = document.getElementById('stream'),
ctrl = document.getElementById('audioControl');
function do_playpause(){
let visitor = require('electron').remote.getCurrentWindow().visitor;
visitor.event("Music", method).send();
// Update the Button
var pause = ctrl.innerHTML === pause_button;
ctrl.innerHTML = pause ? play_button : pause_button;
@@ -1,10 +1,17 @@
const { app, BrowserWindow, globalShortcut } = require('electron');
const fs = require('fs');
var ua = require('universal-analytics');
const tracking_id = "UA-67885845-4";
var visitor = ua(tracking_id);
const { init } = require('@sentry/electron');
init({
dsn: 'https://79f7d930af9c4696a5229b962be84102@sentry.io/1446827',
enableNative: false,
});

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let win;
const krlx_url = "http://live.krlx.org/data.php";

function createWindow () {

@@ -13,7 +20,7 @@ function createWindow () {

// and load the index.html of the app.
win.loadFile('index.html');

win.visitor = visitor;
// Register media shortcuts
globalShortcut.register("MediaPlayPause",
function(){
@@ -1,6 +1,6 @@
{
"name": "krlxdesktop",
"version": "1.0.1",
"version": "1.0.2",
"description": "A desktop player for KRLX",
"main": "index.js",
"scripts": {
@@ -40,13 +40,14 @@
]
},
"dependencies": {
"@sentry/electron": "^0.17.1",
"bootstrap": "^4.3.1",
"bootswatch": "^4.3.1",
"jquery": "^3.4.0",
"js-base64": "^2.5.1",
"moment": "^2.24.0",
"popper": "^1.0.1",
"popper.js": "^1.15.0",
"universal-analytics": "^0.4.20",
"yarn": "^1.15.2"
},
"postinstall": "electron-builder install-app-deps"
10 page.js
@@ -6,6 +6,15 @@ const Base64 = require('./node_modules/js-base64').Base64;
const fs = require('fs');
const moment = require('./assets/moment.min.js');
const spotify_api = require('./spotify_api.json');
const { init } = require('@sentry/electron');
let visitor = remote.getCurrentWindow().visitor;

visitor.screenview("Home Screen", "KRLX Desktop", remote.app.getVersion()).send();

init({
dsn: 'https://79f7d930af9c4696a5229b962be84102@sentry.io/1446827',
enableNative: false,
});
// The RegEx to resolve student images from the directory
const DIR_REG = new RegExp('(<div class="email"><span class="icon">' +
'\\n{0,1}<\\/span>(\\w+)&nbsp;)|<span class="icon"><\\/span><a href="mailto:(\\w+)@carleton.edu">');
@@ -321,7 +330,6 @@ function check_updates(){
success: function(data){
console.log("Got update data");
console.log(data);
console.log(shell);
let curr_version = remote.app.getVersion();
let remote_version = data.updates.version;
let update_url = data.updates.update;
@@ -61,17 +61,22 @@ <h1>Schedule</h1>
&copy <script>document.write(new Date().getFullYear())</script>
</div>
<script>
let visitor = require('electron').remote.getCurrentWindow().visitor;
let app_version = require('electron').remote.app.getVersion();
visitor.screenview("Schedule", "KRLX Desktop", app_version).send();
let play_button = '<img class="img-fluid" src="assets/play.svg" width="50" height="50">';
let pause_button = '<img class="img-fluid" src="assets/pause.svg" width="50" height="50">'
let yourAudio = document.getElementById('stream'),
ctrl = document.getElementById('audioControl');
function do_playpause(){
// Update the Button
var pause = ctrl.innerHTML === pause_button;
ctrl.innerHTML = pause ? play_button : pause_button;
// Update the Audio
var method = pause ? 'pause': 'play';
visitor.event("Music", method).send();
yourAudio[method]();
// Prevent Default Action

0 comments on commit ffc20f9

Please sign in to comment.
You can’t perform that action at this time.