2011-12-01 05:04:44 +00:00
|
|
|
@model NzbDrone.Web.Models.NotificationSettingsModel
|
|
|
|
@{ Layout = "~/Views/Shared/_RefrenceLayout.cshtml"; }
|
2011-07-01 20:33:03 +00:00
|
|
|
@section HeaderContent{
|
2011-11-11 19:24:51 +00:00
|
|
|
<link rel="stylesheet" type="text/css" href="../../Content/Settings.css" />
|
2011-07-01 20:33:03 +00:00
|
|
|
<style>
|
|
|
|
.notifier
|
|
|
|
{
|
2011-11-26 20:34:28 +00:00
|
|
|
overflow: auto;
|
2011-07-01 20:33:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
.notifier h4
|
|
|
|
{
|
|
|
|
font-weight: bold;
|
|
|
|
margin-bottom: 0px;
|
|
|
|
padding-left: 5px;
|
|
|
|
padding-top: 3px;
|
|
|
|
}
|
|
|
|
|
2011-11-30 00:45:45 +00:00
|
|
|
#save_button
|
2011-07-01 20:33:03 +00:00
|
|
|
{
|
2011-11-30 00:45:45 +00:00
|
|
|
margin-top: 10px;
|
2011-07-01 20:33:03 +00:00
|
|
|
}
|
2011-12-01 05:04:44 +00:00
|
|
|
|
2011-11-30 00:45:45 +00:00
|
|
|
#smtpTest
|
2011-10-27 05:46:54 +00:00
|
|
|
{
|
|
|
|
margin-top: 10px;
|
2011-11-30 00:45:45 +00:00
|
|
|
margin-bottom: 10px;
|
|
|
|
margin-left: 220px;
|
2011-10-27 05:46:54 +00:00
|
|
|
}
|
2011-07-01 20:33:03 +00:00
|
|
|
</style>
|
2011-04-21 01:43:09 +00:00
|
|
|
}
|
2011-12-01 05:04:44 +00:00
|
|
|
<div id="stylized">
|
|
|
|
@using (Html.BeginForm("SaveNotifications", "Settings", FormMethod.Post, new { id = "form", name = "form", @class = "settingsForm" }))
|
|
|
|
{
|
|
|
|
<div id="accordion2">
|
|
|
|
<h3>
|
|
|
|
<a href="#">XBMC</a></h3>
|
|
|
|
@{Html.RenderPartial("Xbmc", Model);}
|
|
|
|
<h3>
|
|
|
|
<a href="#">SMTP</a></h3>
|
|
|
|
@{Html.RenderPartial("Smtp", Model);}
|
|
|
|
<h3>
|
|
|
|
<a href="#">Twitter</a></h3>
|
|
|
|
@{Html.RenderPartial("Twitter", Model);}
|
|
|
|
<h3>
|
|
|
|
<a href="#">Growl</a></h3>
|
|
|
|
@{Html.RenderPartial("Growl", Model);}
|
|
|
|
<h3>
|
|
|
|
<a href="#">Prowl</a></h3>
|
|
|
|
@{Html.RenderPartial("Prowl", Model);}
|
|
|
|
</div>
|
2011-07-01 20:33:03 +00:00
|
|
|
|
2011-12-01 05:04:44 +00:00
|
|
|
<button type="submit" id="save_button" disabled="disabled">
|
|
|
|
Save</button>
|
|
|
|
}
|
|
|
|
</div>
|
2011-07-01 20:33:03 +00:00
|
|
|
@section Scripts{
|
2011-11-11 02:56:33 +00:00
|
|
|
<script src="../../Scripts/NzbDrone/settingsForm.js" type="text/javascript"></script>
|
2011-11-26 04:02:29 +00:00
|
|
|
<script type="text/javascript">
|
2011-10-27 05:46:54 +00:00
|
|
|
$(function () {
|
2011-12-01 05:04:44 +00:00
|
|
|
$("#accordion2").accordion({
|
2011-11-30 00:45:45 +00:00
|
|
|
autoHeight: false
|
|
|
|
});
|
2011-10-27 05:46:54 +00:00
|
|
|
});
|
2011-12-01 05:04:44 +00:00
|
|
|
|
2011-11-30 00:45:45 +00:00
|
|
|
//Twitter
|
|
|
|
getAuthorizationUrl = '../Command/GetTwitterAuthorization';
|
|
|
|
verifyAuthorizationUrl = '../Command/VerifyTwitterAuthorization';
|
|
|
|
|
|
|
|
function requestTwitterAuthorization() {
|
|
|
|
$.ajax({
|
2011-12-01 05:04:44 +00:00
|
|
|
type: "GET",
|
|
|
|
url: getAuthorizationUrl,
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could get Twitter Authorization at this time. " + error);
|
|
|
|
},
|
|
|
|
success: function (data, textStatus, jqXHR) {
|
|
|
|
if (data.IsMessage)
|
|
|
|
return false;
|
|
|
|
|
|
|
|
$('#authorizationRequestToken').val(data.Token);
|
|
|
|
window.open(data.Url);
|
|
|
|
}
|
|
|
|
});
|
2011-11-30 00:45:45 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function verifyTwitterAuthorization() {
|
|
|
|
var token = $('#authorizationRequestToken').val();
|
|
|
|
var verifier = $('#twitterVerification').val();
|
|
|
|
|
|
|
|
$.ajax({
|
2011-12-01 05:04:44 +00:00
|
|
|
type: "GET",
|
|
|
|
url: verifyAuthorizationUrl,
|
|
|
|
data: jQuery.param({ token: token, verifier: verifier }),
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could verify Twitter Authorization at this time. " + error);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2011-11-30 00:45:45 +00:00
|
|
|
|
2011-12-01 05:04:44 +00:00
|
|
|
//SMTP
|
|
|
|
function testSmtpSettings() {
|
|
|
|
//Get the variables
|
|
|
|
var server = $('#SmtpServer').val();
|
|
|
|
var port = $('#SmtpPort').val();
|
|
|
|
var ssl = $('#SmtpUseSsl').val();
|
|
|
|
var username = $('#SmtpUsername').val();
|
|
|
|
var password = $('#SmtpPassword').val();
|
|
|
|
var fromAddress = $('#SmtpFromAddress').val();
|
|
|
|
var toAddresses = $('#SmtpToAddresses').val();
|
|
|
|
|
|
|
|
//Send the data!
|
|
|
|
$.ajax({
|
|
|
|
type: "POST",
|
|
|
|
url: '../Command/SendTestEmail',
|
|
|
|
data: jQuery.param({
|
|
|
|
server: server,
|
|
|
|
port: port,
|
|
|
|
ssl: ssl,
|
|
|
|
username: username,
|
|
|
|
password: password,
|
|
|
|
fromAddress: fromAddress,
|
|
|
|
toAddresses: toAddresses
|
|
|
|
}),
|
|
|
|
error: function (req, status, error) {
|
|
|
|
alert("Sorry! We could send a test email at this time. " + error);
|
|
|
|
}
|
|
|
|
});
|
2011-11-30 00:45:45 +00:00
|
|
|
|
2011-12-01 05:04:44 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
</script>
|
2011-06-28 02:24:42 +00:00
|
|
|
}
|