]> source.dussan.org Git - archiva.git/commitdiff
fix i18n loading for templates loading on start
authorOlivier Lamy <olamy@apache.org>
Fri, 24 Aug 2012 08:11:52 +0000 (08:11 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 24 Aug 2012 08:11:52 +0000 (08:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1376855 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/archiva.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js

index d7745ac10db9932986722fdde4b5068e27acebee..ed275b8f2a7e107cc08d14c421292181dffa9173 100644 (file)
@@ -51,8 +51,8 @@ $.ajax({
                 urlArgs: ""+appendJsNoCacheUrl(),
                 shim: {
                       'sammy':['jquery','jquery.tmpl'],
-                      'archiva.main':['jquery','jquery.ui','sammy','jquery.tmpl'],
-                      'utils':['jquery','jquery.tmpl'],
+                      'archiva.main':['jquery','jquery.ui','sammy','jquery.tmpl','utils','i18n'],
+                      'utils':['jquery','jquery.tmpl','i18n'],
                       'archiva.templates': ['jquery','jquery.tmpl','utils'],
                       'redback.templates': ['jquery','jquery.tmpl','utils']
                       },
@@ -97,9 +97,9 @@ $.ajax({
                 }
             });
 
-            requirejs(['jquery','jquery.tmpl','jquery.ui','i18n','sammy','startup','utils',"archiva.main",'domReady!'], function (domReady) {
-                loadi18n(function () {
-                  $.ajax({
+                requirejs(['jquery','jquery.tmpl','jquery.ui','i18n','sammy','startup','utils','domReady!','archiva.main'], function () {
+                  loadi18n(function () {
+                    $.ajax({
                       url: "restServices/archivaUiServices/runtimeInfoService/archivaRuntimeInfo/"+usedLang(),
                       dataType: 'json',
                       success:function(data){
@@ -107,14 +107,14 @@ $.ajax({
                           window.archivaJavascriptLog=data.javascriptLog;
                           window.archivaRuntimeInfo=data;
 
-                          require(['sammy','jquery','jquery.tmpl','archiva.main','utils','domReady!'],function () {
+                          require(['sammy','jquery','i18n','jquery.tmpl','archiva.main','utils','domReady!'],function () {
                               startArchivaApplication();
                               $("#loadingDiv").hide();
                               drawQuickSearchAutocomplete();
                           })
                       }
                     })
+                  });
                 })
-            });
     }
 })
index 72fb7ab9800d5b66418835140126b0ce9110a03f..46611cab8251c96578da7e27c8ec1324ec67fc27 100644 (file)
  * specific language governing permissions and limitations
  * under the License.
  */
-require(['jquery',"jquery.tmpl","utils","text!templates/archiva/menu.html",
+require(['jquery',"jquery.tmpl",'i18n',"utils","text!templates/archiva/menu.html",
           "text!templates/archiva/generics.html",
           "text!templates/archiva/modal.html",
           "text!templates/archiva/repositories.html",
           "text!templates/archiva/search.html",
           "text!templates/archiva/general-admin.html"],
-  function(jquery,jqueryTmpl,utils,menu,generics,modal,repositories,
+  function(jquery,jqueryTmpl,i18n,utils,menu,generics,modal,repositories,
            search,general_admin) {
-
-    var htmlFragment=$("#html-fragments");
-    // template loading
-    htmlFragment.append(menu);
-    htmlFragment.append(generics);
-    $.tmpl( modal ).appendTo(htmlFragment);
-    htmlFragment.append(repositories);
-    htmlFragment.append(search);
-    htmlFragment.append(general_admin);
-    $.log("main-tmpl.js loaded");
+    loadArchivaTemplate=function(){
+      var htmlFragment=$("#html-fragments");
+      // template loading
+      htmlFragment.append(menu);
+      htmlFragment.append(generics);
+      $.tmpl( modal ).appendTo(htmlFragment);
+      htmlFragment.append(repositories);
+      htmlFragment.append(search);
+      htmlFragment.append(general_admin);
+      $.log("main-tmpl.js loaded");
+    }
   }
 );
\ No newline at end of file
index 8553878479482fcf6f2db925e8b2f7e27e90814a..e084460340a8e4173a0600ce11754189718d1364 100644 (file)
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-define("archiva.main",["jquery","jquery.ui","sammy","jquery.tmpl","jquery.cookie","bootstrap","archiva.search",
+define("archiva.main",["jquery","jquery.ui","sammy","jquery.tmpl",'i18n',"jquery.cookie","bootstrap","archiva.search",
          "jquery.validate","jquery.json","knockout","redback.templates","archiva.templates",
           "redback.roles","redback","archiva.general-admin","archiva.repositories",
           "archiva.network-proxies","archiva.proxy-connectors","archiva.repository-groups","archiva.artifacts-management"],
@@ -581,6 +581,8 @@ function(jquery,ui,sammy,tmpl) {
   startArchivaApplication=function(){
 
     $.log("startArchivaApplication");
+    loadRedbackTemplate();
+    loadArchivaTemplate();
     $('#topbar-menu-container').html($("#topbar_menu_tmpl" ).tmpl());
     $('#sidebar-content').html($("#main_menu_tmpl").tmpl());
 
index 7817e4a8983a1fb55a78f2774545604de50122e3..f9f4e2aae8d31eec7a29c2e018b4673df2dfd288 100644 (file)
  * specific language governing permissions and limitations
  * under the License.
  */
-require(['jquery',"jquery.tmpl","utils","text!templates/redback/user-edit.html",
+require(['jquery',"jquery.tmpl",'i18n',"utils","text!templates/redback/user-edit.html",
           "text!templates/redback/login.html"],
-    function(jquery,jqueryTmpl,utils,useredit, login) {
+    function(jquery,jqueryTmpl,i18n,utils,useredit, login) {
 
-      var htmlFragment=$("#html-fragments");
+      loadRedbackTemplate=function(){
 
-      // template loading
-      htmlFragment.append(useredit);
-      $.tmpl(login).appendTo("#html-fragments");
-      $.log("redback-tmpl.js loaded");
+        var htmlFragment=$("#html-fragments");
+
+        // template loading
+        htmlFragment.append(useredit);
+        //$.tmpl(useredit).appendTo("#html-fragments");
+        $.tmpl(login).appendTo("#html-fragments");
+        //htmlFragment.append(login);
+        $.log("redback-tmpl.js loaded");
+      }
     }
 );
\ No newline at end of file