Changeset 18609


Ignore:
Timestamp:
Oct 11, 2012, 10:46:47 PM (11 years ago)
Author:
rvelices
Message:

rv_gmaps use colorbox instead of nyroModal

Location:
extensions/rv_gmaps/trunk
Files:
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • extensions/rv_gmaps/trunk/changelog.txt

    r18578 r18609  
    44- minor javascript changes for maps api v3.9
    55- code optimization
     6- use colorbox instead of nyroModal
    67
    782.4.d
  • extensions/rv_gmaps/trunk/map_data.php

    r18578 r18609  
    7777}
    7878
    79 $out='';
    80 function rvo($s) {
    81   //global $out; $out.=$s;
    82         echo $s;
    83 }
    84 
    85 function rvf() {
    86   //global $out; echo $out; $out=''; ob_flush();
    87 }
    88 
    8979$start_output = get_moment();
    9080
    9181
    92 rvo( "{\ntitle:".jsgm_str( strip_tags(trigger_event('render_element_description', $page['title']) ) ) );
     82echo "{\ntitle:", jsgm_str( strip_tags(trigger_event('render_element_description', $page['title']) ) )
     83  , ",\npage_url:", jsgm_str( duplicate_index_url( array('start'=>0) ) )
     84  , ",\nblowup_url:", jsgm_str( rvm_duplicate_blowup_url( array('start'=>0) ) )
     85  , ",\nkml_url:", jsgm_str( rvm_duplicate_kml_index_url( array('start'=>0, 'flat'=>1) ) )
     86  , ",\nnb_items:", count($page['items']);
    9387
    94 rvo( ",\npage_url:".jsgm_str( duplicate_index_url( array('start'=>0) ) ) );
     88echo ",\nbounds:";
     89if ( isset($cm) )
     90  echo jsgm_bounds( $cm->bounds );
     91else
     92  echo "null";
    9593
    96 rvo( ",\nblowup_url:".jsgm_str( rvm_duplicate_blowup_url( array('start'=>0) ) ) );
     94echo ",\n\nnb_clusters:", count($clusters);
    9795
    98 rvo( ",\nkml_url:".jsgm_str( rvm_duplicate_kml_index_url( array('start'=>0, 'flat'=>1) ) ) );
    99 
    100 rvo( ",\nnb_items:".count($page['items']) );
    101 
    102 rvo( ",\nbounds:" );
    103 if ( isset($cm) )
    104   rvo( jsgm_bounds( $cm->bounds ) );
    105 else
    106   rvo( "null" );
    107 
    108 rvo( ",\n\nnb_clusters:".count($clusters) );
    109 
    110 rvo( ",\nimage_clusters:[\n" );
     96echo ",\nimage_clusters:[\n";
    11197$i=0;
    11298$thumb_params = ImageStdParams::get_by_type(IMG_THUMB);
     
    122108foreach( $clusters as $c )
    123109{
    124   if ($i) rvo( ",\n\n" );
    125   rvo( '{position:'. jsgm_position( bounds_center($c->bounds) ) );
    126   rvo( ",\nbounds:". jsgm_bounds( $c->bounds ) );
    127   rvo( ",\nnb_items:".count($c->items) );
    128   rvo( ",\n" );
     110  if ($i) echo ",\n\n" ;
     111  echo '{position:', jsgm_position( bounds_center($c->bounds) );
     112  echo ",\nbounds:", jsgm_bounds( $c->bounds );
     113  echo ",\nnb_items:", count($c->items);
     114  echo ",\n";
    129115
    130   rvo( 'blowup_url:"'.rvm_duplicate_blowup_url(array('box'=>$c->bounds), array('start') ). '"' );
     116  echo 'blowup_url:"', rvm_duplicate_blowup_url(array('box'=>$c->bounds), array('start') ), '"';
    131117
    132118  $max_per_cluster = rvm_get_config_var('nb_images_per_marker',20);
    133119  if ( count($c->items) >  $max_per_cluster )
    134   {
    135120    $c->items = array_slice($c->items, 0, $max_per_cluster);
    136   }
    137   rvo( ",\nitems:[" );
     121
     122  echo ",\nitems:[";
    138123  for ($j=0; $j<count($c->items); $j++)
    139124  {
     
    142127                $page_url = str_replace(array('123456789','dummy_file'), array($img['id'], get_filename_wo_extension($img['file'])), $page_url_model);
    143128
    144     if ($j) rvo( "," );
    145     rvo( "{tn:".jsgm_str( DerivativeImage::url( $thumb_params,$img ) ) );
    146     rvo( ",name:".jsgm_str( render_element_name($img) ) );
    147     rvo( ",comment:".jsgm_str( render_element_description($img) ) );
    148     rvo( ",page_url:".jsgm_str( $page_url ) );
    149     rvo( "}" );
     129    if ($j) echo( "," );
     130    echo "{tn:", jsgm_str( DerivativeImage::url( $thumb_params,$img ) );
     131    echo ",name:", jsgm_str( render_element_name($img) );
     132    echo ",comment:", jsgm_str( render_element_description($img) );
     133    echo ",page_url:", jsgm_str( $page_url );
     134    echo "}";
    150135  }
    151   rvo( "]\n}" );
    152   rvf();
     136  echo "]\n}";
    153137  $i++;
    154138}
    155 rvo( "] /*clusters*/\n" );
     139echo "] /*clusters*/\n";
    156140
    157141$time = get_elapsed_time($t2, get_moment());
    158142$page['queries_time'] = number_format($page['queries_time'],3,'.',' ');
    159 rvo( "\n,debug:'$time; out:".get_elapsed_time($start_output,get_moment()).";$cluster_debug queries:".$page['count_queries']." in ".$page['queries_time']."s'\n" );
     143echo "\n,debug:'$time; out:", get_elapsed_time($start_output,get_moment()), ";$cluster_debug queries:", $page['count_queries'], " in ", $page['queries_time'], "s'\n" ;
    160144
    161 rvo( '}' );
    162 rvf();
     145echo '}';
    163146?>
  • extensions/rv_gmaps/trunk/template/data_handler.js

    r12719 r18609  
    283283PwgDataHandler.blowupUrl = function(theUrl)
    284284{
    285         jQuery.fx.off = true;
    286         jQuery.nyroModalManual( {
    287                 url: theUrl,
    288                 forceType: 'iframe',
    289                 width: 1920
     285        jQuery.colorbox( {
     286                href: theUrl,
     287                iframe: 1,
     288                width: "95%", height: "98%"
    290289        });
    291290        return false;
  • extensions/rv_gmaps/trunk/template/map.tpl

    r14181 r18609  
    88
    99<script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;language={$lang_info.code}&amp;libraries=places" type="text/javascript"></script>
    10 {combine_script id='jquery' load='header' path='http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'}
    11 {combine_script id='jquery.nyroModal' load='async' path="`$PLUGIN_LOCATION`/template/nyroModal/jquery.nyroModal-1.6.2.js" version='1.6.2'}
     10{combine_script id='jquery' load='header' path='http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js'}
     11{combine_script id='jquery.colorbox' load='async' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
    1212{combine_css path="`$PLUGIN_LOCATION`/template/style.css" version=$RVM_PLUGIN_VERSION}
    13 {combine_css path="`$PLUGIN_LOCATION`/template/nyroModal/nyroModal.css" version=$RVM_PLUGIN_VERSION}
     13{combine_css path='themes/default/js/plugins/colorbox/style2/colorbox.css'}
    1414{combine_script id='rvm.dl' load='header' path="`$PLUGIN_LOCATION`/template/data_loader.js" version=$RVM_PLUGIN_VERSION}
    1515{combine_script id='rvm.dh' load='header' path="`$PLUGIN_LOCATION`/template/data_handler.js" version=$RVM_PLUGIN_VERSION}
  • extensions/rv_gmaps/trunk/template/picture_map_content.tpl

    r13092 r18609  
    22<script src="http://maps.googleapis.com/maps/api/js?sensor=false&amp;language={$lang_info.code}" type="text/javascript"></script>
    33{combine_script id='jquery' load='header' path='themes/default/js/jquery.min.js'}
    4 {combine_script id='jquery.nyroModal' load='async' path="`$PLUGIN_LOCATION`/template/nyroModal/jquery.nyroModal-1.6.2.js" version='1.6.2'}
    5 <link href="{$PLUGIN_ROOT_URL}/template/nyroModal/nyroModal.css" rel="stylesheet" type="text/css">
     4{combine_script id='jquery.colorbox' load='async' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
     5{combine_css path='themes/default/js/plugins/colorbox/style2/colorbox.css'}
    66{/html_head}{html_style}{literal}
    77#mapPicture {
     
    6161function blowupUrl(theUrl)
    6262{
    63         jQuery.fx.off = true;
    64         jQuery.nyroModalManual( {
    65                 url: theUrl,
    66                 forceType: 'iframe',
    67                 width: 1920
    68         });
     63        jQuery.colorbox({href: theUrl, iframe: 1, width: "95%", height: "98%"});
    6964        return false;
    7065}
Note: See TracChangeset for help on using the changeset viewer.