Olctw_Debug - Version 1.1.0

Version Notes

Just migrated the extension to be able to work under Magento community 1.7.0.0.

Download this release

Release Info

Developer Finjon Kiang
Extension Olctw_Debug
Version 1.1.0
Comparing to
See all releases


Version 1.1.0

Files changed (65) hide show
  1. app/code/community/Olctw/Debug/Block/Abstract.php +15 -0
  2. app/code/community/Olctw/Debug/Block/Blocks.php +38 -0
  3. app/code/community/Olctw/Debug/Block/Config.php +91 -0
  4. app/code/community/Olctw/Debug/Block/Controller.php +13 -0
  5. app/code/community/Olctw/Debug/Block/Debug.php +220 -0
  6. app/code/community/Olctw/Debug/Block/Layout.php +16 -0
  7. app/code/community/Olctw/Debug/Block/Models.php +46 -0
  8. app/code/community/Olctw/Debug/Block/Preferences.php +15 -0
  9. app/code/community/Olctw/Debug/Block/Versions.php +29 -0
  10. app/code/community/Olctw/Debug/Helper/Data.php +236 -0
  11. app/code/community/Olctw/Debug/Model/Observer.php +242 -0
  12. app/code/community/Olctw/Debug/controllers/IndexController.php +496 -0
  13. app/code/community/Olctw/Debug/controllers/PreferencesController.php +18 -0
  14. app/code/community/Olctw/Debug/etc/config.xml +197 -0
  15. app/code/community/Olctw/Debug/etc/system.xml +127 -0
  16. app/design/adminhtml/default/default/layout/olctw_debug/debug.xml +21 -0
  17. app/design/adminhtml/default/default/template/olctw_debug/arrayformat.phtml +34 -0
  18. app/design/adminhtml/default/default/template/olctw_debug/blocks.phtml +89 -0
  19. app/design/adminhtml/default/default/template/olctw_debug/config.phtml +58 -0
  20. app/design/adminhtml/default/default/template/olctw_debug/configsearch.phtml +26 -0
  21. app/design/adminhtml/default/default/template/olctw_debug/controller.phtml +148 -0
  22. app/design/adminhtml/default/default/template/olctw_debug/debug.phtml +65 -0
  23. app/design/adminhtml/default/default/template/olctw_debug/groupedclasssearch.phtml +28 -0
  24. app/design/adminhtml/default/default/template/olctw_debug/handledetails.phtml +33 -0
  25. app/design/adminhtml/default/default/template/olctw_debug/layout.phtml +85 -0
  26. app/design/adminhtml/default/default/template/olctw_debug/logdetails.phtml +21 -0
  27. app/design/adminhtml/default/default/template/olctw_debug/logs.phtml +10 -0
  28. app/design/adminhtml/default/default/template/olctw_debug/models.phtml +92 -0
  29. app/design/adminhtml/default/default/template/olctw_debug/performance.phtml +10 -0
  30. app/design/adminhtml/default/default/template/olctw_debug/preferences.phtml +18 -0
  31. app/design/adminhtml/default/default/template/olctw_debug/simplepanel.phtml +9 -0
  32. app/design/adminhtml/default/default/template/olctw_debug/utils.phtml +41 -0
  33. app/design/adminhtml/default/default/template/olctw_debug/versions.phtml +22 -0
  34. app/design/frontend/base/default/layout/olctw_debug/debug.xml +21 -0
  35. app/design/frontend/base/default/template/olctw_debug/arrayformat.phtml +34 -0
  36. app/design/frontend/base/default/template/olctw_debug/blocks.phtml +89 -0
  37. app/design/frontend/base/default/template/olctw_debug/config.phtml +58 -0
  38. app/design/frontend/base/default/template/olctw_debug/configsearch.phtml +26 -0
  39. app/design/frontend/base/default/template/olctw_debug/controller.phtml +148 -0
  40. app/design/frontend/base/default/template/olctw_debug/debug.phtml +65 -0
  41. app/design/frontend/base/default/template/olctw_debug/groupedclasssearch.phtml +28 -0
  42. app/design/frontend/base/default/template/olctw_debug/handledetails.phtml +33 -0
  43. app/design/frontend/base/default/template/olctw_debug/layout.phtml +85 -0
  44. app/design/frontend/base/default/template/olctw_debug/logdetails.phtml +21 -0
  45. app/design/frontend/base/default/template/olctw_debug/logs.phtml +10 -0
  46. app/design/frontend/base/default/template/olctw_debug/models.phtml +92 -0
  47. app/design/frontend/base/default/template/olctw_debug/performance.phtml +10 -0
  48. app/design/frontend/base/default/template/olctw_debug/preferences.phtml +18 -0
  49. app/design/frontend/base/default/template/olctw_debug/simplepanel.phtml +9 -0
  50. app/design/frontend/base/default/template/olctw_debug/utils.phtml +41 -0
  51. app/design/frontend/base/default/template/olctw_debug/versions.phtml +22 -0
  52. app/etc/modules/Olctw_Debug.xml +9 -0
  53. package.xml +18 -0
  54. skin/frontend/base/default/olctw_debug/css/toolbar.css +402 -0
  55. skin/frontend/base/default/olctw_debug/img/back.png +0 -0
  56. skin/frontend/base/default/olctw_debug/img/back_hover.png +0 -0
  57. skin/frontend/base/default/olctw_debug/img/close.png +0 -0
  58. skin/frontend/base/default/olctw_debug/img/close_hover.png +0 -0
  59. skin/frontend/base/default/olctw_debug/img/djdt_vertical.png +0 -0
  60. skin/frontend/base/default/olctw_debug/img/indicator.png +0 -0
  61. skin/frontend/base/default/olctw_debug/img/loader.gif +0 -0
  62. skin/frontend/base/default/olctw_debug/img/panel_bg.png +0 -0
  63. skin/frontend/base/default/olctw_debug/js/jquery.cookie.js +96 -0
  64. skin/frontend/base/default/olctw_debug/js/jquery.js +3180 -0
  65. skin/frontend/base/default/olctw_debug/js/toolbar.js +190 -0
