Created
December 7, 2011 16:07
-
-
Save fabriziomachado/1443363 to your computer and use it in GitHub Desktop.
assets/js/application.js
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
var url = 'http://localhost/codeigniter-academic/assets/images/photos/'; | |
// with NowJs | |
$(document).ready(function(){ | |
// JQuery notify | |
$container = $("#container").notify(); | |
//Channel to emit notify | |
now.notify = function(title, message){ | |
$("#container").notify("create", "sticky", { | |
title: title, | |
text: message | |
}); | |
} | |
//Channel to emit resize | |
now.resize = function(message){ | |
$("#photos").append("<img src='" + url + message + "'/ >"); | |
$("#container").notify("create", "sticky", { | |
title: 'RESIZE IMAGE', | |
text: message | |
}); | |
} | |
// Channel to emit pong message | |
now.pong = function(title, message){ | |
$("#container").notify("create", "sticky", { | |
title: title, | |
text: message | |
}); | |
} | |
$('#ping-pong-everyone').click(function() { | |
now.ping('everyone'); // function server | |
}); | |
$('#ping-pong-this').click(function() { | |
now.ping('this'); // function server | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment