Added default theme kill switch

This commit is contained in:
Christopher Pitt 2015-12-01 10:14:59 +13:00
parent 974f5b7b81
commit 13aefa8f48

View File

@ -79,6 +79,13 @@ class DocumentationViewer extends Controller
*/ */
private static $edit_links = array(); private static $edit_links = array();
/**
* Determines whether css and js files are injected into the document.
*
* @var bool
*/
private static $apply_default_theme = true;
/** /**
* *
*/ */
@ -89,21 +96,24 @@ class DocumentationViewer extends Controller
if (!$this->canView()) { if (!$this->canView()) {
return Security::permissionFailure($this); return Security::permissionFailure($this);
} }
Requirements::javascript('//use.typekit.net/emt4dhq.js');
Requirements::customScript('try{Typekit.load();}catch(e){}');
Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js'); if ($this->config()->apply_default_theme) {
Requirements::javascript('https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js'); Requirements::javascript('//use.typekit.net/emt4dhq.js');
Requirements::customScript('try{Typekit.load();}catch(e){}');
Requirements::javascript(DOCSVIEWER_DIR .'/javascript/DocumentationViewer.js'); Requirements::javascript(THIRDPARTY_DIR .'/jquery/jquery.js');
Requirements::combine_files('docs.css', array( Requirements::javascript('https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js');
DOCSVIEWER_DIR .'/css/normalize.css',
DOCSVIEWER_DIR .'/css/utilities.css', Requirements::javascript(DOCSVIEWER_DIR .'/javascript/DocumentationViewer.js');
DOCSVIEWER_DIR .'/css/typography.css', Requirements::combine_files('docs.css', array(
DOCSVIEWER_DIR .'/css/forms.css', DOCSVIEWER_DIR .'/css/normalize.css',
DOCSVIEWER_DIR .'/css/layout.css', DOCSVIEWER_DIR .'/css/utilities.css',
DOCSVIEWER_DIR .'/css/small.css' DOCSVIEWER_DIR .'/css/typography.css',
)); DOCSVIEWER_DIR .'/css/forms.css',
DOCSVIEWER_DIR .'/css/layout.css',
DOCSVIEWER_DIR .'/css/small.css'
));
}
} }
/** /**