1
0
Fork 0
mirror of https://github.com/kbparagua/paloma synced 2023-03-27 23:21:17 -04:00

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);
};
}