]> git.0d.be Git - panikweb.git/blobdiff - panikweb_templates/static/js/specifics.js
dynamically create link to go back to panikdb
[panikweb.git] / panikweb_templates / static / js / specifics.js
index 9c54122f4cbcd02e9ecd088fa9e749598b386247..e52c69b20f8b51a0c8191771bc2926a4bff243f6 100644 (file)
@@ -411,6 +411,17 @@ $(function() {
                $('#nav-search a').unbind('click').on('click', navsearch_click);
                $('#nav-search form').unbind('submit').on('submit', navsearch_click);
 
+               if (document.cookie.indexOf('panikdb=on')) {
+                       panikdb_path = null;
+                       if (window.location.pathname.indexOf('/emissions/') == 0) {
+                               panikdb_path = window.location.pathname;
+                       } else if (window.location.pathname.indexOf('/news/') == 0) {
+                               panikdb_path = '/emissions' + window.location.pathname;
+                       }
+                       if (panikdb_path) {
+                               $('<a id="panikdb" href="http://panikdb.radiopanik.org' + panikdb_path + '">Voir dans PanikDB</a>').appendTo($main);
+                       }
+               }
        }
        init();
 });