Browse Source

AMBARI-501. Speed up page load/reload times (Contributed by Yusaku)

git-svn-id: https://svn.apache.org/repos/asf/incubator/ambari/branches/ambari-186@1347339 13f79535-47bb-0310-9956-ffa450edef68
Vikram Dixit K 13 years ago
parent
commit
38cfc1ca55
5 changed files with 38 additions and 17 deletions
  1. 2 0
      CHANGES.txt
  2. 20 0
      hmc/css/yuiCombined.css
  3. 8 15
      hmc/html/bootstrapJs.htmli
  4. 2 2
      hmc/html/initializeCluster.php
  5. 6 0
      hmc/js/ext/yuiCombined.js

+ 2 - 0
CHANGES.txt

@@ -6,6 +6,8 @@ characters wide.
 
 Release 0.1.x - unreleased
 
+  AMBARI-501. Speed up page load/reload times (Yusaku via Vikram)
+
   AMBARI-500. Fix versions in rpm spec file. (Mahadev via Vikram)
 
   AMBARI-499. Add "Help" link to the top nav (Yusaku via Vikram)

File diff suppressed because it is too large
+ 20 - 0
hmc/css/yuiCombined.css


+ 8 - 15
hmc/html/bootstrapJs.htmli

@@ -1,25 +1,18 @@
+<link type="text/css" rel="stylesheet" href="../css/yuiCombined.css">
 <script src="../yui-3.5.1/build/yui/yui-min.js"></script>
+<script src="../js/ext/yuiCombined.js"></script>
 
 <script type="text/javascript">
 
-  var globalYuiLoaderOptions = {
-    combine: true,
-    comboBase: '../fileCombinator.php?',
-    root: 'yui-3.5.1/build/'
-  };
-
-  var globalYui = YUI( globalYuiLoaderOptions ).use( 
-    "node", "io", "dump", "json", "panel", "event", "arraysort", 
-    "array-extras", "datasource", "datasource-io", "datasource-jsonschema", 
-    "datasource-polling", "stylesheet", "dd-drop", "dd-constrain",
-    "dd-proxy", "transition", "overlay", "node-event-simulate", function (Y) {
+  var globalYui = YUI().use("*", function (Y) {
 
+    for (var jsFile in jsFilesToLoad) {
       /* Load all the files in jsFilesToLoad in one shot. */
       var dynamicJsScript = document.createElement("script");
       dynamicJsScript.type = "text/javascript";
-      dynamicJsScript.src = '../fileCombinator.php?' + jsFilesToLoad.join('&');
-      globalYui.log('Loading ' + dynamicJsScript.src);
+      dynamicJsScript.src = '../' + jsFilesToLoad[jsFile];
+      dynamicJsScript.async = false;
       document.getElementsByTagName("head")[0].appendChild(dynamicJsScript);
-
-    });
+    }
+  });
 </script>

+ 2 - 2
hmc/html/initializeCluster.php

@@ -12,6 +12,8 @@
     <link type="text/css" rel="stylesheet" href="../css/selectHosts.css" media="screen"/>
     <link rel="shortcut icon" href="../images/logo-micro.gif">
     <!-- End CSS -->
+    <script src="../js/ext/jquery.min.js"></script>
+    <script src="../js/ext/bootstrap.min.js"></script>
   </head>
 
   <body class="yui3-skin-sam">
@@ -307,8 +309,6 @@
             };
 
             var jsFilesToLoad = [
-                'js/ext/jquery.min.js',
-                'js/ext/bootstrap.min.js',
                 'js/utils.js', 
                 'js/txnUtils.js',
                 'js/installationWizard.js',

File diff suppressed because it is too large
+ 6 - 0
hmc/js/ext/yuiCombined.js


Some files were not shown because too many files changed in this diff