Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Dev: added global setting for js debugging
- Loading branch information
Showing
17 changed files
with
2,744 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -400,8 +400,11 @@ public function renderHead(&$output) | |
} | ||
|
||
//Propagate our debug settings into the javascript realm | ||
$debug = Yii::app()->getConfig('debug', 0); | ||
$html .= "<script type='text/javascript'>window.debugState=".$debug.";</script>"; | ||
|
||
$debugFrontend = (int) getGlobalSetting('javascriptdebugfrntnd'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
olleharstedt
Collaborator
|
||
$debugBackend = (int) getGlobalSetting('javascriptdebugbcknd'); | ||
|
||
$html .= "<script type='text/javascript'>window.debugState = {frontend : (".$debugFrontend." === 1), backend : (".$debugBackend." === 1)};</script>"; | ||
|
||
if ($this->enableJavaScript) { | ||
if (isset($this->scriptFiles[self::POS_HEAD])) { | ||
|
@@ -530,11 +533,11 @@ public function renderBodyEnd(&$output) | |
} | ||
} | ||
if (App()->getConfig('debug') > 0) { | ||
$scripts[] = "jQuery(document).off('pjax:scriptsuccess.debugger').on('pjax:scriptsuccess.debugger',function(e) { console.log('PJAX scriptsuccess', e); });"; | ||
$scripts[] = "jQuery(document).off('pjax:scripterror.debugger').on('pjax:scripterror.debugger',function(e) { console.log('PJAX scripterror', e); });"; | ||
$scripts[] = "jQuery(document).off('pjax:scripttimeout.debugger').on('pjax:scripttimeout.debugger',function(e) { console.log('PJAX scripttimeout', e); });"; | ||
$scripts[] = "jQuery(document).off('pjax:success.debugger').on('pjax:success.debugger',function(e) { console.log('PJAX success', e);});"; | ||
$scripts[] = "jQuery(document).off('pjax:error.debugger').on('pjax:error.debugger',function(e) { console.log('PJAX error', e);});"; | ||
$scripts[] = "jQuery(document).off('pjax:scriptsuccess.debugger').on('pjax:scriptsuccess.debugger',function(e) { console.ls.log('PJAX scriptsuccess', e); });"; | ||
$scripts[] = "jQuery(document).off('pjax:scripterror.debugger').on('pjax:scripterror.debugger',function(e) { console.ls.log('PJAX scripterror', e); });"; | ||
$scripts[] = "jQuery(document).off('pjax:scripttimeout.debugger').on('pjax:scripttimeout.debugger',function(e) { console.ls.log('PJAX scripttimeout', e); });"; | ||
$scripts[] = "jQuery(document).off('pjax:success.debugger').on('pjax:success.debugger',function(e) { console.ls.log('PJAX success', e);});"; | ||
$scripts[] = "jQuery(document).off('pjax:error.debugger').on('pjax:error.debugger',function(e) { console.ls.log('PJAX error', e);});"; | ||
} | ||
|
||
//All scripts are wrapped into a section to be able to reload them accordingly | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
This breaks the installer. See Travis.