Index: INSTALL.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jsmath/INSTALL.txt,v
retrieving revision 1.4
diff -u -p -r1.4 INSTALL.txt
--- INSTALL.txt	11 Jul 2008 12:12:30 -0000	1.4
+++ INSTALL.txt	19 Aug 2009 00:25:43 -0000
@@ -6,25 +6,27 @@ the jsMath fonts and then enabling the m
 1) Extract the jsmath.tar.gz file into your /sites/all/modules/ directory. This
 will create a jsmath subdirectory holding the module's files.
 
-2) Download jsMath-v3.5.zip from http://downloads.sourceforge.net/jsmath/jsMath-v3.5.zip
-and extract it into the jsmath directory you created in the previous step. This
-will create a subdirectory jsmath/jsMath holding the jsMath scripts
-
-3) Download jsMath-fonts-1.3.zip from http://downloads.sourceforge.net/jsmath/jsMath-fonts-1.3.zip
-and also extract it into the jsmath directory. This will create a subdirectory 
-jsmath/jsMath/fonts holding the fonts.
+2) Create a /sites/all/libraries directory, if it doesn't exist already.
 
-4) If you want to make the AMSmath symbol fonts available then download
+3) Download jsMath-v3.5.zip from http://downloads.sourceforge.net/jsmath/jsMath-v3.5.zip
+and extract it into the libraries directory you created in the previous step. This
+will create a subdirectory libraries/jsMath holding the jsMath scripts
+
+4) Download jsMath-fonts-1.3.zip from http://downloads.sourceforge.net/jsmath/jsMath-fonts-1.3.zip
+and also extract it into the libraries directory. This will create a subdirectory 
+libraries/jsMath/fonts holding the fonts.
+
+5) If you want to make the AMSmath symbol fonts available then download
 also the files http://www.math.union.edu/~dpvc/jsMath/download/extra-fonts/msam10/msam10.zip
 and http://www.math.union.edu/~dpvc/jsMath/download/extra-fonts/msbm10/msbm10.zip
 and extract them into the jsmath/jsMath/fonts directory. Any other additional
 fonts you may want to intall can be found on the page at
 http://www.math.union.edu/~dpvc/jsMath/download/extra-fonts/welcome.html
 
-5) Go to the module admin section (Administer -> Site building -> Modules) and 
+6) Go to the module admin section (Administer -> Site building -> Modules) and 
 enable the "jsmath" module. 
 
-6) Go to the Administer -> Site configuration -> jsMath settings where
+7) Go to the Administer -> Site configuration -> jsMath settings where
 you can change the default settings for jsMath.
 
 Notice that jsMath is not currently implemented as a filter controlled by
Index: jsmath.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/jsmath/jsmath.module,v
retrieving revision 1.7
diff -u -p -r1.7 jsmath.module
@@ -246,10 +246,22 @@ function _jsmath_settings() {
  */
 function jsmath_init() {
   // Create javascript for setting jsMath options and loading jsMath
-  $jsmath_path = base_path() . drupal_get_path('module', 'jsmath') . '/jsMath';
+
+  // first check in the libraries location
+  $jspath_file_path = 'sites/all/libraries/jsMath/jsMath-easy-load.js';
+  if (!file_exists($jspath_file_path)) {
+    // if it's not there, try inside the module
+    $jspath_file_path = drupal_get_path('module', 'jsmath') . '/jsMath/jsMath-easy-load.js';
+    if (!file_exists($jspath_file_path)) {
+      // otherwise log an error
+      drupal_set_message(t("Installation of jsMath missing", 'error', FALSE));
+    }
+  }
+
+  $jsmath_path = base_path() . dirname($jspath_file_path);
   $load = "<script type=\"text/javascript\">
     if (!window.jsMath) {window.jsMath = {}}
     
     jsMath.Easy = {
       root: \"{$jsmath_path}\",
       scale: ". variable_get('jsmath_scale', 120) .",
