Last active
February 29, 2016 13:20
-
-
Save vernondegoede/dfde285a2ea7d289c4fc to your computer and use it in GitHub Desktop.
Rubymine Live Templates for Backbone.js & Marionette.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.module("App.$PARAM$", function ($PARAM$, App, Backbone, Marionette, $, _) { | |
'use_strict'; | |
$PARAM$.Controller = { | |
showHomepage: function () { | |
this.entities = this.getEntities(); | |
this.instantiateViews(); | |
this.setViewHandlers(); | |
this.renderViews(); | |
$END$ | |
}, | |
getEntities: function () { | |
}, | |
instantiateViews: function () { | |
}, | |
setViewHandlers: function () { | |
}, | |
renderViews: function () { | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.module("Entities", function (Entities, App, Backbone, Marionette, $, _) { | |
'use_strict'; | |
Entities.Model = Backbone.Model.extend({ | |
urlRoot: App.spree_endpoint + "$PARAM$", | |
defaults: { | |
} | |
}); | |
Entities.Collection = Backbone.Collection.extend({ | |
url: App.spree_endpoint + '$END$', | |
model: Entities.Model, | |
parse: function (response) { | |
return response; | |
} | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.module("$PARAM$", function ($PARAM$, App, Backbone, Marionette, $, _) { | |
'use_strict'; | |
$PARAM$.Router = Marionette.AppRouter.extend({ | |
appRoutes: { | |
"checkout(/)": "showCheckout" | |
}, | |
controller: { | |
showCheckout: function () { | |
CheckoutsApp.Main.Controller.showCheckout(); | |
} | |
} | |
}); | |
$PARAM$.on("start", function () { | |
var Router = new $PARAM$.Router(); | |
Backbone.Wreqr.radio.commands.setHandler('checkout', 'show', function () { | |
Router.controller.showCheckout(); | |
}); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/template" id="tpl-$PARAM$"> | |
$END$ | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.module("App.$PARAM$", function ($PARAM$, App, Backbone, Marionette, $, _) { | |
'use_strict'; | |
$PARAM$.View = Marionette.ItemView.extend({ | |
template: "#tpl-", | |
className: "", | |
onShow: function () { | |
$END$ | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment