tests/Leaflet/sl-application.js
// Aggregates all data pertaining to a slurl - Includes title, image, description, x/y coordinates, etc
Aggregates all data pertaining to a slurl - Includes title, image, description, x/y coordinates, etc
Aggregates all data pertaining to a slurl - Includes title image description x / y coordinates etc
function slurl_setup() {
    var urlPath = window.location.pathname;
    var urlParts = urlPath.split("/");
 	var initial_region = 'Beta Technologies';
    slurl_data['region'] = new Object();
    if (urlParts[1] == '' || urlParts[1] == 'index.php' || urlParams['q'] != undefined || urlParts[3] == undefined) {
        slurl_data['region']['name'] = initial_region;
        slurl_data['region']['x'] = 0;
        slurl_data['region']['y'] = 0;
        slurl_data['region']['z'] = 0;
        slurl_data['region']['default'] = true;
    }
    else
    {
        initial_region = (urlParts[2] == undefined) ? 'Beta Technologies' : decodeURIComponent(urlParts[2]);
        slurl_data['region']['name'] = initial_region;
        slurl_data['region']['x'] = (urlParts[3] != undefined) ? check_coords(urlParts[3]) : 128 ;
        slurl_data['region']['y'] = (urlParts[4] != undefined) ? check_coords(urlParts[4]) : 128 ;
        slurl_data['region']['z'] = (urlParts[5] != undefined) ? urlParts[5] : 0;
        slurl_data['region']['default'] = false;
    }
    var slurl = 'secondlife://' + encodeURIComponent(slurl_data['region']['name'].toUpperCase()) + '/' + slurl_data['region']['x'] + '/' + slurl_data['region']['y'] + '/' + slurl_data['region']['z'];
    var templateData = {
        'slurl': slurl,
        'title': $.sl.maps.config.default_title,
        'img': $.sl.maps.config.default_img,
        'msg': $.sl.maps.config.default_msg
    };
    Mustache.parse($.sl.maps.config.balloon_tmpl);
    slurl_data['windowcontent'] = Mustache.render($.sl.maps.config.balloon_tmpl, templateData);
    slurl_data['sidebarcontent'] = templateData;
    Mustache.parse($.sl.maps.config.noexists_tmpl);
    slurl_data['noexist_windowcontent'] = Mustache.render($.sl.maps.config.noexists_tmpl, {'region_name':slurl_data['region']['name']} );
}
function slurl_setup ( ) { var urlPath = window . location . pathname ; var urlParts = urlPath . split ( "/" ) ; var initial_region = 'Beta Technologies' ; slurl_data [ 'region' ] = new Object ( ) ; if ( urlParts [ 1 ] == '' || urlParts [ 1 ] == 'index.php' || urlParams [ 'q' ] != undefined || urlParts [ 3 ] == undefined ) { slurl_data [ 'region' ] [ 'name' ] = initial_region ; slurl_data [ 'region' ] [ 'x' ] = 0 ; slurl_data [ 'region' ] [ 'y' ] = 0 ; slurl_data [ 'region' ] [ 'z' ] = 0 ; slurl_data [ 'region' ] [ 'default' ] = true ; } else { initial_region = ( urlParts [ 2 ] == undefined ) ? 'Beta Technologies' : decodeURIComponent ( urlParts [ 2 ] ) ; slurl_data [ 'region' ] [ 'name' ] = initial_region ; slurl_data [ 'region' ] [ 'x' ] = ( urlParts [ 3 ] != undefined ) ? check_coords ( urlParts [ 3 ] ) : 128 ; slurl_data [ 'region' ] [ 'y' ] = ( urlParts [ 4 ] != undefined ) ? check_coords ( urlParts [ 4 ] ) : 128 ; slurl_data [ 'region' ] [ 'z' ] = ( urlParts [ 5 ] != undefined ) ? urlParts [ 5 ] : 0 ; slurl_data [ 'region' ] [ 'default' ] = false ; } var slurl = 'secondlife://' + encodeURIComponent ( slurl_data [ 'region' ] [ 'name' ] . toUpperCase ( ) ) + '/' + slurl_data [ 'region' ] [ 'x' ] + '/' + slurl_data [ 'region' ] [ 'y' ] + '/' + slurl_data [ 'region' ] [ 'z' ] ; var templateData = { 'slurl' : slurl , 'title' : $ . sl . maps . config . default_title , 'img' : $ . sl . maps . config . default_img , 'msg' : $ . sl . maps . config . default_msg } ; Mustache . parse ( $ . sl . maps . config . balloon_tmpl ) ; slurl_data [ 'windowcontent' ] = Mustache . render ( $ . sl . maps . config . balloon_tmpl , templateData ) ; slurl_data [ 'sidebarcontent' ] = templateData ; Mustache . parse ( $ . sl . maps . config . noexists_tmpl ) ; slurl_data [ 'noexist_windowcontent' ] = Mustache . render ( $ . sl . maps . config . noexists_tmpl , { 'region_name' : slurl_data [ 'region' ] [ 'name' ] } ) ; }
Aggregates all data pertaining to a slurl - Includes title, image, description, x/y coordinates, etc
Aggregates all data pertaining to a slurl - Includes title image description x / y coordinates etc
//   var initial_region = 'Ahern'; // The following 2 should be numeric only -- need to regex 0-256 // z-index can much higher than 256, 4 digits at least, here we have an uncapped check // hurl the slurl // Setup the template data // Create the balloon content // Some content for a sidebar if needed // A default for when a region doesn't exist.