test with jquery.turbolinks

This commit is contained in:
kbparagua 2014-09-25 23:36:17 +08:00
parent dbd4b0d155
commit 446f89e5f3
4 changed files with 10 additions and 12 deletions

View File

@ -3,14 +3,6 @@
<div class="js-paloma-hook" data-id="<%= id %>">
<script type="text/javascript">
(function(){
// Do not continue if Paloma not found.
if (window['Paloma'] === undefined) {
if (window['console'] !== undefined) {
console.warn("Paloma not found. Require it in your application.js.");
}
return true;
}
Paloma.env = '<%= Rails.env %>';
// Remove any callback details if any

View File

@ -1,4 +1,5 @@
source 'https://rubygems.org'
gem 'selenium-webdriver'
gem 'jquery-turbolinks'
gemspec :path => '../'

View File

@ -11,14 +11,17 @@
// GO AFTER THE REQUIRES BELOW.
//
//= require jquery
//= require jquery.turbolinks
//= require jquery_ujs
//= require turbolinks
//= require paloma
//= require_tree .
// $(document).on('page:restore', function(){
// Uncomment if jquery.turbolinks is not used.
// $(document).on('page:load', function(){
// Paloma.executeHook();
// Paloma.engine.start();
// });

View File

@ -3,15 +3,17 @@ window.Paloma = window.Paloma || {};
//
// Do nothing if there is no available console.
//
if (!window['console']){ Paloma.log = Paloma.warn = function(msg){}; }
if ( !window['console'] ){
Paloma.log = Paloma.warn = function(msg){};
}
else {
Paloma.warn = function(msg){
if(Paloma.env != 'development') return;
if (Paloma.env != 'development'){ return; }
console.warn(msg);
};
Paloma.log = function(msg){
if(Paloma.env != 'development') return;
if (Paloma.env != 'development'){ return; }
console.log(msg);
};
}