]> source.dussan.org Git - archiva.git/commitdiff
cleanup template loading
authorOlivier Lamy <olamy@apache.org>
Mon, 23 Jan 2012 16:21:33 +0000 (16:21 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 23 Jan 2012 16:21:33 +0000 (16:21 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234882 13f79535-47bb-0310-9956-ffa450edef68

12 files changed:
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
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/archiva/templates/topbar.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/jquery.i18n.properties-1.0.9.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/redback-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/login.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/register-form.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-edit.html
archiva-modules/archiva-web/archiva-webapp-js/src/site/apt/generics-js.apt
archiva-modules/archiva-web/archiva-webapp-js/src/site/site.xml
archiva-modules/archiva-web/archiva-webapp-js/src/site/xdoc/index.xml

index 10bd6aa7b1a862a537ba13f858cff9055f678654..6b11e4d4f8d7950af1f74db6a586234ec3b6ac1e 100644 (file)
@@ -74,7 +74,9 @@
        .script("redback/permission.js").wait()
        .script("redback/resource.js").wait()
        .script("redback/roles.js").wait()
-       .script("archiva/main.js");
+       .script("archiva/main.js").wait(function(){
+        //startArchivaApplication();
+       });
 
 </script>
 
index bdcd037fd32b3ad3043def89efe5324755fffa8c..73d313e2112ea596f841bffde0c90c66e595634c 100644 (file)
@@ -21,10 +21,10 @@ require(["text!archiva/templates/menu.html","text!archiva/templates/topbar.html"
   function(menu,topbar,message,modal,grids_generics,repositories) {
 
     // template loading
-    $.tmpl( menu, $.i18n.map ).appendTo("#html-fragments");
-    $.tmpl( topbar, $.i18n.map ).appendTo("#html-fragments");
-    $.tmpl( modal, $.i18n.map ).appendTo("#html-fragments");
+    $.tmpl( menu ).appendTo("#html-fragments");
+    $.tmpl( topbar ).appendTo("#html-fragments");
     $("#html-fragments").append(message);
+    $.tmpl( modal ).appendTo("#html-fragments");
     $("#html-fragments").append(grids_generics);
     $("#html-fragments").append(repositories);
     $.log("main-tmpl.js menu loaded");
index 219925184d5628206527cda077e8293c2af2d3d9..50240e28226e4c6cac39246d6b445c37b2267336 100644 (file)
@@ -160,14 +160,16 @@ $(function() {
     }
   });
 
-  $('#topbar-menu-container').html($("#topbar-menu"));
-  $('#sidebar-content').html($("#main-menu"));
-
-
-  checkCreateAdminLink();
-  hideElementWithKarma();
-  checkSecurityLinks();
+  startArchivaApplication = function(){
+    $.log("startArchivaApplication");
+    $('#topbar-menu-container').html($("#topbar-menu"));
+    $('#sidebar-content').html($("#main-menu"));
 
+    checkCreateAdminLink();
+    hideElementWithKarma();
+    checkSecurityLinks();
+  }
+  startArchivaApplication();
 })
 });
 
index 9d93239696cfdc9e95c88b35d67d75ccd29df787..5e182231cd6c547dce136c2650d97f60efb5e481 100644 (file)
@@ -38,7 +38,7 @@
         </li>
         <li id="logout-link" style="display: none">
           <a href="#" onclick="logout();" id="logout-link-a">
-            <span class="label important">${logout}</span>
+            <span class="label important">${$.i18n.prop('logout')}</span>
           </a>
         </li>
         <li id="register-link" style="display: none">
index eb88988962e6bae778d24cca54774cc9aa99bec9..cd99e0ac8a08b4afcbe090350e5ca3d0d589d264 100644 (file)
@@ -242,13 +242,14 @@ $.i18n.browserLang = function() {
 loadAndParseFile = function (filename, settings) {
        $.ajax({
         url:        filename,
-        async:      false,
+        async:      true,
         cache:         settings.cache,
         contentType:'text/plain;charset='+ settings.encoding,
         dataType:   'text',
         success:    function(data, status) {
-                                       parseData(data, settings.mode); 
-                                       }
+          parseData(data, settings.mode);
+          if(settings.callback){ settings.callback(); }
+                         }
     });
 }
 
