forked from aurajs/aura
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Individual sandbox injection into widgets
Turned sandbox modules into sandbox factories. Added RequireJS path mapping to replace widget sandboxes with individual sandbox instances. Allowing sandbox extensions through overriding a factory method in Core. Added per-sandbox logging as first example of sandbox-specific functionality.
- Loading branch information
Showing
12 changed files
with
141 additions
and
107 deletions.
There are no files selected for viewing
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,40 @@ | ||
// ## Sandbox Extension | ||
// @fileOverview Extend the aura-sandbox (facade pattern) | ||
// @todo This is a stupid place to include jquery ui | ||
define(['aura_sandbox', 'core', 'perms', 'jquery_ui'], function(sandbox, core, perms) { | ||
define(['perms', 'backbone', 'localstorage', 'jquery_ui'], function(perms, Backbone, Store) { | ||
'use strict'; | ||
|
||
var auraSandbox = Object.create(sandbox); | ||
auraSandbox.data.Store = core.data.Store; | ||
auraSandbox.mvc = {}; | ||
auraSandbox.widgets = {}; | ||
return { | ||
extend: function(sandbox, channel) { | ||
sandbox.data.Store = Store; | ||
sandbox.mvc = {}; | ||
sandbox.widgets = {}; | ||
|
||
auraSandbox.mvc.View = function(view) { | ||
return core.mvc.View.extend(view); | ||
}; | ||
|
||
auraSandbox.mvc.Model = function(model) { | ||
return core.mvc.Model.extend(model); | ||
}; | ||
sandbox.mvc.View = function(view) { | ||
return Backbone.View.extend(view); | ||
}; | ||
|
||
auraSandbox.mvc.Collection = function(collection) { | ||
return core.mvc.Collection.extend(collection); | ||
}; | ||
sandbox.mvc.Model = function(model) { | ||
return Backbone.Model.extend(model); | ||
}; | ||
|
||
auraSandbox.mvc.Router = function(router) { | ||
return core.mvc.Router.extend(router); | ||
}; | ||
sandbox.mvc.Collection = function(collection) { | ||
return Backbone.Collection.extend(collection); | ||
}; | ||
|
||
auraSandbox.widgets.stop = function(channel, el) { | ||
return sandbox.stop.apply(this, arguments); | ||
}; | ||
sandbox.mvc.Router = function(router) { | ||
return Backbone.Router.extend(router); | ||
}; | ||
|
||
auraSandbox.widgets.start = function(channel, options) { | ||
return sandbox.start.apply(this, arguments); | ||
}; | ||
sandbox.widgets.stop = function(channel, el) { | ||
return sandbox.stop.apply(this, arguments); | ||
}; | ||
|
||
return auraSandbox; | ||
sandbox.widgets.start = function(channel, options) { | ||
return sandbox.start.apply(this, arguments); | ||
}; | ||
|
||
return sandbox; | ||
} | ||
}; | ||
}); |
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
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
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
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
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