app/code/community/Olctw/Debug/Block/Abstract.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Abstract extends Mage_Core_Block_Template {
4
+
5
+ const DEFAULT_STORE_ID = 1;
6
+
7
+ public function _getViewVars() {
8
+ return $this->_viewVars;
9
+ }
10
+
11
+ public function getShowTemplateHints() {
12
+ return false;
13
+ }
14
+
15
+ }
app/code/community/Olctw/Debug/Block/Blocks.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Blocks extends Olctw_Debug_Block_Abstract {
4
+
5
+ public function getItems() {
6
+ $blocks = Mage::getSingleton('debug/observer')->getBlocks();
7
+ return $blocks;
8
+ }
9
+
10
+ public function getLayoutBlocks() {
11
+ return Mage::getSingleton('debug/observer')->getLayoutBlocks();
12
+ }
13
+
14
+ public function getTemplateDirs() {
15
+ return array(Mage::getBaseDir('design'));
16
+ }
17
+
18
+ public function getViewBlockUrl($blockClass) {
19
+ return Mage::getUrl('debug/index/viewBlock', array(
20
+ 'block' => $blockClass,
21
+ '_store' => self::DEFAULT_STORE_ID,
22
+ '_nosid' => true));
23
+ }
24
+
25
+ public function getViewTemplateUrl($template) {
26
+ return Mage::getUrl('debug/index/viewTemplate', array(
27
+ '_query' => array('template' => $template),
28
+ '_store' => self::DEFAULT_STORE_ID,
29
+ '_nosid' => true));
30
+ }
31
+
32
+ public function getRenderingTime($block) {
33
+ if (array_key_exists('rendered_in', $block)) {
34
+ return number_format($block['rendered_in'], 3);
35
+ }
36
+ }
37
+
38
+ }
app/code/community/Olctw/Debug/Block/Config.php ADDED
@@ -0,0 +1,91 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Config extends Olctw_Debug_Block_Abstract {
4
+
5
+ static function xml2array($xml, &$arr, $parentKey = '') {
6
+ if (!$xml)
7
+ return;
8
+
9
+ if (count($xml->children()) == 0) {
10
+ $arr[$parentKey] = (string) $xml;
11
+ } else {
12
+ foreach ($xml->children() as $key => $item) {
13
+ $key = $parentKey ? $parentKey . DS . $key : $key;
14
+ self::xml2array($item, $arr, $key);
15
+ }
16
+ }
17
+ }
18
+
19
+ public function getToggleHintsUrl($forStore = null) {
20
+ if (!$forStore) {
21
+ $forStore = Mage::app()->getStore()->getId();
22
+ }
23
+
24
+ return Mage::getUrl('debug/index/toggleTemplateHints', array(
25
+ 'store' => $forStore,
26
+ '_store' => self::DEFAULT_STORE_ID,
27
+ '_nosid' => true));
28
+ }
29
+
30
+ public function getToggleTranslateHintsUrl($forStore = null) {
31
+ if (!$forStore) {
32
+ $forStore = Mage::app()->getStore()->getId();
33
+ }
34
+
35
+ return Mage::getUrl('debug/index/toggleTranslateInline', array(
36
+ 'store' => $forStore,
37
+ '_store' => self::DEFAULT_STORE_ID,
38
+ '_nosid' => true));
39
+ }
40
+
41
+ public function getDownloadConfigUrl() {
42
+ return Mage::getUrl('debug/index/downloadConfig', array(
43
+ '_store' => self::DEFAULT_STORE_ID,
44
+ '_nosid' => true));
45
+ }
46
+
47
+ public function getDownloadConfigAsTextUrl() {
48
+ return Mage::getUrl('debug/index/downloadConfigAsText', array(
49
+ '_store' => self::DEFAULT_STORE_ID,
50
+ '_nosid' => true));
51
+ }
52
+
53
+ public function getSearchConfigUrl() {
54
+ return Mage::getUrl('debug/index/searchConfig', array(
55
+ '_store' => self::DEFAULT_STORE_ID,
56
+ '_nosid' => true));
57
+ }
58
+
59
+ public function hasFullPageCache() {
60
+ return class_exists('Enterprise_PageCache_Model_Processor', false);
61
+ }
62
+
63
+ /**
64
+ * FIXME: Find a better idea
65
+ * Currently not very useful because FPC is caching our block and status is displayed incorrectly.
66
+ *
67
+ * @return string
68
+ */
69
+ public function getFullPacheDebugStatus() {
70
+ if ($this->hasFullPageCache()) {
71
+ return Mage::getStoreConfig(Enterprise_PageCache_Model_Processor::XML_PATH_CACHE_DEBUG) ? $this->__('Now: On') :
72
+ $this->__('Now: Off');
73
+ } else {
74
+ return '';
75
+ }
76
+ }
77
+
78
+ public function getFullPageDebugUrl($forStore = null) {
79
+ if (!$forStore) {
80
+ $forStore = Mage::app()->getStore()->getId();
81
+ }
82
+
83
+ return Mage::getUrl('debug/index/togglePageCacheDebug', array('store' => $forStore,
84
+ 'query' => rand(0, 1000000), // To bypass fpc
85
+ '_store' => self::DEFAULT_STORE_ID,
86
+ '_nosid' => true
87
+ )
88
+ );
89
+ }
90
+
91
+ }
app/code/community/Olctw/Debug/Block/Controller.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Controller extends Olctw_Debug_Block_Abstract {
4
+
5
+ protected function getItems() {
6
+ return Mage::getSingleton('debug/debug')->getBlocks();
7
+ }
8
+
9
+ protected function getTemplateDirs() {
10
+ return NULL;
11
+ }
12
+
13
+ }
app/code/community/Olctw/Debug/Block/Debug.php ADDED
@@ -0,0 +1,220 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Debug extends Olctw_Debug_Block_Abstract {
4
+
5
+ public function _prepareLayout() {
6
+ return parent::_prepareLayout();
7
+ }
8
+
9
+ public function renderView() {
10
+ // Render Debug toolbar only if allowed
11
+ if (Mage::helper('debug')->isRequestAllowed()) {
12
+ return parent::renderView();
13
+ }
14
+ }
15
+
16
+ public function getVersion() {
17
+ return (string) Mage::getConfig()->getNode('modules/Olctw_Debug/version');
18
+ }
19
+
20
+ private function createDummyPanel($title) {
21
+ $panel = array(
22
+ 'title' => $title,
23
+ 'has_content' => true,
24
+ 'url' => NULL,
25
+ 'dom_id' => 'debug-panel-' . $title,
26
+ 'nav_title' => $title,
27
+ 'nav_subtitle' => 'Subtitle for ' . $title,
28
+ 'content' => 'Some content for ' . $title,
29
+ 'template' => 'olctw_debug_versions_panel'
30
+ );
31
+ return $panel;
32
+ }
33
+
34
+ protected function createVersionsPanel() {
35
+ $title = 'Versions';
36
+ $content = '';
37
+ $panel = array(
38
+ 'title' => $title,
39
+ 'has_content' => true,
40
+ 'url' => NULL,
41
+ 'dom_id' => 'debug-panel-' . $title,
42
+ 'nav_title' => $title,
43
+ 'nav_subtitle' => 'Magento modules',
44
+ 'template' => 'olctw_debug_versions_panel', // child block defined in layout xml
45
+ );
46
+ return $panel;
47
+ }
48
+
49
+ protected function createPerformancePanel() {
50
+ $title = 'Performance';
51
+ $helper = Mage::helper('debug');
52
+ $panel = array(
53
+ 'title' => $title,
54
+ 'has_content' => true,
55
+ 'url' => NULL,
56
+ 'dom_id' => 'debug-panel-' . $title,
57
+ 'nav_title' => $title,
58
+ 'nav_subtitle' => "TIME: {$helper->getScriptDuration()}s MEM: {$helper->getMemoryUsage()}",
59
+ 'template' => 'olctw_debug_performance_panel',
60
+ );
61
+ return $panel;
62
+ }
63
+
64
+ protected function createConfigPanel() {
65
+ $title = 'Configuration';
66
+ $content = '';
67
+ $panel = array(
68
+ 'title' => $title,
69
+ 'has_content' => true,
70
+ 'url' => NULL,
71
+ 'dom_id' => 'debug-panel-' . $title,
72
+ 'nav_title' => $title,
73
+ 'nav_subtitle' => "Search configurations",
74
+ 'template' => 'olctw_debug_config_panel', // child block defined in layout xml
75
+ );
76
+ return $panel;
77
+ }
78
+
79
+ protected function createBlocksPanel() {
80
+ $title = 'Blocks';
81
+ $nBlocks = count(Mage::getSingleton('debug/observer')->getBlocks());
82
+
83
+ $panel = array(
84
+ 'title' => $title,
85
+ 'has_content' => true,
86
+ 'url' => NULL,
87
+ 'dom_id' => 'debug-panel-' . $title,
88
+ 'nav_title' => $title,
89
+ 'nav_subtitle' => "{$nBlocks} used blocks",
90
+ 'template' => 'olctw_debug_blocks_panel', // child block defined in layout xml
91
+ );
92
+ return $panel;
93
+ }
94
+
95
+ protected function createLayoutPanel() {
96
+ $title = 'Layout';
97
+ $panel = array(
98
+ 'title' => $title,
99
+ 'has_content' => true,
100
+ 'url' => NULL,
101
+ 'dom_id' => 'debug-panel-' . $title,
102
+ 'nav_title' => $title,
103
+ 'nav_subtitle' => "Layout handlers",
104
+ 'template' => 'olctw_debug_layout_panel', // child block defined in layout xml
105
+ );
106
+ return $panel;
107
+ }
108
+
109
+ protected function createControllerPanel() {
110
+ $title = 'Controller';
111
+ $content = '';
112
+ $panel = array(
113
+ 'title' => $title,
114
+ 'has_content' => true,
115
+ 'url' => NULL,
116
+ 'dom_id' => 'debug-panel-' . $title,
117
+ 'nav_title' => $title,
118
+ 'nav_subtitle' => 'Controller and request',
119
+ 'template' => 'olctw_debug_controller_panel', // child block defined in layout xml
120
+ );
121
+ return $panel;
122
+ }
123
+
124
+ protected function createModelsPanel() {
125
+ $title = 'Models';
126
+ $nModels = count(Mage::getSingleton('debug/observer')->getModels());
127
+ $nQueries = count(Mage::getSingleton('debug/observer')->getQueries());
128
+ $panel = array(
129
+ 'title' => $title,
130
+ 'has_content' => true,
131
+ 'url' => NULL,
132
+ 'dom_id' => 'debug-panel-' . $title,
133
+ 'nav_title' => $title,
134
+ 'nav_subtitle' => "{$nModels} models, {$nQueries} queries",
135
+ 'template' => 'olctw_debug_models_panel', // child block defined in layout xml
136
+ );
137
+ return $panel;
138
+ }
139
+
140
+ protected function createUtilsPanel() {
141
+ $title = 'Utilities';
142
+
143
+ $panel = array(
144
+ 'title' => $title,
145
+ 'has_content' => true,
146
+ 'url' => NULL,
147
+ 'dom_id' => 'debug-panel-' . $title,
148
+ 'nav_title' => $title,
149
+ 'nav_subtitle' => "Quick actions",
150
+ 'template' => 'olctw_debug_utils_panel', // child block defined in layout xml
151
+ );
152
+ return $panel;
153
+ }
154
+
155
+ protected function createLogsPanel() {
156
+ $title = 'Logs';
157
+
158
+ $panel = array(
159
+ 'title' => $title,
160
+ 'has_content' => true,
161
+ 'url' => NULL,
162
+ 'dom_id' => 'debug-panel-' . $title,
163
+ 'nav_title' => $title,
164
+ 'nav_subtitle' => "View logs",
165
+ 'template' => 'olctw_debug_logs_panel', // child block defined in layout xml
166
+ );
167
+ return $panel;
168
+ }
169
+
170
+ protected function createPreferencesPanel() {
171
+ $title = 'Preferences';
172
+ $panel = array(
173
+ 'title' => $title,
174
+ 'has_content' => true,
175
+ 'url' => NULL,
176
+ 'dom_id' => 'debug-panel-' . $title,
177
+ 'nav_title' => $title,
178
+ 'nav_subtitle' => "Customize Magneto Debug",
179
+ 'template' => 'olctw_debug_preferences_panel', // child block defined in layout xml
180
+ );
181
+ return $panel;
182
+ }
183
+
184
+ public function getPanels() {
185
+ $panels = array();
186
+ $panels[] = $this->createVersionsPanel();
187
+ $panels[] = $this->createPerformancePanel();
188
+ $panels[] = $this->createConfigPanel();
189
+ $panels[] = $this->createControllerPanel();
190
+ $panels[] = $this->createModelsPanel();
191
+ $panels[] = $this->createLayoutPanel();
192
+ $panels[] = $this->createBlocksPanel();
193
+ $panels[] = $this->createUtilsPanel();
194
+ $panels[] = $this->createLogsPanel();
195
+ // TODO: Implement preferences panel (toggle panels visibility from toolbar)
196
+ // $panels[] = $this->createPreferencesPanel();
197
+
198
+ return $panels;
199
+ }
200
+
201
+ public function getVisiblePanels() {
202
+ /* @var $helper Olctw_Debug_Helper_Data */
203
+ $helper = Mage::helper('debug');
204
+ $panels = $this->getPanels();
205
+ $visiblePanels = array();
206
+
207
+ foreach ($panels as $panel) {
208
+ if ($helper->isPanelVisible($panel['title'])) {
209
+ $visiblePanels[] = $panel;
210
+ }
211
+ }
212
+
213
+ return $visiblePanels;
214
+ }
215
+
216
+ public function getDebugMediaUrl() {
217
+ return Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'frontend/base/default/olctw_debug/';
218
+ }
219
+
220
+ }
app/code/community/Olctw/Debug/Block/Layout.php ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Layout extends Olctw_Debug_Block_Abstract {
4
+
5
+ public function getViewHandleUrl($layoutHandle) {
6
+ $designPackage = Mage::getSingleton('core/design_package');
7
+
8
+ return $this->getUrl('debug/index/viewFilesWithHandle', array(
9
+ 'layout' => $layoutHandle,
10
+ 'storeId' => $designPackage->getStore()->getId(),
11
+ 'area' => $designPackage->getArea(),
12
+ '_store' => self::DEFAULT_STORE_ID
13
+ ));
14
+ }
15
+
16
+ }
app/code/community/Olctw/Debug/Block/Models.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Models extends Olctw_Debug_Block_Abstract {
4
+
5
+ const SQL_SELECT_ACTION = 'viewSqlSelect';
6
+ const SQL_EXPLAIN_ACTION = 'viewSqlExplain';
7
+
8
+ protected function getItems() {
9
+ return Mage::getSingleton('debug/observer')->getModels();
10
+ }
11
+
12
+ protected function getQueries() {
13
+ return Mage::getSingleton('debug/observer')->getQueries();
14
+ }
15
+
16
+ protected function getCollections() {
17
+ return Mage::getSingleton('debug/observer')->getCollections();
18
+ }
19
+
20
+ /**
21
+ * $viewType can be 'Select' or 'Explain'
22
+ * @param \Zend_Db_Profiler_Query $query
23
+ * @param string $viewType
24
+ * @return string
25
+ */
26
+ protected function getSqlUrl(Zend_Db_Profiler_Query $query, $viewType = self::SQL_SELECT_ACTION) {
27
+ $queryType = $query->getQueryType();
28
+ if ($queryType == Zend_Db_Profiler::SELECT) {
29
+ return Mage::getUrl('debug/index/' . $viewType, array(
30
+ '_query' => array('sql' => $query->getQuery(), 'params' => $query->getQueryParams()),
31
+ '_store' => self::DEFAULT_STORE_ID
32
+ ));
33
+ } else {
34
+ return '';
35
+ }
36
+ }
37
+
38
+ public function getSqlSelectUrl(Zend_Db_Profiler_Query $query) {
39
+ return $this->getSqlUrl($query, self::SQL_SELECT_ACTION);
40
+ }
41
+
42
+ public function getSqlExplainUrl(Zend_Db_Profiler_Query $query) {
43
+ return $this->getSqlUrl($query, self::SQL_EXPLAIN_ACTION);
44
+ }
45
+
46
+ }
app/code/community/Olctw/Debug/Block/Preferences.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Preferences extends Olctw_Debug_Block_Abstract {
4
+
5
+ public function getPanels() {
6
+ /* @var $debugBlock Olctw_Debug_Block_Debug */
7
+ $debugBlock = $this->getParentBlock();
8
+ return $debugBlock->getPanels();
9
+ }
10
+
11
+ public function getFormUrl() {
12
+ return Mage::getUrl('debug/preferences/updatePost');
13
+ }
14
+
15
+ }
app/code/community/Olctw/Debug/Block/Versions.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Block_Versions extends Olctw_Debug_Block_Abstract {
4
+
5
+ protected function getItems() {
6
+ $items = array();
7
+ $items[] = array(
8
+ 'module' => 'Magento',
9
+ 'codePool' => 'core',
10
+ 'active' => true,
11
+ 'version' => Mage::getVersion());
12
+
13
+ $modulesConfig = Mage::getConfig()->getModuleConfig();
14
+ foreach ($modulesConfig as $node) {
15
+ foreach ($node as $module => $data) {
16
+ $items[] = array(
17
+ "module" => $module,
18
+ "codePool" => $data->codePool,
19
+ "active" => $data->active,
20
+ "version" => $data->version
21
+ );
22
+ }
23
+ }
24
+
25
+ return $items;
26
+ }
27
+
28
+ }
29
+
app/code/community/Olctw/Debug/Helper/Data.php ADDED
@@ -0,0 +1,236 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Helper_Data extends Mage_Core_Helper_Abstract {
4
+
5
+ /**
6
+ * Cleans Magento's cache
7
+ *
8
+ * @return void
9
+ */
10
+ public function cleanCache() {
11
+ Mage::app()->cleanCache();
12
+ }
13
+
14
+ /**
15
+ * Check if client's ip is whitelisted
16
+ *
17
+ * @return bool
18
+ */
19
+ function isRequestAllowed() {
20
+ $isDebugEnable = (int) Mage::getStoreConfig('debug/options/enable');
21
+ $clientIp = $this->_getRequest()->getClientIp();
22
+ $allow = false;
23
+
24
+ if ($isDebugEnable) {
25
+ $allow = true;
26
+
27
+ // Code copy-pasted from core/helper, isDevAllowed method
28
+ // I cannot use that method because the client ip is not always correct (e.g varnish)
29
+ $allowedIps = Mage::getStoreConfig('dev/restrict/allow_ips');
30
+ if ($isDebugEnable && !empty($allowedIps) && !empty($clientIp)) {
31
+ $allowedIps = preg_split('#\s*,\s*#', $allowedIps, null, PREG_SPLIT_NO_EMPTY);
32
+ if (array_search($clientIp, $allowedIps) === false
33
+ && array_search(Mage::helper('core/http')->getHttpHost(), $allowedIps) === false) {
34
+ $allow = false;
35
+ }
36
+ }
37
+ }
38
+
39
+ return $allow;
40
+ }
41
+
42
+ /**
43
+ * Return readable file size
44
+ *
45
+ * @param int $size size in bytes
46
+ *
47
+ * @return string
48
+ */
49
+ function formatSize($size) {
50
+ $sizes = array(" Bytes", " KB", " MB", " GB", " TB", " PB", " EB", " ZB", " YB");
51
+ if ($size == 0) {
52
+ return('n/a');
53
+ } else {
54
+ return ( round($size / pow(1024, ($i = floor(log($size, 1024)))), 2) . $sizes[$i]);
55
+ }
56
+ }
57
+
58
+ public function getMemoryUsage() {
59
+ return $this->formatSize(memory_get_peak_usage(TRUE));
60
+ }
61
+
62
+ public function getScriptDuration() {
63
+ if (function_exists('xdebug_time_index')) {
64
+ return sprintf("%0.2f", xdebug_time_index());
65
+ } else {
66
+ return 'n/a';
67
+ }
68
+ }
69
+
70
+ public static function sortModelCmp($a, $b) {
71
+ if ($a['occurrences'] == $b['occurrences'])
72
+ return 0;
73
+ return ($a['occurrences'] < $b['occurrences']) ? 1 : -1;
74
+ }
75
+
76
+ public function sortModelsByOccurrences(&$models) {
77
+ usort($models, array('Olctw_Debug_Helper_Data', 'sortModelCmp'));
78
+ }
79
+
80
+ public function getBlockFilename($blockClass) {
81
+ return mageFindClassFile($blockClass);
82
+ }
83
+
84
+ /**
85
+ * Returns all xml files that contains layout updates.
86
+ *
87
+ * @param int|null $storeId store identifier
88
+ *
89
+ * @param $designArea
90
+ * @return array
91
+ */
92
+ function getLayoutUpdatesFiles($storeId, $designArea) {
93
+ if (null === $storeId) {
94
+ $storeId = Mage::app()->getStore()->getId();
95
+ }
96
+ $updatesRoot = Mage::app()->getConfig()->getNode($designArea . '/layout/updates');
97
+
98
+ // Find files with layout updates
99
+ $updateFiles = array();
100
+ foreach ($updatesRoot->children() as $updateNode) {
101
+ if ($updateNode->file) {
102
+ $module = $updateNode->getAttribute('module');
103
+ if ($module && Mage::getStoreConfigFlag('advanced/modules_disable_output/' . $module, $storeId)) {
104
+ continue;
105
+ }
106
+ $updateFiles[] = (string) $updateNode->file;
107
+ }
108
+ }
109
+ // custom local layout updates file - load always last
110
+ $updateFiles[] = 'local.xml';
111
+
112
+ return $updateFiles;
113
+ }
114
+
115
+ /**
116
+ * Read last lines of file (able to read huge file)
117
+ *
118
+ * @param string $file
119
+ * @param int $lines
120
+ * @param null|string $header
121
+ *
122
+ * @return array|int
123
+ */
124
+ public function getLastRows($file, $lines, $header = null) {
125
+ // Number of lines read per time
126
+ $bufferlength = 1024;
127
+ $aliq = "";
128
+ $line_arr = array();
129
+ $tmp = array();
130
+ $tmp2 = array();
131
+
132
+ if (!($handle = fopen($file, "r"))) {
133
+ return "Could not fopen $file";
134
+ }
135
+
136
+ if (!$handle) {
137
+ return "Bad file handle";
138
+ }
139
+
140
+ // Get size of file
141
+ fseek($handle, 0, SEEK_END);
142
+ $filesize = ftell($handle);
143
+
144
+ $position = - min($bufferlength, $filesize);
145
+
146
+ while ($lines > 0) {
147
+ if (fseek($handle, $position, SEEK_END)) {
148
+ return "Could not fseek";
149
+ }
150
+
151
+ unset($buffer);
152
+ $buffer = "";
153
+ // Read some data starting fromt he end of the file
154
+ if (!($buffer = fread($handle, $bufferlength))) {
155
+ return "File is empty";
156
+ }
157
+
158
+ // Split by line
159
+ $cnt = (count($tmp) - 1);
160
+ for ($i = 0; $i < count($tmp); $i++) {
161
+ unset($tmp[0]);
162
+ }
163
+ unset($tmp);
164
+ $tmp = explode("\n", $buffer);
165
+
166
+ // Handle case of partial previous line read
167
+ if ($aliq != "") {
168
+ $tmp[count($tmp) - 1] .= $aliq;
169
+ }
170
+
171
+ unset($aliq);
172
+ // Take out the first line which may be partial
173
+ $aliq = array_shift($tmp);
174
+ $read = count($tmp);
175
+
176
+ // Read too much (exceeded indicated lines to read)
177
+ if ($read >= $lines) {
178
+ // Slice off the lines we need and merge with current results
179
+ unset($tmp2);
180
+ $tmp2 = array_slice($tmp, $read - $lines);
181
+ $line_arr = array_merge($tmp2, $line_arr);
182
+
183
+ // Discard the header line if it is there
184
+ if ($header &&
185
+ (count($line_arr) <= $lines)) {
186
+ array_shift($line_arr);
187
+ }
188
+
189
+ // Break the loop
190
+ $lines = 0;
191
+ }
192
+ // Reached start of file
193
+ elseif (-$position >= $filesize) {
194
+ // Get back $aliq which contains the very first line of the file
195
+ unset($tmp2);
196
+ $tmp2[0] = $aliq;
197
+
198
+ $line_arr = array_merge($tmp2, $tmp, $line_arr);
199
+
200
+ // Discard the header line if it is there
201
+ if ($header &&
202
+ (count($line_arr) <= $lines)) {
203
+ array_shift($line_arr);
204
+ }
205
+
206
+ // Break the loop
207
+ $lines = 0;
208
+ }
209
+ // Continue reading
210
+ else {
211
+ // Add the freshly grabbed lines on top of the others
212
+ $line_arr = array_merge($tmp, $line_arr);
213
+ $lines -= $read;
214
+
215
+ // No longer a full buffer's worth of data to read
216
+ if ($position - $bufferlength < -$filesize) {
217
+ $bufferlength = $filesize + $position;
218
+ $position = -$filesize;
219
+ }
220
+ // Still >= $bufferlength worth of data to read
221
+ else {
222
+ $position -= $bufferlength;
223
+ }
224
+ }
225
+ }
226
+
227
+ fclose($handle);
228
+
229
+ return $line_arr;
230
+ }
231
+
232
+ public function isPanelVisible($panelTitle) {
233
+ return Mage::getStoreConfig('debug/options/debug_panel_' . strtolower($panelTitle) . '_visibility');
234
+ }
235
+
236
+ }
app/code/community/Olctw/Debug/Model/Observer.php ADDED
@@ -0,0 +1,242 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_Model_Observer {
4
+
5
+ private $_actions = array();
6
+ // List of assoc array with class, type and sql keys
7
+ private $collections = array();
8
+ // private $layoutUpdates = array();
9
+ private $models = array();
10
+ private $blocks = array();
11
+ private $layoutBlocks = array();
12
+
13
+ public function getModels() {
14
+ return $this->models;
15
+ }
16
+
17
+ public function getBlocks() {
18
+ return $this->blocks;
19
+ }
20
+
21
+ public function getLayoutBlocks() {
22
+ return $this->layoutBlocks;
23
+ }
24
+
25
+ public function getCollections() {
26
+ return $this->collections;
27
+ }
28
+
29
+ // public function getLayoutUpdates() { return $this->layoutUpdates; }
30
+
31
+ /**
32
+ *
33
+ * TODO: Make this a setting
34
+ *
35
+ * @return bool
36
+ */
37
+ protected function _skipCoreBlocks() {
38
+ return false;
39
+ }
40
+
41
+ /**
42
+ * Logic that checks if we should ignore this block
43
+ *
44
+ * @param $block Mage_Core_Block_Abstract
45
+ * @return bool
46
+ */
47
+ protected function _skipBlock($block) {
48
+ $blockClass = get_class($block);
49
+
50
+ if ($this->_skipCoreBlocks() && strpos($blockClass, 'Mage_') === 0) {
51
+ return true;
52
+ }
53
+
54
+ // Don't list blocks from Debug module
55
+ if (strpos($blockClass, 'Olctw_Debug_Block') === 0) {
56
+ return true;
57
+ }
58
+
59
+ return false;
60
+ }
61
+
62
+ public function getQueries() {
63
+ //TODO: implement profiler for connections other than 'core_write'
64
+ $profiler = Mage::getSingleton('core/resource')->getConnection('core_write')->getProfiler();
65
+ $queries = array();
66
+
67
+ if ($profiler) {
68
+ $queries = $profiler->getQueryProfiles();
69
+ }
70
+
71
+ return $queries;
72
+ }
73
+
74
+ public function onLayoutGenerate(Varien_Event_Observer $observer) {
75
+ $layout = $observer->getEvent()->getLayout();
76
+ $layoutBlocks = $layout->getAllBlocks();
77
+
78
+ // After layout generates all the blocks
79
+ foreach ($layoutBlocks as $block) {
80
+ $blockStruct = array();
81
+ $blockStruct['class'] = get_class($block);
82
+ $blockStruct['layout_name'] = $block->getNameInLayout();
83
+ if (method_exists($block, 'getTemplateFile')) {
84
+ $blockStruct['template'] = $block->getTemplateFile();
85
+ } else {
86
+ $blockStruct['template'] = '';
87
+ }
88
+ if (method_exists($block, 'getViewVars')) {
89
+ $blockStruct['context'] = $block->getViewVars();
90
+ } else {
91
+ $blockStruct['context'] = NULL;
92
+ }
93
+ $this->layoutBlocks[] = $blockStruct;
94
+ }
95
+ }
96
+
97
+ /**
98
+ * Listens to core_block_abstract_to_html_before event and records blocks
99
+ * that are about to being rendered.
100
+ *
101
+ * @param Varien_Event_Observer $observer
102
+ * @return Olctw_Debug_Model_Observer
103
+ */
104
+ public function onBlockToHtml(Varien_Event_Observer $observer) {
105
+ /** @var $event Varien_Event */
106
+ $event = $observer->getEvent();
107
+ /* @var $block Mage_Core_Block_Abstract */
108
+ $block = $event->getBlock();
109
+
110
+ if ($this->_skipBlock($block)) {
111
+ return $this;
112
+ }
113
+
114
+ $blockStruct = array();
115
+ $blockStruct['class'] = get_class($block);
116
+ $blockStruct['layout_name'] = $block->getNameInLayout();
117
+ $blockStruct['rendered_at'] = microtime(true);
118
+
119
+ if (method_exists($block, 'getTemplateFile')) {
120
+ $blockStruct['template'] = $block->getTemplateFile();
121
+ } else {
122
+ $blockStruct['template'] = '';
123
+ }
124
+ if (method_exists($block, 'getViewVars')) {
125
+ $blockStruct['context'] = $block->getViewVars();
126
+ } else {
127
+ $blockStruct['context'] = NULL;
128
+ }
129
+
130
+ $this->blocks[$block->getNameInLayout()] = $blockStruct;
131
+
132
+ return $this;
133
+ }
134
+
135
+ /**
136
+ * Listens to core_block_abstract_to_html_after event end computes the time
137
+ * spent in block's _toHtml (rendering time).
138
+ *
139
+ * @param Varien_Event_Observer $observer
140
+ * @return Olctw_Debug_Model_Observer
141
+ */
142
+ public function onBlockToHtmlAfter(Varien_Event_Observer $observer) {
143
+ $event = $observer->getEvent();
144
+ /* @var $block Mage_Core_Block_Abstract */
145
+ $block = $event->getBlock();
146
+
147
+ // Don't list blocks from Debug module
148
+ if ($this->_skipBlock($block)) {
149
+ return $this;
150
+ }
151
+
152
+ $blockStruct = $this->blocks[$block->getNameInLayout()];
153
+
154
+ $duration = microtime(true) - $blockStruct['rendered_at'];
155
+ $this->blocks[$block->getNameInLayout()]['rendered_in'] = $duration;
156
+ }
157
+
158
+ function onActionPostDispatch(Varien_Event_Observer $event) {
159
+ $action = $event->getControllerAction();
160
+
161
+ $actionStruct = array();
162
+ $actionStruct['class'] = get_class($action);
163
+ $actionStruct['action_name'] = $action->getFullActionName();
164
+ $actionStruct['route_name'] = $action->getRequest()->getRouteName();
165
+
166
+ $this->_actions[] = $actionStruct;
167
+ }
168
+
169
+ // controller_action_layout_generate_blocks_after
170
+ function onCollectionLoad(Varien_Event_Observer $event) {
171
+ /** @var Mage_Core_Model_Mysql4_Store_Collection */
172
+ $collection = $event->getCollection();
173
+
174
+ $collectionStruct = array();
175
+ $collectionStruct['sql'] = $collection->getSelectSql(true);
176
+ $collectionStruct['type'] = 'mysql';
177
+ $collectionStruct['class'] = get_class($collection);
178
+ $this->collections[] = $collectionStruct;
179
+ }
180
+
181
+ function onEavCollectionLoad(Varien_Event_Observer $event) {
182
+ $collection = $event->getCollection();
183
+ $sqlStruct = array();
184
+ $sqlStruct['sql'] = $collection->getSelectSql(true);
185
+ $sqlStruct['type'] = 'eav';
186
+ $sqlStruct['class'] = get_class($collection);
187
+ $this->collections[] = $sqlStruct;
188
+ }
189
+
190
+ /* function onPrepareLayout(Varien_Event_Observer $observer){
191
+ $block = $observer->getEvent()->getBlock();
192
+ var_dump(array_keys($observer->getEvent()->getData()));
193
+ // Mage::log('onPrepareLayout: ' . get_class($observer) . 'block=";
194
+
195
+ $layoutUpdate = array();
196
+ $layoutUpdate['block'] = get_class($observer->getBlock());
197
+ $layoutUpdate['name'] = get_class($observer->getName());
198
+ $this->layoutUpdates[] = $layoutUpdate;
199
+ } */
200
+
201
+ function onModelLoad(Varien_Event_Observer $observer) {
202
+ $event = $observer->getEvent();
203
+ $object = $event->getObject();
204
+ $key = get_class($object);
205
+
206
+ if (array_key_exists($key, $this->models)) {
207
+ $this->models[$key]['occurrences']++;
208
+ } else {
209
+ $model = array();
210
+ $model['class'] = get_class($object);
211
+ $model['resource_name'] = $object->getResourceName();
212
+ $model['occurrences'] = 1;
213
+ $this->models[$key] = $model;
214
+ }
215
+
216
+ return $this;
217
+ }
218
+
219
+ /**
220
+ * We listen to this event to filter access to actions defined by Debug module.
221
+ * We allow only actions if debug toolbar is on and ip is listed in Developer Client Restrictions
222
+ *
223
+ * @param Varien_Event_Observer $observer
224
+ *
225
+ * @return void
226
+ */
227
+ function onActionPreDispatch(Varien_Event_Observer $observer) {
228
+ $action = $observer->getEvent()->getControllerAction();
229
+ $moduleName = $action->getRequest()->getControllerModule();
230
+ if (strpos($moduleName, "Olctw_Debug") === 0 && !Mage::helper('debug')->isRequestAllowed()) {
231
+
232
+ Mage::log("Access to Olctw_Debug's actions blocked: dev mode is set to false.");
233
+ // $response = $action->getResponse();
234
+ // $response->setHttpResponseCode(404);
235
+ // $response->setBody('Site access denied.');
236
+ //$action->setDispatched(true)
237
+ //
238
+ exit();
239
+ }
240
+ }
241
+
242
+ }
app/code/community/Olctw/Debug/controllers/IndexController.php ADDED
@@ -0,0 +1,496 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_IndexController extends Mage_Core_Controller_Front_Action {
4
+
5
+ /**
6
+ * Return block content
7
+ *
8
+ * @param string $title block title
9
+ * @param string $content body content
10
+ *
11
+ * @return string
12
+ */
13
+ private function _debugPanel($title, $content) {
14
+ $block = $this->getLayout()->createBlock('debug/abstract');
15
+ $block->setTemplate('olctw_debug/simplepanel.phtml');
16
+ $block->assign('title', $title);
17
+ $block->assign('content', $content);
18
+ return $block->toHtml();
19
+ }
20
+
21
+ /**
22
+ * @param null $defaultUrl
23
+ * @return Mage_Core_Controller_Varien_Action
24
+ */
25
+ protected function _redirectReferer($defaultUrl = null) {
26
+ if ($store = $this->getRequest()->getParam('store')) {
27
+ Mage::app()->setCurrentStore($store);
28
+ }
29
+ return parent::_redirectReferer($defaultUrl);
30
+ }
31
+
32
+ /**
33
+ * Show source code of template
34
+ *
35
+ * @return string
36
+ */
37
+ public function viewTemplateAction() {
38
+ $fileName = $this->getRequest()->get('template');
39
+
40
+ $absoluteFilePath = realpath(Mage::getBaseDir('design') . DS . $fileName);
41
+ $source = highlight_string(file_get_contents($absoluteFilePath), true);
42
+
43
+ $content = $this->_debugPanel("Template Source: <code>$fileName</code>", $source);
44
+ $this->getResponse()->setBody($content);
45
+ }
46
+
47
+ /**
48
+ * Show source code of block
49
+ *
50
+ * @return string
51
+ */
52
+ public function viewBlockAction() {
53
+ $blockClass = $this->getRequest()->get('block');
54
+ $absoluteFilePath = Mage::helper('debug')->getBlockFilename($blockClass);
55
+
56
+ $source = highlight_string(file_get_contents($absoluteFilePath), true);
57
+
58
+ $content = $this->_debugPanel("Block Source: <code>{$blockClass}</code>", $source);
59
+ $this->getResponse()->setBody($content);
60
+ }
61
+
62
+ /**
63
+ * View sql query
64
+ *
65
+ * @return void
66
+ */
67
+ public function viewSqlSelectAction() {
68
+ $con = Mage::getSingleton('core/resource')->getConnection('core_write');
69
+ $query = $this->getRequest()->getParam('sql');
70
+ $queryParams = $this->getRequest()->getParam('params');
71
+
72
+ $result = $con->query($query, $queryParams);
73
+
74
+ $items = array();
75
+ $headers = array();
76
+ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
77
+ $items[] = $row;
78
+
79
+ if (empty($headers)) {
80
+ $headers = array_keys($row);
81
+ }
82
+ }
83
+
84
+ $block = $this->getLayout()->createBlock('debug/abstract');
85
+ $block->setTemplate('olctw_debug/arrayformat.phtml');
86
+ $block->assign('title', 'SQL Select');
87
+ $block->assign('headers', $headers);
88
+ $block->assign('items', $items);
89
+ $block->assign('query', $query);
90
+ $this->getResponse()->setBody($block->toHtml());
91
+ }
92
+
93
+ /**
94
+ * @return void
95
+ */
96
+ public function viewFilesWithHandleAction() {
97
+ $layoutHandle = $this->getRequest()->getParam('layout');
98
+ $storeId = $this->getRequest()->getParam('storeId');
99
+ $designArea = $this->getRequest()->getParam('area');
100
+
101
+ $title = "Files with layout updates for handle {$layoutHandle}";
102
+ if (!$layoutHandle) {
103
+
104
+ }
105
+
106
+ $updateFiles = Mage::helper('debug')->getLayoutUpdatesFiles($storeId, $designArea);
107
+
108
+ /* @var $designPackage Mage_Core_Model_Design_Package */
109
+ $designPackage = Mage::getModel('core/design_package');
110
+ $designPackage->setStore(Mage::app()->getStore($storeId));
111
+ $designPackage->setArea($designArea);
112
+
113
+ // search handle in these files
114
+ $handleFiles = array();
115
+ foreach ($updateFiles as $file) {
116
+ $filename = $designPackage->getLayoutFilename($file, array(
117
+ '_area' => $designPackage->getArea(),
118
+ '_package' => $designPackage->getPackageName(),
119
+ '_theme' => $designPackage->getTheme('layout')
120
+ ));
121
+ if (!is_readable($filename)) {
122
+ continue;
123
+ }
124
+ $fileStr = file_get_contents($filename);
125
+
126
+ $fileXml = simplexml_load_string($fileStr, Mage::getConfig()->getModelClassName('core/layout_element'));
127
+ if (!$fileXml instanceof SimpleXMLElement) {
128
+ continue;
129
+ }
130
+
131
+ $result = $fileXml->xpath("/layout/" . $layoutHandle);
132
+ if ($result) {
133
+ $handleFiles[$filename] = $result;
134
+ }
135
+ }
136
+
137
+ // Search updates for handle in DB
138
+ $bind = array(
139
+ 'store_id' => $storeId,
140
+ 'area' => $designArea,
141
+ 'package' => $designPackage->getPackageName(),
142
+ 'theme' => $designPackage->getTheme('layout'),
143
+ 'layout_update_handle' => $layoutHandle
144
+ );
145
+
146
+ /* @var $layoutResourceModel Mage_Core_Model_Resource_Layout */
147
+ $layoutResourceModel = Mage::getResourceModel('core/layout');
148
+
149
+ /* @var $readAdapter Varien_Db_Adapter_Pdo_Mysql */
150
+ $readAdapter = Mage::getSingleton('core/resource')->getConnection('core_read');
151
+
152
+ /* @var $select Varien_Db_Select */
153
+ $select = $readAdapter->select()
154
+ ->from(array('layout_update' => $layoutResourceModel->getMainTable()), array('xml'))
155
+ ->join(array('link' => $layoutResourceModel->getTable('core/layout_link')), 'link.layout_update_id=layout_update.layout_update_id', '')
156
+ ->where('link.store_id IN (0, :store_id)')
157
+ ->where('link.area = :area')
158
+ ->where('link.package = :package')
159
+ ->where('link.theme = :theme')
160
+ ->where('layout_update.handle = :layout_update_handle')
161
+ ->order('layout_update.sort_order ' . Varien_Db_Select::SQL_ASC);
162
+
163
+ $result = $readAdapter->fetchCol($select, $bind);
164
+
165
+ if (count($result)) {
166
+ $handleFiles['DATABASE'] = array();
167
+ foreach ($result as $dbLayoutUpdate) {
168
+ $handleFiles['DATABASE'][] = new Varien_Simplexml_Element($dbLayoutUpdate);
169
+ }
170
+ }
171
+
172
+ $block = $this->getLayout()->createBlock('debug/abstract');
173
+ $block->setTemplate('olctw_debug/handledetails.phtml');
174
+ $block->assign('title', $title);
175
+ $block->assign('handleFiles', $handleFiles);
176
+
177
+ $this->getResponse()->setBody($block->toHtml());
178
+ }
179
+
180
+ /**
181
+ * Show explain of sql query
182
+ *
183
+ * @return void
184
+ */
185
+ public function viewSqlExplainAction() {
186
+ $con = Mage::getSingleton('core/resource')->getConnection('core_write');
187
+ $query = $this->getRequest()->getParam('sql');
188
+ $queryParams = $this->getRequest()->getParam('params');
189
+
190
+ $result = $con->query("EXPLAIN {$query}", $queryParams);
191
+
192
+ $items = array();
193
+ $headers = array();
194
+ while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
195
+ $items[] = $row;
196
+
197
+ if (empty($headers)) {
198
+ $headers = array_keys($row);
199
+ }
200
+ }
201
+
202
+ $block = $this->getLayout()->createBlock('debug/abstract');
203
+ $block->setTemplate('olctw_debug/arrayformat.phtml');
204
+ $block->assign('title', 'SQL Explain');
205
+ $block->assign('headers', $headers);
206
+ $block->assign('items', $items);
207
+ $block->assign('query', $query);
208
+
209
+ $this->getResponse()->setBody($block->toHtml());
210
+ }
211
+
212
+ /**
213
+ * Clear Magento cache
214
+ *
215
+ * @return void
216
+ */
217
+ public function clearCacheAction() {
218
+ $content = Mage::helper('debug')->cleanCache();
219
+ Mage::getSingleton('core/session')->addSuccess("Magento's caches were cleared.");
220
+ $this->_redirectReferer();
221
+ }
222
+
223
+ /**
224
+ * Turn on/off translate inline
225
+ *
226
+ * @return void
227
+ */
228
+ public function toggleTranslateInlineAction() {
229
+ $forStore = $this->getRequest()->getParam('store', 1);
230
+
231
+ $currentStatus = Mage::getStoreConfig('dev/translate_inline/active', $forStore);
232
+ $newStatus = !$currentStatus;
233
+
234
+ $config = Mage::app()->getConfig();
235
+ $config->saveConfig('dev/translate_inline/active', $newStatus, 'stores', $forStore);
236
+ $config->saveConfig('dev/translate_inline/active_admin', $newStatus, 'stores', $forStore);
237
+
238
+ // Toggle translate cache too
239
+ $allTypes = Mage::app()->useCache();
240
+ $allTypes['translate'] = !$newStatus; // Cache off when translate is on
241
+ Mage::app()->saveUseCache($allTypes);
242
+
243
+ // clear cache
244
+ Mage::app()->cleanCache(array(Mage_Core_Model_Config::CACHE_TAG, Mage_Core_Model_Translate::CACHE_TAG));
245
+
246
+ Mage::getSingleton('core/session')->addSuccess('Translate inline set to ' . var_export($newStatus, true));
247
+ $this->_redirectReferer();
248
+ }
249
+
250
+ /**
251
+ * Turn on/off template hints
252
+ *
253
+ * @return void
254
+ */
255
+ public function toggleTemplateHintsAction() {
256
+ $forStore = $this->getRequest()->getParam('store', 1);
257
+
258
+ $currentStatus = Mage::app()->getStore($forStore)->getConfig('dev/debug/template_hints');
259
+ $newStatus = !$currentStatus;
260
+
261
+ $config = Mage::getModel('core/config');
262
+ $config->saveConfig('dev/debug/template_hints', $newStatus, 'stores', $forStore);
263
+ $config->saveConfig('dev/debug/template_hints_blocks', $newStatus, 'stores', $forStore);
264
+ Mage::app()->cleanCache(array(Mage_Core_Model_Config::CACHE_TAG));
265
+
266
+ Mage::getSingleton('core/session')->addSuccess('Template hints set to ' . var_export($newStatus, true));
267
+
268
+ $this->_redirectReferer();
269
+ }
270
+
271
+ /**
272
+ * Turn on/off modules
273
+ *
274
+ * @return Olctw_Debug_IndexController|string
275
+ */
276
+ public function toggleModuleStatusAction() {
277
+ $title = "Toggle Module Status";
278
+ $moduleName = $this->getRequest()->getParam('module');
279
+ if (!$moduleName) {
280
+ echo $this->_debugPanel($title, "Invalid module name supplied. ");
281
+ return;
282
+ }
283
+ $config = Mage::getConfig();
284
+
285
+ $moduleConfig = Mage::getConfig()->getModuleConfig($moduleName);
286
+ if (!$moduleConfig) {
287
+ echo $this->_debugPanel($title, "Unable to load supplied module. ");
288
+ return;
289
+ }
290
+
291
+ $moduleCurrentStatus = $moduleConfig->is('active');
292
+ $moduleNewStatus = !$moduleCurrentStatus;
293
+ $moduleConfigFile = $config->getOptions()->getEtcDir() . DS . 'modules' . DS . $moduleName . '.xml';
294
+ $configContent = file_get_contents($moduleConfigFile);
295
+
296
+ function strbool($value) {
297
+ return $value ? 'true' : 'false';
298
+ }
299
+
300
+ $contents = '<br/>Active status switched to ' . (string) $moduleNewStatus . ' for module {$moduleName} in file {$moduleConfigFile}:';
301
+ $contents .= '<br/><code>' . htmlspecialchars($configContent) . '</code>';
302
+
303
+ $configContent = str_replace('<active>' . (string) $moduleCurrentStatus . '</active>', '<active>' . (string) $moduleNewStatus . '</active>', $configContent);
304
+
305
+ if (file_put_contents($moduleConfigFile, $configContent) === FALSE) {
306
+ echo $this->_debugPanel($title, "Failed to write configuration. (Web Server's permissions for {$moduleConfigFile}?!)");
307
+ return $this;
308
+ }
309
+
310
+ Mage::helper('debug')->cleanCache();
311
+
312
+ $contents .= '<br/><code>' . htmlspecialchars($configContent) . '</code>';
313
+ $contents .= '<br/><br/><i>WARNING: This feature doesn\'t support usage of multiple frontends.</i>';
314
+
315
+ $this->getResponse()->setBody($this->_debugPanel($title, $contents));
316
+ }
317
+
318
+ /**
319
+ * Download config as XML file
320
+ *
321
+ * @return string
322
+ */
323
+ public function downloadConfigAction() {
324
+ $this->getResponse()->setHeader('Content-type', 'text/xml', true);
325
+ $this->getResponse()->setBody(Mage::app()->getConfig()->getNode()->asXML());
326
+ }
327
+
328
+ /**
329
+ * Download config as text
330
+ *
331
+ * @return void
332
+ */
333
+ public function downloadConfigAsTextAction() {
334
+ $items = array();
335
+ $configs = Mage::app()->getConfig()->getNode();
336
+ Olctw_Debug_Block_Config::xml2array($configs, $items);
337
+
338
+ $content = '';
339
+ foreach ($items as $key => $value) {
340
+ $content .= "$key = $value\n";
341
+ }
342
+
343
+ $this->getResponse()->setHeader('Content-type', 'text/plain', true);
344
+ $this->getResponse()->setBody($content);
345
+ }
346
+
347
+ /**
348
+ * Toggle Sql profiler
349
+ *
350
+ * @return void
351
+ */
352
+ public function toggleSqlProfilerAction() {
353
+ $localConfigFile = Mage::getBaseDir('etc') . DS . 'local.xml';
354
+ $localConfigBackupFile = Mage::getBaseDir('etc') . DS . 'local-magneto.xml_';
355
+
356
+ $configContent = file_get_contents($localConfigFile);
357
+ $xml = new SimpleXMLElement($configContent);
358
+
359
+ if ((int) $xml->global->resources->default_setup->connection->profiler != 1) {
360
+ $xml->global->resources->default_setup->connection->addChild('profiler', 1);
361
+ } else {
362
+ unset($xml->global->resources->default_setup->connection->profiler);
363
+ }
364
+
365
+ // backup config file
366
+ if (file_put_contents($localConfigBackupFile, $configContent) === FALSE) {
367
+ Mage::getSingleton('core/session')->addError($this->__('Operation aborted: couldn\'t create backup for config file'));
368
+ $this->_redirectReferer();
369
+ }
370
+
371
+ if ($xml->saveXML($localConfigFile) === FALSE) {
372
+ Mage::getSingleton('core/session')->addError($this->__("Couldn't save {$localConfigFile}: check write permissions."));
373
+ $this->_redirectReferer();
374
+ }
375
+ Mage::getSingleton('core/session')->addSuccess($this->__('SQL profiler status changed in local.xml'));
376
+
377
+ // Assure config cache and all full page cache is emptied
378
+ Mage::app()->cleanCache();
379
+ $this->_redirectReferer();
380
+ }
381
+
382
+ /**
383
+ * Search grouped class
384
+ *
385
+ * @return void
386
+ */
387
+ public function searchGroupedClassAction() {
388
+ if ($this->getRequest()->isPost()) {
389
+ $uri = $this->getRequest()->getPost('uri');
390
+ $groupType = $this->getRequest()->getPost('group');
391
+
392
+ if ($groupType == 'all') {
393
+ $groupTypes = array('model', 'block', 'helper');
394
+ } else {
395
+ $groupTypes = array($groupType);
396
+ }
397
+
398
+ $items = array();
399
+
400
+ if (!empty($uri)) {
401
+ foreach ($groupTypes as $type) {
402
+ $items[$type]['class'] = Mage::getConfig()->getGroupedClassName($type, $uri);
403
+ $items[$type]['filepath'] = mageFindClassFile($items[$type]['class']);
404
+ }
405
+
406
+ $block = $this->getLayout()->createBlock('debug/abstract');
407
+ $block->setTemplate('olctw_debug/groupedclasssearch.phtml');
408
+ $block->assign('items', $items);
409
+ $this->getResponse()->setBody($block->toHtml());
410
+ } else {
411
+ $this->getResponse()->setBody($this->__('Please fill in a search query'));
412
+ }
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Seach config
418
+ *
419
+ * @return void
420
+ */
421
+ public function searchConfigAction() {
422
+ if ($this->getRequest()->isPost()) {
423
+ $result['error'] = 0;
424
+
425
+ $query = $this->getRequest()->getPost('query');
426
+
427
+ if (!empty($query)) {
428
+ $configs = Mage::app()->getConfig()->getNode();
429
+ $configArray = array();
430
+
431
+ Olctw_Debug_Block_Config::xml2array($configs, $configArray);
432
+ $configKeys = array_keys($configArray);
433
+
434
+ $items = array();
435
+
436
+ foreach ($configKeys as $configKey) {
437
+ if (strpos($configKey, $query) !== FALSE) {
438
+ $items[$configKey] = $configArray[$configKey];
439
+ }
440
+ }
441
+ $block = $this->getLayout()->createBlock('debug/abstract');
442
+ $block->setTemplate('olctw_debug/configsearch.phtml');
443
+ $block->assign('items', $items);
444
+ $this->getResponse()->setBody($block->toHtml());
445
+ } else {
446
+ $result['error'] = 1;
447
+ $result['message'] = $this->__('Search query cannot be empty.');
448
+ }
449
+ }
450
+ }
451
+
452
+ /**
453
+ * Return last 100 lines of log file.
454
+ *
455
+ */
456
+ public function viewLogAction() {
457
+ $file = $this->getRequest()->getParam('file');
458
+
459
+ if (!empty($file)) {
460
+ // Accept only specific files
461
+ if ($file == Mage::getStoreConfig('dev/log/file') || $file == Mage::getStoreConfig('dev/log/exception_file')) {
462
+ // TODO: Review this..
463
+ $result = Mage::helper('debug')->getLastRows(Mage::getBaseDir('var') . DS . 'log' . DS . $file, 10);
464
+
465
+ if (!is_array($result)) {
466
+ $result = array($result);
467
+ }
468
+
469
+ $block = $this->getLayout()->createBlock('debug/abstract');
470
+ $block->setTemplate('olctw_debug/logdetails.phtml');
471
+ $block->assign('title', 'Log details : ' . $file);
472
+ $block->assign('items', $result);
473
+
474
+ $this->getResponse()->setBody($block->toHtml());
475
+ } else {
476
+ $this->getResponse()->setHttpResponseCode(418)->setBody('I\'m a teapot.');
477
+ }
478
+ }
479
+ }
480
+
481
+ public function togglePageCacheDebugAction() {
482
+ $forStore = $this->getRequest()->getParam('store', 1);
483
+
484
+ if (class_exists('Enterprise_PageCache_Model_Processor')) {
485
+ $configPath = Enterprise_PageCache_Model_Processor::XML_PATH_CACHE_DEBUG;
486
+ $currentStatus = Mage::getStoreConfig($configPath);
487
+
488
+ $config = Mage::getModel('core/config');
489
+ $config->saveConfig($configPath, !$currentStatus, 'stores', $forStore);
490
+ Mage::getModel('core/cache')->flush();
491
+
492
+ $this->_redirectReferer();
493
+ }
494
+ }
495
+
496
+ }
app/code/community/Olctw/Debug/controllers/PreferencesController.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Olctw_Debug_PreferencesController extends Mage_Core_Controller_Front_Action {
4
+
5
+ public function updatePostAction() {
6
+ $request = $this->getRequest();
7
+ if ($request->isPost()) {
8
+ $form = $request->getPost();
9
+
10
+ /* @var $helper Olctw_Debug_Helper_Data */
11
+ $helper = Mage::helper('debug');
12
+ // $panels = $helper->getPanels();
13
+ }
14
+
15
+ $this->_redirectReferer();
16
+ }
17
+
18
+ }
app/code/community/Olctw/Debug/etc/config.xml ADDED
@@ -0,0 +1,197 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Olctw_Debug>
5
+ <version>1.1.0</version>
6
+ </Olctw_Debug>
7
+ </modules>
8
+ <frontend>
9
+ <routers>
10
+ <debug>
11
+ <use>standard</use>
12
+ <args>
13
+ <module>Olctw_Debug</module>
14
+ <frontName>debug</frontName>
15
+ </args>
16
+ </debug>
17
+ </routers>
18
+ <layout>
19
+ <updates>
20
+ <olctw_debug_frontend_layout>
21
+ <file>olctw_debug/debug.xml</file>
22
+ </olctw_debug_frontend_layout>
23
+ </updates>
24
+ </layout>
25
+ </frontend>
26
+ <global>
27
+ <models>
28
+ <debug>
29
+ <class>Olctw_Debug_Model</class>
30
+ </debug>
31
+ </models>
32
+ <resources>
33
+ <debug_write>
34
+ <connection>
35
+ <use>core_write</use>
36
+ </connection>
37
+ </debug_write>
38
+ <debug_read>
39
+ <connection>
40
+ <use>core_read</use>
41
+ </connection>
42
+ </debug_read>
43
+ </resources>
44
+ <blocks>
45
+ <debug>
46
+ <class>Olctw_Debug_Block</class>
47
+ </debug>
48
+ </blocks>
49
+ <helpers>
50
+ <debug>
51
+ <class>Olctw_Debug_Helper</class>
52
+ </debug>
53
+ </helpers>
54
+
55
+ <events>
56
+ <controller_action_layout_generate_blocks_after>
57
+ <observers>
58
+ <olctw_debug_observer>
59
+ <type>singleton</type>
60
+ <class>Olctw_Debug_Model_Observer</class>
61
+ <method>onLayoutGenerate</method>
62
+ </olctw_debug_observer>
63
+ </observers>
64
+ </controller_action_layout_generate_blocks_after>
65
+
66
+ <core_block_abstract_to_html_before>
67
+ <observers>
68
+ <olctw_debug_observer>
69
+ <type>singleton</type>
70
+ <class>Olctw_Debug_Model_Observer</class>
71
+ <method>onBlockToHtml</method>
72
+ </olctw_debug_observer>
73
+ </observers>
74
+ </core_block_abstract_to_html_before>
75
+
76
+ <core_block_abstract_to_html_after>
77
+ <observers>
78
+ <olctw_debug_observer>
79
+ <type>singleton</type>
80
+ <class>Olctw_Debug_Model_Observer</class>
81
+ <method>onBlockToHtmlAfter</method>
82
+ </olctw_debug_observer>
83
+ </observers>
84
+ </core_block_abstract_to_html_after>
85
+
86
+ <controller_action_postdispatch>
87
+ <observers>
88
+ <olctw_debug_observer>
89
+ <type>singleton</type>
90
+ <class>Olctw_Debug_Model_Observer</class>
91
+ <method>onActionPostDispatch</method>
92
+ </olctw_debug_observer>
93
+ </observers>
94
+ </controller_action_postdispatch>
95
+
96
+ <core_collection_abstract_load_before>
97
+ <observers>
98
+ <olctw_debug_observer>
99
+ <type>singleton</type>
100
+ <class>Olctw_Debug_Model_Observer</class>
101
+ <method>onCollectionLoad</method>
102
+ </olctw_debug_observer>
103
+ </observers>
104
+ </core_collection_abstract_load_before>
105
+
106
+ <eav_collection_abstract_load_before>
107
+ <observers>
108
+ <olctw_debug_observer>
109
+ <type>singleton</type>
110
+ <class>Olctw_Debug_Model_Observer</class>
111
+ <method>onEavCollectionLoad</method>
112
+ </olctw_debug_observer>
113
+ </observers>
114
+ </eav_collection_abstract_load_before>
115
+
116
+
117
+ <!-- <core_block_abstract_prepare_layout_after> -->
118
+ <!-- <observers> -->
119
+ <!-- <olctw_debug_observer> -->
120
+ <!-- <type>singleton</type> -->
121
+ <!-- <class>Olctw_Debug_Model_Observer</class> -->
122
+ <!-- <method>onPrepareLayout</method> -->
123
+ <!-- </olctw_debug_observer> -->
124
+ <!-- </observers> -->
125
+ <!-- </core_block_abstract_prepare_layout_after> -->
126
+
127
+ <model_load_after>
128
+ <observers>
129
+ <olctw_debug_observer>
130
+ <type>singleton</type>
131
+ <class>Olctw_Debug_Model_Observer</class>
132
+ <method>onModelLoad</method>
133
+ </olctw_debug_observer>
134
+ </observers>
135
+ </model_load_after>
136
+
137
+ <controller_action_predispatch>
138
+ <observers>
139
+ <olctw_debug_observer>
140
+ <type>singleton</type>
141
+ <class>Olctw_Debug_Model_Observer</class>
142
+ <method>onActionPreDispatch</method>
143
+ </olctw_debug_observer>
144
+ </observers>
145
+ </controller_action_predispatch>
146
+ </events>
147
+ </global>
148
+
149
+ <default>
150
+ <debug>
151
+ <options>
152
+ <enable>1</enable>
153
+ <debug_panel_versions_visibility>1</debug_panel_versions_visibility>
154
+ <debug_panel_performance_visibility>1</debug_panel_performance_visibility>
155
+ <debug_panel_configuration_visibility>1</debug_panel_configuration_visibility>
156
+ <debug_panel_blocks_visibility>1</debug_panel_blocks_visibility>
157
+ <debug_panel_layout_visibility>1</debug_panel_layout_visibility>
158
+ <debug_panel_controller_visibility>1</debug_panel_controller_visibility>
159
+ <debug_panel_models_visibility>1</debug_panel_models_visibility>
160
+ <debug_panel_utilities_visibility>1</debug_panel_utilities_visibility>
161
+ <debug_panel_preferences_visibility>1</debug_panel_preferences_visibility>
162
+ <debug_panel_logs_visibility>1</debug_panel_logs_visibility>
163
+ </options>
164
+ </debug>
165
+ </default>
166
+
167
+ <adminhtml>
168
+ <acl>
169
+ <resources>
170
+ <admin>
171
+ <children>
172
+ <debug>
173
+ <title>Debug Toolbar</title>
174
+ <sort_order>10</sort_order>
175
+ </debug>
176
+ <system>
177
+ <children>
178
+ <config>
179
+ <children>
180
+ <debug>Debug Toolbar Options</debug>
181
+ </children>
182
+ </config>
183
+ </children>
184
+ </system>
185
+ </children>
186
+ </admin>
187
+ </resources>
188
+ </acl>
189
+ <layout>
190
+ <updates>
191
+ <olctw_debug_admin_layout>
192
+ <file>olctw_debug/debug.xml</file>
193
+ </olctw_debug_admin_layout>
194
+ </updates>
195
+ </layout>
196
+ </adminhtml>
197
+ </config>
app/code/community/Olctw/Debug/etc/system.xml ADDED
@@ -0,0 +1,127 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <config>
2
+ <sections>
3
+ <debug translate="label" module="debug">
4
+ <label>Debug Toolbar</label>
5
+ <tab>advanced</tab>
6
+ <sort_order>100</sort_order>
7
+ <show_in_default>1</show_in_default>
8
+ <show_in_website>1</show_in_website>
9
+ <show_in_store>1</show_in_store>
10
+
11
+ <groups>
12
+ <options translate="label">
13
+ <label>Debug Toolbar Options</label>
14
+ <sort_order>100</sort_order>
15
+ <show_in_default>1</show_in_default>
16
+ <show_in_website>1</show_in_website>
17
+ <show_in_store>1</show_in_store>
18
+ <expanded>1</expanded>
19
+ <fields>
20
+ <enable>
21
+ <label>Enable Debug Toolbar</label>
22
+ <frontend_type>select</frontend_type>
23
+ <source_model>adminhtml/system_config_source_yesno</source_model>
24
+ <sort_order>1</sort_order>
25
+ <show_in_default>1</show_in_default>
26
+ <show_in_website>1</show_in_website>
27
+ <show_in_store>1</show_in_store>
28
+ <comment><![CDATA[Display Debug Toolbar if set to Yes and client's ip is whitelisted in
29
+ System / Configuration / Developer / Developer Client Restrictions - Allowed IPS.]]>
30
+ </comment>
31
+ <sort_order>0</sort_order>
32
+ </enable>
33
+
34
+ <debug_panel_versions_visibility>
35
+ <label>Show Versions Panel</label>
36
+ <frontend_type>select</frontend_type>
37
+ <source_model>adminhtml/system_config_source_yesno</source_model>
38
+ <sort_order>1</sort_order>
39
+ <show_in_default>1</show_in_default>
40
+ <show_in_website>1</show_in_website>
41
+ <show_in_store>1</show_in_store>
42
+ <sort_order>1</sort_order>
43
+ </debug_panel_versions_visibility>
44
+
45
+ <debug_panel_performance_visibility>
46
+ <label>Show Performance Panel</label>
47
+ <frontend_type>select</frontend_type>
48
+ <source_model>adminhtml/system_config_source_yesno</source_model>
49
+ <sort_order>1</sort_order>
50
+ <show_in_default>1</show_in_default>
51
+ <show_in_website>1</show_in_website>
52
+ <show_in_store>1</show_in_store>
53
+ <sort_order>2</sort_order>
54
+ </debug_panel_performance_visibility>
55
+
56
+ <debug_panel_configuration_visibility>
57
+ <label>Show Configuration Panel</label>
58
+ <frontend_type>select</frontend_type>
59
+ <source_model>adminhtml/system_config_source_yesno</source_model>
60
+ <sort_order>1</sort_order>
61
+ <show_in_default>1</show_in_default>
62
+ <show_in_website>1</show_in_website>
63
+ <show_in_store>1</show_in_store>
64
+ <sort_order>3</sort_order>
65
+ </debug_panel_configuration_visibility>
66
+
67
+ <debug_panel_controller_visibility>
68
+ <label>Show Controller Panel</label>
69
+ <frontend_type>select</frontend_type>
70
+ <source_model>adminhtml/system_config_source_yesno</source_model>
71
+ <sort_order>1</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ <sort_order>4</sort_order>
76
+ </debug_panel_controller_visibility>
77
+
78
+ <debug_panel_models_visibility>
79
+ <label>Show Models Panel</label>
80
+ <frontend_type>select</frontend_type>
81
+ <source_model>adminhtml/system_config_source_yesno</source_model>
82
+ <sort_order>1</sort_order>
83
+ <show_in_default>1</show_in_default>
84
+ <show_in_website>1</show_in_website>
85
+ <show_in_store>1</show_in_store>
86
+ <sort_order>5</sort_order>
87
+ </debug_panel_models_visibility>
88
+
89
+ <debug_panel_layout_visibility>
90
+ <label>Show Layout Panel</label>
91
+ <frontend_type>select</frontend_type>
92
+ <source_model>adminhtml/system_config_source_yesno</source_model>
93
+ <sort_order>1</sort_order>
94
+ <show_in_default>1</show_in_default>
95
+ <show_in_website>1</show_in_website>
96
+ <show_in_store>1</show_in_store>
97
+ <sort_order>6</sort_order>
98
+ </debug_panel_layout_visibility>
99
+
100
+ <debug_panel_blocks_visibility>
101
+ <label>Show Blocks Panel</label>
102
+ <frontend_type>select</frontend_type>
103
+ <source_model>adminhtml/system_config_source_yesno</source_model>
104
+ <sort_order>1</sort_order>
105
+ <show_in_default>1</show_in_default>
106
+ <show_in_website>1</show_in_website>
107
+ <show_in_store>1</show_in_store>
108
+ <sort_order>7</sort_order>
109
+ </debug_panel_blocks_visibility>
110
+
111
+ <debug_panel_logs_visibility>
112
+ <label>Show Logs Panel</label>
113
+ <frontend_type>select</frontend_type>
114
+ <source_model>adminhtml/system_config_source_yesno</source_model>
115
+ <sort_order>1</sort_order>
116
+ <show_in_default>1</show_in_default>
117
+ <show_in_website>1</show_in_website>
118
+ <show_in_store>1</show_in_store>
119
+ <sort_order>8</sort_order>
120
+ </debug_panel_logs_visibility>
121
+ </fields>
122
+ </options>
123
+ </groups>
124
+ </debug>
125
+ </sections>
126
+ </config>
127
+
app/design/adminhtml/default/default/layout/olctw_debug/debug.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.1">
3
+ <default>
4
+ <reference name="before_body_end">
5
+ <block type="debug/debug" name="olctw_debug_panels" template="olctw_debug/debug.phtml">
6
+ <block type="debug/versions" name="olctw_debug_versions_panel" template="olctw_debug/versions.phtml"/>
7
+ <block type="debug/config" name="olctw_debug_config_panel" template="olctw_debug/config.phtml"/>
8
+ <block type="debug/blocks" name="olctw_debug_blocks_panel" template="olctw_debug/blocks.phtml"/>
9
+ <block type="debug/controller" name="olctw_debug_controller_panel" template="olctw_debug/controller.phtml"/>
10
+ <block type="debug/models" name="olctw_debug_models_panel" template="olctw_debug/models.phtml"/>
11
+ <block type="debug/layout" name="olctw_debug_layout_panel" template="olctw_debug/layout.phtml"/>
12
+ <block type="debug/abstract" name="olctw_debug_performance_panel" template="olctw_debug/performance.phtml"/>
13
+ <block type="debug/abstract" name="olctw_debug_utils_panel" template="olctw_debug/utils.phtml"/>
14
+ <block type="debug/abstract" name="olctw_debug_logs_panel" template="olctw_debug/logs.phtml"/>
15
+
16
+ <!-- Preferences panel is not implemented yet -->
17
+ <!--<block type="debug/preferences" name="olctw_debug_preferences_panel" template="olctw_debug/preferences.phtml"/>-->
18
+ </block>
19
+ </reference>
20
+ </default>
21
+ </layout>
app/design/adminhtml/default/default/template/olctw_debug/arrayformat.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $title ?></h3>
4
+ </div>
5
+
6
+ <div class="djDebugPanelContent">
7
+ <div class="scroll">
8
+ <dl>
9
+ <dt><?php echo $this->__("Executed SQL") ?></dt>
10
+ <dd><?php echo htmlspecialchars($query); ?></dd>
11
+ </dl>
12
+
13
+ <table class="djSqlExplain">
14
+ <thead>
15
+ <tr>
16
+ <?php foreach ($headers as $header): ?>
17
+ <th><?php echo htmlspecialchars($header); ?></th>
18
+ <?php endforeach; ?>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <?php $row = 0; ?>
23
+ <?php foreach ($items as $row): ?>
24
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
25
+ <?php foreach ($row as $key => $value): ?>
26
+ <td><?php echo htmlspecialchars($value); ?></td>
27
+ <?php endforeach; ?>
28
+ </tr>
29
+ <?php endforeach; ?>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+ </div>
34
+
app/design/adminhtml/default/default/template/olctw_debug/blocks.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Blocks */
3
+
4
+ $templateDirs = $this->getTemplateDirs();
5
+ $blocks = $this->getItems();
6
+ $layoutBlocks = $this->getLayoutBlocks();
7
+ ?>
8
+
9
+ <h4><?php echo $this->__('Template path') ?></h4>
10
+ <?php if ($templateDirs): ?>
11
+ <ol>
12
+ <?php foreach ($templateDirs as $template): ?>
13
+ <li><?php echo $template; ?></li>
14
+ </ol>
15
+ <?php endforeach; ?>
16
+ <?php else: ?>
17
+ <p>None</p>
18
+ <?php endif; ?>
19
+
20
+
21
+ <h4><?php echo $this->__('Rendered Blocks') ?></h4>
22
+ <p>List of all rendered blocks.</p>
23
+ <table>
24
+ <thead>
25
+ <tr>
26
+ <th>#</th>
27
+ <th><?php echo $this->__('name in layout') ?></th>
28
+ <th><?php echo $this->__('block class') ?></th>
29
+ <th><?php echo $this->__('template') ?></th>
30
+ <th><?php echo $this->__('rendering in') ?></th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <?php $row = 0; ?>
35
+ <?php foreach ($blocks as $block): ?>
36
+ <tr class="<?php echo ( ($row % 2 ? 'djdebugodd' : 'djdebugeven')) ?>">
37
+ <td><?php echo $row ?></td>
38
+ <td><?php echo $block['layout_name'] ?></td>
39
+ <td>
40
+ <a href="<?php echo $this->getViewBlockUrl($block['class']) ?>"
41
+ class="remoteCall"><?php echo $block['class'] ?></a>
42
+ </td>
43
+ <td>
44
+ <?php if ($block['template']): ?>
45
+ <a href="<?php echo $this->getViewTemplateUrl($block['template']) ?>"
46
+ class="remoteCall toggletemplate"><?php echo $block['template'] ?></a>
47
+ <?php endif; ?>
48
+ </td>
49
+ <td>
50
+ <?php echo $this->getRenderingTime($block) ?>
51
+ </td>
52
+ </tr>
53
+ <?php $row++; ?>
54
+ <?php endforeach ?>
55
+ </tbody>
56
+ </table>
57
+
58
+ <h4><?php echo $this->__('Layout Blocks') ?></h4>
59
+ <p>List of all instantiated blocks, few of them might not be rendered.</p>
60
+ <table>
61
+ <thead>
62
+ <tr>
63
+ <th>#</th>
64
+ <th><?php echo $this->__('name in layout') ?></th>
65
+ <th><?php echo $this->__('block class') ?></th>
66
+ <th><?php echo $this->__('template') ?></th>
67
+ </tr>
68
+ </thead>
69
+ <tbody>
70
+ <?php $row = 0; ?>
71
+ <?php foreach ($layoutBlocks as $block): ?>
72
+ <tr class="<?php echo ( ($row % 2 ? 'djdebugodd' : 'djdebugeven')) ?>">
73
+ <td><?php echo $row ?></td>
74
+ <td><?php echo $block['layout_name'] ?></td>
75
+ <td>
76
+ <a href="<?php echo $this->getViewBlockUrl($block['class']) ?>"
77
+ class="remoteCall"><?php echo $block['class'] ?></a>
78
+ </td>
79
+ <td>
80
+ <?php if ($block['template']): ?>
81
+ <a href="<?php echo $this->getViewTemplateUrl($block['template']) ?>"
82
+ class="remoteCall toggletemplate"><?php echo $block['template'] ?></a>
83
+ <?php endif; ?>
84
+ </td>
85
+ </tr>
86
+ <?php $row++; ?>
87
+ <?php endforeach ?>
88
+ </tbody>
89
+ </table>
app/design/adminhtml/default/default/template/olctw_debug/config.phtml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* @var $this Magneto_Debug_Block_Config */ ?>
2
+ <dl>
3
+ <dt><strong>
4
+ <a class="toggleTemplate" href="<?php echo $this->getToggleHintsUrl() ?>">
5
+ <?php echo $this->__('Toggle Template Hints') ?>
6
+ </a>
7
+ <a class="toggleTemplate" href="<?php echo $this->getToggleTranslateHintsUrl() ?>">
8
+ <?php echo $this->__('Toggle Translate Inline') ?>
9
+ </a>
10
+ <?php if ($this->hasFullPageCache()): ?>
11
+ <a class="toggleTemplate" href="<?php echo $this->getFullPageDebugUrl() ?>">
12
+ <?php echo $this->__('Toggle FPC Debug') ?>
13
+ </a>
14
+ <?php endif ?>
15
+ </strong></dt>
16
+ </dl>
17
+ <dl>
18
+ <dt><strong>
19
+ <a class="toggleTemplate" href="<?php echo $this->getDownloadConfigUrl() ?>" target="_blank">Download Config (XML)</a>
20
+ </strong>
21
+ <strong>
22
+ <a class="toggleTemplate" href="<?php echo $this->getDownloadConfigAsTextUrl() ?>" target="_blank">Download Config (TEXT)</a>
23
+ </strong></dt>
24
+ </dl>
25
+ <br/>
26
+
27
+ <form action="#" id="config-search-form" onSubmit="handlerFunction(); return false;">
28
+ <input name="query" class="input-text required-entry" type="search" size="40" />
29
+ <input type="button" onClick="handlerFunction()" value="<?php echo $this->__('Search Config') ?>" />
30
+ </form>
31
+ <p>
32
+ Search examples: <em>default/system</em>, <em>global/resources/default_setup</em>, <em>frontend/events</em> or <em>modules</em>. If you don't know what to search check all the <a class="toggleTemplate" href="<?php echo $this->getDownloadConfigAsTextUrl() ?>" target="_blank">configuration keys</a>.
33
+ </p>
34
+
35
+ <script type="text/javascript">
36
+ function handlerFunction(){
37
+ var request = new Ajax.Updater(
38
+ 'config-search-results',
39
+ '<?php echo $this->getSearchConfigUrl() ?>',
40
+ {
41
+ method: 'post',
42
+ parameters: Form.serialize($('config-search-form'))
43
+ });
44
+ }
45
+ </script>
46
+ <div id="config-search-results">
47
+ <table>
48
+ <thead>
49
+ <tr>
50
+ <th><?php echo $this->__("#") ?></th>
51
+ <th><?php echo $this->__("Config") ?></th>
52
+ <th><?php echo $this->__("Value") ?></th>
53
+ </tr>
54
+ </thead>
55
+ <tbody>
56
+ </tbody>
57
+ </table>
58
+ </div>
app/design/adminhtml/default/default/template/olctw_debug/configsearch.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th><?php echo $this->__("#") ?></th>
5
+ <th><?php echo $this->__("Config") ?></th>
6
+ <th><?php echo $this->__("Value") ?></th>
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ <div id="config-search-results">
11
+ <?php if (count($items)): ?>
12
+ <?php $row = 0 ?>
13
+ <?php foreach ($items as $key => $value): ?>
14
+ <tr>
15
+ <td><?php echo $row ?></td>
16
+ <td><?php echo $key ?></td>
17
+ <td><?php echo htmlspecialchars($value) ?></td>
18
+ </tr>
19
+ <?php $row++ ?>
20
+ <?php endforeach; ?>
21
+ <?php else: ?>
22
+ <tr><td colspan="3">Configurations not found for this query.</td></tr>
23
+ <?php endif; ?>
24
+ </div>
25
+ </tbody>
26
+ </table>
app/design/adminhtml/default/default/template/olctw_debug/controller.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $controller = Mage::registry('controller');
3
+ $request = $controller->getRequest();
4
+ $cookies = $_COOKIE;
5
+ $session = Mage::getSingleton('core/session');
6
+ ?>
7
+ <h4><?php $this->__('Controller information') ?></h4>
8
+ <table>
9
+ <thead>
10
+ <tr>
11
+ <th><?php echo $this->__('Variable') ?></th>
12
+ <th><?php echo $this->__('Value') ?></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr class="djDebugOdd">
17
+ <td><?php echo $this->__('Route Name') ?></td>
18
+ <td><?php echo $request->getRouteName() ?></td>
19
+ </tr>
20
+ <tr class="djDebugEven">
21
+ <td><?php echo $this->__('Controller Module/Name') ?></td>
22
+ <td><?php echo $request->getControllerModule() ?> / <?php echo $request->getControllerName() ?></td>
23
+ </tr>
24
+ <tr class="djDebugOdd">
25
+ <td><?php echo $this->__('Action Name') ?></td>
26
+ <td><?php echo $request->getActionName() ?></td>
27
+ </tr>
28
+ <tr class="djDebugEven">
29
+ <td><?php echo $this->__('Request Path') ?></td>
30
+ <td><?php echo $request->getPathInfo() ?></td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ <h4><?php echo $this->__('COOKIES Variables') ?></h4>
36
+ <?php if ($cookies): ?>
37
+ <table>
38
+ <colgroup>
39
+ <col style="width:20%"/>
40
+ <col/>
41
+ </colgroup>
42
+ <thead>
43
+ <tr>
44
+ <th><?php echo $this->__("Variable") ?></th>
45
+ <th><?php echo $this->__("Value") ?></th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <?php $row = 0; ?>
50
+ <?php foreach ($cookies as $key => $value): ?>
51
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
52
+ <td><?php echo htmlspecialchars($key) ?></td>
53
+ <td><?php echo htmlspecialchars($value) ?></td>
54
+ </tr>
55
+ <?php $row++; ?>
56
+ <?php endforeach ?>
57
+ </tbody>
58
+ </table>
59
+ <?php else: ?>
60
+ <p><?php echo $this->__("No COOKIE data") ?></p>
61
+ <?php endif ?>
62
+
63
+ <h4><?php echo $this->__('SESSION Variables') ?></h4>
64
+ <?php if (count($_SESSION)): ?>
65
+ <table>
66
+ <colgroup>
67
+ <col style="width:20%"/>
68
+ <col/>
69
+ </colgroup>
70
+ <thead>
71
+ <tr>
72
+ <th><?php echo $this->__("Variable") ?></th>
73
+ <th><?php echo $this->__("Value") ?></th>
74
+ </tr>
75
+ </thead>
76
+ <?php foreach ($_SESSION as $namespace => $data): ?>
77
+ <tbody>
78
+ <tr><th colspan="2" style="text-align: center; font-size: 120%; font-weight: bold;"><?php echo $namespace ?></th></tr>
79
+ <?php $row = 0; ?>
80
+ <?php foreach ($data as $key => $value): ?>
81
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
82
+ <td><?php echo htmlspecialchars($key) ?></td>
83
+ <td>
84
+ <?php if (is_array($value)): ?>
85
+ <?php foreach ($value as $key => $_value): ?>
86
+ <?php echo $key . ' => ' . $this->escapeHtml(json_encode($_value)); ?><br/>
87
+ <?php endforeach; ?>
88
+ <?php elseif (is_object($value)): ?>
89
+ <?php echo get_class($value) ?>
90
+ <?php else: ?>
91
+ <?php echo htmlspecialchars($value) ?>
92
+ <?php endif ?>
93
+ </td>
94
+ </tr>
95
+ <?php $row++; ?>
96
+ <?php endforeach; ?>
97
+ </tbody>
98
+ <?php endforeach; ?>
99
+ </table>
100
+ <?php else: ?>
101
+ <p><?php echo $this->__("No SESSION data") ?></p>
102
+ <?php endif ?>
103
+
104
+ <h4><?php echo $this->__("GET Variables") ?></h4>
105
+ <?php if ($_GET): ?>
106
+ <table>
107
+ <thead>
108
+ <tr>
109
+ <th><?php echo $this->__("Variable") ?></th>
110
+ <th><?php echo $this->__("Value") ?></th>
111
+ </tr>
112
+ </thead>
113
+ <tbody>
114
+ <?php $row = 0; ?>
115
+ <?php foreach ($_GET as $key => $value): ?>
116
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
117
+ <td><?php echo htmlspecialchars($key) ?></td>
118
+ <td><?php echo htmlspecialchars(var_export($value, true)) ?></td>
119
+ </tr>
120
+ <?php endforeach; ?>
121
+ </tbody>
122
+ </table>
123
+ <?php else: ?>
124
+ <p><?php echo $this->__("No GET data") ?></p>
125
+ <?php endif ?>
126
+
127
+ <h4><?php echo $this->__("POST Variables") ?></h4>
128
+ <?php if ($_POST): ?>
129
+ <table>
130
+ <thead>
131
+ <tr>
132
+ <th><?php echo $this->__("Variable") ?></th>
133
+ <th><?php echo $this->__("Value") ?></th>
134
+ </tr>
135
+ </thead>
136
+ <tbody>
137
+ <?php $row = 0; ?>
138
+ <?php foreach ($_POST as $key => $value): ?>
139
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
140
+ <td><?php echo htmlspecialchars($key) ?></td>
141
+ <td><?php echo htmlspecialchars(var_export($value, true)) ?></td>
142
+ </tr>
143
+ <?php endforeach; ?>
144
+ </tbody>
145
+ </table>
146
+ <?php else: ?>
147
+ <p><?php echo $this->__("No POST data") ?></p>
148
+ <?php endif ?>
app/design/adminhtml/default/default/template/olctw_debug/debug.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Debug */
3
+ $panels = $this->getVisiblePanels();
4
+ ?>
5
+ <style type="text/css">@media print { #djDebug {display:none;}}</style>
6
+ <script type="text/javascript">
7
+ // <![CDATA[
8
+ var DEBUG_TOOLBAR_MEDIA_URL = "<?php echo $this->getDebugMediaUrl(); ?>";
9
+ // ]]>
10
+ </script>
11
+ <script type="text/javascript" src="<?php echo $this->getDebugMediaUrl(); ?>js/toolbar.js"></script>
12
+ <div id="djDebug" style="display:none;">
13
+ <div style="display:none;" id="djDebugToolbar">
14
+ <ul id="djDebugPanelList">
15
+ <?php if ($panels): ?>
16
+ <li><a id="djHideToolBarButton" href="#" title="<?php echo $this->__("Hide Toolbar"); ?>"><?php echo $this->__("Hide") ?> &raquo;</a></li>
17
+ <?php else: ?>
18
+ <li id="djDebugButton">DEBUG</li>
19
+ <?php endif; ?>
20
+ <?php foreach ($panels as $panel): ?>
21
+ <li>
22
+ <?php if ($panel['has_content']): ?>
23
+ <a href="<?php echo $panel['url'] ? $panel['url'] : "#" ?>" title="<?php echo $panel['title']; ?>" class="<?php echo $panel['dom_id'] ?>">
24
+ <?php else: ?>
25
+ <div class="contentless">
26
+ <?php endif; ?>
27
+ <?php echo $panel['nav_title']; ?>
28
+ <?php if ($panel['nav_subtitle']): ?>
29
+ <br /><small><?php echo $panel['nav_subtitle']; ?></small>
30
+ <?php endif; ?>
31
+ <?php if ($panel['has_content']): ?>
32
+ </a>
33
+ <?php else: ?>
34
+ </div>
35
+ <?php endif; ?>
36
+ </li>
37
+ <?php endforeach; ?>
38
+ <li>
39
+ <a href="#" class="">About
40
+ <br/><small>Version <?php echo $this->getVersion() ?></a></small>
41
+ </a>
42
+ </li>
43
+ </ul>
44
+ </div>
45
+ <div style="display:none;" id="djDebugToolbarHandle">
46
+ <a title="<?php echo $this->__("Show Toolbar"); ?>" id="djShowToolBarButton" href="#">&laquo;</a>
47
+ </div>
48
+ <?php foreach ($panels as $panel): ?>
49
+ <?php if ($panel['has_content']): ?>
50
+ <div id="<?php echo $panel['dom_id'] ?>" class="panelContent">
51
+ <div class="djDebugPanelTitle">
52
+ <a href="" class="djDebugClose"><?php echo $this->__("Close"); ?></a>
53
+ <h3><?php echo $panel['title'] ?></h3>
54
+ </div>
55
+ <div class="djDebugPanelContent">
56
+ <div class="scroll">
57
+ <?php echo $this->getChildHtml($panel['template']) ?>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <?php endif; ?>
62
+
63
+ <?php endforeach; ?>
64
+ <div id="djDebugWindow" class="panelContent"></div>
65
+ </div>
app/design/adminhtml/default/default/template/olctw_debug/groupedclasssearch.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th><?php echo $this->__('#') ?></th>
5
+ <th><?php echo $this->__('Group Type') ?></th>
6
+ <th><?php echo $this->__('Search Results') ?></th>
7
+ <th><?php echo $this->__('File path') ?></th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <div id="class-search-results">
12
+ <?php if (count($items)): ?>
13
+ <?php $row = 0 ?>
14
+ <?php foreach ($items as $key => $value): ?>
15
+ <tr>
16
+ <td><?php echo $row ?></td>
17
+ <td><?php echo $key ?></td>
18
+ <td><?php echo htmlspecialchars($value['class']) ?></td>
19
+ <td><?php echo htmlspecialchars($value['filepath']) ?></td>
20
+ </tr>
21
+ <?php $row++ ?>
22
+ <?php endforeach; ?>
23
+ <?php else: ?>
24
+ <tr><td colspan="3">Grouped classes not found for this uri.</td></tr>
25
+ <?php endif; ?>
26
+ </div>
27
+ </tbody>
28
+ </table>
app/design/adminhtml/default/default/template/olctw_debug/handledetails.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $title ?></h3>
4
+ </div>
5
+
6
+ <div class="djDebugPanelContent">
7
+ <div class="scroll">
8
+ <h4><?php echo $this->__('Layout Updates For This Handle') ?> (<?php echo count($handleFiles); ?>)</h4>
9
+ <table>
10
+ <thead>
11
+ <tr>
12
+ <th><?php echo $this->__('Update xml file') ?></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <?php $row = 0; ?>
17
+ <?php foreach ($handleFiles as $filename => $handleUpdates): ?>
18
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
19
+ <td class="syntax"><h5><?php echo $filename ?></h5></td>
20
+ </tr>
21
+
22
+ <?php foreach ($handleUpdates as $update): ?>
23
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>"><td>
24
+ <code><?php echo htmlspecialchars($update->asXML()) ?></code>
25
+ </td></tr>
26
+ <?php endforeach; ?>
27
+ <?php $row++; ?>
28
+ <?php endforeach ?>
29
+ </tbody>
30
+ </table>
31
+
32
+ </div>
33
+ </div>
app/design/adminhtml/default/default/template/olctw_debug/layout.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Layout */
3
+ $layout = Mage::getSingleton('core/layout');
4
+ $layoutHandles = Mage::getSingleton('core/layout')->getUpdate()->getHandles();
5
+ $layoutUpdates = Mage::getSingleton('core/layout')->getUpdate()->asArray();
6
+
7
+ /* @var $designPackage Mage_Core_Model_Design_Package */
8
+ $designPackage = Mage::getSingleton('core/design_package');
9
+ ?>
10
+
11
+ <h4><?php echo $this->__('Package information') ?></h4>
12
+ <table>
13
+ <thead>
14
+ <tr>
15
+ <th><?php echo $this->__('Variable') ?></th>
16
+ <th><?php echo $this->__('Value') ?></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <tr class="djDebugOdd">
21
+ <td><?php echo $this->__('Design Area') ?></td>
22
+ <td><?php echo $designPackage->getArea() ?></td>
23
+ </tr>
24
+ <tr class="djDebugEven">
25
+ <td><?php echo $this->__('Package Name') ?></td>
26
+ <td><?php echo $designPackage->getPackageName() ?></td>
27
+ </tr>
28
+ <tr class="djDebugOdd">
29
+ <td><?php echo $this->__('Template Theme') ?></td>
30
+ <td><?php echo $designPackage->getTheme('template') ?></td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ <h4><?php echo $this->__('Handles for this request');
36
+ echo "(" . count($layoutHandles) . ")" ?></h4>
37
+ <table>
38
+ <thead>
39
+ <tr>
40
+ <th><?php echo $this->__('Handle') ?></th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <?php $row = 0; ?>
45
+ <?php foreach ($layoutHandles as $item): ?>
46
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
47
+ <td><a class="remoteCall toggleTemplate" href="<?php echo $this->getViewHandleUrl($item) ?>"><?php echo $item ?></a></td>
48
+ </tr>
49
+ <?php $row++; ?>
50
+ <?php endforeach ?>
51
+ </tbody>
52
+ </table>
53
+
54
+ <dl>
55
+ <dt><strong>Page Layout</strong></dt>
56
+ <dd>
57
+ <div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span>View Page Layout</a></div>
58
+ <div class="djTemplateHideContextDiv" style="display:none;">
59
+ <code><?php echo htmlspecialchars($layout->getNode()->asXML()) ?></code>
60
+ </div>
61
+ </dd>
62
+ </dl>
63
+
64
+ <h4><?php echo $this->__('Layout updates') ?> (<?php echo count($layoutUpdates); ?>)</h4>
65
+ <table>
66
+ <thead>
67
+ <tr>
68
+ <th><?php echo $this->__('#'); ?></th>
69
+ <th><?php echo $this->__('Update') ?></th>
70
+ </tr>
71
+ </thead>
72
+ <tbody>
73
+ <?php $row = 0; ?>
74
+ <?php foreach ($layoutUpdates as $item): ?>
75
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
76
+ <td><?php echo $row ?>.</td>
77
+ <td class="syntax">
78
+ <code><?php echo htmlspecialchars($item) ?></code>
79
+ </td>
80
+ </tr>
81
+ <?php $row++; ?>
82
+ <?php endforeach ?>
83
+ </tbody>
84
+ </table>
85
+
app/design/adminhtml/default/default/template/olctw_debug/logdetails.phtml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $title ?></h3>
4
+ </div>
5
+
6
+ <div class="djDebugPanelContent">
7
+ <div class="scroll">
8
+
9
+ <table class="djSqlExplain">
10
+ <tbody>
11
+ <?php $row = 0; ?>
12
+ <?php foreach ($items as $index => $row): ?>
13
+ <tr class="<?php echo ( ($index % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
14
+ <td><?php echo $row; ?></td>
15
+ </tr>
16
+ <?php endforeach; ?>
17
+ </tbody>
18
+ </table>
19
+ </div>
20
+ </div>
21
+
app/design/adminhtml/default/default/template/olctw_debug/logs.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <h4><?php echo $this->__('View content of logs file'); ?></h4>
2
+
3
+ <a class="remoteCall toggleTemplate"
4
+ href="<?php echo Mage::getUrl('debug/index/viewLog', array('file' => Mage::getStoreConfig('dev/log/file'))); ?>">
5
+ <?php echo Mage::getStoreConfig('dev/log/file'); ?>
6
+ </a>
7
+ <a class="remoteCall toggleTemplate"
8
+ href="<?php echo Mage::getUrl('debug/index/viewLog', array('file' => Mage::getStoreConfig('dev/log/exception_file'))); ?>">
9
+ <?php echo Mage::getStoreConfig('dev/log/exception_file'); ?>
10
+ </a>
app/design/adminhtml/default/default/template/olctw_debug/models.phtml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Models */
3
+
4
+ $items = $this->getItems();
5
+ Mage::helper('debug')->sortModelsByOccurrences($items);
6
+ $collections = $this->getCollections();
7
+ $queries = $this->getQueries();
8
+ ?>
9
+ <h4><?php echo $this->__('MODELS') ?></h4>
10
+ <table>
11
+ <thead>
12
+ <tr>
13
+ <th><?php echo $this->__('Resource Name') ?></th>
14
+ <th><?php echo $this->__('Model Class') ?></th>
15
+ <th><?php echo $this->__('Times Instantiated') ?></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <?php $row = 0; ?>
20
+ <?php foreach ($items as $item): ?>
21
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
22
+ <td><?php echo $item['resource_name'] ?></td>
23
+ <td><?php echo $item['class'] ?></td>
24
+ <td><?php echo $item['occurrences'] ?></td>
25
+ </tr>
26
+ <?php $row++; ?>
27
+ <?php endforeach ?>
28
+ </tbody>
29
+ </table>
30
+
31
+ <h4><?php echo $this->__('COLLECTIONS') ?></h4>
32
+ <table>
33
+ <thead>
34
+ <tr>
35
+ <th><?php echo $this->__('Type') ?></th>
36
+ <th><?php echo $this->__('Class') ?></th>
37
+ <th><?php echo $this->__('SQL') ?></th>
38
+ </tr>
39
+ </thead>
40
+ <tbody>
41
+ <?php $row = 0; ?>
42
+ <?php foreach ($collections as $item): ?>
43
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
44
+ <td><?php echo $item['type'] ?></td>
45
+ <td><?php echo $item['class'] ?></td>
46
+ <td><?php echo $item['sql'] ?></td>
47
+ </tr>
48
+ <?php $row++; ?>
49
+ <?php endforeach ?>
50
+ </tbody>
51
+ </table>
52
+ <h4><?php echo $this->__('QUERIES') ?></h4>
53
+ <?php if ($queries): ?>
54
+ <p><a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/toggleSqlProfiler') ?>">Disable SQL Profiler</a></p>
55
+ <table>
56
+ <thead>
57
+ <tr>
58
+ <th><?php echo $this->__('Time') ?></th>
59
+ <th><?php echo $this->__('Action') ?></th>
60
+ <th><?php echo $this->__('Query') ?></th>
61
+ </tr>
62
+ </thead>
63
+ <tbody>
64
+ <?php $row = 0; ?>
65
+ <?php foreach ($queries as $item): ?>
66
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
67
+ <td>
68
+ <div class=""><?php echo sprintf("%.4f", $item->getElapsedSecs()) ?>&nbsp;s</div>
69
+ </td>
70
+ <td>
71
+ <?php if ($item->getQueryType() == Zend_Db_Profiler::SELECT): ?>
72
+ <a class="remoteCall" href="<?php echo $this->getSqlSelectUrl($item) ?>">SELECT</a><br />
73
+ <a class="remoteCall" href="<?php echo $this->getSqlExplainUrl($item) ?>">EXPLAIN</a><br />
74
+ <?php endif; ?>
75
+ </td>
76
+ <td class="syntax">
77
+ <div class="djDebugSqlWrap">
78
+ <div class="djDebugSql"><?php echo $item->getQuery() ?>
79
+ <?php if (count($item->getQueryParams())): ?>
80
+ <br/><strong>Params:</strong> <?php echo implode(', ', $item->getQueryParams()); ?>
81
+ <?php endif; ?>
82
+ </div>
83
+ </div>
84
+ </td>
85
+ </tr>
86
+ <?php $row++; ?>
87
+ <?php endforeach ?>
88
+ </tbody>
89
+ </table>
90
+ <?php else: ?>
91
+ <p>SQL Profiler is not enabled. <a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/toggleSqlProfiler') ?>">Enable SQL Profiler</a></p>
92
+ <?php endif; ?>
app/design/adminhtml/default/default/template/olctw_debug/performance.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php ?>
2
+ <h4><?php $this->__('Performance') ?></h4>
3
+ <dl>
4
+ <dt><strong>
5
+ <a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/clearCache') ?>">
6
+ <?php echo $this->__('Clear Magento Cache'); ?>
7
+ </a>
8
+ </strong></dt>
9
+ </dl>
10
+
app/design/adminhtml/default/default/template/olctw_debug/preferences.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Preferences */
3
+ $panels = $this->getPanels();
4
+
5
+ /* @var $helper Magneto_Debug_Helper_Data */
6
+ $helper = Mage::helper('debug');
7
+ ?>
8
+
9
+ <h4><?php echo $this->__('Visible Panels') ?></h4>
10
+ <form method="post" action="<?php echo $this->getFormUrl() ?>" name="preferences-form">
11
+ <?php foreach ($panels as $panel): ?>
12
+ <input type="checkbox" name="<?php echo strtolower($panel['title']) ?>" id="<?php echo $panel['dom_id'] . '_visibility' ?>"
13
+ <?php if ($helper->isPanelVisible($panel['title'])): ?>checked<?php endif ?>>
14
+ <label for="<?php echo $panel['dom_id'] . '_visibility' ?>"><?php echo $panel['title'] ?></label><br>
15
+ <?php endforeach ?>
16
+
17
+ <button class="form-button" type="submit"><span>Update</span></button>
18
+ </form>
app/design/adminhtml/default/default/template/olctw_debug/simplepanel.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $this->__($title) ?></h3>
4
+ </div>
5
+ <div class="djDebugPanelContent">
6
+ <div class="scroll">
7
+ <code><?php echo $this->__($content) ?></code>
8
+ </div>
9
+ </div>
app/design/adminhtml/default/default/template/olctw_debug/utils.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php ?>
2
+ <h4>Grouped Class Search</h4>
3
+ <form action="#" id="class-search-form" onSubmit="submitGroupedClassSearch(); return false;">
4
+ <input name="uri" class="input-text required-entry" type="search" size="40" />
5
+ <select name="group" class="input-select required-entry">
6
+ <option>all</option>
7
+ <option>model</option>
8
+ <option>block</option>
9
+ <option>helper</option>
10
+ </select>
11
+ <input type="button" onClick="submitGroupedClassSearch()" value="<?php echo $this->__('Search Grouped Class Name') ?>" />
12
+ </form>
13
+ <p>
14
+ Search examples: <em>catalog/product</em>, <em>core/url</em>, etc.
15
+ </p>
16
+
17
+ <script type="text/javascript">
18
+ function submitGroupedClassSearch(){
19
+ var request = new Ajax.Updater(
20
+ 'class-search-results',
21
+ '<?php echo $this->getUrl("debug/index/searchGroupedClass") ?>',
22
+ {
23
+ method: 'post',
24
+ parameters: Form.serialize($('class-search-form'))
25
+ });
26
+ }
27
+ </script>
28
+ <div id="class-search-results">
29
+ <table>
30
+ <thead>
31
+ <tr>
32
+ <th><?php echo $this->__('#') ?></th>
33
+ <th><?php echo $this->__('Group Type') ?></th>
34
+ <th><?php echo $this->__('Class') ?></th>
35
+ <th><?php echo $this->__('File path') ?></th>
36
+ </tr>
37
+ </thead>
38
+ <tbody>
39
+ </tbody>
40
+ </table>
41
+ </div>
app/design/adminhtml/default/default/template/olctw_debug/versions.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th><?php echo $this->__("Module") ?></th>
5
+ <th><?php echo $this->__("Version") ?></th>
6
+ <th><?php echo $this->__("Status") ?></th>
7
+ <th><?php echo $this->__("Actions") ?></th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <?php $row = 0; ?>
12
+ <?php foreach ($this->getItems() as $item): ?>
13
+ <tr class="<?php echo (($row % 2) ? 'djDebugOdd' : 'djDebugEven') ?>">
14
+ <td><?php echo $item['module'] ?></td>
15
+ <td><?php echo $item['version'] ?></td>
16
+ <td><?php echo $item['active'] ?></td>
17
+ <td><a class="remoteCall" href="<?php echo Mage::getUrl('debug/index/toggleModuleStatus', array('_query' => array('module' => $item['module']))) ?>">Toggle Status</a><td>
18
+ </tr>
19
+ <?php $row++; ?>
20
+ <?php endforeach; ?>
21
+ </tbody>
22
+ </table>
app/design/frontend/base/default/layout/olctw_debug/debug.xml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout version="0.1.1">
3
+ <default>
4
+ <reference name="before_body_end">
5
+ <block type="debug/debug" name="olctw_debug_panels" template="olctw_debug/debug.phtml">
6
+ <block type="debug/versions" name="olctw_debug_versions_panel" template="olctw_debug/versions.phtml"/>
7
+ <block type="debug/config" name="olctw_debug_config_panel" template="olctw_debug/config.phtml"/>
8
+ <block type="debug/blocks" name="olctw_debug_blocks_panel" template="olctw_debug/blocks.phtml"/>
9
+ <block type="debug/controller" name="olctw_debug_controller_panel" template="olctw_debug/controller.phtml"/>
10
+ <block type="debug/models" name="olctw_debug_models_panel" template="olctw_debug/models.phtml"/>
11
+ <block type="debug/layout" name="olctw_debug_layout_panel" template="olctw_debug/layout.phtml"/>
12
+ <block type="debug/abstract" name="olctw_debug_performance_panel" template="olctw_debug/performance.phtml"/>
13
+ <block type="debug/abstract" name="olctw_debug_utils_panel" template="olctw_debug/utils.phtml"/>
14
+ <block type="debug/abstract" name="olctw_debug_logs_panel" template="olctw_debug/logs.phtml"/>
15
+
16
+ <!-- Preferences panel is not implemented yet -->
17
+ <!--<block type="debug/preferences" name="olctw_debug_preferences_panel" template="olctw_debug/preferences.phtml"/>-->
18
+ </block>
19
+ </reference>
20
+ </default>
21
+ </layout>
app/design/frontend/base/default/template/olctw_debug/arrayformat.phtml ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $title ?></h3>
4
+ </div>
5
+
6
+ <div class="djDebugPanelContent">
7
+ <div class="scroll">
8
+ <dl>
9
+ <dt><?php echo $this->__("Executed SQL") ?></dt>
10
+ <dd><?php echo htmlspecialchars($query); ?></dd>
11
+ </dl>
12
+
13
+ <table class="djSqlExplain">
14
+ <thead>
15
+ <tr>
16
+ <?php foreach ($headers as $header): ?>
17
+ <th><?php echo htmlspecialchars($header); ?></th>
18
+ <?php endforeach; ?>
19
+ </tr>
20
+ </thead>
21
+ <tbody>
22
+ <?php $row = 0; ?>
23
+ <?php foreach ($items as $row): ?>
24
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
25
+ <?php foreach ($row as $key => $value): ?>
26
+ <td><?php echo htmlspecialchars($value); ?></td>
27
+ <?php endforeach; ?>
28
+ </tr>
29
+ <?php endforeach; ?>
30
+ </tbody>
31
+ </table>
32
+ </div>
33
+ </div>
34
+
app/design/frontend/base/default/template/olctw_debug/blocks.phtml ADDED
@@ -0,0 +1,89 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Blocks */
3
+
4
+ $templateDirs = $this->getTemplateDirs();
5
+ $blocks = $this->getItems();
6
+ $layoutBlocks = $this->getLayoutBlocks();
7
+ ?>
8
+
9
+ <h4><?php echo $this->__('Template path') ?></h4>
10
+ <?php if ($templateDirs): ?>
11
+ <ol>
12
+ <?php foreach ($templateDirs as $template): ?>
13
+ <li><?php echo $template; ?></li>
14
+ </ol>
15
+ <?php endforeach; ?>
16
+ <?php else: ?>
17
+ <p>None</p>
18
+ <?php endif; ?>
19
+
20
+
21
+ <h4><?php echo $this->__('Rendered Blocks') ?></h4>
22
+ <p>List of all rendered blocks.</p>
23
+ <table>
24
+ <thead>
25
+ <tr>
26
+ <th>#</th>
27
+ <th><?php echo $this->__('name in layout') ?></th>
28
+ <th><?php echo $this->__('block class') ?></th>
29
+ <th><?php echo $this->__('template') ?></th>
30
+ <th><?php echo $this->__('rendering in') ?></th>
31
+ </tr>
32
+ </thead>
33
+ <tbody>
34
+ <?php $row = 0; ?>
35
+ <?php foreach ($blocks as $block): ?>
36
+ <tr class="<?php echo ( ($row % 2 ? 'djdebugodd' : 'djdebugeven')) ?>">
37
+ <td><?php echo $row ?></td>
38
+ <td><?php echo $block['layout_name'] ?></td>
39
+ <td>
40
+ <a href="<?php echo $this->getViewBlockUrl($block['class']) ?>"
41
+ class="remoteCall"><?php echo $block['class'] ?></a>
42
+ </td>
43
+ <td>
44
+ <?php if ($block['template']): ?>
45
+ <a href="<?php echo $this->getViewTemplateUrl($block['template']) ?>"
46
+ class="remoteCall toggletemplate"><?php echo $block['template'] ?></a>
47
+ <?php endif; ?>
48
+ </td>
49
+ <td>
50
+ <?php echo $this->getRenderingTime($block) ?>
51
+ </td>
52
+ </tr>
53
+ <?php $row++; ?>
54
+ <?php endforeach ?>
55
+ </tbody>
56
+ </table>
57
+
58
+ <h4><?php echo $this->__('Layout Blocks') ?></h4>
59
+ <p>List of all instantiated blocks, few of them might not be rendered.</p>
60
+ <table>
61
+ <thead>
62
+ <tr>
63
+ <th>#</th>
64
+ <th><?php echo $this->__('name in layout') ?></th>
65
+ <th><?php echo $this->__('block class') ?></th>
66
+ <th><?php echo $this->__('template') ?></th>
67
+ </tr>
68
+ </thead>
69
+ <tbody>
70
+ <?php $row = 0; ?>
71
+ <?php foreach ($layoutBlocks as $block): ?>
72
+ <tr class="<?php echo ( ($row % 2 ? 'djdebugodd' : 'djdebugeven')) ?>">
73
+ <td><?php echo $row ?></td>
74
+ <td><?php echo $block['layout_name'] ?></td>
75
+ <td>
76
+ <a href="<?php echo $this->getViewBlockUrl($block['class']) ?>"
77
+ class="remoteCall"><?php echo $block['class'] ?></a>
78
+ </td>
79
+ <td>
80
+ <?php if ($block['template']): ?>
81
+ <a href="<?php echo $this->getViewTemplateUrl($block['template']) ?>"
82
+ class="remoteCall toggletemplate"><?php echo $block['template'] ?></a>
83
+ <?php endif; ?>
84
+ </td>
85
+ </tr>
86
+ <?php $row++; ?>
87
+ <?php endforeach ?>
88
+ </tbody>
89
+ </table>
app/design/frontend/base/default/template/olctw_debug/config.phtml ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php /* @var $this Magneto_Debug_Block_Config */ ?>
2
+ <dl>
3
+ <dt><strong>
4
+ <a class="toggleTemplate" href="<?php echo $this->getToggleHintsUrl() ?>">
5
+ <?php echo $this->__('Toggle Template Hints') ?>
6
+ </a>
7
+ <a class="toggleTemplate" href="<?php echo $this->getToggleTranslateHintsUrl() ?>">
8
+ <?php echo $this->__('Toggle Translate Inline') ?>
9
+ </a>
10
+ <?php if ($this->hasFullPageCache()): ?>
11
+ <a class="toggleTemplate" href="<?php echo $this->getFullPageDebugUrl() ?>">
12
+ <?php echo $this->__('Toggle FPC Debug') ?>
13
+ </a>
14
+ <?php endif ?>
15
+ </strong></dt>
16
+ </dl>
17
+ <dl>
18
+ <dt><strong>
19
+ <a class="toggleTemplate" href="<?php echo $this->getDownloadConfigUrl() ?>" target="_blank">Download Config (XML)</a>
20
+ </strong>
21
+ <strong>
22
+ <a class="toggleTemplate" href="<?php echo $this->getDownloadConfigAsTextUrl() ?>" target="_blank">Download Config (TEXT)</a>
23
+ </strong></dt>
24
+ </dl>
25
+ <br/>
26
+
27
+ <form action="#" id="config-search-form" onSubmit="handlerFunction(); return false;">
28
+ <input name="query" class="input-text required-entry" type="search" size="40" />
29
+ <input type="button" onClick="handlerFunction()" value="<?php echo $this->__('Search Config') ?>" />
30
+ </form>
31
+ <p>
32
+ Search examples: <em>default/system</em>, <em>global/resources/default_setup</em>, <em>frontend/events</em> or <em>modules</em>. If you don't know what to search check all the <a class="toggleTemplate" href="<?php echo $this->getDownloadConfigAsTextUrl() ?>" target="_blank">configuration keys</a>.
33
+ </p>
34
+
35
+ <script type="text/javascript">
36
+ function handlerFunction(){
37
+ var request = new Ajax.Updater(
38
+ 'config-search-results',
39
+ '<?php echo $this->getSearchConfigUrl() ?>',
40
+ {
41
+ method: 'post',
42
+ parameters: Form.serialize($('config-search-form'))
43
+ });
44
+ }
45
+ </script>
46
+ <div id="config-search-results">
47
+ <table>
48
+ <thead>
49
+ <tr>
50
+ <th><?php echo $this->__("#") ?></th>
51
+ <th><?php echo $this->__("Config") ?></th>
52
+ <th><?php echo $this->__("Value") ?></th>
53
+ </tr>
54
+ </thead>
55
+ <tbody>
56
+ </tbody>
57
+ </table>
58
+ </div>
app/design/frontend/base/default/template/olctw_debug/configsearch.phtml ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th><?php echo $this->__("#") ?></th>
5
+ <th><?php echo $this->__("Config") ?></th>
6
+ <th><?php echo $this->__("Value") ?></th>
7
+ </tr>
8
+ </thead>
9
+ <tbody>
10
+ <div id="config-search-results">
11
+ <?php if (count($items)): ?>
12
+ <?php $row = 0 ?>
13
+ <?php foreach ($items as $key => $value): ?>
14
+ <tr>
15
+ <td><?php echo $row ?></td>
16
+ <td><?php echo $key ?></td>
17
+ <td><?php echo htmlspecialchars($value) ?></td>
18
+ </tr>
19
+ <?php $row++ ?>
20
+ <?php endforeach; ?>
21
+ <?php else: ?>
22
+ <tr><td colspan="3">Configurations not found for this query.</td></tr>
23
+ <?php endif; ?>
24
+ </div>
25
+ </tbody>
26
+ </table>
app/design/frontend/base/default/template/olctw_debug/controller.phtml ADDED
@@ -0,0 +1,148 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ $controller = Mage::registry('controller');
3
+ $request = $controller->getRequest();
4
+ $cookies = $_COOKIE;
5
+ $session = Mage::getSingleton('core/session');
6
+ ?>
7
+ <h4><?php $this->__('Controller information') ?></h4>
8
+ <table>
9
+ <thead>
10
+ <tr>
11
+ <th><?php echo $this->__('Variable') ?></th>
12
+ <th><?php echo $this->__('Value') ?></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <tr class="djDebugOdd">
17
+ <td><?php echo $this->__('Route Name') ?></td>
18
+ <td><?php echo $request->getRouteName() ?></td>
19
+ </tr>
20
+ <tr class="djDebugEven">
21
+ <td><?php echo $this->__('Controller Module/Name') ?></td>
22
+ <td><?php echo $request->getControllerModule() ?> / <?php echo $request->getControllerName() ?></td>
23
+ </tr>
24
+ <tr class="djDebugOdd">
25
+ <td><?php echo $this->__('Action Name') ?></td>
26
+ <td><?php echo $request->getActionName() ?></td>
27
+ </tr>
28
+ <tr class="djDebugEven">
29
+ <td><?php echo $this->__('Request Path') ?></td>
30
+ <td><?php echo $request->getPathInfo() ?></td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ <h4><?php echo $this->__('COOKIES Variables') ?></h4>
36
+ <?php if ($cookies): ?>
37
+ <table>
38
+ <colgroup>
39
+ <col style="width:20%"/>
40
+ <col/>
41
+ </colgroup>
42
+ <thead>
43
+ <tr>
44
+ <th><?php echo $this->__("Variable") ?></th>
45
+ <th><?php echo $this->__("Value") ?></th>
46
+ </tr>
47
+ </thead>
48
+ <tbody>
49
+ <?php $row = 0; ?>
50
+ <?php foreach ($cookies as $key => $value): ?>
51
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
52
+ <td><?php echo htmlspecialchars($key) ?></td>
53
+ <td><?php echo htmlspecialchars($value) ?></td>
54
+ </tr>
55
+ <?php $row++; ?>
56
+ <?php endforeach ?>
57
+ </tbody>
58
+ </table>
59
+ <?php else: ?>
60
+ <p><?php echo $this->__("No COOKIE data") ?></p>
61
+ <?php endif ?>
62
+
63
+ <h4><?php echo $this->__('SESSION Variables') ?></h4>
64
+ <?php if (count($_SESSION)): ?>
65
+ <table>
66
+ <colgroup>
67
+ <col style="width:20%"/>
68
+ <col/>
69
+ </colgroup>
70
+ <thead>
71
+ <tr>
72
+ <th><?php echo $this->__("Variable") ?></th>
73
+ <th><?php echo $this->__("Value") ?></th>
74
+ </tr>
75
+ </thead>
76
+ <?php foreach ($_SESSION as $namespace => $data): ?>
77
+ <tbody>
78
+ <tr><th colspan="2" style="text-align: center; font-size: 120%; font-weight: bold;"><?php echo $namespace ?></th></tr>
79
+ <?php $row = 0; ?>
80
+ <?php foreach ($data as $key => $value): ?>
81
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
82
+ <td><?php echo htmlspecialchars($key) ?></td>
83
+ <td>
84
+ <?php if (is_array($value)): ?>
85
+ <?php foreach ($value as $key => $_value): ?>
86
+ <?php echo $key . ' => ' . $this->escapeHtml(json_encode($_value)); ?><br/>
87
+ <?php endforeach; ?>
88
+ <?php elseif (is_object($value)): ?>
89
+ <?php echo get_class($value) ?>
90
+ <?php else: ?>
91
+ <?php echo htmlspecialchars($value) ?>
92
+ <?php endif ?>
93
+ </td>
94
+ </tr>
95
+ <?php $row++; ?>
96
+ <?php endforeach; ?>
97
+ </tbody>
98
+ <?php endforeach; ?>
99
+ </table>
100
+ <?php else: ?>
101
+ <p><?php echo $this->__("No SESSION data") ?></p>
102
+ <?php endif ?>
103
+
104
+ <h4><?php echo $this->__("GET Variables") ?></h4>
105
+ <?php if ($_GET): ?>
106
+ <table>
107
+ <thead>
108
+ <tr>
109
+ <th><?php echo $this->__("Variable") ?></th>
110
+ <th><?php echo $this->__("Value") ?></th>
111
+ </tr>
112
+ </thead>
113
+ <tbody>
114
+ <?php $row = 0; ?>
115
+ <?php foreach ($_GET as $key => $value): ?>
116
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
117
+ <td><?php echo htmlspecialchars($key) ?></td>
118
+ <td><?php echo htmlspecialchars(var_export($value, true)) ?></td>
119
+ </tr>
120
+ <?php endforeach; ?>
121
+ </tbody>
122
+ </table>
123
+ <?php else: ?>
124
+ <p><?php echo $this->__("No GET data") ?></p>
125
+ <?php endif ?>
126
+
127
+ <h4><?php echo $this->__("POST Variables") ?></h4>
128
+ <?php if ($_POST): ?>
129
+ <table>
130
+ <thead>
131
+ <tr>
132
+ <th><?php echo $this->__("Variable") ?></th>
133
+ <th><?php echo $this->__("Value") ?></th>
134
+ </tr>
135
+ </thead>
136
+ <tbody>
137
+ <?php $row = 0; ?>
138
+ <?php foreach ($_POST as $key => $value): ?>
139
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
140
+ <td><?php echo htmlspecialchars($key) ?></td>
141
+ <td><?php echo htmlspecialchars(var_export($value, true)) ?></td>
142
+ </tr>
143
+ <?php endforeach; ?>
144
+ </tbody>
145
+ </table>
146
+ <?php else: ?>
147
+ <p><?php echo $this->__("No POST data") ?></p>
148
+ <?php endif ?>
app/design/frontend/base/default/template/olctw_debug/debug.phtml ADDED
@@ -0,0 +1,65 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Debug */
3
+ $panels = $this->getVisiblePanels();
4
+ ?>
5
+ <style type="text/css">@media print { #djDebug {display:none;}}</style>
6
+ <script type="text/javascript">
7
+ // <![CDATA[
8
+ var DEBUG_TOOLBAR_MEDIA_URL = "<?php echo $this->getDebugMediaUrl(); ?>";
9
+ // ]]>
10
+ </script>
11
+ <script type="text/javascript" src="<?php echo $this->getDebugMediaUrl(); ?>js/toolbar.js"></script>
12
+ <div id="djDebug" style="display:none;">
13
+ <div style="display:none;" id="djDebugToolbar">
14
+ <ul id="djDebugPanelList">
15
+ <?php if ($panels): ?>
16
+ <li><a id="djHideToolBarButton" href="#" title="<?php echo $this->__("Hide Toolbar"); ?>"><?php echo $this->__("Hide") ?> &raquo;</a></li>
17
+ <?php else: ?>
18
+ <li id="djDebugButton">DEBUG</li>
19
+ <?php endif; ?>
20
+ <?php foreach ($panels as $panel): ?>
21
+ <li>
22
+ <?php if ($panel['has_content']): ?>
23
+ <a href="<?php echo $panel['url'] ? $panel['url'] : "#" ?>" title="<?php echo $panel['title']; ?>" class="<?php echo $panel['dom_id'] ?>">
24
+ <?php else: ?>
25
+ <div class="contentless">
26
+ <?php endif; ?>
27
+ <?php echo $panel['nav_title']; ?>
28
+ <?php if ($panel['nav_subtitle']): ?>
29
+ <br /><small><?php echo $panel['nav_subtitle']; ?></small>
30
+ <?php endif; ?>
31
+ <?php if ($panel['has_content']): ?>
32
+ </a>
33
+ <?php else: ?>
34
+ </div>
35
+ <?php endif; ?>
36
+ </li>
37
+ <?php endforeach; ?>
38
+ <li>
39
+ <a href="#" class="">About
40
+ <br/><small>Version <?php echo $this->getVersion() ?></a></small>
41
+ </a>
42
+ </li>
43
+ </ul>
44
+ </div>
45
+ <div style="display:none;" id="djDebugToolbarHandle">
46
+ <a title="<?php echo $this->__("Show Toolbar"); ?>" id="djShowToolBarButton" href="#">&laquo;</a>
47
+ </div>
48
+ <?php foreach ($panels as $panel): ?>
49
+ <?php if ($panel['has_content']): ?>
50
+ <div id="<?php echo $panel['dom_id'] ?>" class="panelContent">
51
+ <div class="djDebugPanelTitle">
52
+ <a href="" class="djDebugClose"><?php echo $this->__("Close"); ?></a>
53
+ <h3><?php echo $panel['title'] ?></h3>
54
+ </div>
55
+ <div class="djDebugPanelContent">
56
+ <div class="scroll">
57
+ <?php echo $this->getChildHtml($panel['template']) ?>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <?php endif; ?>
62
+
63
+ <?php endforeach; ?>
64
+ <div id="djDebugWindow" class="panelContent"></div>
65
+ </div>
app/design/frontend/base/default/template/olctw_debug/groupedclasssearch.phtml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th><?php echo $this->__('#') ?></th>
5
+ <th><?php echo $this->__('Group Type') ?></th>
6
+ <th><?php echo $this->__('Search Results') ?></th>
7
+ <th><?php echo $this->__('File path') ?></th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <div id="class-search-results">
12
+ <?php if (count($items)): ?>
13
+ <?php $row = 0 ?>
14
+ <?php foreach ($items as $key => $value): ?>
15
+ <tr>
16
+ <td><?php echo $row ?></td>
17
+ <td><?php echo $key ?></td>
18
+ <td><?php echo htmlspecialchars($value['class']) ?></td>
19
+ <td><?php echo htmlspecialchars($value['filepath']) ?></td>
20
+ </tr>
21
+ <?php $row++ ?>
22
+ <?php endforeach; ?>
23
+ <?php else: ?>
24
+ <tr><td colspan="3">Grouped classes not found for this uri.</td></tr>
25
+ <?php endif; ?>
26
+ </div>
27
+ </tbody>
28
+ </table>
app/design/frontend/base/default/template/olctw_debug/handledetails.phtml ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $title ?></h3>
4
+ </div>
5
+
6
+ <div class="djDebugPanelContent">
7
+ <div class="scroll">
8
+ <h4><?php echo $this->__('Layout Updates For This Handle') ?> (<?php echo count($handleFiles); ?>)</h4>
9
+ <table>
10
+ <thead>
11
+ <tr>
12
+ <th><?php echo $this->__('Update xml file') ?></th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+ <?php $row = 0; ?>
17
+ <?php foreach ($handleFiles as $filename => $handleUpdates): ?>
18
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
19
+ <td class="syntax"><h5><?php echo $filename ?></h5></td>
20
+ </tr>
21
+
22
+ <?php foreach ($handleUpdates as $update): ?>
23
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>"><td>
24
+ <code><?php echo htmlspecialchars($update->asXML()) ?></code>
25
+ </td></tr>
26
+ <?php endforeach; ?>
27
+ <?php $row++; ?>
28
+ <?php endforeach ?>
29
+ </tbody>
30
+ </table>
31
+
32
+ </div>
33
+ </div>
app/design/frontend/base/default/template/olctw_debug/layout.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Layout */
3
+ $layout = Mage::getSingleton('core/layout');
4
+ $layoutHandles = Mage::getSingleton('core/layout')->getUpdate()->getHandles();
5
+ $layoutUpdates = Mage::getSingleton('core/layout')->getUpdate()->asArray();
6
+
7
+ /* @var $designPackage Mage_Core_Model_Design_Package */
8
+ $designPackage = Mage::getSingleton('core/design_package');
9
+ ?>
10
+
11
+ <h4><?php echo $this->__('Package information') ?></h4>
12
+ <table>
13
+ <thead>
14
+ <tr>
15
+ <th><?php echo $this->__('Variable') ?></th>
16
+ <th><?php echo $this->__('Value') ?></th>
17
+ </tr>
18
+ </thead>
19
+ <tbody>
20
+ <tr class="djDebugOdd">
21
+ <td><?php echo $this->__('Design Area') ?></td>
22
+ <td><?php echo $designPackage->getArea() ?></td>
23
+ </tr>
24
+ <tr class="djDebugEven">
25
+ <td><?php echo $this->__('Package Name') ?></td>
26
+ <td><?php echo $designPackage->getPackageName() ?></td>
27
+ </tr>
28
+ <tr class="djDebugOdd">
29
+ <td><?php echo $this->__('Template Theme') ?></td>
30
+ <td><?php echo $designPackage->getTheme('template') ?></td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ <h4><?php echo $this->__('Handles for this request');
36
+ echo "(" . count($layoutHandles) . ")" ?></h4>
37
+ <table>
38
+ <thead>
39
+ <tr>
40
+ <th><?php echo $this->__('Handle') ?></th>
41
+ </tr>
42
+ </thead>
43
+ <tbody>
44
+ <?php $row = 0; ?>
45
+ <?php foreach ($layoutHandles as $item): ?>
46
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
47
+ <td><a class="remoteCall toggleTemplate" href="<?php echo $this->getViewHandleUrl($item) ?>"><?php echo $item ?></a></td>
48
+ </tr>
49
+ <?php $row++; ?>
50
+ <?php endforeach ?>
51
+ </tbody>
52
+ </table>
53
+
54
+ <dl>
55
+ <dt><strong>Page Layout</strong></dt>
56
+ <dd>
57
+ <div class="djTemplateShowContextDiv"><a class="djTemplateShowContext"><span class="toggleArrow">&#x25B6;</span>View Page Layout</a></div>
58
+ <div class="djTemplateHideContextDiv" style="display:none;">
59
+ <code><?php echo htmlspecialchars($layout->getNode()->asXML()) ?></code>
60
+ </div>
61
+ </dd>
62
+ </dl>
63
+
64
+ <h4><?php echo $this->__('Layout updates') ?> (<?php echo count($layoutUpdates); ?>)</h4>
65
+ <table>
66
+ <thead>
67
+ <tr>
68
+ <th><?php echo $this->__('#'); ?></th>
69
+ <th><?php echo $this->__('Update') ?></th>
70
+ </tr>
71
+ </thead>
72
+ <tbody>
73
+ <?php $row = 0; ?>
74
+ <?php foreach ($layoutUpdates as $item): ?>
75
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
76
+ <td><?php echo $row ?>.</td>
77
+ <td class="syntax">
78
+ <code><?php echo htmlspecialchars($item) ?></code>
79
+ </td>
80
+ </tr>
81
+ <?php $row++; ?>
82
+ <?php endforeach ?>
83
+ </tbody>
84
+ </table>
85
+
app/design/frontend/base/default/template/olctw_debug/logdetails.phtml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $title ?></h3>
4
+ </div>
5
+
6
+ <div class="djDebugPanelContent">
7
+ <div class="scroll">
8
+
9
+ <table class="djSqlExplain">
10
+ <tbody>
11
+ <?php $row = 0; ?>
12
+ <?php foreach ($items as $index => $row): ?>
13
+ <tr class="<?php echo ( ($index % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
14
+ <td><?php echo $row; ?></td>
15
+ </tr>
16
+ <?php endforeach; ?>
17
+ </tbody>
18
+ </table>
19
+ </div>
20
+ </div>
21
+
app/design/frontend/base/default/template/olctw_debug/logs.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <h4><?php echo $this->__('View content of logs file'); ?></h4>
2
+
3
+ <a class="remoteCall toggleTemplate"
4
+ href="<?php echo Mage::getUrl('debug/index/viewLog', array('file' => Mage::getStoreConfig('dev/log/file'))); ?>">
5
+ <?php echo Mage::getStoreConfig('dev/log/file'); ?>
6
+ </a>
7
+ <a class="remoteCall toggleTemplate"
8
+ href="<?php echo Mage::getUrl('debug/index/viewLog', array('file' => Mage::getStoreConfig('dev/log/exception_file'))); ?>">
9
+ <?php echo Mage::getStoreConfig('dev/log/exception_file'); ?>
10
+ </a>
app/design/frontend/base/default/template/olctw_debug/models.phtml ADDED
@@ -0,0 +1,92 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Models */
3
+
4
+ $items = $this->getItems();
5
+ Mage::helper('debug')->sortModelsByOccurrences($items);
6
+ $collections = $this->getCollections();
7
+ $queries = $this->getQueries();
8
+ ?>
9
+ <h4><?php echo $this->__('MODELS') ?></h4>
10
+ <table>
11
+ <thead>
12
+ <tr>
13
+ <th><?php echo $this->__('Resource Name') ?></th>
14
+ <th><?php echo $this->__('Model Class') ?></th>
15
+ <th><?php echo $this->__('Times Instantiated') ?></th>
16
+ </tr>
17
+ </thead>
18
+ <tbody>
19
+ <?php $row = 0; ?>
20
+ <?php foreach ($items as $item): ?>
21
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
22
+ <td><?php echo $item['resource_name'] ?></td>
23
+ <td><?php echo $item['class'] ?></td>
24
+ <td><?php echo $item['occurrences'] ?></td>
25
+ </tr>
26
+ <?php $row++; ?>
27
+ <?php endforeach ?>
28
+ </tbody>
29
+ </table>
30
+
31
+ <h4><?php echo $this->__('COLLECTIONS') ?></h4>
32
+ <table>
33
+ <thead>
34
+ <tr>
35
+ <th><?php echo $this->__('Type') ?></th>
36
+ <th><?php echo $this->__('Class') ?></th>
37
+ <th><?php echo $this->__('SQL') ?></th>
38
+ </tr>
39
+ </thead>
40
+ <tbody>
41
+ <?php $row = 0; ?>
42
+ <?php foreach ($collections as $item): ?>
43
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
44
+ <td><?php echo $item['type'] ?></td>
45
+ <td><?php echo $item['class'] ?></td>
46
+ <td><?php echo $item['sql'] ?></td>
47
+ </tr>
48
+ <?php $row++; ?>
49
+ <?php endforeach ?>
50
+ </tbody>
51
+ </table>
52
+ <h4><?php echo $this->__('QUERIES') ?></h4>
53
+ <?php if ($queries): ?>
54
+ <p><a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/toggleSqlProfiler') ?>">Disable SQL Profiler</a></p>
55
+ <table>
56
+ <thead>
57
+ <tr>
58
+ <th><?php echo $this->__('Time') ?></th>
59
+ <th><?php echo $this->__('Action') ?></th>
60
+ <th><?php echo $this->__('Query') ?></th>
61
+ </tr>
62
+ </thead>
63
+ <tbody>
64
+ <?php $row = 0; ?>
65
+ <?php foreach ($queries as $item): ?>
66
+ <tr class="<?php echo ( ($row % 2 ? 'djDebugOdd' : 'djDebugEven')) ?>">
67
+ <td>
68
+ <div class=""><?php echo sprintf("%.4f", $item->getElapsedSecs()) ?>&nbsp;s</div>
69
+ </td>
70
+ <td>
71
+ <?php if ($item->getQueryType() == Zend_Db_Profiler::SELECT): ?>
72
+ <a class="remoteCall" href="<?php echo $this->getSqlSelectUrl($item) ?>">SELECT</a><br />
73
+ <a class="remoteCall" href="<?php echo $this->getSqlExplainUrl($item) ?>">EXPLAIN</a><br />
74
+ <?php endif; ?>
75
+ </td>
76
+ <td class="syntax">
77
+ <div class="djDebugSqlWrap">
78
+ <div class="djDebugSql"><?php echo $item->getQuery() ?>
79
+ <?php if (count($item->getQueryParams())): ?>
80
+ <br/><strong>Params:</strong> <?php echo implode(', ', $item->getQueryParams()); ?>
81
+ <?php endif; ?>
82
+ </div>
83
+ </div>
84
+ </td>
85
+ </tr>
86
+ <?php $row++; ?>
87
+ <?php endforeach ?>
88
+ </tbody>
89
+ </table>
90
+ <?php else: ?>
91
+ <p>SQL Profiler is not enabled. <a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/toggleSqlProfiler') ?>">Enable SQL Profiler</a></p>
92
+ <?php endif; ?>
app/design/frontend/base/default/template/olctw_debug/performance.phtml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
1
+ <?php ?>
2
+ <h4><?php $this->__('Performance') ?></h4>
3
+ <dl>
4
+ <dt><strong>
5
+ <a class="toggleTemplate" href="<?php echo Mage::getUrl('debug/index/clearCache') ?>">
6
+ <?php echo $this->__('Clear Magento Cache'); ?>
7
+ </a>
8
+ </strong></dt>
9
+ </dl>
10
+
app/design/frontend/base/default/template/olctw_debug/preferences.phtml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* @var $this Magneto_Debug_Block_Preferences */
3
+ $panels = $this->getPanels();
4
+
5
+ /* @var $helper Magneto_Debug_Helper_Data */
6
+ $helper = Mage::helper('debug');
7
+ ?>
8
+
9
+ <h4><?php echo $this->__('Visible Panels') ?></h4>
10
+ <form method="post" action="<?php echo $this->getFormUrl() ?>" name="preferences-form">
11
+ <?php foreach ($panels as $panel): ?>
12
+ <input type="checkbox" name="<?php echo strtolower($panel['title']) ?>" id="<?php echo $panel['dom_id'] . '_visibility' ?>"
13
+ <?php if ($helper->isPanelVisible($panel['title'])): ?>checked<?php endif ?>>
14
+ <label for="<?php echo $panel['dom_id'] . '_visibility' ?>"><?php echo $panel['title'] ?></label><br>
15
+ <?php endforeach ?>
16
+
17
+ <button class="form-button" type="submit"><span>Update</span></button>
18
+ </form>
app/design/frontend/base/default/template/olctw_debug/simplepanel.phtml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <div class="djDebugPanelTitle">
2
+ <a class="djDebugClose djDebugBack" href="">"Back"</a>
3
+ <h3><?php echo $this->__($title) ?></h3>
4
+ </div>
5
+ <div class="djDebugPanelContent">
6
+ <div class="scroll">
7
+ <code><?php echo $this->__($content) ?></code>
8
+ </div>
9
+ </div>
app/design/frontend/base/default/template/olctw_debug/utils.phtml ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php ?>
2
+ <h4>Grouped Class Search</h4>
3
+ <form action="#" id="class-search-form" onSubmit="submitGroupedClassSearch(); return false;">
4
+ <input name="uri" class="input-text required-entry" type="search" size="40" />
5
+ <select name="group" class="input-select required-entry">
6
+ <option>all</option>
7
+ <option>model</option>
8
+ <option>block</option>
9
+ <option>helper</option>
10
+ </select>
11
+ <input type="button" onClick="submitGroupedClassSearch()" value="<?php echo $this->__('Search Grouped Class Name') ?>" />
12
+ </form>
13
+ <p>
14
+ Search examples: <em>catalog/product</em>, <em>core/url</em>, etc.
15
+ </p>
16
+
17
+ <script type="text/javascript">
18
+ function submitGroupedClassSearch(){
19
+ var request = new Ajax.Updater(
20
+ 'class-search-results',
21
+ '<?php echo $this->getUrl("debug/index/searchGroupedClass") ?>',
22
+ {
23
+ method: 'post',
24
+ parameters: Form.serialize($('class-search-form'))
25
+ });
26
+ }
27
+ </script>
28
+ <div id="class-search-results">
29
+ <table>
30
+ <thead>
31
+ <tr>
32
+ <th><?php echo $this->__('#') ?></th>
33
+ <th><?php echo $this->__('Group Type') ?></th>
34
+ <th><?php echo $this->__('Class') ?></th>
35
+ <th><?php echo $this->__('File path') ?></th>
36
+ </tr>
37
+ </thead>
38
+ <tbody>
39
+ </tbody>
40
+ </table>
41
+ </div>
app/design/frontend/base/default/template/olctw_debug/versions.phtml ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <table>
2
+ <thead>
3
+ <tr>
4
+ <th><?php echo $this->__("Module") ?></th>
5
+ <th><?php echo $this->__("Version") ?></th>
6
+ <th><?php echo $this->__("Status") ?></th>
7
+ <th><?php echo $this->__("Actions") ?></th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <?php $row = 0; ?>
12
+ <?php foreach ($this->getItems() as $item): ?>
13
+ <tr class="<?php echo (($row % 2) ? 'djDebugOdd' : 'djDebugEven') ?>">
14
+ <td><?php echo $item['module'] ?></td>
15
+ <td><?php echo $item['version'] ?></td>
16
+ <td><?php echo $item['active'] ?></td>
17
+ <td><a class="remoteCall" href="<?php echo Mage::getUrl('debug/index/toggleModuleStatus', array('_query' => array('module' => $item['module']))) ?>">Toggle Status</a><td>
18
+ </tr>
19
+ <?php $row++; ?>
20
+ <?php endforeach; ?>
21
+ </tbody>
22
+ </table>
app/etc/modules/Olctw_Debug.xml ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <config>
3
+ <modules>
4
+ <Olctw_Debug>
5
+ <active>true</active>
6
+ <codePool>community</codePool>
7
+ </Olctw_Debug>
8
+ </modules>
9
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Olctw_Debug</name>
4
+ <version>1.1.0</version>
5
+ <stability>stable</stability>
6
+ <license>Open Software License (OSL 3.0)</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>A debug tool bar for developers of magento commerce community 1.7 or higher.</summary>
10
+ <description>Based on the version provided from https://github.com/madalinoprea/magneto-debug . We first try to make it working under 1.7 or higher version. Everyone is welcome to report issue and fork it in https://github.com/kiang/magneto-debug .</description>
11
+ <notes>Just migrated the extension to be able to work under Magento community 1.7.0.0.</notes>
12
+ <authors><author><name>Just This Computer Studio ( http://olc.tw )</name><user>kiang</user><email>service@olc.tw</email></author></authors>
13
+ <date>2013-05-01</date>
14
+ <time>16:02:43</time>
15
+ <contents><target name="magecommunity"><dir name="Olctw"><dir name="Debug"><dir name="Block"><file name="Abstract.php" hash="e28c82e3bccc26c80917b94b50629439"/><file name="Blocks.php" hash="101756f33cbe798b305e387357492741"/><file name="Config.php" hash="726a712eb85246e55640a53bff33ea25"/><file name="Controller.php" hash="01394f0e5b7df1226fe71702426c43d0"/><file name="Debug.php" hash="763d11c18b44ca39db67a39e01e61e62"/><file name="Layout.php" hash="37978bc6b5f192409a0bd53f66f3bcf9"/><file name="Models.php" hash="62efb9f7b8c07de7e4afc7d72ae32d34"/><file name="Preferences.php" hash="db4df2f0eed05ee017b5f7dca3dc09f1"/><file name="Versions.php" hash="d9e101822db6b6f14fd3e3bdc78d6693"/></dir><dir name="Helper"><file name="Data.php" hash="1030805541b82c93cb53641f6c18f322"/></dir><dir name="Model"><file name="Observer.php" hash="7a2e2574e1261a9171ceba04b6454bcb"/></dir><dir name="controllers"><file name="IndexController.php" hash="7439129c897fac87d3412fd96cf48480"/><file name="PreferencesController.php" hash="b22689eb701cdf246399e08729b5cad2"/></dir><dir name="etc"><file name="config.xml" hash="a87e7e9b642e7b56e54dc51dbf8320a3"/><file name="system.xml" hash="0e7a9cb88940c60e555b69e917218386"/></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="olctw_debug"><file name="arrayformat.phtml" hash="182e206b9e3298c75b842cded4d0e082"/><file name="blocks.phtml" hash="e303425969eb0aafb47e744e5e7b19e5"/><file name="config.phtml" hash="ae389d2f340a5fe7d3ae40a683368065"/><file name="configsearch.phtml" hash="ca657bd4f91e6d8726c551c69ba4d576"/><file name="controller.phtml" hash="2c66129f8fa003b18bf32d3e4a85aa7d"/><file name="debug.phtml" hash="73011bb170e7611b8bb9c70e5ab82d6c"/><file name="groupedclasssearch.phtml" hash="9a15022d9cb41805b42ad3a6a645fb6f"/><file name="handledetails.phtml" hash="e24e48a597817fdbff2c474fa5cf2c9a"/><file name="layout.phtml" hash="cabae1232ed3c36df2194b7c8ed1aeba"/><file name="logdetails.phtml" hash="ed71a2facfe2a2b630e9f532ae84f1fa"/><file name="logs.phtml" hash="1f165856e61b67db3456acd5e23bf4a1"/><file name="models.phtml" hash="496cb60e17b91e967153450b2c8e44dd"/><file name="performance.phtml" hash="ba09274957f58ff223233bcc60e18ad4"/><file name="preferences.phtml" hash="c3234a8eab0ab61ec5a9baf1cbdd1c0c"/><file name="simplepanel.phtml" hash="e25f827850caeeb542caa6c3e389379c"/><file name="utils.phtml" hash="d3554c17eed75cdcb87c1d9351b9666a"/><file name="versions.phtml" hash="37c089ff3dca334f887c0fdb230ce6da"/></dir></dir><dir name="layout"><dir name="olctw_debug"><file name="debug.xml" hash="b775c800fecf8b2d0fef6ed9da9f4690"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="olctw_debug"><file name="arrayformat.phtml" hash="182e206b9e3298c75b842cded4d0e082"/><file name="blocks.phtml" hash="e303425969eb0aafb47e744e5e7b19e5"/><file name="config.phtml" hash="ae389d2f340a5fe7d3ae40a683368065"/><file name="configsearch.phtml" hash="ca657bd4f91e6d8726c551c69ba4d576"/><file name="controller.phtml" hash="2c66129f8fa003b18bf32d3e4a85aa7d"/><file name="debug.phtml" hash="73011bb170e7611b8bb9c70e5ab82d6c"/><file name="groupedclasssearch.phtml" hash="9a15022d9cb41805b42ad3a6a645fb6f"/><file name="handledetails.phtml" hash="e24e48a597817fdbff2c474fa5cf2c9a"/><file name="layout.phtml" hash="cabae1232ed3c36df2194b7c8ed1aeba"/><file name="logdetails.phtml" hash="ed71a2facfe2a2b630e9f532ae84f1fa"/><file name="logs.phtml" hash="1f165856e61b67db3456acd5e23bf4a1"/><file name="models.phtml" hash="496cb60e17b91e967153450b2c8e44dd"/><file name="performance.phtml" hash="ba09274957f58ff223233bcc60e18ad4"/><file name="preferences.phtml" hash="c3234a8eab0ab61ec5a9baf1cbdd1c0c"/><file name="simplepanel.phtml" hash="e25f827850caeeb542caa6c3e389379c"/><file name="utils.phtml" hash="d3554c17eed75cdcb87c1d9351b9666a"/><file name="versions.phtml" hash="37c089ff3dca334f887c0fdb230ce6da"/></dir></dir><dir name="layout"><dir name="olctw_debug"><file name="debug.xml" hash="b775c800fecf8b2d0fef6ed9da9f4690"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Olctw_Debug.xml" hash="fa7f2e82090d08d7d22b29cc33967249"/></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="olctw_debug"><dir name="css"><file name="toolbar.css" hash="a27ddb92c1a40d7f939259f3bf918419"/></dir><dir name="img"><file name="back.png" hash="64efd4aff01ee220183867b295390dc9"/><file name="back_hover.png" hash="2f40a29790969f1dc280740f2351cb34"/><file name="close.png" hash="6c12b2e804cc3027942473db15a03f48"/><file name="close_hover.png" hash="cc81bbd1cf1acb56325f590a55f88988"/><file name="djdt_vertical.png" hash="504d215839926b66de611020af6de7f0"/><file name="indicator.png" hash="b5677e8869a359a8941fd2fc3b5553f4"/><file name="loader.gif" hash="31f39e1edfd811606e45e4de38f16a49"/><file name="panel_bg.png" hash="0eabad5fe24f2dab304977b924040b8d"/></dir><dir name="js"><file name="jquery.cookie.js" hash="384772142d1907d7d3aea3ac11fad9d0"/><file name="jquery.js" hash="03733a1e6214125f2ebb5eade76b2561"/><file name="toolbar.js" hash="fafa0a4862e046c9aad1cb4d64ee9a4f"/></dir></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies><required><php><min>5.0.0</min><max>6.0.0</max></php></required></dependencies>
18
+ </package>
skin/frontend/base/default/olctw_debug/css/toolbar.css ADDED
@@ -0,0 +1,402 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Debug Toolbar CSS Reset, adapted from Eric Meyer's CSS Reset */
2
+ #djDebug {color:#000;background:#FFF;}
3
+ #djDebug, #djDebug div, #djDebug span, #djDebug applet, #djDebug object, #djDebug iframe,
4
+ #djDebug h1, #djDebug h2, #djDebug h3, #djDebug h4, #djDebug h5, #djDebug h6, #djDebug p, #djDebug blockquote, #djDebug pre,
5
+ #djDebug a, #djDebug abbr, #djDebug acronym, #djDebug address, #djDebug big, #djDebug cite, #djDebug code,
6
+ #djDebug del, #djDebug dfn, #djDebug em, #djDebug font, #djDebug img, #djDebug ins, #djDebug kbd, #djDebug q, #djDebug s, #djDebug samp,
7
+ #djDebug small, #djDebug strike, #djDebug strong, #djDebug sub, #djDebug sup, #djDebug tt, #djDebug var,
8
+ #djDebug b, #djDebug u, #djDebug i, #djDebug center,
9
+ #djDebug dl, #djDebug dt, #djDebug dd, #djDebug ol, #djDebug ul, #djDebug li,
10
+ #djDebug fieldset, #djDebug form, #djDebug label, #djDebug legend,
11
+ #djDebug table, #djDebug caption, #djDebug tbody, #djDebug tfoot, #djDebug thead, #djDebug tr, #djDebug th, #djDebug td {
12
+ margin:0;
13
+ padding:0;
14
+ border:0;
15
+ outline:0;
16
+ font-size:12px;
17
+ line-height:1.5em;
18
+ color:#000;
19
+ vertical-align:baseline;
20
+ background:transparent;
21
+ font-family:sans-serif;
22
+ text-align:left;
23
+ }
24
+
25
+ #djDebug #djDebugToolbar {
26
+ background:#111;
27
+ width:200px;
28
+ z-index:100000000;
29
+ position:fixed;
30
+ top:0;
31
+ bottom:0;
32
+ right:0;
33
+ opacity:0.9;
34
+ }
35
+
36
+ #djDebug #djDebugToolbar small {
37
+ color:#999;
38
+ }
39
+
40
+ #djDebug #djDebugToolbar ul {
41
+ margin:0;
42
+ padding:0;
43
+ list-style:none;
44
+ }
45
+
46
+ #djDebug #djDebugToolbar li {
47
+ border-bottom:1px solid #222;
48
+ color:#fff;
49
+ display:block;
50
+ font-weight:bold;
51
+ float:none;
52
+ margin:0;
53
+ padding:0;
54
+ position:relative;
55
+ width:auto;
56
+ }
57
+
58
+ #djDebug #djDebugToolbar li>a,
59
+ #djDebug #djDebugToolbar li>div.contentless {
60
+ font-weight:normal;
61
+ font-style:normal;
62
+ text-decoration:none;
63
+ display:block;
64
+ font-size:16px;
65
+ padding:10px 10px 5px 25px;
66
+ color:#fff;
67
+ }
68
+
69
+ #djDebug #djDebugToolbar li a:hover {
70
+ color:#111;
71
+ background-color:#ffc;
72
+ }
73
+
74
+ #djDebug #djDebugToolbar li.active {
75
+ background-image:url(../img/indicator.png);
76
+ background-repeat:no-repeat;
77
+ background-position:left center;
78
+ background-color:#333;
79
+ padding-left:10px;
80
+ }
81
+
82
+ #djDebug #djDebugToolbar li.active a:hover {
83
+ color:#b36a60;
84
+ background-color:transparent;
85
+ }
86
+
87
+ #djDebug #djDebugToolbar li small {
88
+ font-size:12px;
89
+ color:#999;
90
+ font-style:normal;
91
+ text-decoration:none;
92
+ font-variant:small-caps;
93
+ }
94
+
95
+ #djDebug #djDebugToolbarHandle {
96
+ position:fixed;
97
+ background:#fff;
98
+ border:1px solid #111;
99
+ top:30px;
100
+ right:0;
101
+ z-index:100000000;
102
+ opacity:0.75;
103
+ }
104
+
105
+ #djDebug a#djShowToolBarButton {
106
+ display:block;
107
+ height:75px;
108
+ width:30px;
109
+ border-right:none;
110
+ border-bottom:4px solid #fff;
111
+ border-top:4px solid #fff;
112
+ border-left:4px solid #fff;
113
+ color:#fff;
114
+ font-size:10px;
115
+ font-weight:bold;
116
+ text-decoration:none;
117
+ text-align:center;
118
+ text-indent:-999999px;
119
+ background:#000 url(../img/djdt_vertical.png) no-repeat left center;
120
+ opacity:0.5;
121
+ }
122
+
123
+ #djDebug a#djShowToolBarButton:hover {
124
+ background-color:#111;
125
+ padding-right:6px;
126
+ border-top-color:#FFE761;
127
+ border-left-color:#FFE761;
128
+ border-bottom-color:#FFE761;
129
+ opacity:1.0;
130
+ }
131
+
132
+ #djDebug code {
133
+ display:block;
134
+ font-family:Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace;
135
+ white-space:pre;
136
+ overflow:auto;
137
+ }
138
+
139
+ #djDebug code span {
140
+ font-family:Consolas, Monaco, "Bitstream Vera Sans Mono", "Lucida Console", monospace;
141
+ }
142
+
143
+ #djDebug tr.djDebugOdd {
144
+ background-color:#f5f5f5;
145
+ }
146
+
147
+ #djDebug .panelContent {
148
+ display:none;
149
+ position:fixed;
150
+ margin:0;
151
+ top:0;
152
+ right:200px;
153
+ bottom:0;
154
+ left:0px;
155
+ background-color:#eee;
156
+ color:#666;
157
+ z-index:100000000;
158
+ }
159
+
160
+ #djDebug .panelContent > div {
161
+ border-bottom:1px solid #ddd;
162
+ }
163
+
164
+ #djDebug .djDebugPanelTitle {
165
+ position:absolute;
166
+ background-color:#ffc;
167
+ color:#666;
168
+ padding-left:20px;
169
+ top:0;
170
+ right:0;
171
+ left:0;
172
+ height:50px;
173
+ }
174
+
175
+ #djDebug .djDebugPanelTitle code {
176
+ display:inline;
177
+ font-size:inherit;
178
+ }
179
+
180
+ #djDebug .djDebugPanelContent {
181
+ position:absolute;
182
+ top:50px;
183
+ right:0;
184
+ bottom:0;
185
+ left:0;
186
+ height:auto;
187
+ padding:0 0 0 20px;
188
+ }
189
+
190
+ #djDebug .djDebugPanelContent .scroll {
191
+ height:100%;
192
+ overflow:auto;
193
+ display:block;
194
+ padding:0 10px 0 0;
195
+ }
196
+
197
+ #djDebug h3 {
198
+ font-size:24px;
199
+ font-weight:normal;
200
+ line-height:50px;
201
+ }
202
+
203
+ #djDebug h4 {
204
+ font-size:20px;
205
+ font-weight:bold;
206
+ margin-top:0.8em;
207
+ }
208
+
209
+ #djDebug .panelContent table {
210
+ border:1px solid #ccc;
211
+ border-collapse:collapse;
212
+ width:100%;
213
+ background-color:#fff;
214
+ display:block;
215
+ margin-top:0.8em;
216
+ overflow: auto;
217
+ }
218
+ #djDebug .panelContent tbody td,
219
+ #djDebug .panelContent tbody th {
220
+ vertical-align:top;
221
+ padding:2px 3px;
222
+ }
223
+ #djDebug .panelContent thead th {
224
+ padding:1px 6px 1px 3px;
225
+ text-align:left;
226
+ font-weight:bold;
227
+ font-size:14px;
228
+ }
229
+ #djDebug .panelContent tbody th {
230
+ width:12em;
231
+ text-align:right;
232
+ color:#666;
233
+ padding-right:.5em;
234
+ }
235
+
236
+ #djDebug .djTemplateHideContextDiv {
237
+ background-color:#fff;
238
+ }
239
+
240
+ /*
241
+ #djDebug .panelContent p a:hover, #djDebug .panelContent dd a:hover {
242
+ color:#111;
243
+ background-color:#ffc;
244
+ }
245
+
246
+ #djDebug .panelContent p {
247
+ padding:0 5px;
248
+ }
249
+
250
+ #djDebug .panelContent p, #djDebug .panelContent table, #djDebug .panelContent ol, #djDebug .panelContent ul, #djDebug .panelContent dl {
251
+ margin:5px 0 15px;
252
+ background-color:#fff;
253
+ }
254
+ #djDebug .panelContent table {
255
+ clear:both;
256
+ border:0;
257
+ padding:0;
258
+ margin:0;
259
+ border-collapse:collapse;
260
+ border-spacing:0;
261
+ }
262
+
263
+ #djDebug .panelContent table a {
264
+ color:#000;
265
+ padding:2px 4px;
266
+ }
267
+ #djDebug .panelContent table a:hover {
268
+ background-color:#ffc;
269
+ }
270
+
271
+ #djDebug .panelContent table th {
272
+ background-color:#333;
273
+ font-weight:bold;
274
+ color:#fff;
275
+ padding:3px 7px 3px;
276
+ text-align:left;
277
+ cursor:pointer;
278
+ }
279
+ #djDebug .panelContent table td {
280
+ padding:5px 10px;
281
+ font-size:14px;
282
+ background:#fff;
283
+ color:#000;
284
+ vertical-align:top;
285
+ border:0;
286
+ }
287
+ #djDebug .panelContent table tr.djDebugOdd td {
288
+ background:#eee;
289
+ }
290
+ */
291
+
292
+ #djDebug .panelContent .djDebugClose {
293
+ text-indent:-9999999px;
294
+ display:block;
295
+ position:absolute;
296
+ top:4px;
297
+ right:15px;
298
+ height:40px;
299
+ width:40px;
300
+ background:url(../img/close.png) no-repeat center center;
301
+ }
302
+
303
+ #djDebug .panelContent .djDebugClose:hover {
304
+ background-image:url(../img/close_hover.png);
305
+ }
306
+
307
+ #djDebug .panelContent .djDebugClose.djDebugBack {
308
+ background-image:url(../img/back.png);
309
+ }
310
+
311
+ #djDebug .panelContent .djDebugClose.djDebugBack:hover {
312
+ background-image:url(../img/back_hover.png);
313
+ }
314
+
315
+ #djDebug .panelContent dt, #djDebug .panelContent dd {
316
+ display:block;
317
+ }
318
+
319
+ #djDebug .panelContent dt {
320
+ margin-top:0.75em;
321
+ }
322
+
323
+ #djDebug .panelContent dd {
324
+ margin-left:10px;
325
+ }
326
+
327
+ #djDebug a.toggleTemplate {
328
+ padding:4px;
329
+ background-color:#bbb;
330
+ -moz-border-radius:3px;
331
+ -webkit-border-radius:3px;
332
+ }
333
+
334
+ #djDebug a.toggleTemplate:hover {
335
+ padding:4px;
336
+ background-color:#444;
337
+ color:#ffe761;
338
+ -moz-border-radius:3px;
339
+ -webkit-border-radius:3px;
340
+ }
341
+
342
+
343
+ #djDebug a.djTemplateShowContext, #djDebug a.djTemplateShowContext span.toggleArrow {
344
+ color:#999;
345
+ }
346
+
347
+ #djDebug a.djTemplateShowContext:hover, #djDebug a.djTemplateShowContext:hover span.toggleArrow {
348
+ color:#000;
349
+ cursor:pointer;
350
+ }
351
+
352
+ #djDebug .djDebugSqlWrap {
353
+ position:relative;
354
+ }
355
+
356
+ #djDebug .djDebugSql {
357
+ z-index:100000002;
358
+ }
359
+
360
+ #djDebug .djSQLHideStacktraceDiv tbody th {
361
+ text-align: left;
362
+ }
363
+
364
+ #djDebug .djSqlExplain td {
365
+ white-space: pre;
366
+ }
367
+
368
+ #djDebug span.djDebugLineChart {
369
+ background-color:#777;
370
+ height:3px;
371
+ position:absolute;
372
+ bottom:0;
373
+ top:0;
374
+ left:0;
375
+ display:block;
376
+ z-index:1000000001;
377
+ }
378
+ #djDebug span.djDebugLineChartWarning {
379
+ background-color:#900;
380
+ }
381
+
382
+ #djDebug .highlight { color:#000; }
383
+ #djDebug .highlight .err { color:#000; } /* Error */
384
+ #djDebug .highlight .g { color:#000; } /* Generic */
385
+ #djDebug .highlight .k { color:#000; font-weight:bold } /* Keyword */
386
+ #djDebug .highlight .o { color:#000; } /* Operator */
387
+ #djDebug .highlight .n { color:#000; } /* Name */
388
+ #djDebug .highlight .mi { color:#000; font-weight:bold } /* Literal.Number.Integer */
389
+ #djDebug .highlight .l { color:#000; } /* Literal */
390
+ #djDebug .highlight .x { color:#000; } /* Other */
391
+ #djDebug .highlight .p { color:#000; } /* Punctuation */
392
+ #djDebug .highlight .m { color:#000; font-weight:bold } /* Literal.Number */
393
+ #djDebug .highlight .s { color:#333 } /* Literal.String */
394
+ #djDebug .highlight .w { color:#888888 } /* Text.Whitespace */
395
+ #djDebug .highlight .il { color:#000; font-weight:bold } /* Literal.Number.Integer.Long */
396
+ #djDebug .highlight .na { color:#333 } /* Name.Attribute */
397
+ #djDebug .highlight .nt { color:#000; font-weight:bold } /* Name.Tag */
398
+ #djDebug .highlight .nv { color:#333 } /* Name.Variable */
399
+ #djDebug .highlight .s2 { color:#333 } /* Literal.String.Double */
400
+ #djDebug .highlight .cp { color:#333 } /* Comment.Preproc */
401
+
402
+ #djDebug div.loader { background: url(../img/loader.gif); margin: 100px auto; width: 64px; height: 64px; border: none; }
skin/frontend/base/default/olctw_debug/img/back.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/back_hover.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/close.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/close_hover.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/djdt_vertical.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/indicator.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/loader.gif ADDED
Binary file
skin/frontend/base/default/olctw_debug/img/panel_bg.png ADDED
Binary file
skin/frontend/base/default/olctw_debug/js/jquery.cookie.js ADDED
@@ -0,0 +1,96 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /**
2
+ * Cookie plugin
3
+ *
4
+ * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
5
+ * Dual licensed under the MIT and GPL licenses:
6
+ * http://www.opensource.org/licenses/mit-license.php
7
+ * http://www.gnu.org/licenses/gpl.html
8
+ *
9
+ */
10
+
11
+ /**
12
+ * Create a cookie with the given name and value and other optional parameters.
13
+ *
14
+ * @example $.cookie('the_cookie', 'the_value');
15
+ * @desc Set the value of a cookie.
16
+ * @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '/', domain: 'jquery.com', secure: true });
17
+ * @desc Create a cookie with all available options.
18
+ * @example $.cookie('the_cookie', 'the_value');
19
+ * @desc Create a session cookie.
20
+ * @example $.cookie('the_cookie', null);
21
+ * @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain
22
+ * used when the cookie was set.
23
+ *
24
+ * @param String name The name of the cookie.
25
+ * @param String value The value of the cookie.
26
+ * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
27
+ * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
28
+ * If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
29
+ * If set to null or omitted, the cookie will be a session cookie and will not be retained
30
+ * when the the browser exits.
31
+ * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
32
+ * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
33
+ * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
34
+ * require a secure protocol (like HTTPS).
35
+ * @type undefined
36
+ *
37
+ * @name $.cookie
38
+ * @cat Plugins/Cookie
39
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
40
+ */
41
+
42
+ /**
43
+ * Get the value of a cookie with the given name.
44
+ *
45
+ * @example $.cookie('the_cookie');
46
+ * @desc Get the value of a cookie.
47
+ *
48
+ * @param String name The name of the cookie.
49
+ * @return The value of the cookie.
50
+ * @type String
51
+ *
52
+ * @name $.cookie
53
+ * @cat Plugins/Cookie
54
+ * @author Klaus Hartl/klaus.hartl@stilbuero.de
55
+ */
56
+ jQuery.cookie = function(name, value, options) {
57
+ if (typeof value != 'undefined') { // name and value given, set cookie
58
+ options = options || {};
59
+ if (value === null) {
60
+ value = '';
61
+ options.expires = -1;
62
+ }
63
+ var expires = '';
64
+ if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
65
+ var date;
66
+ if (typeof options.expires == 'number') {
67
+ date = new Date();
68
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
69
+ } else {
70
+ date = options.expires;
71
+ }
72
+ expires = '; expires=' + date.toUTCString(); // use expires attribute, max-age is not supported by IE
73
+ }
74
+ // CAUTION: Needed to parenthesize options.path and options.domain
75
+ // in the following expressions, otherwise they evaluate to undefined
76
+ // in the packed version for some reason...
77
+ var path = options.path ? '; path=' + (options.path) : '';
78
+ var domain = options.domain ? '; domain=' + (options.domain) : '';
79
+ var secure = options.secure ? '; secure' : '';
80
+ document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
81
+ } else { // only name given, get cookie
82
+ var cookieValue = null;
83
+ if (document.cookie && document.cookie != '') {
84
+ var cookies = document.cookie.split(';');
85
+ for (var i = 0; i < cookies.length; i++) {
86
+ var cookie = jQuery.trim(cookies[i]);
87
+ // Does this cookie string begin with the name we want?
88
+ if (cookie.substring(0, name.length + 1) == (name + '=')) {
89
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
90
+ break;
91
+ }
92
+ }
93
+ }
94
+ return cookieValue;
95
+ }
96
+ };
skin/frontend/base/default/olctw_debug/js/jquery.js ADDED
@@ -0,0 +1,3180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * jQuery JavaScript Library v1.4.1
3
+ * http://jquery.com/
4
+ *
5
+ * Copyright 2010, John Resig
6
+ * Dual licensed under the MIT or GPL Version 2 licenses.
7
+ * http://jquery.org/license
8
+ *
9
+ * Includes Sizzle.js
10
+ * http://sizzlejs.com/
11
+ * Copyright 2010, The Dojo Foundation
12
+ * Released under the MIT, BSD, and GPL Licenses.
13
+ *
14
+ * Date: Mon Jan 25 19:43:33 2010 -0500
15
+ */
16
+ (function(z,v){
17
+ function la(){
18
+ if(!c.isReady){
19
+ try{
20
+ r.documentElement.doScroll("left")
21
+ }catch(a){
22
+ setTimeout(la,1);
23
+ return
24
+ }
25
+ c.ready()
26
+ }
27
+ }
28
+ function Ma(a,b){
29
+ b.src?c.ajax({
30
+ url:b.src,
31
+ async:false,
32
+ dataType:"script"
33
+ }):c.globalEval(b.text||b.textContent||b.innerHTML||"");
34
+ b.parentNode&&b.parentNode.removeChild(b)
35
+ }
36
+ function X(a,b,d,f,e,i){
37
+ var j=a.length;
38
+ if(typeof b==="object"){
39
+ for(var n in b)X(a,n,b[n],f,e,d);return a
40
+ }
41
+ if(d!==v){
42
+ f=!i&&f&&c.isFunction(d);
43
+ for(n=0;n<j;n++)e(a[n],b,f?d.call(a[n],n,e(a[n],b)):d,i);
44
+ return a
45
+ }
46
+ return j?
47
+ e(a[0],b):null
48
+ }
49
+ function J(){
50
+ return(new Date).getTime()
51
+ }
52
+ function Y(){
53
+ return false
54
+ }
55
+ function Z(){
56
+ return true
57
+ }
58
+ function ma(a,b,d){
59
+ d[0].type=a;
60
+ return c.event.handle.apply(b,d)
61
+ }
62
+ function na(a){
63
+ var b,d=[],f=[],e=arguments,i,j,n,o,m,s,x=c.extend({},c.data(this,"events").live);
64
+ if(!(a.button&&a.type==="click")){
65
+ for(o in x){
66
+ j=x[o];
67
+ if(j.live===a.type||j.altLive&&c.inArray(a.type,j.altLive)>-1){
68
+ i=j.data;
69
+ i.beforeFilter&&i.beforeFilter[a.type]&&!i.beforeFilter[a.type](a)||f.push(j.selector)
70
+ }else delete x[o]
71
+ }
72
+ i=c(a.target).closest(f,
73
+ a.currentTarget);
74
+ m=0;
75
+ for(s=i.length;m<s;m++)for(o in x){
76
+ j=x[o];
77
+ n=i[m].elem;
78
+ f=null;
79
+ if(i[m].selector===j.selector){
80
+ if(j.live==="mouseenter"||j.live==="mouseleave")f=c(a.relatedTarget).closest(j.selector)[0];
81
+ if(!f||f!==n)d.push({
82
+ elem:n,
83
+ fn:j
84
+ })
85
+ }
86
+ }
87
+ m=0;
88
+ for(s=d.length;m<s;m++){
89
+ i=d[m];
90
+ a.currentTarget=i.elem;
91
+ a.data=i.fn.data;
92
+ if(i.fn.apply(i.elem,e)===false){
93
+ b=false;
94
+ break
95
+ }
96
+ }
97
+ return b
98
+ }
99
+ }
100
+ function oa(a,b){
101
+ return"live."+(a?a+".":"")+b.replace(/\./g,"`").replace(/ /g,"&")
102
+ }
103
+ function pa(a){
104
+ return!a||!a.parentNode||a.parentNode.nodeType===
105
+ 11
106
+ }
107
+ function qa(a,b){
108
+ var d=0;
109
+ b.each(function(){
110
+ if(this.nodeName===(a[d]&&a[d].nodeName)){
111
+ var f=c.data(a[d++]),e=c.data(this,f);
112
+ if(f=f&&f.events){
113
+ delete e.handle;
114
+ e.events={};
115
+
116
+ for(var i in f)for(var j in f[i])c.event.add(this,i,f[i][j],f[i][j].data)
117
+ }
118
+ }
119
+ })
120
+ }
121
+ function ra(a,b,d){
122
+ var f,e,i;
123
+ if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&a[0].indexOf("<option")<0&&(c.support.checkClone||!sa.test(a[0]))){
124
+ e=true;
125
+ if(i=c.fragments[a[0]])if(i!==1)f=i
126
+ }
127
+ if(!f){
128
+ b=b&&b[0]?b[0].ownerDocument||b[0]:r;
129
+ f=b.createDocumentFragment();
130
+ c.clean(a,b,f,d)
131
+ }
132
+ if(e)c.fragments[a[0]]=i?f:1;
133
+ return{
134
+ fragment:f,
135
+ cacheable:e
136
+ }
137
+ }
138
+ function K(a,b){
139
+ var d={};
140
+
141
+ c.each(ta.concat.apply([],ta.slice(0,b)),function(){
142
+ d[this]=a
143
+ });
144
+ return d
145
+ }
146
+ function ua(a){
147
+ return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false
148
+ }
149
+ var c=function(a,b){
150
+ return new c.fn.init(a,b)
151
+ },Na=z.jQuery,Oa=z.$,r=z.document,S,Pa=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Qa=/^.[^:#\[\.,]*$/,Ra=/\S/,Sa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Ta=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,O=navigator.userAgent,
152
+ va=false,P=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,Q=Array.prototype.slice,wa=Array.prototype.indexOf;
153
+ c.fn=c.prototype={
154
+ init:function(a,b){
155
+ var d,f;
156
+ if(!a)return this;
157
+ if(a.nodeType){
158
+ this.context=this[0]=a;
159
+ this.length=1;
160
+ return this
161
+ }
162
+ if(typeof a==="string")if((d=Pa.exec(a))&&(d[1]||!b))if(d[1]){
163
+ f=b?b.ownerDocument||b:r;
164
+ if(a=Ta.exec(a))if(c.isPlainObject(b)){
165
+ a=[r.createElement(a[1])];
166
+ c.fn.attr.call(a,b,true)
167
+ }else a=[f.createElement(a[1])];
168
+ else{
169
+ a=ra([d[1]],
170
+ [f]);
171
+ a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes
172
+ }
173
+ }else{
174
+ if(b=r.getElementById(d[2])){
175
+ if(b.id!==d[2])return S.find(a);
176
+ this.length=1;
177
+ this[0]=b
178
+ }
179
+ this.context=r;
180
+ this.selector=a;
181
+ return this
182
+ }else if(!b&&/^\w+$/.test(a)){
183
+ this.selector=a;
184
+ this.context=r;
185
+ a=r.getElementsByTagName(a)
186
+ }else return!b||b.jquery?(b||S).find(a):c(b).find(a);
187
+ else if(c.isFunction(a))return S.ready(a);
188
+ if(a.selector!==v){
189
+ this.selector=a.selector;
190
+ this.context=a.context
191
+ }
192
+ return c.isArray(a)?this.setArray(a):c.makeArray(a,
193
+ this)
194
+ },
195
+ selector:"",
196
+ jquery:"1.4.1",
197
+ length:0,
198
+ size:function(){
199
+ return this.length
200
+ },
201
+ toArray:function(){
202
+ return Q.call(this,0)
203
+ },
204
+ get:function(a){
205
+ return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]
206
+ },
207
+ pushStack:function(a,b,d){
208
+ a=c(a||null);
209
+ a.prevObject=this;
210
+ a.context=this.context;
211
+ if(b==="find")a.selector=this.selector+(this.selector?" ":"")+d;
212
+ else if(b)a.selector=this.selector+"."+b+"("+d+")";
213
+ return a
214
+ },
215
+ setArray:function(a){
216
+ this.length=0;
217
+ ba.apply(this,a);
218
+ return this
219
+ },
220
+ each:function(a,b){
221
+ return c.each(this,
222
+ a,b)
223
+ },
224
+ ready:function(a){
225
+ c.bindReady();
226
+ if(c.isReady)a.call(r,c);else P&&P.push(a);
227
+ return this
228
+ },
229
+ eq:function(a){
230
+ return a===-1?this.slice(a):this.slice(a,+a+1)
231
+ },
232
+ first:function(){
233
+ return this.eq(0)
234
+ },
235
+ last:function(){
236
+ return this.eq(-1)
237
+ },
238
+ slice:function(){
239
+ return this.pushStack(Q.apply(this,arguments),"slice",Q.call(arguments).join(","))
240
+ },
241
+ map:function(a){
242
+ return this.pushStack(c.map(this,function(b,d){
243
+ return a.call(b,d,b)
244
+ }))
245
+ },
246
+ end:function(){
247
+ return this.prevObject||c(null)
248
+ },
249
+ push:ba,
250
+ sort:[].sort,
251
+ splice:[].splice
252
+ };
253
+ c.fn.init.prototype=c.fn;
254
+ c.extend=c.fn.extend=function(){
255
+ var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,i,j,n;
256
+ if(typeof a==="boolean"){
257
+ f=a;
258
+ a=arguments[1]||{};
259
+
260
+ b=2
261
+ }
262
+ if(typeof a!=="object"&&!c.isFunction(a))a={};
263
+
264
+ if(d===b){
265
+ a=this;
266
+ --b
267
+ }
268
+ for(;b<d;b++)if((e=arguments[b])!=null)for(i in e){
269
+ j=a[i];
270
+ n=e[i];
271
+ if(a!==n)if(f&&n&&(c.isPlainObject(n)||c.isArray(n))){
272
+ j=j&&(c.isPlainObject(j)||c.isArray(j))?j:c.isArray(n)?[]:{};
273
+
274
+ a[i]=c.extend(f,j,n)
275
+ }else if(n!==v)a[i]=n
276
+ }
277
+ return a
278
+ };
279
+
280
+ c.extend({
281
+ noConflict:function(a){
282
+ z.$=
283
+ Oa;
284
+ if(a)z.jQuery=Na;
285
+ return c
286
+ },
287
+ isReady:false,
288
+ ready:function(){
289
+ if(!c.isReady){
290
+ if(!r.body)return setTimeout(c.ready,13);
291
+ c.isReady=true;
292
+ if(P){
293
+ for(var a,b=0;a=P[b++];)a.call(r,c);
294
+ P=null
295
+ }
296
+ c.fn.triggerHandler&&c(r).triggerHandler("ready")
297
+ }
298
+ },
299
+ bindReady:function(){
300
+ if(!va){
301
+ va=true;
302
+ if(r.readyState==="complete")return c.ready();
303
+ if(r.addEventListener){
304
+ r.addEventListener("DOMContentLoaded",L,false);
305
+ z.addEventListener("load",c.ready,false)
306
+ }else if(r.attachEvent){
307
+ r.attachEvent("onreadystatechange",L);
308
+ z.attachEvent("onload",
309
+ c.ready);
310
+ var a=false;
311
+ try{
312
+ a=z.frameElement==null
313
+ }catch(b){}
314
+ r.documentElement.doScroll&&a&&la()
315
+ }
316
+ }
317
+ },
318
+ isFunction:function(a){
319
+ return $.call(a)==="[object Function]"
320
+ },
321
+ isArray:function(a){
322
+ return $.call(a)==="[object Array]"
323
+ },
324
+ isPlainObject:function(a){
325
+ if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;
326
+ if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,"isPrototypeOf"))return false;
327
+ var b;
328
+ for(b in a);return b===v||aa.call(a,b)
329
+ },
330
+ isEmptyObject:function(a){
331
+ for(var b in a)return false;
332
+ return true
333
+ },
334
+ error:function(a){
335
+ throw a;
336
+ },
337
+ parseJSON:function(a){
338
+ if(typeof a!=="string"||!a)return null;
339
+ if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return z.JSON&&z.JSON.parse?z.JSON.parse(a):(new Function("return "+a))();else c.error("Invalid JSON: "+a)
340
+ },
341
+ noop:function(){},
342
+ globalEval:function(a){
343
+ if(a&&Ra.test(a)){
344
+ var b=r.getElementsByTagName("head")[0]||
345
+ r.documentElement,d=r.createElement("script");
346
+ d.type="text/javascript";
347
+ if(c.support.scriptEval)d.appendChild(r.createTextNode(a));else d.text=a;
348
+ b.insertBefore(d,b.firstChild);
349
+ b.removeChild(d)
350
+ }
351
+ },
352
+ nodeName:function(a,b){
353
+ return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()
354
+ },
355
+ each:function(a,b,d){
356
+ var f,e=0,i=a.length,j=i===v||c.isFunction(a);
357
+ if(d)if(j)for(f in a){
358
+ if(b.apply(a[f],d)===false)break
359
+ }else for(;e<i;){
360
+ if(b.apply(a[e++],d)===false)break
361
+ }else if(j)for(f in a){
362
+ if(b.call(a[f],f,a[f])===false)break
363
+ }else for(d=
364
+ a[0];e<i&&b.call(d,e,d)!==false;d=a[++e]);
365
+ return a
366
+ },
367
+ trim:function(a){
368
+ return(a||"").replace(Sa,"")
369
+ },
370
+ makeArray:function(a,b){
371
+ b=b||[];
372
+ if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);
373
+ return b
374
+ },
375
+ inArray:function(a,b){
376
+ if(b.indexOf)return b.indexOf(a);
377
+ for(var d=0,f=b.length;d<f;d++)if(b[d]===a)return d;return-1
378
+ },
379
+ merge:function(a,b){
380
+ var d=a.length,f=0;
381
+ if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==
382
+ v;)a[d++]=b[f++];
383
+ a.length=d;
384
+ return a
385
+ },
386
+ grep:function(a,b,d){
387
+ for(var f=[],e=0,i=a.length;e<i;e++)!d!==!b(a[e],e)&&f.push(a[e]);
388
+ return f
389
+ },
390
+ map:function(a,b,d){
391
+ for(var f=[],e,i=0,j=a.length;i<j;i++){
392
+ e=b(a[i],i,d);
393
+ if(e!=null)f[f.length]=e
394
+ }
395
+ return f.concat.apply([],f)
396
+ },
397
+ guid:1,
398
+ proxy:function(a,b,d){
399
+ if(arguments.length===2)if(typeof b==="string"){
400
+ d=a;
401
+ a=d[b];
402
+ b=v
403
+ }else if(b&&!c.isFunction(b)){
404
+ d=b;
405
+ b=v
406
+ }
407
+ if(!b&&a)b=function(){
408
+ return a.apply(d||this,arguments)
409
+ };
410
+
411
+ if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;
412
+ return b
413
+ },
414
+ uaMatch:function(a){
415
+ a=a.toLowerCase();
416
+ a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];
417
+ return{
418
+ browser:a[1]||"",
419
+ version:a[2]||"0"
420
+ }
421
+ },
422
+ browser:{}
423
+ });
424
+ O=c.uaMatch(O);
425
+ if(O.browser){
426
+ c.browser[O.browser]=true;
427
+ c.browser.version=O.version
428
+ }
429
+ if(c.browser.webkit)c.browser.safari=true;
430
+ if(wa)c.inArray=function(a,b){
431
+ return wa.call(b,a)
432
+ };
433
+
434
+ S=c(r);
435
+ if(r.addEventListener)L=function(){
436
+ r.removeEventListener("DOMContentLoaded",
437
+ L,false);
438
+ c.ready()
439
+ };
440
+ else if(r.attachEvent)L=function(){
441
+ if(r.readyState==="complete"){
442
+ r.detachEvent("onreadystatechange",L);
443
+ c.ready()
444
+ }
445
+ };
446
+ (function(){
447
+ c.support={};
448
+
449
+ var a=r.documentElement,b=r.createElement("script"),d=r.createElement("div"),f="script"+J();
450
+ d.style.display="none";
451
+ d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
452
+ var e=d.getElementsByTagName("*"),i=d.getElementsByTagName("a")[0];
453
+ if(!(!e||!e.length||!i)){
454
+ c.support=
455
+
456
+ {
457
+ leadingWhitespace:d.firstChild.nodeType===3,
458
+ tbody:!d.getElementsByTagName("tbody").length,
459
+ htmlSerialize:!!d.getElementsByTagName("link").length,
460
+ style:/red/.test(i.getAttribute("style")),
461
+ hrefNormalized:i.getAttribute("href")==="/a",
462
+ opacity:/^0.55$/.test(i.style.opacity),
463
+ cssFloat:!!i.style.cssFloat,
464
+ checkOn:d.getElementsByTagName("input")[0].value==="on",
465
+ optSelected:r.createElement("select").appendChild(r.createElement("option")).selected,
466
+ checkClone:false,
467
+ scriptEval:false,
468
+ noCloneEvent:true,
469
+ boxModel:null
470
+ };
471
+ b.type="text/javascript";
472
+ try{
473
+ b.appendChild(r.createTextNode("window."+f+"=1;"))
474
+ }catch(j){}
475
+ a.insertBefore(b,a.firstChild);
476
+ if(z[f]){
477
+ c.support.scriptEval=true;
478
+ delete z[f]
479
+ }
480
+ a.removeChild(b);
481
+ if(d.attachEvent&&d.fireEvent){
482
+ d.attachEvent("onclick",function n(){
483
+ c.support.noCloneEvent=false;
484
+ d.detachEvent("onclick",n)
485
+ });
486
+ d.cloneNode(true).fireEvent("onclick")
487
+ }
488
+ d=r.createElement("div");
489
+ d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";
490
+ a=r.createDocumentFragment();
491
+ a.appendChild(d.firstChild);
492
+ c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;
493
+ c(function(){
494
+ var n=r.createElement("div");
495
+ n.style.width=n.style.paddingLeft="1px";
496
+ r.body.appendChild(n);
497
+ c.boxModel=c.support.boxModel=n.offsetWidth===2;
498
+ r.body.removeChild(n).style.display="none"
499
+ });
500
+ a=function(n){
501
+ var o=r.createElement("div");
502
+ n="on"+n;
503
+ var m=n in o;
504
+ if(!m){
505
+ o.setAttribute(n,"return;");
506
+ m=typeof o[n]==="function"
507
+ }
508
+ return m
509
+ };
510
+
511
+ c.support.submitBubbles=a("submit");
512
+ c.support.changeBubbles=a("change");
513
+ a=b=d=e=i=null
514
+ }
515
+ })();
516
+ c.props=
517
+ {
518
+ "for":"htmlFor",
519
+ "class":"className",
520
+ readonly:"readOnly",
521
+ maxlength:"maxLength",
522
+ cellspacing:"cellSpacing",
523
+ rowspan:"rowSpan",
524
+ colspan:"colSpan",
525
+ tabindex:"tabIndex",
526
+ usemap:"useMap",
527
+ frameborder:"frameBorder"
528
+ };
529
+
530
+ var G="jQuery"+J(),Ua=0,xa={},Va={};
531
+
532
+ c.extend({
533
+ cache:{},
534
+ expando:G,
535
+ noData:{
536
+ embed:true,
537
+ object:true,
538
+ applet:true
539
+ },
540
+ data:function(a,b,d){
541
+ if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){
542
+ a=a==z?xa:a;
543
+ var f=a[G],e=c.cache;
544
+ if(!b&&!f)return null;
545
+ f||(f=++Ua);
546
+ if(typeof b==="object"){
547
+ a[G]=f;
548
+ e=e[f]=c.extend(true,
549
+
550
+ {},b)
551
+ }else e=e[f]?e[f]:typeof d==="undefined"?Va:(e[f]={});
552
+ if(d!==v){
553
+ a[G]=f;
554
+ e[b]=d
555
+ }
556
+ return typeof b==="string"?e[b]:e
557
+ }
558
+ },
559
+ removeData:function(a,b){
560
+ if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){
561
+ a=a==z?xa:a;
562
+ var d=a[G],f=c.cache,e=f[d];
563
+ if(b){
564
+ if(e){
565
+ delete e[b];
566
+ c.isEmptyObject(e)&&c.removeData(a)
567
+ }
568
+ }else{
569
+ try{
570
+ delete a[G]
571
+ }catch(i){
572
+ a.removeAttribute&&a.removeAttribute(G)
573
+ }
574
+ delete f[d]
575
+ }
576
+ }
577
+ }
578
+ });
579
+ c.fn.extend({
580
+ data:function(a,b){
581
+ if(typeof a==="undefined"&&this.length)return c.data(this[0]);
582
+ else if(typeof a==="object")return this.each(function(){
583
+ c.data(this,
584
+ a)
585
+ });
586
+ var d=a.split(".");
587
+ d[1]=d[1]?"."+d[1]:"";
588
+ if(b===v){
589
+ var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);
590
+ if(f===v&&this.length)f=c.data(this[0],a);
591
+ return f===v&&d[1]?this.data(d[0]):f
592
+ }else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){
593
+ c.data(this,a,b)
594
+ })
595
+ },
596
+ removeData:function(a){
597
+ return this.each(function(){
598
+ c.removeData(this,a)
599
+ })
600
+ }
601
+ });
602
+ c.extend({
603
+ queue:function(a,b,d){
604
+ if(a){
605
+ b=(b||"fx")+"queue";
606
+ var f=c.data(a,b);
607
+ if(!d)return f||[];
608
+ if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);
609
+ return f
610
+ }
611
+ },
612
+ dequeue:function(a,b){
613
+ b=b||"fx";
614
+ var d=c.queue(a,b),f=d.shift();
615
+ if(f==="inprogress")f=d.shift();
616
+ if(f){
617
+ b==="fx"&&d.unshift("inprogress");
618
+ f.call(a,function(){
619
+ c.dequeue(a,b)
620
+ })
621
+ }
622
+ }
623
+ });
624
+ c.fn.extend({
625
+ queue:function(a,b){
626
+ if(typeof a!=="string"){
627
+ b=a;
628
+ a="fx"
629
+ }
630
+ if(b===v)return c.queue(this[0],a);
631
+ return this.each(function(){
632
+ var d=c.queue(this,a,b);
633
+ a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)
634
+ })
635
+ },
636
+ dequeue:function(a){
637
+ return this.each(function(){
638
+ c.dequeue(this,a)
639
+ })
640
+ },
641
+ delay:function(a,b){
642
+ a=c.fx?c.fx.speeds[a]||
643
+ a:a;
644
+ b=b||"fx";
645
+ return this.queue(b,function(){
646
+ var d=this;
647
+ setTimeout(function(){
648
+ c.dequeue(d,b)
649
+ },a)
650
+ })
651
+ },
652
+ clearQueue:function(a){
653
+ return this.queue(a||"fx",[])
654
+ }
655
+ });
656
+ var ya=/[\n\t]/g,ca=/\s+/,Wa=/\r/g,Xa=/href|src|style/,Ya=/(button|input)/i,Za=/(button|input|object|select|textarea)/i,$a=/^(a|area)$/i,za=/radio|checkbox/;
657
+ c.fn.extend({
658
+ attr:function(a,b){
659
+ return X(this,a,b,true,c.attr)
660
+ },
661
+ removeAttr:function(a){
662
+ return this.each(function(){
663
+ c.attr(this,a,"");
664
+ this.nodeType===1&&this.removeAttribute(a)
665
+ })
666
+ },
667
+ addClass:function(a){
668
+ if(c.isFunction(a))return this.each(function(o){
669
+ var m=
670
+ c(this);
671
+ m.addClass(a.call(this,o,m.attr("class")))
672
+ });
673
+ if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){
674
+ var e=this[d];
675
+ if(e.nodeType===1)if(e.className)for(var i=" "+e.className+" ",j=0,n=b.length;j<n;j++){
676
+ if(i.indexOf(" "+b[j]+" ")<0)e.className+=" "+b[j]
677
+ }else e.className=a
678
+ }
679
+ return this
680
+ },
681
+ removeClass:function(a){
682
+ if(c.isFunction(a))return this.each(function(o){
683
+ var m=c(this);
684
+ m.removeClass(a.call(this,o,m.attr("class")))
685
+ });
686
+ if(a&&typeof a==="string"||a===v)for(var b=(a||"").split(ca),
687
+ d=0,f=this.length;d<f;d++){
688
+ var e=this[d];
689
+ if(e.nodeType===1&&e.className)if(a){
690
+ for(var i=(" "+e.className+" ").replace(ya," "),j=0,n=b.length;j<n;j++)i=i.replace(" "+b[j]+" "," ");
691
+ e.className=i.substring(1,i.length-1)
692
+ }else e.className=""
693
+ }
694
+ return this
695
+ },
696
+ toggleClass:function(a,b){
697
+ var d=typeof a,f=typeof b==="boolean";
698
+ if(c.isFunction(a))return this.each(function(e){
699
+ var i=c(this);
700
+ i.toggleClass(a.call(this,e,i.attr("class"),b),b)
701
+ });
702
+ return this.each(function(){
703
+ if(d==="string")for(var e,i=0,j=c(this),n=b,o=
704
+ a.split(ca);e=o[i++];){
705
+ n=f?n:!j.hasClass(e);
706
+ j[n?"addClass":"removeClass"](e)
707
+ }else if(d==="undefined"||d==="boolean"){
708
+ this.className&&c.data(this,"__className__",this.className);
709
+ this.className=this.className||a===false?"":c.data(this,"__className__")||""
710
+ }
711
+ })
712
+ },
713
+ hasClass:function(a){
714
+ a=" "+a+" ";
715
+ for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(ya," ").indexOf(a)>-1)return true;return false
716
+ },
717
+ val:function(a){
718
+ if(a===v){
719
+ var b=this[0];
720
+ if(b){
721
+ if(c.nodeName(b,"option"))return(b.attributes.value||
722
+
723
+ {}).specified?b.value:b.text;
724
+ if(c.nodeName(b,"select")){
725
+ var d=b.selectedIndex,f=[],e=b.options;
726
+ b=b.type==="select-one";
727
+ if(d<0)return null;
728
+ var i=b?d:0;
729
+ for(d=b?d+1:e.length;i<d;i++){
730
+ var j=e[i];
731
+ if(j.selected){
732
+ a=c(j).val();
733
+ if(b)return a;
734
+ f.push(a)
735
+ }
736
+ }
737
+ return f
738
+ }
739
+ if(za.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;
740
+ return(b.value||"").replace(Wa,"")
741
+ }
742
+ return v
743
+ }
744
+ var n=c.isFunction(a);
745
+ return this.each(function(o){
746
+ var m=c(this),s=a;
747
+ if(this.nodeType===1){
748
+ if(n)s=a.call(this,o,m.val());
749
+ if(typeof s==="number")s+="";
750
+ if(c.isArray(s)&&za.test(this.type))this.checked=c.inArray(m.val(),s)>=0;
751
+ else if(c.nodeName(this,"select")){
752
+ var x=c.makeArray(s);
753
+ c("option",this).each(function(){
754
+ this.selected=c.inArray(c(this).val(),x)>=0
755
+ });
756
+ if(!x.length)this.selectedIndex=-1
757
+ }else this.value=s
758
+ }
759
+ })
760
+ }
761
+ });
762
+ c.extend({
763
+ attrFn:{
764
+ val:true,
765
+ css:true,
766
+ html:true,
767
+ text:true,
768
+ data:true,
769
+ width:true,
770
+ height:true,
771
+ offset:true
772
+ },
773
+ attr:function(a,b,d,f){
774
+ if(!a||a.nodeType===3||a.nodeType===8)return v;
775
+ if(f&&b in c.attrFn)return c(a)[b](d);
776
+ f=a.nodeType!==1||!c.isXMLDoc(a);
777
+ var e=d!==v;
778
+ b=f&&c.props[b]||b;
779
+ if(a.nodeType===1){
780
+ var i=Xa.test(b);
781
+ if(b in a&&f&&!i){
782
+ if(e){
783
+ b==="type"&&Ya.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
784
+ a[b]=d
785
+ }
786
+ if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;
787
+ if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:Za.test(a.nodeName)||$a.test(a.nodeName)&&a.href?0:v;
788
+ return a[b]
789
+ }
790
+ if(!c.support.style&&f&&b==="style"){
791
+ if(e)a.style.cssText=
792
+ ""+d;
793
+ return a.style.cssText
794
+ }
795
+ e&&a.setAttribute(b,""+d);
796
+ a=!c.support.hrefNormalized&&f&&i?a.getAttribute(b,2):a.getAttribute(b);
797
+ return a===null?v:a
798
+ }
799
+ return c.style(a,b,d)
800
+ }
801
+ });
802
+ var ab=function(a){
803
+ return a.replace(/[^\w\s\.\|`]/g,function(b){
804
+ return"\\"+b
805
+ })
806
+ };
807
+
808
+ c.event={
809
+ add:function(a,b,d,f){
810
+ if(!(a.nodeType===3||a.nodeType===8)){
811
+ if(a.setInterval&&a!==z&&!a.frameElement)a=z;
812
+ if(!d.guid)d.guid=c.guid++;
813
+ if(f!==v){
814
+ d=c.proxy(d);
815
+ d.data=f
816
+ }
817
+ var e=c.data(a,"events")||c.data(a,"events",{}),i=c.data(a,"handle"),j;
818
+ if(!i){
819
+ j=
820
+ function(){
821
+ return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(j.elem,arguments):v
822
+ };
823
+
824
+ i=c.data(a,"handle",j)
825
+ }
826
+ if(i){
827
+ i.elem=a;
828
+ b=b.split(/\s+/);
829
+ for(var n,o=0;n=b[o++];){
830
+ var m=n.split(".");
831
+ n=m.shift();
832
+ if(o>1){
833
+ d=c.proxy(d);
834
+ if(f!==v)d.data=f
835
+ }
836
+ d.type=m.slice(0).sort().join(".");
837
+ var s=e[n],x=this.special[n]||{};
838
+
839
+ if(!s){
840
+ s=e[n]={};
841
+
842
+ if(!x.setup||x.setup.call(a,f,m,d)===false)if(a.addEventListener)a.addEventListener(n,i,false);else a.attachEvent&&a.attachEvent("on"+n,i)
843
+ }
844
+ if(x.add)if((m=x.add.call(a,
845
+ d,f,m,s))&&c.isFunction(m)){
846
+ m.guid=m.guid||d.guid;
847
+ m.data=m.data||d.data;
848
+ m.type=m.type||d.type;
849
+ d=m
850
+ }
851
+ s[d.guid]=d;
852
+ this.global[n]=true
853
+ }
854
+ a=null
855
+ }
856
+ }
857
+ },
858
+ global:{},
859
+ remove:function(a,b,d){
860
+ if(!(a.nodeType===3||a.nodeType===8)){
861
+ var f=c.data(a,"events"),e,i,j;
862
+ if(f){
863
+ if(b===v||typeof b==="string"&&b.charAt(0)===".")for(i in f)this.remove(a,i+(b||""));else{
864
+ if(b.type){
865
+ d=b.handler;
866
+ b=b.type
867
+ }
868
+ b=b.split(/\s+/);
869
+ for(var n=0;i=b[n++];){
870
+ var o=i.split(".");
871
+ i=o.shift();
872
+ var m=!o.length,s=c.map(o.slice(0).sort(),ab);
873
+ s=new RegExp("(^|\\.)"+
874
+ s.join("\\.(?:.*\\.)?")+"(\\.|$)");
875
+ var x=this.special[i]||{};
876
+
877
+ if(f[i]){
878
+ if(d){
879
+ j=f[i][d.guid];
880
+ delete f[i][d.guid]
881
+ }else for(var A in f[i])if(m||s.test(f[i][A].type))delete f[i][A];x.remove&&x.remove.call(a,o,j);
882
+ for(e in f[i])break;if(!e){
883
+ if(!x.teardown||x.teardown.call(a,o)===false)if(a.removeEventListener)a.removeEventListener(i,c.data(a,"handle"),false);else a.detachEvent&&a.detachEvent("on"+i,c.data(a,"handle"));
884
+ e=null;
885
+ delete f[i]
886
+ }
887
+ }
888
+ }
889
+ }
890
+ for(e in f)break;if(!e){
891
+ if(A=c.data(a,"handle"))A.elem=null;
892
+ c.removeData(a,
893
+ "events");
894
+ c.removeData(a,"handle")
895
+ }
896
+ }
897
+ }
898
+ },
899
+ trigger:function(a,b,d,f){
900
+ var e=a.type||a;
901
+ if(!f){
902
+ a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);
903
+ if(e.indexOf("!")>=0){
904
+ a.type=e=e.slice(0,-1);
905
+ a.exclusive=true
906
+ }
907
+ if(!d){
908
+ a.stopPropagation();
909
+ this.global[e]&&c.each(c.cache,function(){
910
+ this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)
911
+ })
912
+ }
913
+ if(!d||d.nodeType===3||d.nodeType===8)return v;
914
+ a.result=v;
915
+ a.target=d;
916
+ b=c.makeArray(b);
917
+ b.unshift(a)
918
+ }
919
+ a.currentTarget=d;
920
+ (f=c.data(d,"handle"))&&f.apply(d,
921
+ b);
922
+ f=d.parentNode||d.ownerDocument;
923
+ try{
924
+ if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false
925
+ }catch(i){}
926
+ if(!a.isPropagationStopped()&&f)c.event.trigger(a,b,f,true);
927
+ else if(!a.isDefaultPrevented()){
928
+ d=a.target;
929
+ var j;
930
+ if(!(c.nodeName(d,"a")&&e==="click")&&!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()])){
931
+ try{
932
+ if(d[e]){
933
+ if(j=d["on"+e])d["on"+e]=null;
934
+ this.triggered=true;
935
+ d[e]()
936
+ }
937
+ }catch(n){}
938
+ if(j)d["on"+e]=j;
939
+ this.triggered=false
940
+ }
941
+ }
942
+ },
943
+ handle:function(a){
944
+ var b,
945
+ d;
946
+ a=arguments[0]=c.event.fix(a||z.event);
947
+ a.currentTarget=this;
948
+ d=a.type.split(".");
949
+ a.type=d.shift();
950
+ b=!d.length&&!a.exclusive;
951
+ var f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)");
952
+ d=(c.data(this,"events")||{})[a.type];
953
+ for(var e in d){
954
+ var i=d[e];
955
+ if(b||f.test(i.type)){
956
+ a.handler=i;
957
+ a.data=i.data;
958
+ i=i.apply(this,arguments);
959
+ if(i!==v){
960
+ a.result=i;
961
+ if(i===false){
962
+ a.preventDefault();
963
+ a.stopPropagation()
964
+ }
965
+ }
966
+ if(a.isImmediatePropagationStopped())break
967
+ }
968
+ }
969
+ return a.result
970
+ },
971
+ props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
972
+ fix:function(a){
973
+ if(a[G])return a;
974
+ var b=a;
975
+ a=c.Event(b);
976
+ for(var d=this.props.length,f;d;){
977
+ f=this.props[--d];
978
+ a[f]=b[f]
979
+ }
980
+ if(!a.target)a.target=a.srcElement||r;
981
+ if(a.target.nodeType===3)a.target=a.target.parentNode;
982
+ if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;
983
+ if(a.pageX==null&&a.clientX!=null){
984
+ b=r.documentElement;
985
+ d=r.body;
986
+ a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);
987
+ a.pageY=a.clientY+(b&&b.scrollTop||
988
+ d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)
989
+ }
990
+ if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;
991
+ if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;
992
+ if(!a.which&&a.button!==v)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;
993
+ return a
994
+ },
995
+ guid:1E8,
996
+ proxy:c.proxy,
997
+ special:{
998
+ ready:{
999
+ setup:c.bindReady,
1000
+ teardown:c.noop
1001
+ },
1002
+ live:{
1003
+ add:function(a,b){
1004
+ c.extend(a,b||{});
1005
+ a.guid+=b.selector+b.live;
1006
+ b.liveProxy=a;
1007
+ c.event.add(this,b.live,na,b)
1008
+ },
1009
+ remove:function(a){
1010
+ if(a.length){
1011
+ var b=
1012
+ 0,d=new RegExp("(^|\\.)"+a[0]+"(\\.|$)");
1013
+ c.each(c.data(this,"events").live||{},function(){
1014
+ d.test(this.type)&&b++
1015
+ });
1016
+ b<1&&c.event.remove(this,a[0],na)
1017
+ }
1018
+ },
1019
+ special:{}
1020
+ },
1021
+ beforeunload:{
1022
+ setup:function(a,b,d){
1023
+ if(this.setInterval)this.onbeforeunload=d;
1024
+ return false
1025
+ },
1026
+ teardown:function(a,b){
1027
+ if(this.onbeforeunload===b)this.onbeforeunload=null
1028
+ }
1029
+ }
1030
+ }
1031
+ };
1032
+
1033
+ c.Event=function(a){
1034
+ if(!this.preventDefault)return new c.Event(a);
1035
+ if(a&&a.type){
1036
+ this.originalEvent=a;
1037
+ this.type=a.type
1038
+ }else this.type=a;
1039
+ this.timeStamp=J();
1040
+ this[G]=true
1041
+ };
1042
+ c.Event.prototype={
1043
+ preventDefault:function(){
1044
+ this.isDefaultPrevented=Z;
1045
+ var a=this.originalEvent;
1046
+ if(a){
1047
+ a.preventDefault&&a.preventDefault();
1048
+ a.returnValue=false
1049
+ }
1050
+ },
1051
+ stopPropagation:function(){
1052
+ this.isPropagationStopped=Z;
1053
+ var a=this.originalEvent;
1054
+ if(a){
1055
+ a.stopPropagation&&a.stopPropagation();
1056
+ a.cancelBubble=true
1057
+ }
1058
+ },
1059
+ stopImmediatePropagation:function(){
1060
+ this.isImmediatePropagationStopped=Z;
1061
+ this.stopPropagation()
1062
+ },
1063
+ isDefaultPrevented:Y,
1064
+ isPropagationStopped:Y,
1065
+ isImmediatePropagationStopped:Y
1066
+ };
1067
+
1068
+ var Aa=function(a){
1069
+ for(var b=
1070
+ a.relatedTarget;b&&b!==this;)try{
1071
+ b=b.parentNode
1072
+ }catch(d){
1073
+ break
1074
+ }
1075
+ if(b!==this){
1076
+ a.type=a.data;
1077
+ c.event.handle.apply(this,arguments)
1078
+ }
1079
+ },Ba=function(a){
1080
+ a.type=a.data;
1081
+ c.event.handle.apply(this,arguments)
1082
+ };
1083
+
1084
+ c.each({
1085
+ mouseenter:"mouseover",
1086
+ mouseleave:"mouseout"
1087
+ },function(a,b){
1088
+ c.event.special[a]={
1089
+ setup:function(d){
1090
+ c.event.add(this,b,d&&d.selector?Ba:Aa,a)
1091
+ },
1092
+ teardown:function(d){
1093
+ c.event.remove(this,b,d&&d.selector?Ba:Aa)
1094
+ }
1095
+ }
1096
+ });
1097
+ if(!c.support.submitBubbles)c.event.special.submit={
1098
+ setup:function(a,b,d){
1099
+ if(this.nodeName.toLowerCase()!==
1100
+ "form"){
1101
+ c.event.add(this,"click.specialSubmit."+d.guid,function(f){
1102
+ var e=f.target,i=e.type;
1103
+ if((i==="submit"||i==="image")&&c(e).closest("form").length)return ma("submit",this,arguments)
1104
+ });
1105
+ c.event.add(this,"keypress.specialSubmit."+d.guid,function(f){
1106
+ var e=f.target,i=e.type;
1107
+ if((i==="text"||i==="password")&&c(e).closest("form").length&&f.keyCode===13)return ma("submit",this,arguments)
1108
+ })
1109
+ }else return false
1110
+ },
1111
+ remove:function(a,b){
1112
+ c.event.remove(this,"click.specialSubmit"+(b?"."+b.guid:""));
1113
+ c.event.remove(this,
1114
+ "keypress.specialSubmit"+(b?"."+b.guid:""))
1115
+ }
1116
+ };
1117
+
1118
+ if(!c.support.changeBubbles){
1119
+ var da=/textarea|input|select/i;
1120
+ function Ca(a){
1121
+ var b=a.type,d=a.value;
1122
+ if(b==="radio"||b==="checkbox")d=a.checked;
1123
+ else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){
1124
+ return f.selected
1125
+ }).join("-"):"";
1126
+ else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;
1127
+ return d
1128
+ }
1129
+ function ea(a,b){
1130
+ var d=a.target,f,e;
1131
+ if(!(!da.test(d.nodeName)||d.readOnly)){
1132
+ f=c.data(d,"_change_data");
1133
+ e=Ca(d);
1134
+ if(a.type!=="focusout"||
1135
+ d.type!=="radio")c.data(d,"_change_data",e);
1136
+ if(!(f===v||e===f))if(f!=null||e){
1137
+ a.type="change";
1138
+ return c.event.trigger(a,b,d)
1139
+ }
1140
+ }
1141
+ }
1142
+ c.event.special.change={
1143
+ filters:{
1144
+ focusout:ea,
1145
+ click:function(a){
1146
+ var b=a.target,d=b.type;
1147
+ if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return ea.call(this,a)
1148
+ },
1149
+ keydown:function(a){
1150
+ var b=a.target,d=b.type;
1151
+ if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return ea.call(this,a)
1152
+ },
1153
+ beforeactivate:function(a){
1154
+ a=
1155
+ a.target;
1156
+ a.nodeName.toLowerCase()==="input"&&a.type==="radio"&&c.data(a,"_change_data",Ca(a))
1157
+ }
1158
+ },
1159
+ setup:function(a,b,d){
1160
+ for(var f in T)c.event.add(this,f+".specialChange."+d.guid,T[f]);return da.test(this.nodeName)
1161
+ },
1162
+ remove:function(a,b){
1163
+ for(var d in T)c.event.remove(this,d+".specialChange"+(b?"."+b.guid:""),T[d]);return da.test(this.nodeName)
1164
+ }
1165
+ };
1166
+
1167
+ var T=c.event.special.change.filters
1168
+ }
1169
+ r.addEventListener&&c.each({
1170
+ focus:"focusin",
1171
+ blur:"focusout"
1172
+ },function(a,b){
1173
+ function d(f){
1174
+ f=c.event.fix(f);
1175
+ f.type=b;
1176
+ return c.event.handle.call(this,
1177
+ f)
1178
+ }
1179
+ c.event.special[b]={
1180
+ setup:function(){
1181
+ this.addEventListener(a,d,true)
1182
+ },
1183
+ teardown:function(){
1184
+ this.removeEventListener(a,d,true)
1185
+ }
1186
+ }
1187
+ });
1188
+ c.each(["bind","one"],function(a,b){
1189
+ c.fn[b]=function(d,f,e){
1190
+ if(typeof d==="object"){
1191
+ for(var i in d)this[b](i,f,d[i],e);return this
1192
+ }
1193
+ if(c.isFunction(f)){
1194
+ e=f;
1195
+ f=v
1196
+ }
1197
+ var j=b==="one"?c.proxy(e,function(n){
1198
+ c(this).unbind(n,j);
1199
+ return e.apply(this,arguments)
1200
+ }):e;
1201
+ return d==="unload"&&b!=="one"?this.one(d,f,e):this.each(function(){
1202
+ c.event.add(this,d,j,f)
1203
+ })
1204
+ }
1205
+ });
1206
+ c.fn.extend({
1207
+ unbind:function(a,
1208
+ b){
1209
+ if(typeof a==="object"&&!a.preventDefault){
1210
+ for(var d in a)this.unbind(d,a[d]);return this
1211
+ }
1212
+ return this.each(function(){
1213
+ c.event.remove(this,a,b)
1214
+ })
1215
+ },
1216
+ trigger:function(a,b){
1217
+ return this.each(function(){
1218
+ c.event.trigger(a,b,this)
1219
+ })
1220
+ },
1221
+ triggerHandler:function(a,b){
1222
+ if(this[0]){
1223
+ a=c.Event(a);
1224
+ a.preventDefault();
1225
+ a.stopPropagation();
1226
+ c.event.trigger(a,b,this[0]);
1227
+ return a.result
1228
+ }
1229
+ },
1230
+ toggle:function(a){
1231
+ for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);
1232
+ return this.click(c.proxy(a,function(f){
1233
+ var e=(c.data(this,"lastToggle"+
1234
+ a.guid)||0)%d;
1235
+ c.data(this,"lastToggle"+a.guid,e+1);
1236
+ f.preventDefault();
1237
+ return b[e].apply(this,arguments)||false
1238
+ }))
1239
+ },
1240
+ hover:function(a,b){
1241
+ return this.mouseenter(a).mouseleave(b||a)
1242
+ }
1243
+ });
1244
+ c.each(["live","die"],function(a,b){
1245
+ c.fn[b]=function(d,f,e){
1246
+ var i,j=0;
1247
+ if(c.isFunction(f)){
1248
+ e=f;
1249
+ f=v
1250
+ }
1251
+ for(d=(d||"").split(/\s+/);(i=d[j++])!=null;){
1252
+ i=i==="focus"?"focusin":i==="blur"?"focusout":i==="hover"?d.push("mouseleave")&&"mouseenter":i;
1253
+ b==="live"?c(this.context).bind(oa(i,this.selector),{
1254
+ data:f,
1255
+ selector:this.selector,
1256
+ live:i
1257
+ },e):c(this.context).unbind(oa(i,this.selector),e?{
1258
+ guid:e.guid+this.selector+i
1259
+ }:null)
1260
+ }
1261
+ return this
1262
+ }
1263
+ });
1264
+ c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),function(a,b){
1265
+ c.fn[b]=function(d){
1266
+ return d?this.bind(b,d):this.trigger(b)
1267
+ };
1268
+
1269
+ if(c.attrFn)c.attrFn[b]=true
1270
+ });
1271
+ z.attachEvent&&!z.addEventListener&&z.attachEvent("onunload",function(){
1272
+ for(var a in c.cache)if(c.cache[a].handle)try{
1273
+ c.event.remove(c.cache[a].handle.elem)
1274
+ }catch(b){}
1275
+ });
1276
+ (function(){
1277
+ function a(g){
1278
+ for(var h="",k,l=0;g[l];l++){
1279
+ k=g[l];
1280
+ if(k.nodeType===3||k.nodeType===4)h+=k.nodeValue;
1281
+ else if(k.nodeType!==8)h+=a(k.childNodes)
1282
+ }
1283
+ return h
1284
+ }
1285
+ function b(g,h,k,l,q,p){
1286
+ q=0;
1287
+ for(var u=l.length;q<u;q++){
1288
+ var t=l[q];
1289
+ if(t){
1290
+ t=t[g];
1291
+ for(var y=false;t;){
1292
+ if(t.sizcache===k){
1293
+ y=l[t.sizset];
1294
+ break
1295
+ }
1296
+ if(t.nodeType===1&&!p){
1297
+ t.sizcache=k;
1298
+ t.sizset=q
1299
+ }
1300
+ if(t.nodeName.toLowerCase()===h){
1301
+ y=t;
1302
+ break
1303
+ }
1304
+ t=t[g]
1305
+ }
1306
+ l[q]=y
1307
+ }
1308
+ }
1309
+ }
1310
+ function d(g,h,k,l,q,p){
1311
+ q=0;
1312
+ for(var u=l.length;q<u;q++){
1313
+ var t=l[q];
1314
+ if(t){
1315
+ t=t[g];
1316
+ for(var y=false;t;){
1317
+ if(t.sizcache===
1318
+ k){
1319
+ y=l[t.sizset];
1320
+ break
1321
+ }
1322
+ if(t.nodeType===1){
1323
+ if(!p){
1324
+ t.sizcache=k;
1325
+ t.sizset=q
1326
+ }
1327
+ if(typeof h!=="string"){
1328
+ if(t===h){
1329
+ y=true;
1330
+ break
1331
+ }
1332
+ }else if(o.filter(h,[t]).length>0){
1333
+ y=t;
1334
+ break
1335
+ }
1336
+ }
1337
+ t=t[g]
1338
+ }
1339
+ l[q]=y
1340
+ }
1341
+ }
1342
+ }
1343
+ var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,i=Object.prototype.toString,j=false,n=true;
1344
+ [0,0].sort(function(){
1345
+ n=false;
1346
+ return 0
1347
+ });
1348
+ var o=function(g,h,k,l){
1349
+ k=k||[];
1350
+ var q=h=h||r;
1351
+ if(h.nodeType!==1&&h.nodeType!==9)return[];
1352
+ if(!g||
1353
+ typeof g!=="string")return k;
1354
+ for(var p=[],u,t,y,R,H=true,M=w(h),I=g;(f.exec(""),u=f.exec(I))!==null;){
1355
+ I=u[3];
1356
+ p.push(u[1]);
1357
+ if(u[2]){
1358
+ R=u[3];
1359
+ break
1360
+ }
1361
+ }
1362
+ if(p.length>1&&s.exec(g))if(p.length===2&&m.relative[p[0]])t=fa(p[0]+p[1],h);else for(t=m.relative[p[0]]?[h]:o(p.shift(),h);p.length;){
1363
+ g=p.shift();
1364
+ if(m.relative[g])g+=p.shift();
1365
+ t=fa(g,t)
1366
+ }else{
1367
+ if(!l&&p.length>1&&h.nodeType===9&&!M&&m.match.ID.test(p[0])&&!m.match.ID.test(p[p.length-1])){
1368
+ u=o.find(p.shift(),h,M);
1369
+ h=u.expr?o.filter(u.expr,u.set)[0]:u.set[0]
1370
+ }
1371
+ if(h){
1372
+ u=
1373
+ l?{
1374
+ expr:p.pop(),
1375
+ set:A(l)
1376
+ }:o.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);
1377
+ t=u.expr?o.filter(u.expr,u.set):u.set;
1378
+ if(p.length>0)y=A(t);else H=false;
1379
+ for(;p.length;){
1380
+ var D=p.pop();
1381
+ u=D;
1382
+ if(m.relative[D])u=p.pop();else D="";
1383
+ if(u==null)u=h;
1384
+ m.relative[D](y,u,M)
1385
+ }
1386
+ }else y=[]
1387
+ }
1388
+ y||(y=t);
1389
+ y||o.error(D||g);
1390
+ if(i.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){
1391
+ if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))k.push(t[g])
1392
+ }else for(g=0;y[g]!=null;g++)y[g]&&
1393
+ y[g].nodeType===1&&k.push(t[g]);else k.push.apply(k,y);else A(y,k);
1394
+ if(R){
1395
+ o(R,q,k,l);
1396
+ o.uniqueSort(k)
1397
+ }
1398
+ return k
1399
+ };
1400
+
1401
+ o.uniqueSort=function(g){
1402
+ if(C){
1403
+ j=n;
1404
+ g.sort(C);
1405
+ if(j)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)
1406
+ }
1407
+ return g
1408
+ };
1409
+
1410
+ o.matches=function(g,h){
1411
+ return o(g,null,null,h)
1412
+ };
1413
+
1414
+ o.find=function(g,h,k){
1415
+ var l,q;
1416
+ if(!g)return[];
1417
+ for(var p=0,u=m.order.length;p<u;p++){
1418
+ var t=m.order[p];
1419
+ if(q=m.leftMatch[t].exec(g)){
1420
+ var y=q[1];
1421
+ q.splice(1,1);
1422
+ if(y.substr(y.length-1)!=="\\"){
1423
+ q[1]=(q[1]||"").replace(/\\/g,"");
1424
+ l=m.find[t](q,
1425
+ h,k);
1426
+ if(l!=null){
1427
+ g=g.replace(m.match[t],"");
1428
+ break
1429
+ }
1430
+ }
1431
+ }
1432
+ }
1433
+ l||(l=h.getElementsByTagName("*"));
1434
+ return{
1435
+ set:l,
1436
+ expr:g
1437
+ }
1438
+ };
1439
+
1440
+ o.filter=function(g,h,k,l){
1441
+ for(var q=g,p=[],u=h,t,y,R=h&&h[0]&&w(h[0]);g&&h.length;){
1442
+ for(var H in m.filter)if((t=m.leftMatch[H].exec(g))!=null&&t[2]){
1443
+ var M=m.filter[H],I,D;
1444
+ D=t[1];
1445
+ y=false;
1446
+ t.splice(1,1);
1447
+ if(D.substr(D.length-1)!=="\\"){
1448
+ if(u===p)p=[];
1449
+ if(m.preFilter[H])if(t=m.preFilter[H](t,u,k,p,l,R)){
1450
+ if(t===true)continue
1451
+ }else y=I=true;
1452
+ if(t)for(var U=0;(D=u[U])!=null;U++)if(D){
1453
+ I=M(D,t,U,u);
1454
+ var Da=
1455
+ l^!!I;
1456
+ if(k&&I!=null)if(Da)y=true;else u[U]=false;
1457
+ else if(Da){
1458
+ p.push(D);
1459
+ y=true
1460
+ }
1461
+ }
1462
+ if(I!==v){
1463
+ k||(u=p);
1464
+ g=g.replace(m.match[H],"");
1465
+ if(!y)return[];
1466
+ break
1467
+ }
1468
+ }
1469
+ }
1470
+ if(g===q)if(y==null)o.error(g);else break;
1471
+ q=g
1472
+ }
1473
+ return u
1474
+ };
1475
+
1476
+ o.error=function(g){
1477
+ throw"Syntax error, unrecognized expression: "+g;
1478
+ };
1479
+
1480
+ var m=o.selectors={
1481
+ order:["ID","NAME","TAG"],
1482
+ match:{
1483
+ ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
1484
+ CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
1485
+ NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
1486
+ ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
1487
+ TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
1488
+ CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
1489
+ POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
1490
+ PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
1491
+ },
1492
+ leftMatch:{},
1493
+ attrMap:{
1494
+ "class":"className",
1495
+ "for":"htmlFor"
1496
+ },
1497
+ attrHandle:{
1498
+ href:function(g){
1499
+ return g.getAttribute("href")
1500
+ }
1501
+ },
1502
+ relative:{
1503
+ "+":function(g,h){
1504
+ var k=typeof h==="string",l=k&&!/\W/.test(h);
1505
+ k=k&&!l;
1506
+ if(l)h=h.toLowerCase();
1507
+ l=0;
1508
+ for(var q=g.length,
1509
+ p;l<q;l++)if(p=g[l]){
1510
+ for(;(p=p.previousSibling)&&p.nodeType!==1;);
1511
+ g[l]=k||p&&p.nodeName.toLowerCase()===h?p||false:p===h
1512
+ }
1513
+ k&&o.filter(h,g,true)
1514
+ },
1515
+ ">":function(g,h){
1516
+ var k=typeof h==="string";
1517
+ if(k&&!/\W/.test(h)){
1518
+ h=h.toLowerCase();
1519
+ for(var l=0,q=g.length;l<q;l++){
1520
+ var p=g[l];
1521
+ if(p){
1522
+ k=p.parentNode;
1523
+ g[l]=k.nodeName.toLowerCase()===h?k:false
1524
+ }
1525
+ }
1526
+ }else{
1527
+ l=0;
1528
+ for(q=g.length;l<q;l++)if(p=g[l])g[l]=k?p.parentNode:p.parentNode===h;k&&o.filter(h,g,true)
1529
+ }
1530
+ },
1531
+ "":function(g,h,k){
1532
+ var l=e++,q=d;
1533
+ if(typeof h==="string"&&!/\W/.test(h)){
1534
+ var p=
1535
+ h=h.toLowerCase();
1536
+ q=b
1537
+ }
1538
+ q("parentNode",h,l,g,p,k)
1539
+ },
1540
+ "~":function(g,h,k){
1541
+ var l=e++,q=d;
1542
+ if(typeof h==="string"&&!/\W/.test(h)){
1543
+ var p=h=h.toLowerCase();
1544
+ q=b
1545
+ }
1546
+ q("previousSibling",h,l,g,p,k)
1547
+ }
1548
+ },
1549
+ find:{
1550
+ ID:function(g,h,k){
1551
+ if(typeof h.getElementById!=="undefined"&&!k)return(g=h.getElementById(g[1]))?[g]:[]
1552
+ },
1553
+ NAME:function(g,h){
1554
+ if(typeof h.getElementsByName!=="undefined"){
1555
+ var k=[];
1556
+ h=h.getElementsByName(g[1]);
1557
+ for(var l=0,q=h.length;l<q;l++)h[l].getAttribute("name")===g[1]&&k.push(h[l]);
1558
+ return k.length===0?null:k
1559
+ }
1560
+ },
1561
+ TAG:function(g,h){
1562
+ return h.getElementsByTagName(g[1])
1563
+ }
1564
+ },
1565
+ preFilter:{
1566
+ CLASS:function(g,h,k,l,q,p){
1567
+ g=" "+g[1].replace(/\\/g,"")+" ";
1568
+ if(p)return g;
1569
+ p=0;
1570
+ for(var u;(u=h[p])!=null;p++)if(u)if(q^(u.className&&(" "+u.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))k||l.push(u);
1571
+ else if(k)h[p]=false;return false
1572
+ },
1573
+ ID:function(g){
1574
+ return g[1].replace(/\\/g,"")
1575
+ },
1576
+ TAG:function(g){
1577
+ return g[1].toLowerCase()
1578
+ },
1579
+ CHILD:function(g){
1580
+ if(g[1]==="nth"){
1581
+ var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&
1582
+ "2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);
1583
+ g[2]=h[1]+(h[2]||1)-0;
1584
+ g[3]=h[3]-0
1585
+ }
1586
+ g[0]=e++;
1587
+ return g
1588
+ },
1589
+ ATTR:function(g,h,k,l,q,p){
1590
+ h=g[1].replace(/\\/g,"");
1591
+ if(!p&&m.attrMap[h])g[1]=m.attrMap[h];
1592
+ if(g[2]==="~=")g[4]=" "+g[4]+" ";
1593
+ return g
1594
+ },
1595
+ PSEUDO:function(g,h,k,l,q){
1596
+ if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=o(g[3],null,null,h);
1597
+ else{
1598
+ g=o.filter(g[3],h,k,true^q);
1599
+ k||l.push.apply(l,g);
1600
+ return false
1601
+ }else if(m.match.POS.test(g[0])||m.match.CHILD.test(g[0]))return true;
1602
+ return g
1603
+ },
1604
+ POS:function(g){
1605
+ g.unshift(true);
1606
+ return g
1607
+ }
1608
+ },
1609
+ filters:{
1610
+ enabled:function(g){
1611
+ return g.disabled===false&&g.type!=="hidden"
1612
+ },
1613
+ disabled:function(g){
1614
+ return g.disabled===true
1615
+ },
1616
+ checked:function(g){
1617
+ return g.checked===true
1618
+ },
1619
+ selected:function(g){
1620
+ return g.selected===true
1621
+ },
1622
+ parent:function(g){
1623
+ return!!g.firstChild
1624
+ },
1625
+ empty:function(g){
1626
+ return!g.firstChild
1627
+ },
1628
+ has:function(g,h,k){
1629
+ return!!o(k[3],g).length
1630
+ },
1631
+ header:function(g){
1632
+ return/h\d/i.test(g.nodeName)
1633
+ },
1634
+ text:function(g){
1635
+ return"text"===g.type
1636
+ },
1637
+ radio:function(g){
1638
+ return"radio"===g.type
1639
+ },
1640
+ checkbox:function(g){
1641
+ return"checkbox"===
1642
+ g.type
1643
+ },
1644
+ file:function(g){
1645
+ return"file"===g.type
1646
+ },
1647
+ password:function(g){
1648
+ return"password"===g.type
1649
+ },
1650
+ submit:function(g){
1651
+ return"submit"===g.type
1652
+ },
1653
+ image:function(g){
1654
+ return"image"===g.type
1655
+ },
1656
+ reset:function(g){
1657
+ return"reset"===g.type
1658
+ },
1659
+ button:function(g){
1660
+ return"button"===g.type||g.nodeName.toLowerCase()==="button"
1661
+ },
1662
+ input:function(g){
1663
+ return/input|select|textarea|button/i.test(g.nodeName)
1664
+ }
1665
+ },
1666
+ setFilters:{
1667
+ first:function(g,h){
1668
+ return h===0
1669
+ },
1670
+ last:function(g,h,k,l){
1671
+ return h===l.length-1
1672
+ },
1673
+ even:function(g,h){
1674
+ return h%2===
1675
+ 0
1676
+ },
1677
+ odd:function(g,h){
1678
+ return h%2===1
1679
+ },
1680
+ lt:function(g,h,k){
1681
+ return h<k[3]-0
1682
+ },
1683
+ gt:function(g,h,k){
1684
+ return h>k[3]-0
1685
+ },
1686
+ nth:function(g,h,k){
1687
+ return k[3]-0===h
1688
+ },
1689
+ eq:function(g,h,k){
1690
+ return k[3]-0===h
1691
+ }
1692
+ },
1693
+ filter:{
1694
+ PSEUDO:function(g,h,k,l){
1695
+ var q=h[1],p=m.filters[q];
1696
+ if(p)return p(g,k,h,l);
1697
+ else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;
1698
+ else if(q==="not"){
1699
+ h=h[3];
1700
+ k=0;
1701
+ for(l=h.length;k<l;k++)if(h[k]===g)return false;return true
1702
+ }else o.error("Syntax error, unrecognized expression: "+
1703
+ q)
1704
+ },
1705
+ CHILD:function(g,h){
1706
+ var k=h[1],l=g;
1707
+ switch(k){
1708
+ case "only":case "first":
1709
+ for(;l=l.previousSibling;)if(l.nodeType===1)return false;if(k==="first")return true;
1710
+ l=g;
1711
+ case "last":
1712
+ for(;l=l.nextSibling;)if(l.nodeType===1)return false;return true;
1713
+ case "nth":
1714
+ k=h[2];
1715
+ var q=h[3];
1716
+ if(k===1&&q===0)return true;
1717
+ h=h[0];
1718
+ var p=g.parentNode;
1719
+ if(p&&(p.sizcache!==h||!g.nodeIndex)){
1720
+ var u=0;
1721
+ for(l=p.firstChild;l;l=l.nextSibling)if(l.nodeType===1)l.nodeIndex=++u;p.sizcache=h
1722
+ }
1723
+ g=g.nodeIndex-q;
1724
+ return k===0?g===0:g%k===0&&g/k>=
1725
+ 0
1726
+ }
1727
+ },
1728
+ ID:function(g,h){
1729
+ return g.nodeType===1&&g.getAttribute("id")===h
1730
+ },
1731
+ TAG:function(g,h){
1732
+ return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h
1733
+ },
1734
+ CLASS:function(g,h){
1735
+ return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1
1736
+ },
1737
+ ATTR:function(g,h){
1738
+ var k=h[1];
1739
+ g=m.attrHandle[k]?m.attrHandle[k](g):g[k]!=null?g[k]:g.getAttribute(k);
1740
+ k=g+"";
1741
+ var l=h[2];
1742
+ h=h[4];
1743
+ return g==null?l==="!=":l==="="?k===h:l==="*="?k.indexOf(h)>=0:l==="~="?(" "+k+" ").indexOf(h)>=0:!h?k&&g!==false:l==="!="?k!==h:l==="^="?
1744
+ k.indexOf(h)===0:l==="$="?k.substr(k.length-h.length)===h:l==="|="?k===h||k.substr(0,h.length+1)===h+"-":false
1745
+ },
1746
+ POS:function(g,h,k,l){
1747
+ var q=m.setFilters[h[2]];
1748
+ if(q)return q(g,k,h,l)
1749
+ }
1750
+ }
1751
+ },s=m.match.POS;
1752
+ for(var x in m.match){
1753
+ m.match[x]=new RegExp(m.match[x].source+/(?![^\[]*\])(?![^\(]*\))/.source);
1754
+ m.leftMatch[x]=new RegExp(/(^(?:.|\r|\n)*?)/.source+m.match[x].source.replace(/\\(\d+)/g,function(g,h){
1755
+ return"\\"+(h-0+1)
1756
+ }))
1757
+ }
1758
+ var A=function(g,h){
1759
+ g=Array.prototype.slice.call(g,0);
1760
+ if(h){
1761
+ h.push.apply(h,g);
1762
+ return h
1763
+ }
1764
+ return g
1765
+ };
1766
+ try{
1767
+ Array.prototype.slice.call(r.documentElement.childNodes,0)
1768
+ }catch(B){
1769
+ A=function(g,h){
1770
+ h=h||[];
1771
+ if(i.call(g)==="[object Array]")Array.prototype.push.apply(h,g);
1772
+ else if(typeof g.length==="number")for(var k=0,l=g.length;k<l;k++)h.push(g[k]);else for(k=0;g[k];k++)h.push(g[k]);
1773
+ return h
1774
+ }
1775
+ }
1776
+ var C;
1777
+ if(r.documentElement.compareDocumentPosition)C=function(g,h){
1778
+ if(!g.compareDocumentPosition||!h.compareDocumentPosition){
1779
+ if(g==h)j=true;
1780
+ return g.compareDocumentPosition?-1:1
1781
+ }
1782
+ g=g.compareDocumentPosition(h)&4?-1:g===
1783
+ h?0:1;
1784
+ if(g===0)j=true;
1785
+ return g
1786
+ };
1787
+ else if("sourceIndex"in r.documentElement)C=function(g,h){
1788
+ if(!g.sourceIndex||!h.sourceIndex){
1789
+ if(g==h)j=true;
1790
+ return g.sourceIndex?-1:1
1791
+ }
1792
+ g=g.sourceIndex-h.sourceIndex;
1793
+ if(g===0)j=true;
1794
+ return g
1795
+ };
1796
+ else if(r.createRange)C=function(g,h){
1797
+ if(!g.ownerDocument||!h.ownerDocument){
1798
+ if(g==h)j=true;
1799
+ return g.ownerDocument?-1:1
1800
+ }
1801
+ var k=g.ownerDocument.createRange(),l=h.ownerDocument.createRange();
1802
+ k.setStart(g,0);
1803
+ k.setEnd(g,0);
1804
+ l.setStart(h,0);
1805
+ l.setEnd(h,0);
1806
+ g=k.compareBoundaryPoints(Range.START_TO_END,
1807
+ l);
1808
+ if(g===0)j=true;
1809
+ return g
1810
+ };
1811
+ (function(){
1812
+ var g=r.createElement("div"),h="script"+(new Date).getTime();
1813
+ g.innerHTML="<a name='"+h+"'/>";
1814
+ var k=r.documentElement;
1815
+ k.insertBefore(g,k.firstChild);
1816
+ if(r.getElementById(h)){
1817
+ m.find.ID=function(l,q,p){
1818
+ if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(l[1]))?q.id===l[1]||typeof q.getAttributeNode!=="undefined"&&q.getAttributeNode("id").nodeValue===l[1]?[q]:v:[]
1819
+ };
1820
+
1821
+ m.filter.ID=function(l,q){
1822
+ var p=typeof l.getAttributeNode!=="undefined"&&l.getAttributeNode("id");
1823
+ return l.nodeType===1&&p&&p.nodeValue===q
1824
+ }
1825
+ }
1826
+ k.removeChild(g);
1827
+ k=g=null
1828
+ })();
1829
+ (function(){
1830
+ var g=r.createElement("div");
1831
+ g.appendChild(r.createComment(""));
1832
+ if(g.getElementsByTagName("*").length>0)m.find.TAG=function(h,k){
1833
+ k=k.getElementsByTagName(h[1]);
1834
+ if(h[1]==="*"){
1835
+ h=[];
1836
+ for(var l=0;k[l];l++)k[l].nodeType===1&&h.push(k[l]);
1837
+ k=h
1838
+ }
1839
+ return k
1840
+ };
1841
+
1842
+ g.innerHTML="<a href='#'></a>";
1843
+ if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")m.attrHandle.href=function(h){
1844
+ return h.getAttribute("href",
1845
+ 2)
1846
+ };
1847
+
1848
+ g=null
1849
+ })();
1850
+ r.querySelectorAll&&function(){
1851
+ var g=o,h=r.createElement("div");
1852
+ h.innerHTML="<p class='TEST'></p>";
1853
+ if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){
1854
+ o=function(l,q,p,u){
1855
+ q=q||r;
1856
+ if(!u&&q.nodeType===9&&!w(q))try{
1857
+ return A(q.querySelectorAll(l),p)
1858
+ }catch(t){}
1859
+ return g(l,q,p,u)
1860
+ };
1861
+
1862
+ for(var k in g)o[k]=g[k];h=null
1863
+ }
1864
+ }();
1865
+ (function(){
1866
+ var g=r.createElement("div");
1867
+ g.innerHTML="<div class='test e'></div><div class='test'></div>";
1868
+ if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===
1869
+ 0)){
1870
+ g.lastChild.className="e";
1871
+ if(g.getElementsByClassName("e").length!==1){
1872
+ m.order.splice(1,0,"CLASS");
1873
+ m.find.CLASS=function(h,k,l){
1874
+ if(typeof k.getElementsByClassName!=="undefined"&&!l)return k.getElementsByClassName(h[1])
1875
+ };
1876
+
1877
+ g=null
1878
+ }
1879
+ }
1880
+ })();
1881
+ var E=r.compareDocumentPosition?function(g,h){
1882
+ return g.compareDocumentPosition(h)&16
1883
+ }:function(g,h){
1884
+ return g!==h&&(g.contains?g.contains(h):true)
1885
+ },w=function(g){
1886
+ return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false
1887
+ },fa=function(g,h){
1888
+ var k=[],
1889
+ l="",q;
1890
+ for(h=h.nodeType?[h]:h;q=m.match.PSEUDO.exec(g);){
1891
+ l+=q[0];
1892
+ g=g.replace(m.match.PSEUDO,"")
1893
+ }
1894
+ g=m.relative[g]?g+"*":g;
1895
+ q=0;
1896
+ for(var p=h.length;q<p;q++)o(g,h[q],k);
1897
+ return o.filter(l,k)
1898
+ };
1899
+
1900
+ c.find=o;
1901
+ c.expr=o.selectors;
1902
+ c.expr[":"]=c.expr.filters;
1903
+ c.unique=o.uniqueSort;
1904
+ c.getText=a;
1905
+ c.isXMLDoc=w;
1906
+ c.contains=E
1907
+ })();
1908
+ var bb=/Until$/,cb=/^(?:parents|prevUntil|prevAll)/,db=/,/;
1909
+ Q=Array.prototype.slice;
1910
+ var Ea=function(a,b,d){
1911
+ if(c.isFunction(b))return c.grep(a,function(e,i){
1912
+ return!!b.call(e,i,e)===d
1913
+ });
1914
+ else if(b.nodeType)return c.grep(a,
1915
+ function(e){
1916
+ return e===b===d
1917
+ });
1918
+ else if(typeof b==="string"){
1919
+ var f=c.grep(a,function(e){
1920
+ return e.nodeType===1
1921
+ });
1922
+ if(Qa.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)
1923
+ }
1924
+ return c.grep(a,function(e){
1925
+ return c.inArray(e,b)>=0===d
1926
+ })
1927
+ };
1928
+
1929
+ c.fn.extend({
1930
+ find:function(a){
1931
+ for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){
1932
+ d=b.length;
1933
+ c.find(a,this[f],b);
1934
+ if(f>0)for(var i=d;i<b.length;i++)for(var j=0;j<d;j++)if(b[j]===b[i]){
1935
+ b.splice(i--,1);
1936
+ break
1937
+ }
1938
+ }
1939
+ return b
1940
+ },
1941
+ has:function(a){
1942
+ var b=c(a);
1943
+ return this.filter(function(){
1944
+ for(var d=
1945
+ 0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true
1946
+ })
1947
+ },
1948
+ not:function(a){
1949
+ return this.pushStack(Ea(this,a,false),"not",a)
1950
+ },
1951
+ filter:function(a){
1952
+ return this.pushStack(Ea(this,a,true),"filter",a)
1953
+ },
1954
+ is:function(a){
1955
+ return!!a&&c.filter(a,this).length>0
1956
+ },
1957
+ closest:function(a,b){
1958
+ if(c.isArray(a)){
1959
+ var d=[],f=this[0],e,i={},j;
1960
+ if(f&&a.length){
1961
+ e=0;
1962
+ for(var n=a.length;e<n;e++){
1963
+ j=a[e];
1964
+ i[j]||(i[j]=c.expr.match.POS.test(j)?c(j,b||this.context):j)
1965
+ }
1966
+ for(;f&&f.ownerDocument&&f!==b;){
1967
+ for(j in i){
1968
+ e=i[j];
1969
+ if(e.jquery?e.index(f)>
1970
+ -1:c(f).is(e)){
1971
+ d.push({
1972
+ selector:j,
1973
+ elem:f
1974
+ });
1975
+ delete i[j]
1976
+ }
1977
+ }
1978
+ f=f.parentNode
1979
+ }
1980
+ }
1981
+ return d
1982
+ }
1983
+ var o=c.expr.match.POS.test(a)?c(a,b||this.context):null;
1984
+ return this.map(function(m,s){
1985
+ for(;s&&s.ownerDocument&&s!==b;){
1986
+ if(o?o.index(s)>-1:c(s).is(a))return s;
1987
+ s=s.parentNode
1988
+ }
1989
+ return null
1990
+ })
1991
+ },
1992
+ index:function(a){
1993
+ if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());
1994
+ return c.inArray(a.jquery?a[0]:a,this)
1995
+ },
1996
+ add:function(a,b){
1997
+ a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);
1998
+ b=c.merge(this.get(),
1999
+ a);
2000
+ return this.pushStack(pa(a[0])||pa(b[0])?b:c.unique(b))
2001
+ },
2002
+ andSelf:function(){
2003
+ return this.add(this.prevObject)
2004
+ }
2005
+ });
2006
+ c.each({
2007
+ parent:function(a){
2008
+ return(a=a.parentNode)&&a.nodeType!==11?a:null
2009
+ },
2010
+ parents:function(a){
2011
+ return c.dir(a,"parentNode")
2012
+ },
2013
+ parentsUntil:function(a,b,d){
2014
+ return c.dir(a,"parentNode",d)
2015
+ },
2016
+ next:function(a){
2017
+ return c.nth(a,2,"nextSibling")
2018
+ },
2019
+ prev:function(a){
2020
+ return c.nth(a,2,"previousSibling")
2021
+ },
2022
+ nextAll:function(a){
2023
+ return c.dir(a,"nextSibling")
2024
+ },
2025
+ prevAll:function(a){
2026
+ return c.dir(a,"previousSibling")
2027
+ },
2028
+ nextUntil:function(a,b,d){
2029
+ return c.dir(a,"nextSibling",d)
2030
+ },
2031
+ prevUntil:function(a,b,d){
2032
+ return c.dir(a,"previousSibling",d)
2033
+ },
2034
+ siblings:function(a){
2035
+ return c.sibling(a.parentNode.firstChild,a)
2036
+ },
2037
+ children:function(a){
2038
+ return c.sibling(a.firstChild)
2039
+ },
2040
+ contents:function(a){
2041
+ return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)
2042
+ }
2043
+ },function(a,b){
2044
+ c.fn[a]=function(d,f){
2045
+ var e=c.map(this,b,d);
2046
+ bb.test(a)||(f=d);
2047
+ if(f&&typeof f==="string")e=c.filter(f,e);
2048
+ e=this.length>1?c.unique(e):
2049
+ e;
2050
+ if((this.length>1||db.test(f))&&cb.test(a))e=e.reverse();
2051
+ return this.pushStack(e,a,Q.call(arguments).join(","))
2052
+ }
2053
+ });
2054
+ c.extend({
2055
+ filter:function(a,b,d){
2056
+ if(d)a=":not("+a+")";
2057
+ return c.find.matches(a,b)
2058
+ },
2059
+ dir:function(a,b,d){
2060
+ var f=[];
2061
+ for(a=a[b];a&&a.nodeType!==9&&(d===v||a.nodeType!==1||!c(a).is(d));){
2062
+ a.nodeType===1&&f.push(a);
2063
+ a=a[b]
2064
+ }
2065
+ return f
2066
+ },
2067
+ nth:function(a,b,d){
2068
+ b=b||1;
2069
+ for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a
2070
+ },
2071
+ sibling:function(a,b){
2072
+ for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==
2073
+ b&&d.push(a);
2074
+ return d
2075
+ }
2076
+ });
2077
+ var Fa=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ga=/(<([\w:]+)[^>]*?)\/>/g,eb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,Ha=/<([\w:]+)/,fb=/<tbody/i,gb=/<|&\w+;/,sa=/checked\s*(?:[^=]|=\s*.checked.)/i,Ia=function(a,b,d){
2078
+ return eb.test(d)?a:b+"></"+d+">"
2079
+ },F={
2080
+ option:[1,"<select multiple='multiple'>","</select>"],
2081
+ legend:[1,"<fieldset>","</fieldset>"],
2082
+ thead:[1,"<table>","</table>"],
2083
+ tr:[2,"<table><tbody>","</tbody></table>"],
2084
+ td:[3,"<table><tbody><tr>","</tr></tbody></table>"],
2085
+ col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],
2086
+ area:[1,"<map>","</map>"],
2087
+ _default:[0,"",""]
2088
+ };
2089
+
2090
+ F.optgroup=F.option;
2091
+ F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;
2092
+ F.th=F.td;
2093
+ if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];
2094
+ c.fn.extend({
2095
+ text:function(a){
2096
+ if(c.isFunction(a))return this.each(function(b){
2097
+ var d=c(this);
2098
+ d.text(a.call(this,b,d.text()))
2099
+ });
2100
+ if(typeof a!=="object"&&a!==v)return this.empty().append((this[0]&&this[0].ownerDocument||r).createTextNode(a));
2101
+ return c.getText(this)
2102
+ },
2103
+ wrapAll:function(a){
2104
+ if(c.isFunction(a))return this.each(function(d){
2105
+ c(this).wrapAll(a.call(this,d))
2106
+ });
2107
+ if(this[0]){
2108
+ var b=c(a,this[0].ownerDocument).eq(0).clone(true);
2109
+ this[0].parentNode&&b.insertBefore(this[0]);
2110
+ b.map(function(){
2111
+ for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;
2112
+ return d
2113
+ }).append(this)
2114
+ }
2115
+ return this
2116
+ },
2117
+ wrapInner:function(a){
2118
+ if(c.isFunction(a))return this.each(function(b){
2119
+ c(this).wrapInner(a.call(this,b))
2120
+ });
2121
+ return this.each(function(){
2122
+ var b=c(this),d=b.contents();
2123
+ d.length?
2124
+ d.wrapAll(a):b.append(a)
2125
+ })
2126
+ },
2127
+ wrap:function(a){
2128
+ return this.each(function(){
2129
+ c(this).wrapAll(a)
2130
+ })
2131
+ },
2132
+ unwrap:function(){
2133
+ return this.parent().each(function(){
2134
+ c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)
2135
+ }).end()
2136
+ },
2137
+ append:function(){
2138
+ return this.domManip(arguments,true,function(a){
2139
+ this.nodeType===1&&this.appendChild(a)
2140
+ })
2141
+ },
2142
+ prepend:function(){
2143
+ return this.domManip(arguments,true,function(a){
2144
+ this.nodeType===1&&this.insertBefore(a,this.firstChild)
2145
+ })
2146
+ },
2147
+ before:function(){
2148
+ if(this[0]&&this[0].parentNode)return this.domManip(arguments,
2149
+ false,function(b){
2150
+ this.parentNode.insertBefore(b,this)
2151
+ });
2152
+ else if(arguments.length){
2153
+ var a=c(arguments[0]);
2154
+ a.push.apply(a,this.toArray());
2155
+ return this.pushStack(a,"before",arguments)
2156
+ }
2157
+ },
2158
+ after:function(){
2159
+ if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){
2160
+ this.parentNode.insertBefore(b,this.nextSibling)
2161
+ });
2162
+ else if(arguments.length){
2163
+ var a=this.pushStack(this,"after",arguments);
2164
+ a.push.apply(a,c(arguments[0]).toArray());
2165
+ return a
2166
+ }
2167
+ },
2168
+ clone:function(a){
2169
+ var b=this.map(function(){
2170
+ if(!c.support.noCloneEvent&&
2171
+ !c.isXMLDoc(this)){
2172
+ var d=this.outerHTML,f=this.ownerDocument;
2173
+ if(!d){
2174
+ d=f.createElement("div");
2175
+ d.appendChild(this.cloneNode(true));
2176
+ d=d.innerHTML
2177
+ }
2178
+ return c.clean([d.replace(Fa,"").replace(V,"")],f)[0]
2179
+ }else return this.cloneNode(true)
2180
+ });
2181
+ if(a===true){
2182
+ qa(this,b);
2183
+ qa(this.find("*"),b.find("*"))
2184
+ }
2185
+ return b
2186
+ },
2187
+ html:function(a){
2188
+ if(a===v)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Fa,""):null;
2189
+ else if(typeof a==="string"&&!/<script/i.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(Ha.exec(a)||
2190
+ ["",""])[1].toLowerCase()]){
2191
+ a=a.replace(Ga,Ia);
2192
+ try{
2193
+ for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){
2194
+ c.cleanData(this[b].getElementsByTagName("*"));
2195
+ this[b].innerHTML=a
2196
+ }
2197
+ }catch(f){
2198
+ this.empty().append(a)
2199
+ }
2200
+ }else c.isFunction(a)?this.each(function(e){
2201
+ var i=c(this),j=i.html();
2202
+ i.empty().append(function(){
2203
+ return a.call(this,e,j)
2204
+ })
2205
+ }):this.empty().append(a);
2206
+ return this
2207
+ },
2208
+ replaceWith:function(a){
2209
+ if(this[0]&&this[0].parentNode){
2210
+ if(c.isFunction(a))return this.each(function(b){
2211
+ var d=c(this),f=d.html();
2212
+ d.replaceWith(a.call(this,
2213
+ b,f))
2214
+ });else a=c(a).detach();
2215
+ return this.each(function(){
2216
+ var b=this.nextSibling,d=this.parentNode;
2217
+ c(this).remove();
2218
+ b?c(b).before(a):c(d).append(a)
2219
+ })
2220
+ }else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)
2221
+ },
2222
+ detach:function(a){
2223
+ return this.remove(a,true)
2224
+ },
2225
+ domManip:function(a,b,d){
2226
+ function f(s){
2227
+ return c.nodeName(s,"table")?s.getElementsByTagName("tbody")[0]||s.appendChild(s.ownerDocument.createElement("tbody")):s
2228
+ }
2229
+ var e,i,j=a[0],n=[];
2230
+ if(!c.support.checkClone&&arguments.length===3&&typeof j===
2231
+ "string"&&sa.test(j))return this.each(function(){
2232
+ c(this).domManip(a,b,d,true)
2233
+ });
2234
+ if(c.isFunction(j))return this.each(function(s){
2235
+ var x=c(this);
2236
+ a[0]=j.call(this,s,b?x.html():v);
2237
+ x.domManip(a,b,d)
2238
+ });
2239
+ if(this[0]){
2240
+ e=a[0]&&a[0].parentNode&&a[0].parentNode.nodeType===11?{
2241
+ fragment:a[0].parentNode
2242
+ }:ra(a,this,n);
2243
+ if(i=e.fragment.firstChild){
2244
+ b=b&&c.nodeName(i,"tr");
2245
+ for(var o=0,m=this.length;o<m;o++)d.call(b?f(this[o],i):this[o],e.cacheable||this.length>1||o>0?e.fragment.cloneNode(true):e.fragment)
2246
+ }
2247
+ n&&c.each(n,
2248
+ Ma)
2249
+ }
2250
+ return this
2251
+ }
2252
+ });
2253
+ c.fragments={};
2254
+
2255
+ c.each({
2256
+ appendTo:"append",
2257
+ prependTo:"prepend",
2258
+ insertBefore:"before",
2259
+ insertAfter:"after",
2260
+ replaceAll:"replaceWith"
2261
+ },function(a,b){
2262
+ c.fn[a]=function(d){
2263
+ var f=[];
2264
+ d=c(d);
2265
+ for(var e=0,i=d.length;e<i;e++){
2266
+ var j=(e>0?this.clone(true):this).get();
2267
+ c.fn[b].apply(c(d[e]),j);
2268
+ f=f.concat(j)
2269
+ }
2270
+ return this.pushStack(f,a,d.selector)
2271
+ }
2272
+ });
2273
+ c.each({
2274
+ remove:function(a,b){
2275
+ if(!a||c.filter(a,[this]).length){
2276
+ if(!b&&this.nodeType===1){
2277
+ c.cleanData(this.getElementsByTagName("*"));
2278
+ c.cleanData([this])
2279
+ }
2280
+ this.parentNode&&
2281
+ this.parentNode.removeChild(this)
2282
+ }
2283
+ },
2284
+ empty:function(){
2285
+ for(this.nodeType===1&&c.cleanData(this.getElementsByTagName("*"));this.firstChild;)this.removeChild(this.firstChild)
2286
+ }
2287
+ },function(a,b){
2288
+ c.fn[a]=function(){
2289
+ return this.each(b,arguments)
2290
+ }
2291
+ });
2292
+ c.extend({
2293
+ clean:function(a,b,d,f){
2294
+ b=b||r;
2295
+ if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||r;
2296
+ var e=[];
2297
+ c.each(a,function(i,j){
2298
+ if(typeof j==="number")j+="";
2299
+ if(j){
2300
+ if(typeof j==="string"&&!gb.test(j))j=b.createTextNode(j);
2301
+ else if(typeof j===
2302
+ "string"){
2303
+ j=j.replace(Ga,Ia);
2304
+ var n=(Ha.exec(j)||["",""])[1].toLowerCase(),o=F[n]||F._default,m=o[0];
2305
+ i=b.createElement("div");
2306
+ for(i.innerHTML=o[1]+j+o[2];m--;)i=i.lastChild;
2307
+ if(!c.support.tbody){
2308
+ m=fb.test(j);
2309
+ n=n==="table"&&!m?i.firstChild&&i.firstChild.childNodes:o[1]==="<table>"&&!m?i.childNodes:[];
2310
+ for(o=n.length-1;o>=0;--o)c.nodeName(n[o],"tbody")&&!n[o].childNodes.length&&n[o].parentNode.removeChild(n[o])
2311
+ }!c.support.leadingWhitespace&&V.test(j)&&i.insertBefore(b.createTextNode(V.exec(j)[0]),i.firstChild);
2312
+ j=c.makeArray(i.childNodes)
2313
+ }
2314
+ if(j.nodeType)e.push(j);else e=c.merge(e,j)
2315
+ }
2316
+ });
2317
+ if(d)for(a=0;e[a];a++)if(f&&c.nodeName(e[a],"script")&&(!e[a].type||e[a].type.toLowerCase()==="text/javascript"))f.push(e[a].parentNode?e[a].parentNode.removeChild(e[a]):e[a]);
2318
+ else{
2319
+ e[a].nodeType===1&&e.splice.apply(e,[a+1,0].concat(c.makeArray(e[a].getElementsByTagName("script"))));
2320
+ d.appendChild(e[a])
2321
+ }
2322
+ return e
2323
+ },
2324
+ cleanData:function(a){
2325
+ for(var b=0,d;(d=a[b])!=null;b++){
2326
+ c.event.remove(d);
2327
+ c.removeData(d)
2328
+ }
2329
+ }
2330
+ });
2331
+ var hb=/z-?index|font-?weight|opacity|zoom|line-?height/i,
2332
+ Ja=/alpha\([^)]*\)/,Ka=/opacity=([^)]*)/,ga=/float/i,ha=/-([a-z])/ig,ib=/([A-Z])/g,jb=/^-?\d+(?:px)?$/i,kb=/^-?\d/,lb={
2333
+ position:"absolute",
2334
+ visibility:"hidden",
2335
+ display:"block"
2336
+ },mb=["Left","Right"],nb=["Top","Bottom"],ob=r.defaultView&&r.defaultView.getComputedStyle,La=c.support.cssFloat?"cssFloat":"styleFloat",ia=function(a,b){
2337
+ return b.toUpperCase()
2338
+ };
2339
+
2340
+ c.fn.css=function(a,b){
2341
+ return X(this,a,b,true,function(d,f,e){
2342
+ if(e===v)return c.curCSS(d,f);
2343
+ if(typeof e==="number"&&!hb.test(f))e+="px";
2344
+ c.style(d,f,e)
2345
+ })
2346
+ };
2347
+ c.extend({
2348
+ style:function(a,b,d){
2349
+ if(!a||a.nodeType===3||a.nodeType===8)return v;
2350
+ if((b==="width"||b==="height")&&parseFloat(d)<0)d=v;
2351
+ var f=a.style||a,e=d!==v;
2352
+ if(!c.support.opacity&&b==="opacity"){
2353
+ if(e){
2354
+ f.zoom=1;
2355
+ b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";
2356
+ a=f.filter||c.curCSS(a,"filter")||"";
2357
+ f.filter=Ja.test(a)?a.replace(Ja,b):b
2358
+ }
2359
+ return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Ka.exec(f.filter)[1])/100+"":""
2360
+ }
2361
+ if(ga.test(b))b=La;
2362
+ b=b.replace(ha,ia);
2363
+ if(e)f[b]=d;
2364
+ return f[b]
2365
+ },
2366
+ css:function(a,
2367
+ b,d,f){
2368
+ if(b==="width"||b==="height"){
2369
+ var e,i=b==="width"?mb:nb;
2370
+ function j(){
2371
+ e=b==="width"?a.offsetWidth:a.offsetHeight;
2372
+ f!=="border"&&c.each(i,function(){
2373
+ f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);
2374
+ if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,"border"+this+"Width",true))||0
2375
+ })
2376
+ }
2377
+ a.offsetWidth!==0?j():c.swap(a,lb,j);
2378
+ return Math.max(0,Math.round(e))
2379
+ }
2380
+ return c.curCSS(a,b,d)
2381
+ },
2382
+ curCSS:function(a,b,d){
2383
+ var f,e=a.style;
2384
+ if(!c.support.opacity&&b==="opacity"&&
2385
+ a.currentStyle){
2386
+ f=Ka.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";
2387
+ return f===""?"1":f
2388
+ }
2389
+ if(ga.test(b))b=La;
2390
+ if(!d&&e&&e[b])f=e[b];
2391
+ else if(ob){
2392
+ if(ga.test(b))b="float";
2393
+ b=b.replace(ib,"-$1").toLowerCase();
2394
+ e=a.ownerDocument.defaultView;
2395
+ if(!e)return null;
2396
+ if(a=e.getComputedStyle(a,null))f=a.getPropertyValue(b);
2397
+ if(b==="opacity"&&f==="")f="1"
2398
+ }else if(a.currentStyle){
2399
+ d=b.replace(ha,ia);
2400
+ f=a.currentStyle[b]||a.currentStyle[d];
2401
+ if(!jb.test(f)&&kb.test(f)){
2402
+ b=e.left;
2403
+ var i=a.runtimeStyle.left;
2404
+ a.runtimeStyle.left=
2405
+ a.currentStyle.left;
2406
+ e.left=d==="fontSize"?"1em":f||0;
2407
+ f=e.pixelLeft+"px";
2408
+ e.left=b;
2409
+ a.runtimeStyle.left=i
2410
+ }
2411
+ }
2412
+ return f
2413
+ },
2414
+ swap:function(a,b,d){
2415
+ var f={};
2416
+
2417
+ for(var e in b){
2418
+ f[e]=a.style[e];
2419
+ a.style[e]=b[e]
2420
+ }
2421
+ d.call(a);
2422
+ for(e in b)a.style[e]=f[e]
2423
+ }
2424
+ });
2425
+ if(c.expr&&c.expr.filters){
2426
+ c.expr.filters.hidden=function(a){
2427
+ var b=a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";
2428
+ return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"
2429
+ };
2430
+
2431
+ c.expr.filters.visible=function(a){
2432
+ return!c.expr.filters.hidden(a)
2433
+ }
2434
+ }
2435
+ var pb=
2436
+ J(),qb=/<script(.|\s)*?\/script>/gi,rb=/select|textarea/i,sb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ja=/\?/,tb=/(\?|&)_=.*?(&|$)/,ub=/^(\w+:)?\/\/([^\/?#]+)/,vb=/%20/g;
2437
+ c.fn.extend({
2438
+ _load:c.fn.load,
2439
+ load:function(a,b,d){
2440
+ if(typeof a!=="string")return this._load(a);
2441
+ else if(!this.length)return this;
2442
+ var f=a.indexOf(" ");
2443
+ if(f>=0){
2444
+ var e=a.slice(f,a.length);
2445
+ a=a.slice(0,f)
2446
+ }
2447
+ f="GET";
2448
+ if(b)if(c.isFunction(b)){
2449
+ d=b;
2450
+ b=null
2451
+ }else if(typeof b==="object"){
2452
+ b=
2453
+ c.param(b,c.ajaxSettings.traditional);
2454
+ f="POST"
2455
+ }
2456
+ var i=this;
2457
+ c.ajax({
2458
+ url:a,
2459
+ type:f,
2460
+ dataType:"html",
2461
+ data:b,
2462
+ complete:function(j,n){
2463
+ if(n==="success"||n==="notmodified")i.html(e?c("<div />").append(j.responseText.replace(qb,"")).find(e):j.responseText);
2464
+ d&&i.each(d,[j.responseText,n,j])
2465
+ }
2466
+ });
2467
+ return this
2468
+ },
2469
+ serialize:function(){
2470
+ return c.param(this.serializeArray())
2471
+ },
2472
+ serializeArray:function(){
2473
+ return this.map(function(){
2474
+ return this.elements?c.makeArray(this.elements):this
2475
+ }).filter(function(){
2476
+ return this.name&&!this.disabled&&
2477
+ (this.checked||rb.test(this.nodeName)||sb.test(this.type))
2478
+ }).map(function(a,b){
2479
+ a=c(this).val();
2480
+ return a==null?null:c.isArray(a)?c.map(a,function(d){
2481
+ return{
2482
+ name:b.name,
2483
+ value:d
2484
+ }
2485
+ }):{
2486
+ name:b.name,
2487
+ value:a
2488
+ }
2489
+ }).get()
2490
+ }
2491
+ });
2492
+ c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){
2493
+ c.fn[b]=function(d){
2494
+ return this.bind(b,d)
2495
+ }
2496
+ });
2497
+ c.extend({
2498
+ get:function(a,b,d,f){
2499
+ if(c.isFunction(b)){
2500
+ f=f||d;
2501
+ d=b;
2502
+ b=null
2503
+ }
2504
+ return c.ajax({
2505
+ type:"GET",
2506
+ url:a,
2507
+ data:b,
2508
+ success:d,
2509
+ dataType:f
2510
+ })
2511
+ },
2512
+ getScript:function(a,
2513
+ b){
2514
+ return c.get(a,null,b,"script")
2515
+ },
2516
+ getJSON:function(a,b,d){
2517
+ return c.get(a,b,d,"json")
2518
+ },
2519
+ post:function(a,b,d,f){
2520
+ if(c.isFunction(b)){
2521
+ f=f||d;
2522
+ d=b;
2523
+ b={}
2524
+ }
2525
+ return c.ajax({
2526
+ type:"POST",
2527
+ url:a,
2528
+ data:b,
2529
+ success:d,
2530
+ dataType:f
2531
+ })
2532
+ },
2533
+ ajaxSetup:function(a){
2534
+ c.extend(c.ajaxSettings,a)
2535
+ },
2536
+ ajaxSettings:{
2537
+ url:location.href,
2538
+ global:true,
2539
+ type:"GET",
2540
+ contentType:"application/x-www-form-urlencoded",
2541
+ processData:true,
2542
+ async:true,
2543
+ xhr:z.XMLHttpRequest&&(z.location.protocol!=="file:"||!z.ActiveXObject)?function(){
2544
+ return new z.XMLHttpRequest
2545
+ }:
2546
+ function(){
2547
+ try{
2548
+ return new z.ActiveXObject("Microsoft.XMLHTTP")
2549
+ }catch(a){}
2550
+ },
2551
+ accepts:{
2552
+ xml:"application/xml, text/xml",
2553
+ html:"text/html",
2554
+ script:"text/javascript, application/javascript",
2555
+ json:"application/json, text/javascript",
2556
+ text:"text/plain",
2557
+ _default:"*/*"
2558
+ }
2559
+ },
2560
+ lastModified:{},
2561
+ etag:{},
2562
+ ajax:function(a){
2563
+ function b(){
2564
+ e.success&&e.success.call(o,n,j,w);
2565
+ e.global&&f("ajaxSuccess",[w,e])
2566
+ }
2567
+ function d(){
2568
+ e.complete&&e.complete.call(o,w,j);
2569
+ e.global&&f("ajaxComplete",[w,e]);
2570
+ e.global&&!--c.active&&c.event.trigger("ajaxStop")
2571
+ }
2572
+ function f(q,p){
2573
+ (e.context?c(e.context):c.event).trigger(q,p)
2574
+ }
2575
+ var e=c.extend(true,{},c.ajaxSettings,a),i,j,n,o=a&&a.context||e,m=e.type.toUpperCase();
2576
+ if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);
2577
+ if(e.dataType==="jsonp"){
2578
+ if(m==="GET")N.test(e.url)||(e.url+=(ja.test(e.url)?"&":"?")+(e.jsonp||"callback")+"=?");
2579
+ else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";
2580
+ e.dataType="json"
2581
+ }
2582
+ if(e.dataType==="json"&&(e.data&&N.test(e.data)||
2583
+ N.test(e.url))){
2584
+ i=e.jsonpCallback||"jsonp"+pb++;
2585
+ if(e.data)e.data=(e.data+"").replace(N,"="+i+"$1");
2586
+ e.url=e.url.replace(N,"="+i+"$1");
2587
+ e.dataType="script";
2588
+ z[i]=z[i]||function(q){
2589
+ n=q;
2590
+ b();
2591
+ d();
2592
+ z[i]=v;
2593
+ try{
2594
+ delete z[i]
2595
+ }catch(p){}
2596
+ A&&A.removeChild(B)
2597
+ }
2598
+ }
2599
+ if(e.dataType==="script"&&e.cache===null)e.cache=false;
2600
+ if(e.cache===false&&m==="GET"){
2601
+ var s=J(),x=e.url.replace(tb,"$1_="+s+"$2");
2602
+ e.url=x+(x===e.url?(ja.test(e.url)?"&":"?")+"_="+s:"")
2603
+ }
2604
+ if(e.data&&m==="GET")e.url+=(ja.test(e.url)?"&":"?")+e.data;
2605
+ e.global&&!c.active++&&
2606
+ c.event.trigger("ajaxStart");
2607
+ s=(s=ub.exec(e.url))&&(s[1]&&s[1]!==location.protocol||s[2]!==location.host);
2608
+ if(e.dataType==="script"&&m==="GET"&&s){
2609
+ var A=r.getElementsByTagName("head")[0]||r.documentElement,B=r.createElement("script");
2610
+ B.src=e.url;
2611
+ if(e.scriptCharset)B.charset=e.scriptCharset;
2612
+ if(!i){
2613
+ var C=false;
2614
+ B.onload=B.onreadystatechange=function(){
2615
+ if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){
2616
+ C=true;
2617
+ b();
2618
+ d();
2619
+ B.onload=B.onreadystatechange=null;
2620
+ A&&B.parentNode&&
2621
+ A.removeChild(B)
2622
+ }
2623
+ }
2624
+ }
2625
+ A.insertBefore(B,A.firstChild);
2626
+ return v
2627
+ }
2628
+ var E=false,w=e.xhr();
2629
+ if(w){
2630
+ e.username?w.open(m,e.url,e.async,e.username,e.password):w.open(m,e.url,e.async);
2631
+ try{
2632
+ if(e.data||a&&a.contentType)w.setRequestHeader("Content-Type",e.contentType);
2633
+ if(e.ifModified){
2634
+ c.lastModified[e.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[e.url]);
2635
+ c.etag[e.url]&&w.setRequestHeader("If-None-Match",c.etag[e.url])
2636
+ }
2637
+ s||w.setRequestHeader("X-Requested-With","XMLHttpRequest");
2638
+ w.setRequestHeader("Accept",
2639
+ e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)
2640
+ }catch(fa){}
2641
+ if(e.beforeSend&&e.beforeSend.call(o,w,e)===false){
2642
+ e.global&&!--c.active&&c.event.trigger("ajaxStop");
2643
+ w.abort();
2644
+ return false
2645
+ }
2646
+ e.global&&f("ajaxSend",[w,e]);
2647
+ var g=w.onreadystatechange=function(q){
2648
+ if(!w||w.readyState===0||q==="abort"){
2649
+ E||d();
2650
+ E=true;
2651
+ if(w)w.onreadystatechange=c.noop
2652
+ }else if(!E&&w&&(w.readyState===4||q==="timeout")){
2653
+ E=true;
2654
+ w.onreadystatechange=c.noop;
2655
+ j=q==="timeout"?"timeout":!c.httpSuccess(w)?
2656
+ "error":e.ifModified&&c.httpNotModified(w,e.url)?"notmodified":"success";
2657
+ var p;
2658
+ if(j==="success")try{
2659
+ n=c.httpData(w,e.dataType,e)
2660
+ }catch(u){
2661
+ j="parsererror";
2662
+ p=u
2663
+ }
2664
+ if(j==="success"||j==="notmodified")i||b();else c.handleError(e,w,j,p);
2665
+ d();
2666
+ q==="timeout"&&w.abort();
2667
+ if(e.async)w=null
2668
+ }
2669
+ };
2670
+
2671
+ try{
2672
+ var h=w.abort;
2673
+ w.abort=function(){
2674
+ w&&h.call(w);
2675
+ g("abort")
2676
+ }
2677
+ }catch(k){}
2678
+ e.async&&e.timeout>0&&setTimeout(function(){
2679
+ w&&!E&&g("timeout")
2680
+ },e.timeout);
2681
+ try{
2682
+ w.send(m==="POST"||m==="PUT"||m==="DELETE"?e.data:null)
2683
+ }catch(l){
2684
+ c.handleError(e,
2685
+ w,null,l);
2686
+ d()
2687
+ }
2688
+ e.async||g();
2689
+ return w
2690
+ }
2691
+ },
2692
+ handleError:function(a,b,d,f){
2693
+ if(a.error)a.error.call(a.context||a,b,d,f);
2694
+ if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])
2695
+ },
2696
+ active:0,
2697
+ httpSuccess:function(a){
2698
+ try{
2699
+ return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223||a.status===0
2700
+ }catch(b){}
2701
+ return false
2702
+ },
2703
+ httpNotModified:function(a,b){
2704
+ var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");
2705
+ if(d)c.lastModified[b]=d;
2706
+ if(f)c.etag[b]=
2707
+ f;
2708
+ return a.status===304||a.status===0
2709
+ },
2710
+ httpData:function(a,b,d){
2711
+ var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;
2712
+ a=e?a.responseXML:a.responseText;
2713
+ e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");
2714
+ if(d&&d.dataFilter)a=d.dataFilter(a,b);
2715
+ if(typeof a==="string")if(b==="json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);
2716
+ else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);
2717
+ return a
2718
+ },
2719
+ param:function(a,b){
2720
+ function d(j,n){
2721
+ if(c.isArray(n))c.each(n,
2722
+ function(o,m){
2723
+ b?f(j,m):d(j+"["+(typeof m==="object"||c.isArray(m)?o:"")+"]",m)
2724
+ });else!b&&n!=null&&typeof n==="object"?c.each(n,function(o,m){
2725
+ d(j+"["+o+"]",m)
2726
+ }):f(j,n)
2727
+ }
2728
+ function f(j,n){
2729
+ n=c.isFunction(n)?n():n;
2730
+ e[e.length]=encodeURIComponent(j)+"="+encodeURIComponent(n)
2731
+ }
2732
+ var e=[];
2733
+ if(b===v)b=c.ajaxSettings.traditional;
2734
+ if(c.isArray(a)||a.jquery)c.each(a,function(){
2735
+ f(this.name,this.value)
2736
+ });else for(var i in a)d(i,a[i]);return e.join("&").replace(vb,"+")
2737
+ }
2738
+ });
2739
+ var ka={},wb=/toggle|show|hide/,xb=/^([+-]=)?([\d+-.]+)(.*)$/,
2740
+ W,ta=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];
2741
+ c.fn.extend({
2742
+ show:function(a,b){
2743
+ if(a||a===0)return this.animate(K("show",3),a,b);
2744
+ else{
2745
+ a=0;
2746
+ for(b=this.length;a<b;a++){
2747
+ var d=c.data(this[a],"olddisplay");
2748
+ this[a].style.display=d||"";
2749
+ if(c.css(this[a],"display")==="none"){
2750
+ d=this[a].nodeName;
2751
+ var f;
2752
+ if(ka[d])f=ka[d];
2753
+ else{
2754
+ var e=c("<"+d+" />").appendTo("body");
2755
+ f=e.css("display");
2756
+ if(f==="none")f="block";
2757
+ e.remove();
2758
+ ka[d]=f
2759
+ }
2760
+ c.data(this[a],"olddisplay",f)
2761
+ }
2762
+ }
2763
+ a=0;
2764
+ for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";
2765
+ return this
2766
+ }
2767
+ },
2768
+ hide:function(a,b){
2769
+ if(a||a===0)return this.animate(K("hide",3),a,b);
2770
+ else{
2771
+ a=0;
2772
+ for(b=this.length;a<b;a++){
2773
+ var d=c.data(this[a],"olddisplay");
2774
+ !d&&d!=="none"&&c.data(this[a],"olddisplay",c.css(this[a],"display"))
2775
+ }
2776
+ a=0;
2777
+ for(b=this.length;a<b;a++)this[a].style.display="none";
2778
+ return this
2779
+ }
2780
+ },
2781
+ _toggle:c.fn.toggle,
2782
+ toggle:function(a,b){
2783
+ var d=typeof a==="boolean";
2784
+ if(c.isFunction(a)&&
2785
+ c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){
2786
+ var f=d?a:c(this).is(":hidden");
2787
+ c(this)[f?"show":"hide"]()
2788
+ }):this.animate(K("toggle",3),a,b);
2789
+ return this
2790
+ },
2791
+ fadeTo:function(a,b,d){
2792
+ return this.filter(":hidden").css("opacity",0).show().end().animate({
2793
+ opacity:b
2794
+ },a,d)
2795
+ },
2796
+ animate:function(a,b,d,f){
2797
+ var e=c.speed(b,d,f);
2798
+ if(c.isEmptyObject(a))return this.each(e.complete);
2799
+ return this[e.queue===false?"each":"queue"](function(){
2800
+ var i=c.extend({},e),j,n=this.nodeType===1&&c(this).is(":hidden"),
2801
+ o=this;
2802
+ for(j in a){
2803
+ var m=j.replace(ha,ia);
2804
+ if(j!==m){
2805
+ a[m]=a[j];
2806
+ delete a[j];
2807
+ j=m
2808
+ }
2809
+ if(a[j]==="hide"&&n||a[j]==="show"&&!n)return i.complete.call(this);
2810
+ if((j==="height"||j==="width")&&this.style){
2811
+ i.display=c.css(this,"display");
2812
+ i.overflow=this.style.overflow
2813
+ }
2814
+ if(c.isArray(a[j])){
2815
+ (i.specialEasing=i.specialEasing||{})[j]=a[j][1];
2816
+ a[j]=a[j][0]
2817
+ }
2818
+ }
2819
+ if(i.overflow!=null)this.style.overflow="hidden";
2820
+ i.curAnim=c.extend({},a);
2821
+ c.each(a,function(s,x){
2822
+ var A=new c.fx(o,i,s);
2823
+ if(wb.test(x))A[x==="toggle"?n?"show":"hide":x](a);
2824
+ else{
2825
+ var B=xb.exec(x),C=A.cur(true)||0;
2826
+ if(B){
2827
+ x=parseFloat(B[2]);
2828
+ var E=B[3]||"px";
2829
+ if(E!=="px"){
2830
+ o.style[s]=(x||1)+E;
2831
+ C=(x||1)/A.cur(true)*C;
2832
+ o.style[s]=C+E
2833
+ }
2834
+ if(B[1])x=(B[1]==="-="?-1:1)*x+C;
2835
+ A.custom(C,x,E)
2836
+ }else A.custom(C,x,"")
2837
+ }
2838
+ });
2839
+ return true
2840
+ })
2841
+ },
2842
+ stop:function(a,b){
2843
+ var d=c.timers;
2844
+ a&&this.queue([]);
2845
+ this.each(function(){
2846
+ for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){
2847
+ b&&d[f](true);
2848
+ d.splice(f,1)
2849
+ }
2850
+ });
2851
+ b||this.dequeue();
2852
+ return this
2853
+ }
2854
+ });
2855
+ c.each({
2856
+ slideDown:K("show",1),
2857
+ slideUp:K("hide",1),
2858
+ slideToggle:K("toggle",
2859
+ 1),
2860
+ fadeIn:{
2861
+ opacity:"show"
2862
+ },
2863
+ fadeOut:{
2864
+ opacity:"hide"
2865
+ }
2866
+ },function(a,b){
2867
+ c.fn[a]=function(d,f){
2868
+ return this.animate(b,d,f)
2869
+ }
2870
+ });
2871
+ c.extend({
2872
+ speed:function(a,b,d){
2873
+ var f=a&&typeof a==="object"?a:{
2874
+ complete:d||!d&&b||c.isFunction(a)&&a,
2875
+ duration:a,
2876
+ easing:d&&b||b&&!c.isFunction(b)&&b
2877
+ };
2878
+
2879
+ f.duration=c.fx.off?0:typeof f.duration==="number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;
2880
+ f.old=f.complete;
2881
+ f.complete=function(){
2882
+ f.queue!==false&&c(this).dequeue();
2883
+ c.isFunction(f.old)&&f.old.call(this)
2884
+ };
2885
+
2886
+ return f
2887
+ },
2888
+ easing:{
2889
+ linear:function(a,
2890
+ b,d,f){
2891
+ return d+f*a
2892
+ },
2893
+ swing:function(a,b,d,f){
2894
+ return(-Math.cos(a*Math.PI)/2+0.5)*f+d
2895
+ }
2896
+ },
2897
+ timers:[],
2898
+ fx:function(a,b,d){
2899
+ this.options=b;
2900
+ this.elem=a;
2901
+ this.prop=d;
2902
+ if(!b.orig)b.orig={}
2903
+ }
2904
+ });
2905
+ c.fx.prototype={
2906
+ update:function(){
2907
+ this.options.step&&this.options.step.call(this.elem,this.now,this);
2908
+ (c.fx.step[this.prop]||c.fx.step._default)(this);
2909
+ if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"
2910
+ },
2911
+ cur:function(a){
2912
+ if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==
2913
+ null))return this.elem[this.prop];
2914
+ return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0
2915
+ },
2916
+ custom:function(a,b,d){
2917
+ function f(i){
2918
+ return e.step(i)
2919
+ }
2920
+ this.startTime=J();
2921
+ this.start=a;
2922
+ this.end=b;
2923
+ this.unit=d||this.unit||"px";
2924
+ this.now=this.start;
2925
+ this.pos=this.state=0;
2926
+ var e=this;
2927
+ f.elem=this.elem;
2928
+ if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)
2929
+ },
2930
+ show:function(){
2931
+ this.options.orig[this.prop]=c.style(this.elem,this.prop);
2932
+ this.options.show=true;
2933
+ this.custom(this.prop===
2934
+ "width"||this.prop==="height"?1:0,this.cur());
2935
+ c(this.elem).show()
2936
+ },
2937
+ hide:function(){
2938
+ this.options.orig[this.prop]=c.style(this.elem,this.prop);
2939
+ this.options.hide=true;
2940
+ this.custom(this.cur(),0)
2941
+ },
2942
+ step:function(a){
2943
+ var b=J(),d=true;
2944
+ if(a||b>=this.options.duration+this.startTime){
2945
+ this.now=this.end;
2946
+ this.pos=this.state=1;
2947
+ this.update();
2948
+ this.options.curAnim[this.prop]=true;
2949
+ for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){
2950
+ if(this.options.display!=null){
2951
+ this.elem.style.overflow=
2952
+ this.options.overflow;
2953
+ a=c.data(this.elem,"olddisplay");
2954
+ this.elem.style.display=a?a:this.options.display;
2955
+ if(c.css(this.elem,"display")==="none")this.elem.style.display="block"
2956
+ }
2957
+ this.options.hide&&c(this.elem).hide();
2958
+ if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,e,this.options.orig[e]);this.options.complete.call(this.elem)
2959
+ }
2960
+ return false
2961
+ }else{
2962
+ e=b-this.startTime;
2963
+ this.state=e/this.options.duration;
2964
+ a=this.options.easing||(c.easing.swing?"swing":"linear");
2965
+ this.pos=
2966
+ c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);
2967
+ this.now=this.start+(this.end-this.start)*this.pos;
2968
+ this.update()
2969
+ }
2970
+ return true
2971
+ }
2972
+ };
2973
+
2974
+ c.extend(c.fx,{
2975
+ tick:function(){
2976
+ for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);
2977
+ a.length||c.fx.stop()
2978
+ },
2979
+ stop:function(){
2980
+ clearInterval(W);
2981
+ W=null
2982
+ },
2983
+ speeds:{
2984
+ slow:600,
2985
+ fast:200,
2986
+ _default:400
2987
+ },
2988
+ step:{
2989
+ opacity:function(a){
2990
+ c.style(a.elem,"opacity",a.now)
2991
+ },
2992
+ _default:function(a){
2993
+ if(a.elem.style&&a.elem.style[a.prop]!=
2994
+ null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now
2995
+ }
2996
+ }
2997
+ });
2998
+ if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){
2999
+ return c.grep(c.timers,function(b){
3000
+ return a===b.elem
3001
+ }).length
3002
+ };
3003
+
3004
+ c.fn.offset="getBoundingClientRect"in r.documentElement?function(a){
3005
+ var b=this[0];
3006
+ if(a)return this.each(function(e){
3007
+ c.offset.setOffset(this,a,e)
3008
+ });
3009
+ if(!b||!b.ownerDocument)return null;
3010
+ if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);
3011
+ var d=b.getBoundingClientRect(),
3012
+ f=b.ownerDocument;
3013
+ b=f.body;
3014
+ f=f.documentElement;
3015
+ return{
3016
+ top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),
3017
+ left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)
3018
+ }
3019
+ }:function(a){
3020
+ var b=this[0];
3021
+ if(a)return this.each(function(s){
3022
+ c.offset.setOffset(this,a,s)
3023
+ });
3024
+ if(!b||!b.ownerDocument)return null;
3025
+ if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);
3026
+ c.offset.initialize();
3027
+ var d=b.offsetParent,f=
3028
+ b,e=b.ownerDocument,i,j=e.documentElement,n=e.body;
3029
+ f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;
3030
+ for(var o=b.offsetTop,m=b.offsetLeft;(b=b.parentNode)&&b!==n&&b!==j;){
3031
+ if(c.offset.supportsFixedPosition&&f.position==="fixed")break;
3032
+ i=e?e.getComputedStyle(b,null):b.currentStyle;
3033
+ o-=b.scrollTop;
3034
+ m-=b.scrollLeft;
3035
+ if(b===d){
3036
+ o+=b.offsetTop;
3037
+ m+=b.offsetLeft;
3038
+ if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){
3039
+ o+=parseFloat(i.borderTopWidth)||
3040
+ 0;
3041
+ m+=parseFloat(i.borderLeftWidth)||0
3042
+ }
3043
+ f=d;
3044
+ d=b.offsetParent
3045
+ }
3046
+ if(c.offset.subtractsBorderForOverflowNotVisible&&i.overflow!=="visible"){
3047
+ o+=parseFloat(i.borderTopWidth)||0;
3048
+ m+=parseFloat(i.borderLeftWidth)||0
3049
+ }
3050
+ f=i
3051
+ }
3052
+ if(f.position==="relative"||f.position==="static"){
3053
+ o+=n.offsetTop;
3054
+ m+=n.offsetLeft
3055
+ }
3056
+ if(c.offset.supportsFixedPosition&&f.position==="fixed"){
3057
+ o+=Math.max(j.scrollTop,n.scrollTop);
3058
+ m+=Math.max(j.scrollLeft,n.scrollLeft)
3059
+ }
3060
+ return{
3061
+ top:o,
3062
+ left:m
3063
+ }
3064
+ };
3065
+
3066
+ c.offset={
3067
+ initialize:function(){
3068
+ var a=r.body,b=r.createElement("div"),
3069
+ d,f,e,i=parseFloat(c.curCSS(a,"marginTop",true))||0;
3070
+ c.extend(b.style,{
3071
+ position:"absolute",
3072
+ top:0,
3073
+ left:0,
3074
+ margin:0,
3075
+ border:0,
3076
+ width:"1px",
3077
+ height:"1px",
3078
+ visibility:"hidden"
3079
+ });
3080
+ b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
3081
+ a.insertBefore(b,a.firstChild);
3082
+ d=b.firstChild;
3083
+ f=d.firstChild;
3084
+ e=d.nextSibling.firstChild.firstChild;
3085
+ this.doesNotAddBorder=f.offsetTop!==5;
3086
+ this.doesAddBorderForTableAndCells=e.offsetTop===5;
3087
+ f.style.position="fixed";
3088
+ f.style.top="20px";
3089
+ this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;
3090
+ f.style.position=f.style.top="";
3091
+ d.style.overflow="hidden";
3092
+ d.style.position="relative";
3093
+ this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;
3094
+ this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==i;
3095
+ a.removeChild(b);
3096
+ c.offset.initialize=c.noop
3097
+ },
3098
+ bodyOffset:function(a){
3099
+ var b=a.offsetTop,d=a.offsetLeft;
3100
+ c.offset.initialize();
3101
+ if(c.offset.doesNotIncludeMarginInBodyOffset){
3102
+ b+=parseFloat(c.curCSS(a,"marginTop",true))||0;
3103
+ d+=parseFloat(c.curCSS(a,"marginLeft",true))||0
3104
+ }
3105
+ return{
3106
+ top:b,
3107
+ left:d
3108
+ }
3109
+ },
3110
+ setOffset:function(a,b,d){
3111
+ if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";
3112
+ var f=c(a),e=f.offset(),i=parseInt(c.curCSS(a,"top",true),10)||0,j=parseInt(c.curCSS(a,"left",true),10)||0;
3113
+ if(c.isFunction(b))b=b.call(a,d,e);
3114
+ d={
3115
+ top:b.top-e.top+i,
3116
+ left:b.left-
3117
+ e.left+j
3118
+ };
3119
+
3120
+ "using"in b?b.using.call(a,d):f.css(d)
3121
+ }
3122
+ };
3123
+
3124
+ c.fn.extend({
3125
+ position:function(){
3126
+ if(!this[0])return null;
3127
+ var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{
3128
+ top:0,
3129
+ left:0
3130
+ }:b.offset();
3131
+ d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;
3132
+ d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;
3133
+ f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;
3134
+ f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;
3135
+ return{
3136
+ top:d.top-f.top,
3137
+ left:d.left-f.left
3138
+ }
3139
+ },
3140
+ offsetParent:function(){
3141
+ return this.map(function(){
3142
+ for(var a=
3143
+ this.offsetParent||r.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;
3144
+ return a
3145
+ })
3146
+ }
3147
+ });
3148
+ c.each(["Left","Top"],function(a,b){
3149
+ var d="scroll"+b;
3150
+ c.fn[d]=function(f){
3151
+ var e=this[0],i;
3152
+ if(!e)return null;
3153
+ if(f!==v)return this.each(function(){
3154
+ if(i=ua(this))i.scrollTo(!a?f:c(i).scrollLeft(),a?f:c(i).scrollTop());else this[d]=f
3155
+ });else return(i=ua(e))?"pageXOffset"in i?i[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&i.document.documentElement[d]||i.document.body[d]:e[d]
3156
+ }
3157
+ });
3158
+ c.each(["Height","Width"],function(a,b){
3159
+ var d=b.toLowerCase();
3160
+ c.fn["inner"+b]=function(){
3161
+ return this[0]?c.css(this[0],d,false,"padding"):null
3162
+ };
3163
+
3164
+ c.fn["outer"+b]=function(f){
3165
+ return this[0]?c.css(this[0],d,false,f?"margin":"border"):null
3166
+ };
3167
+
3168
+ c.fn[d]=function(f){
3169
+ var e=this[0];
3170
+ if(!e)return f==null?null:this;
3171
+ if(c.isFunction(f))return this.each(function(i){
3172
+ var j=c(this);
3173
+ j[d](f.call(this,i,j[d]()))
3174
+ });
3175
+ return"scrollTo"in e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||
3176
+ e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===v?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")
3177
+ }
3178
+ });
3179
+ z.jQuery=z.$=c
3180
+ })(window);
skin/frontend/base/default/olctw_debug/js/toolbar.js ADDED
@@ -0,0 +1,190 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function(window, document, version, callback) {
2
+ var j, d;
3
+ var loaded = false;
4
+ if (!(j = window.jQuery) || version > j.fn.jquery || callback(j)) {
5
+ var script = document.createElement("script");
6
+ script.type = "text/javascript";
7
+ script.src = DEBUG_TOOLBAR_MEDIA_URL + "js/jquery.js";
8
+ script.onload = script.onreadystatechange = function() {
9
+ if (!loaded && (!(d = this.readyState) || d == "loaded" || d == "complete")) {
10
+ callback((j = window.jQuery).noConflict(1), loaded = true);
11
+ j(script).remove();
12
+ }
13
+ };
14
+ document.getElementsByTagName('head')[0].appendChild(script)
15
+ }
16
+ })(window, document, "1.3", function($, jquery_loaded) {
17
+
18
+ $.cookie = function(name, value, options) {
19
+ if (typeof value != 'undefined') {
20
+ options = options || {};
21
+ if (value === null) {
22
+ value = '';
23
+ options.expires = -1;
24
+ }
25
+ var expires = '';
26
+ if (options.expires && (typeof options.expires == 'number' || options.expires.toUTCString)) {
27
+ var date;
28
+ if (typeof options.expires == 'number') {
29
+ date = new Date();
30
+ date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
31
+ } else {
32
+ date = options.expires;
33
+ }
34
+ expires = '; expires=' + date.toUTCString();
35
+ }
36
+ var path = options.path ? '; path=' + (options.path) : '';
37
+ var domain = options.domain ? '; domain=' + (options.domain) : '';
38
+ var secure = options.secure ? '; secure' : '';
39
+ document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
40
+ } else {
41
+ var cookieValue = null;
42
+ if (document.cookie && document.cookie != '') {
43
+ var cookies = document.cookie.split(';');
44
+ for (var i = 0; i < cookies.length; i++) {
45
+ var cookie = $.trim(cookies[i]);
46
+ if (cookie.substring(0, name.length + 1) == (name + '=')) {
47
+ cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
48
+ break;
49
+ }
50
+ }
51
+ }
52
+ return cookieValue;
53
+ }
54
+ };
55
+ $('head').append('<link rel="stylesheet" href="'+DEBUG_TOOLBAR_MEDIA_URL+'css/toolbar.css" type="text/css" />');
56
+ var COOKIE_NAME = 'djdt';
57
+ var djdt = {
58
+ init: function() {
59
+ $('#djDebug').show();
60
+ var current = null;
61
+ $('#djDebugPanelList li a').click(function() {
62
+ if (!this.className) {
63
+ return false;
64
+ }
65
+ current = $('#djDebug #' + this.className);
66
+ if (current.is(':visible')) {
67
+ $(document).trigger('close.djDebug');
68
+ $(this).parent().removeClass('active');
69
+ } else {
70
+ $('.panelContent').hide(); // Hide any that are already open
71
+ current.show();
72
+ $('#djDebugToolbar li').removeClass('active');
73
+ $(this).parent().addClass('active');
74
+ }
75
+ return false;
76
+ });
77
+ $('#djDebug a.djDebugClose').click(function() {
78
+ $(document).trigger('close.djDebug');
79
+ $('#djDebugToolbar li').removeClass('active');
80
+ return false;
81
+ });
82
+ $('#djDebug a.remoteCall').click(function() {
83
+ $('#djDebugWindow').html('<div class="loader"></div>');
84
+ $('#djDebugWindow').load(this.href, {}, function() {
85
+ $('#djDebugWindow a.djDebugBack').click(function() {
86
+ $(this).parent().parent().hide();
87
+ return false;
88
+ });
89
+ });
90
+ $('#djDebugWindow').show();
91
+ return false;
92
+ });
93
+ $('#debug-panel-Layout a.djTemplateShowContext').click(function() {
94
+ djdt.toggle_arrow($(this).children('.toggleArrow'))
95
+ djdt.toggle_content($(this).parent().next());
96
+ return false;
97
+ });
98
+ $('#djDebugSQLPanel a.djSQLShowStacktrace').click(function() {
99
+ djdt.toggle_content($('.djSQLHideStacktraceDiv', $(this).parents('tr')));
100
+ return false;
101
+ });
102
+ $('#djHideToolBarButton').click(function() {
103
+ djdt.hide_toolbar(true);
104
+ return false;
105
+ });
106
+ $('#djShowToolBarButton').click(function() {
107
+ djdt.show_toolbar();
108
+ return false;
109
+ });
110
+ $(document).bind('close.djDebug', function() {
111
+ // If a sub-panel is open, close that
112
+ if ($('#djDebugWindow').is(':visible')) {
113
+ $('#djDebugWindow').hide();
114
+ return;
115
+ }
116
+ // If a panel is open, close that
117
+ if ($('.panelContent').is(':visible')) {
118
+ $('.panelContent').hide();
119
+ return;
120
+ }
121
+ // Otherwise, just minimize the toolbar
122
+ if ($('#djDebugToolbar').is(':visible')) {
123
+ djdt.hide_toolbar(true);
124
+ return;
125
+ }
126
+ });
127
+ if ($.cookie(COOKIE_NAME)) {
128
+ djdt.hide_toolbar(false);
129
+ } else {
130
+ djdt.show_toolbar(false);
131
+ }
132
+ },
133
+ toggle_content: function(elem) {
134
+ if (elem.is(':visible')) {
135
+ elem.hide();
136
+ } else {
137
+ elem.show();
138
+ }
139
+ },
140
+ close: function() {
141
+ $(document).trigger('close.djDebug');
142
+ return false;
143
+ },
144
+ hide_toolbar: function(setCookie) {
145
+ // close any sub panels
146
+ $('#djDebugWindow').hide();
147
+ // close all panels
148
+ $('.panelContent').hide();
149
+ $('#djDebugToolbar li').removeClass('active');
150
+ // finally close toolbar
151
+ $('#djDebugToolbar').hide('fast');
152
+ $('#djDebugToolbarHandle').show();
153
+ // Unbind keydown
154
+ $(document).unbind('keydown.djDebug');
155
+ if (setCookie) {
156
+ $.cookie(COOKIE_NAME, 'hide', {
157
+ path: '/',
158
+ expires: 10
159
+ });
160
+ }
161
+ },
162
+ show_toolbar: function(animate) {
163
+ // Set up keybindings
164
+ $(document).bind('keydown.djDebug', function(e) {
165
+ if (e.keyCode == 27) {
166
+ djdt.close();
167
+ }
168
+ });
169
+ $('#djDebugToolbarHandle').hide();
170
+ if (animate) {
171
+ $('#djDebugToolbar').show('fast');
172
+ } else {
173
+ $('#djDebugToolbar').show();
174
+ }
175
+ $.cookie(COOKIE_NAME, null, {
176
+ path: '/',
177
+ expires: -1
178
+ });
179
+ },
180
+ toggle_arrow: function(elem) {
181
+ var uarr = String.fromCharCode(0x25b6);
182
+ var darr = String.fromCharCode(0x25bc);
183
+ elem.html(elem.html() == uarr ? darr : uarr);
184
+ }
185
+ };
186
+ $(document).ready(function() {
187
+ djdt.init();
188
+ });
189
+ });
190
+