From e2a48d8701f91b8e24fbe9e99e91eb72a87bb749 Mon Sep 17 00:00:00 2001 From: horchi Date: Sun, 5 Mar 2017 16:39:28 +0100 Subject: git init --- http/src/css/epgd.less | 1724 +++++++++++++++++++++++++++++++++++++ http/src/css/theme/default.less | 7 + http/src/js/1_main.js | 714 +++++++++++++++ http/src/js/5_timerDialog.js | 640 ++++++++++++++ http/src/js/channels.js | 46 + http/src/js/epgd | 3 + http/src/js/eventDetail.js | 523 +++++++++++ http/src/js/pages.editChannels.js | 313 +++++++ http/src/js/pages.editUser.js | 96 +++ http/src/js/pages.help.js | 49 ++ http/src/js/pages.login.js | 114 +++ http/src/js/pages.magazine.js | 413 +++++++++ http/src/js/pages.now.js | 135 +++ http/src/js/pages.profile.js | 251 ++++++ http/src/js/pages.records.js | 453 ++++++++++ http/src/js/pages.timer.js | 743 ++++++++++++++++ http/src/js/vdr.js | 57 ++ http/src/lang/de.js | 299 +++++++ http/src/lang/hilfe.html | 303 +++++++ 19 files changed, 6883 insertions(+) create mode 100644 http/src/css/epgd.less create mode 100644 http/src/css/theme/default.less create mode 100644 http/src/js/1_main.js create mode 100644 http/src/js/5_timerDialog.js create mode 100644 http/src/js/channels.js create mode 100644 http/src/js/epgd create mode 100644 http/src/js/eventDetail.js create mode 100644 http/src/js/pages.editChannels.js create mode 100644 http/src/js/pages.editUser.js create mode 100644 http/src/js/pages.help.js create mode 100644 http/src/js/pages.login.js create mode 100644 http/src/js/pages.magazine.js create mode 100644 http/src/js/pages.now.js create mode 100644 http/src/js/pages.profile.js create mode 100644 http/src/js/pages.records.js create mode 100644 http/src/js/pages.timer.js create mode 100644 http/src/js/vdr.js create mode 100644 http/src/lang/de.js create mode 100644 http/src/lang/hilfe.html (limited to 'http/src') diff --git a/http/src/css/epgd.less b/http/src/css/epgd.less new file mode 100644 index 0000000..51a9c90 --- /dev/null +++ b/http/src/css/epgd.less @@ -0,0 +1,1724 @@ +/* Hier sind Variablen aus Jquery-ui. Sie werden folgendermass erstellt: + aus 3rdParty\jquery-ui-x:x.custom\development-bundle\themes\humanity\jquery-ui.css den Link kopieren und hier einfügen. + Dann diesen Link (nur Auswahl) per regulären Ausdruck + suchen "$([^=]+)=([^&]+)" und ersetzen "@$1: $2; " + suchen " ([a-f0-9]{6})" und ersetzen " #$1" +*/ +@ui-fwDefault: normal; +@ui-fsDefault: 1.1em; +@ui-cornerRadius: 6px; +@ui-bgColorHeader: #cb842e; +@ui-bgTextureHeader: glass; +@ui-bgImgOpacityHeader: 25; +@ui-borderColorHeader: #d49768; +@ui-fcHeader: #ffffff; +@ui-iconColorHeader: #ffffff; +@ui-bgColorContent: #f4f0ec; +@ui-bgTextureContent: inset_soft; +@ui-bgImgOpacityContent: 100; +@ui-borderColorContent: #e0cfc2; +@ui-fcContent: #1e1b1d; +@ui-iconColorContent: #c47a23; +@ui-bgColorDefault: #ede4d4; +@ui-bgTextureDefault: glass; +@ui-bgImgOpacityDefault: 70; +@ui-borderColorDefault: #cdc3b7; +@ui-fcDefault: #3f3731; +@ui-iconColorDefault: #f08000; +@ui-bgColorHover: #f5f0e5; +@ui-bgTextureHover: glass; +@ui-bgImgOpacityHover: 100; +@ui-borderColorHover: #f5ad66; +@ui-fcHover: #a46313; +@ui-iconColorHover: #f08000; +@ui-bgColorActive: #f4f0ec; +@ui-bgTextureActive: highlight_hard; +@ui-bgImgOpacityActive: 100; +@ui-borderColorActive: #e0cfc2; +@ui-fcActive: #b85700; +@ui-iconColorActive: #f35f07; +@ui-bgColorHighlight: #f5f5b5; +@ui-bgTextureHighlight: highlight_hard; +@ui-bgImgOpacityHighlight: 75; +@ui-borderColorHighlight: #d9bb73; +@ui-fcHighlight: #060200; +@ui-iconColorHighlight: #cb672b; +@ui-bgColorError: #fee4bd; +@ui-bgTextureError: highlight_hard; +@ui-bgImgOpacityError: 65; +@ui-borderColorError: #f8893f; +@ui-fcError: #592003; +@ui-iconColorError: #ff7519; +@ui-bgColorOverlay: #aaaaaa; +@ui-bgTextureOverlay: flat; +@ui-bgImgOpacityOverlay: 75; +@ui-opacityOverlay: 30; +@ui-bgColorShadow: #aaaaaa; +@ui-bgTextureShadow: flat; +@ui-bgImgOpacityShadow: 75; +@ui-opacityShadow: 30; +@ui-thicknessShadow: 8px; +@ui-offsetTopShadow: -8px; +@ui-offsetLeftShadow: -8px; +@ui-cornerRadiusShadow: 8px; + +h5 { + margin-bottom: 5px; +} + +.ui-autocomplete-multiselect { + display: inline-block; + background: #fff !important; + border: 1px solid @ui-borderColorContent; + border-radius: 6px; + padding: 1px 3px 0 3px; + overflow: hidden; + cursor: text; + font-size: 0.8em; + vertical-align: bottom; +} + +.ui-autocomplete-multiselect .ui-autocomplete-multiselect-item .ui-icon { + float: right; + cursor: pointer; +} + +.ui-autocomplete-multiselect .ui-autocomplete-multiselect-item { + display: inline-block; + border: 1px solid #ccc; + border-radius: 4px; + padding: 1px 3px; + margin-right: 2px; + margin-bottom: 1px; + background-color: @ui-bgColorContent; + font-size: 0.8em; +} + +.ui-autocomplete-multiselect input { + display: inline-block; + border: none; + outline: none; + height: auto; + margin: 2px; + overflow: visible; + margin-bottom: 5px; + text-align: left; + background: #fff !important; +} + +.ui-autocomplete { + max-height: 120px; + overflow-y: auto; + overflow-x: hidden; +} + + +.ui-autocomplete-category { + font-weight: bold; + padding: .2em .4em; + margin: .8em 0 .2em; + line-height: 1.5; +} + +.placeholders { + position: absolute; + max-height: 120px; + overflow: auto; +} +.ui-dialog{position:fixed} + + +.iAsButton { + border: 1px solid @ui-borderColorDefault; + background-color: @ui-bgColorDefault; + color: @ui-iconColorContent; + border-radius: @ui-cornerRadius; + text-align: center; + padding: 3px; + display: inline-block; + text-decoration: none; + cursor: pointer; + margin: 3px; + white-space: nowrap; + + &[disabled] { + opacity: .35; + } +} + +.iAsIcon { + text-align: center; + display: inline-block; + text-decoration: none; + cursor: pointer; + margin: 3px; + white-space: nowrap; + padding: 0; + font-size: 0.9em; + vertical-align: 6px; + margin-top: -6px; + border: 1px solid @ui-borderColorDefault; + background-color: @ui-bgColorDefault; + color: @ui-iconColorContent; + border-radius: 50%; + font-size: 0.8em; +} + +.i-ok { + color: green; +} + +.i-warning { + color: #f2e339; +} +.i-error { + color: #f16241; +} +.i-flash-outline { + color: #f90000; +} +.i-progress { + color: #c47a23; +} + + +/* ========================================================================== + EPGd + ========================================================================== */ +@epgdSprite: url(images/epg_icons_24x24_orange.png); + +html{ + width:100%; +} +body { + margin: 0; + padding: 30px 0 0 0; + font-size: 0.8em; + width:100%; + overflow:auto; +} + +input, select { + padding: 2px; + border: 1px solid @ui-borderColorContent; + border-radius: 6px; + vertical-align: middle; + font-weight:normal; +} + +select { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + // border-right:none; +} + +.full { + width: 98%; +} + +.quickInfo { + max-width: 80%; + max-height: 80%; + overflow-y: auto; +} + +#menu-top { + //min-width: 320px; + width: 100%; + margin:0 auto; + white-space:normal; + //overflow: hidden; + position: fixed; + z-index: 99; + top: 0; + left: 0; + //border: 5px solid white; + //border-width: 0px 0px 5px 0px; + background-color: #fff; + + span.maxi { + display:none; + } + + .iAsButton { + padding: 0 2px; + line-height: 21px; + margin-top: 0; + } + + &.mini{ + span.maxi { + display: block; + position: absolute; + padding:0 10px; + right:0; + top: 2px; + font-size: 1.3em; + } + > ul { + padding-right: 40px; +// overflow-y:visible; + + > li { + display: none; + float: left; + max-width:95%; + } + } + } + &.open { + z-index: 9999; + + > ul { + padding: 10px 0 10px 10px; + + > li { + display: block; + float: left; + min-width: 90%; + min-height: 25px; + > a { + width:100%; + } + } + } + .ui-datepicker {display:none} + } +} + +#ui-menu-top { + overflow: hidden; + min-height:30px; + + .ui-menu { + position:fixed; + overflow: visible !important; + padding-top: 5px; + z-index: 99; + } + + > li { + float: left; + display: block; + width: auto !important; + border: 1px solid transparent; + margin: 1px 5px !important; + padding: 0 0 !important; + line-height: 24px; + outline: none; + + > a { + float: left; + display: block; + clear: both; + overflow: hidden; + text-decoration: none; + } + + span.ui-menu-icon { + display:none; + } + } + .menu-active { + display: block !important; + + > a { + color: @ui-fcActive; + font-weight: bold; + min-height: 25px; + } + } + + ul li { + display: block; + float: none; + + ul { + left: 120px !important; + width: 100%; + + li { + width: auto; + + a { + float: left; + } + } + } + } + +/* + + #ui-menu-top .ui-menu li { + float: left; + display: block; + } +*/ + input, select { + display: none; + float: left; + font-size: 1em; + margin: 0 0 0 5px; + } + input, select { + padding:3px; + } +} + +#menu_login { + float: right; + margin-right: 20px !important; +} + +.menu-active input, .menu-active select { + display: block; + visibility: visible; +} + +.ui-tabs { + position: static; + border: 1px solid @ui-borderColorContent; +} + +#tabCon { + padding: 10px; +} + +table.ui-datepicker-calendar { + width: 40%; + float: left; + margin: 10px 2% 5px 0; + font-size: 1em; +} + +.ui-datepicker { + width: auto; +} + +.ui-timepicker-div { + width: 53%; + min-width: 230px; + float: left; + margin: 3px 0 0 0; + + dl dd { + margin: 0 10px 0 4px; + } + + dt { + float: none !important; + font-weight: bold; + } + + span { + float: left; + line-height: 0.8; + margin-bottom: 10px; + } + u { + margin: 0px 0px 10px 10px; + text-align: right; + //font-size: 0.9em; + min-width: 16px; + cursor: pointer; + display: inline-block; + } + i { + padding-right: 17px; + background: url(images/epg_icons_24x24_orange.png) no-repeat 45px -1831px; + display:inline-block; + } +} + +.channel { + width:80px; + overflow: hidden; + font-weight: bold; + font-size: 10px; + line-height: 1; + color: #4d4949; + padding: 3px 5px 0 3px; + img { + max-width: 70px; + max-height: 50px; + margin-right: 5px; + margin-bottom: 5px; + display:block; + } + .i-tv { + font-size: 1.8em; + line-height: 1.3em; + margin-left: -4px; + cursor: pointer; + } +} + +.popup { + z-index: 8888; +} + +.topInfo { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + height: 36px; + padding: 6px 0.7em; + z-index: 100000; + position: fixed; + top: 0; + right: 30px; + + button { + margin: -4px 0 0 10px; + } +} + +#content { + text-align: center; + width: 96%; + padding: 0; + margin: 0 auto; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + + > * { + text-align: left; + } +} + +.teaserList { + padding: 0px; + margin: 0px auto; + list-style: none; + display: block; + + li { + padding: 1px 3px 3px 3px; + margin: 0.5% 1%; + overflow: hidden; + width: 98%; + min-height: 70px; + -webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */ + -moz-box-sizing: border-box; /* Firefox, other Gecko */ + box-sizing: border-box; /* Opera/IE 8+ */ + + } + .desc { + height: 72px; + overflow: hidden; + &:hover{ + min-height: 72px; + height:auto; + overflow-y:visible; + } + } + + .desc img { + float: right; + margin: 0px 0px 2px 5px; + } + + .time { + float: left; + font-size: 0.9em; + } + .date { + float: right; + font-size: 0.9em; + } + .tipp { + margin:1px 5px 0 0; + } + + .title { + font-weight: bold; + margin-top: 8px; + //font-size: 1.1em; + } + +} + +#pageNow { + li { + padding-left: 90px; + } + + .channel { + float: left; + margin-left: -87px; + cursor: pointer; + img {max-height:70px} + } +} + +#magazine-nav{ + +// overflow:hidden; + width:100%; + left:-27px; + position:relative; + + .left, .right { + width: 50px; + height:54px; + border-top: none; + border-bottom: none; + position: absolute; + z-index: 98; + top:0; + + .ui-widget-content { + width: 50px; + margin: 0 -1px; + text-align: center; + padding-top: 1px; + border-bottom: none; + } + + span { + margin: 0px auto 1px auto; + } + } + .left { + left:0; + //border-right: 5px solid white; + } + .right { + right: 0; + //border-left: 5px solid white; + } + +} + + +#magazine-head { + margin: 0 0 0 -2%; + height: 55px; + padding: 0 0 0 54px; + overflow:hidden; + + .ui-widget-content { + margin: 0 3px; + width: 200px; + height: 55px; + float: left; + + .channel { + height: 55px; + width:auto; + img { + max-width:100px; + float:left; + } + } + } +} + + + +#magazine { + padding: 0 0 0 54px; + margin: 0 0 0 -2%; + overflow-x: hidden; + overflow-y: scroll; + position: relative; + clear: left; + + .timeNow { + position: absolute; + border-top: 2px solid red; + z-index: 99; + left: 0; + color: red; + font-weight: bold; + padding: 0 0 0 8px; + margin: 0; + opacity: 0.5; + } + + > div { + margin: 0; + padding: 0; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + + > div { + float: left; + width: 200px; + min-height: 90%; + margin: 0 3px; + + &.timeLine { + width: 50px; + //font-size: 0.8em; + margin: 0 0 0 -1px; + left: 0; + position: absolute; + z-index: 99; + + p { + position: absolute; + pointer-events:none; + width: 5000px; + height: 180px; + background-color: red !important; + opacity: 0.1; + } + + &.tlr{ + p{display:none} + } + dfn { + height: 120px; + text-align: center; + box-sizing: border-box; + padding-top: 10px; + display: block; + + &:nth-of-type(2n+1) { + background-color: #ddd; + } + } + } + } + + + dt { + //border-top: 2px solid @ui-borderColorContent; + //border-left: 4px solid transparent; + //padding: 4px 4px 4px 1px; + border: 2px solid transparent; + border-top-color: @ui-borderColorContent; + padding: 1px 4px; + width: 200px; + margin: 0; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + overflow: hidden; + + &:hover { + overflow-y: visible; + height: auto !important; + } + + .time { + font-size: 0.9em; + float: left; + + * { + display: block; + float: left; + width: 40px; + } + //b { text-align: center; } + } + + img { + float: right; + } + + .title { + font-size: 0.9em; + font-weight: bold; + clear: both; + } + + .desc { + margin-top: 5px; + border: none; + clear:both; + } + } + } +} + +.desc { + font-size: 0.9em; + border: 1px solid @ui-borderColorContent; + border-width: 1px 0 0 0; + margin-top: 20px; + + span { + font-weight: bold; + color: #ae0a0a; + margin-right: 5px; + } +} + +.progress { + border: 1px solid @ui-borderColorContent; + float: right; + margin-top: 3px; + width: 100px; + height: 10px; + + > div { + background-color: @ui-bgColorHeader; + height: 8px; + margin-top: 1px; + } +} + +#eventDetail { + position: fixed; + display: none; + z-index: 100; + min-width: 320px; + width: 432px; + height: 80%; + min-height: 440px; + padding: 0; + + .ui-accordion-content { + padding: 0; + + a { + margin-right: 5px; + } + } + + .toolbar { + text-align: center; + float: left; + width: 100%; + padding: 2px; + box-sizing: border-box; + + button { + font-size: 1.2em; + } + } + + .title { + display: inline-block; + margin-left: 10px; + overflow: hidden; + text-align: center; + width: 100px; + //height: 18px; + } + + h3 { + cursor: auto; + vertical-align: top; + text-align: center; + font-size: 0.8em; + padding: 3px 140px 0; + overflow: hidden; + height: 18px; + clear:both; + + div { + position: absolute; + top: 3px; + display: inline-block; + //background:@ui-bgColorContent; + padding: 0 5px; + + &.date { + left: 20px; + } + + &.time { + right: 0; + } + } + } + + .imgBox { + //margin: 10px 0 0 10px; + padding: 4px; + display: table-cell; + position: relative; + border: 1px solid #ccc; + border-radius: 4px; + width: 270px; + float: left; + min-height: 120px; + + img { + display: block; + margin: auto; + } + } + + .chPrFl { + width: 105px; + margin: -5px 0 0 10px; + float: left; + font-size: 0.8em; + + > div { + width: 100px; + float: left; + margin-top: 5px; + } + + .channel { + text-align: center; + //height: 75px; + font-size: 12px; + border: 1px solid #ccc; + border-radius: 4px; + img { + margin: 0 auto 5px auto; + } + } + + .audio { + span { + height: 16px; + min-width: 25px; + margin: 0 8px 0 0; + background-image: @epgdSprite; + background-repeat: no-repeat; + display: inline-block; + } + } + } + + .info { + float: left; + margin: 10px 10px 0 0; + min-width: 135px; + font-size: 0.9em; + + b { + margin-left: 5px; + } + } + + .col2 { + float: left; + width: 280px; + margin: 10px 10px 0 0; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + } + + .rate { + background-size: 25px; + min-height:40px; + padding-left: 30px; + > span { + display: block; + font-size: 1.2em; + } + } + .tipp{ + margin:0 5px 0 0; + } + + .stars { + div { + height: 16px; + width: 80px; + margin: 2px 0 5px 0; + background-image: @epgdSprite; + background-repeat: no-repeat; + } + } + + div.stars { + font-size: 0.9em; + float: right; + margin: 10px 10px 0 0; + text-align: center; + clear: both; + } + + td.stars { + div { + float: left; + margin-right: 20px; + } + } + + .colFull { + float: left; + width: 405px; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + margin: 10px 0 0 10px; + + > img { + margin: 10px 0 0 0; + vertical-align: top; + } + } + + .desc { + padding: 5px 10px 5px 0px; + } + + table { + //font-size: 0.8em; + border-collapse: collapse; + //margin: 10px 0 0 10px; + th, td { + text-align: left; + border: 1px solid @ui-borderColorContent; + padding: 2px 3px; + } + } + + .poster { + float: left; + margin: 10px 10px 0 10px; + } + + .actors { + font-size: 0.9em; + //padding-left: 10px; + h5 { + margin: 10px 0 0; + font-size: 1.1em; + } + + div { + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; + padding: 10px 10px 0 65px; + width: 195px; + min-height: 100px; + + a { + display: block; + font-weight: bold; + } + + img { + max-width: 60px; + max-height: 90px; + float: left; + margin-left: -65px; + } + } + } + .rec { + font-size:0.9em; + } +} + +.hasTimer { + color: red; + font-weight: bold; +} + +.stars1 { + background-position: 0 -465px; +} +.stars2 { + background-position: 0 -491px; +} +.stars3 { + background-position: 0 -517px; +} +.stars4 { + background-position: 0 -543px; +} +.stars5 { + background-position: 0 -570px; +} +.a-169 { + background-position: 0 -784px; +} +.a-dd { + background-position: 0 -712px; +} + +.parRate6 { + background: @epgdSprite no-repeat 0 -1558px; + height: 30px; + width: 30px; + color: transparent; + float: right; +} +.parRate12 { + background: @epgdSprite no-repeat 0 -1520px; + height: 30px; + width: 30px; + color: transparent; + float: right; +} +.parRate16 { + background: @epgdSprite no-repeat 0 -1634px; + height: 30px; + width: 30px; + color: transparent; + float: right; +} +.parRate18 { + background: @epgdSprite no-repeat 0 -1596px; + height: 30px; + width: 30px; + color: transparent; + float: right; +} + +.rate { + background: url() no-repeat left top; + background-size: 18px; + min-height:35px; + padding-left: 25px; + margin: 5px 0; + float: left; + clear:left; + display:block; +} + +.rate1{ background-image: url('images/thumb-rate1.svg');} +.rate2{ background-image: url('images/thumb-rate2.svg'); background-size:25px} +.rate3{ background-image: url('images/thumb-rate3.svg');} +.rate4{ background-image: url('images/thumb-rate4.svg');} +.rate5{ background-image: url('images/thumb-rate5.svg');} +.rate0{ background:none; height:auto;padding-left:inherit} + +.tipp{ + display:block; + float: left; + margin:5px 0; + background-color: rgb(245, 126, 126); + color: white; + border-radius: @ui-cornerRadius; + padding: 1px 3px; + font-size: 0.9em; + font-weight: normal; +} + +#searchResult { + overflow-y: auto; + overflow-x: visible; + border-top: 1px solid @ui-bgColorHeader; + box-sizing: border-box; + padding-right:1px; +} + +.timerTable { + min-width: 400px; + width:100%; + + &.sub { + background-color: white; + border: 3px double @ui-borderColorContent; + } + + td { + border: 1px solid @ui-borderColorContent; + padding: 2px 5px; + vertical-align: top; + + .channel { + img { + max-height:30px; + } + } + } + + /* p { + border-top: 1px solid #ccc; + height: 18px; + margin: 0; + overflow-y: hidden; + + &:hover { + overflow-y: visible; + height: auto !important; + } + } + }*/ + + th { + text-align: left; + vertical-align: top; + padding: 2px 5px; + display: table-cell; + } + + span { + float: right; + } + + .i-sort-name-up { + margin-right: 0; + } + + .i-sort-name-down { + margin-left: 0; + } +} + +#timerList { + td { + &:nth-child(6) { + cursor: pointer; + } + } +} +#timerSearchList { + max-width:750px; +} +.searchDialog { + min-width: 320px; + //max-width: 650px; + position: relative; + + #tTitle { + cursor: pointer; + text-align: center; + text-decoration: underline; + } + + >form{ + >div{ + margin-bottom:5px; + margin-top: 5px; + } + &.noAdv{ + >div + div {display: none} + } + } + + label { + //display: block; + margin: 5px 5px 0 0; + font-weight: bold; + color: #666; + cursor: pointer; + } + + input.hasDatepicker[disabled] { + border: none; + background-color: transparent; + width: 20px; + } + + .week { + border: 1px solid @ui-borderColorContent; + margin: 5px 0; + padding: 5px 0; + width: 99%; + + > input[type=checkbox], > span { + width: auto; + margin-left: 2%; + margin-right: 2px; + line-height: 2em; + } + } + + .colBlock { + width:100%; + float: left; + div { + float: left; + margin-right: 10px; + + label { + display: block; + } + } + } + form.typeS { + .noTypeS, .onlyTypeR {display:none} + } + form.typeV { + .onlyTypeR, .onlyTypeS {display:none} + } + form.typeR { + .onlyTypeS {display:none} + } +} + +.selMarkBlock { + display: inline-block; + text-align: center; + width: 34px; + float: left; + font-size: 0.8em; + + b { + border: 1px solid #CCCCCC; + border-radius: 6px; + float: left; + margin: 5px 3px 0 0; + padding-left: 5px; + height: 13px; + width: 20px; + + b { + border: medium none; + border-radius: 6px 0 0 6px; + margin: 0 0 0 -5px; + width: 7px; + height: 13px; + } + } +} + +#records { + margin-left: -20px; +/* 23.11.16 brauchen wir das noch??? + .ui-menu li { + padding: 2px 5px; + + &:hover { + border: 1px solid @ui-borderColorHover; + } + }*/ + + .folder { + //clear: left; + padding: 0 0 0 20px; + + h4 { + margin: 3px 0; + display: inline-block; + span { + font-weight: normal; + padding-right: 3px; + } + } + + div, m { + display: none; + } + + &.open,&.tmp-open { + > h4 { + > span:before { + content: '\e80a'; // folder open + } + + > m { + display: inline; + } + + > m:before { + content: '\e80b'; // menu + } + // menu + } + + > div { + display: block; + } + } + + } + +} +.rec { + border: 1px solid @ui-borderColorDefault; + border-radius: 6px; + margin: 2px 20px; + //clear: left; + //width: 80%; + padding: 0 140px 0 70px; + background-color: @ui-bgColorContent; + position: relative; + + u { + display: block; + position: absolute; + margin-left: -60px; + padding: 2px 0; + } + + b { + display: block; + background-color: white; + padding: 2px 5px; + + i { + display: block; + font-weight: normal; + } + } + + em { + display: block; + position: absolute; + right: 10px; + top: 0; + padding: 2px 0; + } +} + #recBar{ + font-size:0.9em; + display:inline-block; + } + + body.dd-open{ + #ui-menu-top, #recBar{ + display:none !important; + } + #records{ + .folder { + display:block; + } + div.rec{ + display:none; + } + } + + } + +.pageEditChannels > li { + border: 1px solid #CCCCCC; + border-radius: 6px; + clear: left; + float: left; + margin-top: 5px; + padding-left: 5px; + width: 96%; + + &.filterHide { + height:0; + overflow:hidden; + margin:0; + border:none; + } + +} + + +#pageEditChannelsHead { + border-bottom: 3px double #CCCCCC; + font-size: 0.9em; + margin: 10px 0 0 10px; + width: 600px; + float: none; + + em { + padding: 3px; + line-height: 0; + } +} + +.pageEditChannels { + font-size: 0.9em; + margin: 0; + width: 600px; + overflow-y: auto; + float: left; + + em { + cursor: pointer; + float: left; + margin: 3px 10px 0 0; + font-size: 1.2em; + } + + span { + display: inline-block; + float: left; + padding: 5px 10px 5px 0; + width: 180px; + } + + > li > input { + float: left; + margin-top: 3px; + width: 180px; + } + + ol { + background: none repeat scroll 0 0 #EEEEEE; + border-radius: 6px; + display: inline-block; + float: left; + margin: 3px 10px; + padding: 2px 5px 2px 20px; + min-height: 15px; + font-size: 0.7em; + + input { + margin-top: 3px; + width: 40px; + } + } +} + +#pageEditChannels { + border-bottom: 1px solid #CCCCCC; +} + +#pageEditChannelsSource { + width: 350px; + margin-top: 5px; + + i { + padding: 5px 10px 5px 0; + float: left; + } +} + +.selected { + background-color: #F39814; +} + +#page_profile { + td { + padding: 5px; + vertical-align: top; + } +} + +#page_editUser { + >div { + float:left; + height:350px; + padding-right:20px; + margin-right:20px; + border-right:2px solid #ccc; + } + h2 { + margin: 5px 0 2px 0; + font-size:1em + } + form {float:left} + select{ + overflow:auto; height:200px + } +} + +/* ========================================================================== + Media Queries + ========================================================================== */ +@media only screen and (max-width: 420px) { + body { + font-size: 1em; + } + + ui-icon { + margin: 6px; + } + + .ui-timepicker-div { + + u { + min-width: 21px; + } + i { + background-position: 53px -1828px; + } + } + + .teaserList .desc img, #eventDetail .ui-widget-shadow { + display: none; + } + + .teaserList { + .time,.date {font-size: 0.8em;} + .tipp {font-size: 0.7em;margin-top:2px} + .progress {width:40px} + } + + #eventDetail { + width: 100%; + height: 60%; + position: fixed; + + .colFull { + width: 100%; + margin: 0; + } + + .imgBox:empty { + display: none; + } + + .col2 { + width: 165px; + } + + .info:nth-child(2n+1) { + clear: both; + } + + .stars { + clear: none !important; + float: left; + margin-left: 10px; + } + + + .desc { + width: 300px; + } + } + + .searchDialog { + width: 320px; + } + + #magazine-nav { + top:-10px; + .left{margin-left:-1px;} + .right{margin-right:-1px;} + } + + #magazine-head { + .ui-widget-content { + height: 65px; + } + .prev {height:auto} + } + #magazine .tlr {display:none} + + #records { + margin-left:-5px; + + + .folder { + padding: 0 0 0 5px; + } + } + .rec { + margin: 2px; + padding: 0; + border-bottom-left-radius: 0; + border-bottom-right-radius: 0; + + u { + position: inherit; + margin-left: 2px; + } + } +} + +@media only screen and (min-width: 768px) and (max-width:1139px) { + #pageNow li { + float: left; + width: 48%; + } + + #pageNow li:nth-child(2n+1) { + clear: left; + } + + #eventDetail { + width: 700px; + + h3 { + font-size: 1em; + padding: 3px 170px 0; + height: 20px; + } + + .desc { + border-width: 0 0 0 1px; + height: 100%; + margin-top: 0; + //margin-left: 10px; + padding: 5px 10px; + } + + .desc, .actors { + width: 270px; + } + + .poster, table.colFull, table.colFull img { + width: 320px; + } + } +} + +@media only screen and (min-width: 900px) { + #eventDetail { + width: 850px; + + h3 { + font-size: 1em; + padding: 3px 170px 0; + height: 20px; + } + + .desc { + border-width: 0 0 0 1px; + height: 100%; + margin-top: 0; + //margin-left: 10px; + padding: 5px 10px; + } + + .desc, .actors { + width: 405px; + } + + .poster { + float: right; + } + } +} + +@media only screen and (min-width: 1140px) { + .content { + width: 1026px; /* 1140px - 10% for margins */ + margin: 0 auto; + } + + #pageNow li { + float: left; + width: 31%; + } + + #pageNow li:nth-child(3n+1) { + clear: left; + } +} + + +/* + +@media (min-width: 1696px) { + #pageNow li:nth-child(4n+1) { + clear: left; + } +} +@media (max-width: 1695px) { + #pageNow li:nth-child(3n+1) { + clear: left; + } +} + +@media (max-width: 1275px) { + #pageNow li { + width:46%; + } + #pageNow li:nth-child(2n+1) { + c_lear: left; + } +} +@media (max-width: 865px) { + #pageNow li { + width:96%; + } +} +@media (max-width: 420px) { + #pageNow img, #eventDetail .ui-widget-shadow{ + display:none; + } + #pageNow li { + width:310px; + margin-left:0px; + margin-right:0px; + } + #pageNow .desc { + width:220px; + } + #eventDetail { + width:320px; + height:100%; + position:fixed; + } +} +*/ diff --git a/http/src/css/theme/default.less b/http/src/css/theme/default.less new file mode 100644 index 0000000..d55a291 --- /dev/null +++ b/http/src/css/theme/default.less @@ -0,0 +1,7 @@ +@import (inline) "../../../3rdParty/boilerplate5/css/normalize.min.css"; +@import (inline) "../../../3rdParty/boilerplate5/css/main_pre.min.css"; +@import (inline) "../../../3rdParty/jquery-ui-1.11.4.custom/jquery-ui.min.css"; +@import (inline) "../../../3rdParty/jQuery-Timepicker-Addon-master/dist/jquery-ui-timepicker-addon.min.css"; +@import (inline) "../../../3rdParty/fontello/css/epgd.css"; +@import "../epgd.less"; +@import (inline ) "../../../3rdParty/boilerplate5/css/main_post.min.css"; diff --git a/http/src/js/1_main.js b/http/src/js/1_main.js new file mode 100644 index 0000000..3a8251a --- /dev/null +++ b/http/src/js/1_main.js @@ -0,0 +1,714 @@ + +epgd.profile = { + needLogin: -1, + channelLogoPath: "data/channellogo", + eventImgPath: "data/eventimg", + movieMediaPath: "data/moviemedia", + serieImgPath: "data/seriesmedia", + movieActorPath: "http://www.themoviedb.org/person/", + serieSeasonPath: "http://www.thetvdb.com/?tab=seasonall&id=", + constabelEditPath: "https://www.eplists.de/eplist.cgi?action=edit&back=&file=", + constabelLinkPath: "https://www.eplists.de/eplist.cgi?action=show_form_redir&linkname=", + minEventTime: 0, + maxEventTime: 0, + logoShowName: 0 +}; +epgd.userProfile_defaults = { + defaultVDRuuid: '', + constabelLoginPath: false, + pickerFirstDay: '6', + quickTimes: '', + startWithSched: 0, + startPage: "menu_options", + namingModeSerie: "0", + namingModeSearchSerie: "0", + namingModeMovie: "0", + namingModeSearchMovie: "0", + namingModeSerieTemplate: "", + namingModeSearchSerieTemplate: "", + namingModeMovieTemplate: "", + namingModeSearchMovieTemplate: "", + chFormat: "", + timerDefaultVDRuuid: '', + searchAdv: "0", + mailReceiver: "", + messageMailTypes: "", + magazinePan: 10, + magazinePanDelay: 400, + maxListEntries: 100, + ratings: "", + recordSubFolderSort: 1 +}; +epgd.profile_load = function (doNotCache) { + var profile = $.extend(epgd.profile, epgd.userProfile_defaults); + epgd.ajax({ url: epgd.login.url + "data/parameters", async: false, cache: false, dataType: "json" },function (data) { + var p,i,k, + oldVal, now, + changes = {}; + for (i in data.parameters) { + p = data.parameters[i]; + oldVal = profile[p.name]; + if (oldVal != undefined && oldVal != p.value) { + profile[p.name] = p.type === 0 ? parseInt(p.value, 10) : p.value; + changes[p.name] = oldVal; + if (p.name.indexOf('logo') == 0) + epgd.channels.isDirty = true; + } + } + if (epgd.utils.timeOffset == null) { + epgd.utils.timeOffset = (data.timezone - new Date().getTimezoneOffset() * 60) * 1000; + now = epgd.utils.now(); + epgd.$dtPicker.datetimepicker('setDate', new Date(now.setMinutes(parseInt(now.getMinutes() / 15, 10) * 15))); + } + if (!profile.minEventTime) { + now = epgd.utils.now(); + profile.minEventTime = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0).getTime() / 1000; + changes["minEventTime"] = 0; + } + if (!profile.maxEventTime) { + profile.maxEventTime = profile.minEventTime + 8 * 24 * 60 * 60 - 60; + changes["maxEventTime"] = 0; + } + for (k in changes) { + $(window).trigger("profile_updated", changes); + break; + } + epgd.channels.isDirty && epgd.channels.load(); + }); +} + +epgd.pages = {}; + +epgd.login = { + user: '', + session: '', + rights:-1, + url: '' +} +epgd.rights = { // userMask + umConfig: 2, + umConfigEdit: 4 + 2, + umConfigUsers: 8, + umTimer: 64, + umTimerEdit: 128 + 64, + umSearchTimer: 256 + 64, + umSearchTimerEdit: 512 + 256 + 128 + 64, + umFsk: 4096, + umRecordings: 32768, + umRecordingsEdit: 65536 + 32768 +} +epgd.utils = { + timeOffset: null, + now: function () {return new Date(new Date().getTime() - this.timeOffset);}, + date: function (unixTime) { return new Date(unixTime * 1000 - this.timeOffset); }, + unixTime: function (date) { return date ? parseInt((date.getTime() + this.timeOffset) / 1000, 10) : 0; }, + formatTime: function (unixTime) { + var d = new Date(unixTime * 1000 - this.timeOffset); + return new String(100 + d.getHours()).slice(1) + ':' + new String(100 + d.getMinutes()).slice(1); + }, + formatDateTime: function (unixTime, dateFormat) { + var d = new Date(unixTime * 1000 - this.timeOffset); + return $.datepicker.formatDate((dateFormat || epgd.tr.dateTimePicker.dateFormat), d) + ' ' + new String(100 + d.getHours()).slice(1) + ':' + new String(100 + d.getMinutes()).slice(1); + }, + formatDate: function (unixTime, dateFormat) { + var d = new Date(unixTime * 1000 - this.timeOffset); + return $.datepicker.formatDate((dateFormat || epgd.tr.dateTimePicker.dateFormat), d); + }, + popup: function (txt, options) { + var $w = $(window), + $dlg; + options = $.extend({ + autoOpen: true, + dialogClass: 'popup', + show: { + effect: "blind", + duration: 1000 + }, + hide: { + effect: "explode", + duration: 1000 + }, + width: 400, + height:200, + maxWidth: $w.width() * 0.8, + maxHeight: $w.height() * 0.7, + }, options); + $dlg = $('

