Changeset 8911
- Timestamp:
- Jan 26, 2011, 12:52:35 PM (14 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 5 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/admin_autosize.php
r8864 r8911 115 115 case 'autosize_help': 116 116 117 $message=" <fieldset id='fieldset'>117 $message=" 118 118 <script id='dimensions' src='./plugins/Autosize/js/jquery.dimensions.js'></script> 119 119 <script id='Affiche_script' src='./plugins/Autosize/js/Affiche_script.js'></script> 120 <fieldset id='fieldset'> 120 121 <div class='autosize' 121 autosize='MargeBasse:30px;MargeHaute:30px;parent:fieldset;ResizePicture:true' 122 > 123 124 <img src='./galleries/Voyages/Europe/Italie/Chianti/IMG_0520.JPG' width='100%' /> 125 </a> 122 autosize='MargeBasse:30px;MargeHaute:30px;parent:fieldset;ResizePicture:true'> 123 <img src='./plugins/Autosize/images/ECO_050.jpg ' width='100%' /> 126 124 </div> 127 125 </fieldset>"; 128 126 if (isset($_POST['valid'])) { $message = empty($_POST['texte']) ? $message : stripslashes($_POST['texte']); 129 127 } 130 //========================================================================= 131 $toolbar = 'Basic'; 132 $width = '100%'; 133 $height = '200px'; 128 //========================================================================= 129 130 131 $toolbar = 'Full'; //basic 132 $width = 'auto'; 133 $height = 'auto'; 134 134 $areas = array(); 135 135 $areas[]='texte'; 136 136 if (!empty($areas)){ 137 137 if (function_exists('set_fckeditor_instance')) 138 set_fckeditor_instance($areas, $toolbar, $width, $height); 138 { $template->set_prefilter('plugin_admin_content', 'add_remove_button'); 139 set_fckeditor_instance($areas, $toolbar, $width, $height); 140 } 139 141 } 140 141 142 143 144 145 146 147 142 148 143 $template->set_filenames(array( 'plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/help.tpl' ))); -
extensions/Autosize/autosize.inc.php
r8729 r8911 25 25 PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' 26 26 ); 27 if (!defined('ROOT_URL')) 28 define( 'ROOT_URL', get_root_url().'/' ); 29 if (!defined('AUTOSIZE_PATH_ABS')) 30 define( 31 'AUTOSIZE_PATH_ABS', 32 dirname(__FILE__).'/' 33 ); 34 35 27 36 28 37 class autosize_controler { … … 37 46 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 38 47 if ($ma_page=='thePiwiShackControllerPage') return ; 48 39 49 $my_path = dirname(__FILE__).'/'; 40 50 $template->set_filenames(array('autosize_init'=>$my_path. "template/conflit.tpl" ) ); … … 42 52 $autosize_parametres = cl_autosize_Get_Options() ; 43 53 $theme=$user['theme']; 44 $url = get_root_url(); 54 $url = get_root_url(); 55 $AUTOSIZE_PATH=AUTOSIZE_PATH; 56 57 45 58 $template->assign( 46 59 array( … … 49 62 'cl_version' => $cl_plugin['version'] , 50 63 'name' => $cl_plugin['name'] , 51 'MY_ROOT' => $url,52 64 'theme' => $theme , 53 65 'DEBUG' => $DEBUG , 54 'AUTOSIZE_PATH' => AUTOSIZE_PATH) 66 'AUTOSIZE_PATH' => AUTOSIZE_PATH , 67 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS, 68 'ROOT_URL' => $url , 69 ) 55 70 ); 56 71 … … 63 78 static public function cl_autosize_script_2() 64 79 { 65 global $template,$user,$conf,$picture ,$page, $cl_plugin ;80 global $template,$user,$conf,$picture ,$page, $cl_plugin,$known_script ; 66 81 $my_path = dirname(__FILE__).'/'; 67 82 $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ; … … 109 124 static public function cl_autosize_affiche() 110 125 { 111 global $user, $picture, $template,$page ;126 global $user, $picture, $template,$page,$known_script; 112 127 global $content, $element_info; 113 128 global $infos_message,$erreur_message; … … 119 134 if ( isset($picture['current'])){ 120 135 $autosize_parametres = cl_autosize_Get_Options(); 121 include (AUTOSIZE_PATH."include/affiche.php"); 136 include (AUTOSIZE_PATH."include/affiche.php"); 137 122 138 if($autosize_parametres->check_icon_v == 'on'){ 123 139 $template->assign('cl_autosize_button', -
extensions/Autosize/include/affiche.php
r8864 r8911 1 1 <?php 2 3 4 5 2 $visible=(isset($visible))?$visible:false; 6 3 $img_width=isset($picture['current']['width'])?$picture['current']['width']:480; … … 13 10 $DEBUG= isset($conf['cl_debug']) ? $conf['cl_debug'] : $DEBUG ; 14 11 15 12 $my_path = AUTOSIZE_PATH_ABS; 16 13 $theme=$user['theme']; 17 14 $user_status = $user['status'] ; 18 $template->assign( array( 15 16 $template->assign( array( 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS 19 17 ) 20 18 ); … … 29 27 'thumbnail' => $conf['prefix_thumbnail'], 30 28 'visible' => $visible, 31 29 'ROOT_URL' => get_root_url() , 32 30 'AUTOSIZE_PATH' => AUTOSIZE_PATH, 33 31 'theme' => $theme, -
extensions/Autosize/js/Affiche_script.js
r8864 r8911 51 51 function Wait_Affichage() { 52 52 fade_in = parseInt(fade_in); 53 53 54 54 if (!jQuery().newResize()) { 55 55 setTimeout("Wait_Affichage()", 500); 56 56 return 57 57 } 58 nu_img++;58 nu_img++; 59 59 if (fade_in == 0) { 60 60 jQuery(Parent).css({ opacity: "1" }); … … 73 73 } 74 74 ); 75 76 77 78 75 } 76 // if (nu_img > 1) return; 77 78 79 79 80 80 img_h = jQuery(TheImg).height(); … … 85 85 jQuery("#ret_autosize").val(src_img); 86 86 87 jQuery("#ret_autosize").trigger('ON' );87 jQuery("#ret_autosize").trigger('ON', { width: img_w, height: img_w, theImage: TheImg, src_img: src_img }); 88 88 89 89 … … 97 97 98 98 99 100 99 conf = jQuery(Obj).get(0).conf; 101 100 Obj = jQuery(Obj).get(0).obj; 102 101 myWindow = jQuery("#" + conf.parent).infos(); 103 102 104 if (myWindow == 0) myWindow = jQuery(window).infos();103 if (myWindow.width == 0) myWindow = jQuery(window).infos(); 105 104 marge_basse = 0; 106 105 if (conf.MargeBasse) … … 108 107 conf.MargeBasse 109 108 ); 109 marge_top = 0; 110 if (conf.MargeHaute) 111 marge_top = jQuery().Get_Val_int( 112 conf.MargeHaute 113 ); 114 110 115 info_Obj = jQuery(Obj).infos(); 111 116 h1_left = jQuery(Obj).absoluteLeft(); 112 117 h1_top = jQuery(Obj).absoluteTop(); 113 if (typeof old_h1 == "undefined") old_h1 = 0;114 115 116 118 117 119 if (h1_top < info_Obj.height) 118 h1 = (myWindow.height - h1_top - marge_basse );120 h1 = (myWindow.height - h1_top - marge_basse - marge_top); 119 121 else 120 122 h1 = (myWindow.height - marge_basse); 121 123 122 if (h1 == old_h1) return; 123 old_h1 = h1; 124 125 imgs = jQuery(Obj).find("img"); 126 rap = jQuery(imgs).height() / jQuery(imgs).width(); 127 w2 = (h1 / rap); 128 129 // ("source:" + message); 124 125 rap = info_Obj.height / info_Obj.width; 126 w2 = parseInt(h1 / rap); 130 127 131 128 if (w2 < info_Obj.width) … … 134 131 marginLeft = "auto"; 135 132 136 jQuery(Obj).css({ width: "auto", 133 jQuery(Obj).css({ width: "auto",marginTop:marge_top, 137 134 marginLeft: "auto", marginBottom: 0 + "px", 138 135 verticalAlign: "middle", textAlign: "center" 139 136 }); 140 137 jQuery(Obj).height(h1); 138 141 139 //============================================================= 142 140 if (conf.ResizePicture != "true") { 143 141 144 142 } else 145 jQuery(imgs).each(function (i) { 146 img = jQuery(this); 147 rap = jQuery(this).height() / jQuery(this).width(); 148 w2 = parseInt(h1 / rap); 149 if (w2 > 0 && h1 > 0 && img.length > 0) { 150 img.height(h1); 151 img.width(w2); 152 } 153 154 }); 143 imgs = jQuery(Obj).find("img"); 144 Obj_w = jQuery(Obj).width(); 145 Obj_h = jQuery(Obj).height(); 146 147 jQuery(imgs).each(function (i) { 148 img = jQuery(this); 149 150 info_img = { width: conf.width[i], height: conf.height[i] }; 151 img_rap = conf.rap[i]; 152 153 if (info_img.width > Obj_w) h1 = parseInt(Obj_w / img_rap); 154 else w2 = parseInt(Obj_h * img_rap); 155 if (w2 > 0 && h1 > 0 && img.length > 0) { 156 img.height(h1); 157 img.width(w2); 158 } 159 160 }); 155 161 156 162 … … 176 182 conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]); 177 183 } 184 imgs = jQuery(a).find("img"); 185 rap = new Array(); 186 width = new Array(); 187 height = new Array(); 188 jQuery(imgs).each(function (i) { 189 img = jQuery(this); 190 rap.push((img.width() / img.height())); 191 width.push( img.width() ); 192 height.push( img.height() ); 193 }); 194 195 conf['rap'] = rap; 196 conf['width'] = width; 197 conf['height'] = height; 178 198 179 199 List_autosize.push({ obj: a, conf: conf }); … … 190 210 191 211 function List_autosize_resize(event, ui) { 212 if (typeof wait_resize == "undefined") wait_resize = false; 213 if (wait_resize == true) return; 214 215 wait_resize = true; 192 216 if (List_autosize.length == 0) return; 193 217 for (i = 0; i < List_autosize.length; i++) { 194 218 Autosize_resize(jQuery(List_autosize[i])); 195 219 } 220 wait_resize = false; 196 221 197 222 } -
extensions/Autosize/js/conflit.js
r8864 r8911 537 537 //=== ajout des fonctions jQuery === 538 538 jQuery.extend($, jQuery); 539 540 541 //--------------------------------------------------------------542 -
extensions/Autosize/main.inc.php
r8864 r8911 12 12 if (!defined('AUTOSIZE_PATH')) 13 13 define( 'AUTOSIZE_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' ); 14 if (!defined('ROOT_URL')) 15 define( 'ROOT_URL', get_root_url().'/' ); 14 16 //================================================================== 15 17 include(AUTOSIZE_PATH."include/constants.php"); -
extensions/Autosize/template/autosize.tpl
r8864 r8911 1 1 {html_head} {* $Id: autosize/template/autosize.tpl *} 2 <!-- autosize/template/autosize.tpl --> 3 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} 4 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.packed.js"} 5 {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"} 6 2 <!-- autosize/template/autosize.tpl --> 7 3 <script type="text/javascript"> 8 4 var src_img = '{$SRC_IMG}'; … … 47 43 var check_desc_v = '{$check_desc_v}'; 48 44 </script> 49 {known_script id="Affiche_script" src=$AUTOSIZE_PATH|@cat:"js/Affiche_script.js"} 45 {if PHPWG_VERSION < 2.2 } 46 {include file=$AUTOSIZE_PATH_ABS|@cat:'template/picture_2_1.tpl'} 47 {else} 48 {include file= $AUTOSIZE_PATH_ABS|@cat:'template/picture_2_2.tpl'} 49 {/if} 50 50 <link href="{$AUTOSIZE_PATH}css/autosize.css" rel="stylesheet" type="text/css" /> 51 51 <!-- << autosize/template/autosize.tpl --> -
extensions/Autosize/template/conflit.tpl
r8729 r8911 1 1 {html_head} 2 <!--- cl_conflit/template/confilt.tpl ---> 3 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} 4 {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"} 5 {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"} 6 {/html_head} 2 {if PHPWG_VERSION < 2.2 } 3 {include file=$AUTOSIZE_PATH_ABS|@cat:'template/header_2_1.tpl'} 4 {else} 5 {include file= $AUTOSIZE_PATH_ABS|@cat:'template/header_2_2.tpl'} 6 {/if} 7 {/html_head} 8 7 9 <script type="text/javascript"> 10 8 11 var DEBUG = '{$DEBUG}'; 9 12 var theme = '{$theme}'; -
extensions/Autosize/template/picture.tpl
r8864 r8911 20 20 21 21 </script> 22 <form method="post">22 23 23 <input id="ret_autosize" type="hidden" value="" /> 24 24 <input id="src_img_h" type="hidden" value="" /> 25 25 <input id="src_img_w" type="hidden" value="" /> 26 </form> 26 27
Note: See TracChangeset
for help on using the changeset viewer.