index ff7537db7cad345e111af730061a6f28249a3d16..d9b537a14062c7a6d96e39f149c317c5c75f2852 100644 (file)
 require(["text!redback/templates/user-edit.html", "text!redback/templates/user-grids.html", "text!redback/templates/login.html"
           , "text!redback/templates/register-form.html","text!redback/templates/password-change-form.html"
           ,"text!redback/templates/user-edit-form.html","text!redback/templates/roles-tmpl.html"],
-    function(usercreate, usergrids, login,register,passwordchange,useredit,roles_tmpl) {
+    function(useredit, usergrids, login,register,passwordchange,usereditform,roles) {
 
 
-      $.tmpl( login, $.i18n.map ).appendTo("#html-fragments");
-      $.tmpl( register, $.i18n.map ).appendTo("#html-fragments");
-      $.tmpl( passwordchange, $.i18n.map ).appendTo("#html-fragments");
-      $.tmpl( useredit, $.i18n.map ).appendTo("#html-fragments");
       // template loading
-      $("#html-fragments").append(usercreate);
+
+      $("#html-fragments").append(useredit);
+
       $("#html-fragments").append(usergrids);
-      $("#html-fragments").append(roles_tmpl);
 
+      $.tmpl(login).appendTo("#html-fragments");
+
+      $.tmpl(register).appendTo("#html-fragments");
+
+      $.tmpl(passwordchange).appendTo("#html-fragments");
+
+      $.tmpl(usereditform).appendTo("#html-fragments");
+
+      $("#html-fragments").append(roles);
+
+      $.log("redback-tmpl.js loaded");
     }
 );
\ No newline at end of file
index a0e0e90619c376fb01fc82faea45ddf717b80969..5007d46fc7bc898f352b9bd9ae6d7f79088ae81c 100644 (file)
         <div id="modal-login-err-message" class="alert-message error" style="display:none"></div>
         <fieldset>
           <div class="clearfix">
-            <label for="user-login-form-username">${username}</label>
+            <label for="user-login-form-username">${$.i18n.prop('username')}</label>
             <div class="input">
               <input type="text" id="user-login-form-username" name="user-login-form-username" class="required" />
             </div>
           </div>
           <div class="clearfix">
-            <label for="user-login-form-password">${password}</label>
+            <label for="user-login-form-password">${$.i18n.prop('password')}</label>
             <div class="input">
               <input type="password" id="user-login-form-password" name="user-login-form-password" class="required" />
             </div>
@@ -41,7 +41,7 @@
       </form>
   </div>
   <div class="modal-footer" id="modal-login-footer">
-    <button class="btn primary" onclick="login();" id="modal-login-ok">${$.i18n.prop('login)}</button>
+    <button class="btn primary" onclick="return login();" id="modal-login-ok">${$.i18n.prop('login')}</button>
   </div>
 </div>
 
index b555f3372e585e970d343ae051d238b3f67e03c2..63d8e8a6f19057bfa063bdf7d6427a2bd132cdca 100644 (file)
@@ -26,7 +26,7 @@
         <div id="modal-register-err-message" class="alert-message error" style="display:none"></div>
         <fieldset>
           <div class="clearfix">
-            <label for="user-register-form-username">${username}</label>
+            <label for="user-register-form-username">${$.i18n.prop('username')}</label>
             <div class="input">
               <input type="text" id="user-register-form-username" name="user-register-form-username" class="required" />
             </div>
@@ -38,7 +38,7 @@
             </div>
           </div>
           <div class="clearfix">
-            <label for="user-register-form-email">${email}</label>
+            <label for="user-register-form-email">${$.i18n.prop('email')}</label>
             <div class="input">
               <input type="text" id="user-register-form-email" name="user-register-form-email" class="required email" />
             </div>
index dad0a93f21262b9a985cc8be6fb1d303af250949..e8906d8e772ce18663d915faca68b87507c218fc 100644 (file)
@@ -33,7 +33,7 @@
           <form id="user-create">
             <fieldset id="user-create-fieldset">
               <div class="clearfix">
-                <label for="username">${i18n('username')}</label>
+                <label for="username">${$.i18n.prop('username')}</label>
                 <div class="input" id="username-div">
                   {{if $data.username.length>0}}
                     <span class="uneditable-input">${$data.username}</span>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="fullname">${i18n('full.name')}</label>
+                <label for="fullname">${$.i18n.prop('full.name')}</label>
                 <div class="input">
                   <input type="text" id="fullname" name="fullname" size="30" class="required" data-bind="value: fullName"/>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="password">${i18n('password')}</label>
+                <label for="password">${$.i18n.prop('password')}</label>
                 <div class="input">
                   <input type="password" id="password" name="password" class="required" data-bind="value: password"/>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="confirmPassword">${i18n('confirm.password')}</label>
+                <label for="confirmPassword">${$.i18n.prop('confirm.password')}</label>
                 <div class="input">
                   <input type="password" id="confirmPassword" name="confirmPassword" data-bind="value: confirmPassword"/>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="email">${i18n('email.address')}</label>
+                <label for="email">${$.i18n.prop('email.address')}</label>
                 <div class="input">
                   <input type="text" id="email" name="email" class="required email" data-bind="value: email"/>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="validated">${i18n('validated')}</label>
+                <label for="validated">${$.i18n.prop('validated')}</label>
                 <div class="input">
                   <input type="checkbox" id="validated" name="validated" data-bind="checked: validated"/>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="locked">${i18n('locked')}</label>
+                <label for="locked">${$.i18n.prop('locked')}</label>
                 <div class="input">
                   <input type="checkbox" id="locked" name="locked" data-bind="checked: locked"/>
                 </div>
               </div>
               <div class="clearfix">
-                <label for="passwordChangeRequired">${i18n('passwordChangeRequired')}</label>
+                <label for="passwordChangeRequired">${$.i18n.prop('passwordChangeRequired')}</label>
                 <div class="input">
                   <input type="checkbox" id="passwordChangeRequired" name="passwordChangeRequired" data-bind="checked: passwordChangeRequired"/>
                 </div>
               </div>
             </fieldset>
-            <button data-bind="click: save" class="btn" id="user-create-form-register-button">${i18n('save')}</button>
-            <button class="btn" id="user-create-form-cancel-button">${i18n('cancel')}</button>
+            <button data-bind="click: save" class="btn" id="user-create-form-register-button">${$.i18n.prop('save')}</button>
+            <button class="btn" id="user-create-form-cancel-button">${$.i18n.prop('cancel')}</button>
           </form>
         </div>
         <div class="span8 columns" id="user-edit-roles">
index 31c4cf3f036d49fd420702e2e663df0abf6504a0..25ff1bb087b0b77c1b46f3003fe4d9a66fd97ae1 100644 (file)
@@ -26,4 +26,4 @@
 ~~ NOTE: For help with the syntax of this file, see:
 ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
 
-Generics Javascript functions
\ No newline at end of file
+Generics Javascript
\ No newline at end of file
index 48b89a2600882559bdd739ece1ac41f26e7b09ef..49376666774c829bb5d1bc2be7f644dcfaa14826 100644 (file)
@@ -39,7 +39,7 @@
       <item name="JS Template loading"   href="/template-loading.html"/>
       <item name="i18n"                  href="/i18n.html"/>
       <item name="Knockout Binding"      href="/knockout-binding.html"/>
-      <item name="Generic Javascipts"    href="/generics-js"/>
+      <item name="Generic Javascipts"    href="/generics-js.html"/>
     </menu>
 
   </body>
index 9a32b39f1957c96d4b51f34fa85ebad415d13506..13455f3e49774f0035f1dff9bf61f22f0bfa5e53 100644 (file)
@@ -10,6 +10,9 @@
     <script type="text/javascript" src="js/fancy-box-activation.js"></script>
     <script src="js/jquery.fancybox-1.3.4.pack.js" type="text/javascript"></script>
     <link rel="stylesheet" href="css/jquery.fancybox-1.3.4.css" type="text/css" media="screen" />
+
+    <macro name="toc"/>
+
     <section name="Archiva Javascript Web Application">
       <subsection name="General design">
       <p>
         </ul>
         </p>
       </subsection>
+      <subsection name="Sources organisation">
+        <p>
+          Sources are located in src/main/webapp :
+          <ul>
+            <li>css</li>
+            <li>images</li>
+            <li>js</li>
+          </ul>
+        </p>
+        <subsection name="js directory">
+          <p>
+            Root directory contains external libraries.
+          </p>
+          <p>
+            archiva directory contains archiva js files with a subdirectory templates which contains templates
+          </p>
+          <p>
+            redback directory contains redback js files with a subdirectory templates which contains templates
+          </p>
+        </subsection>
+      </subsection>
+
       <subsection name="Start page">
         <p>
           The main page will load javascript files, load <a href="./i18n.html">i18n</a>, <a href="./template-loading.html">load templates</a> and insert menu.
@@ -80,27 +105,7 @@ Support single value:
           </p>
         </p>
       </subsection>
-      <subsection name="Sources organisation">
-        <p>
-          Sources are located in src/main/webapp :
-          <ul>
-            <li>css</li>
-            <li>images</li>
-            <li>js</li>
-          </ul>
-        </p>
-        <subsection name="js directory">
-          <p>
-            Root directory contains external libraries.
-          </p>
-          <p>
-            archiva directory contains archiva js files with a subdirectory templates which contains templates
-          </p>
-          <p>
-            redback directory contains redback js files with a subdirectory templates which contains templates
-          </p>
-        </subsection>
-      </subsection>
+
     </section>
   </body>
 </document>