Overhaul all Add Show pages.

This commit is contained in:
JackDandy 2014-11-20 22:25:33 +00:00 committed by JackDandy
parent c7966313b2
commit c8c1a07f85
19 changed files with 1228 additions and 1308 deletions

View file

@ -22,6 +22,7 @@
* Fix visual positioning of sprites on Config page
* Fix missing navbar gradients for all browsers
* Update qTip2 to v2.2.1
* Overhaul all Add Show pages
[develop changelog]
* Add TVRage network name standardization

View file

@ -773,122 +773,38 @@ td.tvShow a:hover {
/* =======================================================================
home_addShows.tmpl
========================================================================== */
#addShowPortal {
width: 700px;
padding: 10px 0;
margin-right: auto;
margin-left: auto;
}
#addShowPortal a {
padding: 10px;
}
div.button {
display: table-cell;
vertical-align: middle;
padding-left: 10px;
}
div.buttontext {
display: table-cell;
padding-left: 20px;
text-align: left;
white-space: normal;
}
div.buttontext h3 {
margin-top: 10px;
}
div.buttontext p {
font-size: 13px;
}
.icon-addnewshow {
background-image: url("../images/addshows/add-new32-white.png");
width: 32px;
height: 32px;
}
.icon-addtrendingshow {
background-image: url("../images/addshows/add-trending32-white.png");
width: 32px;
height: 32px;
}
.icon-addrecommendedshow {
background-image: url("../images/addshows/add-trakt32-white.png");
width: 32px;
height: 32px;
}
.icon-addexistingshow {
background-image: url("../images/addshows/add-existing32-white.png");
width: 32px;
height: 32px;
}
/* =======================================================================
home_newShow.tmpl
========================================================================== */
#addShowForm, #recommendedShowsForm {
margin-left: auto;
margin-right: auto;
}
#newShowPortal {
width: 800px;
padding: 10px 0;
margin-right: auto;
margin-left: auto;
}
#displayText {
padding: 8px;
overflow: hidden;
font-size: 14px;
background-color: #3d3d3d;
border: 1px solid #111;
}
#searchResults input[type="radio"] {
vertical-align: -2px;
background-color: rgb(17, 120, 179);
border: 0;
}
/* =======================================================================
home_addExistingShow.tmpl
========================================================================== */
.existingtabs {
padding: 1em 1.4em;
}
ul#rootDirStaticList {
width: 90%;
margin-right: auto;
margin-left: auto;
text-align: left;
}
ul#rootDirStaticList li {
padding: 4px 5px 4px 5px;
margin: 2px;
list-style: none outside none;
cursor: pointer;
background: #3d3d3d;
}
ul#rootDirStaticList li label {
margin-top: 5px;
margin-bottom: 5px;
}
ul#rootDirStaticList li input[type="checkbox"] {
vertical-align: -2px;
}
/* =======================================================================
home_trendingShows.tmpl
========================================================================== */
@ -1834,11 +1750,6 @@ body {
background-color: #222;
}
html * {
outline: 0 !important;
}
input[type="radio"] {
margin: 2px 0px 0px;
line-height: normal;
@ -2002,12 +1913,6 @@ fieldset[disabled] .navbar-default .btn-link:focus {
color: #000000;
}
.form-control-inline {
min-width: 0;
width: auto;
display: inline;
}
.btn {
color: #fff;
text-shadow: 0 1px 1px rgba(0, 0, 0, 0.75);
@ -2052,7 +1957,6 @@ fieldset[disabled] .navbar-default .btn-link:focus {
.btn:hover {
color: #fff;
text-decoration: none;
background-color: #2672B6;
*background-color: #2672B6;
background-position: 0 -150px;
@ -2085,8 +1989,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
.btn.disabled,
.btn[disabled] {
cursor: default;
background-color: #15528F;
background-image: none;
background: #15528F none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
@ -2094,19 +1997,6 @@ fieldset[disabled] .navbar-default .btn-link:focus {
box-shadow: none;
}
.btn-large {
padding: 9px 14px;
font-size: 15px;
line-height: normal;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.btn-large [class^="icon-"] {
margin-top: 1px;
}
.btn-small {
padding: 5px 9px;
font-size: 11px;
@ -2368,58 +2258,12 @@ input sizing (for config pages)
========================================================================== */
#editAProvider optgroup {
color: #eee;
background-color: rgb(51, 51, 51);
background-color: rgb(51, 51, 51);
}
#editAProvider optgroup option {
color: #222;
background-color: #fff;
}
#config select {
min-width: 0;
width: auto;
display: inline;
margin-top: -4px;
}
.btn-inline {
margin-top: -3px;
}
.input75 {
width: 75px;
margin-top: -4px;
}
.input100 {
width: 100px;
margin-top: -4px;
}
.input150 {
width: 150px;
margin-top: -4px;
}
.input200 {
width: 200px;
margin-top: -4px;
}
.input250 {
width: 250px;
margin-top: -4px;
}
.input300 {
width: 300px;
margin-top: -4px;
}
.input350 {
width: 350px;
margin-top: -4px;
background-color: #fff;
}
/* =======================================================================
@ -2498,92 +2342,31 @@ browser.css
/* =======================================================================
formWizard.css
formWizard
========================================================================== */
fieldset.sectionwrap {
width: 800px;
padding: 5px;
text-align: left;
border-width: 0;
}
.step,
legend.legendStep {
color: #ffffff;
margin-bottom: 0px;
}
div.stepsguide {
margin-bottom: 15px;
overflow: hidden;
text-align: left;
cursor: pointer;
}
div.stepsguide .step {
float: left;
width: 266px;
font: bold 24px Arial;
}
div.stepsguide .step p {
margin: 12px 0;
border-bottom: 4px solid #23AFDC;
border-color: #23AFDC;
}
div.stepsguide .disabledstep {
color: #c4c4c4;
.disabledstep {
color: #646464;
}
div.stepsguide .disabledstep p {
border-bottom: 4px solid #1178B3;
}
div.stepsguide .step .smalltext {
font-size: 13px;
font-weight: normal;
}
div.formpaginate {
width: 800px;
margin-top: 1em;
overflow: auto;
font-weight: bold;
text-align: center;
border-color: #1178B3;
}
div.formpaginate .prev, div.formpaginate .next {
padding: 3px 6px;
color: #fff;
cursor: hand;
cursor: pointer;
background: #2265A1;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.stepDiv {
padding: 15px;
}
/* step 3 related */
#customQuality {
display: block;
padding: 10px 0;
overflow: hidden;
clear: both;
}
#customQualityWrapper div.component-group-desc {
float: left;
width: 165px;
}
#customQualityWrapper div.component-group-desc p {
width: 85%;
margin: .8em 0;
font-size: 1.2em;
color: #666;
}
@ -2629,10 +2412,7 @@ tablesorter.css
.tablesorter th,
.tablesorter td {
padding: 4px;
border-top: #222 1px solid;
border-left: #222 1px solid;
vertical-align: middle;
border-color: #222;
}
/* remove extra border from left edge */
@ -2643,31 +2423,22 @@ tablesorter.css
.tablesorter th {
color: #fff;
text-align: center;
text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
background-color: #15528F;
border-collapse: collapse;
font-weight: normal;
}
.tablesorter .tablesorter-header {
padding: 4px 18px 4px 18px;
cursor: pointer;
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
background-position: center right;
background-repeat: no-repeat;
background: #15528F url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==) no-repeat center right;
/* background-image: url(../images/tablesorter/bg.gif); */
}
.tablesorter thead .tablesorter-headerDesc {
background-color: #297AB8;
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
background: #297AB8 url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7) no-repeat center right;
/* background-image: url(../images/tablesorter/asc.gif); */
}
.tablesorter thead .tablesorter-headerAsc {
background-color: #297AB8;
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
background: #297AB8 url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7) no-repeat center right;
/* background-image: url(../images/tablesorter/desc.gif); */
}
@ -2730,10 +2501,9 @@ thead.tablesorter-stickyHeader {
.tablesorter tfoot a {
color:#fff;
text-decoration: none;
}
#showListTable tbody {
#showListTable tbody {
color: #000;
}
@ -2872,6 +2642,25 @@ span.token-input-delete-token {
margin: 0 1px;
}
.step-one #searchResults .alt {
background-color: rgb(40, 40, 40);
}
#addRootDirTable td label .filepath,
.grey-text {
color:#999
}
#newShowPortal #displayText .show-name,
#newShowPortal #displayText .show-dest,
#newShowPortal #displayText p {
color: rgb(200, 200, 200)
}
#newShowPortal #displayText .show-name,
#newShowPortal #displayText .show-dest {
color: rgb(255, 255, 255)
}
/* =======================================================================
jquery.confirm.css
========================================================================== */

View file

