1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2024-12-30 19:56:54 +00:00
Sonarr/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js
Mark McDowall f643c5e3fb Font-Awesomed Series/Details
New: Replaced icons with Font-Awesome SVG icons
2012-10-10 19:02:17 -07:00

84 lines
No EOL
2.1 KiB
JavaScript

$(document).ready(function () {
//All forms are ajax forms
$("form").livequery(function () {
var options = {
type: 'post',
resetForm: false
};
$(this).ajaxForm(options);
});
$('Form button').livequery(function () {
$(this).removeAttr('disabled');
});
//All buttons are jQueryUI buttons
$('button, input[type="button"], input[type="submit"], input[type="reset"]').livequery(function () {
$(this).button();
});
$('.jquery-accordion').livequery(function () {
$(this).accordion({
autoHeight: false,
collapsible: true
});
if ($(this).hasClass('jquery-accordion-collapse-all'))
$(this).accordion("activate", false);
});
$('.jquery-tabs').livequery(function () {
$(this).show();
$(this).tabs({
fx: { opacity: 'toggle' },
select: function (event, ui) {
jQuery(this).css('height', jQuery(this).height());
jQuery(this).css('overflow', 'hidden');
},
show: function (event, ui) {
jQuery(this).css('height', 'auto');
jQuery(this).css('overflow', 'visible');
}
});
});
$('.jQuery-datepicker').livequery(function () {
$(this).datepicker({
dateFormat: "yy-mm-dd"
});
});
$('[data-status]').livequery(function () {
var status = $(this).attr('data-status');
$(this).removeClass(function (index, css) {
return (css.match(/\bicon-\S+/g) || []).join(' ');
});
if (status == 'Downloading') {
$(this).addClass('icon-download-alt');
}
if (status == 'Ready') {
$(this).addClass('icon-play');
}
if (status == 'AirsToday') {
$(this).addClass('icon-time');
}
if (status == 'NotAired') {
$(this).addClass('icon-calendar');
}
if (status == 'Missing') {
$(this).addClass('icon-sign-blank');
}
});
});