diff --git a/NzbDrone.Core/Providers/SceneMappingProvider.cs b/NzbDrone.Core/Providers/SceneMappingProvider.cs index f4520e723..ad70a6d65 100644 --- a/NzbDrone.Core/Providers/SceneMappingProvider.cs +++ b/NzbDrone.Core/Providers/SceneMappingProvider.cs @@ -82,5 +82,22 @@ namespace NzbDrone.Core.Providers if (count == 0) UpdateMappings(); } + + public virtual bool SubmitMapping(int id, string postTitle) + { + Logger.Trace("Parsing example post"); + var episodeParseResult = Parser.ParseTitle(postTitle); + var cleanTitle = episodeParseResult.CleanTitle; + var title = episodeParseResult.SeriesTitle.Replace('.', ' '); + Logger.Trace("Example post parsed. CleanTitle: {0}, Title: {1}", cleanTitle, title); + + var newMapping = String.Format("/SceneMapping/AddPending?cleanTitle={0}&id={1}&title={2}", cleanTitle, id, title); + var response = _httpProvider.DownloadString(_configProvider.ServiceRootUrl + newMapping); + + if (JsonConvert.DeserializeObject(response).Equals("Ok")) + return true; + + return false; + } } } diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/ActionButton.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/ActionButton.css new file mode 100644 index 000000000..4727720a2 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/ActionButton.css @@ -0,0 +1,22 @@ +.actionButton +{ + margin: 5px; + padding: 2px 5px; + background-repeat: no-repeat; + background-position: 5px center; + background-color: #cccccc; + display: inline-block; + font-size: 15px; +} + +.actionButton img +{ + cursor: pointer; + vertical-align: middle; + position: relative; + bottom: 3px; +} + +.delete +{ +} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/css/jquery.dataTables.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/css/jquery.dataTables.css new file mode 100644 index 000000000..cd31baaf4 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/css/jquery.dataTables.css @@ -0,0 +1,310 @@ + +/* + * Table + */ +table.dataTable { + margin: 0 auto; + clear: both; + width: 100%; + border-style: none; + border-width: 1px; + border-spacing: 2px; + border-color: white; + border-collapse: collapse; +} + +table.dataTable thead th { + font-family: "Segoe UI Light" , "Open Sans" , "Segoe UI" , sans-serif; + border-width: 300; + font-size: 17px; + padding: 2px; + border-style: none; + border-color: #EEEEEE; + padding-left: 7px; + text-align: left; + background-color: white; + font-weight: lighter; + cursor: pointer; + *cursor: hand; +} + +table.dataTable tfoot th +{ + padding: 3px 18px 3px 10px; + border-top: 1px solid black; + font-weight: bold; +} + +table.dataTable td { + /*padding: 3px 10px;*/ + border-width: 1px; + border-style: solid; + border-color: #EEEEEE; + padding: 0px 8px 0px 8px; +} + +table.dataTable td.center, +table.dataTable td.dataTables_empty { + text-align: center; +} + +table.dataTable tr.odd { background-color: white; } +table.dataTable tr.even { background-color: #F0F5FF; } + +/* Disable Sorting Highlighting +table.dataTable tr.odd td.sorting_1 { background-color: #D3D6FF; } +table.dataTable tr.odd td.sorting_2 { background-color: #DADCFF; } +table.dataTable tr.odd td.sorting_3 { background-color: #E0E2FF; } +table.dataTable tr.even td.sorting_1 { background-color: #EAEBFF; } +table.dataTable tr.even td.sorting_2 { background-color: #F2F3FF; } +table.dataTable tr.even td.sorting_3 { background-color: #F9F9FF; } +*/ + + +/* + * Table wrapper + */ +.dataTables_wrapper { + position: relative; + clear: both; + *zoom: 1; +} + + +/* + * Page length menu + */ +.dataTables_length { + float: left; +} + + +/* + * Filter + */ +.dataTables_filter { + float: right; + text-align: right; +} + + +/* + * Table information + */ +.dataTables_info { + clear: both; + float: right; +} + + +/* + * Pagination + */ +.dataTables_paginate { + float: left; + text-align: right; +} + +/* Two button pagination - previous / next */ +/*.paginate_disabled_previous, +.paginate_enabled_previous, +.paginate_disabled_next, +.paginate_enabled_next { + height: 19px; + float: left; + cursor: pointer; + *cursor: hand; + color: #111 !important; +} +.paginate_disabled_previous:hover, +.paginate_enabled_previous:hover, +.paginate_disabled_next:hover, +.paginate_enabled_next:hover { + text-decoration: none !important; +} +.paginate_disabled_previous:active, +.paginate_enabled_previous:active, +.paginate_disabled_next:active, +.paginate_enabled_next:active { + outline: none; +} + +.paginate_disabled_previous, +.paginate_disabled_next { + color: #666 !important; +} +.paginate_disabled_previous, +.paginate_enabled_previous { + padding-left: 23px; +} +.paginate_disabled_next, +.paginate_enabled_next { + padding-right: 23px; + margin-left: 10px; +} + +.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } +.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } +.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } + +.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } +.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } +.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } +*/ +/* Four button pagination - first / previous / next / last */ +.paginate_disabled_previous, +.paginate_enabled_previous, +.paginate_disabled_next, +.paginate_enabled_next, +.paginate_disabled_first, +.paginate_enabled_first, +.paginate_disabled_last, +.paginate_enabled_last { + height: 19px; + float: left; + cursor: pointer; + *cursor: hand; + color: #111 !important; +} +.paginate_disabled_previous:hover, +.paginate_enabled_previous:hover, +.paginate_disabled_next:hover, +.paginate_enabled_next:hover, +.paginate_disabled_first:hover, +.paginate_enabled_first:hover, +.paginate_disabled_last:hover, +.paginate_enabled_last:hover { + text-decoration: none !important; +} +.paginate_disabled_previous:active, +.paginate_enabled_previous:active, +.paginate_disabled_next:active, +.paginate_enabled_next:active, +.paginate_disabled_first:active, +.paginate_enabled_first:active, +.paginate_disabled_last:active, +.paginate_enabled_last:active { + outline: none; +} + +.paginate_disabled_previous, +.paginate_disabled_next, +.paginate_disabled_first, +.paginate_disabled_last { + color: #666 !important; +} +.paginate_disabled_previous, +.paginate_enabled_previous, +.paginate_disabled_first, +.paginate_enabled_first { + padding-left: 23px; +} +.paginate_disabled_next, +.paginate_enabled_next, +.paginate_disabled_last, +.paginate_enabled_last { + padding-right: 23px; + margin-left: 10px; +} + +.paginate_enabled_first { background: url('../images/back_enabled.png') no-repeat top left; } +.paginate_enabled_first:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } +.paginate_disabled_first { background: url('../images/back_disabled.png') no-repeat top left; } + +.paginate_enabled_previous { background: url('../images/back_enabled.png') no-repeat top left; } +.paginate_enabled_previous:hover { background: url('../images/back_enabled_hover.png') no-repeat top left; } +.paginate_disabled_previous { background: url('../images/back_disabled.png') no-repeat top left; } + +.paginate_enabled_next { background: url('../images/forward_enabled.png') no-repeat top right; } +.paginate_enabled_next:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } +.paginate_disabled_next { background: url('../images/forward_disabled.png') no-repeat top right; } + +.paginate_enabled_last { background: url('../images/forward_enabled.png') no-repeat top right; } +.paginate_enabled_last:hover { background: url('../images/forward_enabled_hover.png') no-repeat top right; } +.paginate_disabled_last { background: url('../images/forward_disabled.png') no-repeat top right; } + +/* Full number pagination */ +.paging_full_numbers { + height: 22px; + line-height: 22px; +} +.paging_full_numbers a:active { + outline: none +} +.paging_full_numbers a:hover { + text-decoration: none; +} + +.paging_full_numbers a.paginate_button, +.paging_full_numbers a.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; + color: #333 !important; +} + +.paging_full_numbers a.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers a.paginate_button:hover { + background-color: #ccc; + text-decoration: none !important; +} + +.paging_full_numbers a.paginate_active { + background-color: #99B3FF; +} + + +/* + * Processing indicator + */ +.dataTables_processing { + position: absolute; + top: 50%; + left: 50%; + width: 250px; + height: 30px; + margin-left: -125px; + margin-top: -15px; + padding: 14px 0 2px 0; + border: 1px solid #ddd; + text-align: center; + color: #999; + font-size: 14px; + background-color: white; +} + + +/* + * Sorting + */ +.sorting { background: url('../images/sort_both.png') no-repeat center right; } +.sorting_asc { background: url('../images/sort_asc.png') no-repeat center right; } +.sorting_desc { background: url('../images/sort_desc.png') no-repeat center right; } + +.sorting_asc_disabled { background: url('../images/sort_asc_disabled.png') no-repeat center right; } +.sorting_desc_disabled { background: url('../images/sort_desc_disabled.png') no-repeat center right; } + +table.dataTable th:active { + outline: none; +} + + +/* + * Scrolling + */ +.dataTables_scroll { + clear: both; +} + +.dataTables_scrollBody { + *margin-top: -1px; +} + diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/Sorting icons.psd b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/Sorting icons.psd new file mode 100644 index 000000000..53b2e0685 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/Sorting icons.psd differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_disabled.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_disabled.png new file mode 100644 index 000000000..881de7976 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_disabled.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_enabled.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_enabled.png new file mode 100644 index 000000000..c608682b0 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_enabled.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_enabled_hover.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_enabled_hover.png new file mode 100644 index 000000000..d300f1064 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/back_enabled_hover.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/favicon.ico b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/favicon.ico new file mode 100644 index 000000000..6eeaa2a0d Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/favicon.ico differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_disabled.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_disabled.png new file mode 100644 index 000000000..6a6ded7de Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_disabled.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_enabled.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_enabled.png new file mode 100644 index 000000000..a4e6b5384 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_enabled.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_enabled_hover.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_enabled_hover.png new file mode 100644 index 000000000..fc46c5ebf Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/forward_enabled_hover.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_asc.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_asc.png new file mode 100644 index 000000000..a88d7975f Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_asc.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_asc_disabled.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_asc_disabled.png new file mode 100644 index 000000000..4e144cf0b Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_asc_disabled.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_both.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_both.png new file mode 100644 index 000000000..18670406b Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_both.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_desc.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_desc.png new file mode 100644 index 000000000..def071ed5 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_desc.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_desc_disabled.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_desc_disabled.png new file mode 100644 index 000000000..7824973cc Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/DataTables-1.9.0/media/images/sort_desc_disabled.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Grid.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/Grid.css new file mode 100644 index 000000000..855e20f71 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/Grid.css @@ -0,0 +1,88 @@ +.gridImage , .gridAction +{ + width: 18px; + height: 18px; + padding: 3px 1px; + margin: 0px; + vertical-align: middle; + border: none; +} + +.gridAction:hover +{ + cursor: pointer; +} + +.statusImage:hover { + background-color: white; +} + +/* Custom Grid */ +.seriesTable +{ + width: 100%; + border-style: none; + border-collapse: collapse; +} + +.seriesTable th +{ + font-family: "Segoe UI Light" , "Open Sans" , "Segoe UI" , sans-serif; + font-size: 17px; + padding: 2px; + border-style: none; + padding-left: 7px; + text-align: left; + background-color: white; + font-weight: lighter; +} + +.seriesTable td +{ + border-style: solid; + border-color: #EEEEEE; + border-width: 1px; + padding: 0px 8px 0px 8px; +} + +.title-row +{ + font-family: "Segoe UI Light" , "Open Sans" , "Segoe UI" , sans-serif; + font-size: 17px; + background-color: grey; + font-weight: lighter; + color: white; +} + +.detail-row +{ + display: none; +} + +/* Colour alternating rows */ +.seriesTable .alt-row +{ + background: #f0f5ff; +} + +/* Episode Grid Row Colouring */ +.episodeIgnored +{ + background: lightgray; +} + + + +.episodeMissing +{ + background-color: #f5c5c5; +} + +/*Hidden Grid to prevent FOUSC*/ +.hidden-grid { + display: none; +} + +.grid-container { + overflow: hidden; +} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Downloading.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Downloading.png new file mode 100644 index 000000000..f49538894 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Downloading.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Failed.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Failed.png new file mode 100644 index 000000000..0da860271 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Failed.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Gear.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Gear.png new file mode 100644 index 000000000..2e4fedcaa Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Gear.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Newzbin.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Newzbin.png new file mode 100644 index 000000000..66ebe4329 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Newzbin.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Newznab.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Newznab.png new file mode 100644 index 000000000..a6ffe3238 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Newznab.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/NzbMatrix.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/NzbMatrix.png new file mode 100644 index 000000000..95c561e45 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/NzbMatrix.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Nzbs.org.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Nzbs.org.png new file mode 100644 index 000000000..36e68a30f Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Nzbs.org.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/NzbsRus.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/NzbsRus.png new file mode 100644 index 000000000..ed22b8ee4 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/NzbsRus.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Unknown.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Unknown.png new file mode 100644 index 000000000..7ac1ae7b6 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Indexers/Unknown.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Missing.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Missing.png new file mode 100644 index 000000000..15c3101d0 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Missing.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/NotAired.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/NotAired.png new file mode 100644 index 000000000..9a1158e25 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/NotAired.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Plus.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Plus.png new file mode 100644 index 000000000..dbb1e9449 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Plus.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Promote.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Promote.png new file mode 100644 index 000000000..ead6f552e Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Promote.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Ready.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Ready.png new file mode 100644 index 000000000..8501a8b58 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Ready.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Rename.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Rename.png new file mode 100644 index 000000000..bfeb37431 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Rename.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Search.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Search.png new file mode 100644 index 000000000..c445e5c6d Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Search.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Unpacking.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Unpacking.png new file mode 100644 index 000000000..7ed2b5905 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/Unpacking.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/VideoFolder.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/VideoFolder.png new file mode 100644 index 000000000..566c41eb7 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/VideoFolder.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/X.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/X.png new file mode 100644 index 000000000..445702cc8 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/X.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/XbmcNotification.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/XbmcNotification.png new file mode 100644 index 000000000..abbbe37bc Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/XbmcNotification.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ajax-loader.gif b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ajax-loader.gif new file mode 100644 index 000000000..2e9d85eed Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ajax-loader.gif differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/arrow.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/arrow.png new file mode 100644 index 000000000..7e687e6ae Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/arrow.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/background.jpg b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/background.jpg new file mode 100644 index 000000000..64f983548 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/background.jpg differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/blue.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/blue.png new file mode 100644 index 000000000..9a8e03a69 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/blue.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/close.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/close.png new file mode 100644 index 000000000..4e05dcd87 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/close.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/error.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/error.png new file mode 100644 index 000000000..8b4de1fc8 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/error.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/green.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/green.png new file mode 100644 index 000000000..65f614972 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/green.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/gritter.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/gritter.png new file mode 100644 index 000000000..0ca3bc0a0 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/gritter.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/header.jpg b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/header.jpg new file mode 100644 index 000000000..2a5d8e148 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/header.jpg differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/icon_source.url b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/icon_source.url new file mode 100644 index 000000000..02066ae86 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/icon_source.url @@ -0,0 +1,2 @@ +[InternetShortcut] +URL=http://www.iconfinder.com/search/?q=iconset:onebit diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ignored.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ignored.png new file mode 100644 index 000000000..41423bad2 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ignored.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ignoredNeutral.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ignoredNeutral.png new file mode 100644 index 000000000..a7181b004 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/ignoredNeutral.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/notIgnored.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/notIgnored.png new file mode 100644 index 000000000..4ead4b480 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/notIgnored.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/pause.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/pause.png new file mode 100644 index 000000000..289b66e4b Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/pause.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/play.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/play.png new file mode 100644 index 000000000..8501a8b58 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/play.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/red.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/red.png new file mode 100644 index 000000000..719f81074 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/red.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/redownload.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/redownload.png new file mode 100644 index 000000000..77e12d1c6 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/redownload.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/settings.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/settings.png new file mode 100644 index 000000000..6587d5bc3 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/settings.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/stop.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/stop.png new file mode 100644 index 000000000..c61d557d4 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/stop.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/success.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/success.png new file mode 100644 index 000000000..4dcf07651 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/success.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/x_16.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/x_16.png new file mode 100644 index 000000000..cf640c105 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/x_16.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/yellow.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/yellow.png new file mode 100644 index 000000000..19fea1ac0 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/Images/yellow.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Menu.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/Menu.css new file mode 100644 index 000000000..15ff4e38b --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/Menu.css @@ -0,0 +1,26 @@ +.sub-menu +{ + padding-left: 5px; +} + +.sub-menu li +{ + display: inline; + list-style-type: none; + padding-left: 8px; + padding-right: 12px; + padding-top: 6px; + border-right: 1px solid #F0F0F0; +} + +.sub-menu a +{ + text-decoration: none; + color: #105CD6; +} + +.t-grid .sub-menu +{ + margin-left: -10px; + margin-bottom: 0px; +} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Messages.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/Messages.css new file mode 100644 index 000000000..223f17d87 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/Messages.css @@ -0,0 +1,55 @@ +/*Pinned messages*/ + +.infoBox, .successBox, .warningBox, .errorBox, .validationBox +{ + border: 0px solid; + margin: 10px 0px; + padding: 10px 10px 10px 50px; + background-repeat: no-repeat; + background-position: 10px center; +} +.infoBox +{ + color: #00529B; + background-color: #f4f7f9; + background-image: url(images/blue.png); +} +.successBox +{ + color: #4F8A10; + background-color: #DFF2BF; + background-image: url(images/green.png); +} +.warningBox +{ + color: #9F6000; + background-color: #FEEFB3; + background-image: url(images/yellow.png); +} +.errorBox +{ + color: #D8000C; + background-color: #FFBABA; + background-image: url(images/red.png); +} + +/*Progress Notification*/ +#msgBox +{ + display: none; + height: 30px; + background-color: #272525; + opacity: .9; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); + padding: 10px; + text-align: left; + position: fixed; + z-index: 99; + bottom: 0; + right: 0; + font-size: 20px; + color: White; + text-align: center; + white-space:nowrap; +} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/NzbDrone.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/NzbDrone.css new file mode 100644 index 000000000..4d7a3174d --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/NzbDrone.css @@ -0,0 +1,280 @@ +* +{ + font-family: "Segoe UI" , "Open Sans" , "Segoe UI Light" , sans-serif; +} + +body +{ + background: #191919 url(images/background.jpg) no-repeat right top; + font-size: 13px; + color: #3C3C3C; + background-attachment: fixed; +} + +#centered +{ + margin-right: auto; + width: 85%; + margin-left: auto; + min-width: 850px; + max-width: 1400px; +} + +h1, h2, h3, h4, h5, h6 +{ + font-family: "Segoe UI Light" , "Open Sans" , "Segoe UI" , sans-serif; + color: #3C3C3C; + font-weight: 300; +} + + +fieldset +{ + border-style: solid; + border-color: #065EFE; + border-width: 1px; +} + +a +{ + color: #065EFE; +} + +a:hover +{ + text-decoration: none; +} + +hr +{ + display: none; +} + +/* Menu */ + +#menu +{ + height: 60px; +} + +#menu ul +{ + margin: 0; + padding: 5px 0px 5px 0px; + list-style: none; + line-height: normal; +} + +#menu li +{ + display: block; + float: left; + padding: 5px 15px 2px 10px; +} + +#menu a +{ + display: block; + float: left; + height: 26px; + padding: 0px 5px 7px 5px; + text-decoration: none; + text-align: center; + text-transform: lowercase; + font-size: 21px; + font-weight: normal; + vertical-align: middle; + font-family: "Segoe UI" , "Open Sans" , "Segoe UI Light" , sans-serif; +} + +#menu a:hover +{ + text-decoration: none; +} + +#menu li.current_page_item a +{ + border-bottom: 2px solid; + border-color: #065EFE; +} + +/* Page */ + +#page +{ + background-color: White; + padding: 10px 20px 100px 20px; + min-height: 300px; +} + + + +/** LOGO */ + +#logo +{ + font-family: "Segoe UI Light" , "Open Sans" , "Segoe UI" , sans-serif; + font-weight: 100; + height: 135px; + background: url(images/header.jpg) no-repeat left top; + background-color: #065EFE; + font-size: 90px; + color: #FFFFFF; + text-transform: lowercase; + letter-spacing: -1px; + line-height: normal; + padding-left: 120px; +} + +.stackframe +{ + font-family: Consolas, Monospace; +} + + +/* Footer */ +#footer +{ + margin-top: 5px; + margin-bottom: 30px; + padding: 1px 1px 1px 1px; + color: #065EFE; + text-align: center; + text-decoration: none; +} + + + +.sub-field +{ + width: 70%; + margin-top: 10px; + margin-bottom: 10px; +} + +.config-value +{ + float: right; +} + +.config-checkbox +{ + margin-right: 135px; +} + + +input[type=text], select +{ + font-size: small; + padding: 2px 2px; + border: solid 1px #aacfe4; + width: 200px; + margin: 2px 0 10px 0px; + height: 20px; +} + +select +{ + height: 26px; + min-width: 50px; + margin-left: 10px; +} + +button, input[type="button"], input[type="submit"], input[type="reset"] +{ + margin-left: 10px; +} + +/*select, button, input[type="button"], input[type="submit"], input[type="reset"] +{ + height: 26px; + min-width: 50px; + margin-left: 10px; +} + +/*This allows us to override center the text on the jQuery UI Buttons when we set the height above* +button span, input[type="button"] span, input[type="submit"] span, input[type="reset"] span +{ + margin-top: -3px; +}*/ + +.listButton +{ + padding: 2px 10px 2px 10px; + vertical-align: middle; + margin: 0px; +} + +.hiddenResult +{ + display: none; +} + +/* Add Series */ + +.tvDbSearchResults +{ + width: 400px; +} + +.rootDirectories +{ + width: 400px; +} + +.edit-group +{ + width: 435px; + display: block; + height: 25px; +} + + +.dialog +{ + margin-left: auto; + margin-right: auto; +} + + +.qualitySelector +{ + min-width: 60px; + width: auto; +} + +#quickAdd +{ + position: fixed; + top: 30px; + right: 15px; +} + + +#localSeriesLookup +{ + width: 220px; + float: right; + margin-top: 7px; + margin-bottom: 0px; + border: 0px; + background: rgb(40, 40, 40); + color: rgb(169, 169, 169); + padding: 4px; +} + +.ui-dialog-buttonset .ui-delete-button +{ + background: url("jQueryUI/images/ui-bg_flat_30_b40404_40x100.png") repeat-x scroll 50% 50% #B40404; + border: 1px solid #FFFFFF; + color: #FFFFFF; + font-weight: normal; +} + +.ui-dialog-buttonset .ui-delete-button:active +{ + background: url("jQueryUI/images/ui-bg_flat_30_616161_40x100.png") repeat-x scroll 50% 50% #616161; + border: 1px solid #FFFFFF; + color: #FFFFFF; + font-weight: normal; +} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/Overrides.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/Overrides.css new file mode 100644 index 000000000..5404daae2 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/Overrides.css @@ -0,0 +1,59 @@ +/*jQuery UI*/ +.ui-widget-header +{ + font-weight: normal; +} + +.t-combobox .t-input +{ + line-height: 25px; +} + +.ui-autocomplete +{ + border-color: #333333; + background: #333333; +} + +.ui-autocomplete .ui-state-hover +{ + background: #333333; + border-color: #065EFE; +} + +.ui-menu-item .ui-corner-all +{ + color: #065EFE; +} + +.ui-progressbar-value +{ + background: #065EFE url(./jQueryUI/images/ui-bg_flat_30_065efe_40x100.png) 50% 50% repeat-x; +} + +.ui-dialog .ui-dialog-titlebar, .ui-dialog-title +{ + color: #3C3C3C; + font-size: 30px; + font-family: "Open Sans" , "Segoe UI Light" , "Segoe UI" , sans-serif; + font-weight: 300; + padding-top: 0px; + padding-bottom: 0px; + padding-left: 10px; +} + +.jquery-tabs +{ + margin-top: 10px; +} + +.ui-button .ui-state-default{ + background: none; +} + +/*MiniProfiler*/ + +.profiler-button +{ + opacity: 0.6; +} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png new file mode 100644 index 000000000..263c7568b Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_diagonals-thick_30_a32d00_40x40.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png new file mode 100644 index 000000000..5b5dab2ab Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_0_ffffff_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_0_ffffff_40x100.png new file mode 100644 index 000000000..ac8b229af Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_0_ffffff_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_100__40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_100__40x100.png new file mode 100644 index 000000000..842d6f375 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_100__40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_20_ffffff_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_20_ffffff_40x100.png new file mode 100644 index 000000000..ac8b229af Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_20_ffffff_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_065efe_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_065efe_40x100.png new file mode 100644 index 000000000..9c8ef82ce Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_065efe_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_616161_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_616161_40x100.png new file mode 100644 index 000000000..b913bd7d1 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_616161_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_b40404_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_b40404_40x100.png new file mode 100644 index 000000000..08c16fc87 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_30_b40404_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_40_065efe_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_40_065efe_40x100.png new file mode 100644 index 000000000..9c8ef82ce Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_flat_40_065efe_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_white-lines_10_000000_40x100.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_white-lines_10_000000_40x100.png new file mode 100644 index 000000000..c5187eb35 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-bg_white-lines_10_000000_40x100.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png new file mode 100644 index 000000000..81c5eb0bc Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_98d2fb_256x240.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_9ccdfc_256x240.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_9ccdfc_256x240.png new file mode 100644 index 000000000..2022d2105 Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_9ccdfc_256x240.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_ffffff_256x240.png b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_ffffff_256x240.png new file mode 100644 index 000000000..42f8f992c Binary files /dev/null and b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/images/ui-icons_ffffff_256x240.png differ diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/jquery-ui-1.8.16.custom.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/jquery-ui-1.8.16.custom.css new file mode 100644 index 000000000..a50b1b905 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/jQueryUI/jquery-ui-1.8.16.custom.css @@ -0,0 +1,568 @@ +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { display: none; } +.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } +.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } +.ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } +.ui-helper-clearfix { display: inline-block; } +/* required comment for clearfix to work in Opera \*/ +* html .ui-helper-clearfix { height:1%; } +.ui-helper-clearfix { display:block; } +/* end clearfix */ +.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { cursor: default !important; } + + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } + + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } + + +/* + * jQuery UI CSS Framework 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Theming/API + * + * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=&fwDefault=normal&fsDefault=&cornerRadius=1px&bgColorHeader=ffffff&bgTextureHeader=01_flat.png&bgImgOpacityHeader=0&borderColorHeader=ffffff&fcHeader=000000&iconColorHeader=98d2fb&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=20&borderColorContent=e8e8e8&fcContent=&iconColorContent=9ccdfc&bgColorDefault=616161&bgTextureDefault=01_flat.png&bgImgOpacityDefault=30&borderColorDefault=ffffff&fcDefault=ffffff&iconColorDefault=9ccdfc&bgColorHover=&bgTextureHover=01_flat.png&bgImgOpacityHover=100&borderColorHover=ffffff&fcHover=ffffff&iconColorHover=ffffff&bgColorActive=065efe&bgTextureActive=01_flat.png&bgImgOpacityActive=40&borderColorActive=ffffff&fcActive=ffffff&iconColorActive=ffffff&bgColorHighlight=065efe&bgTextureHighlight=01_flat.png&bgImgOpacityHighlight=30&borderColorHighlight=065efe&fcHighlight=ffffff&iconColorHighlight=ffffff&bgColorError=a32d00&bgTextureError=08_diagonals_thick.png&bgImgOpacityError=30&borderColorError=cd0a0a&fcError=ffffff&iconColorError=ffffff&bgColorOverlay=000000&bgTextureOverlay=11_white_lines.png&bgImgOpacityOverlay=10&opacityOverlay=60&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=0px%20 + */ + + +/* Component containers +----------------------------------*/ +.ui-widget { font-family: ; font-size: ; } +.ui-widget .ui-widget { font-size: 1em; } +.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: ; font-size: 1em; } +.ui-widget-content { border: 1px solid #e8e8e8; background: #ffffff url(images/ui-bg_flat_20_ffffff_40x100.png) 50% 50% repeat-x; color: #; } +.ui-widget-content a { color: #; } +.ui-widget-header { border: 1px solid #ffffff; background: #ffffff url(images/ui-bg_flat_0_ffffff_40x100.png) 50% 50% repeat-x; color: #000000; font-weight: bold; } +.ui-widget-header a { color: #000000; } + +/* Interaction states +----------------------------------*/ +.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #ffffff; background: #616161 url(images/ui-bg_flat_30_616161_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #ffffff; text-decoration: none; } +.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #ffffff; background: # url(images/ui-bg_flat_100__40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-hover a, .ui-state-hover a:hover { color: #ffffff; text-decoration: none; } +.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #ffffff; background: #065efe url(images/ui-bg_flat_40_065efe_40x100.png) 50% 50% repeat-x; font-weight: normal; color: #ffffff; } +.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #ffffff; text-decoration: none; } +.ui-widget :active { outline: none; } + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #065efe; background: #065efe url(images/ui-bg_flat_30_065efe_40x100.png) 50% 50% repeat-x; color: #ffffff; } +.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #ffffff; } +.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #a32d00 url(images/ui-bg_diagonals-thick_30_a32d00_40x40.png) 50% 50% repeat; color: #ffffff; } +.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #ffffff; } +.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #ffffff; } +.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } +.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } +.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { width: 16px; height: 16px; background-image: url(images/ui-icons_9ccdfc_256x240.png); } +.ui-widget-content .ui-icon {background-image: url(images/ui-icons_9ccdfc_256x240.png); } +.ui-widget-header .ui-icon {background-image: url(images/ui-icons_98d2fb_256x240.png); } +.ui-state-default .ui-icon { background-image: url(images/ui-icons_9ccdfc_256x240.png); } +.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-active .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-highlight .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } +.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_ffffff_256x240.png); } + +/* positioning */ +.ui-icon-carat-1-n { background-position: 0 0; } +.ui-icon-carat-1-ne { background-position: -16px 0; } +.ui-icon-carat-1-e { background-position: -32px 0; } +.ui-icon-carat-1-se { background-position: -48px 0; } +.ui-icon-carat-1-s { background-position: -64px 0; } +.ui-icon-carat-1-sw { background-position: -80px 0; } +.ui-icon-carat-1-w { background-position: -96px 0; } +.ui-icon-carat-1-nw { background-position: -112px 0; } +.ui-icon-carat-2-n-s { background-position: -128px 0; } +.ui-icon-carat-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -64px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -64px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 0 -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-off { background-position: -96px -144px; } +.ui-icon-radio-on { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 1px; -webkit-border-top-left-radius: 1px; -khtml-border-top-left-radius: 1px; border-top-left-radius: 1px; } +.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 1px; -webkit-border-top-right-radius: 1px; -khtml-border-top-right-radius: 1px; border-top-right-radius: 1px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 1px; -webkit-border-bottom-left-radius: 1px; -khtml-border-bottom-left-radius: 1px; border-bottom-left-radius: 1px; } +.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 1px; -webkit-border-bottom-right-radius: 1px; -khtml-border-bottom-right-radius: 1px; border-bottom-right-radius: 1px; } + +/* Overlays */ +.ui-widget-overlay { background: #000000 url(images/ui-bg_white-lines_10_000000_40x100.png) 50% 50% repeat; opacity: .60;filter:Alpha(Opacity=60); } +.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 0px ; -khtml-border-radius: 0px ; -webkit-border-radius: 0px ; border-radius: 0px ; }/* + * jQuery UI Resizable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Resizable#theming + */ +.ui-resizable { position: relative;} +.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } +.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } +.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } +.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } +.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } +.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } +.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } +.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } +.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } +.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/* + * jQuery UI Selectable 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectable#theming + */ +.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } +/* + * jQuery UI Accordion 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Accordion#theming + */ +/* IE/Win - Fix animation bug - #4615 */ +.ui-accordion { width: 100%; } +.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } +.ui-accordion .ui-accordion-li-fix { display: inline; } +.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } +.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } +.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } +.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } +.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } +.ui-accordion .ui-accordion-content-active { display: block; } +/* + * jQuery UI Autocomplete 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete#theming + */ +.ui-autocomplete { position: absolute; cursor: default; } + +/* workarounds */ +* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ + +/* + * jQuery UI Menu 1.8.16 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Menu#theming + */ +.ui-menu { + list-style:none; + padding: 2px; + margin: 0; + display:block; + float: left; +} +.ui-menu .ui-menu { + margin-top: -3px; +} +.ui-menu .ui-menu-item { + margin:0; + padding: 0; + zoom: 1; + float: left; + clear: left; + width: 100%; +} +.ui-menu .ui-menu-item a { + text-decoration:none; + display:block; + padding:.2em .4em; + line-height:1.5; + zoom:1; +} +.ui-menu .ui-menu-item a.ui-state-hover, +.ui-menu .ui-menu-item a.ui-state-active { + font-weight: normal; + margin: -1px; +} +/* + * jQuery UI Button 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Button#theming + */ +.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ +.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ +button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ +.ui-button-icons-only { width: 3.4em; } +button.ui-button-icons-only { width: 3.7em; } + +/*button text element */ +.ui-button .ui-button-text { display: block; line-height: 1.4; } +.ui-button-text-only .ui-button-text { padding: .4em 1em; } +.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } +.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } +.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } +.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } +/* no icon support for input elements, provide padding by default */ +input.ui-button { padding: .4em 1em; } + +/*button icon element(s) */ +.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } +.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } +.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } +.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } +.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } + +/*button sets*/ +.ui-buttonset { margin-right: 7px; } +.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } + +/* workarounds */ +button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ +/* + * jQuery UI Dialog 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog#theming + */ +.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } +.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } +.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } +.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } +.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } +.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } +.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } +.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } +.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } +.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } +.ui-draggable .ui-dialog-titlebar { cursor: move; } +/* + * jQuery UI Slider 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Slider#theming + */ +.ui-slider { position: relative; text-align: left; } +.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } +.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } + +.ui-slider-horizontal { height: .8em; } +.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } +.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } +.ui-slider-horizontal .ui-slider-range-min { left: 0; } +.ui-slider-horizontal .ui-slider-range-max { right: 0; } + +.ui-slider-vertical { width: .8em; height: 100px; } +.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } +.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } +.ui-slider-vertical .ui-slider-range-min { bottom: 0; } +.ui-slider-vertical .ui-slider-range-max { top: 0; }/* + * jQuery UI Tabs 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs#theming + */ +.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ +.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } +.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } +.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } +.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } +.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ +.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } +.ui-tabs .ui-tabs-hide { display: none !important; } +/* + * jQuery UI Datepicker 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Datepicker#theming + */ +.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } +.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } +.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } +.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } +.ui-datepicker .ui-datepicker-prev { left:2px; } +.ui-datepicker .ui-datepicker-next { right:2px; } +.ui-datepicker .ui-datepicker-prev-hover { left:1px; } +.ui-datepicker .ui-datepicker-next-hover { right:1px; } +.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } +.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } +.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } +.ui-datepicker select.ui-datepicker-month-year {width: 100%;} +.ui-datepicker select.ui-datepicker-month, +.ui-datepicker select.ui-datepicker-year { width: 49%;} +.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } +.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } +.ui-datepicker td { border: 0; padding: 1px; } +.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } +.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } +.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } +.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } + +/* with multiple calendars */ +.ui-datepicker.ui-datepicker-multi { width:auto; } +.ui-datepicker-multi .ui-datepicker-group { float:left; } +.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } +.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } +.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } +.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } +.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } +.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } +.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } + +/* RTL support */ +.ui-datepicker-rtl { direction: rtl; } +.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } +.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } +.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } +.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } +.ui-datepicker-rtl .ui-datepicker-group { float:right; } +.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } +.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } + +/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ +.ui-datepicker-cover { + display: none; /*sorry for IE5*/ + display/**/: block; /*sorry for IE5*/ + position: absolute; /*must have*/ + z-index: -1; /*must have*/ + filter: mask(); /*must have*/ + top: -4px; /*must have*/ + left: -4px; /*must have*/ + width: 200px; /*must have*/ + height: 200px; /*must have*/ +}/* + * jQuery UI Progressbar 1.8.16 + * + * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar#theming + */ +.ui-progressbar { height:2em; text-align: left; } +.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Content/jquery.gritter.css b/NzbDrone.Services/NzbDrone.Services.Service/Content/jquery.gritter.css new file mode 100644 index 000000000..2e9bfa6df --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Content/jquery.gritter.css @@ -0,0 +1,118 @@ +/* the norm */ +#gritter-notice-wrapper +{ + position: fixed; + top: 60px; + right: 20px; + width: 301px; + z-index: 9999; +} +#gritter-notice-wrapper.top-left +{ + left: 20px; + right: auto; +} +#gritter-notice-wrapper.bottom-right +{ + top: auto; + left: auto; + bottom: 20px; + right: 20px; +} +#gritter-notice-wrapper.bottom-left +{ + top: auto; + right: auto; + bottom: 20px; + left: 20px; +} +.gritter-item-wrapper +{ + position: relative; + margin: 0; +} +.gritter-top +{ + height: 10px; +} +.hover .gritter-top +{ + background-position: right -30px; +} +.gritter-bottom +{ + height: 8px; + margin: 0; +} +.hover .gritter-bottom +{ + background-position: bottom right; +} +.gritter-item +{ + display: block; + background-color: #272525; + opacity: .9; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=85)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85); + color: #eee; + padding: 8px 11px; + font-size: 11px; + border-bottom-style: solid; + border-bottom-width: 5px; +} + +.gritter-success .gritter-item +{ + border-color: rgb(100, 135, 46); +} + +.gritter-fail .gritter-item +{ + border-color: rgb(212, 44, 44); +} + +.hover .gritter-item +{ + background-position: right -40px; +} +.gritter-item p +{ + padding: 0; + margin: 0; +} +.gritter-close +{ + display: none; + position: absolute; + top: 0px; + right: -10px; + background: url(../content/images/gritter.png) no-repeat left top; + cursor: pointer; + width: 30px; + height: 30px; +} +.gritter-title +{ + font-size: 20px; + padding: 0; + display: block; + line-height: 1; + padding-bottom: 10px; + text-shadow: 1px 1px #000; /* Not supported by IE :( */ +} +.gritter-image +{ + width: 48px; + height: 48px; + float: left; +} +.gritter-with-image, .gritter-without-image +{ + padding: 0 0 5px 0; +} +.gritter-with-image +{ + width: 220px; + float: right; +} diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/SceneMappingController.cs b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/SceneMappingController.cs index 3b2ab0174..14a5b5ff9 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Controllers/SceneMappingController.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Controllers/SceneMappingController.cs @@ -1,6 +1,10 @@ -using System.Linq; +using System; +using System.Linq; +using System.Web; using System.Web.Mvc; +using Newtonsoft.Json; using NzbDrone.Services.Service.Providers; +using NzbDrone.Services.Service.Repository; namespace NzbDrone.Services.Service.Controllers { @@ -23,11 +27,67 @@ namespace NzbDrone.Services.Service.Controllers } [HttpGet] - public JsonResult Pending() + [Authorize(Roles = "Users")] + public ActionResult Pending() { var mappings = _sceneMappingProvider.AllPending(); + var serialized = JsonConvert.SerializeObject(mappings); - return Json(mappings, JsonRequestBehavior.AllowGet); + return View((object)serialized); + } + + [HttpPost] + [Authorize(Roles = "Users")] + public string UpdatePending(int id, string value, int columnId) + { + var mapping = _sceneMappingProvider.GetPending(id); + + if (columnId == 0) + mapping.CleanTitle = value.Trim(); + + if (columnId == 1) + mapping.Id = Int32.Parse(value); + + if (columnId == 2) + mapping.Title = value.Trim(); + + _sceneMappingProvider.Update(mapping); + + return value; + } + + [HttpPost] + [Authorize(Roles = "Users")] + public JsonResult AddPending(string cleanTitle, int id, string title) + { + _sceneMappingProvider.Insert(new PendingSceneMapping { CleanTitle = cleanTitle, Id = id, Title = title }); + + return Json("Ok", JsonRequestBehavior.AllowGet); + } + + [Authorize(Roles = "Users")] + public JsonResult Promote(int mappingId) + { + _sceneMappingProvider.Promote(mappingId); + HttpResponse.RemoveOutputCacheItem(VirtualPathUtility.ToAbsolute("~/SceneMapping/Active")); + + return Json("Ok", JsonRequestBehavior.AllowGet); + } + + [Authorize(Roles = "Users")] + public JsonResult PromoteAll() + { + _sceneMappingProvider.PromoteAll(); + return Json("Ok", JsonRequestBehavior.AllowGet); + } + + [Authorize(Roles = "Users")] + public JsonResult Delete(int mappingId) + { + _sceneMappingProvider.DeletePending(mappingId); + HttpResponse.RemoveOutputCacheItem(VirtualPathUtility.ToAbsolute("~/SceneMapping/Active")); + + return Json("Ok", JsonRequestBehavior.AllowGet); } } } \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Global.asax.cs b/NzbDrone.Services/NzbDrone.Services.Service/Global.asax.cs index 17c6c8f47..50e388b73 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Global.asax.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Global.asax.cs @@ -1,5 +1,6 @@ using System; using System.Data.Common; +using System.Linq; using System.Web; using System.Web.Mvc; using System.Web.Routing; @@ -35,7 +36,9 @@ namespace NzbDrone.Services.Service RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); + var razor = ViewEngines.Engines.Single(e => e is RazorViewEngine); ViewEngines.Engines.Clear(); + ViewEngines.Engines.Add(razor); ModelBinders.Binders.DefaultBinder = new JsonModelBinder(); } diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs b/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs new file mode 100644 index 000000000..94848660b --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Helpers/HtmlIncludeExtentions.cs @@ -0,0 +1,48 @@ +using System; +using System.IO; +using System.Linq; +using System.Web.Mvc; +using NzbDrone.Common; + +namespace NzbDrone.Web.Helpers +{ + public static class HtmlIncludeExtentions + { + private static readonly string versionString; + private static readonly bool isProduction; + + static HtmlIncludeExtentions() + { + versionString = new EnviromentProvider().Version.ToString().Replace('.', '_'); + isProduction = EnviromentProvider.IsProduction; + } + + public static MvcHtmlString IncludeScript(this HtmlHelper helper, string filename) + { + var relativePath = "/Scripts/" + filename; + VerifyFile(helper, relativePath); + return MvcHtmlString.Create(String.Format("", relativePath, versionString)); + } + + public static MvcHtmlString IncludeCss(this HtmlHelper helper, string filename) + { + var relativePath = "/Content/" + filename; + VerifyFile(helper, relativePath); + return MvcHtmlString.Create(String.Format("", relativePath, versionString)); + } + + private static void VerifyFile(HtmlHelper helper, string filename) + { + if (isProduction) + return; + + var path = helper.ViewContext.RequestContext.HttpContext.Server.MapPath(filename); + + if (!File.Exists(path)) + { + throw new FileNotFoundException("Included static resource was not found.", path); + } + + } + } +} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Migrations/Migration20120226.cs b/NzbDrone.Services/NzbDrone.Services.Service/Migrations/Migration20120226.cs new file mode 100644 index 000000000..e78a6706d --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Migrations/Migration20120226.cs @@ -0,0 +1,35 @@ +using System; +using System.Data; +using System.Linq; +using Migrator.Framework; + +namespace NzbDrone.Services.Service.Migrations +{ + [Migration(20120226)] + public class Migration20120226 : Migration + { + public override void Up() + { + Database.RenameTable("PendingSceneMappings", "OldPendingSceneMappings"); + + Database.AddTable("PendingSceneMappings", new[] + { + new Column("MappingId", DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity), + new Column("CleanTitle", DbType.String, ColumnProperty.NotNull), + new Column("Id", DbType.Int32, ColumnProperty.NotNull), + new Column("Title", DbType.String, ColumnProperty.NotNull) + }); + + Database.ExecuteNonQuery(@"INSERT INTO PendingSceneMappings (CleanTitle, Id, Title) + SELECT CleanTitle, Id, Title + FROM OldPendingSceneMappings"); + + Database.RemoveTable("OldPendingSceneMappings"); + } + + public override void Down() + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj b/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj index cfb8153fc..db988fd2d 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj +++ b/NzbDrone.Services/NzbDrone.Services.Service/NzbDrone.Services.Service.csproj @@ -78,7 +78,16 @@ - + + True + + + True + + + + True + @@ -93,7 +102,97 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Designer @@ -110,6 +209,8 @@ + + @@ -149,6 +250,18 @@ NzbDrone.Core + + + + + + + + + + + + @@ -160,7 +273,7 @@ True 62182 / - http://localhost:1542/ + http://localhost:62182/ False False diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Providers/SceneMappingProvider.cs b/NzbDrone.Services/NzbDrone.Services.Service/Providers/SceneMappingProvider.cs index 91d31a2fb..1ff2519ef 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Providers/SceneMappingProvider.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Providers/SceneMappingProvider.cs @@ -36,21 +36,31 @@ namespace NzbDrone.Services.Service.Providers _database.Insert(pendingSceneMapping); } - public void DeleteLive(string cleanTitle) + public void Update(PendingSceneMapping pendingSceneMapping) { - _database.Delete(cleanTitle); + _database.Update(pendingSceneMapping); } - public void DeletePending(string cleanTitle) + public PendingSceneMapping GetPending(int mappingId) { - _database.Delete(cleanTitle); + return _database.SingleOrDefault("WHERE MappingId = @mappingId", new{ mappingId }); } - public bool Promote(string cleanTitle) + public void DeleteLive(int mappingId) + { + _database.Delete(mappingId); + } + + public void DeletePending(int mappingId) + { + _database.Delete(mappingId); + } + + public bool Promote(int mappingId) { try { - var pendingItem = _database.Single(cleanTitle); + var pendingItem = GetPending(mappingId); var mapping = new SceneMapping { @@ -59,8 +69,8 @@ namespace NzbDrone.Services.Service.Providers Title = pendingItem.Title }; - _database.Insert(mapping); - _database.Delete(pendingItem); + Insert(mapping); + DeletePending(mappingId); } catch (Exception ex) { @@ -78,7 +88,7 @@ namespace NzbDrone.Services.Service.Providers foreach (var pendingItem in pendingItems) { - Promote(pendingItem.Title); + Promote(pendingItem.MappingId); } } catch (Exception ex) diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Repository/PendingSceneMapping.cs b/NzbDrone.Services/NzbDrone.Services.Service/Repository/PendingSceneMapping.cs index 115832ae4..14bb44929 100644 --- a/NzbDrone.Services/NzbDrone.Services.Service/Repository/PendingSceneMapping.cs +++ b/NzbDrone.Services/NzbDrone.Services.Service/Repository/PendingSceneMapping.cs @@ -7,11 +7,15 @@ using Services.PetaPoco; namespace NzbDrone.Services.Service.Repository { [TableName("PendingSceneMappings")] - [PrimaryKey("CleanTitle", autoIncrement = false)] + [PrimaryKey("MappingId", autoIncrement = true)] public class PendingSceneMapping { + public int MappingId { get; set; } public string CleanTitle { get; set; } public int Id { get; set; } public string Title { get; set; } + + [ResultColumn] + public string Commands { get; set; } } } \ No newline at end of file diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Scripts/DataTables-1.9.0/media/js/jquery.dataTables.editable.js b/NzbDrone.Services/NzbDrone.Services.Service/Scripts/DataTables-1.9.0/media/js/jquery.dataTables.editable.js new file mode 100644 index 000000000..bd0c287f8 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Scripts/DataTables-1.9.0/media/js/jquery.dataTables.editable.js @@ -0,0 +1,1296 @@ +/* +* File: jquery.dataTables.editable.js +* Version: 2.0.8 +* Author: Jovan Popovic +* +* Copyright 2010-2011 Jovan Popovic, all rights reserved. +* +* This source file is free software, under either the GPL v2 license or a +* BSD style license, as supplied with this software. +* +* This source file is distributed in the hope that it will be useful, but +* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +* or FITNESS FOR A PARTICULAR PURPOSE. +* +* Parameters: +* @sUpdateURL String URL of the server-side page used for updating cell. Default value is "UpdateData". +* @sAddURL String URL of the server-side page used for adding new row. Default value is "AddData". +* @sDeleteURL String URL of the server-side page used to delete row by id. Default value is "DeleteData". +* @fnShowError Function function(message, action){...} used to show error message. Action value can be "update", "add" or "delete". +* @sAddNewRowFormId String Id of the form for adding new row. Default id is "formAddNewRow". +* @oAddNewRowFormOptions Object Options that will be set to the "Add new row" dialog +* @sAddNewRowButtonId String Id of the button for adding new row. Default id is "btnAddNewRow". +* @oAddNewRowButtonOptions Object Options that will be set to the "Add new" button +* @sAddNewRowOkButtonId String Id of the OK button placed in add new row dialog. Default value is "btnAddNewRowOk". +* @oAddNewRowOkButtonOptions Object Options that will be set to the Ok button in the "Add new row" form +* @sAddNewRowCancelButtonId String Id of the Cancel button placed in add new row dialog. Default value is "btnAddNewRowCancel". +* @oAddNewRowCancelButtonOptions Object Options that will be set to the Cancel button in the "Add new row" form +* @sDeleteRowButtonId String Id of the button for adding new row. Default id is "btnDeleteRow". +* @oDeleteRowButtonOptions Object Options that will be set to the Delete button +* @sSelectedRowClass String Class that will be associated to the selected row. Default class is "row_selected". +* @sReadOnlyCellClass String Class of the cells that should not be editable. Default value is "read_only". +* @sAddDeleteToolbarSelector String Selector used to identify place where add and delete buttons should be placed. Default value is ".add_delete_toolbar". +* @fnStartProcessingMode Function function(){...} called when AJAX call is started. Use this function to add "Please wait..." message when some button is pressed. +* @fnEndProcessingMode Function function(){...} called when AJAX call is ended. Use this function to close "Please wait..." message. +* @aoColumns Array Array of the JEditable settings that will be applied on the columns +* @sAddHttpMethod String Method used for the Add AJAX request (default is 'POST') +* @sAddDataType String Data type expected from the server when adding a row; allowed values are the same as those accepted by JQuery's "datatype" parameter, e.g. 'text' and 'json'. The default is 'text'. +* @sDeleteHttpMethod String Method used for the Delete AJAX request (default is 'POST') +* @sDeleteDataType String Data type expected from the server when deleting a row; allowed values are the same as those accepted by JQuery's "datatype" parameter, e.g. 'text' and 'json'. The default is 'text'. +* @fnOnDeleting Function function(tr, id, fnDeleteRow){...} Function called before row is deleted. +tr isJQuery object encapsulating row that will be deleted +id is an id of the record that will be deleted. +fnDeleteRow(id) callback function that should be called to delete row with id +returns true if plugin should continue with deleting row, false will abort delete. +* @fnOnDeleted Function function(status){...} Function called after delete action. Status can be "success" or "failure" +* @fnOnAdding Function function(){...} Function called before row is added. +returns true if plugin should continue with adding row, false will abort add. +* @fnOnNewRowPosted Function function(data) Function that can override default function that is called when server-side sAddURL returns result +You can use this function to add different behaviour when server-side page returns result +* @fnOnAdded Function function(status){...} Function called after add action. Status can be "success" or "failure" +* @fnOnEditing Function function(input){...} Function called before cell is updated. +input JQuery object wrapping the input element used for editing value in the cell. +returns true if plugin should continue with sending AJAX request, false will abort update. +* @fnOnEdited Function function(status){...} Function called after edit action. Status can be "success" or "failure" +* @sEditorHeight String Default height of the cell editors +* @sEditorWidth String Default width of the cell editors +* @oDeleteParameters Object Additonal objects added to the DELETE Ajax request +* @oUpdateParameters Object Additonal objects added to the UPDATE Ajax request +* @sIDToken String Token in the add new row dialog that will be replaced with a returned id of the record that is created +* @sSuccessResponse String Text returned from the server if record is successfully deleted or edited. Default "ok" +*/ +(function ($) { + + $.fn.makeEditable = function (options) { + + var iDisplayStart = 0; + + function fnGetCellID(cell) { + /// + ///Utility function used to determine id of the cell + ///By default it is assumed that id is placed as an id attribute of that that surround the cell ( tag). E.g.: + /// + /// ............ + /// + /// + ///TD cell refference + + return properties.fnGetRowID($(cell.parentNode)); + } + + function _fnSetRowIDInAttribute(row, id, overwrite) { + /// + ///Utility function used to set id of the row. Usually when a new record is created, added to the table, + ///and when id of the record is retrieved from the server-side. + ///It is assumed that id is placed as an id attribute of that that surround the cell ( tag). E.g.: + /// + /// ............ + /// + ///This function is used when a datatable is configured in the server side processing mode or ajax source mode + /// + ///TR row where record is placed + + if (overwrite) { + row.attr("id", id); + } else { + if (row.attr("id") == null || row.attr("id") == "") + row.attr("id", id); + } + } + + function _fnGetRowIDFromAttribute(row) { + /// + ///Utility function used to get id of the row. + ///It is assumed that id is placed as an id attribute of that that surround the cell ( tag). E.g.: + /// + /// ............ + /// + ///This function is used when a datatable is configured in the standard client side mode + /// + ///TR row where record is placed + ///Id of the row - by default id attribute placed in the TR tag + + return row.attr("id"); + } + + function _fnSetRowIDInFirstCell(row, id) { + /// + ///Utility function used to set id of the row. Usually when a new record is created, added to the table, + ///and when id of the record is retrieved from the server-side). + ///It is assumed that id is placed as a value of the first <TD> cell in the <TR>. As example: + /// + /// 17......... + /// + ///This function is used when a datatable is configured in the server side processing mode or ajax source mode + /// + ///TR row where record is placed + + $("td:first", row).html(id); + } + + + function _fnGetRowIDFromFirstCell(row) { + /// + ///Utility function used to get id of the row. + ///It is assumed that id is placed as a value of the first <TD> cell in the <TR>. As example: + /// + /// 17......... + /// + ///This function is used when a datatable is configured in the server side processing mode or ajax source mode + /// + ///TR row where record is placed + ///Id of the row - by default id attribute placed in the TR tag + + return $("td:first", row).html(); + + } + + //Reference to the DataTable object + var oTable; + //Refences to the buttons used for manipulating table data + var oAddNewRowButton, oDeleteRowButton, oConfirmRowAddingButton, oCancelRowAddingButton; + //Reference to the form used for adding new data + var oAddNewRowForm; + + //Plugin options + var properties; + + function _fnShowError(errorText, action) { + /// + ///Shows an error message (Default function) + /// + ///text that should be shown + /// action that was executed when error occured e.g. "update", "delete", or "add" + + alert(errorText); + } + + function _fnStartProcessingMode() { + /// + ///Function that starts "Processing" mode i.e. shows "Processing..." dialog while some action is executing(Default function) + /// + + if (oTable.fnSettings().oFeatures.bProcessing) { + $(".dataTables_processing").css('visibility', 'visible'); + } + } + + function _fnEndProcessingMode() { + /// + ///Function that ends the "Processing" mode and returns the table in the normal state(Default function) + /// + + if (oTable.fnSettings().oFeatures.bProcessing) { + $(".dataTables_processing").css('visibility', 'hidden'); + } + } + + var sOldValue, sNewCellValue, sNewCellDislayValue; + + function fnApplyEditable(aoNodes) { + /// + ///Function that applies editable plugin to the array of table rows + /// + ///Aray of table rows <TR> that should be initialized with editable plugin + + if (properties.bDisableEditing) + return; + var oDefaultEditableSettings = { + event: 'dblclick', + + "onsubmit": function (settings, original) { + sOldValue = original.revert; + sNewCellValue = null; + sNewCellDisplayValue = null; + if(settings.type == "text" || settings.type == "select" || settings.type == "textarea" ) + { + var input = $("input,select,textarea", this); + sNewCellValue = $("input,select,textarea", $(this)).val(); + if (input.length == 1) { + var oEditElement = input[0]; + if (oEditElement.nodeName.toLowerCase() == "select" || oEditElement.tagName.toLowerCase() == "select") + sNewCellDisplayValue = $("option:selected", oEditElement).text(); //For select list use selected text instead of value for displaying in table + else + sNewCellDisplayValue = sNewCellValue; + } + + if (!properties.fnOnEditing(input)) + return false; + var x = settings; + if (settings.cssclass != null) { + input.addClass(settings.cssclass); + if (!input.valid() || 0 == input.valid()) + return false; + else + return true; + } + } + + iDisplayStart = fnGetDisplayStart(); + properties.fnStartProcessingMode(); + }, + "submitdata": function (value, settings) { + //iDisplayStart = fnGetDisplayStart(); + //properties.fnStartProcessingMode(); + var id = fnGetCellID(this); + var rowId = oTable.fnGetPosition(this)[0]; + var columnPosition = oTable.fnGetPosition(this)[1]; + var columnId = oTable.fnGetPosition(this)[2]; + var sColumnName = oTable.fnSettings().aoColumns[columnId].sName; + if (sColumnName == null || sColumnName == "") + sColumnName = oTable.fnSettings().aoColumns[columnId].sTitle; + var updateData = null; + if (properties.aoColumns == null || properties.aoColumns[columnId] == null) { + updateData = $.extend({}, + properties.oUpdateParameters, + { + "id": id, + "rowId": rowId, + "columnPosition": columnPosition, + "columnId": columnId, + "columnName": sColumnName + }); + } + else { + updateData = $.extend({}, + properties.oUpdateParameters, + properties.aoColumns[columnId].oUpdateParameters, + { + "id": id, + "rowId": rowId, + "columnPosition": columnPosition, + "columnId": columnId, + "columnName": sColumnName + }); + } + return updateData; + }, + "callback": function (sValue, settings) { + properties.fnEndProcessingMode(); + var status = ""; + var aPos = oTable.fnGetPosition(this); + + if (properties.sSuccessResponse == "IGNORE" || + ( properties.aoColumns != null + && properties.aoColumns[aPos[2]] != null + && properties.aoColumns[aPos[2]].sSuccessResponse == "IGNORE") || + (sNewCellValue == sValue) || + properties.sSuccessResponse == sValue) { + if(sNewCellDisplayValue == null) + { + //sNewCellDisplayValue = sValue; + oTable.fnUpdate(sValue, aPos[0], aPos[2]); + }else{ + oTable.fnUpdate(sNewCellDisplayValue, aPos[0], aPos[2]); + } + $("td.last-updated-cell", oTable).removeClass("last-updated-cell"); + $(this).addClass("last-updated-cell"); + status = "success"; + } else { + oTable.fnUpdate(sOldValue, aPos[0], aPos[2]); + properties.fnShowError(sValue, "update"); + status = "failure"; + } + + properties.fnOnEdited(status, sOldValue, sNewCellDisplayValue, aPos[0], aPos[1], aPos[2]); + if (settings.fnOnCellUpdated != null) { + settings.fnOnCellUpdated(status, sValue, aPos[0], aPos[2], settings); + } + + fnSetDisplayStart(); + }, + "onerror": function () { + properties.fnEndProcessingMode(); + properties.fnShowError("Cell cannot be updated", "update"); + properties.fnOnEdited("failure"); + }, + "height": properties.sEditorHeight, + "width": properties.sEditorWidth + }; + + var cells = null; + + if (properties.aoColumns != null) { + + for (var iDTindex = 0, iDTEindex = 0; iDTindex < oSettings.aoColumns.length; iDTindex++) { + if (oSettings.aoColumns[iDTindex].bVisible) {//if DataTables column is visible + if (properties.aoColumns[iDTEindex] == null) { + //If editor for the column is not defined go to the next column + iDTEindex++; + continue; + } + //Get all cells in the iDTEindex column (nth child is 1-indexed array) + cells = $("td:nth-child(" + (iDTEindex + 1) + ")", aoNodes); + + var oColumnSettings = oDefaultEditableSettings; + oColumnSettings = $.extend({}, oDefaultEditableSettings, properties.oEditableSettings, properties.aoColumns[iDTEindex]); + iDTEindex++; + var sUpdateURL = properties.sUpdateURL; + try { + if (oColumnSettings.sUpdateURL != null) + sUpdateURL = oColumnSettings.sUpdateURL; + } catch (ex) { + } + //cells.editable(sUpdateURL, oColumnSettings); + cells.each(function () { + if (!$(this).hasClass(properties.sReadOnlyCellClass)) { + $(this).editable(sUpdateURL, oColumnSettings); + } + }); + } + + } //end for + } else { + cells = $('td:not(.' + properties.sReadOnlyCellClass + ')', aoNodes); + cells.editable(properties.sUpdateURL, $.extend({}, oDefaultEditableSettings, properties.oEditableSettings)); + } + } + + function fnOnRowAdding(event) { + /// + ///Event handler called when a user click on the submit button in the "Add new row" form. + /// + ///Event that caused the action + + if (properties.fnOnAdding()) { + if (oAddNewRowForm.valid()) { + iDisplayStart = fnGetDisplayStart(); + properties.fnStartProcessingMode(); + + if (properties.bUseFormsPlugin) { + //Still in beta(development) + $(oAddNewRowForm).ajaxSubmit({ + dataType: 'xml', + success: function (response, statusString, xhr) { + if (xhr.responseText.toLowerCase().indexOf("error") != -1) { + properties.fnEndProcessingMode(); + properties.fnShowError(xhr.responseText.replace("Error",""), "add"); + properties.fnOnAdded("failure"); + } else { + fnOnRowAdded(xhr.responseText); + } + + }, + error: function (response) { + properties.fnEndProcessingMode(); + properties.fnShowError(response.responseText, "add"); + properties.fnOnAdded("failure"); + } + } + ); + + } else { + + var params = oAddNewRowForm.serialize(); + $.ajax({ 'url': properties.sAddURL, + 'data': params, + 'type': properties.sAddHttpMethod, + 'dataType': properties.sAddDataType, + success: fnOnRowAdded, + error: function (response) { + properties.fnEndProcessingMode(); + properties.fnShowError(response.responseText, "add"); + properties.fnOnAdded("failure"); + } + }); + } + } + } + event.stopPropagation(); + event.preventDefault(); + } + + function _fnOnNewRowPosted(data) { + ///Callback function called BEFORE a new record is posted to the server + ///TODO: Check this + + return true; + } + + function fnAddRowFromForm(oForm) { + /// + ///Adding a row in the table from the action form + /// + ///Form that contains data to be copied into the row + + var oSettings = oTable.fnSettings(); + var iColumnCount = oSettings.aoColumns.length; + var values = new Array(); + + $("input:text[rel],input:radio[rel][checked],input:hidden[rel],select[rel],textarea[rel],span.datafield[rel],input:checkbox[rel]", oForm).each(function () { + var rel = $(this).attr("rel"); + var sCellValue = ""; + if (rel >= iColumnCount) + properties.fnShowError("In the add form is placed input element with the name '" + $(this).attr("name") + "' with the 'rel' attribute that must be less than a column count - " + iColumnCount, "add"); + else { + if (this.nodeName.toLowerCase() == "select" || this.tagName.toLowerCase() == "select") { + //sCellValue = $("option:selected", this).text(); + sCellValue = $.map( + $.makeArray($("option:selected", this)), + function (n, i) { + return $(n).text(); + }).join(","); + } + else if (this.nodeName.toLowerCase() == "span" || this.tagName.toLowerCase() == "span") + sCellValue = $(this).html(); + else { + if (this.type == "checkbox") { + if (this.checked) + sCellValue = (this.value != "on") ? this.value : "true"; + else + sCellValue = (this.value != "on") ? "" : "false"; + } else + sCellValue = this.value; + } + sCellValue = sCellValue.replace(properties.sIDToken, data);//@BUG What is data????? + values[rel] = sCellValue; + } + }); + + //Add values from the form into the table + var rtn = oTable.fnAddData(values); + var oTRAdded = oTable.fnGetNodes(rtn); + //Apply editable plugin on the cells of the table + fnApplyEditable(oTRAdded); + + } + + function fnOnRowAdded(data) { + /// + ///Function that is called when a new row is added, and Ajax response is returned from server + /// + ///Id of the new row that is returned from the server + + properties.fnEndProcessingMode(); + + if (properties.fnOnNewRowPosted(data)) { + + var oSettings = oTable.fnSettings(); + if (!oSettings.oFeatures.bServerSide) { + var iColumnCount = oSettings.aoColumns.length; + var values = new Array(); + var rowData = new Object(); + + $("input:text[rel],input:radio[rel][checked],input:hidden[rel],select[rel],textarea[rel],span.datafield[rel],input:checkbox[rel]", oAddNewRowForm).each(function () { + var rel = $(this).attr("rel"); + var sCellValue = ""; + if (rel >= iColumnCount) + properties.fnShowError("In the add form is placed input element with the name '" + $(this).attr("name") + "' with the 'rel' attribute that must be less than a column count - " + iColumnCount, "add"); + else { + if (this.nodeName.toLowerCase() == "select" || this.tagName.toLowerCase() == "select") { + //sCellValue = $("option:selected", this).text(); + sCellValue = $.map( + $.makeArray($("option:selected", this)), + function (n, i) { + return $(n).text(); + }).join(","); + } + else if (this.nodeName.toLowerCase() == "span" || this.tagName.toLowerCase() == "span") + sCellValue = $(this).html(); + else { + if (this.type == "checkbox") { + if (this.checked) + sCellValue = (this.value != "on") ? this.value : "true"; + else + sCellValue = (this.value != "on") ? "" : "false"; + } else + sCellValue = this.value; + } + + sCellValue = sCellValue.replace(properties.sIDToken, data); + if (oSettings.aoColumns != null + && oSettings.aoColumns[rel] != null + && isNaN(parseInt(oSettings.aoColumns[0].mDataProp))) { + rowData[oSettings.aoColumns[rel].mDataProp] = sCellValue; + } else { + values[rel] = sCellValue; + } + } + }); + + var rtn; + //Add values from the form into the table + if (oSettings.aoColumns != null && isNaN(parseInt(oSettings.aoColumns[0].mDataProp))) { + rtn = oTable.fnAddData(rowData); + } + else { + rtn = oTable.fnAddData(values); + } + + var oTRAdded = oTable.fnGetNodes(rtn); + //add id returned by server page as an TR id attribute + properties.fnSetRowID($(oTRAdded), data, true); + //Apply editable plugin on the cells of the table + fnApplyEditable(oTRAdded); + + $("tr.last-added-row", oTable).removeClass("last-added-row"); + $(oTRAdded).addClass("last-added-row"); + } else { + oTable.fnDraw(false); + } + //Close the dialog + oAddNewRowForm.dialog('close'); + $(oAddNewRowForm)[0].reset(); + $(".error", $(oAddNewRowForm)).html(""); + + fnSetDisplayStart(); + properties.fnOnAdded("success"); + } + } + + function fnOnCancelRowAdding(event) { + /// + ///Event handler function that is executed when a user press cancel button in the add new row form + /// + ///DOM event that caused an error + + //Clear the validation messages and reset form + $(oAddNewRowForm).validate().resetForm(); // Clears the validation errors + $(oAddNewRowForm)[0].reset(); + + $(".error", $(oAddNewRowForm)).html(""); + $(".error", $(oAddNewRowForm)).hide(); // Hides the error element + + //Close the dialog + oAddNewRowForm.dialog('close'); + event.stopPropagation(); + event.preventDefault(); + } + + + function fnDisableDeleteButton() { + /// + ///Function that disables delete button + /// + + if (properties.oDeleteRowButtonOptions != null) { + //oDeleteRowButton.disable(); + oDeleteRowButton.button("option", "disabled", true); + } else { + oDeleteRowButton.attr("disabled", "true"); + } + } + + function fnEnableDeleteButton() { + /// + ///Function that enables delete button + /// + + if (properties.oDeleteRowButtonOptions != null) { + //oDeleteRowButton.enable(); + oDeleteRowButton.button("option", "disabled", false); + } else { + oDeleteRowButton.removeAttr("disabled"); + } + } + + + + function fnDeleteRow(id, sDeleteURL) { + /// + ///Function that deletes a row with an id, using the sDeleteURL server page + /// + ///Id of the row that will be deleted. Id value is placed in the attribute of the TR tag that will be deleted + ///Server URL where delete request will be posted + + var sURL = sDeleteURL; + if (sDeleteURL == null) + sURL = properties.sDeleteURL; + properties.fnStartProcessingMode(); + var data = $.extend(properties.oDeleteParameters, { "id": id }); + $.ajax({ 'url': sURL, + 'type': properties.sDeleteHttpMethod, + 'data': data, + "success": fnOnRowDeleted, + "dataType": properties.sDeleteDataType, + "error": function (response) { + properties.fnEndProcessingMode(); + properties.fnShowError(response.responseText, "delete"); + properties.fnOnDeleted("failure"); + + } + }); + } + + function _fnOnRowDelete(event) { + /// + ///Event handler for the delete button + /// + ///DOM event + + iDisplayStart = fnGetDisplayStart(); + if ($('tr.' + properties.sSelectedRowClass + ' td', oTable).length == 0) { + fnDisableDeleteButton(); + return; + } + var id = fnGetCellID($('tr.' + properties.sSelectedRowClass + ' td', oTable)[0]); + if (properties.fnOnDeleting($('tr.' + properties.sSelectedRowClass, oTable), id, fnDeleteRow)) { + fnDeleteRow(id); + } + } + + function fnOnRowDeleted(response) { + /// + ///Called after the record is deleted on the server (in the ajax success callback) + /// + ///Response text eturned from the server-side page + + properties.fnEndProcessingMode(); + var oTRSelected = $('tr.' + properties.sSelectedRowClass, oTable)[0]; + if (response == properties.sSuccessResponse || response == "") { + oTable.fnDeleteRow(oTRSelected); + fnDisableDeleteButton(); + fnSetDisplayStart(); + properties.fnOnDeleted("success"); + } + else { + properties.fnShowError(response, "delete"); + properties.fnOnDeleted("failure"); + } + } + + function _fnOnDeleting(tr, id, fnDeleteRow) { + /// + ///The default function that is called before row is deleted + ///Returning false will abort delete + ///Function can be overriden via plugin properties in order to create custom delete functionality + ///in that case call fnDeleteRow with parameter id, and return false to prevent double delete action + /// + ///JQuery wrapper around the TR tag that will be deleted + ///Id of the record that wil be deleted + ///Function that will be called to delete a row. Default - fnDeleteRow(id) + + return confirm("Are you sure that you want to delete this record?"); ; + } + + /* Function called after delete action + * @param result string + * "success" if row is actually deleted + * "failure" if delete failed + * @return void + */ + function _fnOnDeleted(result) { } + + function _fnOnEditing(input) { return true; } + function _fnOnEdited(result, sOldValue, sNewValue, iRowIndex, iColumnIndex, iRealColumnIndex) { + + } + + function fnOnAdding() { return true; } + function _fnOnAdded(result) { } + + var oSettings; + function fnGetDisplayStart() { + return oSettings._iDisplayStart; + } + + function fnSetDisplayStart() { + /// + ///Set the pagination position(do nothing in the server-side mode) + /// + + if (oSettings.oFeatures.bServerSide === false) { + oSettings._iDisplayStart = iDisplayStart; + oSettings.oApi._fnCalculateEnd(oSettings); + //draw the 'current' page + oSettings.oApi._fnDraw(oSettings); + } + } + + function _fnOnBeforeAction(sAction) { + return true; + } + + function _fnOnActionCompleted(sStatus) { + + } + + function fnGetActionSettings(sAction) { + ///Returns settings object for the action + ///The name of the action + + if (properties.aoTableAction) + properties.fnShowError("Configuration error - aoTableAction setting are not set", sAction); + var i = 0; + + for (i = 0; i < properties.aoTableActions.length; i++) { + if (properties.aoTableActions[i].sAction == sAction) + return properties.aoTableActions[i]; + } + + properties.fnShowError("Cannot find action configuration settings", sAction); + } + + + function fnUpdateRow(oActionForm) { + ///Updates table row using form fields + ///Form used to enter data + + var sAction = $(oActionForm).attr("id"); + sAction = sAction.replace("form", ""); + var sActionURL = $(oActionForm).attr("action"); + if (properties.fnOnBeforeAction(sAction)) { + if ($(oActionForm).valid()) { + iDisplayStart = fnGetDisplayStart(); + properties.fnStartProcessingMode(); + if (properties.bUseFormsPlugin) { + + //Still in beta(development) + var oAjaxSubmitOptions = { + success: function (response, statusString, xhr) { + properties.fnEndProcessingMode(); + if (response.toLowerCase().indexOf("error") != -1 || statusString != "success") { + properties.fnShowError(response, sAction); + properties.fnOnActionCompleted("failure"); + } else { + fnUpdateRowOnSuccess(oActionForm); + properties.fnOnActionCompleted("success"); + } + + }, + error: function (response) { + properties.fnEndProcessingMode(); + properties.fnShowError(response.responseText, sAction); + properties.fnOnActionCompleted("failure"); + } + }; + var oActionSettings = fnGetActionSettings(sAction); + oAjaxSubmitOptions = $.extend({}, properties.oAjaxSubmitOptions, oAjaxSubmitOptions); + $(oActionForm).ajaxSubmit(oAjaxSubmitOptions); + + } else { + var params = $(oActionForm).serialize(); + $.ajax({ 'url': sActionURL, + 'data': params, + 'type': properties.sAddHttpMethod, + 'dataType': properties.sAddDataType, + success: function (response) { + properties.fnEndProcessingMode(); + fnUpdateRowOnSuccess(oActionForm); + properties.fnOnActionCompleted("success"); + }, + error: function (response) { + properties.fnEndProcessingMode(); + properties.fnShowError(response.responseText, sAction); + properties.fnOnActionCompleted("failure"); + } + }); + } + } + } + } + + function fnUpdateRowOnSuccess(oActionForm) { + ///Updates table row using form fields after the ajax success callback is executed + ///Form used to enter data + + var iRowID = jQuery.data(oActionForm, 'ROWID'); + //var iDataRowID = jQuery.data(oActionForm, 'DATAROWID'); + var oSettings = oTable.fnSettings(); + var iColumnCount = oSettings.aoColumns.length; + var values = new Array(); + + var sAction = $(oActionForm).attr("id"); + sAction = sAction.replace("form", ""); + + //$("input.ROWID").val(iRowID); + //$("input.DATAROWID").val(iDataRowID); + + $("input:text[rel],input:radio[rel][checked],input:hidden[rel],select[rel],textarea[rel],span.datafield[rel],input:checkbox[rel]", oActionForm).each(function () { + var rel = $(this).attr("rel"); + var sCellValue = ""; + if (rel >= iColumnCount) + properties.fnShowError("In the add form is placed input element with the name '" + $(this).attr("name") + "' with the 'rel' attribute that must be less than a column count - " + iColumnCount, "add"); + else { + if (this.nodeName.toLowerCase() == "select" || this.tagName.toLowerCase() == "select") { + //sCellValue = $("option:selected", this).text(); + sCellValue = $.map( + $.makeArray($("option:selected", this)), + function (n, i) { + return $(n).text(); + }).join(","); + } + else if (this.nodeName.toLowerCase() == "span" || this.tagName.toLowerCase() == "span") + sCellValue = $(this).html(); + else { + if (this.type == "checkbox") { + if (this.checked) + sCellValue = (this.value != "on") ? this.value : "true"; + else + sCellValue = (this.value != "on") ? "" : "false"; + } else + sCellValue = this.value; + } + + //sCellValue = sCellValue.replace(properties.sIDToken, data); + //values[rel] = sCellValue; + oTable.fnUpdate(sCellValue, iRowID, rel); + } + }); + $(oActionForm).dialog('close'); + + + } + + oTable = this; + + var defaults = { + + sUpdateURL: "UpdateData", + sAddURL: "AddData", + sDeleteURL: "DeleteData", + sAddNewRowFormId: "formAddNewRow", + oAddNewRowFormOptions: { autoOpen: false, modal: true }, + sAddNewRowButtonId: "btnAddNewRow", + oAddNewRowButtonOptions: null, + sAddNewRowOkButtonId: "btnAddNewRowOk", + sAddNewRowCancelButtonId: "btnAddNewRowCancel", + oAddNewRowOkButtonOptions: { label: "Ok" }, + oAddNewRowCancelButtonOptions: { label: "Cancel" }, + sDeleteRowButtonId: "btnDeleteRow", + oDeleteRowButtonOptions: null, + sSelectedRowClass: "row_selected", + sReadOnlyCellClass: "read_only", + sAddDeleteToolbarSelector: ".add_delete_toolbar", + fnShowError: _fnShowError, + fnStartProcessingMode: _fnStartProcessingMode, + fnEndProcessingMode: _fnEndProcessingMode, + aoColumns: null, + fnOnDeleting: _fnOnDeleting, + fnOnDeleted: _fnOnDeleted, + fnOnAdding: fnOnAdding, + fnOnNewRowPosted: _fnOnNewRowPosted, + fnOnAdded: _fnOnAdded, + fnOnEditing: _fnOnEditing, + fnOnEdited: _fnOnEdited, + sAddHttpMethod: 'POST', + sAddDataType: "text", + sDeleteHttpMethod: 'POST', + sDeleteDataType: "text", + fnGetRowID: _fnGetRowIDFromAttribute, + fnSetRowID: _fnSetRowIDInAttribute, + sEditorHeight: "100%", + sEditorWidth: "100%", + bDisableEditing: false, + oDeleteParameters: {}, + oUpdateParameters: {}, + sIDToken: "DATAROWID", + aoTableActions: null, + fnOnBeforeAction: _fnOnBeforeAction, + bUseFormsPlugin: false, + fnOnActionCompleted: _fnOnActionCompleted, + sSuccessResponse: "ok" + + + }; + + properties = $.extend(defaults, options); + oSettings = oTable.fnSettings(); + + return this.each(function () { + + if (oTable.fnSettings().sAjaxSource != null) { + oTable.fnSettings().aoDrawCallback.push({ + "fn": function () { + //Apply jEditable plugin on the table cells + fnApplyEditable(oTable.fnGetNodes()); + $(oTable.fnGetNodes()).each(function () { + var position = oTable.fnGetPosition(this); + var id = oTable.fnGetData(position)[0]; + properties.fnSetRowID($(this), id); + } + ); + }, + "sName": "fnApplyEditable" + }); + + } else { + //Apply jEditable plugin on the table cells + fnApplyEditable(oTable.fnGetNodes()); + } + + //Setup form to open in dialog + oAddNewRowForm = $("#" + properties.sAddNewRowFormId); + if (oAddNewRowForm.length != 0) { + + ///Check does the add new form has all nessecary fields + var oSettings = oTable.fnSettings(); + var iColumnCount = oSettings.aoColumns.length; + for (i = 0; i < iColumnCount; i++) { + if ($("[rel=" + i + "]", oAddNewRowForm).length == 0) + properties.fnShowError("In the form that is used for adding new records cannot be found an input element with rel=" + i + " that will be bound to the value in the column " + i + ". See http://code.google.com/p/jquery-datatables-editable/wiki/AddingNewRecords#Add_new_record_form for more details", "init"); + } + + + if (properties.oAddNewRowFormOptions != null) { + properties.oAddNewRowFormOptions.autoOpen = false; + } else { + properties.oAddNewRowFormOptions = { autoOpen: false }; + } + oAddNewRowForm.dialog(properties.oAddNewRowFormOptions); + + //Add button click handler on the "Add new row" button + oAddNewRowButton = $("#" + properties.sAddNewRowButtonId); + if (oAddNewRowButton.length != 0) { + oAddNewRowButton.click(function () { + oAddNewRowForm.dialog('open'); + }); + } else { + if ($(properties.sAddDeleteToolbarSelector).length == 0) { + throw "Cannot find a button with an id '" + properties.sAddNewRowButtonId + "', or placeholder with an id '" + properties.sAddDeleteToolbarSelector + "' that should be used for adding new row although form for adding new record is specified"; + } else { + oAddNewRowButton = null; //It will be auto-generated later + } + } + + //Prevent Submit handler + if (oAddNewRowForm[0].nodeName.toLowerCase() == "form") { + oAddNewRowForm.unbind('submit'); + oAddNewRowForm.submit(function (event) { + fnOnRowAdding(event); + return false; + }); + } else { + $("form", oAddNewRowForm[0]).unbind('submit'); + $("form", oAddNewRowForm[0]).submit(function (event) { + fnOnRowAdding(event); + return false; + }); + } + + // array to add default buttons to + var aAddNewRowFormButtons = []; + + oConfirmRowAddingButton = $("#" + properties.sAddNewRowOkButtonId, oAddNewRowForm); + if (oConfirmRowAddingButton.length == 0) { + //If someone forgotten to set the button text + if (properties.oAddNewRowOkButtonOptions.text == null + || properties.oAddNewRowOkButtonOptions.text == "") { + properties.oAddNewRowOkButtonOptions.text = "Ok"; + } + properties.oAddNewRowOkButtonOptions.click = fnOnRowAdding; + properties.oAddNewRowOkButtonOptions.id = properties.sAddNewRowOkButtonId; + // push the add button onto the array + aAddNewRowFormButtons.push(properties.oAddNewRowOkButtonOptions); + } else { + oConfirmRowAddingButton.click(fnOnRowAdding); + } + + oCancelRowAddingButton = $("#" + properties.sAddNewRowCancelButtonId); + if (oCancelRowAddingButton.length == 0) { + //If someone forgotten to the button text + if (properties.oAddNewRowCancelButtonOptions.text == null + || properties.oAddNewRowCancelButtonOptions.text == "") { + properties.oAddNewRowCancelButtonOptions.text = "Cancel"; + } + properties.oAddNewRowCancelButtonOptions.click = fnOnCancelRowAdding; + properties.oAddNewRowCancelButtonOptions.id = properties.sAddNewRowCancelButtonId; + // push the cancel button onto the array + aAddNewRowFormButtons.push(properties.oAddNewRowCancelButtonOptions); + } else { + oCancelRowAddingButton.click(fnOnCancelRowAdding); + } + // if the array contains elements, add them to the dialog + if (aAddNewRowFormButtons.length > 0) { + oAddNewRowForm.dialog('option', 'buttons', aAddNewRowFormButtons); + } + //Issue: It cannot find it with this call: + //oConfirmRowAddingButton = $("#" + properties.sAddNewRowOkButtonId, oAddNewRowForm); + //oCancelRowAddingButton = $("#" + properties.sAddNewRowCancelButtonId, oAddNewRowForm); + oConfirmRowAddingButton = $("#" + properties.sAddNewRowOkButtonId); + oCancelRowAddingButton = $("#" + properties.sAddNewRowCancelButtonId); + } else { + oAddNewRowForm = null; + } + + //Set the click handler on the "Delete selected row" button + oDeleteRowButton = $('#' + properties.sDeleteRowButtonId); + if (oDeleteRowButton.length != 0) + oDeleteRowButton.click(_fnOnRowDelete); + else { + oDeleteRowButton = null; + } + + //If an add and delete buttons does not exists but Add-delete toolbar is specificed + //Autogenerate these buttons + oAddDeleteToolbar = $(properties.sAddDeleteToolbarSelector); + if (oAddDeleteToolbar.length != 0) { + if (oAddNewRowButton == null && properties.sAddNewRowButtonId != "" + && oAddNewRowForm != null) { + oAddDeleteToolbar.append(""); + oAddNewRowButton = $("#" + properties.sAddNewRowButtonId); + oAddNewRowButton.click(function () { oAddNewRowForm.dialog('open'); }); + } + if (oDeleteRowButton == null && properties.sDeleteRowButtonId != "") { + oAddDeleteToolbar.append(""); + oDeleteRowButton = $("#" + properties.sDeleteRowButtonId); + oDeleteRowButton.click(_fnOnRowDelete); + } + } + + //If delete button exists disable it until some row is selected + if (oDeleteRowButton != null) { + if (properties.oDeleteRowButtonOptions != null) { + oDeleteRowButton.button(properties.oDeleteRowButtonOptions); + } + fnDisableDeleteButton(); + } + + //If add button exists convert it to the JQuery-ui button + if (oAddNewRowButton != null) { + if (properties.oAddNewRowButtonOptions != null) { + oAddNewRowButton.button(properties.oAddNewRowButtonOptions); + } + } + + + //If form ok button exists convert it to the JQuery-ui button + if (oConfirmRowAddingButton != null) { + if (properties.oAddNewRowOkButtonOptions != null) { + oConfirmRowAddingButton.button(properties.oAddNewRowOkButtonOptions); + } + } + + //If form cancel button exists convert it to the JQuery-ui button + if (oCancelRowAddingButton != null) { + if (properties.oAddNewRowCancelButtonOptions != null) { + oCancelRowAddingButton.button(properties.oAddNewRowCancelButtonOptions); + } + } + + //Add handler to the inline delete buttons + $(".table-action-deletelink", oTable).live("click", function (e) { + + e.preventDefault(); + e.stopPropagation(); + var sURL = $(this).attr("href"); + + if (sURL == null || sURL == "") + sURL = properties.sDeleteURL; + + iDisplayStart = fnGetDisplayStart(); + var oTD = ($(this).parents('td'))[0]; + var oTR = ($(this).parents('tr'))[0]; + + $(oTR).addClass(properties.sSelectedRowClass); + + var id = fnGetCellID(oTD); + if (properties.fnOnDeleting(oTD, id, fnDeleteRow)) { + fnDeleteRow(id, sURL); + } + + + } + ); + + //Add handler to the inline delete buttons + $(".table-action-editlink", oTable).live("click", function (e) { + + e.preventDefault(); + e.stopPropagation(); + var sURL = $(this).attr("href"); + + if (sURL == null || sURL == "") + sURL = properties.sDeleteURL; + + iDisplayStart = fnGetDisplayStart(); + var oTD = ($(this).parents('td'))[0]; + var oTR = ($(this).parents('tr'))[0]; + + $(oTR).addClass(properties.sSelectedRowClass); + + var id = fnGetCellID(oTD); + if (properties.fnOnDeleting(oTD, id, fnDeleteRow)) { + fnDeleteRow(id, sURL); + } + + + } + ); + + //Set selected class on row that is clicked + //Enable delete button if row is selected, disable delete button if selected class is removed + $("tbody", oTable).click(function (event) { + if ($(event.target.parentNode).hasClass(properties.sSelectedRowClass)) { + $(event.target.parentNode).removeClass(properties.sSelectedRowClass); + if (oDeleteRowButton != null) { + fnDisableDeleteButton(); + } + } else { + $(oTable.fnSettings().aoData).each(function () { + $(this.nTr).removeClass(properties.sSelectedRowClass); + }); + $(event.target.parentNode).addClass(properties.sSelectedRowClass); + if (oDeleteRowButton != null) { + fnEnableDeleteButton(); + } + } + }); + + + if (properties.aoTableActions != null) { + for (var i = 0; i < properties.aoTableActions.length; i++) { + var oTableAction = $.extend({ sType: "edit" }, properties.aoTableActions[i]); + var sAction = oTableAction.sAction; + var sActionFormId = oTableAction.sActionFormId; + + var oActionForm = $("#form" + sAction); + if (oActionForm.length != 0) { + var oFormOptions = { autoOpen: false, modal: true }; + oFormOptions = $.extend({}, oTableAction.oFormOptions, oFormOptions); + oActionForm.dialog(oFormOptions); + oActionForm.data("action-options", oTableAction); + + var oActionFormLink = $(".table-action-" + sAction); + if (oActionFormLink.length != 0) { + + oActionFormLink.live("click", function () { + + + var sClass = this.className; + var classList = sClass.split(/\s+/); + var sActionFormId = ""; + var sAction = ""; + for (i = 0; i < classList.length; i++) { + if (classList[i].indexOf("table-action-") > -1) { + sAction = classList[i].replace("table-action-", ""); + sActionFormId = "#form" + sAction; + } + } + if (sActionFormId == "") { + properties.fnShowError("Cannot find a form with an id " + sActionFormId + " that should be associated to the action - " + sAction, sAction) + } + + var oTableAction = $(sActionFormId).data("action-options"); + + if (oTableAction.sType == "edit") { + + var oTD = ($(this).parents('td'))[0]; + var oTR = ($(this).parents('tr'))[0]; + + $(oTR).addClass(properties.sSelectedRowClass); + + var iRowID = oTable.fnGetPosition(oTR); + + var id = fnGetCellID(oTD); + + $(sActionFormId).validate().resetForm(); + jQuery.data($(sActionFormId)[0], 'DATARECORDID', id); + $("input.DATARECORDID", $(sActionFormId)).val(id); + jQuery.data($(sActionFormId)[0], 'ROWID', iRowID); + $("input.ROWID", $(sActionFormId)).val(iRowID); + + + var oSettings = oTable.fnSettings(); + var iColumnCount = oSettings.aoColumns.length; + + + $("input:text[rel],input:radio[rel][checked],input:hidden[rel],select[rel],textarea[rel],input:checkbox[rel]", + $(sActionFormId)).each(function () { + var rel = $(this).attr("rel"); + + + if (rel >= iColumnCount) + properties.fnShowError("In the action form is placed input element with the name '" + $(this).attr("name") + "' with the 'rel' attribute that must be less than a column count - " + iColumnCount, "add"); + else { + var sCellValue = oTable.fnGetData(oTR)[rel]; + if (this.nodeName.toLowerCase() == "select" || this.tagName.toLowerCase() == "select") { + //sCellValue = $("option:selected", this).text(); + /*sCellValue = $.map( + $.makeArray($("option:selected", this)), + function (n, i) { + return $(n).text(); + }).join(","); + */ + //$(this).val(sCellValue); + $(this).attr("value", sCellValue); + + } + else if (this.nodeName.toLowerCase() == "span" || this.tagName.toLowerCase() == "span") + $(this).html(sCellValue); + else { + if (this.type == "checkbox") { + if (sCellValue == "true") { + $(this).attr("checked", true); + } + } else + { + if(this.type == "radio"){ + if(this.value == sCellValue){ + this.checked = true; + } + }else{ + this.value = sCellValue; + } + } + } + + //sCellValue = sCellValue.replace(properties.sIDToken, data); + //values[rel] = sCellValue; + //oTable.fnUpdate(sCellValue, iRowID, rel); + } + }); + + + } + $(sActionFormId).dialog('open'); + }); + } + + oActionForm.submit(function (event) { + + var oTableAction = $(this).data("action-options"); + + if (oTableAction.sType == "edit") { + ///Start function fnUpdateRow + fnUpdateRow(this); + ///end function fnUpdateRow + } else { + fnAddRowFromForm(this); + } + return false; + }); + + + var aActionFormButtons = new Array(); + + //var oActionSubmitButton = $("#form" + sAction + "Ok", oActionForm); + //aActionFormButtons.push(oActionSubmitButton); + var oActionFormCancel = $("#form" + sAction + "Cancel", oActionForm); + if (oActionFormCancel.length != 0) { + aActionFormButtons.push(oActionFormCancel); + oActionFormCancel.click(function () { + + var oActionForm = $(this).parents("form")[0]; + //Clear the validation messages and reset form + $(oActionForm).validate().resetForm(); // Clears the validation errors + $(oActionForm)[0].reset(); + + $(".error", $(oActionForm)).html(""); + $(".error", $(oActionForm)).hide(); // Hides the error element + $(oActionForm).dialog('close'); + }); + } + + //Convert all action form buttons to the JQuery UI buttons + $("button", oActionForm).button(); + /* + if (aActionFormButtons.length > 0) { + oActionForm.dialog('option', 'buttons', aActionFormButtons); + } + */ + + + + } + + + + + } // end for (var i = 0; i < properties.aoTableActions.length; i++) + } //end if (properties.aoTableActions != null) + + + }); + }; +})(jQuery); diff --git a/NzbDrone.Services/NzbDrone.Services.Service/Scripts/DataTables-1.9.0/media/js/jquery.dataTables.js b/NzbDrone.Services/NzbDrone.Services.Service/Scripts/DataTables-1.9.0/media/js/jquery.dataTables.js new file mode 100644 index 000000000..35b8d1b57 --- /dev/null +++ b/NzbDrone.Services/NzbDrone.Services.Service/Scripts/DataTables-1.9.0/media/js/jquery.dataTables.js @@ -0,0 +1,11612 @@ +/** + * @summary DataTables + * @description Paginate, search and sort HTML tables + * @version 1.9.0 + * @file jquery.dataTables.js + * @author Allan Jardine (www.sprymedia.co.uk) + * @contact www.sprymedia.co.uk/contact + * + * @copyright Copyright 2008-2012 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, available at: + * http://datatables.net/license_gpl2 + * http://datatables.net/license_bsd + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + * + * For details please refer to: http://www.datatables.net + */ + +/*jslint evil: true, undef: true, browser: true */ +/*globals $, jQuery,_fnExternApiFunc,_fnInitialise,_fnInitComplete,_fnLanguageCompat,_fnAddColumn,_fnColumnOptions,_fnAddData,_fnCreateTr,_fnGatherData,_fnBuildHead,_fnDrawHead,_fnDraw,_fnReDraw,_fnAjaxUpdate,_fnAjaxParameters,_fnAjaxUpdateDraw,_fnServerParams,_fnAddOptionsHtml,_fnFeatureHtmlTable,_fnScrollDraw,_fnAdjustColumnSizing,_fnFeatureHtmlFilter,_fnFilterComplete,_fnFilterCustom,_fnFilterColumn,_fnFilter,_fnBuildSearchArray,_fnBuildSearchRow,_fnFilterCreateSearch,_fnDataToSearch,_fnSort,_fnSortAttachListener,_fnSortingClasses,_fnFeatureHtmlPaginate,_fnPageChange,_fnFeatureHtmlInfo,_fnUpdateInfo,_fnFeatureHtmlLength,_fnFeatureHtmlProcessing,_fnProcessingDisplay,_fnVisibleToColumnIndex,_fnColumnIndexToVisible,_fnNodeToDataIndex,_fnVisbleColumns,_fnCalculateEnd,_fnConvertToWidth,_fnCalculateColumnWidths,_fnScrollingWidthAdjust,_fnGetWidestNode,_fnGetMaxLenString,_fnStringToCss,_fnDetectType,_fnSettingsFromNode,_fnGetDataMaster,_fnGetTrNodes,_fnGetTdNodes,_fnEscapeRegex,_fnDeleteIndex,_fnReOrderIndex,_fnColumnOrdering,_fnLog,_fnClearTable,_fnSaveState,_fnLoadState,_fnCreateCookie,_fnReadCookie,_fnDetectHeader,_fnGetUniqueThs,_fnScrollBarWidth,_fnApplyToChildren,_fnMap,_fnGetRowData,_fnGetCellData,_fnSetCellData,_fnGetObjectDataFn,_fnSetObjectDataFn,_fnApplyColumnDefs,_fnBindAction,_fnCallbackReg,_fnCallbackFire,_fnJsonString,_fnRender,_fnNodeToColumnIndex*/ + +(/** @lends */function($, window, document, undefined) { + /** + * DataTables is a plug-in for the jQuery Javascript library. It is a + * highly flexible tool, based upon the foundations of progressive + * enhancement, which will add advanced interaction controls to any + * HTML table. For a full list of features please refer to + * DataTables.net. + * + * Note that the DataTable object is not a global variable but is + * aliased to jQuery.fn.DataTable and jQuery.fn.dataTable through which + * it may be accessed. + * + * @class + * @param {object} [oInit={}] Configuration object for DataTables. Options + * are defined by {@link DataTable.defaults} + * @requires jQuery 1.3+ + * + * @example + * // Basic initialisation + * $(document).ready( function { + * $('#example').dataTable(); + * } ); + * + * @example + * // Initialisation with configuration options - in this case, disable + * // pagination and sorting. + * $(document).ready( function { + * $('#example').dataTable( { + * "bPaginate": false, + * "bSort": false + * } ); + * } ); + */ + var DataTable = function( oInit ) + { + + + /** + * Add a column to the list used for the table with default values + * @param {object} oSettings dataTables settings object + * @param {node} nTh The th element for this column + * @memberof DataTable#oApi + */ + function _fnAddColumn( oSettings, nTh ) + { + var oDefaults = DataTable.defaults.columns; + var iCol = oSettings.aoColumns.length; + var oCol = $.extend( {}, DataTable.models.oColumn, oDefaults, { + "sSortingClass": oSettings.oClasses.sSortable, + "sSortingClassJUI": oSettings.oClasses.sSortJUI, + "nTh": nTh ? nTh : document.createElement('th'), + "sTitle": oDefaults.sTitle ? oDefaults.sTitle : nTh ? nTh.innerHTML : '', + "aDataSort": oDefaults.aDataSort ? oDefaults.aDataSort : [iCol], + "mDataProp": oDefaults.mDataProp ? oDefaults.oDefaults : iCol + } ); + oSettings.aoColumns.push( oCol ); + + /* Add a column specific filter */ + if ( oSettings.aoPreSearchCols[ iCol ] === undefined || oSettings.aoPreSearchCols[ iCol ] === null ) + { + oSettings.aoPreSearchCols[ iCol ] = $.extend( {}, DataTable.models.oSearch ); + } + else + { + var oPre = oSettings.aoPreSearchCols[ iCol ]; + + /* Don't require that the user must specify bRegex, bSmart or bCaseInsensitive */ + if ( oPre.bRegex === undefined ) + { + oPre.bRegex = true; + } + + if ( oPre.bSmart === undefined ) + { + oPre.bSmart = true; + } + + if ( oPre.bCaseInsensitive === undefined ) + { + oPre.bCaseInsensitive = true; + } + } + + /* Use the column options function to initialise classes etc */ + _fnColumnOptions( oSettings, iCol, null ); + } + + + /** + * Apply options for a column + * @param {object} oSettings dataTables settings object + * @param {int} iCol column index to consider + * @param {object} oOptions object with sType, bVisible and bSearchable + * @memberof DataTable#oApi + */ + function _fnColumnOptions( oSettings, iCol, oOptions ) + { + var oCol = oSettings.aoColumns[ iCol ]; + + /* User specified column options */ + if ( oOptions !== undefined && oOptions !== null ) + { + if ( oOptions.sType !== undefined ) + { + oCol.sType = oOptions.sType; + oCol._bAutoType = false; + } + + $.extend( oCol, oOptions ); + _fnMap( oCol, oOptions, "sWidth", "sWidthOrig" ); + + /* iDataSort to be applied (backwards compatibility), but aDataSort will take + * priority if defined + */ + if ( oOptions.iDataSort !== undefined ) + { + oCol.aDataSort = [ oOptions.iDataSort ]; + } + _fnMap( oCol, oOptions, "aDataSort" ); + } + + /* Cache the data get and set functions for speed */ + oCol.fnGetData = _fnGetObjectDataFn( oCol.mDataProp ); + oCol.fnSetData = _fnSetObjectDataFn( oCol.mDataProp ); + + /* Feature sorting overrides column specific when off */ + if ( !oSettings.oFeatures.bSort ) + { + oCol.bSortable = false; + } + + /* Check that the class assignment is correct for sorting */ + if ( !oCol.bSortable || + ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) + { + oCol.sSortingClass = oSettings.oClasses.sSortableNone; + oCol.sSortingClassJUI = ""; + } + else if ( oCol.bSortable || + ($.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) == -1) ) + { + oCol.sSortingClass = oSettings.oClasses.sSortable; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUI; + } + else if ( $.inArray('asc', oCol.asSorting) != -1 && $.inArray('desc', oCol.asSorting) == -1 ) + { + oCol.sSortingClass = oSettings.oClasses.sSortableAsc; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIAscAllowed; + } + else if ( $.inArray('asc', oCol.asSorting) == -1 && $.inArray('desc', oCol.asSorting) != -1 ) + { + oCol.sSortingClass = oSettings.oClasses.sSortableDesc; + oCol.sSortingClassJUI = oSettings.oClasses.sSortJUIDescAllowed; + } + } + + + /** + * Adjust the table column widths for new data. Note: you would probably want to + * do a redraw after calling this function! + * @param {object} oSettings dataTables settings object + * @memberof DataTable#oApi + */ + function _fnAdjustColumnSizing ( oSettings ) + { + /* Not interested in doing column width calculation if autowidth is disabled */ + if ( oSettings.oFeatures.bAutoWidth === false ) + { + return false; + } + + _fnCalculateColumnWidths( oSettings ); + for ( var i=0 , iLen=oSettings.aoColumns.length ; i