diff --git a/Html/css/images/mblogoblackfull.png b/Html/css/images/mblogoblackfull.png deleted file mode 100644 index 340f12d9df..0000000000 Binary files a/Html/css/images/mblogoblackfull.png and /dev/null differ diff --git a/Html/css/images/mblogoicon.png b/Html/css/images/mblogoicon.png new file mode 100644 index 0000000000..be2de69d14 Binary files /dev/null and b/Html/css/images/mblogoicon.png differ diff --git a/Html/css/images/mblogotextblack.png b/Html/css/images/mblogotextblack.png new file mode 100644 index 0000000000..cd22f437f2 Binary files /dev/null and b/Html/css/images/mblogotextblack.png differ diff --git a/Html/css/images/mblogotextwhite.png b/Html/css/images/mblogotextwhite.png new file mode 100644 index 0000000000..b1a7c8fc74 Binary files /dev/null and b/Html/css/images/mblogotextwhite.png differ diff --git a/Html/css/images/mblogowhitefull.png b/Html/css/images/mblogowhitefull.png deleted file mode 100644 index 48c8f72d39..0000000000 Binary files a/Html/css/images/mblogowhitefull.png and /dev/null differ diff --git a/Html/css/site.css b/Html/css/site.css index 186266c4dc..32818e3ccc 100644 --- a/Html/css/site.css +++ b/Html/css/site.css @@ -1,806 +1,816 @@ -@font-face { - font-family: "Open Sans"; - font-style: normal; - font-weight: 700; - src: local("Open Sans Bold"), local("OpenSans-Bold"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/k3k702ZOKiLJc3WVjuplzJ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); -} - -@font-face { - font-family: "Open Sans"; - font-style: normal; - font-weight: 300; - src: local("Open Sans Light"), local("OpenSans-Light"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTZ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); -} - -@font-face { - font-family: "Open Sans"; - font-style: normal; - font-weight: 800; - src: local("Open Sans Extrabold"), local("OpenSans-Extrabold"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/EInbV5DfGHOiMmvb1Xr-hp1r3JsPcQLi8jytr04NNhU.woff) format('woff'); -} - -@font-face { - font-family: "Open Sans"; - font-style: normal; - font-weight: 400; - src: local("Open Sans"), local("OpenSans"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); -} - -body { - overflow-y: scroll!important; -} - -h1 { - font-family: 'Segoe UI Light', 'Open Sans', Arial, Helvetica, sans-serif; - font-weight: 200; - font-size: 32pt; -} - -.toolsSidebar h1 { - font-size: 42pt; -} - -.ui-loader h1 { - font-weight: bold; - font-family: Arial; -} - -h2 { - font-family: 'Segoe UI Semiight', 'Open Sans', Arial, Helvetica, sans-serif; - font-weight: 400; - font-size: 22pt; -} - -pre, textarea.pre { - display: block; - padding: 8.5px; - font-size: 12.025px; - line-height: 18px; - word-break: break-all; - word-wrap: break-word; - white-space: pre; - white-space: pre-wrap; - background-color: #f5f5f5; - border: 1px solid #ccc; - border: 1px solid rgba(0, 0, 0, 0.15); - -webkit-border-radius: 4px; - -moz-border-radius: 4px; - border-radius: 4px; - font-family: Menlo, Monaco, Consolas, "Courier New", monospace; - color: #000; -} - -.type-interior h2 { - color: #1B58B8; -} - -/* - Page / Base styles - */ -.page { - background: #f2f2f2; - background-attachment: fixed; -} - -.libraryPage { - background: #1d1d1d url(images/bg.png) top left repeat-x; - background: #262626!important; - background-attachment: fixed!important; -} - - .libraryPage .interiorLink { - color: #2489ce; - font-weight: bold; - } - -/* - Header - */ -.header { - padding: 10px 0 10px 10px; -} - -.imgLogo { - height: 45px; -} - - -.ui-popup-container { - z-index: 99999; -} - -.headerButtons { - float: right; - position: absolute; - top: 10px; - right: 10px; -} - -.header .imageLink { - display: inline-block; -} - -.imageLink + .imageLink { - margin-left: 30px; -} - -.header .imageLink img { - height: 32px; - vertical-align: middle; -} - -.btnCurrentUser { - text-decoration: none; -} - -.currentUsername { - margin-right: 7px; - font-size: 20px; - color: #000; - position: relative; - top: 4px; -} - -.libraryPage .currentUsername { - color: #fff; -} - -h1 .imageLink { - margin-left: 15px; -} - - h1 .imageLink img { - height: 32px; - } - -.imageLink:hover { - opacity: .5; -} - -.type-home h1 { - margin-top: 1.25em; - margin-bottom: 10px; - padding-bottom: 5px; - font-weight: normal; - border-bottom: 1px solid #777; -} - -.libraryPage .ui-content > h1:first-child { - margin-top: 0; -} - -.pageTitle { - margin-top: 0; -} - -.imageButton { - background: transparent; - border: 0; - padding: 0; - cursor: pointer; - cursor: hand; -} - - .imageButton:hover { - opacity: .5; - } - - .imageButton[disabled], .imageButton[disabled]:hover { - opacity: .3!important; - cursor: default; - } - -/* - Forms - */ -form, .readOnlyContent { - max-width: 600px; -} - -.fieldDescription { - font-size: 11px; - padding-left: 5px; -} - -.ulForm { - margin-bottom: 20px!important; -} - - .ulForm li:not(.ui-li-divider) { - background: none; - border-top: none; - border-bottom: none; - } - -.popup .ulForm { - margin-bottom: 0!important; -} - -.popup .ui-content { - padding: 20px; -} - -.content-secondary { - z-index: 99996; - background: #262626; - border: 0; - margin-top: 40px; -} - - .content-secondary h1 { - margin: 0; - padding: 20px 0 20px 30px; - color: #fff; - } - -.sidebarLinks a { - display: block; - padding: 12px 15px 12px 30px; - text-decoration: none; - color: #fff!important; - text-shadow: none!important; - font-weight: normal!important; - font-size: 17px; -} - - .sidebarLinks a:hover { - background: #f2f2f2; - color: #000!important; - } - - .sidebarLinks a.selectedSidebarLink { - background: #2572EB!important; - color: #fff!important; - } - -/* Tabs (e.g. advanced metadata page) */ -.localnav { - margin-bottom: 40px!important; -} - - .localnav + form { - margin-top: -10px; - } - -.page > .ui-content { - padding-bottom: 100px; -} - -@media all and (min-width: 650px) { - - .imgLogo { - height: 60px; - } - - .header { - padding-left: 30px; - padding-top: 20px; - padding-bottom: 15px; - } - - .headerButtons { - top: 20px; - right: 30px; - } - - .localnav .ui-btn-inner { - font-size: 16px; - } - - .libraryPage .ui-content { - padding-right: 50px; - padding-left: 50px; - } - - .type-interior > .ui-content { - padding-right: 0; - padding-left: 0; - padding-top: 0; - overflow: hidden; - } - - .content-secondary { - text-align: left; - width: 45%; - position: fixed; - top: 0; - left: 0; - bottom: 0; - margin: 0; - } - - .content-primary { - width: 45%; - float: right; - padding: 0 6% 3em 0; - margin: 0; - } - - .content-primary ul:first-child { - margin-top: 0; - } -} - -@media all and (min-width: 750px) { - - .content-secondary { - width: 34%; - } - - .content-primary { - width: 56%; - } -} - -@media all and (min-width: 1200px) { - - - .content-secondary { - width: 30%; - } - - .content-primary { - width: 60%; - } -} - -@media all and (min-width: 1440px) { - - - .content-secondary { - width: 25%; - } - - .content-primary { - width: 65%; - } -} - -@media all and (min-width: 1920px) { - - - .content-secondary { - width: 20%; - } - - .content-primary { - width: 70%; - } -} - -/* - Media Library Page - */ -.mediaFolderButtons { - margin-top: 10px; -} - -.mediaFolderLocations { - margin: 1em .25em!important; -} - -.mediaLocationsHeader { - padding-top: .75em!important; - padding-bottom: .75em!important; -} - - .mediaLocationsHeader .ui-btn { - position: absolute; - right: 3px; - margin-top: 0!important; - margin-bottom: 0!important; - top: 6px; - } - -#divVirtualFolders .ui-btn-inner, .mediaLocationsHeader, #divVirtualFolders .ui-btn-text { - font-size: 14px; -} - -#ulDirectoryPickerList a { - padding-top: .4em; - padding-bottom: .4em; - font-size: 15px; -} - -/* - Plugin updates Page - */ -#pluginUpdatesForm table { - width: 100%; -} - -#pluginUpdatesForm td + td { - text-align: center; -} - - -/* - List Vew Items - */ - -.posterViewItem { - display: inline-block; - margin: 5px; - text-align: center; - font-size: 15px; - padding: 0; - position: relative; -} - - .posterViewItem a { - color: white!important; - font-weight: normal!important; - text-decoration: none; - } - - .posterViewItem img { - max-width: 155px; - max-height: 155px; - vertical-align: bottom; - } - -.premiumBanner img { - position: absolute; - text-align: right; - top: 0; - right: 0; - width: 75px!important; - height: 75px!important; - max-width: 75px!important; - max-height: 75px!important; -} - -.posterViewItemText { - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - margin: 0; - padding: 4px 0px 0; - bottom: 0; - left: 0; - right: 0; - background: #181818; - text-shadow: none; - max-width: 155px; -} - - .posterViewItemText div{ - text-overflow: ellipsis; - overflow: hidden; - white-space: nowrap; - margin: 0px 4px; - height: 24px; - } - -.posterViewItem:hover, .userItem:hover { - -moz-box-shadow: 0 0 20px 3px #2572EB; - -webkit-box-shadow: 0 0 20px 3px #2572EB; - box-shadow: 0 0 20px 3px #2572EB; -} - -@media all and (min-width: 750px) { - - .posterViewItem { - font-size: 16px; - } - - .posterViewItemText { - padding-top: 5px; - max-width: 190px; - } - - .posterViewItem img { - max-width: 190px; - max-height: 190px; - } -} - -@media all and (min-width: 1200px) { - - .posterViewItem { - font-size: 17px; - } - - .posterViewItem img { - max-width: 280px; - max-height: 280px; - } - - .posterViewItemText { - max-width: 280px; - } -} - -@media all and (min-width: 1920px) { - - .posterViewItem { - font-size: 19px; - } - - .posterViewItemText div{ - height: 28px; - } - - .posterViewItem img { - max-width: 352px; - max-height: 352px; - } - - .posterViewItemText { - max-width: 352px; - } -} - -/* Startup wizard */ -.wizardPage { - background: #e2e2e2; -} - -.wizardContent { - max-width: 800px; - padding: .5em 2em 1em; - margin: 0 auto; - background: #f2f2f2; -} - -.wizardNavigation { - text-align: right; -} - -.wizardContent form { - max-width: 100%; -} - -.wizardContent p { - margin: 2em 0; -} - -.wizardContent h2 img { - height: 35px; - vertical-align: middle; - margin-right: .5em; - position: relative; - top: -3px; -} - -/* User Image */ -.imageDropZone { - border: 2px dashed #bbb; - -moz-border-radius: 5px; - -webkit-border-radius: 5px; - border-radius: 5px; - padding: 25px; - text-align: center; - color: #bbb; -} - -/* Dashboard home */ -.tblConnections td { - padding: .5em 0 .5em 1.25em; -} - - .tblConnections td:first-child { - padding-left: 0; - } - -.tblConnections img { - height: 50px; -} - -.clientNowPlayingImage { - border-radius: 5px; - border: 2px solid #ccc; -} - -/* Footer */ -#footer { - background: #5a5a5a; - position: fixed; - bottom: -2px; - left: -2px; - right: -2px; - z-index: 99997; -} - -.footerNotification { - text-shadow: none; - padding: .5em 1em; - margin: 0; - font-weight: normal; - border-top: 1px solid #999; -} - -.notificationIcon { - height: 24px; - margin-right: 1em; - vertical-align: middle; -} - -/* - * Gradient Shadow - */ - -/* All HTML5 progress enabled browsers */ -progress { - /* Turns off styling - not usually needed, but good to know. */ - appearance: none; - -moz-appearance: none; - -webkit-appearance: none; - /* gets rid of default border in Firefox and Opera. */ - border: solid #cccccc 2px; - border-radius: 4px; - margin: 0; -} - - /* Polyfill */ - progress[role]:after { - background-image: none; /* removes default background from polyfill */ - } - -/* - * Background of the progress bar background - */ - -/* Firefox and Polyfill */ -progress { - background: #cccccc !important; /* !important only needed in polyfill */ -} - - /* Chrome */ - progress::-webkit-progress-bar { - background: #cccccc; - } - - /* - * Background of the progress bar value - */ - - /* Firefox */ - progress::-moz-progress-bar { - border-radius: 5px; - background-image: -moz-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); - } - - /* Chrome */ - progress::-webkit-progress-value { - border-radius: 5px; - background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(43,194,83)), color-stop(1, rgb(84,240,84)) ); - background-image: -webkit-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); - } - - /* Polyfill */ - progress[aria-valuenow]:before { - border-radius: 5px; - background-image: -moz-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); - background-image: -ms-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); - background-image: -o-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); - } - -/* Detail Page*/ - -.itemDetailImage { - max-width: 100%; - max-height: 400px; -} - -.itemImageBlock { - vertical-align: top; -} - -.itemDetailBlock { - vertical-align: top; - padding-top: 1em; -} - - .itemDetailBlock p { - margin-top: 0; - } - -.starRating { - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMYAAAA6CAYAAADryyY/AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmU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Fna5KgnZW+m8QcgM1JNFW03vZegwxl0eekqz1+nh/wHpt113GQ6n7AAAAABJRU5ErkJggg==); - background-position: left center; - background-repeat: no-repeat; - width: 24px; - height: 20px; - display: inline-block; - background-size: cover; -} - -.galleryImage { - width: 120px; - display: inline-block; - margin: 5px; -} - -.halfStarRating { - background-position: center center; -} - -.emptyStarRating { - background-position: right center; -} - -@media all and (min-width: 650px) { - .itemImageBlock { - display: inline-block; - } - - .itemDetailImage, .itemImageBlock { - max-width: 220px; - } - - .itemDetailBlock { - padding-top: 0; - display: inline-block; - width: 45%; - padding-left: 20px; - max-width: 800px; - } - - .galleryImage { - width: 150px; - } -} - -@media all and (min-width: 750px) { - - .itemDetailImage, .itemImageBlock { - max-width: 300px; - } - - .itemDetailBlock { - padding-left: 30px; - } -} - - -@media all and (min-width: 1200px) { - - .itemDetailImage, .itemImageBlock { - max-width: 400px; - } - - .itemDetailBlock { - width: 55%; - } - - .galleryImage { - width: 200px; - } -} - -/* Now playing bar */ -#nowPlayingBar { - padding: 10px 20px 8px; - border-top: 1px solid #5490CC; -} - -.mediaButton { - margin: 0 20px 0 0; - display: inline-block; -} - -#mediaElement { - margin-right: 20px; - display: inline-block; - position: relative; -} - -.mediaButton img { - height: 28px; -} - -.itemVideo { - position: absolute; - z-index: 99998; - height: auto; - width: 180px; - bottom: -5px; -} - -@media all and (min-width: 650px) { - - .itemVideo { - width: 270px; - } -} +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 700; + src: local("Open Sans Bold"), local("OpenSans-Bold"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/k3k702ZOKiLJc3WVjuplzJ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); +} + +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 300; + src: local("Open Sans Light"), local("OpenSans-Light"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/DXI1ORHCpsQm3Vp6mXoaTZ1r3JsPcQLi8jytr04NNhU.woff) format('woff'); +} + +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 800; + src: local("Open Sans Extrabold"), local("OpenSans-Extrabold"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/EInbV5DfGHOiMmvb1Xr-hp1r3JsPcQLi8jytr04NNhU.woff) format('woff'); +} + +@font-face { + font-family: "Open Sans"; + font-style: normal; + font-weight: 400; + src: local("Open Sans"), local("OpenSans"), url(http://themes.googleusercontent.com/static/fonts/opensans/v6/K88pR3goAWT7BTt32Z01mz8E0i7KZn-EPnyo3HZu7kw.woff) format('woff'); +} + +body { + overflow-y: scroll!important; +} + +h1 { + font-family: 'Segoe UI Light', 'Open Sans', Arial, Helvetica, sans-serif; + font-weight: 200; + font-size: 32pt; +} + +.toolsSidebar h1 { + font-size: 42pt; +} + +.ui-loader h1 { + font-weight: bold; + font-family: Arial; +} + +h2 { + font-family: 'Segoe UI Semiight', 'Open Sans', Arial, Helvetica, sans-serif; + font-weight: 400; + font-size: 22pt; +} + +pre, textarea.pre { + display: block; + padding: 8.5px; + font-size: 12.025px; + line-height: 18px; + word-break: break-all; + word-wrap: break-word; + white-space: pre; + white-space: pre-wrap; + background-color: #f5f5f5; + border: 1px solid #ccc; + border: 1px solid rgba(0, 0, 0, 0.15); + -webkit-border-radius: 4px; + -moz-border-radius: 4px; + border-radius: 4px; + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + color: #000; +} + +.type-interior h2 { + color: #1B58B8; +} + +/* + Page / Base styles + */ +.page { + background: #f2f2f2; + background-attachment: fixed; +} + +.libraryPage { + background: #1d1d1d url(images/bg.png) top left repeat-x; + background: #262626!important; + background-attachment: fixed!important; +} + + .libraryPage .interiorLink { + color: #2489ce; + font-weight: bold; + } + +/* + Header + */ +.header { + padding: 10px 0 10px 10px; +} + +.imgLogoIcon { + height: 45px; +} + +.imgLogoText { + height: 45px; + display: none; +} + + +.ui-popup-container { + z-index: 99999; +} + +.headerButtons { + float: right; + position: absolute; + top: 10px; + right: 10px; +} + +.header .imageLink { + display: inline-block; +} + +.imageLink + .imageLink { + margin-left: 30px; +} + +.header .imageLink img { + height: 32px; + vertical-align: middle; +} + +.btnCurrentUser { + text-decoration: none; +} + +.currentUsername { + margin-right: 7px; + font-size: 20px; + color: #000; + position: relative; + top: 4px; +} + +.libraryPage .currentUsername { + color: #fff; +} + +h1 .imageLink { + margin-left: 15px; +} + + h1 .imageLink img { + height: 32px; + } + +.imageLink:hover { + opacity: .5; +} + +.type-home h1 { + margin-top: 1.25em; + margin-bottom: 10px; + padding-bottom: 5px; + font-weight: normal; + border-bottom: 1px solid #777; +} + +.libraryPage .ui-content > h1:first-child { + margin-top: 0; +} + +.pageTitle { + margin-top: 0; +} + +.imageButton { + background: transparent; + border: 0; + padding: 0; + cursor: pointer; + cursor: hand; +} + + .imageButton:hover { + opacity: .5; + } + + .imageButton[disabled], .imageButton[disabled]:hover { + opacity: .3!important; + cursor: default; + } + +/* + Forms + */ +form, .readOnlyContent { + max-width: 600px; +} + +.fieldDescription { + font-size: 11px; + padding-left: 5px; +} + +.ulForm { + margin-bottom: 20px!important; +} + + .ulForm li:not(.ui-li-divider) { + background: none; + border-top: none; + border-bottom: none; + } + +.popup .ulForm { + margin-bottom: 0!important; +} + +.popup .ui-content { + padding: 20px; +} + +.content-secondary { + z-index: 99996; + background: #262626; + border: 0; + margin-top: 40px; +} + + .content-secondary h1 { + margin: 0; + padding: 20px 0 20px 30px; + color: #fff; + } + +.sidebarLinks a { + display: block; + padding: 12px 15px 12px 30px; + text-decoration: none; + color: #fff!important; + text-shadow: none!important; + font-weight: normal!important; + font-size: 17px; +} + + .sidebarLinks a:hover { + background: #f2f2f2; + color: #000!important; + } + + .sidebarLinks a.selectedSidebarLink { + background: #2572EB!important; + color: #fff!important; + } + +/* Tabs (e.g. advanced metadata page) */ +.localnav { + margin-bottom: 40px!important; +} + + .localnav + form { + margin-top: -10px; + } + +.page > .ui-content { + padding-bottom: 100px; +} + +@media all and (min-width: 650px) { + + .imgLogoIcon { + height: 60px; + } + + .imgLogoText { + height: 60px; + display: inline; + } + + .header { + padding-left: 30px; + padding-top: 20px; + padding-bottom: 15px; + } + + .headerButtons { + top: 20px; + right: 30px; + } + + .localnav .ui-btn-inner { + font-size: 16px; + } + + .libraryPage .ui-content { + padding-right: 50px; + padding-left: 50px; + } + + .type-interior > .ui-content { + padding-right: 0; + padding-left: 0; + padding-top: 0; + overflow: hidden; + } + + .content-secondary { + text-align: left; + width: 45%; + position: fixed; + top: 0; + left: 0; + bottom: 0; + margin: 0; + } + + .content-primary { + width: 45%; + float: right; + padding: 0 6% 3em 0; + margin: 0; + } + + .content-primary ul:first-child { + margin-top: 0; + } +} + +@media all and (min-width: 750px) { + + .content-secondary { + width: 34%; + } + + .content-primary { + width: 56%; + } +} + +@media all and (min-width: 1200px) { + + + .content-secondary { + width: 30%; + } + + .content-primary { + width: 60%; + } +} + +@media all and (min-width: 1440px) { + + + .content-secondary { + width: 25%; + } + + .content-primary { + width: 65%; + } +} + +@media all and (min-width: 1920px) { + + + .content-secondary { + width: 20%; + } + + .content-primary { + width: 70%; + } +} + +/* + Media Library Page + */ +.mediaFolderButtons { + margin-top: 10px; +} + +.mediaFolderLocations { + margin: 1em .25em!important; +} + +.mediaLocationsHeader { + padding-top: .75em!important; + padding-bottom: .75em!important; +} + + .mediaLocationsHeader .ui-btn { + position: absolute; + right: 3px; + margin-top: 0!important; + margin-bottom: 0!important; + top: 6px; + } + +#divVirtualFolders .ui-btn-inner, .mediaLocationsHeader, #divVirtualFolders .ui-btn-text { + font-size: 14px; +} + +#ulDirectoryPickerList a { + padding-top: .4em; + padding-bottom: .4em; + font-size: 15px; +} + +/* + Plugin updates Page + */ +#pluginUpdatesForm table { + width: 100%; +} + +#pluginUpdatesForm td + td { + text-align: center; +} + + +/* + List Vew Items + */ + +.posterViewItem { + display: inline-block; + margin: 5px; + text-align: center; + font-size: 15px; + padding: 0; + position: relative; +} + + .posterViewItem a { + color: white!important; + font-weight: normal!important; + text-decoration: none; + } + + .posterViewItem img { + max-width: 155px; + max-height: 155px; + vertical-align: bottom; + } + +.premiumBanner img { + position: absolute; + text-align: right; + top: 0; + right: 0; + width: 75px!important; + height: 75px!important; + max-width: 75px!important; + max-height: 75px!important; +} + +.posterViewItemText { + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + margin: 0; + padding: 4px 0px 0; + bottom: 0; + left: 0; + right: 0; + background: #181818; + text-shadow: none; + max-width: 155px; +} + + .posterViewItemText div{ + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + margin: 0px 4px; + height: 24px; + } + +.posterViewItem:hover, .userItem:hover { + -moz-box-shadow: 0 0 20px 3px #2572EB; + -webkit-box-shadow: 0 0 20px 3px #2572EB; + box-shadow: 0 0 20px 3px #2572EB; +} + +@media all and (min-width: 750px) { + + .posterViewItem { + font-size: 16px; + } + + .posterViewItemText { + padding-top: 5px; + max-width: 190px; + } + + .posterViewItem img { + max-width: 190px; + max-height: 190px; + } +} + +@media all and (min-width: 1200px) { + + .posterViewItem { + font-size: 17px; + } + + .posterViewItem img { + max-width: 280px; + max-height: 280px; + } + + .posterViewItemText { + max-width: 280px; + } +} + +@media all and (min-width: 1920px) { + + .posterViewItem { + font-size: 19px; + } + + .posterViewItemText div{ + height: 28px; + } + + .posterViewItem img { + max-width: 352px; + max-height: 352px; + } + + .posterViewItemText { + max-width: 352px; + } +} + +/* Startup wizard */ +.wizardPage { + background: #e2e2e2; +} + +.wizardContent { + max-width: 800px; + padding: .5em 2em 1em; + margin: 0 auto; + background: #f2f2f2; +} + +.wizardNavigation { + text-align: right; +} + +.wizardContent form { + max-width: 100%; +} + +.wizardContent p { + margin: 2em 0; +} + +.wizardContent h2 img { + height: 35px; + vertical-align: middle; + margin-right: .5em; + position: relative; + top: -3px; +} + +/* User Image */ +.imageDropZone { + border: 2px dashed #bbb; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + border-radius: 5px; + padding: 25px; + text-align: center; + color: #bbb; +} + +/* Dashboard home */ +.tblConnections td { + padding: .5em 0 .5em 1.25em; +} + + .tblConnections td:first-child { + padding-left: 0; + } + +.tblConnections img { + height: 50px; +} + +.clientNowPlayingImage { + border-radius: 5px; + border: 2px solid #ccc; +} + +/* Footer */ +#footer { + background: #5a5a5a; + position: fixed; + bottom: -2px; + left: -2px; + right: -2px; + z-index: 99997; +} + +.footerNotification { + text-shadow: none; + padding: .5em 1em; + margin: 0; + font-weight: normal; + border-top: 1px solid #999; +} + +.notificationIcon { + height: 24px; + margin-right: 1em; + vertical-align: middle; +} + +/* + * Gradient Shadow + */ + +/* All HTML5 progress enabled browsers */ +progress { + /* Turns off styling - not usually needed, but good to know. */ + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + /* gets rid of default border in Firefox and Opera. */ + border: solid #cccccc 2px; + border-radius: 4px; + margin: 0; +} + + /* Polyfill */ + progress[role]:after { + background-image: none; /* removes default background from polyfill */ + } + +/* + * Background of the progress bar background + */ + +/* Firefox and Polyfill */ +progress { + background: #cccccc !important; /* !important only needed in polyfill */ +} + + /* Chrome */ + progress::-webkit-progress-bar { + background: #cccccc; + } + + /* + * Background of the progress bar value + */ + + /* Firefox */ + progress::-moz-progress-bar { + border-radius: 5px; + background-image: -moz-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); + } + + /* Chrome */ + progress::-webkit-progress-value { + border-radius: 5px; + background-image: -webkit-gradient( linear, left bottom, left top, color-stop(0, rgb(43,194,83)), color-stop(1, rgb(84,240,84)) ); + background-image: -webkit-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); + } + + /* Polyfill */ + progress[aria-valuenow]:before { + border-radius: 5px; + background-image: -moz-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); + background-image: -ms-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); + background-image: -o-linear-gradient( center bottom, rgb(43,194,83) 37%, rgb(84,240,84) 69% ); + } + +/* Detail Page*/ + +.itemDetailImage { + max-width: 100%; + max-height: 400px; +} + +.itemImageBlock { + vertical-align: top; +} + +.itemDetailBlock { + vertical-align: top; + padding-top: 1em; +} + + .itemDetailBlock p { + margin-top: 0; + } + +.starRating { + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMYAAAA6CAYAAADryyY/AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAS+klEQVR4Xu1de1gUV54dMJmdyWRcZzWZPNZMRLIRgxhFRhOdRCRKwMQkoGZ0hCCiGOOqSdSwrpmMiE58JDOT6LpmvnE0Jk40RoOPaHjKU1QQEBB5qPgCROhmdP377vnRVVDdXe/qruqgfN/5qrpuFV333HN+t+6jbv+IMfaju7jLwV0NOGugyxRW/rVdSe2H7/fn4GfVvdzlwcG81TzU19f7hB6sJsLP1pK2qvXSqjSUyU+BewBLzGGxILp4OHfu3B3Pw/nz532CB0uNcbl+ZUBnaxqzt6zunB0XNgSm+DnQx4paw0pj8DxAFJ0zZsy4Y3morKwMuHDhAvMFHqw0hp+tedWOztZURqgue/dzGOLfuZrD9FrDQmN080CiKCwsvGN5aGxs3EEc+AIPlhnj8rmU0M6WVawLzX/owptJY6JgjAeAe81+pLLKGEIeECkpWrKEhIQ7joeKiopQ3hS+wINVxvC3Xf19XmfzBzAEh2sfsOqTSw7DEIHA/Vxj3LSnKouM4cQDCQJRk+Xn599xPDQ0NOTxhvAFHqwwht+1+vciOq/9nnXh6vtO2PrJq0lww0PAj01zhTW9MW48QByMx8aNG+8YHs6cORNBAYEg5ID2reLBCmP426+sbOq8uhKGcMfF6nfLoNMnuYY4deOa8mdBjeHGg1AUpaWldwwP6KJtcjUE/9kqHsw2hl9Lw/I5nVf+mzljBT73YOdnMcvghoFcrWFKQ9xkY4jyAIEwITZt2tTreaiqqprjagpf4MFUYxRnJvW3X0pp6rz8X0wcKTiewlrrl7bAFMFAX7O6b800hhQProL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MJztNHjx5liNSm8ZCenh5LxtixY8fRxMREy/XgCR50GaPhm6ETV89/hFbiCOUeXYQ1BAlS6yOTUo0hZhAyHX0XmZDmSAUlTO43JXXeg7Q6Bj1yaZoaoscYvspDdHT0lLlz55rGA2qricnJyT6nByM86DIG95hCjWJaB5Z6j2iZGm/UEEqG4WsQ+m66B3qEonvqD2h6m0+PMe7y0FU8VAb02Nqr9KDHGEQGvQxEZFBUFna5KgnZW+m8QcgM1JNFW03vZegwxl0eekqz1+nh/wHpt113GQ6n7AAAAABJRU5ErkJggg==); + background-position: left center; + background-repeat: no-repeat; + width: 24px; + height: 20px; + display: inline-block; + background-size: cover; +} + +.galleryImage { + width: 120px; + display: inline-block; + margin: 5px; +} + +.halfStarRating { + background-position: center center; +} + +.emptyStarRating { + background-position: right center; +} + +@media all and (min-width: 650px) { + .itemImageBlock { + display: inline-block; + } + + .itemDetailImage, .itemImageBlock { + max-width: 220px; + } + + .itemDetailBlock { + padding-top: 0; + display: inline-block; + width: 45%; + padding-left: 20px; + max-width: 800px; + } + + .galleryImage { + width: 150px; + } +} + +@media all and (min-width: 750px) { + + .itemDetailImage, .itemImageBlock { + max-width: 300px; + } + + .itemDetailBlock { + padding-left: 30px; + } +} + + +@media all and (min-width: 1200px) { + + .itemDetailImage, .itemImageBlock { + max-width: 400px; + } + + .itemDetailBlock { + width: 55%; + } + + .galleryImage { + width: 200px; + } +} + +/* Now playing bar */ +#nowPlayingBar { + padding: 10px 20px 8px; + border-top: 1px solid #5490CC; +} + +.mediaButton { + margin: 0 20px 0 0; + display: inline-block; +} + +#mediaElement { + margin-right: 20px; + display: inline-block; + position: relative; +} + +.mediaButton img { + height: 28px; +} + +.itemVideo { + position: absolute; + z-index: 99998; + height: auto; + width: 180px; + bottom: -5px; +} + +@media all and (min-width: 650px) { + + .itemVideo { + width: 270px; + } +} diff --git a/Html/scripts/site.js b/Html/scripts/site.js index 2660697dc2..d5479b3ede 100644 --- a/Html/scripts/site.js +++ b/Html/scripts/site.js @@ -1,1187 +1,1187 @@ -$.ajaxSetup({ - crossDomain: true, - - error: function (event, jqxhr, settings, exception) { - Dashboard.hideLoadingMsg(); - - if (!Dashboard.suppressAjaxErrors) { - setTimeout(function () { - - - var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage; - - Dashboard.showError(msg); - }, 500); - } - } -}); - -$.support.cors = true; - -$(document).one('click', WebNotifications.requestPermission); - -var Dashboard = { - jQueryMobileInit: function () { - - //$.mobile.defaultPageTransition = 'slide'; - - // Page - //$.mobile.page.prototype.options.theme = "a"; - //$.mobile.page.prototype.options.headerTheme = "a"; - //$.mobile.page.prototype.options.contentTheme = "a"; - //$.mobile.page.prototype.options.footerTheme = "a"; - - //$.mobile.button.prototype.options.theme = "c"; - $.mobile.listview.prototype.options.dividerTheme = "b"; - - $.mobile.popup.prototype.options.theme = "c"; - //$.mobile.collapsible.prototype.options.contentTheme = "a"; - }, - - getCurrentUser: function () { - - if (!Dashboard.getUserPromise) { - Dashboard.getUserPromise = ApiClient.getUser(Dashboard.getCurrentUserId()).fail(Dashboard.logout); - } - - return Dashboard.getUserPromise; - }, - - validateCurrentUser: function () { - Dashboard.getUserPromise = null; - - if (Dashboard.getCurrentUserId()) { - Dashboard.getCurrentUser(); - } - - // Re-render the header - $('.header').remove(); - Dashboard.ensureHeader($.mobile.activePage); - }, - - getCurrentUserId: function () { - - var userId = localStorage.getItem("userId"); - - if (!userId) { - var autoLoginUserId = getParameterByName('u'); - - if (autoLoginUserId) { - userId = autoLoginUserId; - localStorage.setItem("userId", userId); - } - } - - return userId; - }, - - setCurrentUser: function (userId) { - localStorage.setItem("userId", userId); - Dashboard.getUserPromise = null; - }, - - logout: function () { - localStorage.removeItem("userId"); - Dashboard.getUserPromise = null; - window.location = "login.html"; - }, - - showError: function (message) { - - $.mobile.loading('show', { - theme: "e", - text: message, - textonly: true, - textVisible: true - }); - - setTimeout(function () { - $.mobile.loading('hide'); - }, 2000); - }, - - alert: function (message) { - - $.mobile.loading('show', { - theme: "e", - text: message, - textonly: true, - textVisible: true - }); - - setTimeout(function () { - $.mobile.loading('hide'); - }, 2000); - }, - - updateSystemInfo: function (info) { - - var isFirstLoad = !Dashboard.lastSystemInfo; - - Dashboard.lastSystemInfo = info; - Dashboard.ensureWebSocket(info); - - if (!Dashboard.initialServerVersion) { - Dashboard.initialServerVersion = info.Version; - } - - if (info.HasPendingRestart) { - - Dashboard.hideDashboardVersionWarning(); - Dashboard.showServerRestartWarning(); - - } else { - - Dashboard.hideServerRestartWarning(); - - if (Dashboard.initialServerVersion != info.Version) { - - Dashboard.showDashboardVersionWarning(); - } - } - - if (isFirstLoad) { - Dashboard.showFailedAssemblies(info.FailedPluginAssemblies); - } - - Dashboard.showInProgressInstallations(info.InProgressInstallations); - }, - - showFailedAssemblies: function (failedAssemblies) { - - for (var i = 0, length = failedAssemblies.length; i < length; i++) { - - var assembly = failedAssemblies[i]; - - var html = ''; - - var index = assembly.lastIndexOf('\\'); - - if (index != -1) { - assembly = assembly.substring(index + 1); - } - - html += ''; - html += assembly + " failed to load."; - html += ''; - - Dashboard.showFooterNotification({ html: html }); - - } - }, - - showInProgressInstallations: function (installations) { - - installations = installations || []; - - for (var i = 0, length = installations.length; i < length; i++) { - - var installation = installations[i]; - - var percent = installation.PercentComplete || 0; - - if (percent < 100) { - Dashboard.showPackageInstallNotification(installation, "progress"); - } - } - - if (installations.length) { - - Dashboard.ensureInstallRefreshInterval(); - } else { - Dashboard.stopInstallRefreshInterval(); - } - }, - - ensureInstallRefreshInterval: function () { - - if (!Dashboard.installRefreshInterval) { - - if (Dashboard.isWebSocketOpen()) { - Dashboard.sendWebSocketMessage("SystemInfoStart", "0,350"); - } - Dashboard.installRefreshInterval = 1; - } - }, - - stopInstallRefreshInterval: function () { - - if (Dashboard.installRefreshInterval) { - if (Dashboard.isWebSocketOpen()) { - Dashboard.sendWebSocketMessage("SystemInfoStop"); - } - Dashboard.installRefreshInterval = null; - } - }, - - cancelInstallation: function (id) { - - ApiClient.cancelPackageInstallation(id).always(Dashboard.refreshSystemInfoFromServer); - - }, - - showServerRestartWarning: function () { - - var html = 'Please restart Media Browser Server to finish updating.'; - html += ''; - - Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false }); - }, - - hideServerRestartWarning: function () { - - $('#serverRestartWarning').remove(); - }, - - showDashboardVersionWarning: function () { - - var html = 'Please refresh this page to receive new updates from the server.'; - html += ''; - - Dashboard.showFooterNotification({ id: "dashboardVersionWarning", html: html, forceShow: true, allowHide: false }); - }, - - reloadPage: function () { - - window.location.href = window.location.href; - }, - - hideDashboardVersionWarning: function () { - - $('#dashboardVersionWarning').remove(); - }, - - showFooterNotification: function (options) { - - var removeOnHide = !options.id; - - options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random()); - - var parentElem = $('#footerNotifications'); - - var elem = $('#' + options.id, parentElem); - - if (!elem.length) { - elem = $('

').appendTo(parentElem); - } - - var onclick = removeOnHide ? "$(\"#" + options.id + "\").remove();" : "$(\"#" + options.id + "\").hide();"; - - if (options.allowHide !== false) { - options.html += ""; - } - - if (options.forceShow) { - elem.show(); - } - - elem.html(options.html).trigger('create'); - - if (options.timeout) { - - setTimeout(function () { - - if (removeOnHide) { - elem.remove(); - } else { - elem.hide(); - } - - }, options.timeout); - } - }, - - getConfigurationPageUrl: function (name) { - return "ConfigurationPage?name=" + encodeURIComponent(name); - }, - - navigate: function (url, preserveQueryString) { - - var queryString = window.location.search; - if (preserveQueryString && queryString) { - url += queryString; - } - $.mobile.changePage(url); - }, - - showLoadingMsg: function () { - $.mobile.showPageLoadingMsg(); - }, - - hideLoadingMsg: function () { - $.mobile.hidePageLoadingMsg(); - }, - - processPluginConfigurationUpdateResult: function () { - - Dashboard.hideLoadingMsg(); - - Dashboard.alert("Settings saved."); - }, - - defaultErrorMessage: "There was an error processing the request.", - - processServerConfigurationUpdateResult: function (result) { - - Dashboard.hideLoadingMsg(); - - Dashboard.alert("Settings saved."); - }, - - confirm: function (message, title, callback) { - - $('#confirmFlyout').popup("close").remove(); - - var html = '
'; - - html += '
'; - html += '

' + title + '

'; - html += '
'; - - html += '
'; - - html += '
'; - html += message; - html += '
'; - - html += '

'; - html += '

'; - html += '
'; - - html += '
'; - - $(document.body).append(html); - - $('#confirmFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () { - - if (callback) { - callback(this.confirm == true); - } - - $(this).off("popupafterclose").remove(); - }); - }, - - refreshSystemInfoFromServer: function () { - ApiClient.getSystemInfo().done(function (info) { - - Dashboard.updateSystemInfo(info); - }); - }, - - restartServer: function () { - - Dashboard.suppressAjaxErrors = true; - Dashboard.showLoadingMsg(); - - ApiClient.performPendingRestart().done(function () { - - setTimeout(function () { - Dashboard.reloadPageWhenServerAvailable(); - }, 500); - - }).fail(function () { - Dashboard.suppressAjaxErrors = false; - }); - }, - - reloadPageWhenServerAvailable: function (retryCount) { - - ApiClient.getSystemInfo().done(function () { - Dashboard.reloadPage(); - - }).fail(function () { - setTimeout(function () { - - retryCount = retryCount || 0; - retryCount++; - - if (retryCount < 10) { - Dashboard.reloadPageWhenServerAvailable(retryCount); - } else { - Dashboard.suppressAjaxErrors = false; - } - }, 500); - }); - }, - - getPosterViewHtml: function (options) { - - var html = ""; - - for (var i = 0, length = options.items.length; i < length; i++) { - var item = options.items[i]; - - var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary; - - var href = item.IsFolder ? "#" : "itemDetails.html?id=" + item.Id; - - html += "
"; - - if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { - html += ""; - } else if (hasPrimaryImage) { - html += ""; - } - else if (item.BackdropImageTags && item.BackdropImageTags.length) { - html += ""; - } else { - html += ""; - } - - if (options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season')) { - html += "
"; - html += "
" + item.Name + "
"; - html += "
" - } - - html += "
"; - } - - return html; - }, - - showUserFlyout: function () { - - Dashboard.getCurrentUser().done(function (user) { - - var html = '
'; - - html += 'Close'; - - html += '
'; - html += '

' + user.Name + '

'; - html += '
'; - - html += '
'; - - html += '

'; - - var imageUrl = user.PrimaryImageTag ? ApiClient.getUserImageUrl(user.Id, { - - height: 400, - tag: user.PrimaryImageTag, - type: "Primary" - - }) : "css/images/userFlyoutDefault.png"; - - html += ''; - html += '

'; - - html += '

'; - html += '

'; - html += '
'; - - html += '
'; - - $(document.body).append(html); - - $('#userFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () { - - $(this).off("popupafterclose").remove(); - }); - }); - }, - - selectDirectory: function (options) { - - options = options || {}; - - options.header = options.header || "Select Media Path"; - - var html = ''; - - $($.mobile.activePage).append(html); - - var popup = $('#popupDirectoryPicker').popup().trigger('create').popup("open").on("popupafterclose", function () { - - $('form', this).off("submit"); - $(this).off("click").off("popupafterclose").remove(); - - }).on("click", ".lnkDirectory", function () { - - var path = this.getAttribute('data-path'); - - Dashboard.refreshDirectoryBrowser(path); - }); - - var txtCurrentPath = $('#txtDirectoryPickerPath', popup); - - if (options.path) { - txtCurrentPath.val(options.path); - } - - $('form', popup).on('submit', function () { - - if (options.callback) { - options.callback($('#txtDirectoryPickerPath', this).val()); - } - - return false; - }); - - Dashboard.refreshDirectoryBrowser(txtCurrentPath.val()); - }, - - refreshDirectoryBrowser: function (path) { - var page = $.mobile.activePage; - - Dashboard.showLoadingMsg(); - - var promise; - - if (path === "Network") { - promise = ApiClient.getNetworkComputers(); - } - else if (path) { - promise = ApiClient.getDirectoryContents(path, { includeDirectories: true }); - } else { - promise = ApiClient.getDrives(); - } - - promise.done(function (folders) { - - $('#txtDirectoryPickerPath', page).val(path || ""); - - var html = ''; - - if (path) { - - var parentPath = path; - - if (parentPath.endsWith('\\')) { - parentPath = parentPath.substring(0, parentPath.length - 1); - } - - var lastIndex = parentPath.lastIndexOf('\\'); - parentPath = lastIndex == -1 ? "" : parentPath.substring(0, lastIndex); - - if (parentPath.endsWith(':')) { - parentPath += "\\"; - } - - if (parentPath == '\\') { - parentPath = "Network"; - } - - html += '
  • ..
  • '; - } - - for (var i = 0, length = folders.length; i < length; i++) { - - var folder = folders[i]; - - html += '
  • ' + folder.Name + '
  • '; - } - - if (!path) { - html += '
  • Network
  • '; - } - - $('#ulDirectoryPickerList', page).html(html).listview('refresh'); - - Dashboard.hideLoadingMsg(); - - }).fail(function () { - - $('#txtDirectoryPickerPath', page).val(""); - $('#ulDirectoryPickerList', page).html('').listview('refresh'); - - Dashboard.hideLoadingMsg(); - }); - }, - - getPluginSecurityInfo: function () { - - if (!Dashboard.getPluginSecurityInfoPromise) { - Dashboard.getPluginSecurityInfoPromise = ApiClient.getPluginSecurityInfo(); - } - - return Dashboard.getPluginSecurityInfoPromise; - }, - - resetPluginSecurityInfo: function () { - Dashboard.getPluginSecurityInfoPromise = null; - }, - - ensureHeader: function (page) { - - if (!$('.header', page).length) { - - var isLoggedIn = Dashboard.getCurrentUserId(); - - if (isLoggedIn) { - - var promise1 = Dashboard.getCurrentUser(); - var promise2 = Dashboard.getPluginSecurityInfo(); - - $.when(promise1, promise2).done(function (response1, response2) { - - Dashboard.renderHeader(page, response1[0], response2[0]); - }); - - } else { - - Dashboard.renderHeader(page); - } - } - }, - - renderHeader: function (page, user, pluginSecurityInfo) { - - var headerHtml = ''; - headerHtml += '
    '; - - var isLibraryPage = page.hasClass('libraryPage'); - - headerHtml += ''; - - var imageColor = isLibraryPage ? "White" : "Black"; - - if (user && !page.hasClass('wizardPage')) { - headerHtml += '
    '; - headerHtml += '' + user.Name + ''; - - if (user.PrimaryImageTag) { - - var url = ApiClient.getUserImageUrl(user.Id, { - width: 225, - tag: user.PrimaryImageTag, - type: "Primary" - }); - - headerHtml += ''; - } else { - headerHtml += ''; - } - headerHtml += ''; - - if (pluginSecurityInfo.IsMBSupporter) { - headerHtml += ''; - } - if (user.Configuration.IsAdministrator) { - headerHtml += ''; - } - - headerHtml += '
    '; - } - - headerHtml += '
    '; - page.prepend(headerHtml); - }, - - ensureToolsMenu: function (page) { - - if (!page.hasClass('type-interior')) { - return; - } - - var sidebar = $('.toolsSidebar', page); - - if (!sidebar.length) { - - var html = '
    '; - - html += '

    Tools

    '; - - html += ''; - - // content-secondary - html += '
    '; - - $(page).append(html); - } - }, - - getToolsMenuLinks: function (page) { - - var pageElem = page[0]; - - return [{ - name: "Dashboard", - href: "dashboard.html", - selected: pageElem.id == "dashboardPage" - }, { - name: "Media Library", - href: "library.html", - selected: pageElem.id == "mediaLibraryPage" - }, { - name: "Metadata", - href: "metadata.html", - selected: pageElem.id == "metadataConfigurationPage" || pageElem.id == "advancedMetadataConfigurationPage" || pageElem.id == "metadataImagesConfigurationPage" - }, { - name: "Plugins", - href: "plugins.html", - selected: page.hasClass("pluginConfigurationPage") - }, { - name: "User Profiles", - href: "userProfiles.html", - selected: page.hasClass("userProfilesConfigurationPage") - }, { - name: "Display Settings", - href: "uiSettings.html", - selected: pageElem.id == "displaySettingsPage" - }, { - name: "Advanced", - href: "advanced.html", - selected: pageElem.id == "advancedConfigurationPage" - }, { - name: "Scheduled Tasks", - href: "scheduledTasks.html", - selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage" - }, { - name: "Help", - href: "support.html", - selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage" - }]; - - }, - - ensureWebSocket: function (systemInfo) { - - if (!("WebSocket" in window)) { - // Not supported by the browser - return; - } - - if (Dashboard.webSocket) { - if (Dashboard.webSocket.readyState === WebSocket.OPEN || Dashboard.webSocket.readyState === WebSocket.CONNECTING) { - return; - } - } - - systemInfo = systemInfo || Dashboard.lastSystemInfo; - - var url = "ws://" + ApiClient.serverHostName + ":" + systemInfo.WebSocketPortNumber + "/mediabrowser"; - - var ws = new WebSocket(url); - - ws.onmessage = Dashboard.onWebSocketMessage; - - ws.onopen = function () { - setTimeout(function () { - $(document).trigger("websocketopen"); - }, 500); - }; - ws.onerror = function () { - setTimeout(function () { - $(document).trigger("websocketerror"); - }, 0); - }; - ws.onclose = function () { - setTimeout(function () { - $(document).trigger("websocketclose"); - }, 0); - }; - - Dashboard.webSocket = ws; - }, - - resetWebSocketPingInterval: function () { - - if (Dashboard.pingWebSocketInterval) { - clearInterval(Dashboard.pingWebSocketInterval); - Dashboard.pingWebSocketInterval = null; - } - Dashboard.pingWebSocketInterval = setInterval(Dashboard.pingWebSocket, 30000); - }, - - pingWebSocket: function () { - - // Send a ping to the server every so often to try and keep the connection alive - if (Dashboard.isWebSocketOpen()) { - Dashboard.sendWebSocketMessage("ping"); - } - - }, - - onWebSocketMessage: function (msg) { - - msg = JSON.parse(msg.data); - - if (msg.MessageType === "LibraryChanged") { - Dashboard.processLibraryUpdateNotification(msg.Data); - } - else if (msg.MessageType === "UserDeleted") { - Dashboard.validateCurrentUser(); - } - else if (msg.MessageType === "SystemInfo") { - Dashboard.updateSystemInfo(msg.Data); - } - else if (msg.MessageType === "HasPendingRestartChanged") { - Dashboard.updateSystemInfo(msg.Data); - } - else if (msg.MessageType === "UserUpdated") { - Dashboard.validateCurrentUser(); - - var user = msg.Data; - - if (user.Id == Dashboard.getCurrentUserId()) { - - $('.currentUsername').html(user.Name); - } - } - else if (msg.MessageType === "PackageInstallationCompleted") { - Dashboard.showPackageInstallNotification(msg.Data, "completed"); - Dashboard.refreshSystemInfoFromServer(); - } - else if (msg.MessageType === "PackageInstallationFailed") { - Dashboard.showPackageInstallNotification(msg.Data, "failed"); - Dashboard.refreshSystemInfoFromServer(); - } - else if (msg.MessageType === "PackageInstallationCancelled") { - Dashboard.showPackageInstallNotification(msg.Data, "cancelled"); - Dashboard.refreshSystemInfoFromServer(); - } - else if (msg.MessageType === "PackageInstalling") { - Dashboard.showPackageInstallNotification(msg.Data, "progress"); - Dashboard.refreshSystemInfoFromServer(); - } - else if (msg.MessageType === "ScheduledTaskEndExecute") { - - Dashboard.showTaskCompletionNotification(msg.Data); - } - - $(document).trigger("websocketmessage", [msg]); - }, - - sendWebSocketMessage: function (name, data) { - - var msg = { MessageType: name }; - - if (data) { - msg.Data = data; - } - - msg = JSON.stringify(msg); - - Dashboard.webSocket.send(msg); - }, - - isWebSocketOpen: function () { - return Dashboard.webSocket && Dashboard.webSocket.readyState === WebSocket.OPEN; - }, - - showTaskCompletionNotification: function (result) { - - var html = ''; - - if (result.Status == "Completed") { - html += ''; - return; - } - else if (result.Status == "Cancelled") { - html += ''; - return; - } - else { - html += ''; - } - - html += ''; - html += result.Name + " " + result.Status; - html += ''; - - var timeout = 0; - - if (result.Status == 'Cancelled') { - timeout = 2000; - } - - Dashboard.showFooterNotification({ html: html, id: result.Id, forceShow: true, timeout: timeout }); - }, - - showPackageInstallNotification: function (installation, status) { - - var html = ''; - - if (status == 'completed') { - html += ''; - } - else if (status == 'cancelled') { - html += ''; - } - else if (status == 'failed') { - html += ''; - } - else if (status == 'progress') { - html += ''; - } - - html += ''; - - if (status == 'completed') { - html += installation.Name + ' ' + installation.Version + ' installation completed'; - } - else if (status == 'cancelled') { - html += installation.Name + ' ' + installation.Version + ' installation was cancelled'; - } - else if (status == 'failed') { - html += installation.Name + ' ' + installation.Version + ' installation failed'; - } - else if (status == 'progress') { - html += 'Installing ' + installation.Name + ' ' + installation.Version; - } - - html += ''; - - if (status == 'progress') { - - var percentComplete = Math.round(installation.PercentComplete || 0); - - html += ''; - html += '' + percentComplete + '%'; - html += ''; - - if (percentComplete < 100) { - var btnId = "btnCancel" + installation.Id; - html += ''; - } - } - - var timeout = 0; - - if (status == 'cancelled') { - timeout = 2000; - } - - var forceShow = status != "progress"; - var allowHide = status != "progress" && status != 'cancelled'; - - Dashboard.showFooterNotification({ html: html, id: installation.Id, timeout: timeout, forceShow: forceShow, allowHide: allowHide }); - }, - - processLibraryUpdateNotification: function (data) { - - var newItems = data.ItemsAdded.filter(function (a) { - return !a.IsFolder; - }); - - if (!Dashboard.newItems) { - Dashboard.newItems = []; - } - - for (var i = 0, length = newItems.length ; i < length; i++) { - - Dashboard.newItems.push(newItems[i]); - } - - if (Dashboard.newItemTimeout) { - clearTimeout(Dashboard.newItemTimeout); - } - - Dashboard.newItemTimeout = setTimeout(Dashboard.onNewItemTimerStopped, 60000); - }, - - onNewItemTimerStopped: function () { - - var newItems = Dashboard.newItems; - - newItems = newItems.sort(function (a, b) { - - if (a.PrimaryImageTag && b.PrimaryImageTag) { - return 0; - } - - if (a.PrimaryImageTag) { - return -1; - } - - return 1; - }); - - Dashboard.newItems = []; - Dashboard.newItemTimeout = null; - - // Show at most 3 notifications - for (var i = 0, length = Math.min(newItems.length, 3) ; i < length; i++) { - - var item = newItems[i]; - - var data = { - title: "New " + item.Type, - body: item.Name, - timeout: 6000 - }; - - if (item.PrimaryImageTag) { - data.icon = ApiClient.getImageUrl(item.Id, { - width: 100, - tag: item.PrimaryImageTag - }); - } - - WebNotifications.show(data); - } - }, - - ensurePageTitle: function (page) { - - if (!page.hasClass('type-interior')) { - return; - } - - var pageElem = page[0]; - - if (pageElem.hasPageTitle) { - return; - } - - var parent = $('.content-primary', page); - - if (!parent.length) { - parent = $('.ui-content', page)[0]; - } - - $(parent).prepend("

    " + (document.title || " ") + "

    "); - - pageElem.hasPageTitle = true; - }, - - setPageTitle: function (title) { - - $('.pageTitle', $.mobile.activePage).html(title); - - if (title) { - document.title = title; - } - }, - - metroColors: ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"], - - getRandomMetroColor: function () { - - var index = Math.floor(Math.random() * (Dashboard.metroColors.length - 1)); - - return Dashboard.metroColors[index]; - } - -}; - -$(function () { - - var footerHtml = ''; - - - $(document.body).append(footerHtml); -}); - -Dashboard.jQueryMobileInit(); - -$(document).on('pagebeforeshow', ".page", function () { - - Dashboard.refreshSystemInfoFromServer(); - - var page = $(this); - - Dashboard.ensureHeader(page); - Dashboard.ensurePageTitle(page); - -}).on('pageinit', ".page", function () { - - var page = $(this); - var hasLogin = Dashboard.getCurrentUserId(); - - if (!hasLogin) { - - if (this.id !== "loginPage" && !page.hasClass('wizardPage')) { - - Dashboard.logout(); - } - } - - else { - - Dashboard.getCurrentUser().done(function (user) { - - if (user.Configuration.IsAdministrator) { - Dashboard.ensureToolsMenu(page); - } - }); - } +$.ajaxSetup({ + crossDomain: true, + + error: function (event, jqxhr, settings, exception) { + Dashboard.hideLoadingMsg(); + + if (!Dashboard.suppressAjaxErrors) { + setTimeout(function () { + + + var msg = event.getResponseHeader("X-Application-Error-Code") || Dashboard.defaultErrorMessage; + + Dashboard.showError(msg); + }, 500); + } + } +}); + +$.support.cors = true; + +$(document).one('click', WebNotifications.requestPermission); + +var Dashboard = { + jQueryMobileInit: function () { + + //$.mobile.defaultPageTransition = 'slide'; + + // Page + //$.mobile.page.prototype.options.theme = "a"; + //$.mobile.page.prototype.options.headerTheme = "a"; + //$.mobile.page.prototype.options.contentTheme = "a"; + //$.mobile.page.prototype.options.footerTheme = "a"; + + //$.mobile.button.prototype.options.theme = "c"; + $.mobile.listview.prototype.options.dividerTheme = "b"; + + $.mobile.popup.prototype.options.theme = "c"; + //$.mobile.collapsible.prototype.options.contentTheme = "a"; + }, + + getCurrentUser: function () { + + if (!Dashboard.getUserPromise) { + Dashboard.getUserPromise = ApiClient.getUser(Dashboard.getCurrentUserId()).fail(Dashboard.logout); + } + + return Dashboard.getUserPromise; + }, + + validateCurrentUser: function () { + Dashboard.getUserPromise = null; + + if (Dashboard.getCurrentUserId()) { + Dashboard.getCurrentUser(); + } + + // Re-render the header + $('.header').remove(); + Dashboard.ensureHeader($.mobile.activePage); + }, + + getCurrentUserId: function () { + + var userId = localStorage.getItem("userId"); + + if (!userId) { + var autoLoginUserId = getParameterByName('u'); + + if (autoLoginUserId) { + userId = autoLoginUserId; + localStorage.setItem("userId", userId); + } + } + + return userId; + }, + + setCurrentUser: function (userId) { + localStorage.setItem("userId", userId); + Dashboard.getUserPromise = null; + }, + + logout: function () { + localStorage.removeItem("userId"); + Dashboard.getUserPromise = null; + window.location = "login.html"; + }, + + showError: function (message) { + + $.mobile.loading('show', { + theme: "e", + text: message, + textonly: true, + textVisible: true + }); + + setTimeout(function () { + $.mobile.loading('hide'); + }, 2000); + }, + + alert: function (message) { + + $.mobile.loading('show', { + theme: "e", + text: message, + textonly: true, + textVisible: true + }); + + setTimeout(function () { + $.mobile.loading('hide'); + }, 2000); + }, + + updateSystemInfo: function (info) { + + var isFirstLoad = !Dashboard.lastSystemInfo; + + Dashboard.lastSystemInfo = info; + Dashboard.ensureWebSocket(info); + + if (!Dashboard.initialServerVersion) { + Dashboard.initialServerVersion = info.Version; + } + + if (info.HasPendingRestart) { + + Dashboard.hideDashboardVersionWarning(); + Dashboard.showServerRestartWarning(); + + } else { + + Dashboard.hideServerRestartWarning(); + + if (Dashboard.initialServerVersion != info.Version) { + + Dashboard.showDashboardVersionWarning(); + } + } + + if (isFirstLoad) { + Dashboard.showFailedAssemblies(info.FailedPluginAssemblies); + } + + Dashboard.showInProgressInstallations(info.InProgressInstallations); + }, + + showFailedAssemblies: function (failedAssemblies) { + + for (var i = 0, length = failedAssemblies.length; i < length; i++) { + + var assembly = failedAssemblies[i]; + + var html = ''; + + var index = assembly.lastIndexOf('\\'); + + if (index != -1) { + assembly = assembly.substring(index + 1); + } + + html += ''; + html += assembly + " failed to load."; + html += ''; + + Dashboard.showFooterNotification({ html: html }); + + } + }, + + showInProgressInstallations: function (installations) { + + installations = installations || []; + + for (var i = 0, length = installations.length; i < length; i++) { + + var installation = installations[i]; + + var percent = installation.PercentComplete || 0; + + if (percent < 100) { + Dashboard.showPackageInstallNotification(installation, "progress"); + } + } + + if (installations.length) { + + Dashboard.ensureInstallRefreshInterval(); + } else { + Dashboard.stopInstallRefreshInterval(); + } + }, + + ensureInstallRefreshInterval: function () { + + if (!Dashboard.installRefreshInterval) { + + if (Dashboard.isWebSocketOpen()) { + Dashboard.sendWebSocketMessage("SystemInfoStart", "0,350"); + } + Dashboard.installRefreshInterval = 1; + } + }, + + stopInstallRefreshInterval: function () { + + if (Dashboard.installRefreshInterval) { + if (Dashboard.isWebSocketOpen()) { + Dashboard.sendWebSocketMessage("SystemInfoStop"); + } + Dashboard.installRefreshInterval = null; + } + }, + + cancelInstallation: function (id) { + + ApiClient.cancelPackageInstallation(id).always(Dashboard.refreshSystemInfoFromServer); + + }, + + showServerRestartWarning: function () { + + var html = 'Please restart Media Browser Server to finish updating.'; + html += ''; + + Dashboard.showFooterNotification({ id: "serverRestartWarning", html: html, forceShow: true, allowHide: false }); + }, + + hideServerRestartWarning: function () { + + $('#serverRestartWarning').remove(); + }, + + showDashboardVersionWarning: function () { + + var html = 'Please refresh this page to receive new updates from the server.'; + html += ''; + + Dashboard.showFooterNotification({ id: "dashboardVersionWarning", html: html, forceShow: true, allowHide: false }); + }, + + reloadPage: function () { + + window.location.href = window.location.href; + }, + + hideDashboardVersionWarning: function () { + + $('#dashboardVersionWarning').remove(); + }, + + showFooterNotification: function (options) { + + var removeOnHide = !options.id; + + options.id = options.id || "notification" + new Date().getTime() + parseInt(Math.random()); + + var parentElem = $('#footerNotifications'); + + var elem = $('#' + options.id, parentElem); + + if (!elem.length) { + elem = $('

    ').appendTo(parentElem); + } + + var onclick = removeOnHide ? "$(\"#" + options.id + "\").remove();" : "$(\"#" + options.id + "\").hide();"; + + if (options.allowHide !== false) { + options.html += ""; + } + + if (options.forceShow) { + elem.show(); + } + + elem.html(options.html).trigger('create'); + + if (options.timeout) { + + setTimeout(function () { + + if (removeOnHide) { + elem.remove(); + } else { + elem.hide(); + } + + }, options.timeout); + } + }, + + getConfigurationPageUrl: function (name) { + return "ConfigurationPage?name=" + encodeURIComponent(name); + }, + + navigate: function (url, preserveQueryString) { + + var queryString = window.location.search; + if (preserveQueryString && queryString) { + url += queryString; + } + $.mobile.changePage(url); + }, + + showLoadingMsg: function () { + $.mobile.showPageLoadingMsg(); + }, + + hideLoadingMsg: function () { + $.mobile.hidePageLoadingMsg(); + }, + + processPluginConfigurationUpdateResult: function () { + + Dashboard.hideLoadingMsg(); + + Dashboard.alert("Settings saved."); + }, + + defaultErrorMessage: "There was an error processing the request.", + + processServerConfigurationUpdateResult: function (result) { + + Dashboard.hideLoadingMsg(); + + Dashboard.alert("Settings saved."); + }, + + confirm: function (message, title, callback) { + + $('#confirmFlyout').popup("close").remove(); + + var html = '
    '; + + html += '
    '; + html += '

    ' + title + '

    '; + html += '
    '; + + html += '
    '; + + html += '
    '; + html += message; + html += '
    '; + + html += '

    '; + html += '

    '; + html += '
    '; + + html += '
    '; + + $(document.body).append(html); + + $('#confirmFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () { + + if (callback) { + callback(this.confirm == true); + } + + $(this).off("popupafterclose").remove(); + }); + }, + + refreshSystemInfoFromServer: function () { + ApiClient.getSystemInfo().done(function (info) { + + Dashboard.updateSystemInfo(info); + }); + }, + + restartServer: function () { + + Dashboard.suppressAjaxErrors = true; + Dashboard.showLoadingMsg(); + + ApiClient.performPendingRestart().done(function () { + + setTimeout(function () { + Dashboard.reloadPageWhenServerAvailable(); + }, 500); + + }).fail(function () { + Dashboard.suppressAjaxErrors = false; + }); + }, + + reloadPageWhenServerAvailable: function (retryCount) { + + ApiClient.getSystemInfo().done(function () { + Dashboard.reloadPage(); + + }).fail(function () { + setTimeout(function () { + + retryCount = retryCount || 0; + retryCount++; + + if (retryCount < 10) { + Dashboard.reloadPageWhenServerAvailable(retryCount); + } else { + Dashboard.suppressAjaxErrors = false; + } + }, 500); + }); + }, + + getPosterViewHtml: function (options) { + + var html = ""; + + for (var i = 0, length = options.items.length; i < length; i++) { + var item = options.items[i]; + + var hasPrimaryImage = item.ImageTags && item.ImageTags.Primary; + + var href = item.IsFolder ? "#" : "itemDetails.html?id=" + item.Id; + + html += "
    "; + + if (options.preferBackdrop && item.BackdropImageTags && item.BackdropImageTags.length) { + html += ""; + } else if (hasPrimaryImage) { + html += ""; + } + else if (item.BackdropImageTags && item.BackdropImageTags.length) { + html += ""; + } else { + html += ""; + } + + if (options.showTitle || !hasPrimaryImage || (item.Type !== 'Movie' && item.Type !== 'Series' && item.Type !== 'Season')) { + html += "
    "; + html += "
    " + item.Name + "
    "; + html += "
    " + } + + html += "
    "; + } + + return html; + }, + + showUserFlyout: function () { + + Dashboard.getCurrentUser().done(function (user) { + + var html = '
    '; + + html += 'Close'; + + html += '
    '; + html += '

    ' + user.Name + '

    '; + html += '
    '; + + html += '
    '; + + html += '

    '; + + var imageUrl = user.PrimaryImageTag ? ApiClient.getUserImageUrl(user.Id, { + + height: 400, + tag: user.PrimaryImageTag, + type: "Primary" + + }) : "css/images/userFlyoutDefault.png"; + + html += ''; + html += '

    '; + + html += '

    '; + html += '

    '; + html += '
    '; + + html += '
    '; + + $(document.body).append(html); + + $('#userFlyout').popup().trigger('create').popup("open").on("popupafterclose", function () { + + $(this).off("popupafterclose").remove(); + }); + }); + }, + + selectDirectory: function (options) { + + options = options || {}; + + options.header = options.header || "Select Media Path"; + + var html = ''; + + $($.mobile.activePage).append(html); + + var popup = $('#popupDirectoryPicker').popup().trigger('create').popup("open").on("popupafterclose", function () { + + $('form', this).off("submit"); + $(this).off("click").off("popupafterclose").remove(); + + }).on("click", ".lnkDirectory", function () { + + var path = this.getAttribute('data-path'); + + Dashboard.refreshDirectoryBrowser(path); + }); + + var txtCurrentPath = $('#txtDirectoryPickerPath', popup); + + if (options.path) { + txtCurrentPath.val(options.path); + } + + $('form', popup).on('submit', function () { + + if (options.callback) { + options.callback($('#txtDirectoryPickerPath', this).val()); + } + + return false; + }); + + Dashboard.refreshDirectoryBrowser(txtCurrentPath.val()); + }, + + refreshDirectoryBrowser: function (path) { + var page = $.mobile.activePage; + + Dashboard.showLoadingMsg(); + + var promise; + + if (path === "Network") { + promise = ApiClient.getNetworkComputers(); + } + else if (path) { + promise = ApiClient.getDirectoryContents(path, { includeDirectories: true }); + } else { + promise = ApiClient.getDrives(); + } + + promise.done(function (folders) { + + $('#txtDirectoryPickerPath', page).val(path || ""); + + var html = ''; + + if (path) { + + var parentPath = path; + + if (parentPath.endsWith('\\')) { + parentPath = parentPath.substring(0, parentPath.length - 1); + } + + var lastIndex = parentPath.lastIndexOf('\\'); + parentPath = lastIndex == -1 ? "" : parentPath.substring(0, lastIndex); + + if (parentPath.endsWith(':')) { + parentPath += "\\"; + } + + if (parentPath == '\\') { + parentPath = "Network"; + } + + html += '
  • ..
  • '; + } + + for (var i = 0, length = folders.length; i < length; i++) { + + var folder = folders[i]; + + html += '
  • ' + folder.Name + '
  • '; + } + + if (!path) { + html += '
  • Network
  • '; + } + + $('#ulDirectoryPickerList', page).html(html).listview('refresh'); + + Dashboard.hideLoadingMsg(); + + }).fail(function () { + + $('#txtDirectoryPickerPath', page).val(""); + $('#ulDirectoryPickerList', page).html('').listview('refresh'); + + Dashboard.hideLoadingMsg(); + }); + }, + + getPluginSecurityInfo: function () { + + if (!Dashboard.getPluginSecurityInfoPromise) { + Dashboard.getPluginSecurityInfoPromise = ApiClient.getPluginSecurityInfo(); + } + + return Dashboard.getPluginSecurityInfoPromise; + }, + + resetPluginSecurityInfo: function () { + Dashboard.getPluginSecurityInfoPromise = null; + }, + + ensureHeader: function (page) { + + if (!$('.header', page).length) { + + var isLoggedIn = Dashboard.getCurrentUserId(); + + if (isLoggedIn) { + + var promise1 = Dashboard.getCurrentUser(); + var promise2 = Dashboard.getPluginSecurityInfo(); + + $.when(promise1, promise2).done(function (response1, response2) { + + Dashboard.renderHeader(page, response1[0], response2[0]); + }); + + } else { + + Dashboard.renderHeader(page); + } + } + }, + + renderHeader: function (page, user, pluginSecurityInfo) { + + var headerHtml = ''; + headerHtml += '
    '; + + var isLibraryPage = page.hasClass('libraryPage'); + + headerHtml += ''; + + var imageColor = isLibraryPage ? "White" : "Black"; + + if (user && !page.hasClass('wizardPage')) { + headerHtml += '
    '; + headerHtml += '' + user.Name + ''; + + if (user.PrimaryImageTag) { + + var url = ApiClient.getUserImageUrl(user.Id, { + width: 225, + tag: user.PrimaryImageTag, + type: "Primary" + }); + + headerHtml += ''; + } else { + headerHtml += ''; + } + headerHtml += ''; + + if (pluginSecurityInfo.IsMBSupporter) { + headerHtml += ''; + } + if (user.Configuration.IsAdministrator) { + headerHtml += ''; + } + + headerHtml += '
    '; + } + + headerHtml += '
    '; + page.prepend(headerHtml); + }, + + ensureToolsMenu: function (page) { + + if (!page.hasClass('type-interior')) { + return; + } + + var sidebar = $('.toolsSidebar', page); + + if (!sidebar.length) { + + var html = '
    '; + + html += '

    Tools

    '; + + html += ''; + + // content-secondary + html += '
    '; + + $(page).append(html); + } + }, + + getToolsMenuLinks: function (page) { + + var pageElem = page[0]; + + return [{ + name: "Dashboard", + href: "dashboard.html", + selected: pageElem.id == "dashboardPage" + }, { + name: "Media Library", + href: "library.html", + selected: pageElem.id == "mediaLibraryPage" + }, { + name: "Metadata", + href: "metadata.html", + selected: pageElem.id == "metadataConfigurationPage" || pageElem.id == "advancedMetadataConfigurationPage" || pageElem.id == "metadataImagesConfigurationPage" + }, { + name: "Plugins", + href: "plugins.html", + selected: page.hasClass("pluginConfigurationPage") + }, { + name: "User Profiles", + href: "userProfiles.html", + selected: page.hasClass("userProfilesConfigurationPage") + }, { + name: "Display Settings", + href: "uiSettings.html", + selected: pageElem.id == "displaySettingsPage" + }, { + name: "Advanced", + href: "advanced.html", + selected: pageElem.id == "advancedConfigurationPage" + }, { + name: "Scheduled Tasks", + href: "scheduledTasks.html", + selected: pageElem.id == "scheduledTasksPage" || pageElem.id == "scheduledTaskPage" + }, { + name: "Help", + href: "support.html", + selected: pageElem.id == "supportPage" || pageElem.id == "logPage" || pageElem.id == "supporterPage" || pageElem.id == "supporterKeyPage" + }]; + + }, + + ensureWebSocket: function (systemInfo) { + + if (!("WebSocket" in window)) { + // Not supported by the browser + return; + } + + if (Dashboard.webSocket) { + if (Dashboard.webSocket.readyState === WebSocket.OPEN || Dashboard.webSocket.readyState === WebSocket.CONNECTING) { + return; + } + } + + systemInfo = systemInfo || Dashboard.lastSystemInfo; + + var url = "ws://" + ApiClient.serverHostName + ":" + systemInfo.WebSocketPortNumber + "/mediabrowser"; + + var ws = new WebSocket(url); + + ws.onmessage = Dashboard.onWebSocketMessage; + + ws.onopen = function () { + setTimeout(function () { + $(document).trigger("websocketopen"); + }, 500); + }; + ws.onerror = function () { + setTimeout(function () { + $(document).trigger("websocketerror"); + }, 0); + }; + ws.onclose = function () { + setTimeout(function () { + $(document).trigger("websocketclose"); + }, 0); + }; + + Dashboard.webSocket = ws; + }, + + resetWebSocketPingInterval: function () { + + if (Dashboard.pingWebSocketInterval) { + clearInterval(Dashboard.pingWebSocketInterval); + Dashboard.pingWebSocketInterval = null; + } + Dashboard.pingWebSocketInterval = setInterval(Dashboard.pingWebSocket, 30000); + }, + + pingWebSocket: function () { + + // Send a ping to the server every so often to try and keep the connection alive + if (Dashboard.isWebSocketOpen()) { + Dashboard.sendWebSocketMessage("ping"); + } + + }, + + onWebSocketMessage: function (msg) { + + msg = JSON.parse(msg.data); + + if (msg.MessageType === "LibraryChanged") { + Dashboard.processLibraryUpdateNotification(msg.Data); + } + else if (msg.MessageType === "UserDeleted") { + Dashboard.validateCurrentUser(); + } + else if (msg.MessageType === "SystemInfo") { + Dashboard.updateSystemInfo(msg.Data); + } + else if (msg.MessageType === "HasPendingRestartChanged") { + Dashboard.updateSystemInfo(msg.Data); + } + else if (msg.MessageType === "UserUpdated") { + Dashboard.validateCurrentUser(); + + var user = msg.Data; + + if (user.Id == Dashboard.getCurrentUserId()) { + + $('.currentUsername').html(user.Name); + } + } + else if (msg.MessageType === "PackageInstallationCompleted") { + Dashboard.showPackageInstallNotification(msg.Data, "completed"); + Dashboard.refreshSystemInfoFromServer(); + } + else if (msg.MessageType === "PackageInstallationFailed") { + Dashboard.showPackageInstallNotification(msg.Data, "failed"); + Dashboard.refreshSystemInfoFromServer(); + } + else if (msg.MessageType === "PackageInstallationCancelled") { + Dashboard.showPackageInstallNotification(msg.Data, "cancelled"); + Dashboard.refreshSystemInfoFromServer(); + } + else if (msg.MessageType === "PackageInstalling") { + Dashboard.showPackageInstallNotification(msg.Data, "progress"); + Dashboard.refreshSystemInfoFromServer(); + } + else if (msg.MessageType === "ScheduledTaskEndExecute") { + + Dashboard.showTaskCompletionNotification(msg.Data); + } + + $(document).trigger("websocketmessage", [msg]); + }, + + sendWebSocketMessage: function (name, data) { + + var msg = { MessageType: name }; + + if (data) { + msg.Data = data; + } + + msg = JSON.stringify(msg); + + Dashboard.webSocket.send(msg); + }, + + isWebSocketOpen: function () { + return Dashboard.webSocket && Dashboard.webSocket.readyState === WebSocket.OPEN; + }, + + showTaskCompletionNotification: function (result) { + + var html = ''; + + if (result.Status == "Completed") { + html += ''; + return; + } + else if (result.Status == "Cancelled") { + html += ''; + return; + } + else { + html += ''; + } + + html += ''; + html += result.Name + " " + result.Status; + html += ''; + + var timeout = 0; + + if (result.Status == 'Cancelled') { + timeout = 2000; + } + + Dashboard.showFooterNotification({ html: html, id: result.Id, forceShow: true, timeout: timeout }); + }, + + showPackageInstallNotification: function (installation, status) { + + var html = ''; + + if (status == 'completed') { + html += ''; + } + else if (status == 'cancelled') { + html += ''; + } + else if (status == 'failed') { + html += ''; + } + else if (status == 'progress') { + html += ''; + } + + html += ''; + + if (status == 'completed') { + html += installation.Name + ' ' + installation.Version + ' installation completed'; + } + else if (status == 'cancelled') { + html += installation.Name + ' ' + installation.Version + ' installation was cancelled'; + } + else if (status == 'failed') { + html += installation.Name + ' ' + installation.Version + ' installation failed'; + } + else if (status == 'progress') { + html += 'Installing ' + installation.Name + ' ' + installation.Version; + } + + html += ''; + + if (status == 'progress') { + + var percentComplete = Math.round(installation.PercentComplete || 0); + + html += ''; + html += '' + percentComplete + '%'; + html += ''; + + if (percentComplete < 100) { + var btnId = "btnCancel" + installation.Id; + html += ''; + } + } + + var timeout = 0; + + if (status == 'cancelled') { + timeout = 2000; + } + + var forceShow = status != "progress"; + var allowHide = status != "progress" && status != 'cancelled'; + + Dashboard.showFooterNotification({ html: html, id: installation.Id, timeout: timeout, forceShow: forceShow, allowHide: allowHide }); + }, + + processLibraryUpdateNotification: function (data) { + + var newItems = data.ItemsAdded.filter(function (a) { + return !a.IsFolder; + }); + + if (!Dashboard.newItems) { + Dashboard.newItems = []; + } + + for (var i = 0, length = newItems.length ; i < length; i++) { + + Dashboard.newItems.push(newItems[i]); + } + + if (Dashboard.newItemTimeout) { + clearTimeout(Dashboard.newItemTimeout); + } + + Dashboard.newItemTimeout = setTimeout(Dashboard.onNewItemTimerStopped, 60000); + }, + + onNewItemTimerStopped: function () { + + var newItems = Dashboard.newItems; + + newItems = newItems.sort(function (a, b) { + + if (a.PrimaryImageTag && b.PrimaryImageTag) { + return 0; + } + + if (a.PrimaryImageTag) { + return -1; + } + + return 1; + }); + + Dashboard.newItems = []; + Dashboard.newItemTimeout = null; + + // Show at most 3 notifications + for (var i = 0, length = Math.min(newItems.length, 3) ; i < length; i++) { + + var item = newItems[i]; + + var data = { + title: "New " + item.Type, + body: item.Name, + timeout: 6000 + }; + + if (item.PrimaryImageTag) { + data.icon = ApiClient.getImageUrl(item.Id, { + width: 100, + tag: item.PrimaryImageTag + }); + } + + WebNotifications.show(data); + } + }, + + ensurePageTitle: function (page) { + + if (!page.hasClass('type-interior')) { + return; + } + + var pageElem = page[0]; + + if (pageElem.hasPageTitle) { + return; + } + + var parent = $('.content-primary', page); + + if (!parent.length) { + parent = $('.ui-content', page)[0]; + } + + $(parent).prepend("

    " + (document.title || " ") + "

    "); + + pageElem.hasPageTitle = true; + }, + + setPageTitle: function (title) { + + $('.pageTitle', $.mobile.activePage).html(title); + + if (title) { + document.title = title; + } + }, + + metroColors: ["#6FBD45", "#4BB3DD", "#4164A5", "#E12026", "#800080", "#E1B222", "#008040", "#0094FF", "#FF00C7", "#FF870F", "#7F0037"], + + getRandomMetroColor: function () { + + var index = Math.floor(Math.random() * (Dashboard.metroColors.length - 1)); + + return Dashboard.metroColors[index]; + } + +}; + +$(function () { + + var footerHtml = ''; + + + $(document.body).append(footerHtml); +}); + +Dashboard.jQueryMobileInit(); + +$(document).on('pagebeforeshow', ".page", function () { + + Dashboard.refreshSystemInfoFromServer(); + + var page = $(this); + + Dashboard.ensureHeader(page); + Dashboard.ensurePageTitle(page); + +}).on('pageinit', ".page", function () { + + var page = $(this); + var hasLogin = Dashboard.getCurrentUserId(); + + if (!hasLogin) { + + if (this.id !== "loginPage" && !page.hasClass('wizardPage')) { + + Dashboard.logout(); + } + } + + else { + + Dashboard.getCurrentUser().done(function (user) { + + if (user.Configuration.IsAdministrator) { + Dashboard.ensureToolsMenu(page); + } + }); + } }); \ No newline at end of file