Changes between Version 2 and Version 3 of Howto/JavaScript/ImagePaths

Show
Ignore:
Author:
jcasanova (IP: 82.229.247.57)
Timestamp:
01/11/07 12:55:48 (7 years ago)
Comment:

using SGL_JS_THEME

Legend:

Unmodified
Added
Removed
Modified
  • Howto/JavaScript/ImagePaths

    v1 v3  
    1515}}} 
    1616 
    17 So to set the correct path in your custom javascript files, just call in the web root global as follows (example taken from lightbox.js): 
     17In this example we are interested in both SGL_JS_WEBROOT and SGL_JS_THEME. 
     18 
     19To set the correct path in your custom javascript files, just use these two javascript globals as follows (example taken from lightbox.js): 
    1820 
    1921{{{ 
    20 // 
    21 //      Configuration 
    22 // 
    23 var fileLoadingImage = SGL_JS_WEBROOT + "/themes/my_theme/images/loading.gif"; 
    24 var fileBottomNavCloseImage = SGL_JS_WEBROOT + "/themes/my_theme/images/closelabel.gif"; 
     22/* 
     23 * Configuration 
     24 */ 
     25var fileLoadingImage = SGL_JS_WEBROOT + "/themes/" +SGL_JS_THEME +"/images/loading.gif"; 
     26var fileBottomNavCloseImage = SGL_JS_WEBROOT + "/themes/" +SGL_JS_THEME +"/images/closelabel.gif"; 
     27}}} 
     28 
     29If you have some specific module images located in <moduleName>/www/images simply call 
     30{{{ 
     31var imagePath = SGL_JS_WEBROOT + "/moduleName/images/image.gif"; 
    2532}}} 
    2633