Twatter has been added, Notifications cannot be saved (yet), nor will they send, but the framework for a user to setup Twitter (Authorize NzbDrone) is in place.
parent
f5b5aea62d
commit
a2735d7716
@ -0,0 +1,76 @@
|
||||
@using NzbDrone.Web.Helpers
|
||||
@model NzbDrone.Web.Models.NotificationSettingsModel
|
||||
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<div id="twitter" class="notifier clearfix">
|
||||
<label class="labelClass">@Html.LabelFor(m => m.TwitterEnabled)
|
||||
<span class="small">@Html.DescriptionFor(m => m.TwitterEnabled)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.TwitterEnabled, new { @class = "inputClass checkClass" })
|
||||
|
||||
<label class="labelClass">@Html.LabelFor(m => m.TwitterNotifyOnGrab)
|
||||
<span class="small">@Html.DescriptionFor(m => m.TwitterNotifyOnGrab)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.TwitterNotifyOnGrab, new { @class = "inputClass checkClass" })
|
||||
|
||||
<label class="labelClass">@Html.LabelFor(m => m.TwitterNotifyOnDownload)
|
||||
<span class="small">@Html.DescriptionFor(m => m.TwitterNotifyOnDownload)</span>
|
||||
</label>
|
||||
@Html.CheckBoxFor(m => m.TwitterNotifyOnDownload, new { @class = "inputClass checkClass" })
|
||||
|
||||
<label class="labelClass">Request Authorization
|
||||
<span class="small">Begin Twitter authorization for NzbDrone</span>
|
||||
</label>
|
||||
<input type="button" onclick="requestTwitterAuthorization();" value="Requestion Authorization" class="inputClass"/>
|
||||
|
||||
<label class="labelClass">Verification PIN
|
||||
<span class="small">PIN from Twitter to provide authorization to NzbDrone</span>
|
||||
</label>
|
||||
@Html.TextBox("twitterVerification", "", new { @class = "inputClass" })
|
||||
|
||||
<label class="labelClass">Verify & Test Authorization
|
||||
<span class="small">Verify & Test Twitter authorization for NzbDrone (Send a test tweet)</span>
|
||||
</label>
|
||||
<input type="button" onclick="verifyTwitterAuthorization();" value="Test Authorization" class="inputClass"/>
|
||||
|
||||
@Html.Hidden("authorizationRequestToken")
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
getAuthorizationUrl = '../Command/GetTwitterAuthorization';
|
||||
verifyAuthorizationUrl = '../Command/VerifyTwitterAuthorization';
|
||||
|
||||
function requestTwitterAuthorization() {
|
||||
$.ajax({
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function verifyTwitterAuthorization() {
|
||||
var token = $('#authorizationRequestToken').val();
|
||||
var verifier = $('#twitterVerification').val();
|
||||
|
||||
$.ajax({
|
||||
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);
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2010, Patrick "Ricky" Smith
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in
|
||||
the documentation and/or other materials provided with the distribution.
|
||||
|
||||
- Neither the name Twitterizer nor the names of its contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
Binary file not shown.
Binary file not shown.
Loading…
Reference in new issue