aboutsummaryrefslogtreecommitdiffstats
path: root/public/javascripts/general.js
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2011-09-05 12:17:02 +0100
committerSeb Bacon <seb.bacon@gmail.com>2011-09-05 12:17:02 +0100
commit2926ee877bcf8974c529e1271ded42971fe0d632 (patch)
tree9f136f48fd532a0c6eb6e7809a4ccdc91d90bc9f /public/javascripts/general.js
parent256b548eb0120d9223bd74ded46a850fd724f695 (diff)
Flash a message to users from outside the deployed country, telling them about either (a) a website in their country, or (b) the existence of Alaveteli to help them make one themselves. Closes #124.
Diffstat (limited to 'public/javascripts/general.js')
-rw-r--r--public/javascripts/general.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/public/javascripts/general.js b/public/javascripts/general.js
new file mode 100644
index 000000000..ed5095f82
--- /dev/null
+++ b/public/javascripts/general.js
@@ -0,0 +1,22 @@
+$(document).ready(function() {
+ if(window.location.search.substring(1).search("country_name") == -1) {
+ if (!$.cookie('has_seen_country_message')) {
+ $.ajax({
+ url: "/country_message",
+ dataType: 'html',
+ success: function(country_message){
+ if (country_message != ''){
+ $('#other-country-notice').html(country_message);
+ $('body:not(.front) #other-country-notice').show()
+ }
+ }
+ })
+
+ }
+ }
+
+ $('#other-country-notice').click(function() {
+ $('#other-country-notice').hide();
+ $.cookie('has_seen_country_message', 1, {expires: 365, path: '/'});
+ })
+}) \ No newline at end of file