diff --git a/CHANGES.md b/CHANGES.md index d0b5bea3..9b9f030a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -36,6 +36,9 @@ * Change The Pirate Bay url back as it's now back up and oldpiratebay hasn't been updated for weeks * Remove duplicate thepiratebay icon * Change to ensure uTorrent API parameters are ordered for uT 2.2.1 compatibility +* Remove defunct boxcar notifier +* Add sound selection for boxcar2 notifier +* Change boxcar2 notifier to use updated api scheme [develop changelog] * Change uT params from unicode to str.format as magnet URLs worked but sending files in POST bodies failed diff --git a/gui/slick/images/notifiers/boxcar.png b/gui/slick/images/notifiers/boxcar.png deleted file mode 100644 index 3e1a7000..00000000 Binary files a/gui/slick/images/notifiers/boxcar.png and /dev/null differ diff --git a/gui/slick/interfaces/default/config_notifications.tmpl b/gui/slick/interfaces/default/config_notifications.tmpl index 79589cc6..0802f65f 100644 --- a/gui/slick/interfaces/default/config_notifications.tmpl +++ b/gui/slick/interfaces/default/config_notifications.tmpl @@ -1,1563 +1,1541 @@ #import sickbeard #from sickbeard.helpers import anon_url -#set global $title="Config - Notifications" -#set global $header="Notifications" +#set global $title = 'Config - Notifications' +#set global $header = 'Notifications' -#set global $sbPath="../.." +#set global $sbPath = '../..' -#set global $topmenu="config"# -#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl") +#set global $topmenu = 'config' +#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl') #if $varExists('header') -

$header

+

$header

#else -

$title

+

$title

#end if
-
-
-
- - -
-
- -
- -

XBMC

-

A free and open source cross-platform media center and home entertainment system software with a 10-foot user interface designed for the living-room TV.

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- -
-
- - - -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
- -
- - -
-
- -

Plex Media Server

-

Plex organizes all of your personal media, wherever you keep it, so you can enjoy it on any device

-

For sending notifications to Plex Home Theater (PHT) clients, use the XBMC notifier with port 3005.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- -
-
- - -
-
- - - -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- - -
-
- -

NMJ

-

The Networked Media Jukebox, or NMJ, is the official media jukebox interface made available for the Popcorn Hour 200-series.

-
-
-
- -
- -
-
- - -
-
- - -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- -
-
- -

NMJv2

-

The Networked Media Jukebox, or NMJv2, is the official media jukebox interface made available for the Popcorn Hour 300 & 400-series.

-
-
-
- -
- -
-
- - -
-
- Database location - - - - -
-
- - -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- - -
-
- -

Synology

-

The Synology DiskStation NAS.

-

Synology Indexer is the daemon running on the Synology NAS to build its media database.

-
- -
-
- - -
- -
- -
- -
-
- - -
-
- -

Synology Notifier

-

Synology Notifier is the notification system of Synology DSM

-
- -
-
- - -
-
-
- -
-
- -
-
- -
- -
-
-
- - -
-
- -

pyTivo

-

pyTivo is both an HMO and GoBack server. This notifier will load the completed downloads to your Tivo.

-
-
-
- - -
- -
-
- - -
-
- - -
-
- - -
- -
- -
-
- -
- - -
-
-
- -

Growl

-

A cross-platform unobtrusive global notification system.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - - -
-
Click below to register and test Growl, this is required for Growl notifications to work.
- - -
- -
-
- - -
-
- Prowl -

Prowl

-

A Growl client for iOS.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- - -
-
- -

Libnotify

-

