Skip to content
Browse files

Merge master

  • Loading branch information...
2 parents d7c2e3e + ca9f7e1 commit f044769a35a610ef182a7d5fb7e6a5ac1ff8196c Nick Poulden committed Mar 23, 2012
View
17 README.md
@@ -90,23 +90,24 @@ switch. For full list of all command line options type
[adv]: https://github.com/senchalabs/jsduck/wiki/Advanced-Usage
-Hacking it
-----------
-
-See [Hacking guide](https://github.com/senchalabs/jsduck/wiki/Hacking) in wiki.
-
-
Documenting your code
---------------------
-All the supported syntax is described in the [Guide][].
-For quick overview take a look at [example.js][example].
+For quick overview read the [Guide][] and take a look at [example.js][example].
+Follow links in the guide to digg into the details.
Looking for specific @tag? Take a look at the [whole list of supported tags][tags].
[example]: https://github.com/senchalabs/jsduck/blob/master/opt/example.js
[tags]: https://github.com/senchalabs/jsduck/wiki/Tags
+
+Hacking it
+----------
+
+See [Hacking guide](https://github.com/senchalabs/jsduck/wiki/Hacking) in wiki.
+
+
Copying
-------
View
18 Rakefile
@@ -494,6 +494,24 @@ task :animator, [:mode] => :sass do |t, args|
runner.run
end
+desc "Run JSDuck on Sencha Designer (for internal use at Sencha)\n" +
+ "designer - creates debug/development version\n" +
+ "designer[export] - create live version for deployment\n"
+ "designer[live] - create live version for deployment\n"
+task :designer, [:mode] => :sass do |t, args|
+ mode = args[:mode] || "debug"
+ throw "Unknown mode #{mode}" unless ["debug", "live", "export"].include?(mode)
+ compress if mode == "live"
+
+ runner = JsDuckRunner.new
+ runner.add_options ["--output", OUT_DIR, "--config", "#{DESIGNER_DIR}/docs/config.json"]
+ runner.add_debug if mode == "debug"
+ runner.add_seo if mode == "debug" || mode == "live"
+ runner.add_google_analytics if mode == "live"
+ runner.add_comments('designer', '2') if mode == "debug" || mode == "live"
+ runner.run
+end
+
desc "Build JSDuck gem"
task :gem => :sass do
compress
View
4 template/app.js
@@ -1,5 +1,9 @@
Ext.ns("Docs");
+// Ext 4.0.7 has a bug that when creating cors request
+// the Ext.isIe property is mistakenly checked instead of Ext.isIE.
+Ext.isIe = Ext.isIE;
+
Ext.Loader.setConfig({
enabled: true,
paths: {
View
53 template/app/view/Tabs.js
@@ -89,7 +89,6 @@ Ext.define('Docs.view.Tabs', {
// Close tab when clicked on close button
this.el.on('click', function(event, el) {
- this.justClosed = true;
var url = Ext.get(el).up('.doctab').down('.tabUrl').getAttribute('href');
url = Docs.History.cleanUrl(url);
this.removeTab(url);
@@ -101,8 +100,8 @@ Ext.define('Docs.view.Tabs', {
// Navigate to page when tab clicked
this.el.on('click', function(event, el) {
- if (this.justClosed) {
- this.justClosed = false;
+ // Do nothing when close button within the tab was clicked.
+ if (Ext.fly(event.getTarget()).hasCls("close")) {
return;
}
var url = Ext.get(el).down('.tabUrl').getAttribute('href');
@@ -198,31 +197,39 @@ Ext.define('Docs.view.Tabs', {
return;
}
- var idx = Ext.Array.indexOf(this.tabs, url);
- if (idx !== false) {
- Ext.Array.erase(this.tabs, idx, 1);
- }
- var idx = Ext.Array.indexOf(this.tabsInBar, url);
- if (idx !== false) {
- Ext.Array.erase(this.tabsInBar, idx, 1);
- }
- if (this.tabs[this.tabsInBar.length]) {
- this.tabsInBar.push(this.tabs[this.tabsInBar.length]);
+ // Remove the tab both from tab-bar and all-tabs array
+ this.removeFromArray(this.tabs, url);
+ var removedIndex = this.removeFromArray(this.tabsInBar, url);
+
+ // An empty space in tab-bar has now become available
+ // If the all-tabs array has an item to fill this spot,
+ // add the item from all-tabs array to tab-bar.
+ var firstHiddenTab = this.tabs[this.tabsInBar.length];
+ if (firstHiddenTab) {
+ this.tabsInBar.push(firstHiddenTab);
}
- if (this.activeTab && this.activeTab === url) {
+ // Was the active tab closed?
+ if (this.activeTab === url) {
if (this.tabs.length === 0) {
+ // When all tabs were closed
+ // open index page corresponding to the last closed tab type
Docs.App.getController(this.getControllerName(url)).loadIndex();
}
else {
- if (idx === this.tabs.length) {
- idx -= 1;
+ // When more tabs remaining
+ // activate the tab at the position of last closed tab.
+ // Except when the last tab was closed - then choose one before it.
+ if (removedIndex === this.tabs.length) {
+ removedIndex -= 1;
}
- this.activateTab(this.tabs[idx]);
- this.fireEvent("tabActivate", this.tabs[idx]);
+ this.activateTab(this.tabs[removedIndex]);
+ this.fireEvent("tabActivate", this.tabs[removedIndex]);
}
}
+ // When removed tab got replaced with hidden tab do a full refresh of tabs.
+ // Otherwise just remove the single tab.
if (this.tabs.length >= this.maxTabsInBar()) {
this.refresh();
} else {
@@ -232,6 +239,16 @@ Ext.define('Docs.view.Tabs', {
this.saveTabs();
},
+ // Removes item from array
+ // Returns the index from which the item was removed.
+ removeFromArray: function(array, item) {
+ var idx = Ext.Array.indexOf(array, item);
+ if (idx !== -1) {
+ Ext.Array.erase(array, idx, 1);
+ }
+ return idx;
+ },
+
/**
* Activates a tab
*
View
7 template/resources/sass/_class_overview.scss
@@ -13,7 +13,12 @@
margin: 0 0 10px 60px;
font-size: 12px; }
.hierarchy {
- @include gray-h4;
+ h4 {
+ font-family: $docs-font;
+ font-size: 90%;
+ padding: 11px 0 5px 0;
+ text-transform: uppercase;
+ color: #999999; }
.dependency, .alternate-class-name {
padding: 0 0 0 12px;
margin-top: 3px; }
View
18 template/resources/sass/_comments.scss
@@ -192,7 +192,7 @@
.deleteComment,
.vote {
@include transition(opacity, 0.2s, linear);
- opacity: 1; } } }
+ @include opacity(1); } } }
.target {
color: #666;
font-size: 90%;
@@ -227,13 +227,13 @@
.deleteComment {
right: 110px;
color: #999;
- opacity: 0;
+ @include opacity(0);
@include transition(opacity, 0.2s, linear);
position: absolute; }
.editComment {
right: 160px;
color: #999;
- opacity: 0;
+ @include opacity(0);
@include transition(opacity, 0.2s, linear);
position: absolute; }
.readComment {
@@ -255,10 +255,10 @@
height: 18px;
background: url(../images/vote-arrows.png) no-repeat;
&.selected {
- opacity: 0.4;
+ @include opacity(0.4);
background-position: -22px 0; }
- &:hover {
- opacity: 1 !important;
+ &:hover, &.selected:hover {
+ @include opacity(1);
background-position: -22px 0; } }
.voteCommentDown {
position: absolute;
@@ -269,9 +269,9 @@
background: url(../images/vote-arrows.png) no-repeat 0 -35px;
&.selected {
background-position: -22px -35px;
- opacity: 0.4; }
- &:hover {
- opacity: 1 !important;
+ @include opacity(0.4); }
+ &:hover, &.selected:hover {
+ @include opacity(1);
background-position: -22px -35px; } }
.score {
position: absolute;
View
6 template/resources/sass/_examples.scss
@@ -18,7 +18,7 @@ pre.inline-example {
color: #57a7dc; }
span.x-btn-icon {
background: url(../images/example-icons.png) no-repeat;
- opacity: 0.6;
+ @include opacity(0.6);
&.code {
background-position: -2px -19px; }
&.preview {
@@ -27,7 +27,7 @@ pre.inline-example {
background-position: -2px -88px; } }
.active span.x-btn-icon {
background: url(../images/example-icons.png) no-repeat;
- opacity: 1;
+ @include opacity(1);
&.code {
background-position: -30px -19px; }
&.preview {
@@ -101,7 +101,7 @@ pre.inline-example {
border-width: 1px !important;
border-style: solid;
@include vertical-gradient(#f1f1f1, #e9e9e9);
- box-shadow: inset rgba(255,255,255,0.5) 0 1px 0;
+ @include box-shadow(rgba(255,255,255,0.5) 0 1px 0 0 inset);
.separator {
border-left: 1px solid #ccc;
margin: 0 10px;
View
2 template/resources/sass/_hover_menu.scss
@@ -20,7 +20,7 @@
border: 1px solid #e4e4e4;
border-top: 1px solid #eaeaea;
left: -16px;
- @include border-radius-bottom(5px);
+ @include border-bottom-radius(5px);
table {
width: 100%; }
td {
View
45 template/resources/sass/_mixins.scss
@@ -1,32 +1,5 @@
@import "variables";
-
-@mixin box-shadow($x, $y, $radius, $color) {
- -webkit-box-shadow: $x $y $radius $color;
- -moz-box-shadow: $x $y $radius $color; }
-
-@mixin border-radius($size) {
- border-radius: $size;
- -moz-border-radius: $size; }
-
-@mixin border-radius-bottom($size) {
- border-bottom-left-radius: $size;
- border-bottom-right-radius: $size; }
-
-@mixin border-top-left-radius($size) {
- border-top-left-radius: $size;
- -moz-border-radius-topleft: $size; }
-
-@mixin border-top-right-radius($size) {
- border-top-right-radius: $size;
- -moz-border-radius-topright: $size; }
-
-@mixin border-bottom-left-radius($size) {
- -webkit-border-bottom-left-radius: $size;
- -moz-border-radius-bottomleft: $size; }
-
-@mixin border-bottom-right-radius($size) {
- border-bottom-right-radius: $size;
- -moz-border-radius-bottomright: $size; }
+@import "compass/css3";
@mixin vertical-gradient($fromCol, $toCol) {
background: $fromCol;
@@ -38,10 +11,6 @@
background: -webkit-gradient(linear, left top, right top, from($fromCol), to($toCol));
background: -moz-linear-gradient(left, $fromCol, $toCol); }
-@mixin opacity($opacity) {
- opacity: $opacity;
- filter: alpha(opacity=$opacity*100); }
-
@mixin transition($property, $duration, $timingFunction) {
-webkit-transition: $property $duration $timingFunction;
-moz-transition: $property $duration $timingFunction;
@@ -83,16 +52,8 @@
.icon-component-redirect {
background: url(../images/icons.png) no-repeat 0 -640px; } }
-@mixin gray-h4 {
- h4 {
- font-family: $docs-font;
- font-size: 90%;
- padding: 11px 0 5px 0;
- text-transform: uppercase;
- color: #999999; } }
-
@mixin green-button {
- box-shadow: inset #b3f33d 0 1px 0;
+ @include box-shadow(#b3f33d 0 1px 0 0 inset);
color: #fff;
text-shadow: rgba(0, 0, 0, 0.3) 0 -1px 0;
@include border-radius(3px);
@@ -105,7 +66,7 @@
border-color: #707070;
cursor: auto;
@include vertical-gradient(#bbb, #9c9c9c);
- box-shadow: inset #d7d7d7 0 1px 0; } }
+ @include box-shadow(#d7d7d7 0 1px 0 0 inset); } }
@mixin member-expander {
View
2 template/resources/sass/_trees.scss
@@ -103,7 +103,7 @@
border: 1px solid #727a81;
background-color: #646b72;
@include vertical-gradient(#646b72, #8d949b);
- box-shadow: inset #5b6167 0 0 1px;
+ @include box-shadow(#5b6167 0 0 1px 0 inset);
@include border-radius(10px);
text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35); } } }

0 comments on commit f044769

Please sign in to comment.
Something went wrong with that request. Please try again.