CauseFX 5 ani în urmă
părinte
comite
bdd03f2df2
3 a modificat fișierele cu 21 adăugiri și 2 ștergeri
  1. 13 1
      api/homepage/trakt.php
  2. 8 1
      js/functions.js
  3. BIN
      plugins/images/tabs/trakt.png

+ 13 - 1
api/homepage/trakt.php

@@ -59,7 +59,19 @@ trait TraktHomepageItem
 						'name' => 'traktClientSecret',
 						'label' => 'Client Secret',
 						'value' => $this->config['traktClientSecret']
-					)
+					),
+					array(
+						'type' => 'blank',
+						'label' => 'Please Save before clicking button'
+					),
+					array(
+						'type' => 'button',
+						'label' => '',
+						'icon' => 'fa fa-user',
+						'class' => 'pull-right',
+						'text' => 'Connect Account',
+						'attr' => 'onclick="openOAuth(\'trakt\')"'
+					),
 				),
 				'Calendar' => array(
 					array(

+ 8 - 1
js/functions.js

@@ -8794,7 +8794,7 @@ const plex_oauth_loader = '<style>' +
     '<div class="login-loader-message">' +
     '<div class="login-loader"></div>' +
     '<br>' +
-    'Redirecting to the Plex login page...' +
+    'Redirecting to the login page...' +
     '</div>' +
     '</div>';
 function closePlexOAuthWindow() {
@@ -8882,6 +8882,13 @@ function PlexOAuth(success, error, pre) {
         }
     });
 }
+function openOAuth(provider){
+	// will actually fix this later
+	closePlexOAuthWindow();
+	plex_oauth_window = PopupCenter('', 'OAuth', 600, 700);
+	$(plex_oauth_window.document.body).html(plex_oauth_loader);
+	plex_oauth_window.location = 'api/v2/oauth/trakt';
+}
 function encodeData(data) {
     return Object.keys(data).map(function(key) {
         return [key, data[key]].map(encodeURIComponent).join("=");

BIN
plugins/images/tabs/trakt.png