/dasher/javascript/collections/plugins.js
JavaScript | 58 lines | 25 code | 6 blank | 27 comment | 0 complexity | b47c698f40edfcaf69e163e27e2527c6 MD5 | raw file
- define(
- [
- "backbone",
- "models/plugin"
- ],
- function(Backbone, Plugin) {
- "use strict";
- /**
- * Plugins collection.
- *
- * @class Plugins
- * @constructor
- */
- var Plugins = Backbone.Collection.extend({
- model: Plugin,
- /**
- * Gets the Router plugin from the collection.
- *
- * @method getRouter
- *
- * @return {Plugin} Router plugin
- */
- getRouter: function() {
- return this.findWhere({ id: "Router" });
- },
- /**
- * Gets the InputRecycleChan plugin from the collection.
- *
- * @method getInputRecycleChan
- *
- * @return {Plugin} InputRecycleChan plugin
- */
- getInputRecycleChan: function() {
- return this.findWhere({ id: "inputRecycleChan" });
- },
- /**
- * Gets the InjectRecycleChan plugin from the collection.
- *
- * @method getInjectRecycleChan
- *
- * @return {Plugin} InjectRecycleChan plugin
- */
- getInjectRecycleChan: function() {
- return this.findWhere({ id: "injectRecycleChan" });
- },
- comparator: function(collection) {
- return(collection.get('Name'));
- }
- });
- return Plugins;
- }
- );