You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by dk...@apache.org on 2019/03/08 14:06:31 UTC

[sling-org-apache-sling-starter-content] branch master updated: SLING-8278 improve chrome audit score (#1)

This is an automated email from the ASF dual-hosted git repository.

dklco pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-starter-content.git


The following commit(s) were added to refs/heads/master by this push:
     new 102e4d9  SLING-8278 improve chrome audit score (#1)
102e4d9 is described below

commit 102e4d94f1bc27dffeb6c50c724481f4fafbe964
Author: Ruben <rr...@headwire.com>
AuthorDate: Fri Mar 8 06:06:26 2019 -0800

    SLING-8278 improve chrome audit score (#1)
    
    Thanks @reusr1 !
    
    * SLING-8278 improve chrome audit score
    
    * SLING-8278 change to async version of getSessionInfo
    
    * SLING-8278 adjusted colors as per PR comment
    
    * javadoc link pointing to sling9 instead of sling11
---
 src/main/frontend/src/scss/index.scss              | 15 +++---
 .../resources/content/content/starter/index.html   | 60 +++++++++++++---------
 2 files changed, 45 insertions(+), 30 deletions(-)

diff --git a/src/main/frontend/src/scss/index.scss b/src/main/frontend/src/scss/index.scss
index f04bc7c..a386551 100755
--- a/src/main/frontend/src/scss/index.scss
+++ b/src/main/frontend/src/scss/index.scss
@@ -24,16 +24,15 @@
 body {
     margin: 0;
     font-family: 'Open Sans', Helvetica, Arial;
-    font-weight: 300;
-    color: rgb(128,128,128);
+    font-weight: 400;
+    color: rgb(80,80,80);
     position: relative;
     height: 100%;
 }
 
 h1 {
-    font-weight: 300;
     font-size: 2.4em;
-    color: rgb(96,96,96);
+    font-weight: 300;
 }
 
 h2 {
@@ -48,7 +47,7 @@ p {
 }
 
 a {
-    color: rgb(0,103,140);
+    color: rgb(0,96,128);
     text-decoration: none;
 
     &:hover {
@@ -117,7 +116,11 @@ a {
         margin-bottom: 1em;
     }
 
-    #Logout {
+    #login-signedout {
+        display: none;
+    }
+
+    #login-signedin {
         display: none;
     }
 }
\ No newline at end of file
diff --git a/src/main/resources/content/content/starter/index.html b/src/main/resources/content/content/starter/index.html
index 3a10e43..979164f 100755
--- a/src/main/resources/content/content/starter/index.html
+++ b/src/main/resources/content/content/starter/index.html
@@ -1,4 +1,5 @@
-<html>
+<!DOCTYPE html>
+<html lang="en">
 <!--
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
@@ -22,16 +23,18 @@
         <meta http-equiv="X-UA-Compatible" content="IE=edge">
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <title>Welcome to the Apache Sling Starter</title>
+        <meta name="Description" content="Apache Sling default homepage">
+        <meta name="theme-color" content="#00678c">
         <link href="../content/starter/css/bundle.css" rel="stylesheet">
     </head>
     <body>
         <div class="Grid Fit-Medium Home-Grid">
             <div class="Gradient"></div>
             <header class="Cell Medium-35 Large-25 Align-Center Logos">
-                <a href="http://sling.apache.org" target="_blank" id="sling-logo" title="Visit the Apache Sling website">
+                <a href="http://sling.apache.org" target="_blank" rel="noopener" id="sling-logo" title="Visit the Apache Sling website">
                     <img src="../content/starter/sling-logo.svg" alt="Apache Sling Logo"/>
                 </a>
-                <a href="http://apache.org" target="_blank" id="asf-logo" title="Visit the Apache Software Foundation website">
+                <a href="http://apache.org" target="_blank" rel="noopener" id="asf-logo" title="Visit the Apache Software Foundation website">
                     <img src="../content/starter/img/asf-logo.svg" alt="Apache Software Foundation Logo"/>
                 </a>
             </header>
@@ -39,25 +42,26 @@
                 <div class="Grid">
                     <section class="Cell Large-50">
                         <h1>Welcome</h1>
-                        <p>Apache Sling is a web framework that uses a Java Content Repository, such as <a href="http://jackrabbit.apache.org/jcr/index.html" target="_blank" title="Visit the Apache Jackrabbit website">Apache Jackrabbit</a>, 
+                        <p>Apache Sling is a web framework that uses a Java Content Repository, such as <a href="http://jackrabbit.apache.org/jcr/index.html" target="_blank" rel="noopener" title="Visit the Apache Jackrabbit website">Apache Jackrabbit</a>,
                            to store and manage content. Sling applications use either scripts or Java servlets, selected 
                            based on simple name conventions, to process HTTP requests in a RESTful way. The embedded 
-                           <a href="http://felix.apache.org/" target="_blank" title="Visit the Apache Felix website">Apache Felix</a> OSGi framework and console provide a dynamic runtime environment, where code and 
+                           <a href="http://felix.apache.org/" target="_blank" rel="noopener" title="Visit the Apache Felix website">Apache Felix</a> OSGi framework and console provide a dynamic runtime environment, where code and
                            content bundles can be loaded, unloaded and reconfigured at runtime.</p>
                         <p>The Sling Starter is a ready-to-run Sling configuration, providing an embedded JCR content 
                            repository and web server, a selection of Sling components, documentation and examples. 
                            The Starter makes it easy to get started with Sling and to develop script-based applications.</p>
                         <h1>Getting Started</h1>
-                        <p>To get started with Sling, see our <a href="http://sling.apache.org/" target="_blank" title="Visit the Apache Sling website">website</a>, the <a href="../content/slingshot.html" title="Try the Slingshot sample application">Slingshot sample application</a>
-                           or the <a href="http://sling.apache.org/site/discover-sling-in-15-minutes.html" target="_blank">Sling in 15 minutes</a> tutorial.</p>
+                        <p>To get started with Sling, see our <a href="http://sling.apache.org/" target="_blank" rel="noopener" title="Visit the Apache Sling website">website</a>, the <a href="../content/slingshot.html" title="Try the Slingshot sample application">Slingshot sample application</a>
+                           or the <a href="http://sling.apache.org/site/discover-sling-in-15-minutes.html" target="_blank" rel="noopener">Sling in 15 minutes</a> tutorial.</p>
                         <p>You can mount the repository via WebDAV to explore or modify content, simply use the root URL 
                            as the WebDAV server URL.</p>
                     </section>
                     <div class="Cell Large-15"><!--/* Give the columns a bit of space between them. */--></div>
                     <section class="Cell Large-35">
                         <h1>Session</h1>
-                        <h2 id="Login"><a href="../system/sling/login.html" title="Login to Apache Sling">Login</a> (admin:admin)</h2>
-                        <h2 id="Logout"><a href="../system/sling/logout" title="Logout of Apache Sling">Logout,</a> </h2>
+                        <h2 id="login-unknown"><a href="../system/sling/login.html" title="Login to Apache Sling">Login</a></h2>
+                        <h2 id="login-signedout"><a href="../system/sling/login.html" title="Login to Apache Sling">Login</a> (admin:admin)</h2>
+                        <h2 id="login-signedin"><a href="../system/sling/logout" title="Logout of Apache Sling">Logout</a> <span id="user"></span></h2>
                         <h1>Resources</h1>
                         <h2>This Site</h2>
                         <ul>
@@ -67,27 +71,35 @@
                         </ul>
                         <h2>Reference</h2>
                         <ul>
-                            <li><a href="http://sling.apache.org/apidocs/sling9/index.html" target="_blank" title="Vist the Apache Sling Javadocs">API Documentation</a></li>
-                            <li><a href="http://sling.apache.org/project-information.html#mailing-lists" target="_blank" title="View available Apache Sling mailing lists">Mailing Lists</a></li>
-                            <li><a href="http://sling.apache.org/documentation/tutorials-how-tos.html" target="_blank" title="View Apache Sling Developer Tutorials">Tutorials</a></li>
-                            <li><a href="https://github.com/apache/sling-aggregator" target="_blank" title="View the Sling Aggregator on Github">All Sling repos</a></li>
-                            <li><a href="https://github.com/apache/sling-samples" target="_blank" title="View Apache Sling sample applications on Github">Sample Applications</a></li>
+                            <li><a href="http://sling.apache.org/apidocs/sling11/index.html" target="_blank" rel="noopener" title="Vist the Apache Sling Javadocs">API Documentation</a></li>
+                            <li><a href="http://sling.apache.org/project-information.html#mailing-lists" rel="noopener" target="_blank" title="View available Apache Sling mailing lists">Mailing Lists</a></li>
+                            <li><a href="http://sling.apache.org/documentation/tutorials-how-tos.html" rel="noopener" target="_blank" title="View Apache Sling Developer Tutorials">Tutorials</a></li>
+                            <li><a href="https://github.com/apache/sling-aggregator" target="_blank" rel="noopener" title="View the Sling Aggregator on Github">All Sling repos</a></li>
+                            <li><a href="https://github.com/apache/sling-samples" target="_blank" rel="noopener" title="View Apache Sling sample applications on Github">Sample Applications</a></li>
                         </ul>
                     </section>
                 </div>
             </div>
         </div>
-        <script src="../system/sling.js"></script>
-        <script>
-            var info = Sling.getSessionInfo();
-            if (info.userID !== 'anonymous') {
-                var login = document.querySelector('#Login');
-                var logout = document.querySelector('#Logout');
-                login.style.display = 'none';
-                logout.style.display = 'block';
-                logout.insertAdjacentHTML('beforeend', info.userID);
-            }
+        <script src="../system/sling.js" type="application/javascript"></script>
+        <script type="application/javascript">
+            Sling.getSessionInfoAsync( function(info) {
+                var unknown = document.querySelector('#login-unknown');
+                var login = document.querySelector('#login-signedout');
+                var logout = document.querySelector('#login-signedin');
+                if (info && info.userID !== 'anonymous') {
+                    var user = document.querySelector('#user');
+                    user.innerHTML = info.userID;
+                    login.style.display = 'none';
+                    logout.style.display = 'block';
+                } else {
+                    login.style.display = 'block';
+                    logout.style.display = 'none';
+                }
+                unknown.style.display = 'none';
+            });
         </script>
+
         <!-- Do not remove this comment, used for Starter integration tests -->
     </body>
 </html>