mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
New templates
This commit is contained in:
parent
c02a455af5
commit
f80727a344
7 changed files with 90 additions and 0 deletions
14
app/templates/_filters.js
Normal file
14
app/templates/_filters.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
(function(){
|
||||
// Initializes the main container for all filters and skippers for this
|
||||
// specific scope.
|
||||
var filter = new Paloma.FilterScope(':scope');
|
||||
|
||||
// The _x object is also available on callbacks.
|
||||
// You can make a variable visible on callbacks by using _x here.
|
||||
//
|
||||
// Example:
|
||||
// _x.visibleOnCallback = "I'm a shared variable"
|
||||
var _x = Paloma.variableContainer;
|
||||
|
||||
// ~> Start definitions here and remove this line.
|
||||
})();
|
13
app/templates/application/_locals.js
Normal file
13
app/templates/application/_locals.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
(function(){
|
||||
// Initializes locals container for the global scope.
|
||||
// All _locals.js file will inherit all locals here by default.
|
||||
//
|
||||
// Define a local by adding property to 'locals'.
|
||||
//
|
||||
// Example:
|
||||
// locals.localMethod = function(){};
|
||||
var locals = Paloma.locals['/'] = {};
|
||||
|
||||
|
||||
// ~> Start local definitions here and remove this line.
|
||||
})();
|
19
app/templates/controller/_locals.js
Normal file
19
app/templates/controller/_locals.js
Normal file
|
@ -0,0 +1,19 @@
|
|||
(function(){
|
||||
// Initializes callbacks container for the this specific scope.
|
||||
Paloma.callbacks[':controller_path'] = {};
|
||||
|
||||
// Initializes locals container for this specific scope.
|
||||
// Define a local by adding property to 'locals'.
|
||||
//
|
||||
// Example:
|
||||
// locals.localMethod = function(){};
|
||||
var locals = Paloma.locals[':controller_path'] = {};
|
||||
|
||||
|
||||
// ~> Start local definitions here and remove this line.
|
||||
|
||||
|
||||
// Remove this line if you don't want to inherit locals defined
|
||||
// on parent's _locals.js
|
||||
Paloma.inheritLocals({from : ':namespace', to : ':controller'});
|
||||
})();
|
3
app/templates/controller/_manifest.js
Normal file
3
app/templates/controller/_manifest.js
Normal file
|
@ -0,0 +1,3 @@
|
|||
//= require ./_locals.js
|
||||
//= require ./_filters.js
|
||||
//= require_tree .
|
23
app/templates/controller/action.js
Normal file
23
app/templates/controller/action.js
Normal file
|
@ -0,0 +1,23 @@
|
|||
(function(){
|
||||
// You access variables from before/around filters from _x object.
|
||||
// You can also share variables to after/around filters through _x object.
|
||||
var _x = Paloma.variableContainer;
|
||||
|
||||
// We are using _L as an alias for the locals container.
|
||||
// Use either of the two to access locals from other scopes.
|
||||
//
|
||||
// Example:
|
||||
// _L.otherController.localVariable = 100;
|
||||
var _L = Paloma.locals;
|
||||
|
||||
// Access locals for the current scope through the _l object.
|
||||
//
|
||||
// Example:
|
||||
// _l.localMethod();
|
||||
var _l = _L[':controller_path'];
|
||||
|
||||
|
||||
Paloma.callbacks[':controller_path'][':action'] = function(params){
|
||||
// Do something here.
|
||||
};
|
||||
})();
|
16
app/templates/namespace/_locals.js
Normal file
16
app/templates/namespace/_locals.js
Normal file
|
@ -0,0 +1,16 @@
|
|||
(function(){
|
||||
// Initializes locals container for this specific scope.
|
||||
// Define a local by adding property to 'locals'.
|
||||
//
|
||||
// Example:
|
||||
// locals.localMethod = function(){};
|
||||
var locals = Paloma.locals[':namespace'] = {};
|
||||
|
||||
|
||||
// ~> Start local definitions here and remove this line.
|
||||
|
||||
|
||||
// Remove this line if you don't want to inherit locals defined
|
||||
// on parent's _locals.js
|
||||
Paloma.inheritLocals({from : '/', to : ':namespace'});
|
||||
})();
|
2
app/templates/namespace/_manifest.js
Normal file
2
app/templates/namespace/_manifest.js
Normal file
|
@ -0,0 +1,2 @@
|
|||
//= require ./_locals.js
|
||||
//= require ./_filters.js
|
Loading…
Reference in a new issue