spficklin 14 gadi atpakaļ
vecāks
revīzija
609262cb3d

+ 21 - 0
theme_tripal/js/tripal.js

@@ -71,6 +71,7 @@ if (Drupal.jsEnabled) {
          }
       );
    }
+   //------------------------------------------------------------
    // Toggle the tripal_expandableBox
    function toggleExpandableBoxes(){
 	   var status = $('#tripal_expandableBox_toggle_button').html();
@@ -89,4 +90,24 @@ if (Drupal.jsEnabled) {
 		   $('#tripal_expandableBox_toggle_button').html('[-] Collapse All');
 	   }
    }
+   //------------------------------------------------------------
+   function tripal_get_base_url() {
+
+       // Get the base url. Drupal can not pass it through a form so we need 
+	    // to get it ourself. Use different patterns to match the url in case
+       // the Clean URL function is turned on
+       var baseurl = location.href.substring(0,location.href.lastIndexOf('/?q=/node'));
+       if(!baseurl) {
+    	    var baseurl = location.href.substring(0,location.href.lastIndexOf('/node'));
+       }
+       if (!baseurl) {
+          // This base_url is obtained when Clena URL function is off
+          var baseurl = location.href.substring(0,location.href.lastIndexOf('/?q=node'));
+       }
+       if (!baseurl) {
+          // The last possibility is we've assigned an alias path, get base_url till the last /
+          var baseurl = location.href.substring(0,location.href.lastIndexOf('/'));
+       }
+       return baseurl;
+   }
 }

+ 4 - 18
theme_tripal/js/tripal_analysis_blast.js

@@ -38,24 +38,10 @@ if (Drupal.jsEnabled) {
 	   // Get the dbname from DOM
 	   var index = options.selectedIndex;
 	   var dbid = options[index].value;
-	   
-       // Get the base url. Drupal can not pass it through the form so we need 
-	   // to get it ourself. Use different patterns to match the url in case
-       // the Clean URL function is turned on
-       var baseurl = location.href.substring(0,location.href.lastIndexOf('/?q=/node'));
-       if(!baseurl) {
-    	   var baseurl = location.href.substring(0,location.href.lastIndexOf('/node'));
-       }
-       if (!baseurl) {
-          // This base_url is obtained when Clena URL function is off
-          var baseurl = location.href.substring(0,location.href.lastIndexOf('/?q=node'));
-       }
-       if (!baseurl) {
-          // The last possibility is we've assigned an alias path, get base_url till the last /
-          var baseurl = location.href.substring(0,location.href.lastIndexOf('/'));
-       }
-	   // Form the link for the following ajax call
-       var link = baseurl + '/tripal_blast_regex/' + dbid;
+
+	   // Form the link for the following ajax call	   
+      var baseurl = tripal_get_base_url();
+      var link = baseurl + '/tripal_blast_regex/' + dbid;
 	   
 	   // Make ajax call to retrieve regular expressions
 	   $.ajax( {

+ 1 - 1
theme_tripal/js/tripal_cv.js

@@ -17,7 +17,7 @@ if (Drupal.jsEnabled) {
           isClean = 0;
        }
        if (!baseurl) {
-          // This base_url is obtained when Clena URL function is off
+          // This base_url is obtained when Clean URL function is off
           baseurl = location.href.substring(0,location.href.lastIndexOf('/?q=node'));
           isClean = 1;
        }

+ 3 - 0
theme_tripal/js/tripal_db.js

@@ -0,0 +1,3 @@
+if (Drupal.jsEnabled) {
+
+}