PDA

View Full Version : [FIXED-473][3.1] Remove ExtJs 2 dependency from documentation browser



uwolfer
10 Jan 2010, 6:39 AM
This is not a real bug, but an optimization. The following patch ports the documentation browser app from ExtJs 2 to 3. This way you can get rid of the duplicated ext*.js files in the docs/ folder. This brings two advantages: any IDE does not need to index these useless JS files and the released zip package get smaller (from 9.1MB to 8.6MB (zip file packed with 7zip)).

Please also note the removed folders and files in this patch.



diff -rup ext-3.1.0-orig/docs/index.html ext-3.1.0/docs/index.html
--- ext-3.1.0-orig/docs/index.html 2009-12-15 13:15:36.000000000 +0100
+++ ext-3.1.0/docs/index.html 2009-12-25 12:51:18.000000000 +0100
@@ -2,7 +2,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Ext 3.1 - API Documentation</title>
- <link rel="stylesheet" type="text/css" href="resources/css/ext-all.css" />
+ <link rel="stylesheet" type="text/css" href="../resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="resources/docs.css" />
<link rel="stylesheet" type="text/css" href="resources/style.css" />
<style type="text/css">
@@ -15,9 +15,9 @@
<div class="loading-indicator"><img src="resources/extanim32.gif" width="32" height="32" style="margin-right:8px;" align="absmiddle"/>Loading...</div>
</div>
<!-- include everything after the loading indicator -->
- <script type="text/javascript" src="resources/ext-base.js"></script>
- <script type="text/javascript" src="resources/ext-all.js"></script>
- <script type="text/javascript" src="resources/TabCloseMenu.js"></script>
+ <script type="text/javascript" src="../adapter/ext/ext-base.js"></script>
+ <script type="text/javascript" src="../ext-all.js"></script>
+ <script type="text/javascript" src="../examples/ux/TabCloseMenu.js"></script>

