homepage.php 57 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079
  1. <?php
  2. $data = false;
  3. ini_set("display_errors", 1);
  4. ini_set("error_reporting", E_ALL | E_STRICT);
  5. require_once("user.php");
  6. require_once("functions.php");
  7. $USER = new User("registration_callback");
  8. // Check if connection to homepage is allowed
  9. qualifyUser(HOMEPAGEAUTHNEEDED, true);
  10. // Load Colours/Appearance
  11. foreach(loadAppearance() as $key => $value) {
  12. ${$key} = $value;
  13. }
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang="en" class="no-js">
  17. <head>
  18. <meta charset="UTF-8">
  19. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  20. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  21. <meta name="msapplication-tap-highlight" content="no" />
  22. <title><?=$title;?> Homepage</title>
  23. <link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.min.css">
  24. <link rel="stylesheet" href="bower_components/font-awesome/css/font-awesome.min.css">
  25. <link rel="stylesheet" href="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css">
  26. <script src="js/menu/modernizr.custom.js"></script>
  27. <link rel="stylesheet" href="bower_components/animate.css/animate.min.css">
  28. <link rel="stylesheet" href="bower_components/fullcalendar/dist/fullcalendar.css">
  29. <link rel="stylesheet" href="css/style.css?v=<?php echo INSTALLEDVERSION; ?>">
  30. <link rel="stylesheet" href="bower_components/mdi/css/materialdesignicons.min.css?v=<?php echo INSTALLEDVERSION; ?>">
  31. <link rel="stylesheet" href="bower_components/google-material-color/dist/palette.css?v=<?php echo INSTALLEDVERSION; ?>">
  32. <link rel="stylesheet" type="text/css" href="bower_components/slick/slick.css?v=<?php echo INSTALLEDVERSION; ?>">
  33. <!-- Add the slick-theme.css if you want default styling -->
  34. <!--Scripts-->
  35. <script src="bower_components/jquery/dist/jquery.min.js"></script>
  36. <script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>
  37. <script src="bower_components/moment/min/moment.min.js"></script>
  38. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  39. <script src="bower_components/slimScroll/jquery.slimscroll.min.js"></script>
  40. <script src="bower_components/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.js"></script>
  41. <script src="bower_components/jquery.nicescroll/jquery.nicescroll.min.js"></script>
  42. <script src="bower_components/cta/dist/cta.min.js"></script>
  43. <script src="bower_components/fullcalendar/dist/fullcalendar.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  44. <script src="bower_components/slick/slick.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  45. <script src="js/jqueri_ui_custom/jquery-ui.min.js"></script>
  46. <script src="js/jquery.mousewheel.min.js" type="text/javascript"></script>
  47. <!--Other-->
  48. <script src="js/ajax.js?v=<?php echo INSTALLEDVERSION; ?>"></script>
  49. <!--[if lt IE 9]>
  50. <script src="bower_components/html5shiv/dist/html5shiv.min.js"></script>
  51. <script src="bower_components/respondJs/dest/respond.min.js"></script>
  52. <![endif]-->
  53. <style>
  54. .fc-day-grid-event{
  55. cursor: pointer;
  56. }
  57. .recentItems {
  58. padding-top: 10px;
  59. margin: 5px 0;
  60. }
  61. .slick-image-tall{
  62. width: 125px;
  63. height: 180px;
  64. }
  65. .slick-image-short{
  66. width: 125px;
  67. height: 130px;
  68. margin-top: 50px;
  69. }
  70. .overlay{
  71. position: absolute;
  72. top: 0;
  73. left: 0;
  74. width: 100%;
  75. height: 100%;
  76. display: none;
  77. z-index: 0;
  78. opacity: .98;
  79. }
  80. sort {
  81. display: none;
  82. }
  83. table.fc-list-table {
  84. table-layout: auto;
  85. }.tabbable{
  86. margin-bottom: 0;
  87. }.fc-day-grid-event .fc-content {
  88. white-space: normal;
  89. }.fc-list-item {
  90. table-layout: auto;
  91. position: inherit;
  92. margin: 10px;
  93. border-radius: 4px;
  94. padding: 0 5px 0 5px;
  95. color: #fff !important;
  96. }.fc-calendar .fc-toolbar {
  97. background: <?=$topbar;?>;
  98. color: <?=$topbartext;?>;
  99. border-radius: 5px 5px 0 0;
  100. padding: 15px;
  101. }.fc-calendar .fc-toolbar .fc-right {
  102. bottom: 0px;
  103. right: 20px;
  104. }.fc-calendar .fc-toolbar .fc-right button {
  105. color: <?=$topbartext;?>;
  106. }.fc-calendar .fc-toolbar .fc-prev-button, .fc-calendar .fc-toolbar .fc-next-button {
  107. color: <?=$topbartext;?>;
  108. }.carousel-image{
  109. width: 100px !important;
  110. height: 150px !important;
  111. border-radius: 3px 0 0 3px;
  112. }.carousel-image.album{
  113. width: 150px !important;
  114. height: 150px !important;
  115. border-radius: 3px 0 0 3px;
  116. }.carousel-control.album {
  117. top: 5px !important;
  118. width: 4% !important;
  119. }.carousel-control {
  120. top: 5px !important;
  121. width: 4% !important;
  122. }.carousel-caption.album {
  123. position: absolute;
  124. right: 4%;
  125. top: 0px;
  126. left: 160px;
  127. z-index: 10;
  128. bottom: 0px;
  129. padding-top: 0px;
  130. color: #fff;
  131. text-align: left;
  132. }.carousel-caption {
  133. position: absolute;
  134. right: 4%;
  135. top: 0px;
  136. left: 110px;
  137. z-index: 10;
  138. bottom: 0px;
  139. padding-top: 0px;
  140. color: #fff;
  141. text-align: left;
  142. padding-bottom: 2px !important;
  143. overflow: hidden !important;
  144. } @media screen and (max-width: 576px) {
  145. .nzbtable {
  146. padding-left: 5px !important;
  147. padding-right: 2px !important;
  148. font-size: 10px !important;
  149. word-break: break-word !important;
  150. }
  151. .nzbtable-file-row {
  152. padding-left: 5px !important;
  153. padding-right: 2px !important;
  154. font-size: 10px !important;
  155. white-space: normal !important;
  156. word-break: break-all !important;
  157. width: 0% !important;
  158. }
  159. } .nzbtable-file-row {
  160. white-space: normal !important;
  161. word-break: break-all !important;
  162. width: 0% !important;
  163. }.nzbtable-row {
  164. white-space: normal !important;
  165. width: 0% !important;
  166. font-size: 12px; !important;
  167. }<?php customCSS(); ?>
  168. </style>
  169. </head>
  170. <body class="scroller-body" style="padding: 0px;">
  171. <div class="main-wrapper" style="position: initial;">
  172. <div id="content" class="container-fluid">
  173. <br/>
  174. <?php if (qualifyUser(HOMEPAGENOTICEAUTH) && HOMEPAGENOTICETITLE && HOMEPAGENOTICETYPE && HOMEPAGENOTICEMESSAGE && HOMEPAGENOTICELAYOUT) { echo buildHomepageNotice(HOMEPAGENOTICELAYOUT, HOMEPAGENOTICETYPE, HOMEPAGENOTICETITLE, HOMEPAGENOTICEMESSAGE); } ?>
  175. <?php if (qualifyUser(HOMEPAGECUSTOMHTML1AUTH) && HOMEPAGECUSTOMHTML1) { echo "<div>" . HOMEPAGECUSTOMHTML1 . "</div>"; } ?>
  176. <?php if(SPEEDTEST == "true"){ ?>
  177. <style type="text/css">
  178. .flash {
  179. animation: flash 0.6s linear infinite;
  180. }
  181. @keyframes flash {
  182. 0% { opacity: 0.6; }
  183. 50% { opacity: 1; }
  184. }
  185. </style>
  186. <script type="text/javascript">
  187. var w = null
  188. function runTest() {
  189. document.getElementById('startBtn').style.display = 'none'
  190. document.getElementById('testArea').style.display = ''
  191. document.getElementById('abortBtn').style.display = ''
  192. w = new Worker('bower_components/speed/speedtest_worker.min.js')
  193. var interval = setInterval(function () { w.postMessage('status') }, 100)
  194. w.onmessage = function (event) {
  195. var data = event.data.split(';')
  196. var status = Number(data[0])
  197. var dl = document.getElementById('download')
  198. var ul = document.getElementById('upload')
  199. var ping = document.getElementById('ping')
  200. var jitter = document.getElementById('jitter')
  201. dl.className = status === 1 ? 'w-name flash' : 'w-name'
  202. ping.className = status === 2 ? 'w-name flash' : 'w-name'
  203. jitter.className = ul.className = status === 3 ? 'w-name flash' : 'w-name'
  204. if (status >= 4) {
  205. clearInterval(interval)
  206. document.getElementById('abortBtn').style.display = 'none'
  207. document.getElementById('startBtn').style.display = ''
  208. w = null
  209. }
  210. if (status === 5) {
  211. document.getElementById('testArea').style.display = 'none'
  212. }
  213. dl.textContent = data[1] + " Mbit/s";
  214. $("#downloadpercent").attr("style", "width: " + data[1] + "%;");
  215. $("#uploadpercent").attr("style", "width: " + data[2] + "%;");
  216. $("#pingpercent").attr("style", "width: " + data[3] + "%;");
  217. $("#jitterpercent").attr("style", "width: " + data[5] + "%;");
  218. ul.textContent = data[2] + " Mbit/s";
  219. ping.textContent = data[3] + " ms";
  220. jitter.textContent = data[5] + " ms";
  221. }
  222. w.postMessage('start')
  223. }
  224. function abortTest() {
  225. if (w) w.postMessage('abort')
  226. }
  227. </script>
  228. <div class="row" id="testArea" style="display:none">
  229. <div class="test col-sm-3 col-lg-3">
  230. <div class="content-box ultra-widget green-bg" data-counter="">
  231. <div id="downloadpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  232. <div class="w-content">
  233. <div class="w-icon right pull-right"><i class="mdi mdi-cloud-download"></i></div>
  234. <div class="w-descr left pull-left text-center">
  235. <span class="testName text-uppercase w-name">Download</span>
  236. <br>
  237. <span class="w-name counter" id="download" ></span>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. <div class="test col-sm-3 col-lg-3">
  243. <div class="content-box ultra-widget red-bg" data-counter="">
  244. <div id="uploadpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  245. <div class="w-content">
  246. <div class="w-icon right pull-right"><i class="mdi mdi-cloud-upload"></i></div>
  247. <div class="w-descr left pull-left text-center">
  248. <span class="testName text-uppercase w-name">Upload</span>
  249. <br>
  250. <span class="w-name counter" id="upload" ></span>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="test col-sm-3 col-lg-3">
  256. <div class="content-box ultra-widget yellow-bg" data-counter="">
  257. <div id="pingpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  258. <div class="w-content">
  259. <div class="w-icon right pull-right"><i class="mdi mdi-timer"></i></div>
  260. <div class="w-descr left pull-left text-center">
  261. <span class="testName text-uppercase w-name">Latency</span>
  262. <br>
  263. <span class="w-name counter" id="ping" ></span>
  264. </div>
  265. </div>
  266. </div>
  267. </div>
  268. <div class="test col-sm-3 col-lg-3">
  269. <div class="content-box ultra-widget blue-bg" data-counter="">
  270. <div id="jitterpercent" class="progress-bar progress-bar-striped active w-used" style=""></div>
  271. <div class="w-content">
  272. <div class="w-icon right pull-right"><i class="mdi mdi-pulse"></i></div>
  273. <div class="w-descr left pull-left text-center">
  274. <span class="testName text-uppercase w-name">Jitter</span>
  275. <br>
  276. <span class="w-name counter" id="jitter" ></span>
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. <br/>
  282. </div>
  283. <div id="abortBtn" class="row" style="display: none" onclick="javascript:abortTest()">
  284. <div class="col-lg-12">
  285. <div class="content-box red-bg" style="cursor: pointer;">
  286. <h1 style="margin: 10px" class="text-uppercase text-center">Abort Speed Test</h1>
  287. <div class="clearfix"></div>
  288. </div>
  289. </div>
  290. </div>
  291. <div id="startBtn" class="row" onclick="javascript:runTest()">
  292. <div class="col-lg-12">
  293. <div class="content-box green-bg" style="cursor: pointer;">
  294. <h1 style="margin: 10px" class="text-uppercase text-center">Run Speed Test</h1>
  295. <div class="clearfix"></div>
  296. </div>
  297. </div>
  298. </div>
  299. <?php } ?>
  300. <?php if((PLEXSEARCH == "true" && qualifyUser(PLEXHOMEAUTH))) { ?>
  301. <div id="searchPlexRow" class="row">
  302. <div class="col-lg-12">
  303. <div class="content-box box-shadow big-box todo-list">
  304. <form id="plexSearchForm" onsubmit="return false;" autocomplete="off">
  305. <div class="">
  306. <div class="input-group">
  307. <div style="border-radius: 25px 0 0 25px; border:0" class="input-group-addon gray-bg"><i class="fa fa-search white"></i></div>
  308. <input id="searchInput" type="text" style="border-radius: 0;" autocomplete="off" name="search-title" class="form-control input-group-addon gray-bg" placeholder="Media Search">
  309. <div id="clearSearch" style="border-radius: 0 25px 25px 0;border:0; cursor: pointer;" class="input-group-addon gray-bg"><i class="fa fa-close white"></i></div>
  310. <button style="display:none" id="plexSearchForm_submit" class="btn btn-primary waves"></button>
  311. </div>
  312. </div>
  313. </form>
  314. <div id="resultshere" class="table-responsive"></div>
  315. </div>
  316. </div>
  317. </div>
  318. <?php } ?>
  319. <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))) { ?>
  320. <div id="downloadClientRow" class="row">
  321. <div class="col-xs-12 col-md-12">
  322. <div class="content-box">
  323. <div class="tabbable panel with-nav-tabs panel-default">
  324. <div class="panel-heading">
  325. <div class="content-tools i-block pull-right">
  326. <a id="getDownloader" class="repeat-btn">
  327. <i class="fa fa-repeat"></i>
  328. </a>
  329. </div>
  330. <h3 class="pull-left"><?php if(NZBGETURL != ""){ echo "NZBGet "; } if(SABNZBDURL != ""){ echo "SABnzbd "; } ?></h3>
  331. <ul class="nav nav-tabs pull-right">
  332. <li class="active"><a href="#downloadQueue" data-toggle="tab" aria-expanded="true"><?php echo $language->translate("QUEUE");?></a></li>
  333. <li class=""><a href="#downloadHistory" data-toggle="tab" aria-expanded="false"><?php echo $language->translate("HISTORY");?></a></li>
  334. </ul>
  335. <div class="clearfix"></div>
  336. </div>
  337. <div class="panel-body">
  338. <div class="tab-content">
  339. <div class="tab-pane fade active in" id="downloadQueue">
  340. <div class="table-responsive" style="max-height: 300px">
  341. <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
  342. <thead>
  343. <tr>
  344. <th class="col-xs-7 nzbtable-file-row"><?php echo $language->translate("FILE");?></th>
  345. <th class="col-xs-2 nzbtable"><?php echo $language->translate("STATUS");?></th>
  346. <th class="col-xs-1 nzbtable"><?php echo $language->translate("CATEGORY");?></th>
  347. <th class="col-xs-2 nzbtable"><?php echo $language->translate("PROGRESS");?></th>
  348. </tr>
  349. </thead>
  350. <tbody class="dl-queue sabnzbd"></tbody>
  351. <tbody class="dl-queue nzbget"></tbody>
  352. </table>
  353. </div>
  354. </div>
  355. <div class="tab-pane fade" id="downloadHistory">
  356. <div class="table-responsive" style="max-height: 300px">
  357. <table class="table table-striped progress-widget zero-m" style="max-height: 300px">
  358. <thead>
  359. <tr>
  360. <th class="col-xs-7 nzbtable-file-row"><?php echo $language->translate("FILE");?></th>
  361. <th class="col-xs-2 nzbtable"><?php echo $language->translate("STATUS");?></th>
  362. <th class="col-xs-1 nzbtable"><?php echo $language->translate("CATEGORY");?></th>
  363. <th class="col-xs-2 nzbtable"><?php echo $language->translate("PROGRESS");?></th>
  364. </tr>
  365. </thead>
  366. <tbody class="dl-history sabnzbd"></tbody>
  367. <tbody class="dl-history nzbget"></tbody>
  368. </table>
  369. </div>
  370. </div>
  371. </div>
  372. </div>
  373. </div>
  374. </div>
  375. </div>
  376. </div>
  377. <?php } ?>
  378. <?php if (qualifyUser(PLEXHOMEAUTH) && PLEXTOKEN) { ?>
  379. <div id="plexRowNowPlaying" class="row">
  380. <?php if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams(12, PLEXSHOWNAMES, $USER->role); } ?>
  381. </div>
  382. <div id="plexRow" class="row">
  383. <div class="col-lg-12">
  384. <?php
  385. if(PLEXRECENTMOVIE == "true" || PLEXRECENTTV == "true" || PLEXRECENTMUSIC == "true"){
  386. $plexArray = array("movie" => PLEXRECENTMOVIE, "season" => PLEXRECENTTV, "album" => PLEXRECENTMUSIC);
  387. echo getPlexRecent($plexArray);
  388. }
  389. ?>
  390. </div>
  391. </div>
  392. <div id="plexPlaylists" class="row">
  393. <div class="col-lg-12">
  394. <?php if(PLEXPLAYLISTS == "true"){ echo getPlexPlaylists($plexArray); } ?>
  395. </div>
  396. </div>
  397. <?php } ?>
  398. <?php if (qualifyUser(EMBYHOMEAUTH) && EMBYTOKEN) { ?>
  399. <div id="embyRowNowPlaying" class="row">
  400. <?php if(EMBYPLAYINGNOW == "true"){ echo getEmbyStreams(12, EMBYSHOWNAMES, $USER->role); } ?>
  401. </div>
  402. <div id="embyRow" class="row">
  403. <div class="col-lg-12">
  404. <?php
  405. if(EMBYRECENTMOVIE == "true" || EMBYRECENTTV == "true" || EMBYRECENTMUSIC == "true"){
  406. $embyArray = array("Movie" => EMBYRECENTMOVIE, "Episode" => EMBYRECENTTV, "MusicAlbum" => EMBYRECENTMUSIC, "Series" => EMBYRECENTTV);
  407. echo getEmbyRecent($embyArray);
  408. }
  409. ?>
  410. </div>
  411. </div>
  412. <?php } ?>
  413. <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
  414. <div id="calendarLegendRow" class="row" style="padding: 0 0 10px 0;">
  415. <div class="col-lg-12 content-form form-inline">
  416. <div class="form-group">
  417. <select class="form-control" id="imagetype_selector" style="width: auto !important; display: inline-block">
  418. <option value="all">View All</option>
  419. <?php if(RADARRURL != ""){ echo '<option value="film">Movies</option>'; }?>
  420. <?php if(SONARRURL != "" || SICKRAGEURL != ""){ echo '<option value="tv">TV Shows</option>'; }?>
  421. <?php if(HEADPHONESURL != ""){ echo '<option value="music">Music</option>'; }?>
  422. </select>
  423. <span class="label label-primary well-sm">Available</span>
  424. <span class="label label-danger well-sm">Unavailable</span>
  425. <span class="label indigo-bg well-sm">Unreleased</span>
  426. <span class="label light-blue-bg well-sm">Premier</span>
  427. </div>
  428. <!--
  429. <div class="pull-right">
  430. <div class="btn-group" role="group">
  431. <button type="button" class="btn waves btn-default btn-sm dropdown-toggle waves-effect waves-float" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">View All<span class="caret"></span></button>
  432. <ul style="right:0; left: auto" class="dropdown-menu">
  433. <li><a class="" href="javascript:void(0)">Movies</a></li>
  434. <li><a class="" href="javascript:void(0)">TV Shows</a></li>
  435. <li><a class="" href="javascript:void(0)">Music</a></li>
  436. </ul>
  437. </div>
  438. </div>-->
  439. </div>
  440. </div>
  441. <div id="calendarRow" class="row">
  442. <div class="col-lg-12">
  443. <div id="calendar" class="fc-calendar box-shadow fc fc-ltr fc-unthemed"></div>
  444. </div>
  445. </div>
  446. <?php } ?>
  447. </div>
  448. </div>
  449. <script>
  450. $('.close-btn').click(function(e){
  451. var closedBox = $(this).closest('div.content-box').remove();
  452. e.preventDefault();
  453. });
  454. $('#clearSearch').click(function(e){
  455. $('#searchInput').val("");
  456. $('#resultshere').html("");
  457. $('#searchInput').focus();
  458. e.preventDefault();
  459. });
  460. $(document).on("click", ".openTab", function(e) {
  461. var Title = $(this).attr("extraTitle");
  462. var Type = $(this).attr("extraType");
  463. var openTab = $(this).attr("openTab");
  464. var location = $(this).attr("href");
  465. if( Type === 'season' || Type === 'episode' || Type === 'show'){
  466. Type = "tv";
  467. SearchType = "show";
  468. }else if( Type === 'movie'){
  469. Type = "movie";
  470. SearchType = "movie";
  471. }
  472. if( Type === 'tv' || Type === 'movie' ){
  473. $('#calendarExtra').modal('show');
  474. var refreshBox = $('#calendarMainID');
  475. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  476. setTimeout(function(){
  477. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  478. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  479. refreshPreloader.remove();
  480. });
  481. },600);
  482. ajax_request('POST', 'tvdb-search', {
  483. name: Title,
  484. type: SearchType,
  485. }).done(function(data){
  486. if( data.trakt ) {
  487. $.ajax({
  488. type: 'GET',
  489. url: 'https://api.themoviedb.org/3/'+Type+'/'+data.trakt.tmdb+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  490. cache: true,
  491. async: true,
  492. complete: function(xhr, status) {
  493. var result = $.parseJSON(xhr.responseText);
  494. if (xhr.statusText === "OK") {
  495. if( Type === "movie"){
  496. $('#calendarTitle').html(result.title);
  497. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  498. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(result.runtime)+'</span>&nbsp;');
  499. $('#calendarSummary').text(result.overview);
  500. $('#calendarTagline').text(result.tagline);
  501. $('#calendarTrailer').html(convertTrailer(result.videos)+'&nbsp;<span class="label openPlex palette-Amber-600 bg" openTab="'+openTab+'" location="'+location+'" style="width:100%;display:block;cursor:pointer;"><i style="vertical-align:sub;" class="fa fa-play white"></i><text style="vertical-align:sub;"> Watch Now on PLEX</text></span>');
  502. $('#calendarCast').html(convertCast(result.credits));
  503. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  504. $('#calendarLang').html(convertArray(result.spoken_languages, "MOVIE"));
  505. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  506. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  507. $('#calendarExtra').modal('show');
  508. }else if (Type === "tv"){
  509. $('#calendarTitle').html(result.name);
  510. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  511. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(whatWasIt(result.episode_run_time))+'</span>&nbsp;');
  512. $('#calendarSummary').text(result.overview);
  513. $('#calendarTagline').text("");
  514. $('#calendarTrailer').html(convertTrailer(result.videos)+'&nbsp;<span class="label openPlex palette-Amber-600 bg" openTab="'+openTab+'" location="'+location+'" style="width:100%;display:block;cursor:pointer;"><i style="vertical-align:sub;" class="fa fa-play white"></i><text style="vertical-align:sub;"> Watch Now on PLEX</text></span>');
  515. $('#calendarCast').html(convertCast(result.credits));
  516. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  517. $('#calendarLang').html(convertArray(result.languages, "TV"));
  518. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  519. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  520. $('#calendarExtra').modal('show');
  521. }
  522. }
  523. }
  524. });
  525. }
  526. });
  527. e.preventDefault();
  528. }else{
  529. if($(this).attr("openTab") === "true") {
  530. var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
  531. var activeFrame = isActive.children('iframe');
  532. if(isActive.length === 1){
  533. activeFrame.attr("src", $(this).attr("href"));
  534. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  535. }else{
  536. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  537. parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']").children('iframe').attr("src", $(this).attr("href"));
  538. }
  539. e.preventDefault();
  540. }else{
  541. var source = $(this).attr("href");
  542. window.open(source, '_blank');
  543. }
  544. }
  545. });
  546. $(document).on("click", ".openPlex", function(e) {
  547. if($(this).attr("openTab") === "true") {
  548. var isActive = parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']");
  549. var activeFrame = isActive.children('iframe');
  550. if(isActive.length === 1){
  551. activeFrame.attr("src", $(this).attr("href"));
  552. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  553. }else{
  554. parent.$("li[name='<?php echo strtolower(PLEXTABNAME);?>']").trigger("click");
  555. parent.$("div[data-content-name^='<?php echo strtolower(PLEXTABNAME);?>']").children('iframe').attr("src", $(this).attr("location"));
  556. }
  557. }else{
  558. var source = $(this).attr("location");
  559. window.open(source, '_blank');
  560. }
  561. });
  562. function localStorageSupport() {
  563. return (('localStorage' in window) && window['localStorage'] !== null)
  564. }
  565. $( document ).ready(function() {
  566. $('#plexSearchForm').on('submit', function () {
  567. var refreshBox = $(this).closest('div.content-box');
  568. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  569. setTimeout(function(){
  570. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  571. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  572. refreshPreloader.remove();
  573. });
  574. },1000);
  575. ajax_request('POST', 'search-plex', {
  576. searchtitle: $('#plexSearchForm [name=search-title]').val(),
  577. }).done(function(data){ $('#resultshere').html(data);});
  578. });
  579. $('.repeat-btn').click(function(){
  580. var refreshBox = $(this).closest('div.content-box');
  581. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  582. setTimeout(function(){
  583. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  584. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  585. refreshPreloader.remove();
  586. });
  587. },1500);
  588. });
  589. $(document).on('click', '.w-refresh', function(){
  590. var id = $(this).attr("link");
  591. $("div[np^='"+id+"']").toggle();
  592. });
  593. $('div[class*=recentItems-]').each(function() {
  594. var name = $(this).attr("data-name");
  595. console.log(name);
  596. $(this).slick({
  597. slidesToShow: 13,
  598. slidesToScroll: 13,
  599. infinite: true,
  600. lazyLoad: 'ondemand',
  601. prevArrow: '<a class="zero-m pull-left prev-mail btn btn-default waves waves-button btn-sm waves-effect waves-float"><i class="fa fa-angle-left"></i></a>',
  602. nextArrow: '<a class="pull-left next-mail btn btn-default waves waves-button btn-sm waves-effect waves-float"><i class="fa fa-angle-right"></i></a>',
  603. appendArrows: $('.'+name),
  604. arrows: true,
  605. responsive: [
  606. {
  607. breakpoint: 1750,
  608. settings: {
  609. slidesToShow: 12,
  610. slidesToScroll: 12,
  611. }
  612. },
  613. {
  614. breakpoint: 1600,
  615. settings: {
  616. slidesToShow: 11,
  617. slidesToScroll: 11,
  618. }
  619. },
  620. {
  621. breakpoint: 1450,
  622. settings: {
  623. slidesToShow: 10,
  624. slidesToScroll: 10,
  625. }
  626. },
  627. {
  628. breakpoint: 1300,
  629. settings: {
  630. slidesToShow: 9,
  631. slidesToScroll: 9,
  632. }
  633. },
  634. {
  635. breakpoint: 1150,
  636. settings: {
  637. slidesToShow: 8,
  638. slidesToScroll: 8,
  639. }
  640. },
  641. {
  642. breakpoint: 1000,
  643. settings: {
  644. slidesToShow: 7,
  645. slidesToScroll: 7,
  646. }
  647. },
  648. {
  649. breakpoint: 850,
  650. settings: {
  651. slidesToShow: 6,
  652. slidesToScroll: 6,
  653. }
  654. },
  655. {
  656. breakpoint: 700,
  657. settings: {
  658. slidesToShow: 5,
  659. slidesToScroll: 5,
  660. }
  661. },
  662. {
  663. breakpoint: 675,
  664. settings: {
  665. slidesToShow: 4,
  666. slidesToScroll: 4
  667. }
  668. },
  669. {
  670. breakpoint: 480,
  671. settings: {
  672. slidesToShow: 3,
  673. slidesToScroll: 3
  674. }
  675. }
  676. // You can unslick at a given breakpoint now by adding:
  677. // settings: "unslick"
  678. // instead of a settings object
  679. ]
  680. });
  681. });
  682. //RECENT ITEMS
  683. // each filter we click on
  684. $(".filter-recent-event > li").on("click", function() {
  685. var name = $(this).attr('data-name');
  686. var filter = $(this).attr('data-filter');
  687. $('#recentContent-title').text('Recently Added '+name);
  688. // now filter the slides.
  689. if(filter !== 'item-all'){
  690. $('.recentItems-recent')
  691. .slick('slickUnfilter')
  692. .slick('slickFilter' , '.'+filter );
  693. }else{
  694. $('.recentItems-recent')
  695. .slick('slickUnfilter')
  696. }
  697. });
  698. //PLAYLIST SHIT
  699. // each filter we click on
  700. $(".filter-recent-playlist > li").on("click", function() {
  701. var name = $(this).attr('data-name');
  702. var filter = $(this).attr('data-filter');
  703. $('#playlist-title').text(name);
  704. // now filter the slides.
  705. $('.recentItems-playlists')
  706. .slick('slickUnfilter')
  707. .slick('slickFilter' , '.'+filter );
  708. });
  709. $("body").niceScroll({
  710. railpadding: {top:0,right:0,left:0,bottom:0},
  711. scrollspeed: 30,
  712. mousescrollstep: 60
  713. });
  714. $(".table-responsive").niceScroll({
  715. railpadding: {top:0,right:0,left:0,bottom:0},
  716. scrollspeed: 30,
  717. mousescrollstep: 60
  718. });
  719. $(".playlist-listing").niceScroll({
  720. railpadding: {top:0,right:0,left:0,bottom:0},
  721. scrollspeed: 30,
  722. mousescrollstep: 60
  723. });
  724. <?php if((NZBGETURL != "" && qualifyUser(NZBGETHOMEAUTH)) || (SABNZBDURL != "" && qualifyUser(SABNZBDHOMEAUTH))){ ?>
  725. var queueRefresh = <?php echo DOWNLOADREFRESH; ?>;
  726. var historyRefresh = <?php echo HISTORYREFRESH; ?>; // This really doesn't need to happen that often
  727. var queueLoad = function() {
  728. <?php if(SABNZBDURL != "") { echo '$("tbody.dl-queue.sabnzbd").load("ajax.php?a=sabnzbd-update&list=queue");'; } ?>
  729. <?php if(NZBGETURL != "") { echo '$("tbody.dl-queue.nzbget").load("ajax.php?a=nzbget-update&list=listgroups");'; } ?>
  730. };
  731. var historyLoad = function() {
  732. <?php if(SABNZBDURL != "") { echo '$("tbody.dl-history.sabnzbd").load("ajax.php?a=sabnzbd-update&list=history");'; } ?>
  733. <?php if(NZBGETURL != "") { echo '$("tbody.dl-history.nzbget").load("ajax.php?a=nzbget-update&list=history");'; } ?>
  734. };
  735. // Initial Loads
  736. queueLoad();
  737. historyLoad();
  738. // Interval Loads
  739. var queueInterval = setInterval(queueLoad, queueRefresh);
  740. var historyInterval = setInterval(historyLoad, historyRefresh);
  741. // Manual Load
  742. $("#getDownloader").click(function() {
  743. queueLoad();
  744. historyLoad();
  745. });
  746. <?php } ?>
  747. });
  748. $( window ).on( "load", function() {
  749. $( "ul.filter-recent-playlist > li:first" ).trigger("click");
  750. });
  751. </script>
  752. <?php if ((SONARRURL != "" && qualifyUser(SONARRHOMEAUTH)) || (RADARRURL != "" && qualifyUser(RADARRHOMEAUTH)) || (HEADPHONESURL != "" && qualifyUser(HEADPHONESHOMEAUTH)) || (SICKRAGEURL != "" && qualifyUser(SICKRAGEHOMEAUTH))) { ?>
  753. <script>
  754. $(function () {
  755. var date = new Date();
  756. var d = date.getDate();
  757. var m = date.getMonth();
  758. var y = date.getFullYear();
  759. $('#calendar').fullCalendar({
  760. eventLimit: false,
  761. firstDay: <?php echo CALENDARSTART;?>,
  762. height: "auto",
  763. defaultView: '<?php echo CALENDARVIEW;?>',
  764. header: {
  765. left: 'prev,next,',
  766. center: 'title',
  767. right: 'today, month, basicDay,basicWeek,'
  768. },
  769. views: {
  770. basicDay: { buttonText: '<?php echo $language->translate("DAY");?>', eventLimit: false },
  771. basicWeek: { buttonText: '<?php echo $language->translate("WEEK");?>', eventLimit: false },
  772. month: { buttonText: '<?php echo $language->translate("MONTH");?>', eventLimit: false },
  773. today: { buttonText: '<?php echo $language->translate("TODAY");?>' },
  774. },
  775. //events: [ <?php //echo getCalendar(); ?> ],
  776. eventRender: function eventRender( event, element, view ) {
  777. return ['all', event.imagetype].indexOf($('#imagetype_selector').val()) >= 0
  778. },
  779. editable: false,
  780. droppable: false,
  781. timeFormat: '<?php echo CALTIMEFORMAT; ?>',
  782. });
  783. });
  784. $('#imagetype_selector').on('change',function(){
  785. $('#calendar').fullCalendar('rerenderEvents');
  786. })
  787. $.ajax({
  788. type: 'GET',
  789. url: 'ajax.php?a=get-calendar',
  790. success: function(data)
  791. {
  792. newData = $.parseJSON(data);
  793. $('#calendar').fullCalendar('removeEvents');
  794. $('#calendar').fullCalendar('addEventSource', newData);
  795. console.log('Calendar Entries Added');
  796. }
  797. });
  798. setInterval(function() {
  799. $.ajax({
  800. type: 'GET',
  801. url: 'ajax.php?a=get-calendar',
  802. success: function(data)
  803. {
  804. newData = $.parseJSON(data);
  805. $('#calendar').fullCalendar('removeEvents');
  806. $('#calendar').fullCalendar('addEventSource', newData);
  807. console.log('Calendar refreshed');
  808. }
  809. });
  810. }, 60000);
  811. </script>
  812. <?php } ?>
  813. <script>
  814. function convertTime(a){
  815. if(a){
  816. var hours = Math.trunc(a/60);
  817. var minutes = a % 60;
  818. return hours+"h "+minutes+"m";
  819. }else{
  820. return "N/A";
  821. }
  822. }
  823. function convertArray(a, type){
  824. var result = "";
  825. var count = 1;
  826. var color = "";
  827. $.each( a, function( key, value ) {
  828. if (count == 1){ color = "gray"; }else{ color = "gray"; }
  829. if(type == "MOVIE"){
  830. result += '<span class="label label-'+color+'">'+value['name']+'</span>&nbsp;';
  831. }else if(type == "TV"){
  832. result += '<span class="label label-'+color+'">'+value+'</span>&nbsp;';
  833. }
  834. count++;
  835. });
  836. return result;
  837. }
  838. function convertTrailer(a){
  839. var result = "";
  840. var count = 1;
  841. $.each( a.results, function( key, value ) {
  842. if (count == 1){
  843. result += '<span id="openTrailer" style="cursor:pointer;width: 100%;display: block;" data-key="'+value['key']+'" data-name="'+value['name']+'" data-site="'+value['site']+'" class="label label-danger"><i style="vertical-align:sub;" class="fa fa-youtube-play" aria-hidden="true"></i><text style="vertical-align:sub;"> Watch Trailer</text></span>&nbsp;';
  844. }
  845. count++;
  846. });
  847. return result;
  848. }
  849. function convertCast(a){
  850. var result = "";
  851. var count = 1;
  852. $.each( a.cast, function( key, value ) {
  853. if( value['profile_path'] ){
  854. if (count <= 6){
  855. result += '<div class="col-lg-4 col-xs-4"><div class="zero-m"><img class="pull-left" style="border-radius:10%;margin-left: auto;margin-right: auto;display: block;" height="100px" src="https://image.tmdb.org/t/p/w150'+value['profile_path']+'" alt="profile"><h5 class="text-center"><strong>'+value['name']+'</strong></h5><h6 class="text-center">'+value['character']+'</h6></div></div>';
  856. count++;
  857. }
  858. }
  859. });
  860. return result;
  861. }
  862. function whatIsIt(a){
  863. var what = Object.prototype.toString;
  864. if(what.call(a) == "[object Array]"){
  865. return a[0].fileName;
  866. }else if(what.call(a) == "[object Object]"){
  867. return a.fileName;
  868. }
  869. }
  870. function whatWasIt(a){
  871. var what = Object.prototype.toString;
  872. if(what.call(a) == "[object Array]"){
  873. return a[0];
  874. }else if(what.call(a) == "[object Object]"){
  875. return a;
  876. }
  877. }
  878. $(document).on('click', "#openTrailer", function(){
  879. var key = $(this).attr("data-key");
  880. $('#iFrameYT').html('<iframe id="calendarYoutube" class="embed-responsive-item" src="https://www.youtube.com/embed/'+key+'" allowfullscreen=""></iframe>');
  881. $('#calendarVideo').modal('show');
  882. });
  883. $(document).on('click', "a[class*=ID-]", function(){
  884. $('#calendarExtra').modal('show');
  885. var refreshBox = $('#calendarMainID');
  886. $("<div class='refresh-preloader'><div class='la-timer la-dark'><div></div></div></div>").appendTo(refreshBox).fadeIn(300);
  887. setTimeout(function(){
  888. var refreshPreloader = refreshBox.find('.refresh-preloader'),
  889. deletedRefreshBox = refreshPreloader.fadeOut(300, function(){
  890. refreshPreloader.remove();
  891. });
  892. },600);
  893. var check = $(this).attr("class");
  894. var ID = check.split("--")[1];
  895. if (~check.indexOf("tvID")){
  896. var type = "TV";
  897. ajax_request('POST', 'tvdb-get', {
  898. id: ID,
  899. }).done(function(data){
  900. if( data.trakt ) {
  901. $.ajax({
  902. type: 'GET',
  903. url: 'https://api.themoviedb.org/3/tv/'+data.trakt.tmdb+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  904. cache: true,
  905. async: true,
  906. complete: function(xhr, status) {
  907. var result = $.parseJSON(xhr.responseText);
  908. if (xhr.statusText === "OK") {
  909. console.log(result);
  910. $('#calendarTitle').text(result.name);
  911. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  912. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(whatWasIt(result.episode_run_time))+'</span>&nbsp;');
  913. $('#calendarSummary').text(result.overview);
  914. $('#calendarTagline').text("");
  915. $('#calendarTrailer').html(convertTrailer(result.videos));
  916. $('#calendarCast').html(convertCast(result.credits));
  917. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  918. $('#calendarLang').html(convertArray(result.languages, "TV"));
  919. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  920. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  921. $('#calendarExtra').modal('show');
  922. }
  923. }
  924. });
  925. }else{
  926. $('#calendarTitle').text(data.series.seriesName);
  927. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+data.series.siteRating+'</span>&nbsp');
  928. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(data.series.runtime)+'</span>&nbsp;');
  929. $('#calendarSummary').text(data.series.overview);
  930. $('#calendarTagline').text("");
  931. $('#calendarTrailer').html("");
  932. $('#calendarCast').html("");
  933. $('#calendarGenres').html(convertArray(data.series.genre, "TV"));
  934. $('#calendarLang').html("");
  935. $('#calendarPoster').attr("src","https://thetvdb.com/banners/_cache/"+whatIsIt(data.poster));
  936. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(ajax.php?a=show-image&image=http://thetvdb.com/banners/"+whatIsIt(data.backdrop)+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  937. $('#calendarExtra').modal('show');
  938. }
  939. });
  940. }else if (~check.indexOf("movieID")){
  941. var type = "MOVIE";
  942. $.ajax({
  943. type: 'GET',
  944. url: 'https://api.themoviedb.org/3/movie/'+ID+'?api_key=83cf4ee97bb728eeaf9d4a54e64356a1&append_to_response=videos,credits',
  945. cache: true,
  946. async: true,
  947. complete: function(xhr, status) {
  948. var result = $.parseJSON(xhr.responseText);
  949. console.log(result);
  950. console.log(convertCast(result.credits));
  951. if (xhr.statusText === "OK") {
  952. $('#calendarTitle').text(result.title);
  953. $('#calendarRating').html('<span class="label label-gray"><i class="fa fa-thumbs-up white"></i> '+result.vote_average+'</span>&nbsp;');
  954. $('#calendarRuntime').html('<span class="label label-gray"><i class="fa fa-clock-o white"></i> '+convertTime(result.runtime)+'</span>&nbsp;');
  955. $('#calendarSummary').text(result.overview);
  956. $('#calendarTagline').text(result.tagline);
  957. $('#calendarTrailer').html(convertTrailer(result.videos));
  958. $('#calendarCast').html(convertCast(result.credits));
  959. $('#calendarGenres').html(convertArray(result.genres, "MOVIE"));
  960. $('#calendarLang').html(convertArray(result.spoken_languages, "MOVIE"));
  961. $('#calendarPoster').attr("src","https://image.tmdb.org/t/p/w300"+result.poster_path);
  962. $('#calendarMain').attr("style","background-size: cover; background: linear-gradient(rgba(25,27,29,.75),rgba(25,27,29,.75)),url(https://image.tmdb.org/t/p/w1000"+result.backdrop_path+");top: 0;left: 0;width: 100%;height: 100%;position: fixed;");
  963. $('#calendarExtra').modal('show');
  964. }
  965. }
  966. });
  967. }
  968. });
  969. </script>
  970. <div id="calendarExtra" class="modal fade in" tabindex="-1" role="dialog">
  971. <div class="modal-dialog modal-lg gray-bg" role="document">
  972. <div id="calendarMainID" class="modal-content">
  973. <div class="modal-content" id="calendarMain"></div>
  974. <div style="position: inherit; padding: 15px">
  975. <span id="calendarRuntime" class="pull-left"></span>
  976. <span id="calendarRating" class="pull-left"></span>
  977. <span id="calendarGenres" class="pull-right"></span>
  978. </div>
  979. <div class="modal-body">
  980. <div class="row">
  981. <div class="col-sm-4">
  982. <img style="width:100%;border-radius: 10px;box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);" id="calendarPoster" src="">
  983. </div>
  984. <div class="col-sm-8">
  985. <h2 id="calendarTitle" class="modal-title text-center">Modal title</h2>
  986. <h6 id="calendarTagline" class="modal-title text-center"><em>Modal title</em></h6>
  987. <p id="calendarSummary">Modal Summary</p>
  988. <div class="" id="calendarCast">Modal Summary</div>
  989. </div>
  990. </div>
  991. </div>
  992. <div style="position: inherit; padding: 15px 0px 30px 0px; margin-top: -20px;">
  993. <div class="col-sm-4">
  994. <span id="calendarTrailer" class="pull-left" style="width:100%;display: flex;"></span>
  995. </div>
  996. <div class="col-sm-8">
  997. <span id="calendarLang" class="pull-right"></span>
  998. </div>
  999. </div>
  1000. </div>
  1001. </div>
  1002. </div>
  1003. <div id="calendarVideo" class="modal fade in palette-Grey-900 bg" tabindex="-1" role="dialog">
  1004. <div class="modal-dialog modal-lg gray-bg" role="document">
  1005. <div id="calendarMainVideo" class="modal-content gray-bg">
  1006. <div class="">
  1007. <!-- 16:9 aspect ratio -->
  1008. <div id="iFrameYT" class="embed-responsive embed-responsive-16by9 gray-bg"></div>
  1009. </div>
  1010. </div>
  1011. </div>
  1012. </div>
  1013. </body>
  1014. </html>