소스 검색

No Ticket. Move index.mako's requirements list to an external JS file for easier maintainability.

* moving the requirements for index.mako to a js file for easier maintenance
* fixing the flashmessage calls
Aaron Newton 15 년 전
부모
커밋
ea2e8d90a2

+ 1 - 1
apps/jframegallery/static/js/Source/JFrameGallery/Hue.JFrameGallery.js

@@ -6,7 +6,7 @@
 // "License"); you may not use this file except in compliance
 // with the License.	You may obtain a copy of the License at
 //
-//		 http://www.apache.org/licenses/LICENSE-2.0
+//    http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,

+ 5 - 2
desktop/core/src/desktop/templates/index.mako

@@ -33,7 +33,7 @@
   <link rel="stylesheet" href="/static/oocss/Grid.css">
   <link rel="stylesheet" href="/static/oocss/Icon.css">
 
-  <script src="/depender/build?client=true&require=hue-shared/Hue,hue-shared/Hue.Desktop.BackgroundManager,hue-shared/Hue.Desktop.Config,hue-shared/Hue.JFrame.Target,hue-shared/Hue.Login,hue-shared/Hue.Request,hue-shared/Hue.User"></script>
+  <script src="/depender/build?client=true&require=hue-shared/DesktopLoader"></script>
   <!--[if IE 8]>
       <script>
           window.ie8 = true;
@@ -88,7 +88,10 @@
           if (!FlashMessage.checkForFlashMessage(loading) && 
               !FlashMessage.checkForFlashMessage(launching) && 
               !$$('.loadingmsg').length) {
-                growled[component] = FlashMessage.flash(msg, 10000);
+                growled[component] = FlashMessage.flash({
+                  message: msg, 
+                  duration: 10000
+                });
           }
         };
         var clearGrowl = function(component) {

+ 57 - 0
desktop/core/static/js/Source/Hue/DesktopLoader.js

@@ -0,0 +1,57 @@
+// Licensed to Cloudera, Inc. under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  Cloudera, Inc. licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+/*
+---
+description: Hue namespace, (deprecated) Hue namespace + the base requirements for loading the Hue.
+provides: [DesktopLoader]
+requires: [
+  Core/Cookie,
+  Core/DomReady,
+  Core/Element.Event,
+  Core/Element.Dimensions,
+  Core/Element.Style,
+  Core/Fx.Tween,
+  Core/Request.HTML,
+  Core/Selectors,
+  More/Element.Delegation,
+  More/HtmlTable.Resize,
+  More/Spinner,
+  More/URI,
+  clientcide/dbug,
+  clientcide/Clientcide,
+  clientcide/StickyWin,
+  clientcide/StickyWin.PointyTip,
+  Widgets/ART.Popup,
+  JFrame/JFrame.Browser,
+  JFrame/FlashMessage,
+  JFrame/JFrame.Keys,
+  JFrame/MooTools.Config,
+  hue-shared/Hue,
+  hue-shared/Hue.Desktop.BackgroundManager,
+  hue-shared/Hue.Desktop.Config,
+  hue-shared/Hue.JFrame.Target,
+  hue-shared/Hue.Login,
+  hue-shared/Hue.Request,
+  hue-shared/Hue.User,
+  hue-shared/CCS.JFrame, #These CCS.* files are all just deprecated namespaces; here for backwards compat
+  hue-shared/CCS.JFrame.DeprecatedFilters,
+  hue-shared/CCS.JBrowser,
+  hue-shared/CCS.Desktop.FlashMessage,
+]
+script: Hue.js
+
+...
+*/

+ 1 - 0
desktop/core/static/js/package.yml

@@ -8,6 +8,7 @@ sources: [
   Source/Deprecated/CCS.JBrowser.js,
   Source/Deprecated/CCS.JFrame.js,
   Source/Deprecated/CCS.JFrame.Deprecated.js,
+  Source/Hue/DesktopLoader.js,
   Source/Hue/Hue.js,
   Source/Hue/Hue.Desktop.js,
   Source/Hue/Hue.Desktop.Config.js,