From 421ebeee1e907b62338b5c7067393be1154e6a54 Mon Sep 17 00:00:00 2001 From: Carsten Brandt Date: Sat, 4 Jan 2014 13:41:59 +0100 Subject: [PATCH] refactored debug toolbar assets also fixed problems with display on small screens. fixes #1747 --- extensions/yii/debug/DebugAsset.php | 1 + extensions/yii/debug/Module.php | 4 +- extensions/yii/debug/assets/main.css | 123 -------------- extensions/yii/debug/assets/toolbar.css | 188 +++++++++++++++++++++ extensions/yii/debug/assets/toolbar.js | 41 +++++ .../yii/debug/controllers/DefaultController.php | 1 + extensions/yii/debug/views/default/index.php | 2 +- extensions/yii/debug/views/default/toolbar.css | 178 ------------------- extensions/yii/debug/views/default/toolbar.js | 41 ----- extensions/yii/debug/views/default/toolbar.php | 3 +- extensions/yii/debug/views/default/view.php | 2 +- extensions/yii/debug/views/layouts/main.php | 4 +- 12 files changed, 239 insertions(+), 349 deletions(-) create mode 100644 extensions/yii/debug/assets/toolbar.css create mode 100644 extensions/yii/debug/assets/toolbar.js delete mode 100644 extensions/yii/debug/views/default/toolbar.css delete mode 100644 extensions/yii/debug/views/default/toolbar.js diff --git a/extensions/yii/debug/DebugAsset.php b/extensions/yii/debug/DebugAsset.php index 5b459a3..2d1b289 100644 --- a/extensions/yii/debug/DebugAsset.php +++ b/extensions/yii/debug/DebugAsset.php @@ -17,6 +17,7 @@ class DebugAsset extends AssetBundle public $sourcePath = '@yii/debug/assets'; public $css = [ 'main.css', + 'toolbar.css', ]; public $depends = [ 'yii\web\YiiAsset', diff --git a/extensions/yii/debug/Module.php b/extensions/yii/debug/Module.php index 6c1e6e0..fb0ac80 100644 --- a/extensions/yii/debug/Module.php +++ b/extensions/yii/debug/Module.php @@ -95,8 +95,8 @@ class Module extends \yii\base\Module echo ''; /** @var View $view */ $view = $event->sender; - echo ''; - echo ''; + echo ''; + echo ''; } protected function checkAccess() diff --git a/extensions/yii/debug/assets/main.css b/extensions/yii/debug/assets/main.css index 5987af1..428695a 100644 --- a/extensions/yii/debug/assets/main.css +++ b/extensions/yii/debug/assets/main.css @@ -1,126 +1,3 @@ -body { - padding-top: 60px; -} - -#yii-debug-toolbar { - position: fixed; - top: 0; - left: 0; - right: 0; - margin: 0 0 20px 0; - padding: 0; - z-index: 1000000; - font: 11px Verdana, Arial, sans-serif; - text-align: left; - height: 40px; - border-bottom: 1px solid #e4e4e4; - background: rgb(237,237,237); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); - background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); -} - -.yii-debug-toolbar-block { - float: left; - margin: 0; - border-right: 1px solid #e4e4e4; - padding: 4px 8px; - line-height: 32px; -} - -.yii-debug-toolbar-block.title { - font-size: 1.4em; -} - -.yii-debug-toolbar-block a { - text-decoration: none; - color: black; -} - -.yii-debug-toolbar-block span { -} - -.yii-debug-toolbar-block img { - vertical-align: middle; -} - -#yii-debug-toolbar .label { - display: inline-block; - padding: 2px 4px; - font-size: 11.844px; - font-weight: normal; - line-height: 14px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - white-space: nowrap; - vertical-align: baseline; - background-color: #999999; -} - -#yii-debug-toolbar .label { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -#yii-debug-toolbar .label:empty { - display: none; -} - -#yii-debug-toolbar a.label:hover, -#yii-debug-toolbar a.label:focus { - color: #ffffff; - text-decoration: none; - cursor: pointer; -} - -#yii-debug-toolbar .label-important { - background-color: #b94a48; -} - -#yii-debug-toolbar .label-important[href] { - background-color: #953b39; -} - -#yii-debug-toolbar .label-warning, -#yii-debug-toolbar .badge-warning { - background-color: #f89406; -} - -#yii-debug-toolbar .label-warning[href] { - background-color: #c67605; -} - -#yii-debug-toolbar .label-success { - background-color: #468847; -} - -#yii-debug-toolbar .label-success[href] { - background-color: #356635; -} - -#yii-debug-toolbar .label-info { - background-color: #3a87ad; -} - -#yii-debug-toolbar .label-info[href] { - background-color: #2d6987; -} - -#yii-debug-toolbar .label-inverse, -#yii-debug-toolbar .badge-inverse { - background-color: #333333; -} - -#yii-debug-toolbar .label-inverse[href], -#yii-debug-toolbar .badge-inverse[href] { - background-color: #1a1a1a; -} span.indent { color: #ccc; } diff --git a/extensions/yii/debug/assets/toolbar.css b/extensions/yii/debug/assets/toolbar.css new file mode 100644 index 0000000..1db9906 --- /dev/null +++ b/extensions/yii/debug/assets/toolbar.css @@ -0,0 +1,188 @@ +#yii-debug-toolbar { + padding: 0; + font: 11px Verdana, Arial, sans-serif; + text-align: left; + min-height: 40px; + overflow: auto; + background: rgb(237,237,237); + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); + background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); +} + +.yii-debug-toolbar-top { + border-bottom: 1px solid #e4e4e4; + margin: 0 0 20px 0; +} + +.yii-debug-toolbar-bottom { + position: fixed; + left: 0; + right: 0; + bottom: 0; + z-index: 1000000; + margin: 0; + border-top: 1px solid #ccc; +} + +.yii-debug-toolbar-block { + float: left; + margin: 0; + border-right: 1px solid #e4e4e4; + padding: 4px 8px; + line-height: 32px; + height: 40px; + white-space: nowrap; +} + +.yii-debug-toolbar-block a { + text-decoration: none; + color: black; +} + +.yii-debug-toolbar-block span { +} + +.yii-debug-toolbar-block img { + vertical-align: middle; +} + +#yii-debug-toolbar .label { + display: inline-block; + padding: 2px 4px; + font-size: 11.844px; + font-weight: normal; + line-height: 14px; + color: #ffffff; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); + white-space: nowrap; + vertical-align: baseline; + background-color: #999999; +} + +#yii-debug-toolbar .label { + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; +} + +#yii-debug-toolbar .label:empty { + display: none; +} + +#yii-debug-toolbar a.label:hover, +#yii-debug-toolbar a.label:focus { + color: #ffffff; + text-decoration: none; + cursor: pointer; +} + +#yii-debug-toolbar .label-important { + background-color: #b94a48; +} + +#yii-debug-toolbar .label-important[href] { + background-color: #953b39; +} + +#yii-debug-toolbar .label-warning, +#yii-debug-toolbar .badge-warning { + background-color: #f89406; +} + +#yii-debug-toolbar .label-warning[href] { + background-color: #c67605; +} + +#yii-debug-toolbar .label-success { + background-color: #468847; +} + +#yii-debug-toolbar .label-success[href] { + background-color: #356635; +} + +#yii-debug-toolbar .label-info { + background-color: #3a87ad; +} + +#yii-debug-toolbar .label-info[href] { + background-color: #2d6987; +} + +#yii-debug-toolbar .label-inverse, +#yii-debug-toolbar .badge-inverse { + background-color: #333333; +} + +#yii-debug-toolbar .label-inverse[href], +#yii-debug-toolbar .badge-inverse[href] { + background-color: #1a1a1a; +} + +.yii-debug-toolbar-toggler { + cursor: pointer; + position: absolute; + right: 10px; + bottom: 4px; + width: 15px; + height: 30px; + font-size: 25px; + font-weight: 100; + line-height: 28px; + color: #ffffff; + text-align: center; + background: #666666; + -webkit-border-radius: 12px; + -moz-border-radius: 12px; + border-radius: 12px; + opacity: 0.5; + filter: alpha(opacity=50); +} + +.yii-debug-toolbar-toggler:hover, +.yii-debug-toolbar-toggler:focus { + color: #ffffff; + text-decoration: none; + opacity: 0.9; + filter: alpha(opacity=90); +} + +#yii-debug-toolbar-min { + display: none; + position: fixed; + right: 0; + bottom: 0; + margin: 0; + padding: 0; + z-index: 1000000; + font: 11px Verdana, Arial, sans-serif; + text-align: left; + width: 63px; + height: 38px; + border-top: 1px solid #ccc; + border-left: 1px solid #ccc; + -webkit-border-top-left-radius: 6px; + -moz-border-top-left-radius: 6px; + border-top-left-radius: 6px; + background: rgb(237,237,237); + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); + background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); + background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); +} + +#yii-debug-toolbar-logo { + position: fixed; + right: 31px; + bottom: 4px; +} diff --git a/extensions/yii/debug/assets/toolbar.js b/extensions/yii/debug/assets/toolbar.js new file mode 100644 index 0000000..0dca1de --- /dev/null +++ b/extensions/yii/debug/assets/toolbar.js @@ -0,0 +1,41 @@ +(function() { + var ajax = function(url, settings) { + var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); + settings = settings || {}; + xhr.open(settings.method || 'GET', url, true); + xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); + xhr.onreadystatechange = function(state) { + if (xhr.readyState == 4) { + if (xhr.status == 200 && settings.success) { + settings.success(xhr); + } else if (xhr.status != 200 && settings.error) { + settings.error(xhr); + } + } + }; + xhr.send(settings.data || ''); + }; + + var e = document.getElementById('yii-debug-toolbar'); + if (e) { + e.style.display = 'block'; + var url = e.getAttribute('data-url'); + ajax(url, { + success: function(xhr) { + var div = document.createElement('div'); + div.innerHTML = xhr.responseText; + e.parentNode.replaceChild(div, e); + if (window.localStorage) { + var pref = localStorage.getItem('yii-debug-toolbar'); + if (pref == 'minimized') { + document.getElementById('yii-debug-toolbar').style.display = 'none'; + document.getElementById('yii-debug-toolbar-min').style.display = 'block'; + } + } + }, + error: function(xhr) { + e.innerHTML = xhr.responseText; + } + }); + } +})(); diff --git a/extensions/yii/debug/controllers/DefaultController.php b/extensions/yii/debug/controllers/DefaultController.php index 1542f67..521116c 100644 --- a/extensions/yii/debug/controllers/DefaultController.php +++ b/extensions/yii/debug/controllers/DefaultController.php @@ -75,6 +75,7 @@ class DefaultController extends Controller return $this->renderPartial('toolbar', [ 'tag' => $tag, 'panels' => $this->module->panels, + 'position' => 'bottom', ]); } diff --git a/extensions/yii/debug/views/default/index.php b/extensions/yii/debug/views/default/index.php index 73f5237..082eda7 100644 --- a/extensions/yii/debug/views/default/index.php +++ b/extensions/yii/debug/views/default/index.php @@ -14,7 +14,7 @@ use yii\data\ArrayDataProvider; $this->title = 'Yii Debugger'; ?>
-
+
Yii Debugger
diff --git a/extensions/yii/debug/views/default/toolbar.css b/extensions/yii/debug/views/default/toolbar.css deleted file mode 100644 index f1c2c45..0000000 --- a/extensions/yii/debug/views/default/toolbar.css +++ /dev/null @@ -1,178 +0,0 @@ -#yii-debug-toolbar { - position: fixed; - left: 0; - right: 0; - bottom: 0; - margin: 0; - padding: 0; - z-index: 1000000; - font: 11px Verdana, Arial, sans-serif; - text-align: left; - min-height: 40px; - border-top: 1px solid #ccc; - background: rgb(237,237,237); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); - background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); -} - -.yii-debug-toolbar-block { - float: left; - margin: 0; - border-right: 1px solid #e4e4e4; - padding: 4px 8px; - line-height: 32px; - height: 40px; -} - -.yii-debug-toolbar-block a { - text-decoration: none; - color: black; -} - -.yii-debug-toolbar-block span { -} - -.yii-debug-toolbar-block img { - vertical-align: middle; -} - -#yii-debug-toolbar .label { - display: inline-block; - padding: 2px 4px; - font-size: 11.844px; - font-weight: normal; - line-height: 14px; - color: #ffffff; - text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.25); - white-space: nowrap; - vertical-align: baseline; - background-color: #999999; -} - -#yii-debug-toolbar .label { - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; -} - -#yii-debug-toolbar .label:empty { - display: none; -} - -#yii-debug-toolbar a.label:hover, -#yii-debug-toolbar a.label:focus { - color: #ffffff; - text-decoration: none; - cursor: pointer; -} - -#yii-debug-toolbar .label-important { - background-color: #b94a48; -} - -#yii-debug-toolbar .label-important[href] { - background-color: #953b39; -} - -#yii-debug-toolbar .label-warning, -#yii-debug-toolbar .badge-warning { - background-color: #f89406; -} - -#yii-debug-toolbar .label-warning[href] { - background-color: #c67605; -} - -#yii-debug-toolbar .label-success { - background-color: #468847; -} - -#yii-debug-toolbar .label-success[href] { - background-color: #356635; -} - -#yii-debug-toolbar .label-info { - background-color: #3a87ad; -} - -#yii-debug-toolbar .label-info[href] { - background-color: #2d6987; -} - -#yii-debug-toolbar .label-inverse, -#yii-debug-toolbar .badge-inverse { - background-color: #333333; -} - -#yii-debug-toolbar .label-inverse[href], -#yii-debug-toolbar .badge-inverse[href] { - background-color: #1a1a1a; -} - -.yii-debug-toolbar-toggler { - cursor: pointer; - position: absolute; - right: 10px; - bottom: 4px; - width: 15px; - height: 30px; - font-size: 25px; - font-weight: 100; - line-height: 28px; - color: #ffffff; - text-align: center; - background: #666666; - -webkit-border-radius: 12px; - -moz-border-radius: 12px; - border-radius: 12px; - opacity: 0.5; - filter: alpha(opacity=50); -} - -.yii-debug-toolbar-toggler:hover, -.yii-debug-toolbar-toggler:focus { - color: #ffffff; - text-decoration: none; - opacity: 0.9; - filter: alpha(opacity=90); -} - -#yii-debug-toolbar-min { - display: none; - position: fixed; - right: 0; - bottom: 0; - margin: 0; - padding: 0; - z-index: 1000000; - font: 11px Verdana, Arial, sans-serif; - text-align: left; - width: 63px; - height: 38px; - border-top: 1px solid #ccc; - border-left: 1px solid #ccc; - -webkit-border-top-left-radius: 6px; - -moz-border-top-left-radius: 6px; - border-top-left-radius: 6px; - background: rgb(237,237,237); - background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2VkZWRlZCIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjUzJSIgc3RvcC1jb2xvcj0iI2Y2ZjZmNiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmZmZmYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); - background: -moz-linear-gradient(top, rgba(237,237,237,1) 0%, rgba(246,246,246,1) 53%, rgba(255,255,255,1) 100%); - background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(237,237,237,1)), color-stop(53%,rgba(246,246,246,1)), color-stop(100%,rgba(255,255,255,1))); - background: -webkit-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -o-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: -ms-linear-gradient(top, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - background: linear-gradient(to bottom, rgba(237,237,237,1) 0%,rgba(246,246,246,1) 53%,rgba(255,255,255,1) 100%); - filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ededed', endColorstr='#ffffff',GradientType=0 ); -} - -#yii-debug-toolbar-logo { - position: fixed; - right: 31px; - bottom: 4px; -} diff --git a/extensions/yii/debug/views/default/toolbar.js b/extensions/yii/debug/views/default/toolbar.js deleted file mode 100644 index 0dca1de..0000000 --- a/extensions/yii/debug/views/default/toolbar.js +++ /dev/null @@ -1,41 +0,0 @@ -(function() { - var ajax = function(url, settings) { - var xhr = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject('Microsoft.XMLHTTP'); - settings = settings || {}; - xhr.open(settings.method || 'GET', url, true); - xhr.setRequestHeader('X-Requested-With', 'XMLHttpRequest'); - xhr.onreadystatechange = function(state) { - if (xhr.readyState == 4) { - if (xhr.status == 200 && settings.success) { - settings.success(xhr); - } else if (xhr.status != 200 && settings.error) { - settings.error(xhr); - } - } - }; - xhr.send(settings.data || ''); - }; - - var e = document.getElementById('yii-debug-toolbar'); - if (e) { - e.style.display = 'block'; - var url = e.getAttribute('data-url'); - ajax(url, { - success: function(xhr) { - var div = document.createElement('div'); - div.innerHTML = xhr.responseText; - e.parentNode.replaceChild(div, e); - if (window.localStorage) { - var pref = localStorage.getItem('yii-debug-toolbar'); - if (pref == 'minimized') { - document.getElementById('yii-debug-toolbar').style.display = 'none'; - document.getElementById('yii-debug-toolbar-min').style.display = 'block'; - } - } - }, - error: function(xhr) { - e.innerHTML = xhr.responseText; - } - }); - } -})(); diff --git a/extensions/yii/debug/views/default/toolbar.php b/extensions/yii/debug/views/default/toolbar.php index 7d88822..6d3146f 100644 --- a/extensions/yii/debug/views/default/toolbar.php +++ b/extensions/yii/debug/views/default/toolbar.php @@ -3,6 +3,7 @@ * @var \yii\web\View $this * @var \yii\debug\Panel[] $panels * @var string $tag + * @var string $position */ use yii\debug\panels\ConfigPanel; @@ -24,7 +25,7 @@ EOD; $url = $panels['request']->getUrl(); ?> -
+
getSummary() ?> diff --git a/extensions/yii/debug/views/default/view.php b/extensions/yii/debug/views/default/view.php index c00f601..6b3bdca 100644 --- a/extensions/yii/debug/views/default/view.php +++ b/extensions/yii/debug/views/default/view.php @@ -16,7 +16,7 @@ use yii\helpers\Html; $this->title = 'Yii Debugger'; ?>
-
+
'Back to main debug page']) ?>
diff --git a/extensions/yii/debug/views/layouts/main.php b/extensions/yii/debug/views/layouts/main.php index 0f9a02c..b3a751f 100644 --- a/extensions/yii/debug/views/layouts/main.php +++ b/extensions/yii/debug/views/layouts/main.php @@ -7,9 +7,9 @@ use yii\helpers\Html; yii\debug\DebugAsset::register($this); ?> +beginPage() ?> -beginPage() ?> @@ -21,5 +21,5 @@ yii\debug\DebugAsset::register($this); endBody() ?> -endPage() ?> +endPage() ?>