Merge pull request #87 from assertchris/add-default-theme-kill-switch

Added default theme kill switch
This commit is contained in:
Damian Mooyman 2015-12-01 10:19:11 +13:00
commit 786ddd2d7b
1 changed files with 23 additions and 13 deletions

View File

@ -79,6 +79,13 @@ class DocumentationViewer extends Controller
*/
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,6 +96,8 @@ class DocumentationViewer extends Controller
if (!$this->canView()) {
return Security::permissionFailure($this);
}
if ($this->config()->apply_default_theme) {
Requirements::javascript('//use.typekit.net/emt4dhq.js');
Requirements::customScript('try{Typekit.load();}catch(e){}');
@ -105,6 +114,7 @@ class DocumentationViewer extends Controller
DOCSVIEWER_DIR .'/css/small.css'
));
}
}
/**
* Can the user view this documentation. Hides all functionality for private