Sfoglia il codice sorgente

Added toggle to turn of organizr debug errors

causefx 7 anni fa
parent
commit
61b4795094
3 ha cambiato i file con 13 aggiunte e 3 eliminazioni
  1. 2 1
      api/config/default.php
  2. 7 0
      api/functions/organizr-functions.php
  3. 4 2
      js/functions.js

+ 2 - 1
api/config/default.php

@@ -221,5 +221,6 @@ return array(
 	'localIPFrom' => '',
 	'localIPTo' => '',
 	'sandbox' => 'allow-presentation,allow-forms,allow-same-origin,allow-pointer-lock,allow-scripts,allow-popups,allow-modals,allow-top-navigation',
-	'description' => 'Organizr - Accept no others'
+	'description' => 'Organizr - Accept no others',
+	'debugErrors' => true
 );

+ 7 - 0
api/functions/organizr-functions.php

@@ -100,6 +100,7 @@ function organizrSpecialSettings()
 			'githubCommit' => qualifyRequest(1) ? $GLOBALS['commit'] : '',
 			'schema' => qualifyRequest(1) ? getSchema() : '',
 			'debugArea' => qualifyRequest($GLOBALS['debugAreaAuth']),
+			'debugErrors' => $GLOBALS['debugErrors'],
 			'sandbox' => $GLOBALS['sandbox'],
 		)
 	);
@@ -1093,6 +1094,12 @@ function getCustomizeAppearance()
 					'label' => 'Alternate Homepage Titles',
 					'value' => $GLOBALS['alternateHomepageHeaders']
 				),
+				array(
+					'type' => 'switch',
+					'name' => 'debugErrors',
+					'label' => 'Show Debug Errors',
+					'value' => $GLOBALS['debugErrors']
+				),
 				array(
 					'type' => 'select',
 					'name' => 'unsortedTabs',

+ 4 - 2
js/functions.js

@@ -6728,8 +6728,10 @@ function checkIfTabNameExists(tabName){
     }
 }
 function orgErrorAlert(error){
-    $('#main-org-error-container').addClass('show');
-    $('#main-org-error').html(error);
+    if(activeInfo.settings.misc.debugErrors) {
+        $('#main-org-error-container').addClass('show');
+        $('#main-org-error').html(error);
+    }
 }
 function closeOrgError(){
     $('#main-org-error-container').removeClass('show');