maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1744978 - in /maven/skins/trunk/maven-fluido-skin/src/main/resources: META-INF/maven/site-macros.vm js/fluido.js
Date Sat, 21 May 2016 20:24:42 GMT
Author: hboutemy
Date: Sat May 21 20:24:42 2016
New Revision: 1744978

URL: http://svn.apache.org/viewvc?rev=1744978&view=rev
Log:
[MSKINS-127] load Google Search and +1 javascript asynchronously

Modified:
    maven/skins/trunk/maven-fluido-skin/src/main/resources/META-INF/maven/site-macros.vm
    maven/skins/trunk/maven-fluido-skin/src/main/resources/js/fluido.js

Modified: maven/skins/trunk/maven-fluido-skin/src/main/resources/META-INF/maven/site-macros.vm
URL: http://svn.apache.org/viewvc/maven/skins/trunk/maven-fluido-skin/src/main/resources/META-INF/maven/site-macros.vm?rev=1744978&r1=1744977&r2=1744978&view=diff
==============================================================================
--- maven/skins/trunk/maven-fluido-skin/src/main/resources/META-INF/maven/site-macros.vm (original)
+++ maven/skins/trunk/maven-fluido-skin/src/main/resources/META-INF/maven/site-macros.vm Sat
May 21 20:24:42 2016
@@ -620,11 +620,10 @@
     #set( $startIndex = $project.url.indexOf("://") + 3 )
     #set( $sitesearchValue = $project.url.substring( $startIndex, $project.url.length() )
)
   #end
-
   <input value="$sitesearchValue" name="sitesearch" type="hidden"/>
   <input class="search-query" name="q" id="query" type="text" />
 </form>
-<script type="text/javascript" src="https://cse.google.com/brand?form=search-form"></script>
+<script type="text/javascript">asyncJs( 'https://cse.google.com/brand?form=search-form'
)</script>
 #end
 ##
 ##
@@ -688,15 +687,11 @@
     #if( !$sideBarEnabled )
       #set( $dataSize = 'medium' )
     #end
-
-    <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
-
+    <script type="text/javascript">asyncJs( 'https://apis.google.com/js/plusone.js'
)</script>
     #if( !$sideBarEnabled )
     <ul class="nav pull-right"><li style="margin-top: 10px;">
     #end
-
     <div class="g-plusone" data-href="$project.url" data-size="$dataSize" #if( !$sideBarEnabled
) width="60px" align="right" #end></div>
-
     #if( !$sideBarEnabled )
     </li></ul>
     #end

Modified: maven/skins/trunk/maven-fluido-skin/src/main/resources/js/fluido.js
URL: http://svn.apache.org/viewvc/maven/skins/trunk/maven-fluido-skin/src/main/resources/js/fluido.js?rev=1744978&r1=1744977&r2=1744978&view=diff
==============================================================================
--- maven/skins/trunk/maven-fluido-skin/src/main/resources/js/fluido.js (original)
+++ maven/skins/trunk/maven-fluido-skin/src/main/resources/js/fluido.js Sat May 21 20:24:42
2016
@@ -25,3 +25,13 @@ jQuery( document ).ready( function()
     prettyPrint();
 
 } );
+
+function asyncJs( url ) {
+    ( function() {
+            var s = document.createElement( 'script' ), t = document.getElementsByTagName(
'script' )[0];
+            s.type = 'text/javascript';
+            s.async = true;
+            s.src = url;
+            t.parentNode.insertBefore( s, t );
+        } )();
+}
\ No newline at end of file



Mime
View raw message