@ -760,122 +760,38 @@ td.tvShow a:hover {
/* =======================================================================
home_addShows.tmpl
========================================================================== */
#addShowPortal {
width: 700px;
padding: 10px 0;
margin-right: auto;
margin-left: auto;
}
#addShowPortal a {
padding: 10px;
}
div.button {
display: table-cell;
vertical-align: middle;
padding-left: 10px;
}
div.buttontext {
display: table-cell;
padding-left: 20px;
text-align: left;
white-space: normal;
}
div.buttontext h3 {
margin-top: 10px;
}
div.buttontext p {
font-size: 13px;
}
.icon-addnewshow {
background-image: url("../images/addshows/add-new32-black.png");
width: 32px;
height: 32px;
}
.icon-addtrendingshow {
background-image: url("../images/addshows/add-trending32-black.png");
width: 32px;
height: 32px;
}
.icon-addrecommendedshow {
background-image: url("../images/addshows/add-trakt32-black.png");
width: 32px;
height: 32px;
}
.icon-addexistingshow {
background-image: url("../images/addshows/add-existing32-black.png");
width: 32px;
height: 32px;
}
/* =======================================================================
home_newShow.tmpl
========================================================================== */
#addShowForm, #recommendedShowsForm {
margin-left: auto;
margin-right: auto;
}
#newShowPortal {
width: 800px;
padding: 10px 0;
margin-right: auto;
margin-left: auto;
}
#displayText {
padding: 8px;
overflow: hidden;
font-size: 14px;
background-color: #efefef;
border: 1px solid #dfdede;
}
#searchResults input[type="radio"] {
vertical-align: -2px;
border-color: #dfdede;
}
/* =======================================================================
home_addExistingShow.tmpl
========================================================================== */
.existingtabs {
padding: 1em 1.4em;
}
ul#rootDirStaticList {
width: 90%;
margin-right: auto;
margin-left: auto;
text-align: left;
}
ul#rootDirStaticList li {
padding: 4px 5px 4px 5px;
margin: 2px;
list-style: none outside none;
cursor: pointer;
background: url('../css/lib/images/ui-bg_highlight-soft_75_efefef_1x100.png') repeat-x scroll 50% 50% #EFEFEF;
}
ul#rootDirStaticList li label {
margin-top: 5px;
margin-bottom: 5px;
}
ul#rootDirStaticList li input[type="checkbox"] {
vertical-align: -2px;
}
/* =======================================================================
home_trendingShows.tmpl
========================================================================== */
@ -1813,10 +1729,6 @@ body {
color: #000;
}
html * {
outline: 0 !important;
}
input[type="radio"] {
margin: 2px 0px 0px;
line-height: normal;
@ -2027,7 +1939,6 @@ fieldset[disabled] .navbar-default .btn-link:focus {
.btn:hover {
color: #333333;
text-decoration: none;
background-color: #e6e6e6;
*background-color: #d9d9d9;
background-position: 0 -15px;
@ -2058,8 +1969,7 @@ fieldset[disabled] .navbar-default .btn-link:focus {
.btn.disabled,
.btn[disabled] {
cursor: default;
background-color: #e6e6e6;
background-image: none;
background: #e6e6e6 none;
opacity: 0.65;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
@ -2067,19 +1977,6 @@ fieldset[disabled] .navbar-default .btn-link:focus {
box-shadow: none;
}
.btn-large {
padding: 9px 14px;
font-size: 15px;
line-height: normal;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.btn-large [class^="icon-"] {
margin-top: 1px;
}
.btn-small {
padding: 5px 9px;
font-size: 11px;
@ -2341,58 +2238,12 @@ input sizing (for config pages)
========================================================================== */
#editAProvider optgroup {
color: #eee;
background-color: #888;
background-color: #888;
}
#editAProvider optgroup option {
color: #222;
background-color: #fff;
}
#config select {
min-width: 0;
width: auto;
display: inline;
margin-top: -4px;
}
.btn-inline {
margin-top: -3px;
}
.input75 {
width: 75px;
margin-top: -4px;
}
.input100 {
width: 100px;
margin-top: -4px;
}
.input150 {
width: 150px;
margin-top: -4px;
}
.input200 {
width: 200px;
margin-top: -4px;
}
.input250 {
width: 250px;
margin-top: -4px;
}
.input300 {
width: 300px;
margin-top: -4px;
}
.input350 {
width: 350px;
margin-top: -4px;
background-color: #fff;
}
/* =======================================================================
@ -2470,92 +2321,31 @@ browser.css
/* =======================================================================
formWizard.css
formWizard
========================================================================== */
fieldset.sectionwrap {
width: 800px;
padding: 5px;
text-align: left;
border-width: 0;
}
.step,
legend.legendStep {
color: #57442b;
margin-bottom: 0px;
}
div.stepsguide {
margin-bottom: 15px;
overflow: hidden;
text-align: left;
cursor: pointer;
}
div.stepsguide .step {
float: left;
width: 266px;
font: bold 24px Arial;
}
div.stepsguide .step p {
margin: 12px 0;
border-bottom: 4px solid #57442b;
border-color: #57442b;
}
div.stepsguide .disabledstep {
.disabledstep {
color: #c4c4c4;
}
div.stepsguide .disabledstep p {
border-bottom: 4px solid #8a775e;
}
div.stepsguide .step .smalltext {
font-size: 13px;
font-weight: normal;
}
div.formpaginate {
width: 800px;
margin-top: 1em;
overflow: auto;
font-weight: bold;
text-align: center;
border-color: #8a775e;
}
div.formpaginate .prev, div.formpaginate .next {
padding: 3px 6px;
color: #fff;
cursor: hand;
cursor: pointer;
background: #57442b;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.stepDiv {
padding: 15px;
}
/* step 3 related */
#customQuality {
display: block;
padding: 10px 0;
overflow: hidden;
clear: both;
}
#customQualityWrapper div.component-group-desc {
float: left;
width: 165px;
}
#customQualityWrapper div.component-group-desc p {
width: 85%;
margin: .8em 0;
font-size: 1.2em;
color: #666;
}
@ -2575,10 +2365,7 @@ tablesorter.css
.tablesorter th,
.tablesorter td {
padding: 4px;
border-top: #fff 1px solid;
border-left: #fff 1px solid;
vertical-align: middle;
border-color: #fff;
}
/* remove extra border from left edge */
@ -2589,32 +2376,23 @@ tablesorter.css
.tablesorter th {
color: #fff;
text-align: center;
text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
background-color: #333;
border-collapse: collapse;
font-weight: normal;
}
.tablesorter .tablesorter-header {
padding: 4px 18px 4px 18px;
cursor: pointer;
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
background-position: center right;
background-repeat: no-repeat;
background: #333 url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==) no-repeat center right;
/* background-image: url(../images/tablesorter/bg.gif); */
}
.tablesorter thead .tablesorter-headerDesc {
background-color: #555;
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
background: #555 url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7) no-repeat center right;
/* background-image: url(../images/tablesorter/asc.gif); */
}
.tablesorter thead .tablesorter-headerAsc {
background-color: #555;
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
/* background-image: url(../images/tablesorter/desc.gif); */
background: #555 url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7) no-repeat center right;
/* background-image: url(../images/tablesorter/desc.gif); */
}
.tablesorter thead .sorter-false {
@ -2676,7 +2454,6 @@ thead.tablesorter-stickyHeader {
.tablesorter tfoot a {
color:#fff;
text-decoration: none;
}
/* =======================================================================
@ -2813,6 +2590,25 @@ span.token-input-delete-token {
margin: 0 1px;
}
.step-one #searchResults .alt {
background-color: rgb(245, 245, 245);
}
#addRootDirTable td label .filepath,
.grey-text {
color:#666
}
#newShowPortal #displayText .show-name,
#newShowPortal #displayText .show-dest,
#newShowPortal #displayText p {
color: rgb(153, 153, 153);
}
#newShowPortal #displayText .show-name,
#newShowPortal #displayText .show-dest {
color: rgb(87, 68, 43);
}
/* =======================================================================
jquery.confirm.css
========================================================================== */

View file

@ -511,7 +511,6 @@ home.tmpl
border: 1px solid #ccc;
overflow: hidden;
height: 66px;
overflow: hidden;
border-radius: 8px;
vertical-align: top;
width: 360px;
@ -792,31 +791,42 @@ home_addShows.tmpl
========================================================================== */
#addShowPortal {
width: 700px;
width: 750px;
padding: 10px 0;
margin-right: auto;
margin-left: auto;
}
#addShowPortal a {
padding: 10px;
/* padding: 10px;*/
padding: 0px 20px;
width: 360px;
float: left;
margin: 0 15px 15px 0;
}
div.button {
display: table-cell;
vertical-align: middle;
padding-left: 10px;
/* padding-left: 10px;*/
}
div.buttontext {
display: table-cell;
/*
padding-left: 20px;
padding: 10px 15px;
*/
padding: 10px 0px 10px 15px;
text-align: left;
white-space: normal;
}
div.buttontext p {
margin: 0
}
div.buttontext h3 {
margin-top: 10px;
margin-top: 0px;
}
div.buttontext p {
@ -850,13 +860,19 @@ div.buttontext p {
/* =======================================================================
home_newShow.tmpl
========================================================================== */
#addShowForm, #recommendedShowsForm {
#addShowForm,
#newShowPortal,
fieldset.sectionwrap,
div.formpaginate {
width: 801px
}
#addShowForm {
margin-left: auto;
margin-right: auto;
}
#newShowPortal {
width: 800px;
padding: 10px 0;
margin-right: auto;
margin-left: auto;
@ -866,20 +882,44 @@ home_newShow.tmpl
padding: 8px;
overflow: hidden;
font-size: 14px;
background-color: #efefef;
border: 1px solid #dfdede;
border: 1px solid;
}
#searchResults input[type="radio"] {
vertical-align: -2px;
}
#addShowForm #promptForSettings,
#addShowForm #rootDirStaticList input,
#addShowForm div.field-pair input,
#addShowForm div.field-pair select {
margin-right: 6px;
}
#addShowForm #customQualityWrapper div.component-group-desc p {
font-size: 14px;
}
#addShowForm #nameToSearch {
width: 460px;
margin-top: 0
}
#addShowForm #providedIndexer,
#addShowForm #indexerLangSelect {
margin-left: 7px
}
#addShowForm #searchName {
margin-left: 10px
}
/* =======================================================================
home_addExistingShow.tmpl
========================================================================== */
.existingtabs {
padding: 1em 1.4em;
padding: 20px;
}
ul#rootDirStaticList {
@ -887,14 +927,15 @@ ul#rootDirStaticList {
margin-right: auto;
margin-left: auto;
text-align: left;
list-style-type: none;
padding: 0
}
ul#rootDirStaticList li {
padding: 4px 5px 4px 5px;
margin: 2px;
padding: 4px 10px;
margin: 2px 0;
list-style: none outside none;
cursor: pointer;
background: url('../css/lib/images/ui-bg_highlight-soft_75_efefef_1x100.png') repeat-x scroll 50% 50% #EFEFEF;
}
ul#rootDirStaticList li label {
@ -1537,15 +1578,27 @@ config*.tmpl
color: #666;
}
#config div.field-pair {
padding: 12px 0px;
.stepDiv #customQualityWrapper h4 {
margin-top: 6px;
padding: 0 0
}
.stepDiv div.field-pair {
padding: 0 0 10px
}
#config div.field-pair {
padding: 12px 0
}
.stepDiv .component-desc select,
.stepDiv .component-desc input,
#config div.field-pair select,
#config div.field-pair input {
margin-right: 15px;
}
.stepDiv .component-desc input,
#config div.field-pair input {
float: left;
}
@ -1554,6 +1607,11 @@ config*.tmpl
padding-left: 20px;
}
.stepDiv span.component-title.input {
line-height: 30px
}
.stepDiv span.component-title,
#config span.component-title {
float: left;
width: 172px;
@ -1562,6 +1620,11 @@ config*.tmpl
font-weight: bold;
}
#addShowForm .stepDiv span.component-desc {
width:578px;
}
.stepDiv span.component-desc,
#config span.component-desc {
font-size: 12px;
font-weight: normal;
@ -2297,9 +2360,9 @@ fieldset[disabled] .navbar-default .btn-link:focus {
border-radius: 5px;
}
.btn-large [class^="icon-"] {
/*.btn-large [class^="icon-"] {
margin-top: 1px;
}
}*/
.btn-small {
padding: 5px 9px;
@ -2680,45 +2743,46 @@ browser.css
/* =======================================================================
formWizard.css
formWizard
========================================================================== */
fieldset.sectionwrap {
width: 800px;
padding: 5px;
padding: 5px 0;
text-align: left;
border-width: 0;
}
.step-one #searchResults legend.legendStep {
margin-top: 10px;
}
div.stepsguide .step,
legend.legendStep {
color: #57442b;
margin-bottom: 0px;
margin-bottom: 0;
}
legend.legendStep p {
padding-left: 15px;
}
div.stepsguide {
margin-bottom: 15px;
overflow: hidden;
text-align: left;
cursor: pointer;
}
div.stepsguide .step {
float: left;
width: 266px;
width: 267px;
font: bold 24px Arial;
}
div.stepsguide .step p {
margin: 12px 0;
border-bottom: 4px solid #57442b;
}
div.stepsguide .disabledstep {
color: #c4c4c4;
margin: 12px 0 0;
border-bottom: 5px solid;
}
div.stepsguide .disabledstep p {
border-bottom: 4px solid #8a775e;
border-bottom: 2px solid;
}
div.stepsguide .step .smalltext {
@ -2727,56 +2791,41 @@ div.stepsguide .step .smalltext {
}
div.formpaginate {
width: 800px;
margin-top: 1em;
overflow: auto;
font-weight: bold;
text-align: center;
}
.step-outer {
overflow: hidden
}
div.formpaginate .prev, div.formpaginate .next {
padding: 3px 6px;
color: #fff;
cursor: hand;
cursor: pointer;
background: #57442b;
-webkit-border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
-moz-border-radius: 6px;
border-radius: 6px;
}
.stepDiv {
padding: 15px;
}
.stepDiv.parent-folder {
padding: 15px 0 0;
width: 430px;
margin: 0px auto;
}
#tabs .nocheck,
.stepDiv .nocheck {
padding-left: 16px;
}
#tabs label span.component-title,
.stepDiv label span.component-title {
padding-bottom: 6px;
float: left;
width: 172px;
margin-right: 10px;
font-size: 13px;
font-weight: bold;
}
#tabs label span.component-desc,
.stepDiv label span.component-desc {
padding-bottom: 6px;
font-size: 12px;
font-weight: normal;
display:inline-block;
width:475px;
}
/* step 3 related */
#customQuality {
display: block;
padding: 10px 0;
padding: 0 0 10px 0;
overflow: hidden;
clear: both;
}
@ -2790,7 +2839,6 @@ div.formpaginate .prev, div.formpaginate .next {
width: 85%;
margin: .8em 0;
font-size: 1.2em;
color: #666;
}
/* =======================================================================
@ -2810,9 +2858,9 @@ tablesorter.css
.tablesorter th,
.tablesorter td {
padding: 4px;
border-top: #fff 1px solid;
border-left: #fff 1px solid;
vertical-align: middle;
border-top: 1px solid;
border-left: 1px solid;
vertical-align: baseline;
}
/* remove extra border from left edge */
@ -2822,10 +2870,7 @@ tablesorter.css
}
.tablesorter th {
color: #fff;
text-align: center;
text-shadow: -1px -1px 0 rgba(0,0,0,0.3);
background-color: #333;
border-collapse: collapse;
font-weight: normal;
}
@ -2833,22 +2878,7 @@ tablesorter.css
.tablesorter .tablesorter-header {
padding: 4px 18px 4px 18px;
cursor: pointer;
background-image: url(data:image/gif;base64,R0lGODlhFQAJAIAAAP///////yH5BAEAAAEALAAAAAAVAAkAAAIXjI+AywnaYnhUMoqt3gZXPmVg94yJVQAAOw==);
background-position: center right;
background-repeat: no-repeat;
/* background-image: url(../images/tablesorter/bg.gif); */
}
.tablesorter thead .tablesorter-headerDesc {
background-color: #555;
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjB+gC+jP2ptn0WskLQA7);
/* background-image: url(../images/tablesorter/asc.gif); */
}
.tablesorter thead .tablesorter-headerAsc {
background-color: #555;
background-image: url(data:image/gif;base64,R0lGODlhFQAEAIAAAP///////yH5BAEAAAEALAAAAAAVAAQAAAINjI8Bya2wnINUMopZAQA7);
/* background-image: url(../images/tablesorter/desc.gif); */
vertical-align: middle;
}
.tablesorter thead .sorter-false {
@ -2909,7 +2939,6 @@ thead.tablesorter-stickyHeader {
}
.tablesorter tfoot a {
color:#fff;
text-decoration: none;
}
@ -3052,6 +3081,42 @@ span.token-input-delete-token {
margin: 0 1px;
}
.stepDiv #searchResults div {
line-height: 1.7;
}
.stepDiv #searchResults #searchingAnim {
margin-right: 6px;
}
.stepone-result-title {
font-weight: 600;
margin-left: 10px
}
.stepone-result-date,
.stepone-result-db,
.stepone-result-overview {
margin-left: 5px
}
.stepone-result-db img {
margin-top: 3px;
vertical-align: top;
}
#newShowPortal #displayText .show-name,
#newShowPortal #displayText .show-dest,
#newShowPortal #displayText p {
margin: 0;
}
#newShowPortal #displayText .show-name,
#newShowPortal #displayText .show-dest {
font-weight: 600;
}
#addRootDirTable td label .filepath {
font-weight: 900
}
.boldest {font-weight: 900}
.red-text {color:#d33}
.clear-left {clear:left}

View file

@ -65,7 +65,6 @@
<input type="hidden" name="show" value="$show.indexerid" />
<b>Location:</b> <input type="text" name="location" id="location" value="$show._location" class="form-control form-control-inline input-sm input350" /><br />
<br />
<b>Quality:</b>
#set $qualities = $common.Quality.splitQuality(int($show.quality))
#set global $anyQualities = $qualities[0]
#set global $bestQualities = $qualities[1]

View file

@ -1,17 +1,15 @@
#import os.path
#import sickbeard
#from sickbeard.common import *
#set global $title="Existing Show"
#set global $header="Existing Show"
#set global $title = 'Existing Show'
#set global $header = 'Existing Show'
#set global $sbPath="../.."
#set global $sbPath = '../..'
#set global $statpath="../.."#
#set global $topmenu="home"#
#set global $statpath = '../..'
#set global $topmenu = 'home'
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
<script type="text/javascript" src="$sbRoot/js/qualityChooser.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/addExistingShow.js?$sbPID"></script>
@ -21,7 +19,7 @@
<script type="text/javascript" charset="utf-8">
<!--
\$(document).ready(function(){
\$( "#tabs" ).tabs({
\$( '#tabs' ).tabs({
collapsible: true,
selected: #if $sickbeard.ROOT_DIRS then '-1' else '0'#
});
@ -29,41 +27,55 @@
//-->
</script>
#if $varExists('header')
#if $varExists('header')
<h1 class="header">$header</h1>
#else
#else
<h1 class="title">$title</h1>
#end if
<div id="tabs">
<ul>
<li><a href="#tabs-1">Manage Directories</a></li>
<li><a href="#tabs-2">Customize Options</a></li>
</ul>
<div id="tabs-1" class="existingtabs">
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_rootDirs.tmpl")
</div>
<div id="tabs-2" class="existingtabs">
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_addShowOptions.tmpl")
</div>
</div>
<br />
<image class="preload-image" style="position:absolute;top:-999px" src="$sbRoot/images/loading32<%= '-dark' if 'dark' == sickbeard.THEME_NAME else '' %>.gif" width="32" height="32" border="0">
<p>SickGear can add existing shows, using the current options, by using locally stored NFO/XML metadata to eliminate user interaction.<br />
If you would rather have SickGear prompt you to customize each show, then use the checkbox below.</p>
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">
<p><input type="checkbox" name="promptForSettings" id="promptForSettings" /> <label for="promptForSettings">Prompt me to set settings for each show</label></p>
<p>Tip: shows are added quicker when usable show nfo and xml metadata is found</p>
<hr />
<p style="margin-top:15px">
<input type="checkbox" id="promptForSettings" name="promptForSettings" style="vertical-align: top;" />
<label for="promptForSettings">Enable to change the following options per show, otherwise use these options with all shows added below</label>
</p>
<h5><b>Displaying folders within these directories which aren't already added to SickGear:</b></h5>
<div id="tabs">
<ul>
<li><a href="#tabs-1">Manage parent folders</a></li>
<li><a href="#tabs-2">Custom options</a></li>
</ul>
<div id="tabs-1" class="existingtabs">
<div style="width: 430px; margin: 0px auto">
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_rootDirs.tmpl')
</div>
</div>
<div id="tabs-2">
<div class="stepDiv">
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_addShowOptions.tmpl')
</div>
</div>
</div>
<ul id="rootDirStaticList"><li></li></ul>
<br />
<hr />
<br />
<div id="tableDiv"></div>
<br />
<input class="btn btn-primary" type="button" value="Submit" id="submitShowDirs" />
<p>The following parent folder(s) are scanned for existing shows. Toggle a folder to display shows</p>
<ul id="rootDirStaticList">
<li></li>
</ul>
<p>shows <span class="boldest">not known</span> to SickGear are listed below...</p>
<div id="tableDiv"></div>
<br />
<input class="btn btn-primary" type="button" value="Submit" id="submitShowDirs" />
</form>
#include $os.path.join($sickbeard.PROG_DIR,"gui/slick/interfaces/default/inc_bottom.tmpl")
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')

View file

@ -1,16 +1,16 @@
#import os.path
#import urllib
#import sickbeard
#set global $title="Add Show"
#set global $header="Add Show"
#set global $title = 'Add Show'
#set global $header = 'Add Show'
#set global $sbPath="../.."
#set global $sbPath = '../..'
#set global $statpath="../.."#
#set global $topmenu="home"#
#set global $statpath = '../..'
#set global $topmenu = 'home'
#import os.path
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_top.tmpl')
#if $varExists('header')
<h1 class="header">$header</h1>
@ -18,46 +18,49 @@
<h1 class="title">$title</h1>
#end if
<div id="addShowPortal">
<div id="addShowPortal">
<a href="$sbRoot/home/addShows/newShow/" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="icon-addnewshow"></div></div>
<div class="buttontext">
<h3>Add New Show</h3>
<p>For shows that you haven't downloaded yet, this option finds a show on theTVDB.com and TVRage.com, creates a directory for its episodes, and adds it to SickGear.</p>
</div>
</a>
<a class="btn btn-large" href="$sbRoot/home/addShows/newShow/">
<div class="button"><div class="icon-addnewshow"></div></div>
<div class="buttontext">
<h3>Add New Show</h3>
<p>Search a TV database for a show to add. A new folder will be created for episodes</p>
</div>
</a>
<br/><br/>
<a href="$sbRoot/home/addShows/trendingShows/" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="icon-addtrendingshow"></div></div>
<div class="buttontext">
<h3>Add Trending Show</h3>
<p>For shows that you haven't downloaded yet, this option lets you choose from a list of current trending shows with ratings to add, creates a directory for its episodes, and adds it to SickGear.</p>
</div>
</a>
<a class="btn btn-large" href="$sbRoot/home/addShows/trendingShows/">
<div class="button"><div class="icon-addtrendingshow"></div></div>
<div class="buttontext">
<h3>Add From Trending</h3>
<p>Browse a current trending show list to add from. A folder for episodes will be created</p>
</div>
</a>
<br/><br/>
#if $sickbeard.USE_TRAKT == True:
<a href="$sbRoot/home/addShows/recommendedShows/" id="btnNewShow" class="btn btn-large">
<div class="button"><div class="icon-addrecommendedshow"></div></div>
<div class="buttontext">
<h3>Add Recommended Shows</h3>
<p>For shows that you haven't downloaded yet, this option recommends shows to add based on your Trakt.tv show library, creates a directory for its episodes, and adds it to SickGear.</p>
</div>
</a>
<a class="btn btn-large" href="$sbRoot/home/addShows/existingShows/">
<div class="button"><div class="icon-addexistingshow"></div></div>
<div class="buttontext">
<h3>Add Existing Shows</h3>
<p>Scan parent folders for shows and episode metadata to import into SickGear</p>
</div>
</a>
<br/><br/>
#end if
<a href="$sbRoot/home/addShows/existingShows/" id="btnExistingShow" class="btn btn-large">
<div class="button"><div class="icon-addexistingshow"></div></div>
<div class="buttontext">
<h3>Add Existing Shows</h3>
<p>Use this option to add shows that already have a folder created on your hard drive. SickGear will scan your existing metadata/episodes and add the show accordingly.</p>
</div>
</a>
#if True == $sickbeard.USE_TRAKT:
<a class="btn btn-large" href="$sbRoot/home/addShows/recommendedShows/">
<div class="button"><div class="icon-addrecommendedshow"></div></div>
<div class="buttontext">
<h3>Add Recommended</h3>
<p>Browse recommendations based on your Trakt.tv show library to add to SickGear</p>
</div>
</a>
#else
<div class="buttontext" style="padding:10px 5px">
<p>There's more... unlock another button to browse<br />
recommended shows based on your Trakt.tv show<br />
library by enabling Trakt in Config/Notifications/Social</p>
</div>
#end if
</div>
</div>
<div style="clear:both">&nbsp;</div>
#include $os.path.join($sickbeard.PROG_DIR,"gui/slick/interfaces/default/inc_bottom.tmpl")
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_bottom.tmpl')

View file

@ -2,10 +2,10 @@
#from sickbeard.helpers import anon_url
<table id="addRootDirTable" class="sickbeardTable tablesorter">
<thead><tr><th class="col-checkbox"><input type="checkbox" id="checkAll" checked=checked></th><th>Directory</th><th width="20%">Show Name (tvshow.nfo)<th width="20%">Indexer</td></tr></thead>
<thead><tr><th class="col-checkbox"><input type="checkbox" id="checkAll" checked=checked></th><th>Parent\show folder</th><th width="20%">Show name<br />(tvshow.nfo)<th width="15%">TV database</td></tr></thead>
<tfoot>
<tr>
<th rowspan="1" colspan="4" align="left"><a href="#" style="padding-left: 10px;" class="showManage">Manage Directories</a></th>
<th rowspan="1" colspan="4" align="left"><a href="#" class="showManage">Manage Directories</a></th>
</tr>
</tfoot>
<tbody>
@ -31,7 +31,7 @@
<td class="col-checkbox"><input type="checkbox" id="$show_id" class="dirCheck" checked=checked></td>
<td><label for="$show_id">$curDir['display_dir']</label></td>
#if $curDir['existing_info'][1] and $indexer > 0:
<td><a href="<%= anon_url(sickbeard.indexerApi(indexer).config['show_url'], curDir['existing_info'][0]) %>">$curDir['existing_info'][1]</a></td>
<td><a href="<%= anon_url(sickbeard.indexerApi(indexer).config['show_url'], curDir['existing_info'][0]) %>" target="_new">$curDir['existing_info'][1]</a></td>
#else:
<td>?</td>
#end if

View file

@ -24,15 +24,17 @@
<h1 class="title">$title</h1>
#end if
<image class="preload-image" style="position:absolute;top:-999px" src="$sbRoot/images/loading32<%= '-dark' if 'dark' == sickbeard.THEME_NAME else '' %>.gif" width="32" height="32" border="0">
<div id="newShowPortal">
<div id="displayText">aoeu</div>
<br />
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8" style="width: 800px;">
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addNewShow" accept-charset="utf-8">
<fieldset class="sectionwrap">
<legend class="legendStep">Find a show on the TVDB or TVRAGE</legend>
<fieldset class="sectionwrap step-one">
<legend class="legendStep"><p>Find show at a TV database</p></legend>
<div class="stepDiv">
<input type="hidden" id="indexer_timeout" value="$sickbeard.INDEXER_TIMEOUT" />
@ -48,10 +50,10 @@
#else
<input type="text" id="nameToSearch" value="$default_show_name" class="form-control form-control-inline input-sm input350" />
&nbsp;
<span style="float:right">
<select name="indexerLang" id="indexerLangSelect" class="form-control form-control-inline input-sm">
<option value="en" selected="selected">en</option>
</select><b>*</b>
&nbsp;
</select><b>&nbsp;*</b>
<select name="providedIndexer" id="providedIndexer" class="form-control form-control-inline input-sm">
<option value="0" #if $provided_indexer == 0 then "selected=\"selected\"" else ""#>All Indexers</option>
#for $indexer in $indexers
@ -60,21 +62,21 @@
</select>
&nbsp;
<input class="btn btn-inline" type="button" id="searchName" value="Search" />
</span>
<br />
<p style="margin:5px 0 15px"><b>*</b> SickGear supports english episodes. The language choice is used for fetching metadata and episode filenames</p>
<br />
<b>*</b> This will only affect the language of the retrieved metadata file contents and episode filenames.<br />
This <b>DOES NOT</b> allow SickGear to download non-english TV episodes!<br />
<br />
<div id="searchResults" style="height: 100%;"><br/></div>
<div id="searchResults" style="height: 100%"></div>
#end if
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
<fieldset class="sectionwrap">
<legend class="legendStep">Pick the parent folder</legend>
<fieldset class="sectionwrap step-two">
<legend class="legendStep"><p>Pick parent folder</p></legend>
<div class="stepDiv">
<div class="stepDiv parent-folder">
#if $provided_show_dir
Pre-chosen Destination Folder: <b>$provided_show_dir</b> <br />
<input type="hidden" id="fullShowPath" name="fullShowPath" value="$provided_show_dir" /><br />
@ -82,13 +84,15 @@
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_rootDirs.tmpl')
#end if
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
<fieldset class="sectionwrap">
<legend class="legendStep">Customize options</legend>
<fieldset class="sectionwrap step-three">
<legend class="legendStep"><p>Set custom options</p></legend>
<div class="stepDiv">
#include $os.path.join($sickbeard.PROG_DIR, 'gui/slick/interfaces/default/inc_addShowOptions.tmpl')
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
#for $curNextDir in $other_shows

View file

@ -12,7 +12,6 @@
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_top.tmpl")
<link rel="stylesheet" type="text/css" href="$sbRoot/css/formwizard.css?$sbPID" />
<script type="text/javascript" src="$sbRoot/js/formwizard.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/qualityChooser.js?$sbPID"></script>
<script type="text/javascript" src="$sbRoot/js/recommendedShows.js?$sbPID"></script>
@ -24,35 +23,40 @@
<h1 class="title">$title</h1>
#end if
<image class="preload-image" style="position:absolute;top:-999px" src="$sbRoot/images/loading32<%= '-dark' if 'dark' == sickbeard.THEME_NAME else '' %>.gif" width="32" height="32" border="0">
<div id="newShowPortal">
<div id="displayText"></div>
<br />
<form id="recommendedShowsForm" method="post" action="$sbRoot/home/addShows/addRecommendedShow" accept-charset="utf-8" style="width: 800px;">
<form id="addShowForm" method="post" action="$sbRoot/home/addShows/addRecommendedShow" accept-charset="utf-8">
<fieldset class="sectionwrap">
<legend class="legendStep">Select a recommended show</legend>
<fieldset class="sectionwrap step-one">
<legend class="legendStep"><p>Select a recommended show</p></legend>
<div class="stepDiv">
<div id="searchResults" style="height: 100%;"><br/></div>
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
<fieldset class="sectionwrap">
<legend class="legendStep">Pick the parent folder</legend>
<fieldset class="sectionwrap step-two">
<legend class="legendStep"><p>Pick parent folder</p></legend>
<div class="stepDiv">
<div class="stepDiv parent-folder">
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_rootDirs.tmpl")
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
<fieldset class="sectionwrap">
<legend class="legendStep">Customize options</legend>
<fieldset class="sectionwrap step-three">
<legend class="legendStep"><p>Set custom options</p></legend>
<div class="stepDiv">
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_addShowOptions.tmpl")
</div>
<div style="clear:both">&nbsp;</div>
</fieldset>
</form>

View file

@ -2,62 +2,77 @@
#from sickbeard.common import *
#from sickbeard import subtitles
#if $sickbeard.USE_SUBTITLES:
<div class="field-pair alt">
<input type="checkbox" name="subtitles" id="subtitles" #if $sickbeard.SUBTITLES_DEFAULT then "checked=\"checked\"" else ""# />
<label for="subtitles" class="clearfix">
<span class="component-title">Subtitles</span>
<span class="component-desc">Download subtitles for this show?</span>
</label>
</div>
#end if
<div class="field-pair">
<label for="statusSelect" class="nocheck clearfix">
<span class="component-title">
<select name="defaultStatus" id="statusSelect" class="form-control form-control-inline input-sm">
#for $curStatus in [$SKIPPED, $WANTED, $ARCHIVED, $IGNORED]:
<option value="$curStatus" #if $sickbeard.STATUS_DEFAULT == $curStatus then 'selected="selected"' else ''#>$statusStrings[$curStatus]</option>
#end for
</select>
</span>
<span class="component-desc">Set the initial status of missing episodes</span>
</label>
</div>
<div class="field-pair alt">
<input class="cb" type="checkbox" name="flatten_folders" id="flatten_folders" #if $sickbeard.FLATTEN_FOLDERS_DEFAULT then "checked=\"checked\"" else ""# />
<label for="flatten_folders" class="clearfix">
<span class="component-title">Flatten Folders</span>
<span class="component-desc">Disregard sub-folders?</span>
</label>
</div>
<div class="field-pair">
<label for="statusSelect">
<span class="component-title input">Initial episode status</span>
<span class="component-desc">
<select name="defaultStatus" id="statusSelect" class="form-control form-control-inline input-sm">
#for $curStatus in [$SKIPPED, $WANTED, $ARCHIVED, $IGNORED]:
<option value="$curStatus" #if $sickbeard.STATUS_DEFAULT == $curStatus then 'selected="selected"' else ''#>$statusStrings[$curStatus]</option>
#end for
</select>
<span>set the initial status of missing episodes</span>
</span>
</label>
</div>
<div class="field-pair alt">
<input type="checkbox" name="anime" id="anime" #if $sickbeard.ANIME_DEFAULT then "checked=\"checked\"" else ""# />
<label for="anime" class="clearfix">
<span class="component-title">Anime</span>
<span class="component-desc">Is this show an Anime?</span>
</label>
</div>
<p class="grey-text">Tip: The following options are <span style="font-weight:800">edit</span>able later in the detail view of the show</p>
</div>
<div class="field-pair alt">
<input type="checkbox" name="scene" id="scene" #if $sickbeard.SCENE_DEFAULT then "checked=\"checked\"" else ""# />
<label for="scene" class="clearfix">
<span class="component-title">Scene Numbering</span>
<span class="component-desc">Is this show scene numbered?</span>
</label>
</div>
#if $sickbeard.USE_SUBTITLES:
<div class="field-pair alt">
<label for="subtitles">
<span class="component-title">Subtitles</span>
<span class="component-desc">
<input type="checkbox" name="subtitles" id="subtitles" #if $sickbeard.SUBTITLES_DEFAULT then "checked=\"checked\"" else ""# />
<p>download subtitles for this show</p>
</span>
</label>
</div>
#end if
#set $qualities = $Quality.splitQuality($sickbeard.QUALITY_DEFAULT)
#set global $anyQualities = $qualities[0]
#set global $bestQualities = $qualities[1]
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_qualityChooser.tmpl")
<br>
<div class="field-pair alt">
<label for="saveDefaultsButton" class="nocheck clearfix">
<span class="component-title"><input class="btn btn-inline" type="button" id="saveDefaultsButton" value="Save Defaults" disabled="disabled" /></span>
<span class="component-desc">Persist current values as the defaults</span>
</label>
</div>
<div class="field-pair alt">
<label for="flatten_folders">
<span class="component-title">Flatten folders</span>
<span class="component-desc">
<input class="cb" type="checkbox" name="flatten_folders" id="flatten_folders" #if $sickbeard.FLATTEN_FOLDERS_DEFAULT then "checked=\"checked\"" else ""# />
<p>do not create sub folders</p>
</span>
</label>
</div>
<div class="field-pair alt">
<label for="anime">
<span class="component-title">Anime</span>
<span class="component-desc">
<input type="checkbox" name="anime" id="anime" #if $sickbeard.ANIME_DEFAULT then "checked=\"checked\"" else ""# />
<p>use anime processing for this show</p>
</span>
</label>
</div>
<div class="field-pair alt">
<label for="scene">
<span class="component-title">Scene numbering</span>
<span class="component-desc">
<input type="checkbox" name="scene" id="scene" #if $sickbeard.SCENE_DEFAULT then "checked=\"checked\"" else ""# />
<p>enable if episodes are numbered by scene releases and not by the TV network</p>
</span>
</label>
</div>
#set $qualities = $Quality.splitQuality($sickbeard.QUALITY_DEFAULT)
#set global $anyQualities = $qualities[0]
#set global $bestQualities = $qualities[1]
#include $os.path.join($sickbeard.PROG_DIR, "gui/slick/interfaces/default/inc_qualityChooser.tmpl")
<div class="field-pair alt" style="margin-top:30px">
<label for="saveDefaultsButton">
<span class="component-title">Save options as defaults</span>
<span class="component-desc">
<input class="btn btn-inline" type="button" id="saveDefaultsButton" value="Save Defaults" disabled="disabled" />
<p>reuse the above options when adding more shows</p>
</span>
</label>
</div>

View file

@ -2,46 +2,48 @@
#from sickbeard.common import Quality, qualityPresets, qualityPresetStrings
<div class="field-pair">
<label for="qualityPreset" class="nocheck clearfix">
<label for="qualityPreset" class="clearfix">
#set $overall_quality = $Quality.combineQualities($anyQualities, $bestQualities)
<span class="component-title">
<span class="component-title input">Quality</span>
<span class="component-desc">
#set $selected = None
<select id="qualityPreset" class="form-control form-control-inline input-sm">
<option value="0">Custom</option>
<select id="qualityPreset" class="form-control form-control-inline input-sm">
<option value="0">Custom</option>
#for $curPreset in sorted($qualityPresets):
<option value="$curPreset" #if $curPreset == $overall_quality then "selected=\"selected\"" else ""# #if $qualityPresetStrings[$curPreset].endswith("0p") then "style=\"padding-left: 15px;\"" else ""#>$qualityPresetStrings[$curPreset]</option>
<option value="$curPreset" #if $curPreset == $overall_quality then "selected=\"selected\"" else ""# #if $qualityPresetStrings[$curPreset].endswith("0p") then "style=\"padding-left: 15px;\"" else ""#>$qualityPresetStrings[$curPreset]</option>
#end for
</select>
</span>
<span class="component-desc">Preferred quality of episodes to be download</span>
</label>
</select>
<span>preferred episode quality to download</span>
</span>
</label>
</div>
<div id="customQualityWrapper">
<div id="customQuality">
<div class="component-group-desc">
<p>One of the <b>Initial</b> quality selections must be obtained before SickGear will attempt to process the <b>Archive</b> selections.</p>
</div>
<div class="component-group-desc">
<p>One of the <em>Initial</em> quality selections must succeed before attempting to process <em>Archive</em> selections.</p>
</div>
<div style="padding-right: 40px; text-align: center;" class="float-left">
<h4>Initial</h4>
#set $anyQualityList = filter(lambda x: x > $Quality.NONE, $Quality.qualityStrings)
<select id="anyQualities" name="anyQualities" multiple="multiple" size="$len($anyQualityList)" class="form-control form-control-inline input-sm">
#for $curQuality in sorted($anyQualityList):
<option value="$curQuality" #if $curQuality in $anyQualities then "selected=\"selected\"" else ""#>$Quality.qualityStrings[$curQuality]</option>
#end for
</select>
</div>
<span class="component-desc">
<div style="float:left; padding-right: 40px">
<h4>Initial</h4>
#set $anyQualityList = filter(lambda x: x > $Quality.NONE, $Quality.qualityStrings)
<select id="anyQualities" name="anyQualities" multiple="multiple" size="$len($anyQualityList)" class="form-control form-control-inline input-sm">
#for $curQuality in sorted($anyQualityList):
<option value="$curQuality" #if $curQuality in $anyQualities then "selected=\"selected\"" else ""#>$Quality.qualityStrings[$curQuality]</option>
#end for
</select>
</div>
<div style="text-align: center;" class="float-left">
<h4>Archive</h4>
#set $bestQualityList = filter(lambda x: x > $Quality.SDTV and x < $Quality.UNKNOWN, $Quality.qualityStrings)
<select id="bestQualities" name="bestQualities" multiple="multiple" size="$len($bestQualityList)" class="form-control form-control-inline input-sm">
#for $curQuality in sorted($bestQualityList):
<option value="$curQuality" #if $curQuality in $bestQualities then "selected=\"selected\"" else ""#>$Quality.qualityStrings[$curQuality]</option>
#end for
</select>
</div>
</div>
<div style="float:left">
<h4>Archive</h4>
#set $bestQualityList = filter(lambda x: x > $Quality.SDTV and x < $Quality.UNKNOWN, $Quality.qualityStrings)
<select id="bestQualities" name="bestQualities" multiple="multiple" size="$len($bestQualityList)" class="form-control form-control-inline input-sm">
#for $curQuality in sorted($bestQualityList):
<option value="$curQuality" #if $curQuality in $bestQualities then "selected=\"selected\"" else ""#>$Quality.qualityStrings[$curQuality]</option>
#end for
</select>
</div>
</span>
</div>
</div>

View file

@ -7,7 +7,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SickGear - BRANCH:[$sickbeard.BRANCH] - $title</title>
<!--[if lt IE 9]>

View file

@ -1,78 +1,93 @@
$(document).ready(function() {
$(document).ready(function(){
$('#checkAll').live('click', function(){
var seasCheck = this;
var tableDiv = $('#tableDiv');
$('.dirCheck').each(function(){
this.checked = seasCheck.checked;
});
});
tableDiv.on('click', '#checkAll', function(){
$('#submitShowDirs').click(function(){
var cbToggle = this.checked;
var dirArr = new Array();
$('.dirCheck').each(function(){
this.checked = cbToggle;
});
});
$('.dirCheck').each(function(i,w) {
if (this.checked == true) {
var show = $(this).attr('id');
var indexer = $(this).closest('tr').find('select').val();
dirArr.push(encodeURIComponent(indexer + '|' + show));
}
});
$('#submitShowDirs').click(function(){
if (dirArr.length == 0)
return false;
var dirArr = [];
url = sbRoot+'/home/addShows/addExistingShows?promptForSettings='+ ($('#promptForSettings').prop('checked') ? 'on' : 'off');
$('.dirCheck').each(function(){
if (true == this.checked){
var show = $(this).attr('id');
var indexer = $(this).closest('tr').find('select').val();
dirArr.push(encodeURIComponent(indexer + '|' + show));
}
});
url += '&shows_to_add='+dirArr.join('&shows_to_add=');
if (0 == dirArr.length)
return false;
window.location.href = url;
});
window.location.href = sbRoot + '/home/addShows/addExistingShows'
+ '?promptForSettings=' + ($('#promptForSettings').prop('checked') ? 'on' : 'off')
+ '&shows_to_add=' + dirArr.join('&shows_to_add=');
});
function loadContent() {
var url = '';
$('.dir_check').each(function(i,w){
if ($(w).is(':checked')) {
if (url.length)
url += '&';
url += 'rootDir=' + encodeURIComponent($(w).attr('id'));
}
});
function loadContent(){
var url = '';
$('.dir_check').each(function(i, w){
if ($(w).is(':checked')){
url += (url.length ? '&' : '')
+ 'rootDir=' + encodeURIComponent($(w).attr('id'));
}
});
$('#tableDiv').html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif" height="32" width="32" /> loading folders...');
$.get(sbRoot+'/home/addShows/massAddTable', url, function(data) {
$('#tableDiv').html(data);
$("#addRootDirTable").tablesorter({
//sortList: [[1,0]],
widgets: ['zebra'],
headers: {
0: { sorter: false }
}
});
});
$('#tableDiv').html('<img id="searchingAnim"'
+ ' style="margin-right:10px"'
+ ' src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif"'
+ ' height="32" width="32" />'
+ ' scanning parent folders...');
}
$.get(sbRoot + '/home/addShows/massAddTable',
url,
function(data){
$('#tableDiv').html(data);
$('#addRootDirTable').tablesorter({
sortList: [[1,0]],
widgets: ['zebra'],
headers: {
0: { sorter: false }
}
});
});
}
var last_txt = '';
$('#rootDirText').change(function() {
if (last_txt == $('#rootDirText').val())
return false;
else
last_txt = $('#rootDirText').val();
$('#rootDirStaticList').html('');
$('#rootDirs option').each(function(i, w) {
$('#rootDirStaticList').append('<li class="ui-state-default ui-corner-all"><input type="checkbox" class="dir_check" id="'+$(w).val()+'" checked=checked> <label for="'+$(w).val()+'" style="color:#09A2FF;"><b>'+$(w).val()+'</b></label></li>')
});
loadContent();
});
$('.dir_check').live('click', loadContent);
var last_txt = '', new_text = '', id;
$('#rootDirText').change(function(){
if (last_txt == (new_text = $('#rootDirText').val()))
return false;
$('.showManage').live('click', function() {
$( "#tabs" ).tabs( 'select', 0 );
});
last_txt = new_text;
$('#rootDirStaticList').html('');
$('#rootDirs').find('option').each(function(i, w){
id = $(w).val();
$('#rootDirStaticList').append('<li class="ui-state-default ui-corner-all">'
+ '<input id="' + id + '" type="checkbox"' + ' checked=checked'
+ ' class="dir_check"'
+ ' />'
+ ' <label for="' + id + '"'
+ ' style="color:#09A2FF">'
+ '<b>' + id + '</b></label>'
+ '</li>')
});
loadContent();
});
$('#rootDirStaticList').on('click', '.dir_check', loadContent);
tableDiv.on('click', '.showManage', function(event) {
event.preventDefault();
$('#tabs').tabs('option', 'active', 0);
$('html,body').animate({scrollTop: 0}, 1000);
});
});

View file

@ -1,111 +1,136 @@
/*jQuery Form to Form Wizard (Initial: Oct 1st, 2010)
* This notice must stay intact for usage
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/
/* jQuery Form to Form Wizard (Initial: Oct 1st, 2010)
* This notice must stay intact for usage
* Author: Dynamic Drive at http://www.dynamicdrive.com/
* Visit http://www.dynamicdrive.com/ for full source code
*/
//Oct 21st, 2010: Script updated to v1.1, which adds basic form validation functionality, triggered each time the user goes from one page to the next, or tries to submit the form.
//jQuery.noConflict()
// Oct 21st, 2010: Script updated to v1.1, which adds basic form validation functionality, triggered each time the user goes from one page to the next, or tries to submit the form.
// jQuery.noConflict()
function formtowizard(options){
this.setting=jQuery.extend({persistsection:false, revealfx:['slide', 500], oninit:function(){}, onpagechangestart:function(){}}, options)
this.currentsection=-1
function FormToWizard(options){
this.setting = jQuery.extend({fieldsetborderwidth:2, persistsection:false, revealfx:['slide', 500],
oninit:function(){}, onpagechangestart:function(){}}, options);
this.currentsection = -1;
this.init(this.setting)
}
formtowizard.prototype={
createfieldsets:function($theform, arr){ //reserved function for future version (dynamically wraps form elements with a fieldset element)
$theform.find('fieldset.sectionwrap').removeClass('sectionwrap') //make sure no fieldsets carry 'sectionwrap' before proceeding
var $startelement=$theform.find(':first-child') //reference first element inside form
for (var i=0; i<arr.length; i++){ //loop thru "break" elements
var $fieldsetelements=$startelement.nextUntil('#'+arr[i].breakafter+', *[name='+arr[i].breakafter+']').andSelf() //reference all elements from start element to break element (nextUntil() is jQuery 1.4 function)
$fieldsetelements.add($fieldsetelements.next()).wrapAll('<fieldset class="sectionwrap" />') //wrap these elements with fieldset element
$startelement=$theform.find('fieldset.sectionwrap').eq(i).prepend('<legend class="legendStep">'+arr[i].legend+'</legend>').next() //increment startelement to begin at the end of the just inserted fieldset element
}
},
FormToWizard.prototype = {
loadsection:function(rawi, bypasshooks){
var thiswizard=this
//doload Boolean checks to see whether to load next section (true if bypasshooks param is true or onpagechangestart() event handler doesn't return false)
var doload=bypasshooks || this.setting.onpagechangestart(jQuery, this.currentsection, this.sections.$sections.eq(this.currentsection))
doload=(doload===false)? false : true //unless doload is explicitly false, set to true
if (!bypasshooks && this.setting.validate){
var outcome=this.validate(this.currentsection)
if (outcome===false)
doload=false
}
var i=(rawi=="prev")? this.currentsection-1 : (rawi=="next")? this.currentsection+1 : parseInt(rawi) //get index of next section to show
i=(i<0)? this.sections.count-1 : (i>this.sections.count-1)? 0 : i //make sure i doesn't exceed min/max limit
if (i<this.sections.count && doload){ //if next section to show isn't the same as the current section shown
this.$thesteps.eq(this.currentsection).addClass('disabledstep').end().eq(i).removeClass('disabledstep') //dull current "step" text then highlight next "step" text
if (this.setting.revealfx[0]=="slide"){
this.sections.$sections.css("visibility", "visible")
this.sections.$outerwrapper.stop().animate({height: this.sections.$sections.eq(i).outerHeight()}, this.setting.revealfx[1]) //animate fieldset wrapper's height to accomodate next section's height
this.sections.$innerwrapper.stop().animate({left:-i*this.maxfieldsetwidth}, this.setting.revealfx[1], function(){ //slide next section into view
thiswizard.sections.$sections.each(function(thissec){
if (thissec!=i) //hide fieldset sections currently not in veiw, so tabbing doesn't go to elements within them (and mess up layout)
thiswizard.sections.$sections.eq(thissec).css("visibility", "hidden")
//doload Boolean checks to see whether to load next section (true if bypasshooks param is true or onpagechangestart() event handler doesn't return false)
var doload = bypasshooks || this.setting.onpagechangestart(jQuery, this.currentsection, this.sections.$sections.eq(this.currentsection)),
tabIndex,
thiswizard = this;
doload = (doload !== false); //unless doload is explicitly false, set to true
if (!bypasshooks && this.setting.validate && false === this.validate(this.currentsection))
doload = false;
//get index of next section to show
tabIndex = ('prev' == rawi
? this.currentsection - 1
: ('next' == rawi
? this.currentsection + 1
: parseInt(rawi)));
//don't exceed min/max limit
tabIndex = (tabIndex < 0
? this.sections.count - 1
: (tabIndex > (this.sections.count - 1)
? 0
: tabIndex));
//if next section to show isn't the same as the current section shown
if (tabIndex < this.sections.count && doload){
//dull current 'step' text then highlight next 'step' text
this.$thesteps.eq(this.currentsection).addClass('disabledstep').end().eq(tabIndex).removeClass('disabledstep');
if ('slide' == this.setting.revealfx[0]) {
this.sections.$sections.css('visibility', 'visible');
//animate fieldset wrapper's height to accommodate next section's height
this.sections.$outerwrapper.stop().animate({height: this.sections.$sections.eq(tabIndex).outerHeight()}, this.setting.revealfx[1]);
//slide next section into view
this.sections.$innerwrapper.stop().animate({left: -tabIndex * this.maxfieldsetwidth}, this.setting.revealfx[1], function () {
thiswizard.sections.$sections.each(function (thissec) {
//hide fieldset sections currently not in view, so tabbing doesn't go to elements within them (and mess up layout)
if (tabIndex != thissec)
thiswizard.sections.$sections.eq(thissec).css('visibility', 'hidden')
})
})
}
else if (this.setting.revealfx[0]=="fade"){ //if fx is "fade"
this.sections.$sections.eq(this.currentsection).hide().end().eq(i).fadeIn(this.setting.revealfx[1], function(){
else if ('fade' == this.setting.revealfx[0]) { //if fx is 'fade'
this.sections.$sections.eq(this.currentsection).hide().end().eq(tabIndex).fadeIn(this.setting.revealfx[1], function () {
if (document.all && this.style && this.style.removeAttribute)
this.style.removeAttribute('filter') //fix IE clearType problem
//fix IE clearType problem
this.style.removeAttribute('filter');
})
} else {
this.sections.$sections.eq(this.currentsection).hide().end().eq(tabIndex).show()
}
else{
this.sections.$sections.eq(this.currentsection).hide().end().eq(i).show()
}
this.paginatediv.$status.text("Page "+(i+1)+" of "+this.sections.count) //update current page status text
this.paginatediv.$navlinks.css('visibility', 'visible')
if (i==0) //hide "prev" link
this.paginatediv.$navlinks.eq(0).css('visibility', 'hidden')
else if (i==this.sections.count-1) //hide "next" link
this.paginatediv.$navlinks.eq(1).css('visibility', 'hidden')
//update current page status text
this.paginatediv.$status.text('step ' + (tabIndex + 1) + ' / ' + this.sections.count);
this.paginatediv.$navlinks.css('visibility', 'visible');
if (0 == tabIndex) //hide 'prev' link
this.paginatediv.$navlinks.eq(0).css('visibility', 'hidden');
else if ((this.sections.count - 1) == tabIndex)
//hide 'next' link
this.paginatediv.$navlinks.eq(1).css('visibility', 'hidden');
if (this.setting.persistsection) //enable persistence?
formtowizard.routines.setCookie(this.setting.formid+"_persist", i)
this.currentsection=i
if(i === 0) { setTimeout(function() { $('#nameToSearch').focus(); }, 250); }
FormToWizard.routines.setCookie(this.setting.formid + '_persist', tabIndex);
this.currentsection = tabIndex;
if (0 === tabIndex) {
setTimeout(function () {
$('#nameToSearch').focus();
}, 250);
}
}
},
addvalidatefields:function(){
var $=jQuery, setting=this.setting, theform=this.$theform.get(0), validatefields=[]
var validatefields=setting.validate //array of form element ids to validate
for (var i=0; i<validatefields.length; i++){
var el=theform.elements[validatefields[i]] //reference form element
if (el){ //if element is defined
var $section=$(el).parents('fieldset.sectionwrap:eq(0)') //find fieldset.sectionwrap this form element belongs to
if ($section.length==1){ //if element is within a fieldset.sectionwrap element
$section.data('elements').push(el) //cache this element inside corresponding section
var $ = jQuery,
setting = this.setting,
theform = this.$theform.get(0),
validatefields = setting.validate; //array of form element ids to validate
for (var i = 0; i < validatefields.length; i++){
var el = theform.elements[validatefields[i]]; //reference form element
if (el){
//find fieldset.sectionwrap this form element belongs to
var $section = $(el).parents('fieldset.sectionwrap:eq(0)');
//if element is within a fieldset.sectionwrap element
if ($section.length == 1){
//cache this element inside corresponding section
$section.data('elements').push(el);
}
}
}
},
validate:function(section){
var elements=this.sections.$sections.eq(section).data('elements') //reference elements within this section that should be validated
var validated=true, invalidtext=["Please fill out the following fields:\n"]
//reference elements within this section that should be validated
var elements = this.sections.$sections.eq(section).data('elements');
var validated = true, invalidtext = ['Please fill out the following fields:' + "\n"];
function invalidate(el){
validated=false
invalidtext.push("- "+ (el.id || el.name))
validated = false;
invalidtext.push('- '+ (el.id || el.name))
}
for (var i=0; i<elements.length; i++){
if (/(text)/.test(elements[i].type) && elements[i].value==""){ //text and textarea elements
for (var i = 0; i < elements.length; i++){
if (/(text)/.test(elements[i].type) && elements[i].value == ''){
//text and textarea elements
invalidate(elements[i])
}
else if (/(select)/.test(elements[i].type) && (elements[i].selectedIndex==-1 || elements[i].options[elements[i].selectedIndex].text=="")){ //select elements
} else if (/(select)/.test(elements[i].type) && (elements[i].selectedIndex == -1 || elements[i].options[elements[i].selectedIndex].text == '')){
//select elements
invalidate(elements[i])
}
else if (elements[i].type==undefined && elements[i].length>0){ //radio and checkbox elements
var onechecked=false
for (var r=0; r<elements[i].length; r++){
if (elements[i][r].checked==true){
onechecked=true
} else if (undefined == elements[i].type && 0 < elements[i].length){
//radio and checkbox elements
var onechecked = false;
for (var r = 0; r < elements[i].length; r++){
if (elements[i][r].checked == true){
onechecked = true;
break
}
}
@ -115,98 +140,154 @@ formtowizard.prototype={
}
}
if (!validated)
alert(invalidtext.join('\n'))
alert(invalidtext.join("\n"));
return validated
},
init:function(setting){
var thiswizard=this
var thiswizard = this;
jQuery(function($){ //on document.ready
var $theform=$('#'+setting.formid)
if ($theform.length==0) //if form with specified ID doesn't exist, try name attribute instead
$theform=$('form[name='+setting.formid+']')
if (setting.manualfieldsets && setting.manualfieldsets.length>0)
thiswizard.createfieldsets($theform, setting.manualfieldsets)
var $stepsguide=$('<div class="stepsguide" />') //create Steps Container to house the "steps" text
var $sections=$theform.find('fieldset.sectionwrap').hide() //find all fieldset elements within form and hide them initially
if (setting.revealfx[0]=="slide"){ //create outer DIV that will house all the fieldset.sectionwrap elements
$sectionswrapper=$('<div style="position:relative;overflow:hidden;"></div>').insertBefore($sections.eq(0)) //add DIV above the first fieldset.sectionwrap element
$sectionswrapper_inner=$('<div style="position:absolute;left:0;top:0;"></div>') //create inner DIV of $sectionswrapper that will scroll to reveal a fieldset element
var $theform = $('#' + setting.formid),
//create Steps Container to house the 'steps' text
$stepsguide = $('<div class="stepsguide" />'),
//find all fieldsets within form and hide them initially
$sections = $theform.find('fieldset.sectionwrap').hide(),
$sectionswrapper = '',
$sectionswrapper_inner = '';
if (0 == $theform.length)
//if form with specified ID doesn't exist, try name attribute instead
$theform = $('form[name=' + setting.formid + ']');
if ('slide' == setting.revealfx[0]) {
//create outer DIV that will house all the fieldset.sectionwrap elements
//add DIV above the first fieldset.sectionwrap element
$sectionswrapper = $('<div class="step-outer" style="position:relative"></div>').insertBefore($sections.eq(0));
//create inner DIV of $sectionswrapper that will scroll to reveal a fieldset element
$sectionswrapper_inner = $('<div class="step-inner" style="position:absolute; left:0"></div>');
}
var maxfieldsetwidth=$sections.eq(0).outerWidth() //variable to get width of widest fieldset.sectionwrap
$sections.slice(1).each(function(i){ //loop through $sections (starting from 2nd one)
maxfieldsetwidth=Math.max($(this).outerWidth(), maxfieldsetwidth)
})
maxfieldsetwidth+=2 //add 2px to final width to reveal fieldset border (if not removed via CSS)
thiswizard.maxfieldsetwidth=maxfieldsetwidth
$sections.each(function(i){ //loop through $sections again
var $section=$(this)
if (setting.revealfx[0]=="slide"){
$section.data('page', i).css({position:'absolute', top:0, left:maxfieldsetwidth*i}).appendTo($sectionswrapper_inner) //set fieldset position to "absolute" and move it to inside sectionswrapper_inner DIV
//variable to get width of widest fieldset.sectionwrap
var maxfieldsetwidth = $sections.eq(0).outerWidth();
//loop through $sections (starting from 2nd one)
$sections.slice(1).each(function(){
maxfieldsetwidth = Math.max($(this).outerWidth(), maxfieldsetwidth)
});
//add default 2px or param px to final width to reveal fieldset border (if not removed via CSS)
maxfieldsetwidth += setting.fieldsetborderwidth;
thiswizard.maxfieldsetwidth = maxfieldsetwidth;
//loop through $sections again
$sections.each(function(i){
var $section = $(this);
if ('slide' == setting.revealfx[0]) {
//set fieldset position to 'absolute' and move it to inside sectionswrapper_inner DIV
$section.data('page', i).css({position: 'absolute', left: maxfieldsetwidth * i}).appendTo($sectionswrapper_inner);
}
$section.data('elements', []) //empty array to contain elements within this section that should be validated for data (applicable only if validate option is defined)
//create each "step" DIV and add it to main Steps Container:
var $thestep=$('<div class="step disabledstep" />').data('section', i).html('Step '+(i+1)+'<div class="smalltext">'+$section.find('legend:eq(0)').text()+'<p></p></div>').appendTo($stepsguide)
$thestep.click(function(){ //assign behavior to each step div
//empty array to contain elements within this section that should be validated for data (applicable only if validate option is defined)
$section.data('elements', []);
//create each 'step' DIV and add it to main Steps Container:
var $stepwords = ['first', 'second', 'third'], $thestep = $('<div class="step disabledstep" />').data('section', i).html(($stepwords[i]
+ ' step') + '<div class="smalltext">' + $section.find('legend:eq(0)').text() + '<p></p></div>').appendTo($stepsguide);
//assign behavior to each step div
$thestep.click(function(){
thiswizard.loadsection($(this).data('section'))
})
})
if (setting.revealfx[0]=="slide"){
$sectionswrapper.width(maxfieldsetwidth) //set fieldset wrapper to width of widest fieldset
$sectionswrapper.append($sectionswrapper_inner) //add $sectionswrapper_inner as a child of $sectionswrapper
});
if ('slide' == setting.revealfx[0]) {
$sectionswrapper.width(maxfieldsetwidth); //set fieldset wrapper to width of widest fieldset
$sectionswrapper.append($sectionswrapper_inner); //add $sectionswrapper_inner as a child of $sectionswrapper
$stepsguide.append('<div style="clear:both">&nbsp;</div>')
}
$theform.prepend($stepsguide) //add $thesteps div to the beginning of the form
//add $thesteps div to the beginning of the form
$theform.prepend($stepsguide);
//$stepsguide.insertBefore($sectionswrapper) //add Steps Container before sectionswrapper container
var $thesteps=$stepsguide.find('div.step')
var $thesteps = $stepsguide.find('div.step');
//create pagination DIV and add it to end of form:
var $paginatediv=$('<div class="formpaginate" style="overflow:hidden;"><span class="prev" style="float:left">Prev</span> <span class="status">Step 1 of </span> <span class="next" style="float:right">Next</span></div>')
$theform.append($paginatediv)
thiswizard.$theform=$theform
if (setting.revealfx[0]=="slide"){
thiswizard.sections={$outerwrapper:$sectionswrapper, $innerwrapper:$sectionswrapper_inner, $sections:$sections, count:$sections.length} //remember various parts of section container
var $paginatediv = $('<div class="formpaginate">'
+ '<span class="prev" style="float:left">Prev</span>'
+ ' <span class="status">step 1 of </span>'
+ ' <span class="next" style="float:right">Next</span>'
+ '</div>');
$theform.append($paginatediv);
thiswizard.$theform = $theform;
if ('slide' == setting.revealfx[0]) {
//remember various parts of section container
thiswizard.sections = {
$outerwrapper: $sectionswrapper,
$innerwrapper: $sectionswrapper_inner,
$sections: $sections,
count: $sections.length
};
thiswizard.sections.$sections.show()
} else {
//remember various parts of section container
thiswizard.sections = {
$sections: $sections,
count: $sections.length
};
}
else{
thiswizard.sections={$sections:$sections, count:$sections.length} //remember various parts of section container
}
thiswizard.$thesteps=$thesteps //remember this ref
thiswizard.paginatediv={$main:$paginatediv, $navlinks:$paginatediv.find('span.prev, span.next'), $status:$paginatediv.find('span.status')} //remember various parts of pagination DIV
thiswizard.paginatediv.$main.click(function(e){ //assign behavior to pagination buttons
thiswizard.$thesteps = $thesteps;
//remember various parts of pagination DIV
thiswizard.paginatediv = {
$main: $paginatediv,
$navlinks: $paginatediv.find('span.prev, span.next'),
$status: $paginatediv.find('span.status')
};
//assign behavior to pagination buttons
thiswizard.paginatediv.$main.click(function(e){
if (/(prev)|(next)/.test(e.target.className))
thiswizard.loadsection(e.target.className)
})
var i=(setting.persistsection)? formtowizard.routines.getCookie(setting.formid+"_persist") : 0
thiswizard.loadsection(i||0, true) //show the first section
thiswizard.setting.oninit($, i, $sections.eq(i)) //call oninit event handler
if (setting.validate){ //if validate array defined
thiswizard.addvalidatefields() //seek out and cache form elements that should be validated
});
var i = (setting.persistsection ? FormToWizard.routines.getCookie(setting.formid + '_persist') : 0);
//show the first section
thiswizard.loadsection(i||0, true);
//call oninit event handler
thiswizard.setting.oninit($, i, $sections.eq(i));
//if validate array defined
if (setting.validate){
//seek out and cache form elements that should be validated
thiswizard.addvalidatefields();
thiswizard.$theform.submit(function(){
var returnval=true
for (var i=0; i<thiswizard.sections.count; i++){
for (var i = 0; i < thiswizard.sections.count; i++){
if (!thiswizard.validate(i)){
thiswizard.loadsection(i, true)
returnval=false
break
thiswizard.loadsection(i, true);
return false;
}
}
return returnval //allow or disallow form submission
return true;
})
}
})
}
}
};
formtowizard.routines={
FormToWizard.routines = {
getCookie:function(Name){
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
getCookie:function(Name){
var re = new RegExp(Name + '=[^;]+', 'i'); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return document.cookie.match(re)[0].split('=')[1]; //return its value
return null
},
setCookie:function(name, value){
document.cookie = name+"=" + value + ";path=/"
document.cookie = name + '=' + value + ';path=/';
}
}
};

View file

@ -1,227 +1,278 @@
$(document).ready(function () {
function populateSelect() {
if (!$('#nameToSearch').length) {
return;
}
function populateSelect() {
if (!$('#nameToSearch').length)
return;
if ($('#indexerLangSelect option').length <= 1) {
$.getJSON(sbRoot + '/home/addShows/getIndexerLanguages', {}, function (data) {
var selected, resultStr = '';
if (1 >= $('#indexerLangSelect').find('option').length) {
if (data.results.length === 0) {
resultStr = '<option value="en" selected="selected">en</option>';
} else {
$.each(data.results, function (index, obj) {
if (resultStr == '') {
selected = ' selected="selected"';
} else {
selected = '';
}
$.getJSON(sbRoot + '/home/addShows/getIndexerLanguages', {}, function (data) {
resultStr += '<option value="' + obj + '"' + selected + '>' + obj + '</option>';
});
}
var resultStr = '',
selected = ' selected="selected"',
elIndexerLang = $('#indexerLangSelect');
$('#indexerLangSelect').html(resultStr);
$('#indexerLangSelect').change(function () { searchIndexers(); });
});
}
}
if (0 === data.results.length) {
resultStr = '<option value="en"' + selected + '>en</option>';
} else {
$.each(data.results, function (index, obj) {
resultStr += '<option value="' + obj + '"'
+ ('' == resultStr ? selected : '')
+ '>' + obj + '</option>';
});
}
var searchRequestXhr = null;
elIndexerLang.html(resultStr);
elIndexerLang.change(function () {
searchIndexers();
});
});
}
}
function searchIndexers() {
if (!$('#nameToSearch').val().length) {
return;
}
var searchRequestXhr = null;
if (searchRequestXhr) searchRequestXhr.abort();
function searchIndexers() {
var elNameToSearch = $('#nameToSearch');
var searchingFor = $('#nameToSearch').val() + ' on ' + $('#providedIndexer option:selected').text() + ' in ' + $('#indexerLangSelect').val();
$('#searchResults').empty().html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif" height="32" width="32" /> searching ' + searchingFor + '...');
if (!elNameToSearch.val().length)
return;
searchRequestXhr = $.ajax({
url: sbRoot + '/home/addShows/searchIndexersForShowName',
data: {'search_term': $('#nameToSearch').val(), 'lang': $('#indexerLangSelect').val(), 'indexer': $('#providedIndexer').val()},
timeout: parseInt($('#indexer_timeout').val(), 10) * 1000,
dataType: 'json',
error: function () {
$('#searchResults').empty().html('search timed out, try again or try another indexer');
},
success: function (data) {
var firstResult = true;
var resultStr = '<fieldset>\n<legend>Search Results:</legend>\n';
var checked = '';
if (searchRequestXhr)
searchRequestXhr.abort();
if (data.results.length === 0) {
resultStr += '<b>No results found, try a different search.</b>';
} else {
$.each(data.results, function (index, obj) {
if (firstResult) {
checked = ' checked';
firstResult = false;
} else {
checked = '';
}
var elTvDatabase = $('#providedIndexer'),
elIndexerLang = $('#indexerLangSelect'),
searchingFor = elNameToSearch.val() + ' on ' + elTvDatabase.find('option:selected').text() + ' in ' + elIndexerLang.val();
var whichSeries = obj.join('|');
$('#searchResults').empty().html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif" height="32" width="32" /> searching ' + searchingFor + '...');
searchRequestXhr = $.ajax({
url: sbRoot + '/home/addShows/searchIndexersForShowName',
data: {
'search_term': elNameToSearch.val(),
'lang': elIndexerLang.val(),
'indexer': elTvDatabase.val()
},
timeout: parseInt($('#indexer_timeout').val(), 10) * 1000,
dataType: 'json',
error: function () {
$('#searchResults').empty().html('search timed out, try again or try another database');
},
success: function (data) {
var resultStr = '', checked = '', rowType, row = 0;
resultStr += '<input type="radio" id="whichSeries" name="whichSeries" value="' + whichSeries + '"' + checked + ' /> ';
if (data.langid && data.langid != "") {
resultStr += '<a href="' + anonURL + obj[2] + obj[3] + '&lid=' + data.langid + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[4] + '</b></a>';
} else {
resultStr += '<a href="' + anonURL + obj[2] + obj[3] + '" onclick=\"window.open(this.href, \'_blank\'); return false;\" ><b>' + obj[4] + '</b></a>';
}
if (0 === data.results.length) {
resultStr += '<span class="boldest">Sorry, no results found. Try a different search.</span>';
} else {
$.each(data.results, function (index, obj) {
checked = (0 == row ? ' checked' : '');
rowType = (0 == row % 2 ? '' : ' class="alt"');
row++;
if (obj[5] !== null) {
var startDate = new Date(obj[5]);
var today = new Date();
if (startDate > today) {
resultStr += ' (will debut on ' + obj[5] + ')';
} else {
resultStr += ' (started on ' + obj[5] + ')';
}
}
var whichSeries = obj.join('|'),
showstartdate = '';
if (obj[0] !== null) {
resultStr += ' [' + obj[0] + ']';
}
if (null !== obj[5]) {
var startDate = new Date(obj[5]);
var today = new Date();
showstartdate = '&nbsp;<span class="stepone-result-date">('
+ (startDate > today ? 'will debut' : 'started')
+ ' on ' + obj[5] + ')</span>';
}
resultStr += '<br />';
});
resultStr += '</ul>';
}
resultStr += '</fieldset>';
$('#searchResults').html(resultStr);
updateSampleText();
myform.loadsection(0);
}
});
}
resultStr += '<div' + rowType + '>'
+ '<input id="whichSeries" type="radio"'
+ ' class="stepone-result-radio"'
+ ' title="Add show <span style=\'color: rgb(66, 139, 202)\'>' + obj[4] + '</span>"'
+ ' name="whichSeries"'
+ ' value="' + whichSeries + '"'
+ checked
+ ' />'
+ '<a'
+ ' class="stepone-result-title"'
+ ' title="View detail for <span style=\'color: rgb(66, 139, 202)\'>' + obj[4] + '</span>"'
+ ' href="' + anonURL + obj[2] + obj[3] + ((data.langid && '' != data.langid) ? '&lid=' + data.langid : '') + '"'
+ ' onclick="window.open(this.href, \'_blank\'); return false;"'
+ '>' + obj[4] + '</a>'
+ showstartdate
+ (null == obj[0] ? ''
: '&nbsp;<span class="stepone-result-db grey-text">' + '[' + obj[0] + ']' + '</span>')
+ '</div>' + "\n";
});
}
$('#searchResults').html(
'<fieldset>' + "\n" + '<legend class="legendStep" style="margin-bottom: 15px">'
+ (0 < row ? row : 'No')
+ ' search result' + (1 == row ? '' : 's') + '...</legend>' + "\n"
+ resultStr
+ '</fieldset>'
);
updateSampleText();
myform.loadsection(0);
$('.stepone-result-radio, .stepone-result-title').each(addQTip);
}
});
}
$('#searchName').click(function () { searchIndexers(); });
var elNameToSearch = $('#nameToSearch'),
elSearchName = $('#searchName');
if ($('#nameToSearch').length && $('#nameToSearch').val().length) {
$('#searchName').click();
}
elSearchName.click(function () { searchIndexers(); });
$('#addShowButton').click(function () {
// if they haven't picked a show don't let them submit
if (!$("input:radio[name='whichSeries']:checked").val() && !$("input:hidden[name='whichSeries']").val().length) {
alert('You must choose a show to continue');
return false;
}
if (elNameToSearch.length && elNameToSearch.val().length) {
elSearchName.click();
}
$('#addShowForm').submit();
});
$('#addShowButton').click(function () {
// if they haven't picked a show don't let them submit
if (!$('input:radio[name="whichSeries"]:checked').val()
&& !$('input:hidden[name="whichSeries"]').val().length) {
alert('You must choose a show to continue');
return false;
}
$('#addShowForm').submit();
});
$('#skipShowButton').click(function () {
$('#skipShow').val('1');
$('#addShowForm').submit();
});
$('#skipShowButton').click(function () {
$('#skipShow').val('1');
$('#addShowForm').submit();
});
$('#qualityPreset').change(function () {
myform.loadsection(2);
});
$('#qualityPreset').change(function () {
myform.loadsection(2);
});
/***********************************************
* jQuery Form to Form Wizard- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
/***********************************************
* jQuery Form to Form Wizard- (c) Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
var myform = new formtowizard({
formid: 'addShowForm',
revealfx: ['slide', 500],
oninit: function () {
populateSelect();
updateSampleText();
if ($('input:hidden[name=whichSeries]').length && $('#fullShowPath').length) {
goToStep(3);
}
}
});
var myform = new FormToWizard({
fieldsetborderwidth: 0,
formid: 'addShowForm',
revealfx: ['slide', 500],
oninit: function () {
populateSelect();
updateSampleText();
if ($('input:hidden[name="whichSeries"]').length && $('#fullShowPath').length) {
goToStep(3);
}
}
});
function goToStep(num) {
$('.step').each(function () {
if ($.data(this, 'section') + 1 == num) {
$(this).click();
}
});
}
function goToStep(num) {
$('.step').each(function () {
if ($.data(this, 'section') + 1 == num) {
$(this).click();
}
});
}
$('#nameToSearch').focus();
elNameToSearch.focus();
function updateSampleText() {
// if something's selected then we have some behavior to figure out
function updateSampleText() {
// if something's selected then we have some behavior to figure out
var show_name, sep_char;
// if they've picked a radio button then use that
if ($('input:radio[name=whichSeries]:checked').length) {
show_name = $('input:radio[name=whichSeries]:checked').val().split('|')[4];
}
// if we provided a show in the hidden field, use that
else if ($('input:hidden[name=whichSeries]').length && $('input:hidden[name=whichSeries]').val().length) {
show_name = $('#providedName').val();
} else {
show_name = '';
}
var show_name,
sep_char,
elRadio = $('input:radio[name="whichSeries"]:checked'),
elInput = $('input:hidden[name="whichSeries"]'),
elRootDirs = $('#rootDirs'),
elFullShowPath = $('#fullShowPath');
var sample_text = 'Adding show <b>' + show_name + '</b> into <b>';
// if they've picked a radio button then use that
if (elRadio.length) {
show_name = elRadio.val().split('|')[4];
}
// if we provided a show in the hidden field, use that
else if (elInput.length && elInput.val().length) {
show_name = $('#providedName').val();
} else {
show_name = '';
}
// if we have a root dir selected, figure out the path
if ($("#rootDirs option:selected").length) {
var root_dir_text = $('#rootDirs option:selected').val();
if (root_dir_text.indexOf('/') >= 0) {
sep_char = '/';
} else if (root_dir_text.indexOf('\\') >= 0) {
sep_char = '\\';
} else {
sep_char = '';
}
var sample_text = '<p>Adding show <span class="show-name">' + show_name + '</span>'
+ ('' == show_name ? 'into<br />' : '<br />into')
+ ' <span class="show-dest">';
if (root_dir_text.substr(sample_text.length - 1) != sep_char) {
root_dir_text += sep_char;
}
root_dir_text += '<i>||</i>' + sep_char;
// if we have a root dir selected, figure out the path
if (elRootDirs.find('option:selected').length) {
var root_dir_text = elRootDirs.find('option:selected').val();
if (root_dir_text.indexOf('/') >= 0) {
sep_char = '/';
} else if (root_dir_text.indexOf('\\') >= 0) {
sep_char = '\\';
} else {
sep_char = '';
}
sample_text += root_dir_text;
} else if ($('#fullShowPath').length && $('#fullShowPath').val().length) {
sample_text += $('#fullShowPath').val();
} else {
sample_text += 'unknown dir.';
}
if (root_dir_text.substr(sample_text.length - 1) != sep_char) {
root_dir_text += sep_char;
}
root_dir_text += '<i>||</i>' + sep_char;
sample_text += '</b>';
sample_text += root_dir_text;
} else if (elFullShowPath.length && elFullShowPath.val().length) {
sample_text += elFullShowPath.val();
} else {
sample_text += 'unknown dir.';
}
// if we have a show name then sanitize and use it for the dir name
if (show_name.length) {
$.get(sbRoot + '/home/addShows/sanitizeFileName', {name: show_name}, function (data) {
$('#displayText').html(sample_text.replace('||', data));
});
// if not then it's unknown
} else {
$('#displayText').html(sample_text.replace('||', '??'));
}
sample_text += '</span></p>';
// also toggle the add show button
if (($("#rootDirs option:selected").length || ($('#fullShowPath').length && $('#fullShowPath').val().length)) &&
($('input:radio[name=whichSeries]:checked').length) || ($('input:hidden[name=whichSeries]').length && $('input:hidden[name=whichSeries]').val().length)) {
$('#addShowButton').attr('disabled', false);
} else {
$('#addShowButton').attr('disabled', true);
}
}
// if we have a show name then sanitize and use it for the dir name
if (show_name.length) {
$.get(sbRoot + '/home/addShows/sanitizeFileName', {name: show_name}, function (data) {
$('#displayText').html(sample_text.replace('||', data));
});
// if not then it's unknown
} else {
$('#displayText').html(sample_text.replace('||', '??'));
}
$('#rootDirText').change(updateSampleText);
$('#whichSeries').live('change', updateSampleText);
// also toggle the add show button
if ((elRootDirs.find('option:selected').length || (elFullShowPath.length && elFullShowPath.val().length)) &&
(elRadio.length) || (elInput.length && elInput.val().length)) {
$('#addShowButton').attr('disabled', false);
} else {
$('#addShowButton').attr('disabled', true);
}
}
$('#nameToSearch').keyup(function (event) {
if (event.keyCode == 13) {
$('#searchName').click();
}
});
$('#rootDirText').change(updateSampleText);
$('#searchResults').on('click', '.stepone-result-radio', updateSampleText);
elNameToSearch.keyup(function (event) {
if (event.keyCode == 13) {
elSearchName.click();
}
});
var addQTip = (function() {
$(this).css('cursor', 'help');
$(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-bootstrap qtip-shadow ui-tooltip-sb'
}
});
});
});

View file

@ -1,36 +1,31 @@
function setFromPresets (preset) {
var elCustomQuality = $('#customQuality'),
selected = 'selected';
if (0 == preset) {
elCustomQuality.show();
return;
}
elCustomQuality.hide();
$('#anyQualities').find('option').each(function() {
var result = preset & $(this).val();
$(this).attr(selected, (0 < result ? selected : false));
});
$('#bestQualities').find('option').each(function() {
var result = preset & ($(this).val() << 16);
$(this).attr(selected, (result > 0 ? selected: false));
});
}
$(document).ready(function() {
function setFromPresets (preset) {
if (preset == 0) {
$('#customQuality').show();
return;
} else {
$('#customQuality').hide();
}
var elQualityPreset = $('#qualityPreset'),
selected = ':selected';
$('#anyQualities option').each(function(i) {
var result = preset & $(this).val();
if (result > 0) {
$(this).attr('selected', 'selected');
} else {
$(this).attr('selected', false);
}
});
elQualityPreset.change(function() {
setFromPresets($('#qualityPreset').find(selected).val());
});
$('#bestQualities option').each(function(i) {
var result = preset & ($(this).val() << 16);
if (result > 0) {
$(this).attr('selected', 'selected');
} else {
$(this).attr('selected', false);
}
});
return;
}
$('#qualityPreset').change(function() {
setFromPresets($('#qualityPreset :selected').val());
});
setFromPresets($('#qualityPreset :selected').val());
});
setFromPresets(elQualityPreset.find(selected).val());
});

View file

@ -1,144 +1,211 @@
$(document).ready(function () {
function getRecommendedShows() {
$.getJSON(sbRoot + '/home/addShows/getRecommendedShows', {}, function (data) {
var firstResult = true;
var resultStr = '<fieldset>\n<legend>Recommended Shows:</legend>\n';
var checked = '';
$(document).ready(function (){
if (data.results.length === 0) {
resultStr += '<b>No recommended shows found, update your watched shows list on trakt.tv.</b>';
} else {
$.each(data.results, function (index, obj) {
if (firstResult) {
checked = ' checked';
firstResult = false;
} else {
checked = '';
}
function getRecommendedShows(){
var whichSeries = obj.join('|');
$('#searchResults').empty().html('<img id="searchingAnim"'
+ ' src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif"'
+ ' height="32" width="32" />'
+ ' fetching recommendations...');
resultStr += '<input type="radio" id="whichSeries" name="whichSeries" value="' + whichSeries + '"' + checked + ' /> ';
resultStr += '<a href="' + anonURL + obj[1] + '" onclick="window.open(this.href, \'_blank\'); return false;"><b>' + obj[2] + '</b></a>';
$.getJSON(sbRoot + '/home/addShows/getRecommendedShows',
{},
function (data){
var resultStr = '', checked = '', rowType, row = 0;
if (obj[4] !== null) {
var startDate = new Date(obj[4]);
var today = new Date();
if (startDate > today) {
resultStr += ' (will debut on ' + obj[4] + ')';
} else {
resultStr += ' (started on ' + obj[4] + ')';
}
}
if (null === data || 0 === data.results.length){
resultStr += '<p>Sorry, no recommended shows found, this can happen from time to time.</p>'
+ '<p>However, if the issue persists, then try updating your watched shows list on trakt.tv</p>';
} else {
if (obj[0] !== null) {
resultStr += ' [' + obj[0] + ']';
}
$.each(data.results, function (index, obj){
checked = (0 == row ? ' checked' : '');
rowType = (0 == row % 2 ? '' : ' class="alt"');
row++;
if (obj[3] !== null) {
resultStr += '<br />' + obj[3];
}
var whichSeries = obj[6] + '|' + obj[0] + '|' + obj[1] + '|' + obj[2] + '|' + obj[3],
showstartdate = '';
resultStr += '<p /><br />';
});
resultStr += '</ul>';
}
resultStr += '</fieldset>';
$('#searchResults').html(resultStr);
updateSampleText();
myform.loadsection(0);
});
}
if (null !== obj[3]){
var startDate = new Date(obj[3]);
var today = new Date();
showstartdate = '&nbsp;<span class="stepone-result-date">('
+ (startDate > today ? 'will debut' : 'started')
+ ' on ' + obj[3] + ')</span>';
}
$('#addShowButton').click(function () {
// if they haven't picked a show don't let them submit
if (!$("input:radio[name='whichSeries']:checked").val() && !$("input:hidden[name='whichSeries']").val().length) {
alert('You must choose a show to continue');
return false;
}
resultStr += '<div' + rowType + '>'
+ '<input id="whichSeries" type="radio"'
+ ' class="stepone-result-radio"'
+ ' style="float:left;margin-top:4px"'
+ ' title="Add show <span style=\'color: rgb(66, 139, 202)\'>' + obj[1] + '</span>"'
+ ' name="whichSeries"'
+ ' value="' + whichSeries + '"'
+ checked
+ ' />'
+ '<div style="margin-left:20px">'
+ '<a'
+ ' class="stepone-result-title"'
+ ' style="margin-left:5px"'
+ ' title="View <span class=\'boldest\'>Trakt</span> detail for <span style=\'color: rgb(66, 139, 202)\'>' + obj[1] + '</span>"'
+ ' href="' + anonURL + obj[0] + '"'
+ ' onclick="window.open(this.href, \'_blank\'); return false;"'
+ '>' + obj[1] + '</a>'
+ showstartdate
+ (null == obj[6] ? ''
: '&nbsp;'
+ '<span class="stepone-result-db grey-text">'
+ '<a class="service" href="' + anonURL + obj[7] + '"'
+ ' onclick="window.open(this.href, \'_blank\'); return false;"'
+ ' title="View <span class=\'boldest\'>' + obj[4] + '</span> detail for <span style=\'color: rgb(66, 139, 202)\'>' + obj[1] + '</span>"'
+ '>'
+ '<img alt="' + obj[4] + '" height="16" width="16" src="' + sbRoot + '/images/' + obj[5] + '" />'
+ ''
+ '</a>'
+ '</span>'
)
+ (null == obj[10] ? ''
: '&nbsp;'
+ '<span class="stepone-result-db grey-text">'
+ '<a class="service" href="' + anonURL + obj[11] + '"'
+ ' onclick="window.open(this.href, \'_blank\'); return false;"'
+ ' title="View <span class=\'boldest\'>' + obj[8] + '</span> detail for <span style=\'color: rgb(66, 139, 202)\'>' + obj[1] + '</span>"'
+ '>'
+ '<img alt="' + obj[8] + '" height="16" width="16" src="' + sbRoot + '/images/' + obj[9] + '" />'
+ ''
+ '</a>'
+ '</span>'
)
+ (null == obj[2] ? ''
: '&nbsp;<div class="stepone-result-overview grey-text">' + obj[2] + '</div>')
+ '</div></div>';
});
}
$('#recommendedShowsForm').submit();
});
$('#searchResults').html(
'<fieldset>' + "\n" + '<legend class="legendStep" style="margin-bottom: 15px">'
+ (0 < row ? row : 'No')
+ ' recommended result' + (1 == row ? '' : 's') + '...</legend>' + "\n"
+ resultStr
+ '</fieldset>'
);
updateSampleText();
myform.loadsection(0);
$('.stepone-result-radio, .stepone-result-title, .service').each(addQTip);
}
);
}
$('#qualityPreset').change(function () {
myform.loadsection(2);
});
$('#addShowButton').click(function () {
// if they haven't picked a show don't let them submit
if (!$('input:radio[name="whichSeries"]:checked').val()
&& !$('input:hidden[name="whichSeries"]').val().length) {
alert('You must choose a show to continue');
return false;
}
$('#addShowForm').submit();
});
var myform = new formtowizard({
formid: 'recommendedShowsForm',
revealfx: ['slide', 500],
oninit: function () {
getRecommendedShows();
updateSampleText();
}
});
$('#qualityPreset').change(function (){
myform.loadsection(2);
});
function goToStep(num) {
$('.step').each(function () {
if ($.data(this, 'section') + 1 == num) {
$(this).click();
}
});
}
var myform = new FormToWizard({
fieldsetborderwidth: 0,
formid: 'addShowForm',
revealfx: ['slide', 500],
oninit: function (){
getRecommendedShows();
updateSampleText();
}
});
function updateSampleText() {
// if something's selected then we have some behavior to figure out
function goToStep(num){
$('.step').each(function (){
if ($.data(this, 'section') + 1 == num){
$(this).click();
}
});
}
var show_name, sep_char;
// if they've picked a radio button then use that
if ($('input:radio[name=whichSeries]:checked').length) {
show_name = $('input:radio[name=whichSeries]:checked').val().split('|')[2];
} else {
show_name = '';
}
function updateSampleText(){
// if something's selected then we have some behavior to figure out
var sample_text = 'Adding show <b>' + show_name + '</b> into <b>';
var elRadio = $('input:radio[name="whichSeries"]:checked'),
elFullShowPath = $('#fullShowPath'),
sep_char = '',
root_dirs = $('#rootDirs'),
// if they've picked a radio button then use that
show_name = (elRadio.length ? elRadio.val().split('|')[2] : ''),
sample_text = '<p>Adding show <span class="show-name">' + show_name + '</span>'
+ ('' == show_name ? 'into<br />' : '<br />into')
+ ' <span class="show-dest">';
// if we have a root dir selected, figure out the path
if ($("#rootDirs option:selected").length) {
var root_dir_text = $('#rootDirs option:selected').val();
if (root_dir_text.indexOf('/') >= 0) {
sep_char = '/';
} else if (root_dir_text.indexOf('\\') >= 0) {
sep_char = '\\';
} else {
sep_char = '';
}
// if we have a root dir selected, figure out the path
if (root_dirs.find('option:selected').length){
var root_dir_text = root_dirs.find('option:selected').val();
if (0 <= root_dir_text.indexOf('/')){
sep_char = '/';
} else if (0 <= root_dir_text.indexOf('\\')){
sep_char = '\\';
}
if (root_dir_text.substr(sample_text.length - 1) != sep_char) {
root_dir_text += sep_char;
}
root_dir_text += '<i>||</i>' + sep_char;
root_dir_text += (sep_char != root_dir_text.substr(sample_text.length - 1)
? sep_char : '')
+ '<i>||</i>' + sep_char;
sample_text += root_dir_text;
} else if ($('#fullShowPath').length && $('#fullShowPath').val().length) {
sample_text += $('#fullShowPath').val();
} else {
sample_text += 'unknown dir.';
}
sample_text += root_dir_text;
} else if (elFullShowPath.length && elFullShowPath.val().length){
sample_text += elFullShowPath.val();
} else {
sample_text += 'unknown dir.';
}
sample_text += '</b>';
sample_text += '</span></p>';
// if we have a show name then sanitize and use it for the dir name
if (show_name.length) {
$.get(sbRoot + '/home/addShows/sanitizeFileName', {name: show_name}, function (data) {
$('#displayText').html(sample_text.replace('||', data));
});
// if not then it's unknown
} else {
$('#displayText').html(sample_text.replace('||', '??'));
}
// if we have a show name then sanitize and use it for the dir name
if (show_name.length){
$.get(sbRoot + '/home/addShows/sanitizeFileName', {name: show_name}, function (data){
$('#displayText').html(sample_text.replace('||', data));
});
// if not then it's unknown
} else {
$('#displayText').html(sample_text.replace('||', '??'));
}
// also toggle the add show button
if (($("#rootDirs option:selected").length || ($('#fullShowPath').length && $('#fullShowPath').val().length)) &&
($('input:radio[name=whichSeries]:checked').length)) {
$('#addShowButton').attr('disabled', false);
} else {
$('#addShowButton').attr('disabled', true);
}
}
// also toggle the add show button
$('#addShowButton').attr('disabled',
((root_dirs.find('option:selected').length
|| (elFullShowPath.length && elFullShowPath.val().length))
&& elRadio.length
? false : true));
}
$('#rootDirText').change(updateSampleText);
$('#whichSeries').live('change', updateSampleText);
var addQTip = (function(){
$(this).css('cursor', 'help');
$(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-bootstrap qtip-shadow ui-tooltip-sb'
}
});
});
$('#rootDirText').change(updateSampleText);
$('#searchResults').on('click', '.stepone-result-radio', updateSampleText);
});

View file

@ -2810,7 +2810,7 @@ class NewHomeAddShows(MainHandler):
cur_dir = {
'dir': cur_path,
'display_dir': '<b>' + ek.ek(os.path.dirname, cur_path) + os.sep + '</b>' + ek.ek(
'display_dir': '<span class="filepath">' + ek.ek(os.path.dirname, cur_path) + os.sep + '</span>' + ek.ek(
os.path.basename,
cur_path),
}
@ -2827,6 +2827,9 @@ class NewHomeAddShows(MainHandler):
indexer_id = show_name = indexer = None
for cur_provider in sickbeard.metadata_provider_dict.values():
if indexer_id and show_name:
continue
(indexer_id, show_name, indexer) = cur_provider.retrieveShowMetadata(cur_path)
# default to TVDB if indexer was not detected
@ -2854,6 +2857,10 @@ class NewHomeAddShows(MainHandler):
Display the new show page which collects a tvdb id, folder, and extra options and
posts them to addNewShow
"""
self.set_header('Cache-Control', 'no-cache, no-store, must-revalidate')
self.set_header('Pragma', 'no-cache')
self.set_header('Expires', '0')
t = PageTemplate(headers=self.request.headers, file="home_newShow.tmpl")
t.submenu = HomeMenu()
@ -2899,6 +2906,10 @@ class NewHomeAddShows(MainHandler):
Display the new show page which collects a tvdb id, folder, and extra options and
posts them to addNewShow
"""
self.set_header('Cache-Control', 'no-cache, no-store, must-revalidate')
self.set_header('Pragma', 'no-cache')
self.set_header('Expires', '0')
t = PageTemplate(headers=self.request.headers, file="home_recommendedShows.tmpl")
t.submenu = HomeMenu()
@ -2920,11 +2931,21 @@ class NewHomeAddShows(MainHandler):
return
map(final_results.append,
([int(show['tvdb_id'] or 0) if sickbeard.TRAKT_DEFAULT_INDEXER == 1 else int(show['tvdb_id'] or 0),
show['url'], show['title'], show['overview'],
datetime.date.fromtimestamp(int(show['first_aired']) / 1000.0).strftime('%Y%m%d')] for show in
recommendedlist if not helpers.findCertainShow(sickbeard.showList, indexerid=int(show['tvdb_id']))))
([show['url'],
show['title'],
show['overview'],
sbdatetime.sbdatetime.sbfdate(datetime.date.fromtimestamp(int(show['first_aired']))),
sickbeard.indexerApi(1).name,
sickbeard.indexerApi(1).config['icon'],
int(show['tvdb_id'] or 0),
'%s%s' % (sickbeard.indexerApi(1).config['show_url'], int(show['tvdb_id'] or 0)),
sickbeard.indexerApi(2).name,
sickbeard.indexerApi(2).config['icon'],
int(show['tvrage_id'] or 0),
'%s%s' % (sickbeard.indexerApi(2).config['show_url'], int(show['tvrage_id'] or 0))
] for show in recommendedlist if not helpers.findCertainShow(sickbeard.showList, indexerid=int(show['tvdb_id']))))
self.set_header('Content-Type', 'application/json')
return json.dumps({'results': final_results})
def addRecommendedShow(self, whichSeries=None, indexerLang="en", rootDir=None, defaultStatus=None,