]> source.dussan.org Git - archiva.git/commitdiff
add a method to call activatePopoverDoc which will select class from #main-content...
authorOlivier Lamy <olamy@apache.org>
Mon, 10 Sep 2012 15:32:00 +0000 (15:32 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 10 Sep 2012 15:32:00 +0000 (15:32 +0000)
* popover-doc: popover on click and destroy on mouseover.
* tooltip-doc: tooltip with hover trigger.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1382942 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/utils.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html

index 472888eb1856e17ab5fcfb8a937524935ba2589d..b9fc4518634a22729d37a287a4b30bd8613af394 100644 (file)
@@ -177,6 +177,10 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
 
     this.availableLayouts = window.managedRepositoryTypes;
 
+    showCronExpressionDoc=function(){
+      //$.log("showCronExpressionDoc") ;
+    }
+
     this.save=function(){
       var valid = $("#main-content").find("#managed-repository-edit-form").valid();
       if (valid==false) {
@@ -308,6 +312,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
       activateManagedRepositoryEditTab();
       mainContent.find("#managed-repository-edit-li a").html($.i18n.prop('edit'));
       activateManagedRepositoryFormValidation();
+      activatePopoverDoc();
     }
 
     scanNow=function(managedRepository){
@@ -946,6 +951,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
         var viewModel = new ManagedRepositoryViewModel(new ManagedRepository(),false,managedRepositoriesViewModel);
         ko.applyBindings(viewModel,mainContent.find("#managed-repository-edit").get(0));
         activateManagedRepositoryFormValidation();
+        activatePopoverDoc();
       }
       if ($(e.target).attr("href")=="#managed-repositories-view") {
         mainContent.find("#managed-repository-edit-li a").html($.i18n.prop("add"));
index 3eab02a921c90db12298b76052d63388db9f246c..182dcb453f155f63371448dcf19ac9d0c2d1085f 100644 (file)
@@ -440,6 +440,20 @@ require(["jquery","jquery.tmpl","i18n"], function(jquery,jqueryTmpl,i18n) {
     return str.replace(/\./g,"\\\.");
   }
 
+  activatePopoverDoc=function(){
+    var mainContent=$("#main-content");
+    mainContent.find(".popover-doc" ).popover({html: true, trigger: 'manual'});
+    mainContent.find(".popover-doc" ).on("click",function(){
+      $(this).popover("show");
+    });
+
+    mainContent.find(".popover-doc" ).mouseover(function(){
+      $(this).popover("destroy");
+    });
+
+    mainContent.find(".tooltip-doc" ).tooltip({html: true, trigger: 'hover'});
+  }
+
   //-----------------------------------------
   // extends jquery tmpl to support var def
   //-----------------------------------------
index c2f083c55352d0086b437ced7642178d7da189d5..71f626ee34bbfd6e0b3bca311230d9c0327c0a6c 100644 (file)
           <label class="control-label" for="cronExpression">${$.i18n.prop('cronExpression')}</label>
           <div class="controls">
             <input type="text" id="cronExpression" class="required" name="cronExpression" size="40" data-bind="value: managedRepository.cronExpression"/>
+            <a class="btn btn-warning btn-mini popover-doc" id="rowcount-info-button"
+               data-original-title="${$.i18n.prop('cronExpression.help.title')}"
+               data-content="${$.i18n.prop('cronExpression.help.content')}">
+                <i class="icon-question-sign icon-white"></i>
+            </a>
           </div>
         </div>
         <div class="control-group">