Skip to content

Commit 8f1bab1

Browse files
committed
Another version
1 parent bcb3a99 commit 8f1bab1

File tree

5 files changed

+26
-81
lines changed

5 files changed

+26
-81
lines changed

static/actions/CategoryActions.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

static/bundle.js

Lines changed: 25 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -29682,7 +29682,7 @@ var AuthorActions = {
2968229682
};
2968329683

2968429684
module.exports.AuthorActions = AuthorActions;
29685-
},{"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180}],163:[function(require,module,exports){
29685+
},{"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179}],163:[function(require,module,exports){
2968629686
var BookConstants = require('../constants/BookConstants')
2968729687
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
2968829688

@@ -29739,20 +29739,7 @@ var BookActions = {
2973929739

2974029740
module.exports.BookActions = BookActions;
2974129741

29742-
},{"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180}],164:[function(require,module,exports){
29743-
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
29744-
var BookConstants = require('../constants/BookConstants')
29745-
29746-
var CategoryActions = {
29747-
count_stats: function() {
29748-
AppDispatcher.dispatch({
29749-
actionType: BookConstants.COUNT_STATS
29750-
});
29751-
}
29752-
};
29753-
29754-
module.exports.CategoryActions = CategoryActions;
29755-
},{"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180}],165:[function(require,module,exports){
29742+
},{"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179}],164:[function(require,module,exports){
2975629743
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
2975729744
var BookConstants = require('../constants/BookConstants')
2975829745

@@ -29778,7 +29765,7 @@ var MessageActions = {
2977829765
};
2977929766

2978029767
module.exports.MessageActions = MessageActions;
29781-
},{"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180}],166:[function(require,module,exports){
29768+
},{"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179}],165:[function(require,module,exports){
2978229769
var React = require('react');
2978329770
var AuthorActions = require('../actions/AuthorActions').AuthorActions;
2978429771

@@ -29817,7 +29804,7 @@ var AuthorDialog = React.createClass({displayName: "AuthorDialog",
2981729804
});
2981829805

2981929806
module.exports.AuthorDialog = AuthorDialog ;
29820-
},{"../actions/AuthorActions":162,"react":161}],167:[function(require,module,exports){
29807+
},{"../actions/AuthorActions":162,"react":161}],166:[function(require,module,exports){
2982129808
var React = require('react');
2982229809
var DropDown = require('./DropDown.react').DropDown;
2982329810
var AuthorDialog = require('./AuthorDialog.react').AuthorDialog;
@@ -29863,7 +29850,7 @@ var AuthorPanel = React.createClass({displayName: "AuthorPanel",
2986329850
});
2986429851

2986529852
module.exports.AuthorPanel = AuthorPanel;
29866-
},{"../actions/AuthorActions":162,"./AuthorDialog.react":166,"./DropDown.react":174,"react":161}],168:[function(require,module,exports){
29853+
},{"../actions/AuthorActions":162,"./AuthorDialog.react":165,"./DropDown.react":173,"react":161}],167:[function(require,module,exports){
2986729854
var React = require('react');
2986829855
var BookActions = require('../actions/BookActions').BookActions;
2986929856
var DropDown = require('./DropDown.react.js').DropDown;
@@ -29956,7 +29943,7 @@ var BookForm = React.createClass({displayName: "BookForm",
2995629943

2995729944
module.exports.BookForm = BookForm;
2995829945

29959-
},{"../actions/BookActions":163,"../stores/AuthorStore":181,"../stores/CategoryStore":183,"./AuthorPanel.react.js":167,"./ButtonPanel.react.js":172,"./DatePicker.react.js":173,"./DropDown.react.js":174,"./MessagePanel.react.js":175,"./StatPanel.react.js":178,"react":161}],169:[function(require,module,exports){
29946+
},{"../actions/BookActions":163,"../stores/AuthorStore":180,"../stores/CategoryStore":182,"./AuthorPanel.react.js":166,"./ButtonPanel.react.js":171,"./DatePicker.react.js":172,"./DropDown.react.js":173,"./MessagePanel.react.js":174,"./StatPanel.react.js":177,"react":161}],168:[function(require,module,exports){
2996029947
var React = require('react');
2996129948
var BookStore = require('../stores/BookStore').BookStore;
2996229949
var BookActions = require('../actions/BookActions').BookActions;
@@ -29987,8 +29974,7 @@ var BookPanel = React.createClass({displayName: "BookPanel",
2998729974
),
2998829975
React.createElement("div", {className: "one-half column"},
2998929976
React.createElement(BookForm, {
29990-
book: this.state.editingBook,
29991-
message: this.state.message}
29977+
book: this.state.editingBook}
2999229978
)
2999329979
),
2999429980
React.createElement("br", null)
@@ -30009,7 +29995,7 @@ var BookPanel = React.createClass({displayName: "BookPanel",
3000929995

3001029996
module.exports.BookPanel = BookPanel ;
3001129997

30012-
},{"../actions/BookActions":163,"../stores/BookStore":182,"./BookForm.react":168,"./BookTable.react":170,"./PagingPanel.react":176,"./SearchPanel.react":177,"react":161}],170:[function(require,module,exports){
29998+
},{"../actions/BookActions":163,"../stores/BookStore":181,"./BookForm.react":167,"./BookTable.react":169,"./PagingPanel.react":175,"./SearchPanel.react":176,"react":161}],169:[function(require,module,exports){
3001329999
var React = require('react');
3001430000
var BookTableRow = require('./BookTableRow.react').BookTableRow;
3001530001
var BookActions = require('../actions/BookActions').BookActions;
@@ -30051,7 +30037,7 @@ var BookTable = React.createClass({displayName: "BookTable",
3005130037

3005230038
module.exports.BookTable = BookTable ;
3005330039

30054-
},{"../actions/BookActions":163,"./BookTableRow.react":171,"react":161}],171:[function(require,module,exports){
30040+
},{"../actions/BookActions":163,"./BookTableRow.react":170,"react":161}],170:[function(require,module,exports){
3005530041
var React = require('react');
3005630042
var BookActions = require('../actions/BookActions').BookActions;
3005730043

@@ -30076,7 +30062,7 @@ var BookTableRow = React.createClass({displayName: "BookTableRow",
3007630062

3007730063
module.exports.BookTableRow = BookTableRow;
3007830064

30079-
},{"../actions/BookActions":163,"react":161}],172:[function(require,module,exports){
30065+
},{"../actions/BookActions":163,"react":161}],171:[function(require,module,exports){
3008030066
var React = require('react');
3008130067
var BookActions = require('../actions/BookActions').BookActions;
3008230068

@@ -30104,7 +30090,7 @@ var ButtonPanel = React.createClass({displayName: "ButtonPanel",
3010430090

3010530091
module.exports.ButtonPanel = ButtonPanel;
3010630092

30107-
},{"../actions/BookActions":163,"react":161}],173:[function(require,module,exports){
30093+
},{"../actions/BookActions":163,"react":161}],172:[function(require,module,exports){
3010830094
var React = require('react');
3010930095

3011030096
var DatePicker = React.createClass({displayName: "DatePicker",
@@ -30127,7 +30113,7 @@ var DatePicker = React.createClass({displayName: "DatePicker",
3012730113
});
3012830114

3012930115
module.exports.DatePicker = DatePicker ;
30130-
},{"react":161}],174:[function(require,module,exports){
30116+
},{"react":161}],173:[function(require,module,exports){
3013130117
var React = require('react');
3013230118

3013330119
var DropDown = React.createClass({displayName: "DropDown",
@@ -30154,7 +30140,7 @@ var DropDown = React.createClass({displayName: "DropDown",
3015430140

3015530141
module.exports.DropDown = DropDown;
3015630142

30157-
},{"react":161}],175:[function(require,module,exports){
30143+
},{"react":161}],174:[function(require,module,exports){
3015830144
var React = require('react');
3015930145
var MessageStore = require('../stores/MessageStore').MessageStore;
3016030146

@@ -30185,7 +30171,7 @@ var MessagePanel = React.createClass({displayName: "MessagePanel",
3018530171

3018630172
module.exports.MessagePanel = MessagePanel;
3018730173

30188-
},{"../stores/MessageStore":184,"react":161}],176:[function(require,module,exports){
30174+
},{"../stores/MessageStore":183,"react":161}],175:[function(require,module,exports){
3018930175
var React = require('react');
3019030176
var BookActions = require('../actions/BookActions').BookActions;
3019130177

@@ -30215,7 +30201,7 @@ var PagingPanel = React.createClass({displayName: "PagingPanel",
3021530201

3021630202
module.exports.PagingPanel = PagingPanel;
3021730203

30218-
},{"../actions/BookActions":163,"react":161}],177:[function(require,module,exports){
30204+
},{"../actions/BookActions":163,"react":161}],176:[function(require,module,exports){
3021930205
var React = require('react');
3022030206
var BookActions = require('../actions/BookActions').BookActions;
3022130207

@@ -30263,7 +30249,7 @@ var SearchPanel = React.createClass({displayName: "SearchPanel",
3026330249

3026430250
module.exports.SearchPanel = SearchPanel;
3026530251

30266-
},{"../actions/BookActions":163,"react":161}],178:[function(require,module,exports){
30252+
},{"../actions/BookActions":163,"react":161}],177:[function(require,module,exports){
3026730253
var React = require('react');
3026830254
var BookStore = require('../stores/BookStore').BookStore;
3026930255
var AuthorStore = require('../stores/AuthorStore').AuthorStore;
@@ -30314,7 +30300,7 @@ var StatPanel = React.createClass({displayName: "StatPanel",
3031430300
});
3031530301

3031630302
module.exports.StatPanel = StatPanel ;
30317-
},{"../stores/AuthorStore":181,"../stores/BookStore":182,"react":161}],179:[function(require,module,exports){
30303+
},{"../stores/AuthorStore":180,"../stores/BookStore":181,"react":161}],178:[function(require,module,exports){
3031830304

3031930305
module.exports = {
3032030306
BOOK_CHANGE: 'BOOK_CHANGE',
@@ -30334,13 +30320,13 @@ module.exports = {
3033430320
AUTHOR_DELETE_OK: 'AUTHOR_DELETE_OK'
3033530321
};
3033630322

30337-
},{}],180:[function(require,module,exports){
30323+
},{}],179:[function(require,module,exports){
3033830324
var Dispatcher = require('flux').Dispatcher;
3033930325
var AppDispatcher = new Dispatcher();
3034030326

3034130327
module.exports.AppDispatcher = AppDispatcher;
3034230328

30343-
},{"flux":3}],181:[function(require,module,exports){
30329+
},{"flux":3}],180:[function(require,module,exports){
3034430330
var $ = require('jquery');
3034530331
var EventEmitter = require('events').EventEmitter;
3034630332
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
@@ -30453,7 +30439,7 @@ AuthorStore.dispatchToken = AppDispatcher.register(function(action) {
3045330439
module.exports.AuthorStore = AuthorStore;
3045430440
module.exports.loadAuthors = _load_authors;
3045530441

30456-
},{"../actions/AuthorActions":162,"../actions/MessageActions":165,"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180,"events":1,"jquery":6}],182:[function(require,module,exports){
30442+
},{"../actions/AuthorActions":162,"../actions/MessageActions":164,"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179,"events":1,"jquery":6}],181:[function(require,module,exports){
3045730443
var $ = require('jquery');
3045830444
var EventEmitter = require('events').EventEmitter;
3045930445
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
@@ -30647,7 +30633,6 @@ BookStore.dispatchToken = AppDispatcher.register(function(action) {
3064730633
_search();
3064830634
break;
3064930635
case BookConstants.AUTHOR_DELETE_OK:
30650-
console.log("AUTTHOR DEL OK");
3065130636
_search();
3065230637
break;
3065330638
case BookConstants.BOOK_SORT:
@@ -30668,12 +30653,11 @@ BookStore.dispatchToken = AppDispatcher.register(function(action) {
3066830653
module.exports.BookStore = BookStore;
3066930654
module.exports.reloadBooks = _reloadBooks;
3067030655

30671-
},{"../actions/MessageActions":165,"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180,"events":1,"jquery":6}],183:[function(require,module,exports){
30656+
},{"../actions/MessageActions":164,"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179,"events":1,"jquery":6}],182:[function(require,module,exports){
3067230657
var $ = require('jquery');
3067330658
var EventEmitter = require('events').EventEmitter;
3067430659
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
3067530660
var BookConstants = require('../constants/BookConstants');
30676-
var CategoryActions = require('../actions/CategoryActions').CategoryActions;
3067730661

3067830662
var _state = {
3067930663
categories: [],
@@ -30699,8 +30683,6 @@ var _load_categories = function() {
3069930683
},
3070030684
error: function(xhr, status, err) {
3070130685
console.error(this.props.url, status, err.toString());
30702-
_state.message = err.toString();
30703-
CategoryStore.emitChange();
3070430686
}
3070530687
});
3070630688
};
@@ -30715,10 +30697,6 @@ var _load_subcategories = function(cat) {
3071530697
if(_subcat_cache[cat]) {
3071630698
_state.subcategories = _subcat_cache[cat] ;
3071730699
CategoryStore.emitChange();
30718-
// The action in a different call
30719-
setTimeout(function() {
30720-
CategoryActions.count_stats();
30721-
}, 0);
3072230700
}
3072330701
$.ajax({
3072430702
url: _props.subcategories_url+'?category='+cat,
@@ -30728,12 +30706,9 @@ var _load_subcategories = function(cat) {
3072830706
_state.subcategories = data;
3072930707
_subcat_cache[cat] = data;
3073030708
CategoryStore.emitChange();
30731-
CategoryActions.count_stats()
3073230709
},
3073330710
error: function(xhr, status, err) {
3073430711
console.error(this.props.url, status, err.toString());
30735-
_state.message = err.toString();
30736-
CategoryStore.emitChange();
3073730712
}
3073830713
});
3073930714
};
@@ -30758,10 +30733,7 @@ CategoryStore.dispatchToken = AppDispatcher.register(function(action) {
3075830733
switch(action.actionType) {
3075930734
case BookConstants.BOOK_EDIT:
3076030735
case BookConstants.BOOK_CHANGE:
30761-
//if(action.book.category!=_current_cat) {
30762-
_load_subcategories(action.book.category);
30763-
// _current_cat=action.book.category
30764-
//}
30736+
_load_subcategories(action.book.category);
3076530737
break;
3076630738
case BookConstants.BOOK_EDIT_CANCEL:
3076730739
_state.subcategories = [];
@@ -30775,7 +30747,7 @@ CategoryStore.dispatchToken = AppDispatcher.register(function(action) {
3077530747
module.exports.CategoryStore = CategoryStore;
3077630748
module.exports.loadCategories = _load_categories;
3077730749

30778-
},{"../actions/CategoryActions":164,"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180,"events":1,"jquery":6}],184:[function(require,module,exports){
30750+
},{"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179,"events":1,"jquery":6}],183:[function(require,module,exports){
3077930751
var $ = require('jquery');
3078030752
var EventEmitter = require('events').EventEmitter;
3078130753
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
@@ -30815,10 +30787,10 @@ MessageStore.dispatchToken = AppDispatcher.register(function(action) {
3081530787

3081630788
module.exports.MessageStore = MessageStore;
3081730789

30818-
},{"../constants/BookConstants":179,"../dispatcher/AppDispatcher":180,"events":1,"jquery":6}],185:[function(require,module,exports){
30790+
},{"../constants/BookConstants":178,"../dispatcher/AppDispatcher":179,"events":1,"jquery":6}],184:[function(require,module,exports){
3081930791
var React = require('react');
3082030792
var BookPanel = require('./components/BookPanel.react').BookPanel;
3082130793

3082230794
React.render(React.createElement(BookPanel, null), document.getElementById('content'));
3082330795

30824-
},{"./components/BookPanel.react":169,"react":161}]},{},[185]);
30796+
},{"./components/BookPanel.react":168,"react":161}]},{},[184]);

static/components/BookPanel.react.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ var BookPanel = React.createClass({
2929
<div className="one-half column">
3030
<BookForm
3131
book={this.state.editingBook}
32-
message={this.state.message}
3332
/>
3433
</div>
3534
<br />

static/stores/BookStore.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,6 @@ BookStore.dispatchToken = AppDispatcher.register(function(action) {
191191
_search();
192192
break;
193193
case BookConstants.AUTHOR_DELETE_OK:
194-
console.log("AUTTHOR DEL OK");
195194
_search();
196195
break;
197196
case BookConstants.BOOK_SORT:

static/stores/CategoryStore.js

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ var $ = require('jquery');
22
var EventEmitter = require('events').EventEmitter;
33
var AppDispatcher = require('../dispatcher/AppDispatcher').AppDispatcher;
44
var BookConstants = require('../constants/BookConstants');
5-
var CategoryActions = require('../actions/CategoryActions').CategoryActions;
65

76
var _state = {
87
categories: [],
@@ -28,8 +27,6 @@ var _load_categories = function() {
2827
},
2928
error: function(xhr, status, err) {
3029
console.error(this.props.url, status, err.toString());
31-
_state.message = err.toString();
32-
CategoryStore.emitChange();
3330
}
3431
});
3532
};
@@ -44,10 +41,6 @@ var _load_subcategories = function(cat) {
4441
if(_subcat_cache[cat]) {
4542
_state.subcategories = _subcat_cache[cat] ;
4643
CategoryStore.emitChange();
47-
// The action in a different call
48-
setTimeout(function() {
49-
CategoryActions.count_stats();
50-
}, 0);
5144
}
5245
$.ajax({
5346
url: _props.subcategories_url+'?category='+cat,
@@ -57,12 +50,9 @@ var _load_subcategories = function(cat) {
5750
_state.subcategories = data;
5851
_subcat_cache[cat] = data;
5952
CategoryStore.emitChange();
60-
CategoryActions.count_stats()
6153
},
6254
error: function(xhr, status, err) {
6355
console.error(this.props.url, status, err.toString());
64-
_state.message = err.toString();
65-
CategoryStore.emitChange();
6656
}
6757
});
6858
};
@@ -87,10 +77,7 @@ CategoryStore.dispatchToken = AppDispatcher.register(function(action) {
8777
switch(action.actionType) {
8878
case BookConstants.BOOK_EDIT:
8979
case BookConstants.BOOK_CHANGE:
90-
//if(action.book.category!=_current_cat) {
91-
_load_subcategories(action.book.category);
92-
// _current_cat=action.book.category
93-
//}
80+
_load_subcategories(action.book.category);
9481
break;
9582
case BookConstants.BOOK_EDIT_CANCEL:
9683
_state.subcategories = [];

0 commit comments

Comments
 (0)