Changeset 49949 in spip-zone


Ignore:
Timestamp:
Jul 25, 2011, 6:58:41 AM (10 years ago)
Author:
cedric@…
Message:

La sequence d'initialisation erronée empechait l'activation de la mediabox sur les images de l'espace privé, en l'absence de compression

Location:
_core_/plugins/mediabox
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _core_/plugins/mediabox/javascript/spip.mediabox.js

    r45459 r49949  
    22// and "the ajaxed element" when called because of onAjaxLoad
    33var mediaboxInit = function() {
     4        console.log(box_settings);
    45        var options = {
    56                transition:box_settings.trans,
     
    2223        // passer le portfolio de la dist en mode galerie
    2324        if (box_settings.sel_g){
    24                 jQuery(box_settings.sel_g, this).not('#colorbox')
     25                jQuery(box_settings.sel_g, this).not('.hasbox,#colorbox')
    2526                .attr("onclick","") // se debarrasser du onclick de SPIP
    2627                .colorbox(jQuery.extend({}, options, {rel:'galerieauto',slideshow:true,slideshowAuto:false}))
  • _core_/plugins/mediabox/mediabox_pipelines.php

    r48695 r49949  
    5151        if ($config['active']=='oui' AND $f = find_in_path((test_espace_prive()?"prive/":"")."colorbox/".$config['skin'].'/colorbox.css'))
    5252                $flux .= '<link rel="stylesheet" href="'.direction_css($f).'" type="text/css" media="all" />';
     53        /**
     54         * Initialiser la config de la mediabox
     55         */
     56        $flux ='<script type="text/javascript">/* <![CDATA[ */
     57var box_settings = {tt_img:'.($config['traiter_toutes_images'] == 'oui'?'true':'false')
     58.',sel_g:"'.$config['selecteur_galerie']
     59.'",sel_c:"'.$config['selecteur_commun']
     60.'",trans:"'.$config['transition']
     61.'",speed:"'.$config['speed']
     62.'",ssSpeed:"'.$config['slideshow_speed']
     63.'",maxW:"'.$config['maxWidth']
     64.'",maxH:"'.$config['maxHeight']
     65.'",minW:"'.$config['minWidth']
     66.'",minH:"'.$config['minHeight']
     67.'",opa:"'.$config['opacite']
     68.'",str_ssStart:"'.unicode2charset(html2unicode(_T('mediabox:boxstr_slideshowStart')))
     69.'",str_ssStop:"'.unicode2charset(html2unicode(_T('mediabox:boxstr_slideshowStop')))
     70.'",str_cur:"'._T('mediabox:boxstr_current')
     71.'",str_prev:"'._T('mediabox:boxstr_previous')
     72.'",str_next:"'._T('mediabox:boxstr_next')
     73.'",str_close:"'._T('mediabox:boxstr_close')
     74.'",splash_url:"'.$config['splash_url']
     75.'"};
     76/* ]]> */</script>'."\n" . $flux;
    5377
    5478        return $flux;
     
    6993        <script src="'.mediabox_timestamp(find_in_path('javascript/jquery.colorbox.js')).'" type="text/javascript"></script>
    7094        <script src="'.mediabox_timestamp(find_in_path('javascript/spip.mediabox.js')).'" type="text/javascript"></script>';
    71 
    72                 /**
    73                  * Initialiser la mediabox si jQuery est deja charge, ie on arrive apres
    74                  */
    75                 $flux .='<script type="text/javascript">/* <![CDATA[ */
    76         var box_settings = {tt_img:'.($config['traiter_toutes_images'] == 'oui'?'true':'false')
    77         .',sel_g:"'.$config['selecteur_galerie']
    78         .'",sel_c:"'.$config['selecteur_commun']
    79         .'",trans:"'.$config['transition']
    80         .'",speed:"'.$config['speed']
    81         .'",ssSpeed:"'.$config['slideshow_speed']
    82         .'",maxW:"'.$config['maxWidth']
    83         .'",maxH:"'.$config['maxHeight']
    84         .'",minW:"'.$config['minWidth']
    85         .'",minH:"'.$config['minHeight']
    86         .'",opa:"'.$config['opacite']
    87         .'",str_ssStart:"'.unicode2charset(html2unicode(_T('mediabox:boxstr_slideshowStart')))
    88         .'",str_ssStop:"'.unicode2charset(html2unicode(_T('mediabox:boxstr_slideshowStop')))
    89         .'",str_cur:"'._T('mediabox:boxstr_current')
    90         .'",str_prev:"'._T('mediabox:boxstr_previous')
    91         .'",str_next:"'._T('mediabox:boxstr_next')
    92         .'",str_close:"'._T('mediabox:boxstr_close')
    93         .'",splash_url:"'.$config['splash_url']
    94         .'"};
    95         if (window.jQuery) (jQuery(function(){ if(typeof onAjaxLoad == "function") onAjaxLoad(mediaboxInit); mediaboxInit(); }));
    96         /* ]]> */</script>'."\n";
    97 
    9895                if ($config['splash_url'])
    9996                        $flux .='<script src="'.mediabox_timestamp(find_in_path('javascript/splash.mediabox.js')).'" type="text/javascript"></script>';
Note: See TracChangeset for help on using the changeset viewer.