' + txt + '

').dialog(options); + options.autoClose && window.setTimeout(function () { $dlg.dialog('close').dialog('destroy'); }, options.autoClose); + return $dlg; + }, + confirm: function (message, callback) { + var o = { + modal: true, + buttons: {} + }; + o.buttons[epgd.tr.yes]= function () { $(this).dialog('close'); callback(true);}; + o.buttons[epgd.tr.no]= function () { $(this).dialog('close'); callback(false);}; + this.popup(message, o); + }, + topInfo: function (txt, options) { + var isError = options && options.isError, + $info, + dura; + options = $.extend({ + autoClose: isError ? 0 : 3000, + className: "ui-state-" + (isError ? 'error' : 'highlight') + },options); + dura = (options.autoClose || 3000) / 2; + $info = $('
' + txt + + '
') + .appendTo(epgd.$menu) + .animate({ 'opacity': 0.4 }, dura, function () { $info.animate({ 'opacity': 1 }, dura); }); + options.autoClose && window.setTimeout(function () { $info.remove() }, options.autoClose); + }, + sendMail: function (subject, body, mimetype, receiver) { + epgd.ajax({ + url: epgd.login.url + 'data/sendmail', + type: 'post', + data: JSON.stringify({ "receiver": (receiver || epgd.profile.mailReceiver), "subject": subject, "body": body, "mimetype": mimetype }) + }, function (data) { + data = data.result; + if (data && data.state == 200) + epgd.utils.topInfo(epgd.tr.dataSend); + else + epgd.utils.topInfo(data.message, { isError: 1 }); + epgd.profile_load(); + }); + }, + loader: { + $win: $('
'), + cnt: 0, + process: function (actionFunc, doNotRemove) { + var loader = this; + this.cnt++; + this.$win.appendTo(document.body).stop().animate({ opacity: 0.7}, { + always: function () { + try{ + actionFunc(); + } catch (e) { + epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''),0); + loader.close(); + } + !doNotRemove && loader.close(); + } + }, 200); + }, + close: function () { + if (this.cnt > 0) { + this.cnt--; + this.cnt == 0 && this.$win.remove(); + } + } + }, + addAutoComplete: function (inputSelector, options) { + var $sel = $(inputSelector), + cn = $sel[0].className, + w = $sel[0].style.width || ""; + $(inputSelector).autocomplete($.extend({ + minLength: 0, + multiselect: false, + create: function (event, ui) { // based on http://jsfiddle.net/mekwall/sgxKJ/ + var inst = $(this).autocomplete('instance'), + o = inst.options, + fontSize, kc; + + inst.selectedItems = {}; + if (o.multiselect) { + inst.multiselect = $("
") + .addClass("ui-autocomplete-multiselect ui-state-default ui-widget " + cn) + .css("width", w) + .insertBefore(inst.element) + .append(inst.element) + .bind("click.autocomplete", function () { + inst.element.focus(); + }); + inst.menu.element.css({ "height": "300px", "overflow-y": "auto" }); + fontSize = parseInt(inst.element.css("fontSize") || 10, 10); + function autoSize(e) { + // Hackish autosizing + var $this = $(this); + $this.width(1).width(this.scrollWidth + fontSize - 1); + }; + kc = $.ui.keyCode; + inst.element.bind({ + "keydown.autocomplete": function (e) { + if ((this.value === "") && (e.keyCode == kc.BACKSPACE)) { + var prev = inst.element.prev(); + delete inst.selectedItems[prev.text()]; + prev.remove(); + } + }, + // TODO: Implement outline of container + "focus.autocomplete blur.autocomplete": function () { + inst.multiselect.toggleClass("ui-state-active"); + }, + "keypress.autocomplete change.autocomplete focus.autocomplete blur.autocomplete": autoSize + }).trigger("change"); + o.select = o.select || function (e, ui) { + if (!inst.selectedItems[ui.item.label]) { + $("
") + .addClass("ui-autocomplete-multiselect-item") + .text(ui.item.label) + .append( + $("") + .addClass("ui-icon ui-icon-close") + .click(function () { + var item = $(this).parent(); + delete inst.selectedItems[item.text()]; + item.remove(); + }) + ) + .insertBefore(inst.element); + inst.selectedItems[ui.item.label] = ui.item; + } + inst._value(""); + return false; + } + } else { + o.select = o.select || function (e, ui) { + inst.selectedItems[0] = ui.item; + inst._value(ui.item.label); + return false; + } + }; + } + }, options)).focus(function () { + $(this).autocomplete("search", ""); + });/*.bind("keydown", function (event) { + if (event.keyCode === $.ui.keyCode.TAB && + $(this).autocomplete("instance").menu.active) { + event.preventDefault(); + } + });*/ + }, + getAutoCompleteValues: function (inputSelector, quot) { + quot = quot || ''; + var values = '', + del= ',' + quot, + ac,key; + try { + ac = $(inputSelector).autocomplete("instance").selectedItems; + for (key in ac) + values += del + ac[key].value + quot; + } catch (e) { } + return values.slice(1); + }, + setAutoCompleteValues: function (inputSelector, values ) { + var ac = $(inputSelector).autocomplete("instance"), + item,i, + matcher; + ac.multiselect && ac.multiselect.find(">div").remove(); + ac.selectedItems = {}; + if (values) { + for (i = 0; i < values.length; i++) { + item = null; + matcher = new RegExp($.ui.autocomplete.escapeRegex(values[i]), "i"); + $.each(ac.options.source, function () { + if (matcher.test(this.value || this.label || this)) + return !(item = this); + }); + if (item) + ac._trigger("select", null, { item: item.label ? item : {label:item,value:item} }); + } + } + }, + addPlaceholders: function (inputSelector, key, placeholders) { + var input = $(inputSelector)[0], + html = '').hide().insertAfter(input).click(function (ev) { + var placeholder = ev.target.nodeName == 'B' ? $(ev.target).text() : ev.target.nodeName == 'LI' ? $(ev.target.firstChild).text() : null, + cursorPos = $(input).prop('selectionStart'), + v = $(input).val(); + if (placeholder) { + $(input).val(v.substring(0, cursorPos) + placeholder + v.substring(cursorPos, v.length)).focus(); + cursorPos += placeholder.length; + if (input.setSelectionRange) { + input.setSelectionRange(cursorPos, cursorPos); + } + else if (input.createTextRange) { + v = input.createTextRange(); + v.collapse(true); + v.moveEnd('character', cursorPos); + v.moveStart('character', cursorPos); + v.select(); + } + } + $(this).hide(); + }); + $(input).keydown(function (ev) { + if (ev.key == key) { + $(document).one("click", function () { input.$placeholders.hide(); }) + input.blur(); + return !input.$placeholders.show().position({ + my: "left top", + at: "left bottom", + of: input + }); + } + }); + }, + inherits : function (childClass, parentClass) { + var tempClass = function () { }; + tempClass.prototype = parentClass.prototype; + childClass.prototype = new tempClass(); + childClass.prototype.constructor = childClass; + childClass.base = parentClass.prototype; + return childClass; + }, + log: function (message, level) { + console.log("error:" + message); + try { + $.ajax({ url: "data/log", type: 'get', async: true, cache: false, data: "level=" + (level || 0) + "&message=" + escape(message) }); + } catch (e) {} + } +}; + +epgd.init = function () { + + epgd.$con = $('
').appendTo(document.body); + + $.datepicker.setDefaults(epgd.tr.dateTimePicker); + $.datepicker.setDefaults({ + showOtherMonths: true, + selectOtherMonths: true, + }); + $.timepicker.setDefaults(epgd.tr.dateTimePicker); + $.timepicker.setDefaults({ + timeInput: true, + controlType: { + create: function (tp_inst, obj, unit, val, min, max, step) { + if (unit == 'hour') { + if (!tp_inst.inst.settings.timeOnly) + $('#ui-datepicker-div').width(($(window).width() > 500 ? 430 : 230)+ "px"); + $('0246810
121416182022') + .appendTo(obj).bind("click", { tp_inst: tp_inst, obj: obj, unit:unit }, $.timepicker.quicklink); + } else if (unit == 'minute') { + $('0153045') + .appendTo(obj).bind("click", { tp_inst: tp_inst, obj: obj, unit:unit }, $.timepicker.quicklink); + } else if (unit == 'second' && epgd.profile.quickTimes) { + obj.closest('dl').find('.ui_tpicker_time').removeClass() + .bind("click", { tp_inst: tp_inst, obj:obj, unit: 'time' }, $.timepicker.quicklink).html('').replace(/~/g, '' + epgd.tr.clear + '').appendTo(tp_inst.inst.dpDiv.find('.ui-datepicker-buttonpane')).click(function () { + tp_inst.$input.val(''); + $.datepicker._hideDatepicker(); + }); + return obj; + } else + return obj; + + $('') + .prependTo(obj) + .spinner({ + min: min, + max: max, + step: step, + change: function (e, ui) { // key events + // don't call if api was used and not key press + if (e.originalEvent !== undefined) + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + }, + spin: function (e, ui) { // spin events + tp_inst.control.value(tp_inst, obj, unit, ui.value); + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + } + }); + return obj; + }, + options: function (tp_inst, obj, unit, opts, val) { + if (typeof (opts) == 'string' && val !== undefined) + return obj.find('.ui-timepicker-input').spinner(opts, val); + return obj.find('.ui-timepicker-input').spinner(opts); + }, + value: function (tp_inst, obj, unit, val) { + try { + if (val !== undefined) + return obj.find('.ui-timepicker-input').spinner('value', val); + return obj.find('.ui-timepicker-input').spinner('value'); + } catch (e) { + return false; + } + } + } + }); + + + epgd.$menu = $('').appendTo(document.body).find('ul').hide(); + epgd.$menu.$maxBut = $('').insertBefore(epgd.$menu).click(function () { + epgd.$menu.parent().toggleClass('open'); + }); + epgd.$menu.checkMenuSize = function (ev, callback) { + if (window.wrm_i) { // interval aktiv? + if (window.wrm_w == $(window).width()) { //Breite vom vorherigen Aufruf und aktuelle Breite gleich? + window.clearInterval(window.wrm_i); + delete window.wrm_i; + epgd.$menu.parent().removeClass('mini').width(window.wrm_w).offset({ 'left': $(window).scrollLeft() }); + epgd.$menu.checkMenuSize(null, callback); + } else + window.wrm_w = $(window).width(); + return; + } + if (ev) { + window.wrm_w = $(window).width(); + if (!window.wrm_i) // Interval setzen, um sicher zu sein, dass die Breite jetzt stimmt + window.wrm_i = window.setInterval(epgd.$menu.checkMenuSize, 200,null,callback); + } else { + if (epgd.$menu.height() > 40) + epgd.$menu.parent().addClass('mini'); + window.setTimeout(function () { + document.body.style.paddingTop = (epgd.$menu.parent().height() + 10) + "px"; + callback && window.setTimeout(callback,200); + }, 200); + } + }; + //epgd.$menu.show().checkMenuSize(); + $(window).bind("resize", epgd.$menu.checkMenuSize); + epgd.$dtPicker = $('').appendTo(document.body).hide().bind("click",function () { $(this).datepicker("show"); return false; }); + epgd.$dtPicker.datetimepicker({ + beforeShow: function () { + this.$overlay = $("
").addClass("ui-widget-overlay ui-front").appendTo(document.body); + }, + onClose: function () { + this.$overlay.remove(); + $(window).trigger('datepicker'); + }, + calendarStart: function() { + var d= new Date(epgd.profile.minEventTime * 1000) + leadDays = (d.getDay() - parseInt(epgd.profile.pickerFirstDay, 10) + 7) % 7; + d.setHours(12, 0); + d.setDate(d.getDate() - leadDays); + return d; + } + }); + + epgd.$menu.menu({ + position: { at: "left bottom" }, + select: function (event, ui) { + var id = ui.item.attr('id'); + if (!id || id.indexOf('menu_') != 0 || (event.originalEvent && event.originalEvent.target.nodeName != 'A' && event.originalEvent.target.nodeName != 'LI')) + return false; + $(window).trigger("epgd_close"); + epgd.$menu.parent().removeClass('open'); + $(".menu-active", this).removeClass("menu-active"); + $(document.body).append(epgd.$dtPicker.hide()); + epgd.$menu.checkMenuSize(null,function () { + try { + ui.item.addClass("menu-active").parent().parent('.ui-menu-item').addClass("menu-active"); + epgd.pages[id.slice(5)].render(); + } catch (e) { + epgd.utils.popup(epgd.tr.error.common, { title: epgd.tr.error.error }); + epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''), 2); + } + }); + } + }); + $(window).bind("epgd_close", function () { + $('.epgPopUp').dialog('destroy'); + }).bind("profile_updated", function (e,changes) { + if (changes["minEventTime"] != undefined) + epgd.$dtPicker.datetimepicker("option", {"minDateTime": new Date((epgd.profile.minEventTime= parseInt(epgd.profile.minEventTime,10)) * 1000), "minDate": new Date(epgd.profile.minEventTime * 1000)}); + if (changes["maxEventTime"] != undefined) + epgd.$dtPicker.datetimepicker("option", {"maxDateTime": new Date((epgd.profile.maxEventTime= parseInt(epgd.profile.maxEventTime,10)) * 1000), "maxDate": new Date(epgd.profile.maxEventTime * 1000)}); + if (changes["pickerFirstDay"] != undefined) + epgd.$dtPicker.datetimepicker("option", { "firstDay": epgd.profile.pickerFirstDay }); + if (changes["defaultVDRuuid"] != undefined) { + $('#menu_vdrs > select').val(epgd.profile.defaultVDRuuid); + } + if (changes["quickTimes"] != undefined) { + epgd.pages.magazine.initQT(); + } + if (changes["needLogin"] != undefined) { + epgd.pages.login.doLogin(); + } + }).bind("login_changed", function (e, oldLogin) { + epgd.$menu.html('').hide(); + epgd.$con.html(''); + if (epgd.login.rights) { + epgd.$menu.append(''); + epgd.$menu.append(''); + (epgd.login.rights & epgd.rights.umTimer) == epgd.rights.umTimer && epgd.$menu.append('
  • ' + epgd.tr.menu.timer + '
  • '); + (epgd.login.rights & epgd.rights.umRecordings) == epgd.rights.umRecordings && epgd.$menu.append(''); + epgd.$menu.append(''); + epgd.$menu.append('
  • ' + epgd.tr.menu.options + '
  • '); + epgd.$menu.append(''); + epgd.$menu.append(''); + } + epgd.profile.needLogin == "1" && epgd.$menu.append(''); + if (epgd.login.user != oldLogin.user) { + epgd.profile_load(); + epgd.channels.isDirty = true; + epgd.vdrs.list = null; + } + epgd.channels.load(); + epgd.vdrs.load(); + epgd.$menu.show().menu("refresh"); + epgd.$menu.menu("select", { target: $(epgd.login.rights ? (location.hash || '#' + epgd.profile.startPage || '#menu_profile') : '#menu_login') });//.concat('=' + epgd.profile.startPage + '=').match(/(menu_[^=]+)/)[1] }); + + }).bind("vdrs_load", function () { + html = ''; + for (var uuid in epgd.vdrs.list) { + html += ''; + } + $('').replaceAll('#menu_vdrs > select').show().change(function () { + epgd.vdrs.current = epgd.vdrs.get(this[this.selectedIndex].value); + }).mousedown(function (ev) { + ev.stopPropagation(); + return true; + }).click(function (ev) { + return false; + }); + }).bind("unload", function () { + if (epgd.login.session) + epgd.pages.login.doLogin('logout'); + }); + + epgd.pages.now.init(); + epgd.pages.magazine.init(); + epgd.profile_load(); + if (epgd.profile.needLogin == -1) { + epgd.profile.needLogin = 0; + epgd.pages.login.doLogin(); + } + window.setInterval(epgd.profile_load, 3600000); // ca. jede Stunde neu abfragen + // window.setTimeout(function () { $(window).trigger('resize'); }); +} +window.onerror = function (msg, url, line, col, error) { + // Note that col & error are new to the HTML 5 spec and may not be + // supported in every browser. It worked for me in Chrome. + var extra = !col ? '' : '\ncolumn: ' + col; + extra += !error ? '' : '\nerror: ' + error.stack; + try{ + epgd.utils.log(msg + "\nline: " + line + extra, 2); + } catch(e){} + return true; +}; + +$.widget("custom.catcomplete", $.ui.autocomplete, { + _create: function () { + this._super(); + this.widget().menu("option", "items", "> :not(.ui-autocomplete-category)"); + }, + _renderMenu: function (ul, items) { + var that = this, + currentCategory = ""; + $.each(items, function (index, item) { + var li; + if (item.category != currentCategory) { + ul.append("
  • " + item.category + "
  • "); + currentCategory = item.category; + } + li = that._renderItemData(ul, item); + if (item.category) { + li.attr("aria-label", item.category + " : " + item.label); + } + }); + } +}); +$.datepicker._gotoToday = function (id) { + var inst = this._getInst($(id)[0]), + now = epgd.utils.now(); + this._base_gotoToday(id); + this._setTime(inst, now); + this._setDate(inst, now); + this._hideDatepicker(); +}; +$.timepicker.quicklink = function (ev) { + var target = ev.target.nodeName == 'I' ? ev.target.firstChild : ev.target, + tp_inst, + val = null, + d = false; + try { + tp_inst = ev.data.tp_inst || $.datepicker._getInst(epgd.$dtPicker[0]).settings.timepicker; + } catch (e) { + epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || ''), 2); + return false; + } + if (target.nodeName == 'U') { + if (ev.data.unit == "time") + val = $.datepicker.parseTime(tp_inst._defaults.timeFormat, target.innerHTML, tp_inst._defaults); + else if (ev.data.unit == "hour") + val = { hour: parseInt(target.innerHTML, 10), minute: tp_inst.minute }; + + if (val) { + if (val.hour < tp_inst.hour - 1) + d = true; + else { + tp_inst.control.value(tp_inst, tp_inst.hour_slider, "hour", val.hour); + tp_inst._onTimeChange(); + if (tp_inst.hour != val.hour) + d = true; + } + if (d) { + d = new Date(tp_inst.inst.selectedYear, tp_inst.inst.selectedMonth, tp_inst.inst.selectedDay + 1, val.hour, val.minute); + $.datepicker._setDate(tp_inst.inst, d); + $.datepicker._setTime(tp_inst.inst, d); + $.datepicker._updateDatepicker(tp_inst.inst); + } else + tp_inst.control.value(tp_inst, tp_inst.minute_slider, "minute", val.minute); + } else + tp_inst.control.value(tp_inst, ev.data.obj, ev.data.unit, parseInt(target.innerHTML, 10)); + tp_inst._onTimeChange(); + tp_inst._onSelectHandler(); + if (ev.target.nodeName == 'I') + $.datepicker._hideDatepicker(); + } +} + +epgd.ajax = function (options, success, error) { + var settings = $.extend({ dataType: 'json', contentType: "application/json; charset=utf-8" }, options); + return $.ajax(settings).fail(function (jqxhr, e) { + epgd.utils.loader.close(); + if (jqxhr.status == 401) { + epgd.pages.login.doLogin(null,null,function () { + if (epgd.login.rights) { + settings.url = settings.url.replace(/sid[^\/]+\//, epgd.login.url); + $.ajax(settings).done(success).fail(function () { + epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error }); + }); + } else + epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error }); + }); + } + else if (jqxhr.status == 403) { + epgd.utils.popup(epgd.tr.error.forbidden, { title: epgd.tr.error.error }); + } else if (jqxhr.status == 501){ + epgd.utils.popup(epgd.tr.error.notImplemented, { title: epgd.tr.error.error }); + } else { + if (error && error.call(this, jqxhr, e)) + return; + //if (jqxhr.status == 409) { + var mess = ''; + try { + if (jqxhr.responseJSON) + mess = jqxhr.responseJSON.result.message; + } catch (e) { + mess = ''; + epgd.utils.log((e.message || 'common error') + '\n' + (e.stack || '') + '\n options:' + JSON.stringify(options) + '\n jqhr:' + JSON.stringify(jqxhr), 3); + } + epgd.utils.popup(mess || jqxhr.responseText || epgd.tr.error.serverNotResponse, { title: epgd.tr.error.error }); +// } else + //epgd.utils.popup(epgd.tr.error.serverNotResponse, { title: epgd.tr.error.error }); + } + }).done(success); +}; diff --git a/http/src/js/5_timerDialog.js b/http/src/js/5_timerDialog.js new file mode 100644 index 0000000..704f31e --- /dev/null +++ b/http/src/js/5_timerDialog.js @@ -0,0 +1,640 @@ +// Timer Dialoge - Basis Klasse +epgd.timerDialogBase = function (options) { + this.$win = null; + this.list = null; + if ( options ) + this.options= $.extend({}, this.options, options); +} +epgd.timerDialogBase.prototype = { + options: { + id: "baseDialog", + modal: true, + draggable: true, + resizable: true, + autoOpen: false, + width: 'auto', + maxHeight: $(window).height(), + close: function () { + this.list.dialog.form.reset(); + $(this.list.dialog.form).next().remove(); + //allFields.removeClass("ui-state-error"); + }, + buttons: [{ + text: epgd.tr.del, + icons: { primary: "ui-icon-trash" }, + id: 'tBDel', + click: function () { + $(this).dialog("close"); + this.list.del(this.list.dialog.form.tID.value); + } + }, { + text: epgd.tr.cancel, + icons: { primary: "ui-icon-close" }, + click: function () { + $(this).dialog("close"); + } + }, { + text: epgd.tr.save, + icons: { primary: "ui-icon-disk" }, + click: function () { this.list.dialog.save() } + }] + }, + save: function (data, url, failFunc, succFunc) { + this.list.save(data || this.getData(), url, failFunc, succFunc) && !this.options.embed && this.$win.dialog("close"); + }, + showError: function (msg, field) { + epgd.utils.popup((field && field.id ? '' + $('label[for="' + field.id + '"]').text() + '' : '') + '
    ' + msg + '
    ', { autoClose: 3000 }); + field && field.focus(); + return false; + }, + loadFolder: function () { + var dialog = this; + epgd.ajax({ url: epgd.login.url + "data/recordingdirs" }, function (data) { + if (data.recordingdirs.length) { + var folder = [], + vdrs = epgd.vdrs.list, + vdr; + $.each(data.recordingdirs, function (id, f) { + vdr = vdrs[f.vdruuid]; + folder.push({ value: f.directory, category: vdr ? vdr.name : '-' }); + }); + $(dialog.form.tFolder).catcomplete("option", "source", folder); + } + }); + }, + close: function () { + if (this.$win) + this.$win.dialog("close"); + }, + create: function () { + var o = this.options, + tr = epgd.tr.pages.timerList, + week = '', + i; + for (i = 1; i < epgd.tr.dateTimePicker.dayNamesShort.length; i++) + week += '' + epgd.tr.dateTimePicker.dayNamesShort[i]; + week += '' + epgd.tr.dateTimePicker.dayNamesShort[0]; + this.$win = $('
    ' + + '
    ' + + '
    ' + + '
    ' + +'
    ' + + '
    ' + week + '
    ' + + '

    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ');//.dialog(o);//.dialog("option", "buttons", o.buttons); + !o.embed && this.$win.appendTo(document.body).dialog(o); + this.$win[0].list = this.list; + this.form = this.$win.find('form')[0]; + $(this.form.tFolder).catcomplete({ + minLength: 0, + maxHeight: 300 + }).focus(function () { + $(this).catcomplete("search", ""); + }); + $(this.form.tType).change(function () { + if (this.selectedIndex < 0) + this.selectedIndex = 0; + this.form.className = this.form.className.replace(/ ?type./, '') + ' type' + this[this.selectedIndex].value; + // $('.onlyTypeR', this.form).toggle(this[this.selectedIndex].value == 'R'); + // $('#tSName').parent().toggle(this[this.selectedIndex].value == 'S'); + // $('#tRepeat,#tChFormat').parent().toggle(this[this.selectedIndex].value != 'S'); + }); + $(this.form.tNameMode).change(function () { + this.form.tTemplate.parentNode.style.display = (this.selectedIndex == 6) ? 'block': 'none'; + }); + epgd.utils.addPlaceholders(this.form.tTemplate, '%', tr.templateFields); + this.loadFolder(); + }, + render : function (t) { + t = t || {}; + if (!this.$win) + this.create(); + !this.options.embed && this.$win.dialog('open').dialog('moveToTop'); + var form = this.form, + d, i; + form.tSName.focus(); + if (t.id) { + form.tID.value = t.id; + this.$win.parent().find('#tBDel').show(); + this.$win.parent().find('#tBToggle').hide(); + } else { + form.tID.value = ''; + this.$win.parent().find('#tBDel').hide(); + this.$win.parent().find('#tBToggle').show(); + } + $(form.tType).val(t.type || 'R').change(); + $(form.tVdr).val(t.vdruuid || epgd.profile.timerDefaultVDRuuid); + d = t.weekdays || 0; + for (i = 0, f = 1; i < form.tWeek.length; i++, f *= 2) + form.tWeek[i].checked = (d & f); + form.tPrio.value = t.priority || ''; + form.tLife.value = t.lifetime || ''; + form.tVPS.checked = t.vps == 1; + form.tInactive.checked = t.active === 0; + form.tFolder.value = t.directory || ''; + form.tSName.value = t.name || ''; + epgd.pages.help.initButtons(this.$win); + this.resize(); + }, + resize: function () { + /*var dlgOpt = this.$win.dialog("instance").options; + dlgOpt.position.my = "center top"; + dlgOpt.position.at = "center top"; */ + this.$win.dialog("option", "maxHeight", $(window).height()); + } + }; + +// Timerdialog - Klasse +epgd.timerDialog = epgd.utils.inherits(function () { + epgd.timerDialogBase.call(this,{ + id: 'timerDialog', + title: epgd.tr.pages.timer.timerList + ' ' + epgd.tr.edit, + buttons: [{ + text: epgd.tr.pages.timer.searchTimerList, + icons: { primary: "ui-icon-transferthick-e-w" }, + id: "tBToggle", + click: function () { + var t = this.list.dialog.getData(true); + if (t) { + $(this).dialog("close"); + //t.channelid && (t.channelids = t.channelid); + if (t.title) { + t.expression = t.title; + t.searchfields = 1; + } + epgd.pages.searchTimerList.dialog.render(t); + } + } + }].concat(epgd.timerDialog.base.options.buttons) + }); +}, epgd.timerDialogBase); +epgd.timerDialog.prototype.create = function () { + epgd.timerDialog.base.create.call(this); + + var tr = epgd.tr.pages.timerList, + form = this.form; + + $(form).prepend('
    '); + $(form.tWeek[0]).parent().before('
    ' + + '
      -
    '); + $(form.tNameMode).after(' '); + $(form.tFolder).parent().after('
    '); + $(this.form.tStart).datetimepicker({ + minDateTime: epgd.utils.now(), + }); + $(this.form.tEnd).timepicker({ + // minDateTime: epgd.utils.now() + }); + epgd.utils.addAutoComplete(form.tChannel, { source: epgd.channels.autoCompleteData }); + form.tFile = $(form).find('#tFile')[0]; + form.tEvTime = $(form).find('#tEvTime')[0]; + form.tTitle = $(form).find('#tTitle').click(function () { + if (form.tEvID.value) { + epgd.utils.loader.process(function () { + new epgd.eventDetail(form.tEvID.value).render(); + }); + } + })[0]; +}; +epgd.timerDialog.prototype.render = function (t) { + t = t || {}; + epgd.timerDialog.base.render.call(this, t); + var form = this.form, + d; + + form.tFile.innerHTML = t.file || '...'; + form.tEvID.value = t.eventid || ''; + epgd.utils.setAutoCompleteValues(form.tChannel, t.channelid ? [t.channelid] : null); + form.tTitle.innerHTML = t.title || ''; + form.tEvTime.innerHTML = t.evStartTime ? epgd.utils.formatDateTime(t.evStartTime) + ' - ' + epgd.utils.formatTime(t.evStartTime + t.evDuration) : ''; + + $([form.tStart, form.tEnd]).datetimepicker("option", "disabled", !!t.eventid); + if (t.day || !t.evStartTime) { + if (t.starttime) + d = epgd.utils.date((t.day + parseInt(t.starttime / 100, 10) * 60 * 60 + (t.starttime % 100) * 60)); + else if (t.day) + d = epgd.utils.date(t.day); + else + d = epgd.utils.now(); + $(form.tStart).datetimepicker('setDate', d); + $(form.tStart).datetimepicker('setTime', d); + if (t.endtime) + d = epgd.utils.date((t.day + parseInt(t.endtime / 100, 10) * 60 * 60 + (t.endtime % 100) * 60)); + else + d = new Date(d.getTime() + 2 * 60 * 60000); + $(form.tEnd).datetimepicker('setTime', d); + } else { + $([form.tStart, form.tEnd]).val('...'); + } + //form.tNameMode.defaultIndex = parseInt(t.category == 'Serie' ? epgd.profile.namingModeSerie : epgd.profile.namingModeMovie, 10); + form.tNameMode.selectedIndex = typeof t.namingmode == "undefined" ? parseInt(t.category == 'Serie' ? epgd.profile.namingModeSerie : epgd.profile.namingModeMovie, 10) : t.namingmode; + form.tTemplate.value = t.template || (t.category == 'Serie' ? epgd.profile.namingModeSerieTemplate : epgd.profile.namingModeMovieTemplate); + $(form.tNameMode).change(); +}; +epgd.timerDialog.prototype.getData = function (dontValid) { + var form = this.form, + d, i, + data = {}; + if (form.tEvID.value) data.eventid = parseInt(form.tEvID.value, 10); + data.active = form.tInactive.checked ? 0 : 1; + if (form.tID.value) data.id = parseInt(form.tID.value, 10); + if (form.tStart.value && form.tStart.value != '...') { + d = $(form.tStart).datepicker('getDate'); + data.starttime = d.getHours() * 100 + d.getMinutes(); + d.setHours(0); + d.setMinutes(0); + data.day = parseInt(d.getTime() / 1000, 10); + data.endtime = parseInt(form.tEnd.value.replace(':', ''), 10); + } else if (!data.eventid && !dontValid) + return this.showError(epgd.tr.error.emptyField.replace("$field$", epgd.tr.pages.timerList.recordTime), form.tStart); + data.weekdays = 0; + for (i = 0, f = 1; i < form.tWeek.length; i++, f *= 2) + if (form.tWeek[i].checked) + data.weekdays += f; + data.vps = form.tVPS.checked ? 1 : 0; + if (form.tPrio.value) data.priority = parseInt(form.tPrio.value, 10); + if (form.tLife.value) data.lifetime = parseInt(form.tLife.value, 10); + //if (form.t) data.childlock = form.t; + data.channelid = epgd.utils.getAutoCompleteValues(form.tChannel); + if (!data.channelid && !dontValid) + return this.showError(epgd.tr.error.emptyField.replace("$field$", epgd.tr.channel), form.tChannel); + /*data.file = form.tFile.value; + if (form.tFolder.value) + data.file = form.tFolder.value + '~' + data.file; + */ + d = $(form.tVdr).val(); + if (d) data.vdruuid = d; + //if (!dontValid || form.tNameMode.defaultIndex != form.tNameMode.selectedIndex) + data.namingmode = form.tNameMode.selectedIndex; + data.template = form.tTemplate.value; + data.type = $(form.tType).val(); + if (data.type == 'V' && !d && !dontValid) + return this.showError(epgd.tr.error.emptyField.replace("$field$", "VDR"), form.tVdr); + data.directory = form.tFolder.value; + data.title = form.tTitle.innerHTML || ''; + data.name = form.tSName.value; + return data; +} +// Suchtimerdialog - Klasse +epgd.searchTimerDialog = epgd.utils.inherits(function (options) { + this.searchResultList = null; + epgd.timerDialogBase.call(this,$.extend({},{ + id: 'searchTimerDialog', + width: 530, + title: epgd.tr.pages.timer.searchTimerList + ' ' + epgd.tr.edit, + buttons: [{ + text: epgd.tr.pages.timer.timerList, + icons: { primary: "ui-icon-transferthick-e-w" }, + id: "tBToggle", + click: function () { + var t = this.list.dialog.getData(true); + if (t) { + $(this).dialog("close"); + t.channelids && (t.channelid = t.channelids.split(',')[0]); + t.expression && (t.title = t.expression); + epgd.pages.timerList.dialog.render(t); + } + } + }, { + text: epgd.tr.test, + click: function () { + this.list.dialog.search(); + } + }].concat(epgd.searchTimerDialog.base.options.buttons, { + text: epgd.tr.copy, + icons: { primary: "ui-icon-copy" }, + id: "tBCopy", + click: function (ev) { + $(ev.currentTarget).hide(); + this.list.dialog.form.tID.value = ''; + this.list.dialog.form.tSName.value += ' copy'; + this.list.dialog.form.tSName.select(); + } + }) + },options)); +}, epgd.timerDialogBase); +epgd.searchTimerDialog.prototype.search = function ($con, searchData) { + if (!this.searchResultList) + this.searchResultList = new epgd.searchResultList(null);//,this); + if (!this.searchResultList.$con || ($con && $con[0] != this.searchResultList.$con[0])) + this.searchResultList.render($con || ($('
    ').insertAfter(this.form))); + else + this.searchResultList.$con.find('tbody').empty(); + if (!this.searchResultList.$con.parent().length) { + this.searchResultList.$con.insertAfter(this.form); + this.searchResultList.init(); + } + this.searchResultList.update(searchData || this.getData()); + this.searchResultList.$con[0].scrollIntoView(true); +} +epgd.searchTimerDialog.prototype.create = function () { + epgd.searchTimerDialog.base.create.call(this); + + var tr = epgd.tr.pages.timerList, + trS = epgd.tr.pages.search, + sModes = '', + form = this.form, + key; + + for (key in trS.searchModes) + sModes += ''; + if (!epgd.categories) { + epgd.categories = []; + epgd.ajax({ url: 'data/categories', async: false }, function (data) { epgd.categories = data.categories; }); + } + if (!epgd.genres) { + epgd.genres = []; + epgd.ajax({ url: 'data/genres', async: false }, function (data) { epgd.genres = data.genres; }); + } + + $(form.tSName).parent().parent().after('
    ' + + '
    ' + + '   
    ' + + '
    ' + [""].concat(trS.searchFields).join('') + '
    ' + + '
    ' + + '' + tr.episode + ' ' + + '' + epgd.tr.pages.eventDetail.season + ' ' + + '' + epgd.tr.pages.eventDetail.part + ' ' + + '
    ' + epgd.tr.pages.eventDetail.category + ' ' + + '
    ' + epgd.tr.pages.eventDetail.genre + ' ' + + '
    GoldTippTagesTippTopTipp' + + '
    ' + epgd.tr.pages.eventDetail.year + '' + + '
    ' + tr.noEpgMatch + + '
    ' + + '
    ' + [""].concat(trS.searchFields).join('') + '
    ' + + '
    ' + epgd.pages.help.getIcon('sTChannels') + '
    ' + + '
    ' + + '
    '); + $(form.tWeek[0]).before('' + epgd.tr.dateTimePicker.timeTextBetween + ' - ') + .parent().append('
    ' + tr.nextDays.replace('$field$','') + '').insertAfter(form.tTime.parentNode); + $([form.tStart,form.tEnd]).timepicker({ + alwaysSetTime: false + }); + $([form.tTime, form.tRepeat, form.tAdv]).change(function () { + $(this).parent().next().toggle(this.checked); + }); + $([form.tSFSeason, form.tSFSPart, form.tSFYear]).change(function () { + this.value = this.value.replace(/[^0-9-]/g, ''); + if (this.value.length == 1 && this.value == '-') + this.value = ''; + }); + $(form.tType).append(''); + epgd.utils.addAutoComplete(form.tChannels, { source: epgd.channels.autoCompleteData, multiselect: true }); + epgd.utils.addAutoComplete(form.tSFCat, { source: epgd.categories, multiselect: true }); + epgd.utils.addAutoComplete(form.tSFGenre, { source: epgd.genres, multiselect: true }); +}; +epgd.searchTimerDialog.prototype.render = function (t) { + t = t || { searchfields: 1 }; + epgd.searchTimerDialog.base.render.call(this, t); + var form = this.form, + d, i; + form.tExpr.value = t.expression || ''; + $(form.tSMode).val(t.searchmode || 4); + form.tCaseSens.checked = t.casesensitiv == 1; + d = t.searchfields || 0; + for (i = 0, f = 1; i < form.tSFields.length; i++, f *= 2) + form.tSFields[i].checked = (d & f); + if (t.starttime || t.endtime || t.weekdays || t.nextdays) { + form.tTime.checked = true; + t.starttime ? $(form.tStart).datetimepicker('setTime', new Date(0, 0, 0, parseInt(t.starttime / 100, 10), (t.starttime % 100))) : form.tStart.value = ''; + t.endtime ? $(form.tEnd).datetimepicker('setTime', new Date(0, 0, 0, parseInt(t.endtime / 100, 10), (t.endtime % 100))) : form.tEnd.value; + form.tNextDays.value = t.nextdays || ''; + } else + form.tTime.checked = false; + $(form.tTime).change(); + d = t.repeatfields || 0; + for (i = 0, f = 1; i < form.tRFields.length; i++, f *= 2) + form.tRFields[i].checked = (d & f); + form.tRepeat.checked = d > 0; + $(form.tRepeat).change(); + + form.tSFEpisode.value = t.episodename || ''; + form.tSFSeason.value = t.season || ''; + form.tSFSPart.value = t.seasonpart || ''; + form.tSFYear.value = t.year || ''; + + epgd.utils.setAutoCompleteValues(form.tSFCat, new String(t.category).replace(/'/g, '').split(',')); + epgd.utils.setAutoCompleteValues(form.tSFGenre, new String(t.genre).replace(/'/g, '').split(',')); + d = t.tipp || ''; + for (i = 0; i < form.tSFTip.length; i++) + form.tSFTip[i].checked = d.indexOf("'" + form.tSFTip[i].value + "'") >= 0; + form.tSFNoEpgMatch.checked = t.noepgmatch == 1; + + form.tAdv.checked = t.episodename || t.season || t.seasonpart || t.year || t.category || t.genre || t.tipp || t.noepgmatch; + $(form.tAdv).change(); + epgd.utils.setAutoCompleteValues(form.tChannels, new String(t.channelids).split(',')); + + if (t.chexclude) + form.tChExclude1.checked = 1; + else + form.tChExclude0.checked = 1; + form.tChFormat.value = t.chformat || (t.id ? '' : epgd.profile.chFormat); + form.tNameMode.defaultIndex = parseInt(t.category == 'Serie' ? epgd.profile.namingModeSearchSerie : epgd.profile.namingModeSearchMovie, 10); + form.tNameMode.selectedIndex = t.namingmode || form.tNameMode.defaultIndex; + form.tTemplate.value = t.template || (t.category == 'Serie' ? epgd.profile.namingModeSearchSerieTemplate : epgd.profile.namingModeSearchMovieTemplate); + $(form.tNameMode).change(); + this.$win.parent().find('#tBCopy').toggle(!!t.id); +}; +epgd.searchTimerDialog.prototype.getData = function (dontValid) { + var form = this.form, + d, i, + data = { expression: form.tExpr.value }; + if (form.tSFSeason.value) data.season = form.tSFSeason.value; + if (form.tSFSPart.value) data.seasonpart = form.tSFSPart.value; + if (form.tSFYear.value) data.year = form.tSFYear.value; + if (!dontValid) { + if (!data.expression) + return this.showError(epgd.tr.error.emptyField.replace("$field$", epgd.tr.pages.search.searchExpression), form.tExpr); + if (data.season && !/^[0-9]{0,3}-?[0-9]{0,3}$/.test(data.season)) + return this.showError(epgd.tr.error.invalid, form.tSFSeason); + if (data.seasonpart && !/^[0-9]{0,3}-?[0-9]{0,3}$/.test(data.seasonpart)) + return this.showError(epgd.tr.error.invalid, form.tSFSPart); + if (data.year && !/^((19|20)[0-9]{2})?(-|-(19|20)[0-9]{2})?$/.test(data.year)) + return this.showError(epgd.tr.error.invalid, form.tSFYear); + } + if (form.tID.value) data.id = parseInt(form.tID.value, 10); + if (form.tSFEpisode.value) data.episodename = form.tSFEpisode.value; + data.category = epgd.utils.getAutoCompleteValues(form.tSFCat, "'"); + data.genre = epgd.utils.getAutoCompleteValues(form.tSFGenre, "'"); + d = ''; + for (i = 0; i < form.tSFTip.length; i++) + if (form.tSFTip[i].checked) d += ",'" + form.tSFTip[i].value + "'"; + data.tipp = d.slice(1); + data.noepgmatch = form.tSFNoEpgMatch.checked ? 1 : 0; + + data.searchmode = parseInt($(form.tSMode).val(), 10); + data.searchfields = 0; + for (i = 0, f = 1; i < form.tSFields.length; i++, f *= 2) + if (form.tSFields[i].checked) + data.searchfields += f; + data.casesensitiv = form.tCaseSens.checked ? 1 : 0; + data.repeatfields = 0; + if (form.tRepeat.checked) { + for (i = 0, f = 1; i < form.tRFields.length; i++, f *= 2) + if (form.tRFields[i].checked) + data.repeatfields += f; + } + data.active = form.tInactive.checked ? 0 : 1; + + data.channelids = epgd.utils.getAutoCompleteValues(form.tChannels); + data.chformat = form.tChFormat.value; + data.chexclude = form.tChExclude1.checked ? 1 : 0; + if (form.tTime.checked) { + data.starttime = parseInt(form.tStart.value.replace(':', ''), 10); + data.endtime = parseInt(form.tEnd.value.replace(':', ''), 10); + data.weekdays = 0; + for (i = 0, f = 1; i < form.tWeek.length; i++, f *= 2) + if (form.tWeek[i].checked) + data.weekdays += f; + } + data.vps = form.tVPS.checked ? 1 : 0; + if (form.tPrio.value) data.priority = parseInt(form.tPrio.value, 10); + if (form.tLife.value) data.lifetime = parseInt(form.tLife.value, 10); + //if (form.t) data.childlock = form.t; + data.directory = form.tFolder.value; + d = $(form.tVdr).val(); + if (d) data.vdruuid = d; + //if (!dontValid || form.tNameMode.defaultIndex != form.tNameMode.selectedIndex) + data.namingmode = form.tNameMode.selectedIndex; + data.template = form.tTemplate.value; + data.type = $(form.tType).val(); + if (data.type == 'V' && !d && !dontValid) + return this.showError(epgd.tr.error.emptyField.replace("$field$", "VDR"), form.tVdr); + data.name = form.tSName.value; + if (form.tNextDays.value) data.nextdays = parseInt(form.tNextDays.value,10); + return data; +} +epgd.searchTimerDialog.prototype.save = function (d, url, failFunc, succFunc) { + d = d || this.getData(); + var self = this, + id= d.id, + name= d.name; + d.max = 0; + d.id && delete d.id; + d.name && delete d.name; + epgd.utils.loader.process(function () { + epgd.ajax({ + url: epgd.login.url + "data/search", + type: 'post', + data: JSON.stringify(d) + }, function (data) { + d.id = id; + d.name = name; + if (data.count > 50) { + epgd.utils.confirm(epgd.tr.pages.timerList.confirmSaveBigResult.replace('$cnt$', data.count), function (ok) { + ok && epgd.searchTimerDialog.base.save.call(self, d); + }); + } else + epgd.searchTimerDialog.base.save.call(self, d, url, failFunc, succFunc); + epgd.utils.loader.close(); + }); + },true); +} +// Suche - Klasse +epgd.searchDialog = epgd.utils.inherits(function () { + epgd.searchTimerDialog.call(this, { + id: 'search', + embed: true, + buttons: null + }); + this.searchResultList = new epgd.searchResultList({ + empty: epgd.tr.pages.search.empty + }, this); +}, epgd.searchTimerDialog); +epgd.searchDialog.prototype.create = function () { + epgd.searchDialog.base.create.call(this); + var form = this.form, + search= this, + $result = $('
    ').appendTo(this.$win); + $('') + .insertAfter(form.tExpr) + .after('  '); + $(form.tType).parent().hide().parent().css('border-top','1px solid #ccc').insertAfter($(form.tVdr.parentNode.parentNode).hide()); + $('').insertAfter(form.tSName).click(function () { + search.form.tID.value = ''; + search.form.tSName.value += ' copy'; + search.form.tSName.select(); + }).prop("disabled", true); + $('').insertAfter(form.tSName).click(function () { + search.list.del(this.form.tID.value, function () { search.form.tID.value = '';search.loadSavedSearch() }); + }).prop("disabled", true); $('').insertAfter(form.tSName).click(function () { + var d = search.getData(); + if (!d.name) + return this.showError(epgd.tr.error.invalid, form.tSName); + search.save(d, null, null, function () { search.loadSavedSearch() }); + }); + $(form).submit(function () { + search.search($result); + return false; + }); + this.$win.find('#sExpr').keyup(function (ev) { if (ev.keyCode == 13) { this.form.sSearch.click(); $(this).blur(); } }).focus(); + //$(form.tExpr).parent().next().nextAll().wrapAll('
    '); + this.$win.find('#sAdv').change(function () { + $(form).toggleClass("noAdv", !this.checked); + search.resize(); + }).prop('checked', epgd.profile.searchAdv == "1").change(); + $(form.tSName).autocomplete({ + minLength: 0, + maxHeight: 300, + source:function(){return false}, // damit bei einem focus kein error ausgelöst wird + select: function (ev, ui) { + var d = ui.item.data || { id: '' }; + if (d.id) { + search.render(d); + search.form.sSearch.click(); + $([form.tDel, form.tCopy, form.tInactive]).prop("disabled", false); + return false; + } else { + form.tID.value = ''; + $([form.tDel, form.tCopy, form.tInactive]).prop("disabled", true); + } + } + }).focus(function () { + $(this).autocomplete("search", ""); + }); + this.loadSavedSearch(); +} +epgd.searchDialog.prototype.loadSavedSearch = function () { + var form = this.form; + epgd.ajax({ url: epgd.login.url + "data/searchtimers?type=S" }, function (data) { + var list = []; + $.each(data.searchtimers, function (id, t) { + list.push({ value: t.name || t.expression, label: t.name || t.expression, data: t }); + }); + $(form.tSName).autocomplete("option", "source", list); + }); +} +epgd.searchDialog.prototype.resize = function () { + var $result = this.$win.find('#searchResult'), + h = $(window).height() - $result.offset().top - 20; + if (h < 100) + $result.css({ 'height': 'auto', 'overflow-y': 'visible' }); + else + $result.css({ 'height': h + 'px', 'overflow-y': 'auto' }); +} +epgd.searchDialog.prototype.render = function (t) { + if (!epgd.$con.find('#search').length) { + $('#menu_search').addClass("menu-active"); + this.create(); + epgd.$con.html(''); + this.$win.appendTo(epgd.$con); + } + t = t || { searchfields: 1 }; + t.type = 'S'; + epgd.searchDialog.base.render.call(this, t); +} +epgd.searchDialog.prototype.close = function () { } diff --git a/http/src/js/channels.js b/http/src/js/channels.js new file mode 100644 index 0000000..add3035 --- /dev/null +++ b/http/src/js/channels.js @@ -0,0 +1,46 @@ +epgd.channels = { + list: null, + autoCompleteData: null, + isDirty: false, + selBox: $('')[0], + load: function () { + if (!this.list || this.isDirty) { + epgd.ajax({ url: epgd.login.url + "data/channels", async: false, cache: false},function (data) { + var logoPath = (epgd.profile.channelLogoPath ? epgd.profile.channelLogoPath + '?maxW=70&maxH=50&id=' : false), + channelOpt = '', + list = {}, + ac_data = []; + data.channels && $.each(data.channels, function (i, channel) { + var id = channel.channelid || i; + if (channel.name) { + channel.html = '
    ' + (logoPath ? '' + channel.name + '' + + '' + + (epgd.profile.logoShowName == "1" ? channel.name : '') : channel.name) + '
    '; + channel.visible & 1 && (channelOpt += ''); + } + else { + channel.html = '
    ' + + '' + id + '
    '; + channel.visible & 1 && (channelOpt += ''); + } + list[id] = channel; + ac_data.push({ label: channel.name, value: id }); + }); + epgd.channels.list = list; + epgd.channels.autoCompleteData= ac_data; + $(epgd.channels.selBox).html(channelOpt); + $(window).trigger('channels_load'); + this.dirty = false; + }); + } + }, + getHtml: function (id) { + var ch = this.list[id]; + return ch ? ch.html : '
    ' + + '' + id + '
    '; + }, + getName: function (id) { + var ch = this.list[id]; + return ch ? ch.name : id; + } +}; diff --git a/http/src/js/epgd b/http/src/js/epgd new file mode 100644 index 0000000..8673096 --- /dev/null +++ b/http/src/js/epgd @@ -0,0 +1,3 @@ +var epgd = { + pages: {} +}; diff --git a/http/src/js/eventDetail.js b/http/src/js/eventDetail.js new file mode 100644 index 0000000..8ff8548 --- /dev/null +++ b/http/src/js/eventDetail.js @@ -0,0 +1,523 @@ +epgd.eventDetail = function (id) { + this.id = id; + this.data = null; + this.expire = 0; +} +epgd.eventDetail.prototype.imgPath = false; +epgd.eventDetail.prototype.load = function (channelId, time) { + var self = this; + epgd.ajax({ + url: epgd.login.url + "data/event?" + (channelId && time ? "channelid=" + channelId + "&time=" + time : "id=" + this.id), async: false, cache: false + }, function (data) { + self.data = data.event; self.id = data.id; self.expire = epgd.utils.now().getTime() + 900000; + }); //15*60*1000 + return this; +} +epgd.eventDetail.prototype.render = function () { + if (this.expire < epgd.utils.now().getTime()) + this.load(); + if (!this.data) + return ''; + this.win.render(this); +}; +epgd.eventDetail.prototype.doRecord = function (eData) { + if (eData === true) return epgd.tr.pages.eventDetail.record; // eData = getTitle + eData = eData || this.data; + var tData = { + id: eData.timerid, + eventid: eData.id, + channelid: eData.channelid, + title: eData.title, + evStartTime: eData.starttime, + evDuration: eData.duration, + category: eData.category, + shorttext: eData.shorttext, + expression: eData.title + }; + if (tData.eventid) + epgd.pages.timerList.dialog.render(tData); + else + epgd.pages.searchTimerList.dialog.render(tData); +} +epgd.eventDetail.prototype.doRepeat = function (checkAvail) { + if (checkAvail) return true; + var win = this.win, + $repeatHdl = win.$con.find('.repeat'), + searchData; + if (!$repeatHdl.length) { + if (!this.searchResultList) { + this.searchResultList = new epgd.searchResultList(null, { + resize: function () { + win.$con.last().find('td[data-evId="' + win.detail.data.id + '"]').parent().remove(); + win.$con.accordion("refresh"); + $repeatHdl.click(); + } + }); + } + $repeatHdl = $('

    ' + epgd.tr.pages.eventDetail.repeat + '

    ').appendTo(win.$con); + searchData = { searchfields: 1, expression: this.data.title, searchmode: 1, casesensitiv: 1, fromEventDetail: true }; + if (this.data.shorttext) { + searchData.searchfields1= 2; + searchData.expression1 = this.data.shorttext; + } + epgd.pages.search.search.call(this, $('
    ').appendTo(win.$con), searchData); + } else + $repeatHdl.click(); +} +epgd.eventDetail.prototype.doPlay = function (checkAvail) { + var t = parseInt(epgd.utils.now().getTime() / 1000, 10) - this.data.starttime; + if (t < 0 || t > this.data.duration) + return false; + if (checkAvail) return true; + epgd.vdrs.current.switchChannel(this.data.channelid); +} +epgd.eventDetail.prototype.doPrev = function (checkAvail) { + var t = this.data.starttime - 500, + self = this; + if (t < epgd.profile.minEventTime) + return false; + if (checkAvail) return true; + epgd.utils.loader.process(function () { + new epgd.eventDetail().load(self.data.channelid, t).render(); + }); +} +epgd.eventDetail.prototype.doNext = function (checkAvail) { + var t = this.data.starttime + this.data.duration + 500, + self = this; + if (t > epgd.profile.maxEventTime) + return false; + if (checkAvail) return true; + epgd.utils.loader.process(function () { + new epgd.eventDetail().load(self.data.channelid, t).render(); + }); +} + +epgd.eventDetail.win = function () { + this._create(); + this.closed = true; + this.detail = null; + var win = this; + $(window).bind("epgd_close.eventDetail", function () { + if (!win.closed) { + //win.$win.css('left', ''); + win.$win.css('z-Index', ''); + win.$win.hide(); + $(document).unbind("keyup.eventDetail"); + win.closed = true; + win.$openDialogs && win.$openDialogs.removeClass("ui-state-disabled"); + } + }); + $(window).bind("resize.eventDetail", function (ev) { + if (!win.closed) { + try { + win.$win.css("max-width", $(window).width()); + win.$win.show().position({ of: window }); + win.$con.accordion("refresh"); + } catch (e) { } + if (parseInt(win.$win.css('top'), 10) < 69) + win.$win.css('top', '69px'); + }; + }); +} +epgd.eventDetail.win.prototype._create = function () { + this.imgPath = epgd.profile.eventImgPath ? epgd.profile.eventImgPath + '?no=0&maxW=270&maxH=146&id=' : false; + this.movieImgPath = epgd.profile.movieMediaPath ? epgd.profile.movieMediaPath + '?actor_id=0&movie_id=' : false; + this.movieActorImgPath = epgd.profile.movieMediaPath ? epgd.profile.movieMediaPath + '?maxW=60&maxH=90&media_type=4&actor_id=' : false; + this.serieImgPath = epgd.profile.serieImgPath ? epgd.profile.serieImgPath + '?actor_id=0&series_id=' : false; + this.serieActorImgPath = epgd.profile.serieImgPath ? epgd.profile.serieImgPath + '?maxW=60&maxH=90&season_number=0&episode_id=0&media_type=11&actor_id=' : false; + + this.$win = $('
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    ').appendTo(document.body); + this.$con = this.$win.find(':first :last'); + var win = this, + tr = epgd.tr.pages.eventDetail, + toolbar = this.$win.find('.toolbar')[0]; + this.$rec= $(' ' + + '' + epgd.tr.pages.editChannels.headline + + '
    ' + + '
    Web
    ' + //+ '
    VDR
    ' + + 'channel-idchannel-name' + //+ '
    merging
    ' + + '
    ' + ).find('button'); + + $but.click(function () { + var $menu = this.$menu.show(); + $(document).bind("click.ui_menu", function (ev) { + if (!$(ev.target).closest(".ui-menu").length) { + $menu.hide(); + $(this).unbind("click.ui_menu"); + } + }); + return false; + })[0].$menu = $('').hide().insertAfter($but).menu({ + select: function (ev, ui) { + var $li = ui.item, + ul, path, + filter = ''; + if (!$li.attr('data-id')) + $li = $li.parents('li[data-id]:first'); + switch ($li.attr('data-id')) { + case 'getChannelNames': + filter= '[value=""]'; + case 'getAllChannelNames': + epgd.utils.loader.process(function () { + var list = []; + $('#pageEditChannelsSource li').each(function () { + list[this.lastChild.innerHTML] = this.firstChild.innerHTML; + }) + $('#pageEditChannels > li > input' + filter).each(function () { + this.value = list[this.previousSibling.innerHTML] || this.value; + }); + }); + break; + case 'getOrder': + epgd.utils.loader.process(function () { + var $list = $('#pageEditChannels'), + $span; + $($('#pageEditChannelsSource span').get().reverse()).each(function () { + $span = $list.find('> li > span:contains(' + this.innerHTML + ')'); + if ($span.length) + $span.parent().prependTo($list); + }); + }); + break; + case 'insertList': + $('

    ' + tr.desc_insertList + ' channelpedia.yavdr.com

    ').dialog({ + modal: true, + width: 500, + height: 400 + }).find('textarea').change(function () { + epgd.pages.editChannels.insertReferenceList(this.value); + $(this).parent().dialog('destroy'); + }); + break; + case 'loadList': + if (ui.item.attr('data-url')) { + epgd.ajax({url:epgd.login.url + 'data/proxy?id=' + ui.item.attr('data-url'), dataType: "html", contentType: "text/plain; charset=utf-8"},epgd.pages.editChannels.insertReferenceList); + break; + } + case 'channelpedia': + ul = $('