The standard desktop notification API for Linux/*nix systems. This notifier will only function if the pynotify module is installed (Ubuntu/Debian package python-notify).

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
Click below to test.
- - -
- -
-
- - -
-
- -

Pushover

-

Pushover makes it easy to send real-time notifications to your Android and iOS devices.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- -
-
- -

Boxcar

-

Universal push notification for iOS. Read your messages where and when you want them! A subscription will be sent if needed.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
Click below to test.
- - -
- -
-
- -
-
- -

Boxcar2

-

Read your messages where and when you want them!

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
Click below to test.
- - -
- -
-
- -
-
- -

Notify My Android

-

Notify My Android is a Prowl-like Android App and API that offers an easy way to send notifications from your application directly to your Android device.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- -
-
- -

Pushalot

-

Pushalot is a platform for receiving custom push notifications to connected devices running Windows Phone or Windows 8.

-
-
-
-
- -
-
- -
-
- -
-
- -
-
- - -
-
Click below to test.
- - -
- -
-
- -
-
- -

Pushbullet

-

Pushbullet is a platform for receiving custom push notifications to connected devices running Android and desktop Chrome browsers.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - -
-
Click below to test.
- - -
- -
-
- -
- -
-
-
- -

Twitter

-

A social networking and microblogging service, enabling its users to send and read other users' messages called tweets.

-
-
-
- - -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - -
- -
Click below to test.
- - -
- -
-
- - -
-
- -

Trakt

-

trakt helps keep a record of what TV shows and movies you are watching. Based on your favorites, trakt recommends additional shows and movies you'll enjoy!

-
-
-
- -
- -
-
- - -
-
- - -
-
- - -
-
- -
-
- -
-
- -
-
-
- - -
-
- -
-
- -
-
- -
-
-
Click below to test.
- - -
-
-
- -
-
- -

Email

-

Allows configuration of email notifications on a per show basis.

-
-
-
- -
- -
-
- -
-
- -
-
- -
-
- - -
-
- - -
-
- - -
-
- -
-
- - -
-
- - -
-
- - -
-
- - - -
- -
Click below to test.
- - -
-
-
- -
- - -

- -
+
+
+
+ + +
+
+ +
+ +

XBMC

+

A free and open source cross-platform media center and home entertainment system software with a 10-foot user interface designed for the living-room TV.

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + + +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+ +
+ + +
+
+ +

Plex Media Server

+

Plex organizes all of your personal media, wherever you keep it, so you can enjoy it on any device

+

For sending notifications to Plex Home Theater (PHT) clients, use the XBMC notifier with port 3005.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + + +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ + +
+
+ +

NMJ

+

The Networked Media Jukebox, or NMJ, is the official media jukebox interface made available for the Popcorn Hour 200-series.

+
+
+
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ +
+
+ +

NMJv2

+

The Networked Media Jukebox, or NMJv2, is the official media jukebox interface made available for the Popcorn Hour 300 & 400-series.

+
+
+
+ +
+ +
+
+ + +
+
+ Database location + + + + +
+
+ + +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ + +
+
+ +

Synology

+

The Synology DiskStation NAS.

+

Synology Indexer is the daemon running on the Synology NAS to build its media database.

+
+ +
+
+ + +
+ +
+ +
+ +
+
+ + +
+
+ +

Synology Notifier

+

Synology Notifier is the notification system of Synology DSM

+
+ +
+
+ + +
+
+
+ +
+
+ +
+
+ +
+ +
+
+
+ + +
+
+ +

pyTivo

+

pyTivo is both an HMO and GoBack server. This notifier will load the completed downloads to your Tivo.

+
+
+
+ + +
+ +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+ +
+ + +
+
+
+ +

Growl

+

A cross-platform unobtrusive global notification system.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + + +
+
Click below to register and test Growl, this is required for Growl notifications to work.
+ + +
+ +
+
+ + +
+
+ Prowl +

Prowl

+

A Growl client for iOS.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ + +
+
+ +

Libnotify

+

The standard desktop notification API for Linux/*nix systems. This notifier will only function if the pynotify module is installed (Ubuntu/Debian package python-notify).

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
Click below to test.
+ + +
+ +
+
+ + +
+
+ +

Pushover

+

Pushover makes it easy to send real-time notifications to your Android and iOS devices.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ +
+
+ +

Boxcar2

+

Read your messages where and when you want them!

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ +
+
+ +

Notify My Android

+

Notify My Android is a Prowl-like Android App and API that offers an easy way to send notifications from your application directly to your Android device.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ +
+
+ +

Pushalot

+

Pushalot is a platform for receiving custom push notifications to connected devices running Windows Phone or Windows 8.

+
+
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ +
+
+ +

Pushbullet

+

Pushbullet is a platform for receiving custom push notifications to connected devices running Android and desktop Chrome browsers.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
Click below to test.
+ + +
+ +
+
+ +
+ +
+
+
+ +

Twitter

+

A social networking and microblogging service, enabling its users to send and read other users' messages called tweets.

+
+
+
+ + +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+ +
Click below to test.
+ + +
+ +
+
+ + +
+
+ +

Trakt

+

trakt helps keep a record of what TV shows and movies you are watching. Based on your favorites, trakt recommends additional shows and movies you'll enjoy!

+
+
+
+ +
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+ +
+
+ +
+
+ +
+
+
Click below to test.
+ + +
+
+
+ +
+
+ +

Email

+

Allows configuration of email notifications on a per show basis.

+
+
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ +
+
+ + +
+
+ + +
+
+ + +
+
+ + + +
+ +
Click below to test.
+ + +
+
+
+ +
+ + +

+ +
-#include $os.path.join($sickbeard.PROG_DIR,"gui/slick/interfaces/default/inc_bottom.tmpl") +#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl') diff --git a/gui/slick/js/configNotifications.js b/gui/slick/js/configNotifications.js index d430aa96..1e851c4d 100644 --- a/gui/slick/js/configNotifications.js +++ b/gui/slick/js/configNotifications.js @@ -1,119 +1,103 @@ $(document).ready(function(){ - var loading = ''; + var loading = ''; - $('#testGrowl').click(function () { - var growl_host = $.trim($('#growl_host').val()); - var growl_password = $.trim($('#growl_password').val()); - if (!growl_host) { - $('#testGrowl-result').html('Please fill out the necessary fields above.'); + $('#testGrowl').click(function () { + var growl_host = $.trim($('#growl_host').val()); + var growl_password = $.trim($('#growl_password').val()); + if (!growl_host) { + $('#testGrowl-result').html('Please fill out the necessary fields above.'); $('#growl_host').addClass('warning'); - return; - } - $('#growl_host').removeClass('warning'); + return; + } + $('#growl_host').removeClass('warning'); $(this).prop('disabled', true); - $('#testGrowl-result').html(loading); - $.get(sbRoot + '/home/testGrowl', {'host': growl_host, 'password': growl_password}) - .done(function (data) { - $('#testGrowl-result').html(data); - $('#testGrowl').prop('disabled', false); - }); - }); + $('#testGrowl-result').html(loading); + $.get(sbRoot + '/home/testGrowl', {'host': growl_host, 'password': growl_password}) + .done(function (data) { + $('#testGrowl-result').html(data); + $('#testGrowl').prop('disabled', false); + }); + }); - $('#testProwl').click(function () { - var prowl_api = $.trim($('#prowl_api').val()); - var prowl_priority = $('#prowl_priority').val(); - if (!prowl_api) { - $('#testProwl-result').html('Please fill out the necessary fields above.'); + $('#testProwl').click(function () { + var prowl_api = $.trim($('#prowl_api').val()); + var prowl_priority = $('#prowl_priority').val(); + if (!prowl_api) { + $('#testProwl-result').html('Please fill out the necessary fields above.'); $('#prowl_api').addClass('warning'); - return; - } - $('#prowl_api').removeClass('warning'); + return; + } + $('#prowl_api').removeClass('warning'); $(this).prop('disabled', true); - $('#testProwl-result').html(loading); - $.get(sbRoot + '/home/testProwl', {'prowl_api': prowl_api, 'prowl_priority': prowl_priority}) - .done(function (data) { - $('#testProwl-result').html(data); - $('#testProwl').prop('disabled', false); - }); - }); - - $('#testXBMC').click(function () { - var xbmc_host = $.trim($('#xbmc_host').val()); - var xbmc_username = $.trim($('#xbmc_username').val()); - var xbmc_password = $.trim($('#xbmc_password').val()); - if (!xbmc_host) { - $('#testXBMC-result').html('Please fill out the necessary fields above.'); + $('#testProwl-result').html(loading); + $.get(sbRoot + '/home/testProwl', {'prowl_api': prowl_api, 'prowl_priority': prowl_priority}) + .done(function (data) { + $('#testProwl-result').html(data); + $('#testProwl').prop('disabled', false); + }); + }); + + $('#testXBMC').click(function () { + var xbmc_host = $.trim($('#xbmc_host').val()); + var xbmc_username = $.trim($('#xbmc_username').val()); + var xbmc_password = $.trim($('#xbmc_password').val()); + if (!xbmc_host) { + $('#testXBMC-result').html('Please fill out the necessary fields above.'); $('#xbmc_host').addClass('warning'); - return; - } - $('#xbmc_host').removeClass('warning'); + return; + } + $('#xbmc_host').removeClass('warning'); $(this).prop('disabled', true); - $('#testXBMC-result').html(loading); - $.get(sbRoot + '/home/testXBMC', {'host': xbmc_host, 'username': xbmc_username, 'password': xbmc_password}) - .done(function (data) { - $('#testXBMC-result').html(data); - $('#testXBMC').prop('disabled', false); - }); - }); + $('#testXBMC-result').html(loading); + $.get(sbRoot + '/home/testXBMC', {'host': xbmc_host, 'username': xbmc_username, 'password': xbmc_password}) + .done(function (data) { + $('#testXBMC-result').html(data); + $('#testXBMC').prop('disabled', false); + }); + }); - $('#testPLEX').click(function () { - var plex_host = $.trim($('#plex_host').val()); - var plex_username = $.trim($('#plex_username').val()); - var plex_password = $.trim($('#plex_password').val()); - if (!plex_host) { - $('#testPLEX-result').html('Please fill out the necessary fields above.'); + $('#testPLEX').click(function () { + var plex_host = $.trim($('#plex_host').val()); + var plex_username = $.trim($('#plex_username').val()); + var plex_password = $.trim($('#plex_password').val()); + if (!plex_host) { + $('#testPLEX-result').html('Please fill out the necessary fields above.'); $('#plex_host').addClass('warning'); - return; - } - $('#plex_host').removeClass('warning'); + return; + } + $('#plex_host').removeClass('warning'); $(this).prop('disabled', true); - $('#testPLEX-result').html(loading); - $.get(sbRoot + '/home/testPLEX', {'host': plex_host, 'username': plex_username, 'password': plex_password}) - .done(function (data) { - $('#testPLEX-result').html(data); - $('#testPLEX').prop('disabled', false); - }); - }); + $('#testPLEX-result').html(loading); + $.get(sbRoot + '/home/testPLEX', {'host': plex_host, 'username': plex_username, 'password': plex_password}) + .done(function (data) { + $('#testPLEX-result').html(data); + $('#testPLEX').prop('disabled', false); + }); + }); - $('#testBoxcar').click(function() { - var boxcar_username = $.trim($('#boxcar_username').val()); - if (!boxcar_username) { - $('#testBoxcar-result').html('Please fill out the necessary fields above.'); - $('#boxcar_username').addClass('warning'); - return; - } - $('#boxcar_username').removeClass('warning'); - $(this).prop('disabled', true); - $('#testBoxcar-result').html(loading); - $.get(sbRoot + '/home/testBoxcar', {'username': boxcar_username}) - .done(function (data) { - $('#testBoxcar-result').html(data); - $('#testBoxcar').prop('disabled', false); - }); - }); - - $('#testBoxcar2').click(function () { - var boxcar2_accesstoken = $.trim($('#boxcar2_accesstoken').val()); - if (!boxcar2_accesstoken) { - $('#testBoxcar2-result').html('Please fill out the necessary fields above.'); + $('#testBoxcar2').click(function () { + var boxcar2_accesstoken = $.trim($('#boxcar2_accesstoken').val()); + var boxcar2_sound = $('#boxcar2_sound').val() || 'default'; + if (!boxcar2_accesstoken) { + $('#testBoxcar2-result').html('Please fill out the necessary fields above.'); $('#boxcar2_accesstoken').addClass('warning'); - return; - } - $('#boxcar2_accesstoken').removeClass('warning'); + return; + } + $('#boxcar2_accesstoken').removeClass('warning'); $(this).prop('disabled', true); - $('#testBoxcar2-result').html(loading); - $.get(sbRoot + '/home/testBoxcar2', {'accessToken': boxcar2_accesstoken}) - .done(function (data) { - $('#testBoxcar2-result').html(data); - $('#testBoxcar2').prop('disabled', false); - }); - }); + $('#testBoxcar2-result').html(loading); + $.get(sbRoot + '/home/testBoxcar2', {'accesstoken': boxcar2_accesstoken, 'sound': boxcar2_sound}) + .done(function (data) { + $('#testBoxcar2-result').html(data); + $('#testBoxcar2').prop('disabled', false); + }); + }); - $('#testPushover').click(function () { - var pushover_userkey = $('#pushover_userkey').val(); - var pushover_apikey = $('#pushover_apikey').val(); - if (!pushover_userkey || !pushover_apikey) { - $('#testPushover-result').html('Please fill out the necessary fields above.'); + $('#testPushover').click(function () { + var pushover_userkey = $('#pushover_userkey').val(); + var pushover_apikey = $('#pushover_apikey').val(); + if (!pushover_userkey || !pushover_apikey) { + $('#testPushover-result').html('Please fill out the necessary fields above.'); if (!pushover_userkey) { $('#pushover_userkey').addClass('warning'); } else { @@ -124,108 +108,108 @@ $(document).ready(function(){ } else { $('#pushover_apikey').removeClass('warning'); } - return; - } + return; + } $('#pushover_userkey,#pushover_apikey').removeClass('warning'); $(this).prop('disabled', true); - $('#testPushover-result').html(loading); - $.get(sbRoot + '/home/testPushover', {'userKey': pushover_userkey, 'apiKey': pushover_apikey}) - .done(function (data) { - $('#testPushover-result').html(data); - $('#testPushover').prop('disabled', false); - }); - }); + $('#testPushover-result').html(loading); + $.get(sbRoot + '/home/testPushover', {'userKey': pushover_userkey, 'apiKey': pushover_apikey}) + .done(function (data) { + $('#testPushover-result').html(data); + $('#testPushover').prop('disabled', false); + }); + }); - $('#testLibnotify').click(function() { - $('#testLibnotify-result').html(loading); - $.get(sbRoot + '/home/testLibnotify', - function (data) { $('#testLibnotify-result').html(data); }); - }); + $('#testLibnotify').click(function() { + $('#testLibnotify-result').html(loading); + $.get(sbRoot + '/home/testLibnotify', + function (data) { $('#testLibnotify-result').html(data); }); + }); - $('#twitterStep1').click(function() { - $('#testTwitter-result').html(loading); - $.get(sbRoot + '/home/twitterStep1', function (data) {window.open(data); }) - .done(function () { $('#testTwitter-result').html('Step1: Confirm Authorization'); }); - }); + $('#twitterStep1').click(function() { + $('#testTwitter-result').html(loading); + $.get(sbRoot + '/home/twitterStep1', function (data) {window.open(data); }) + .done(function () { $('#testTwitter-result').html('Step1: Confirm Authorization'); }); + }); - $('#twitterStep2').click(function () { - var twitter_key = $.trim($('#twitter_key').val()); - if (!twitter_key) { - $('#testTwitter-result').html('Please fill out the necessary fields above.'); + $('#twitterStep2').click(function () { + var twitter_key = $.trim($('#twitter_key').val()); + if (!twitter_key) { + $('#testTwitter-result').html('Please fill out the necessary fields above.'); $('#twitter_key').addClass('warning'); - return; - } + return; + } $('#twitter_key').removeClass('warning'); - $('#testTwitter-result').html(loading); - $.get(sbRoot + '/home/twitterStep2', {'key': twitter_key}, - function (data) { $('#testTwitter-result').html(data); }); - }); + $('#testTwitter-result').html(loading); + $.get(sbRoot + '/home/twitterStep2', {'key': twitter_key}, + function (data) { $('#testTwitter-result').html(data); }); + }); - $('#testTwitter').click(function() { - $.get(sbRoot + '/home/testTwitter', - function (data) { $('#testTwitter-result').html(data); }); - }); + $('#testTwitter').click(function() { + $.get(sbRoot + '/home/testTwitter', + function (data) { $('#testTwitter-result').html(data); }); + }); - $('#settingsNMJ').click(function() { - if (!$('#nmj_host').val()) { - alert('Please fill in the Popcorn IP address'); - $('#nmj_host').focus(); - return; - } - $('#testNMJ-result').html(loading); - var nmj_host = $('#nmj_host').val(); - - $.get(sbRoot + '/home/settingsNMJ', {'host': nmj_host}, - function (data) { - if (data === null) { - $('#nmj_database').removeAttr('readonly'); - $('#nmj_mount').removeAttr('readonly'); - } - var JSONData = $.parseJSON(data); - $('#testNMJ-result').html(JSONData.message); - $('#nmj_database').val(JSONData.database); - $('#nmj_mount').val(JSONData.mount); + $('#settingsNMJ').click(function() { + if (!$('#nmj_host').val()) { + alert('Please fill in the Popcorn IP address'); + $('#nmj_host').focus(); + return; + } + $('#testNMJ-result').html(loading); + var nmj_host = $('#nmj_host').val(); + + $.get(sbRoot + '/home/settingsNMJ', {'host': nmj_host}, + function (data) { + if (data === null) { + $('#nmj_database').removeAttr('readonly'); + $('#nmj_mount').removeAttr('readonly'); + } + var JSONData = $.parseJSON(data); + $('#testNMJ-result').html(JSONData.message); + $('#nmj_database').val(JSONData.database); + $('#nmj_mount').val(JSONData.mount); - if (JSONData.database) { - $('#nmj_database').attr('readonly', true); - } else { - $('#nmj_database').removeAttr('readonly'); - } - if (JSONData.mount) { - $('#nmj_mount').attr('readonly', true); - } else { - $('#nmj_mount').removeAttr('readonly'); - } - }); - }); + if (JSONData.database) { + $('#nmj_database').attr('readonly', true); + } else { + $('#nmj_database').removeAttr('readonly'); + } + if (JSONData.mount) { + $('#nmj_mount').attr('readonly', true); + } else { + $('#nmj_mount').removeAttr('readonly'); + } + }); + }); - $('#testNMJ').click(function () { - var nmj_host = $.trim($('#nmj_host').val()); - var nmj_database = $('#nmj_database').val(); - var nmj_mount = $('#nmj_mount').val(); - if (!nmj_host) { - $('#testNMJ-result').html('Please fill out the necessary fields above.'); + $('#testNMJ').click(function () { + var nmj_host = $.trim($('#nmj_host').val()); + var nmj_database = $('#nmj_database').val(); + var nmj_mount = $('#nmj_mount').val(); + if (!nmj_host) { + $('#testNMJ-result').html('Please fill out the necessary fields above.'); $('#nmj_host').addClass('warning'); - return; - } - $('#nmj_host').removeClass('warning'); + return; + } + $('#nmj_host').removeClass('warning'); $(this).prop('disabled', true); - $('#testNMJ-result').html(loading); - $.get(sbRoot + '/home/testNMJ', {'host': nmj_host, 'database': nmj_database, 'mount': nmj_mount}) - .done(function (data) { - $('#testNMJ-result').html(data); - $('#testNMJ').prop('disabled', false); - }); - }); + $('#testNMJ-result').html(loading); + $.get(sbRoot + '/home/testNMJ', {'host': nmj_host, 'database': nmj_database, 'mount': nmj_mount}) + .done(function (data) { + $('#testNMJ-result').html(data); + $('#testNMJ').prop('disabled', false); + }); + }); $('#settingsNMJv2').click(function() { - if (!$('#nmjv2_host').val()) { - alert('Please fill in the Popcorn IP address'); - $('#nmjv2_host').focus(); - return; - } - $('#testNMJv2-result').html(loading); - var nmjv2_host = $('#nmjv2_host').val(); + if (!$('#nmjv2_host').val()) { + alert('Please fill in the Popcorn IP address'); + $('#nmjv2_host').focus(); + return; + } + $('#testNMJv2-result').html(loading); + var nmjv2_host = $('#nmjv2_host').val(); var nmjv2_dbloc; var radios = document.getElementsByName('nmjv2_dbloc'); for (var i = 0; i < radios.length; i++) { @@ -235,46 +219,46 @@ $(document).ready(function(){ } } - var nmjv2_dbinstance=$('#NMJv2db_instance').val(); - $.get(sbRoot + '/home/settingsNMJv2', {'host': nmjv2_host,'dbloc': nmjv2_dbloc,'instance': nmjv2_dbinstance}, - function (data){ - if (data == null) { - $('#nmjv2_database').removeAttr('readonly'); - } - var JSONData = $.parseJSON(data); - $('#testNMJv2-result').html(JSONData.message); - $('#nmjv2_database').val(JSONData.database); - - if (JSONData.database) - $('#nmjv2_database').attr('readonly', true); - else - $('#nmjv2_database').removeAttr('readonly'); - }); - }); + var nmjv2_dbinstance=$('#NMJv2db_instance').val(); + $.get(sbRoot + '/home/settingsNMJv2', {'host': nmjv2_host,'dbloc': nmjv2_dbloc,'instance': nmjv2_dbinstance}, + function (data){ + if (data == null) { + $('#nmjv2_database').removeAttr('readonly'); + } + var JSONData = $.parseJSON(data); + $('#testNMJv2-result').html(JSONData.message); + $('#nmjv2_database').val(JSONData.database); + + if (JSONData.database) + $('#nmjv2_database').attr('readonly', true); + else + $('#nmjv2_database').removeAttr('readonly'); + }); + }); - $('#testNMJv2').click(function () { - var nmjv2_host = $.trim($('#nmjv2_host').val()); - if (!nmjv2_host) { - $('#testNMJv2-result').html('Please fill out the necessary fields above.'); + $('#testNMJv2').click(function () { + var nmjv2_host = $.trim($('#nmjv2_host').val()); + if (!nmjv2_host) { + $('#testNMJv2-result').html('Please fill out the necessary fields above.'); $('#nmjv2_host').addClass('warning'); - return; - } + return; + } $('#nmjv2_host').removeClass('warning'); - $(this).prop('disabled', true); - $('#testNMJv2-result').html(loading); - $.get(sbRoot + '/home/testNMJv2', {'host': nmjv2_host}) - .done(function (data) { - $('#testNMJv2-result').html(data); - $('#testNMJv2').prop('disabled', false); - }); - }); - - $('#testTrakt').click(function () { - var trakt_api = $.trim($('#trakt_api').val()); - var trakt_username = $.trim($('#trakt_username').val()); - var trakt_password = $.trim($('#trakt_password').val()); - if (!trakt_api || !trakt_username || !trakt_password) { - $('#testTrakt-result').html('Please fill out the necessary fields above.'); + $(this).prop('disabled', true); + $('#testNMJv2-result').html(loading); + $.get(sbRoot + '/home/testNMJv2', {'host': nmjv2_host}) + .done(function (data) { + $('#testNMJv2-result').html(data); + $('#testNMJv2').prop('disabled', false); + }); + }); + + $('#testTrakt').click(function () { + var trakt_api = $.trim($('#trakt_api').val()); + var trakt_username = $.trim($('#trakt_username').val()); + var trakt_password = $.trim($('#trakt_password').val()); + if (!trakt_api || !trakt_username || !trakt_password) { + $('#testTrakt-result').html('Please fill out the necessary fields above.'); if (!trakt_api) { $('#trakt_api').addClass('warning'); } else { @@ -290,189 +274,189 @@ $(document).ready(function(){ } else { $('#trakt_password').removeClass('warning'); } - return; - } + return; + } $('#trakt_api,#trakt_username,#trakt_password').removeClass('warning'); - $(this).prop('disabled', true); - $('#testTrakt-result').html(loading); - $.get(sbRoot + '/home/testTrakt', {'api': trakt_api, 'username': trakt_username, 'password': trakt_password}) - .done(function (data) { - $('#testTrakt-result').html(data); - $('#testTrakt').prop('disabled', false); - }); - }); - - $('#testEmail').click(function () { - var status, host, port, tls, from, user, pwd, err, to; - status = $('#testEmail-result'); - status.html(loading); - host = $('#email_host').val(); - host = host.length > 0 ? host : null; - port = $('#email_port').val(); - port = port.length > 0 ? port : null; - tls = $('#email_tls').attr('checked') !== undefined ? 1 : 0; - from = $('#email_from').val(); - from = from.length > 0 ? from : 'root@localhost'; - user = $('#email_user').val().trim(); - pwd = $('#email_password').val(); - err = ''; - if (host === null) { - err += '
  • You must specify an SMTP hostname!
  • '; - } - if (port === null) { - err += '
  • You must specify an SMTP port!
  • '; - } else if (port.match(/^\d+$/) === null || parseInt(port, 10) > 65535) { - err += '
  • SMTP port must be between 0 and 65535!
  • '; - } - if (err.length > 0) { - err = '
      ' + err + '
    '; - status.html(err); - } else { - to = prompt('Enter an email address to send the test to:', null); - if (to === null || to.length === 0 || to.match(/.*@.*/) === null) { - status.html('

    You must provide a recipient email address!

    '); - } else { - $.get(sbRoot + '/home/testEmail', {host: host, port: port, smtp_from: from, use_tls: tls, user: user, pwd: pwd, to: to}, - function (msg) { $('#testEmail-result').html(msg); }); - } - } - }); - - $('#testNMA').click(function () { - var nma_api = $.trim($('#nma_api').val()); - var nma_priority = $('#nma_priority').val(); - if (!nma_api) { - $('#testNMA-result').html('Please fill out the necessary fields above.'); - $('#nma_api').addClass('warning'); - return; - } - $('#nma_api').removeClass('warning'); - $(this).prop('disabled', true); - $('#testNMA-result').html(loading); - $.get(sbRoot + '/home/testNMA', {'nma_api': nma_api, 'nma_priority': nma_priority}) - .done(function (data) { - $('#testNMA-result').html(data); - $('#testNMA').prop('disabled', false); - }); - }); - - $('#testPushalot').click(function () { - var pushalot_authorizationtoken = $.trim($('#pushalot_authorizationtoken').val()); - if (!pushalot_authorizationtoken) { - $('#testPushalot-result').html('Please fill out the necessary fields above.'); - $('#pushalot_authorizationtoken').addClass('warning'); - return; - } - $('#pushalot_authorizationtoken').removeClass('warning'); - $(this).prop('disabled', true); - $('#testPushalot-result').html(loading); - $.get(sbRoot + '/home/testPushalot', {'authorizationToken': pushalot_authorizationtoken}) - .done(function (data) { - $('#testPushalot-result').html(data); - $('#testPushalot').prop('disabled', false); - }); - }); - - $('#testPushbullet').click(function () { - var pushbullet_api = $.trim($('#pushbullet_api').val()); - if (!pushbullet_api) { - $('#testPushbullet-result').html('Please fill out the necessary fields above.'); - $('#pushbullet_api').addClass('warning'); - return; - } - $('#pushbullet_api').removeClass('warning'); - $(this).prop('disabled', true); - $('#testPushbullet-result').html(loading); - $.get(sbRoot + '/home/testPushbullet', {'api': pushbullet_api}) - .done(function (data) { - $('#testPushbullet-result').html(data); - $('#testPushbullet').prop('disabled', false); - }); - }); - - function get_pushbullet_devices(msg){ - - if(msg){ - $('#testPushbullet-result').html(loading); - } - - var pushbullet_api = $("#pushbullet_api").val(); - - if(!pushbullet_api) { - $('#testPushbullet-result').html("You didn't supply a Pushbullet api key"); - $("#pushbullet_api").focus(); - return false; - } - - var current_pushbullet_device = $("#pushbullet_device").val(); - $.get(sbRoot + "/home/getPushbulletDevices", {'api': pushbullet_api}, - function (data) { - var devices = jQuery.parseJSON(data).devices; - $("#pushbullet_device_list").html(''); - for (var i = 0; i < devices.length; i++) { - if(devices[i].active == true) { - if(current_pushbullet_device == devices[i].iden) { - $("#pushbullet_device_list").append('') - } else { - $("#pushbullet_device_list").append('') - } - } - } - if(msg) { - $('#testPushbullet-result').html(msg); - } - } - ); - - $("#pushbullet_device_list").change(function(){ - $("#pushbullet_device").val($("#pushbullet_device_list").val()); - $('#testPushbullet-result').html("Don't forget to save your new pushbullet settings."); - }); - }; - - $('#getPushbulletDevices').click(function(){ - get_pushbullet_devices("Device list updated. Please choose a device to push to."); - }); - - // we have to call this function on dom ready to create the devices select - get_pushbullet_devices(); - - $('#email_show').change(function () { - var key = parseInt($('#email_show').val(), 10); - $('#email_show_list').val(key >= 0 ? notify_data[key.toString()].list : ''); + $(this).prop('disabled', true); + $('#testTrakt-result').html(loading); + $.get(sbRoot + '/home/testTrakt', {'api': trakt_api, 'username': trakt_username, 'password': trakt_password}) + .done(function (data) { + $('#testTrakt-result').html(data); + $('#testTrakt').prop('disabled', false); + }); }); - // Update the internal data struct anytime settings are saved to the server - $('#email_show').bind('notify', function () { load_show_notify_lists(); }); + $('#testEmail').click(function () { + var status, host, port, tls, from, user, pwd, err, to; + status = $('#testEmail-result'); + status.html(loading); + host = $('#email_host').val(); + host = host.length > 0 ? host : null; + port = $('#email_port').val(); + port = port.length > 0 ? port : null; + tls = $('#email_tls').attr('checked') !== undefined ? 1 : 0; + from = $('#email_from').val(); + from = from.length > 0 ? from : 'root@localhost'; + user = $('#email_user').val().trim(); + pwd = $('#email_password').val(); + err = ''; + if (host === null) { + err += '
  • You must specify an SMTP hostname!
  • '; + } + if (port === null) { + err += '
  • You must specify an SMTP port!
  • '; + } else if (port.match(/^\d+$/) === null || parseInt(port, 10) > 65535) { + err += '
  • SMTP port must be between 0 and 65535!
  • '; + } + if (err.length > 0) { + err = '
      ' + err + '
    '; + status.html(err); + } else { + to = prompt('Enter an email address to send the test to:', null); + if (to === null || to.length === 0 || to.match(/.*@.*/) === null) { + status.html('

    You must provide a recipient email address!

    '); + } else { + $.get(sbRoot + '/home/testEmail', {host: host, port: port, smtp_from: from, use_tls: tls, user: user, pwd: pwd, to: to}, + function (msg) { $('#testEmail-result').html(msg); }); + } + } + }); - function load_show_notify_lists() { - $.get(sbRoot + "/home/loadShowNotifyLists", function (data) { - var list, html, s; - list = $.parseJSON(data); - notify_data = list; - if (list._size === 0) { - return; - } - html = ''; - for (s in list) { - if (s.charAt(0) !== '_') { - html += '