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({
show: {solo:true},
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

View file

@ -17,7 +17,7 @@ $(document).ready(function () {
} else {
$('#unpack').qtip('option', {
'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').css('background-color', '#FFFFDD');
@ -56,21 +56,21 @@ $(document).ready(function () {
if (data == "invalid") {
$('#naming_pattern').qtip('option', {
'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').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_pattern').qtip('option', {
'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').css('background-color', '#FFFFDD');
} else {
$('#naming_pattern').qtip('option', {
'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').css('background-color', '#FFFFFF');
@ -97,21 +97,21 @@ $(document).ready(function () {
if (data == "invalid") {
$('#naming_abd_pattern').qtip('option', {
'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').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_abd_pattern').qtip('option', {
'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').css('background-color', '#FFFFDD');
} else {
$('#naming_abd_pattern').qtip('option', {
'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').css('background-color', '#FFFFFF');
@ -138,21 +138,21 @@ $(document).ready(function () {
if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', {
'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').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', {
'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').css('background-color', '#FFFFDD');
} else {
$('#naming_sports_pattern').qtip('option', {
'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').css('background-color', '#FFFFFF');
@ -179,21 +179,21 @@ $(document).ready(function () {
if (data == "invalid") {
$('#naming_sports_pattern').qtip('option', {
'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').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_sports_pattern').qtip('option', {
'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').css('background-color', '#FFFFDD');
} else {
$('#naming_sports_pattern').qtip('option', {
'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').css('background-color', '#FFFFFF');
@ -232,21 +232,21 @@ $(document).ready(function () {
if (data == "invalid") {
$('#naming_anime_pattern').qtip('option', {
'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').css('background-color', '#FFDDDD');
} else if (data == "seasonfolders") {
$('#naming_anime_pattern').qtip('option', {
'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').css('background-color', '#FFFFDD');
} else {
$('#naming_anime_pattern').qtip('option', {
'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').css('background-color', '#FFFFFF');
@ -485,35 +485,27 @@ $(document).ready(function () {
}
$(this).refreshMetadataConfig(true);
$('img[title]').qtip( {
$('img[title]').qtip({
position: {
viewport: $(window),
at: 'bottom center',
my: 'top right'
my: 'top right',
at: 'bottom center'
},
style: {
tip: {
corner: true,
method: 'polygon'
},
classes: 'qtip-shadow qtip-dark'
classes: 'qtip-dark qtip-rounded qtip-shadow'
}
});
$('i[title]').qtip( {
$('i[title]').qtip({
position: {
viewport: $(window),
at: 'top center',
my: 'bottom center'
my: 'bottom center',
at: 'top center'
},
style: {
tip: {
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'
classes: 'qtip-rounded qtip-shadow'
}
});
$('.custom-pattern,#unpack').qtip( {
$('.custom-pattern,#unpack').qtip({
content: 'validating...',
show: {
event: false,
@ -522,15 +514,11 @@ $(document).ready(function () {
hide: false,
position: {
viewport: $(window),
at: 'center left',
my: 'center right'
my: 'right center',
at: 'left center'
},
style: {
tip: {
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow qtip-red'
classes: 'qtip-red qtip-rounded qtip-shadow'
}
});

View file

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

View file

@ -1,20 +1,27 @@
$(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({
content: {
text: 'Loading...',
ajax: {
url: $("#sbRoot").val() + '/home/plotDetails',
type: 'GET',
data: {
show: match[1],
episode: match[3],
season: match[2]
},
success: function (data, status) {
this.set('content.text', data);
}
text: function(event, api) {
// deferred object ensuring the request is only made once
$.ajax({
url: $('#sbRoot').val() + '/home/plotDetails',
type: 'GET',
data: {
show: match[1],
episode: match[3],
season: match[2]
}
})
.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: {
@ -29,11 +36,7 @@ $(function () {
}
},
style: {
tip: {
corner: true,
method: 'polygon'
},
classes: 'qtip-rounded qtip-shadow ui-tooltip-sb'
classes: 'qtip-rounded qtip-shadow'
}
});
});

View file

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

View file

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