瀏覽代碼

Added toggle to turn of organizr debug errors

causefx 7 年之前
父節點
當前提交
61b4795094
共有 3 個文件被更改,包括 13 次插入3 次删除
  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' => '',
 	'localIPFrom' => '',
 	'localIPTo' => '',
 	'localIPTo' => '',
 	'sandbox' => 'allow-presentation,allow-forms,allow-same-origin,allow-pointer-lock,allow-scripts,allow-popups,allow-modals,allow-top-navigation',
 	'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'] : '',
 			'githubCommit' => qualifyRequest(1) ? $GLOBALS['commit'] : '',
 			'schema' => qualifyRequest(1) ? getSchema() : '',
 			'schema' => qualifyRequest(1) ? getSchema() : '',
 			'debugArea' => qualifyRequest($GLOBALS['debugAreaAuth']),
 			'debugArea' => qualifyRequest($GLOBALS['debugAreaAuth']),
+			'debugErrors' => $GLOBALS['debugErrors'],
 			'sandbox' => $GLOBALS['sandbox'],
 			'sandbox' => $GLOBALS['sandbox'],
 		)
 		)
 	);
 	);
@@ -1093,6 +1094,12 @@ function getCustomizeAppearance()
 					'label' => 'Alternate Homepage Titles',
 					'label' => 'Alternate Homepage Titles',
 					'value' => $GLOBALS['alternateHomepageHeaders']
 					'value' => $GLOBALS['alternateHomepageHeaders']
 				),
 				),
+				array(
+					'type' => 'switch',
+					'name' => 'debugErrors',
+					'label' => 'Show Debug Errors',
+					'value' => $GLOBALS['debugErrors']
+				),
 				array(
 				array(
 					'type' => 'select',
 					'type' => 'select',
 					'name' => 'unsortedTabs',
 					'name' => 'unsortedTabs',

+ 4 - 2
js/functions.js

@@ -6728,8 +6728,10 @@ function checkIfTabNameExists(tabName){
     }
     }
 }
 }
 function orgErrorAlert(error){
 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(){
 function closeOrgError(){
     $('#main-org-error-container').removeClass('show');
     $('#main-org-error-container').removeClass('show');