some templates
[wolnelektury.git] / wolnelektury / static / js / dialogs.js
index 846331c..d44dab3 100755 (executable)
@@ -58,7 +58,7 @@
             $('body').append($window);
 
             $window.jqm({
-                ajax: '/uzytkownicy/zaloguj-utworz/',
+                ajax: '/uzytkownik/zaloguj-utworz/?next=' + escape(window.location),
                 ajaxText: '<p><img src="' + STATIC_URL + 'img/indicator.gif" alt="*"/> ' + gettext("Loading") + '</p>',
                 target: $('.target', $window)[0],
                 overlay: 60,
         };
 
 
+
+    // check placeholder browser support
+    if (!Modernizr.input.placeholder)
+    {
+        // set placeholder values
+        $(this).find('[placeholder]').each(function()
+        {
+            $(this).val( $(this).attr('placeholder') ).addClass('placeholder');
+        });
+        // focus and blur of placeholders
+        $('[placeholder]').focus(function()
+        {
+            if ($(this).val() == $(this).attr('placeholder'))
+            {
+                $(this).val('');
+                $(this).removeClass('placeholder');
+            }
+        }).blur(function()
+        {
+            if ($(this).val() == '' || $(this).val() == $(this).attr('placeholder'))
+            {
+                $(this).val($(this).attr('placeholder'));
+                $(this).addClass('placeholder');
+            }
+        });
+
+        // remove placeholders on submit
+        $('[placeholder]').closest('form').submit(function()
+        {
+            $(this).find('[placeholder]').each(function()
+            {
+                if ($(this).val() == $(this).attr('placeholder'))
+                {
+                    $(this).val('');
+                }
+            })
+        });
+    }
+
+
+
     });
 })(jQuery)