You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2014/10/13 14:46:00 UTC

svn commit: r1631368 [10/10] - in /sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources: ./ css/ css/breadcrumbs/ css/images/ fonts/ js/

Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/metro.min.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/metro.min.js
------------------------------------------------------------------------------
    svn:keywords = Id

Added: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/slingshot.js
URL: http://svn.apache.org/viewvc/sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/slingshot.js?rev=1631368&view=auto
==============================================================================
--- sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/slingshot.js (added)
+++ sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/slingshot.js Mon Oct 13 12:45:58 2014
@@ -0,0 +1,54 @@
+$( document ).ready(function() {
+	$(".ui-slingshot-clickable").click(function() { 
+	    var $input = $( this );
+	    window.location.href=$input.attr("data-link");
+    });
+	$("#breadcrumbs").breadcrumbs("home");
+	$(".breadcrumb_icon_home").click(function() {
+		window.location.href=$("#breadcrumbs").attr("data-home");
+	});
+	$(".ui-form-form").submit(function(event) {
+        event.preventDefault();
+        var form = this;
+	    var path = form.action;
+	    var user = form.j_username.value;
+	    var pass = form.j_password.value;
+
+	    // if no user is given, avoid login request
+        if (!user) {
+            return true;
+        }
+
+        // send user/id password to check and persist
+        $.ajax({
+            url: path + "/j_security_check",
+            type: "POST",
+            async: false,
+            global: false,
+            dataType: "text",
+            data: {
+                _charset_: "utf-8",
+                j_username: user,
+                j_password: pass
+            },
+            success: function (data, code, jqXHR){
+                var u = form.action;
+                if (window.location.hash && u.indexOf('#') < 0) {
+                    u = u + window.location.hash;
+                }
+                document.location = u;
+            },
+            error: function() {
+                form.j_password.value="";
+                $(".ui-form-label").css("background-color","red");
+            }
+        });
+        return true;
+	});
+	$(".ui-form-button-new").click(function() {
+		alert("Self registration is not implemented yet. Try username slingshot1 or slingshot2 with the password being the same as the username.");
+	});
+	$(".ui-form-button-help").click(function() {
+		alert("Help function is not implemented yet. Try username slingshot1 or slingshot2 with the password being the same as the username.");
+	});
+});

Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/slingshot.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: sling/trunk/samples/slingshot/src/main/resources/SLING-INF/content/slingshot/resources/js/slingshot.js
------------------------------------------------------------------------------
    svn:keywords = Id