Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Inspector: upgrade Marionette to v4 #378

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion extension/js/common/util/Logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define([
'marionette'
], function(Marionette) {

var Logger = Marionette.Object.extend({
var Logger = Marionette.MnObject.extend({


/**
Expand Down
4 changes: 2 additions & 2 deletions extension/js/inspector/app/components/tree/views/Tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ define([
TODO: seriously consider using fancyTree https://github.com/mar10/fancytree
why? because it seems to do lazy rendering well and we could potentially be showng a big tree.
*/
var Tree = Backbone.Marionette.CompositeView.extend({
var Tree = Marionette.CollectionView.extend({
tagName: 'ul',

className: function() {
Expand Down Expand Up @@ -41,7 +41,7 @@ define([
this.events = _.extend({}, Tree.prototype.events, this.events || {});
this.modelEvents = _.extend({}, Tree.prototype.modelEvents, this.modelEvents || {});

Backbone.Marionette.CompositeView.prototype.constructor.apply(this, arguments);
Marionette.CollectionView.prototype.constructor.apply(this, arguments);

this.treeCount = ++window.treeCount;
// console.log('!!! new tree', this.treeCount, this.el);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define([
'marionette',
'logger',
], function(Marionette, logger) {
return Marionette.Object.extend({
return Marionette.MnObject.extend({

initialize: function(activityCollection) {
this.activityCollection = activityCollection;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ define([
'app/modules/Activity/views/ActivityTree',
], function(Backbone, Marionette, Radio, ActivityTree) {

var Action = Backbone.Marionette.View.extend({
var Action = Marionette.View.extend({

template: 'activity/action.html',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define([
'app/modules/Activity/views/Action'
], function(Backbone, Marionette, Action) {

var ActionList = Backbone.Marionette.NextCollectionView.extend({
var ActionList = Marionette.CollectionView.extend({
tagName: 'ul',
className: 'action-list',
childView: Action
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
define(['backbone', 'marionette', 'app/modules/Activity/d3/graph'
], function(Backbone, Marionette, Graph) {

var ActivityGraph = Backbone.Marionette.View.extend({
var ActivityGraph = Marionette.View.extend({

template: 'activity/graph.html',

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ define([
}
},

childView: function () {
return ActivityTree
},

onShowInfo: function (evt) {
evt.stopPropagation();
if (this.model.get('event')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define([
'app/modules/Data/views/CollectionRow',
], function(Marionette, Radio, CollectionRow) {

return Marionette.CompositeView.extend({
return Marionette.CollectionView.extend({
template: 'data/collection-list.html',

childViewContainer: '[data-child-view-container]',
Expand Down
2 changes: 1 addition & 1 deletion extension/js/inspector/app/modules/Data/views/ModelList.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define([
'app/modules/Data/views/ModelRow',
], function(Marionette, Radio, ModelRow) {

return Marionette.CompositeView.extend({
return Marionette.CollectionView.extend({
template: 'data/list.html',

childViewContainer: '[data-child-view-container]',
Expand Down
4 changes: 2 additions & 2 deletions extension/js/inspector/app/modules/Module.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ define([
'logger'
], function(Marionette, Radio, logger) {

return Marionette.Object.extend({
return Marionette.MnObject.extend({

channelName: '',

constructor: function() {
Marionette.Object.prototype.constructor.apply(this, arguments);
Marionette.MnObject.prototype.constructor.apply(this, arguments);
this.setupData();
this.setupEvents();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ define([
'app/modules/Radio/views/ChannelRow',
], function(Marionette, Radio, ChannelRow) {

return Marionette.CompositeView.extend({
return Marionette.CollectionView.extend({
template: 'radio/list.html',

childViewContainer: '[data-child-view-container]',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ define([
*
*/

return Marionette.Object.extend({
return Marionette.MnObject.extend({

events: [
'show', 'close', 'swap', 'remove', 'destroy'
Expand Down
8 changes: 7 additions & 1 deletion extension/js/inspector/app/modules/UI/views/ViewTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ define([
'app/components/tree/views/Tree',
'util/Radio',
], function(Tree, Radio) {
return Tree.extend({
var ViewTree = Tree.extend({

ui: {
moreInfoLink: "[data-action='more-info']",
Expand Down Expand Up @@ -50,6 +50,10 @@ define([

},

childView: function () {
return ViewTree
},

childViewOptions: function() {
return {
viewCollection: this.options.viewCollection
Expand Down Expand Up @@ -151,4 +155,6 @@ define([
}

});

return ViewTree;
})
4 changes: 2 additions & 2 deletions extension/js/inspector/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define([
], function(Marionette, agent, inspectedPage, logger) {


var DevToolClient = Marionette.Object.extend({
var DevToolClient = Marionette.MnObject.extend({

initialize: function() {
this.agent = agent;
Expand Down Expand Up @@ -68,7 +68,7 @@ define([

waitForClientLoad: function() {
var promise = this.agent.waitFor(function() {
return this.appObserver != undefined;
return this.appObserver !== undefined;
});

promise.catch(function(e) {
Expand Down
4 changes: 2 additions & 2 deletions extension/js/inspector/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,15 @@ require([
logger, App, RadioApp, UIApp, DataApp, ActivityApp,
templates) {

Marionette.Renderer.render = function(template, data) {
function templateRenderer (template, data) {
var compiledTpl = templates[template];
if (!compiledTpl) {
throw new Error(`Unable to find template: "${template}"`)
}
return compiledTpl(data);
};

Marionette.setEnabled('childViewEventPrefix', false);
Marionette.setRenderer(templateRenderer);

/*
* This flag is used to turn on the recorder
Expand Down