mirror of
https://github.com/kbparagua/paloma
synced 2023-03-27 23:21:17 -04:00
Fix _callbacks.js, comments
This commit is contained in:
parent
ea6ea9f621
commit
e6cd15ff3d
4 changed files with 18 additions and 4 deletions
|
@ -71,7 +71,8 @@ module Paloma
|
||||||
#_callbacks.js per folder(controller)
|
#_callbacks.js per folder(controller)
|
||||||
has_callbacks = File.exists? callbacks
|
has_callbacks = File.exists? callbacks
|
||||||
unless has_callbacks
|
unless has_callbacks
|
||||||
copy_file '_callbacks.js', callbacks
|
content = File.read(templates + '_callbacks.js').gsub('controller', "#{controller}")
|
||||||
|
File.open(callbacks, 'w'){ |f| f.write(content) }
|
||||||
File.open(INDEX, 'a+'){|f| f << "\n//= require ./" + controller + '/_callbacks' }
|
File.open(INDEX, 'a+'){|f| f << "\n//= require ./" + controller + '/_callbacks' }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
|
//= require ./controller/_local
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
|
|
@ -6,9 +6,15 @@ Paloma.controller = {
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
functionName = function(params){
|
variableName: value;
|
||||||
|
|
||||||
|
functionName: function(params){
|
||||||
alert('Paloma');
|
alert('Paloma');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
To use the variable and function:
|
||||||
|
Paloma.controller.variableName
|
||||||
|
Paloma.controller.functionName(params);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -3,14 +3,20 @@ window.Paloma = {callbacks:{}};
|
||||||
Paloma.g = {
|
Paloma.g = {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Put here global code which can be used by all callbacks,
|
Put here global code that can be used by all callbacks,
|
||||||
regardless which folder they're from.
|
regardless which folder they're from.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
functionName = function(params){
|
variableName: value;
|
||||||
|
|
||||||
|
functionName: function(params){
|
||||||
alert('Paloma');
|
alert('Paloma');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
To use the variable and function:
|
||||||
|
Paloma.g.variableName
|
||||||
|
Paloma.g.functionName(params);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue