- Must use Sprockets for requiring mustache templates.
- Mustache templates have to be compiled with can.mustache for compatibility with 2.0 and 3.0
- Must expose compiled templates under a namespace, defaults to the commonly used
JST
variable exposed in the main object (window
)
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
/** | |
* If the mixpanel cookie exists this user was in the site before, | |
* we have to consider him returning, only every 24 hours, just like GA. | |
*/ | |
var RETURNING_VISITOR = document.cookie.indexOf('_mixpanel') != -1; | |
// if the mixpanel cookie does not exists the user is considered new | |
if (!RETURNING_VISITOR) { | |
$.cookie('mp_visitor', true, { expires: 1, path: '/' }); | |
// else the user might not be returning. | |
} else if ($.cookie('mp_visitor') !== null) { |
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
namespace :assets do | |
def load_apps | |
require File.expand_path('config/boot.rb', Rake.application.original_dir) | |
Padrino.mounted_apps | |
end | |
desc "Precompile all assets" | |
task :precompile => 'precompile:build' | |
namespace :precompile do |
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
// Retuns the native constructor of its caller | |
function $itself(){ | |
return function(){ | |
return this; | |
} | |
} | |
// Number Fix for SVG values in Gecko | |
Number.implement('svg', (Browser.Engine.gecko) ? function(){ return this + 0.001; } : $itself()); |
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
Function.implement('repeat', function(number, fn, bind){ | |
return function(){ | |
for (var i = 1; i <= number; i++) fn.call(this, i, number); | |
}; | |
}); | |
mySillyFunction = function(){ | |
console.log('Moo said the dog; Meow said the bird'); | |
}; |
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
Function.prototype.append = function(){ | |
for (var i = 0, l = arguments.length; i < l; i++) { | |
$extend(this.prototype, arguments[i]); | |
} | |
}; |
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
<handler pattern=”%core.config_dir%/static_files.xml” class=”StaticFilesConfigHandler”> | |
<validation>%core.lib_dir%/config/xsd/static_files.xsd</validation> | |
<transformation>%core.lib_dir%/config/xsl/static_files.xsl</transformation> | |
</handler> | |
<handler pattern=”%core.module_dir%/*/config/static_files.xml” class=”StaticFilesConfigHandler”> | |
<validation>%core.lib_dir%/config/xsd/static_files.xsd</validation> | |
<transformation>%core.lib_dir%/config/xsl/static_files.xsl</transformation> | |
</handler> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<xs:schema | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
xmlns:routing_1_0="http://agavi.org/agavi/config/parts/routing/1.0" | |
xmlns="http://domain.com/config/parts/static_files/1.0" | |
targetNamespace="http://domain.com/config/parts/static_files/1.0" | |
elementFormDefault="qualified"> | |
<xs:import namespace="http://agavi.org/agavi/config/parts/routing/1.0" | |
schemaLocation="../../../../../libs/agavi/config/xsd/parts/routing.xsd" /> |
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
<route name="..." output_types="html xslt email"> |
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
<?php | |
/** | |
* @package StaticFiles | |
* | |
* @author Luis Merino <mail@luismerino.name> | |
* @copyright Author | |
*/ | |
class StaticFilesModel extends AgaviModel implements AgaviISingletonModel | |
{ | |
protected $files = array(); |
OlderNewer