<script type="text/javascript" src="resources/docs.js"></script>
<script type="text/javascript" src="output/tree.js"></script>
Only in ext-3.1.0-orig/docs/resources: TabCloseMenu.js
Only in ext-3.1.0-orig/docs/resources: css
diff -rup ext-3.1.0-orig/docs/resources/docs.css ext-3.1.0/docs/resources/docs.css
--- ext-3.1.0-orig/docs/resources/docs.css 2009-12-15 13:15:36.000000000 +0100
+++ ext-3.1.0/docs/resources/docs.css 2009-12-25 12:05:55.000000000 +0100
@@ -48,7 +48,7 @@ html, body {

.loading-indicator {
font-size:11px;
- background-image:url('../resources/images/default/grid/loading.gif');
+ background-image:url('../../resources/images/default/grid/loading.gif');
background-repeat: no-repeat;
background-position:top left;
padding-left:20px;
@@ -62,7 +62,7 @@ html, body {
top:35%;
left:43%;
color:#444;
- background-image:url(../resources/images/default/shared/large-loading.gif);
+ background-image:url(../../resources/images/default/shared/large-loading.gif);
background-repeat: no-repeat;
background-position:left 5px;
padding:10px 10px 10px 38px;
@@ -233,7 +233,7 @@ a:hover {
}

#doc-body .x-tab-panel-body {
- background:#fff url(../resources/images/default/form/text-bg.gif) repeat-x 0 0;
+ background:#fff url(../../resources/images/default/form/text-bg.gif) repeat-x 0 0;
}
#doc-body .x-panel-body, #doc-body .body-wrap {
background:transparent !important;
diff -rup ext-3.1.0-orig/docs/resources/docs.js ext-3.1.0/docs/resources/docs.js
--- ext-3.1.0-orig/docs/resources/docs.js 2009-12-15 13:15:36.000000000 +0100
+++ ext-3.1.0/docs/resources/docs.js 2009-12-25 12:40:39.000000000 +0100
@@ -6,6 +6,7 @@ ApiPanel = function() {
ApiPanel.superclass.constructor.call(this, {
id:'api-tree',
region:'west',
+ header:false,
split:true,
width: 280,
minSize: 175,
@@ -95,10 +96,11 @@ Ext.extend(ApiPanel, Ext.tree.TreePanel,

// hide empty packages that weren't filtered
this.hiddenPkgs = [];
+ var that = this;
this.root.cascade(function(n){
if(!n.attributes.isClass && n.ui.ctNode.offsetHeight < 3){
n.ui.hide();
- this.hiddenPkgs.push(n);
+ that.hiddenPkgs.push(n);
}
});
},
@@ -334,7 +336,7 @@ Ext.extend(MainPanel, Ext.TabPanel, {
'<tpl for=".">',
'<div class="search-item">',
'<a class="member" ext:cls="{cls}" ext:member="{member}" href="output/{cls}.html">',
- '<img src="resources/images/default/s.gif" class="item-icon icon-{type}"/>{member}',
+ '<img src="../resources/images/default/s.gif" class="item-icon icon-{type}"/>{member}',
'</a> ',
'<a class="cls" ext:cls="{cls}" href="output/{cls}.html">{cls}</a>',
'<p>{doc}</p>',
Only in ext-3.1.0-orig/docs/resources: ext-all.js
Only in ext-3.1.0-orig/docs/resources: ext-base.js
Only in ext-3.1.0-orig/docs/resources: images
diff -rup ext-3.1.0-orig/docs/resources/style.css ext-3.1.0/docs/resources/style.css
--- ext-3.1.0-orig/docs/resources/style.css 2009-12-15 13:15:36.000000000 +0100
+++ ext-3.1.0/docs/resources/style.css 2009-12-25 12:12:07.000000000 +0100
@@ -44,7 +44,7 @@
border-right:1px solid #d0d0d0;
border-top:1px solid #eee;
border-left:1px solid #eee;
- background: #f9f9f9 url(../resources/images/default/grid/grid3-hrow.gif) repeat-x 0 top;
+ background: #f9f9f9 url(../../resources/images/default/grid/grid3-hrow.gif) repeat-x 0 top;
padding:3px;
}
.body-wrap .msource-header {
diff -rup ext-3.1.0-orig/docs/welcome.html ext-3.1.0/docs/welcome.html
--- ext-3.1.0-orig/docs/welcome.html 2009-12-15 13:15:36.000000000 +0100
+++ ext-3.1.0/docs/welcome.html 2009-12-25 12:23:20.000000000 +0100
@@ -8,7 +8,7 @@
<div class="res-block-inner">
<h3>Additional Resources</h3>
<ul>
- <li><a href="../examples/samples.html" target="_blank">Ext 3.1 Samples</a></li>
+ <li><a href="../examples/index.html" target="_blank">Ext 3.1 Samples</a></li>
<li><a href="http://extjs.com/learn" target="_blank">Ext Learning Center</a></li>
<li><a href="http://extjs.com/learn/Ext_FAQ" target="_blank">FAQ</a></li>
<li><a href="http://extjs.com/learn/Tutorials" target="_blank">Tutorials</a></li>
@@ -30,14 +30,14 @@
<div class="res-block-inner">
<h3>Icon Legend</h3>
<ul id="legend" style="list-style:none;margin-left:0;">
- <li><img src="resources/images/default/s.gif" class="item-icon icon-pkg">Package</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-cls">Class</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-static">Singleton</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-cmp">Component</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-method">Method</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-prop">Property</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-config">Config Option</li>
- <li><img src="resources/images/default/s.gif" class="item-icon icon-event">Event</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-pkg">Package</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-cls">Class</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-static">Singleton</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-cmp">Component</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-method">Method</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-prop">Property</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-config">Config Option</li>
+ <li><img src="../resources/images/default/s.gif" class="item-icon icon-event">Event</li>
</ul>
</div>
</div>

uwolfer
9 Feb 2010, 5:20 AM
I just have noticed that you have removed the ExtJs 2.x dependency in the documentation browser... It seems like you have ignored my patch, since there are at least two obvious bugs now which would have been fixed with my patch.

#1:

this.hiddenPkgs is undefined
this.hiddenPkgs.push(n);
docs.js (line 101)

#2: The left panel header is visible, which uses unnecessary screen space and was not visible in the old browser. This is a behavior change in ExtJs 3.

Also the additional ext-{base,all}.js copy is IMHO bad, since it uses unnecessary space and shows up twice in a IDE when opening a file by name.

Jamie Avins
9 Feb 2010, 9:17 AM
We have not addressed all the issues with the doc viewer yet, your ticket is still open and will be worked on.

Jamie Avins
10 Mar 2010, 3:54 PM
3.2 release will have the remaining changes.