Remove deprecated and redundant qTip2 attributes and CSS.

Fix restore scene exceptions tip over title on displayShow page.
Change ajax for a deferred ajax call used for plots tips and scene exception tips.
Tweak some tip positions and cleanup calls to be more uniform.
This commit is contained in:
JackDandy 2014-12-11 12:55:42 +00:00
parent e724f67321
commit 31946c96b3
6 changed files with 75 additions and 88 deletions

View file

@ -42,7 +42,7 @@
$(this).qtip({ $(this).qtip({
show: {solo:true}, show: {solo:true},
position: {viewport:$(window), my:'left center', adjust:{ y: -10, x: 2 }}, position: {viewport:$(window), my:'left center', adjust:{ y: -10, x: 2 }},
style: {tip:{corner:true, method:'polygon'}, classes:'qtip-rounded qtip-shadow ui-tooltip-sb'} style: {classes:'qtip-rounded qtip-shadow'}
}); });
}); });
#end raw #end raw

View file

@ -17,7 +17,7 @@ $(document).ready(function () {
} else { } else {
$('#unpack').qtip('option', { $('#unpack').qtip('option', {
'content.text': 'Unrar Executable not found.', 'content.text': 'Unrar Executable not found.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#unpack').qtip('toggle', true); $('#unpack').qtip('toggle', true);
$('#unpack').css('background-color', '#FFFFDD'); $('#unpack').css('background-color', '#FFFFDD');
@ -56,21 +56,21 @@ $(document).ready(function () {
if (data == "invalid") { if (data == "invalid") {
$('#naming_pattern').qtip('option', { $('#naming_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_pattern').qtip('toggle', true); $('#naming_pattern').qtip('toggle', true);
$('#naming_pattern').css('background-color', '#FFDDDD'); $('#naming_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_pattern').qtip('option', { $('#naming_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_pattern').qtip('toggle', true); $('#naming_pattern').qtip('toggle', true);
$('#naming_pattern').css('background-color', '#FFFFDD'); $('#naming_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_pattern').qtip('option', { $('#naming_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_pattern').qtip('toggle', false); $('#naming_pattern').qtip('toggle', false);
$('#naming_pattern').css('background-color', '#FFFFFF'); $('#naming_pattern').css('background-color', '#FFFFFF');
@ -97,21 +97,21 @@ $(document).ready(function () {
if (data == "invalid") { if (data == "invalid") {
$('#naming_abd_pattern').qtip('option', { $('#naming_abd_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_abd_pattern').qtip('toggle', true); $('#naming_abd_pattern').qtip('toggle', true);
$('#naming_abd_pattern').css('background-color', '#FFDDDD'); $('#naming_abd_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_abd_pattern').qtip('option', { $('#naming_abd_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_abd_pattern').qtip('toggle', true); $('#naming_abd_pattern').qtip('toggle', true);
$('#naming_abd_pattern').css('background-color', '#FFFFDD'); $('#naming_abd_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_abd_pattern').qtip('option', { $('#naming_abd_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_abd_pattern').qtip('toggle', false); $('#naming_abd_pattern').qtip('toggle', false);
$('#naming_abd_pattern').css('background-color', '#FFFFFF'); $('#naming_abd_pattern').css('background-color', '#FFFFFF');
@ -138,21 +138,21 @@ $(document).ready(function () {
if (data == "invalid") { if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFDDDD'); $('#naming_sports_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFFFDD'); $('#naming_sports_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', false); $('#naming_sports_pattern').qtip('toggle', false);
$('#naming_sports_pattern').css('background-color', '#FFFFFF'); $('#naming_sports_pattern').css('background-color', '#FFFFFF');
@ -179,21 +179,21 @@ $(document).ready(function () {
if (data == "invalid") { if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFDDDD'); $('#naming_sports_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', true); $('#naming_sports_pattern').qtip('toggle', true);
$('#naming_sports_pattern').css('background-color', '#FFFFDD'); $('#naming_sports_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_sports_pattern').qtip('option', { $('#naming_sports_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_sports_pattern').qtip('toggle', false); $('#naming_sports_pattern').qtip('toggle', false);
$('#naming_sports_pattern').css('background-color', '#FFFFFF'); $('#naming_sports_pattern').css('background-color', '#FFFFFF');
@ -232,21 +232,21 @@ $(document).ready(function () {
if (data == "invalid") { if (data == "invalid") {
$('#naming_anime_pattern').qtip('option', { $('#naming_anime_pattern').qtip('option', {
'content.text': 'This pattern is invalid.', 'content.text': 'This pattern is invalid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_anime_pattern').qtip('toggle', true); $('#naming_anime_pattern').qtip('toggle', true);
$('#naming_anime_pattern').css('background-color', '#FFDDDD'); $('#naming_anime_pattern').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") { } else if (data == "seasonfolders") {
$('#naming_anime_pattern').qtip('option', { $('#naming_anime_pattern').qtip('option', {
'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.', 'content.text': 'This pattern would be invalid without the folders, using it will force "Flatten" off for all shows.',
'style.classes': 'qtip-rounded qtip-shadow qtip-red' 'style.classes': 'qtip-red qtip-rounded qtip-shadow'
}); });
$('#naming_anime_pattern').qtip('toggle', true); $('#naming_anime_pattern').qtip('toggle', true);
$('#naming_anime_pattern').css('background-color', '#FFFFDD'); $('#naming_anime_pattern').css('background-color', '#FFFFDD');
} else { } else {
$('#naming_anime_pattern').qtip('option', { $('#naming_anime_pattern').qtip('option', {
'content.text': 'This pattern is valid.', 'content.text': 'This pattern is valid.',
'style.classes': 'qtip-rounded qtip-shadow qtip-green' 'style.classes': 'qtip-green qtip-rounded qtip-shadow'
}); });
$('#naming_anime_pattern').qtip('toggle', false); $('#naming_anime_pattern').qtip('toggle', false);
$('#naming_anime_pattern').css('background-color', '#FFFFFF'); $('#naming_anime_pattern').css('background-color', '#FFFFFF');
@ -485,35 +485,27 @@ $(document).ready(function () {
} }
$(this).refreshMetadataConfig(true); $(this).refreshMetadataConfig(true);
$('img[title]').qtip( { $('img[title]').qtip({
position: { position: {
viewport: $(window), viewport: $(window),
at: 'bottom center', my: 'top right',
my: 'top right' at: 'bottom center'
}, },
style: { style: {
tip: { classes: 'qtip-dark qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-shadow qtip-dark'
} }
}); });
$('i[title]').qtip( { $('i[title]').qtip({
position: { position: {
viewport: $(window), viewport: $(window),
at: 'top center', my: 'bottom center',
my: 'bottom center' at: 'top center'
}, },
style: { style: {
tip: { classes: 'qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'
} }
}); });
$('.custom-pattern,#unpack').qtip( { $('.custom-pattern,#unpack').qtip({
content: 'validating...', content: 'validating...',
show: { show: {
event: false, event: false,
@ -522,15 +514,11 @@ $(document).ready(function () {
hide: false, hide: false,
position: { position: {
viewport: $(window), viewport: $(window),
at: 'center left', my: 'right center',
my: 'center right' at: 'left center'
}, },
style: { style: {
tip: { classes: 'qtip-red qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow qtip-red'
} }
}); });

View file

@ -54,11 +54,7 @@
} }
}, },
style: { style: {
tip: { classes: 'qtip-dark qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-dark qtip-shadow ui-tooltip-sb'
} }
}); });
}); });

View file

@ -1,20 +1,27 @@
$(function () { $(function () {
$('.plotInfo').each(function () { $('.plotInfo').each(function () {
match = $(this).attr("id").match(/^plot_info_(\d+)_(\d+)_(\d+)$/); var match = $(this).attr('id').match(/^plot_info_(\d+)_(\d+)_(\d+)$/);
$(this).qtip({ $(this).qtip({
content: { content: {
text: 'Loading...', text: function(event, api) {
ajax: { // deferred object ensuring the request is only made once
url: $("#sbRoot").val() + '/home/plotDetails', $.ajax({
url: $('#sbRoot').val() + '/home/plotDetails',
type: 'GET', type: 'GET',
data: { data: {
show: match[1], show: match[1],
episode: match[3], episode: match[3],
season: match[2] season: match[2]
},
success: function (data, status) {
this.set('content.text', data);
} }
})
.then(function(content) {
// Set the tooltip content upon successful retrieval
api.set('content.text', content);
}, function(xhr, status, error) {
// Upon failure... set the tooltip content to the status and error value
api.set('content.text', status + ': ' + error);
});
return 'Loading...'; // Set initial text
} }
}, },
show: { show: {
@ -29,11 +36,7 @@ $(function () {
} }
}, },
style: { style: {
tip: { classes: 'qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'
} }
}); });
}); });

View file

@ -15,15 +15,11 @@ $(function () {
at: 'center left', at: 'center left',
adjust: { adjust: {
y: 0, y: 0,
x: -6 x: -2
} }
}, },
style: { style: {
tip: { classes: 'qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'
} }
}); });
}); });

View file

@ -1,17 +1,25 @@
$(function () { $(function () {
$('.title span').each(function () { $('.title span').each(function () {
var match = $(this).parent().attr('id').match(/^scene_exception_(\d+)$/);
$(this).qtip({ $(this).qtip({
content: { content: {
text: 'Loading...', text: function(event, api) {
ajax: { // deferred object ensuring the request is only made once
url: $("#sbRoot").val() + '/home/sceneExceptions', $.ajax({
url: $('#sbRoot').val() + '/home/sceneExceptions',
type: 'GET', type: 'GET',
data: { data: {
show: match[1] show: match[1]
},
success: function (data, status) {
this.set('content.text', data);
} }
})
.then(function(content) {
// Set the tooltip content upon successful retrieval
api.set('content.text', content);
}, function(xhr, status, error) {
// Upon failure... set the tooltip content to the status and error value
api.set('content.text', status + ': ' + error);
});
return 'Loading...'; // Set initial text
} }
}, },
show: { show: {
@ -19,19 +27,15 @@ $(function () {
}, },
position: { position: {
viewport: $(window), viewport: $(window),
my: 'left middle', my: 'left center',
at: 'right middle', at: 'right center',
adjust: { adjust: {
y: 0, y: 0,
x: 10 x: 2
} }
}, },
style: { style: {
tip: { classes: 'qtip-rounded qtip-shadow'
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'
} }
}); });
}); });