diff options
Diffstat (limited to 'public/javascripts/public.js')
| -rw-r--r-- | public/javascripts/public.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/public/javascripts/public.js b/public/javascripts/public.js new file mode 100644 index 0000000..f4619e7 --- /dev/null +++ b/public/javascripts/public.js | |||
| @@ -0,0 +1,25 @@ | |||
| 1 | $(document).ready(function(){ | ||
| 2 | if ($("#headline_image img").length != 0) { | ||
| 3 | image_handler.initialize(); | ||
| 4 | } | ||
| 5 | }); | ||
| 6 | |||
| 7 | |||
| 8 | var image_handler = { | ||
| 9 | initialize : function() { | ||
| 10 | |||
| 11 | path_name = window.location.pathname; | ||
| 12 | locale_rexexp = /^\/(en|de)\\/; | ||
| 13 | locale_match = locale_rexexp.exec(path_name); | ||
| 14 | |||
| 15 | if (locale_match) { | ||
| 16 | locale = locale_match[0]; | ||
| 17 | } | ||
| 18 | else { | ||
| 19 | locale = "/de/"; | ||
| 20 | } | ||
| 21 | |||
| 22 | path = path_name.replace(/\/(de|en)*\/*/, ""); | ||
| 23 | gallery_path = ""; | ||
| 24 | } | ||
| 25 | }; \ No newline at end of file | ||
