Changeset 8864
- Timestamp:
- Jan 24, 2011, 11:15:38 AM (13 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/admin_autosize.php
r7916 r8864 45 45 $my_base_url.'&tab=autosize_admin' 46 46 ); 47 /*48 $tabsheet->add( 'autosize_ content',49 l10n(' content'),50 $my_base_url.'&tab=autosize_ content'47 48 $tabsheet->add( 'autosize_help', 49 l10n('help'), 50 $my_base_url.'&tab=autosize_help' 51 51 ); 52 */52 53 53 54 54 … … 82 82 // | Sélection de l'onglet | 83 83 // ************************************************************************* 84 $autosizes_message ="";85 $erreur_message="";84 global $infos_message ; 85 global $erreur_message; 86 86 global $conf; 87 87 global $autosize_parametres; … … 89 89 global $picture; 90 90 91 $visible=true; 92 93 $path = AUTOSIZE_PATH; 94 95 96 $autosize_parametres = cl_autosize_Get_Options(); 91 $visible=true; 92 $path = AUTOSIZE_PATH; 93 $autosize_parametres = cl_autosize_Get_Options(); 97 94 98 95 if (isset($_POST['submit'])) { … … 112 109 { 113 110 case 'autosize_admin': 114 115 111 $template->set_filenames(array('plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/admin.tpl'))); 116 117 118 112 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 119 113 break; 120 114 121 case 'autosize_ content':115 case 'autosize_help': 122 116 123 124 $template->set_filenames(array( 'plugin_admin_content' => realpath(AUTOSIZE_PATH . 'template/picture.tpl' ))); 117 $message="<fieldset id='fieldset'> 118 <script id='dimensions' src='./plugins/Autosize/js/jquery.dimensions.js'></script> 119 <script id='Affiche_script' src='./plugins/Autosize/js/Affiche_script.js'></script> 120 <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> 126 </div> 127 </fieldset>"; 128 if (isset($_POST['valid'])) { $message = empty($_POST['texte']) ? $message : stripslashes($_POST['texte']); 129 } 130 //========================================================================= 131 $toolbar = 'Basic'; 132 $width = '100%'; 133 $height = '200px'; 134 $areas = array(); 135 $areas[]='texte'; 136 if (!empty($areas)){ 137 if (function_exists('set_fckeditor_instance')) 138 set_fckeditor_instance($areas, $toolbar, $width, $height); 139 } 140 141 142 143 144 145 146 147 148 $template->set_filenames(array( 'plugin_admin_content' => realpath(AUTOSIZE_PATH . 'admin/template/help.tpl' ))); 149 $template->assign( 150 array( 151 'message' => $message , 152 )); 153 154 125 155 $template->assign_var_from_handle('ADMIN_CONTENT', 'plugin_admin_content'); 126 156 break; 127 157 } 128 if (!isset($autosizes_message)){ 129 $autosizes_message = ""; 130 } 131 132 133 134 if ($autosizes_message != "") { 135 array_push($page['autosizes'], $autosizes_message); 136 $autosizes_message=""; 158 if (!isset($infos_message)){ 159 $infos_message = ""; 160 } 161 if ($infos_message != "") { 162 array_push($page['infos'], $infos_message); 163 $infos_message=""; 137 164 } 138 165 if (!isset($erreur_message)){ -
extensions/Autosize/admin/template/admin.tpl
r7962 r8864 197 197 </form> 198 198 199 </table > 200 201 199 </table > 200 201 -
extensions/Autosize/include/affiche.php
r8057 r8864 26 26 'cl_plugin' => $cl_plugin, 27 27 28 'fade_in' => $autosize_parametres->fade_in,28 'fade_in' => $autosize_parametres->fade_in, 29 29 'thumbnail' => $conf['prefix_thumbnail'], 30 30 'visible' => $visible, -
extensions/Autosize/js/Affiche_script.js
r8807 r8864 50 50 //========================================================================== 51 51 function Wait_Affichage() { 52 53 52 fade_in = parseInt(fade_in); 53 54 54 if (!jQuery().newResize()) { 55 55 setTimeout("Wait_Affichage()", 500); 56 56 return 57 57 } 58 58 nu_img++; 59 59 if (fade_in == 0) { 60 60 jQuery(Parent).css({ opacity: "1" }); … … 73 73 } 74 74 ); 75 } 75 } 76 if (nu_img > 1) return; 77 78 79 80 img_h = jQuery(TheImg).height(); 81 img_w = jQuery(TheImg).width(); 82 83 jQuery("#src_img_h").val(img_h); 84 jQuery("#src_img_w").val(img_w); 85 jQuery("#ret_autosize").val(src_img); 86 87 jQuery("#ret_autosize").trigger('ON'); 88 76 89 77 90 } … … 82 95 function Autosize_resize(Obj) { 83 96 if (typeof cl_visible != "undefined") return; 84 var winwidth = jQuery(window).width(); 85 var winheight = jQuery(window).height(); 97 98 99 100 conf = jQuery(Obj).get(0).conf; 101 Obj = jQuery(Obj).get(0).obj; 102 myWindow = jQuery("#" + conf.parent).infos(); 103 104 if (myWindow == 0) myWindow = jQuery(window).infos(); 105 marge_basse = 0; 106 if (conf.MargeBasse) 107 marge_basse = jQuery().Get_Val_int( 108 conf.MargeBasse 109 ); 86 110 info_Obj = jQuery(Obj).infos(); 87 111 h1_left = jQuery(Obj).absoluteLeft(); 88 h1_top = jQuery(Obj).absoluteTop(); 89 h1 = (winheight - h1_top); 90 img = jQuery(Obj).find("img") ; 91 rap = jQuery(img).height() / jQuery(img).width(); 92 w2 = (h1 / rap); 93 94 if (w2 < info_Obj.width) 95 marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2)+"px"; 96 else 97 marginLeft = "auto"; 98 Obj.css({ width: "auto", 99 marginLeft: "auto", 100 verticalAlign: "middle", textAlign: "center" 101 }); 102 Obj.height(h1); 103 104 105 img.height(h1); 106 img.width(w2); 107 108 109 112 h1_top = jQuery(Obj).absoluteTop(); 113 if (typeof old_h1 == "undefined") old_h1 = 0; 114 115 116 117 if (h1_top < info_Obj.height) 118 h1 = (myWindow.height - h1_top - marge_basse); 119 else 120 h1 = (myWindow.height - marge_basse); 121 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); 130 131 if (w2 < info_Obj.width) 132 marginLeft = info_Obj.left + parseInt((info_Obj.width - w2) / 2) + "px"; 133 else 134 marginLeft = "auto"; 135 136 jQuery(Obj).css({ width: "auto", 137 marginLeft: "auto", marginBottom: 0 + "px", 138 verticalAlign: "middle", textAlign: "center" 139 }); 140 jQuery(Obj).height(h1); 141 //============================================================= 142 if (conf.ResizePicture != "true") { 143 144 } 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 }); 155 156 157 158 110 159 } 111 160 jQuery.extend(jQuery.expr[':'], { … … 114 163 n1 = a.className; 115 164 // personal_block 116 if (n1 == "autosize") { 117 List_autosize.push(a); 118 Autosize_resize(jQuery(a)); 119 jQuery(a).css({ opacity: 1 }); 120 165 if (n1.match(RegExp("autosize", "gi"))) { 166 // autoresize = "MargeBasse:30px; ResizePicture:false" 167 infconf = jQuery(a).attr("autosize"); 168 n1 = typeof infconf; 169 conf = { MargeBasse: 0, NoPicture: false } 170 if (n1 == "undefined") { 171 172 } else { 173 tableau = infconf.split(";"); 174 for (var i = 0; i < tableau.length; i++) { 175 tableau2 = tableau[i].split(":"); 176 conf[jQuery.trim(tableau2[0])] = jQuery.trim(tableau2[1]); 177 } 178 179 List_autosize.push({ obj: a, conf: conf }); 180 jQuery(a).css({ opacity: 1 }); 181 } 121 182 } 122 183 // Css = jQuery(a).getStyles(a); … … 126 187 } 127 188 }); 128 129 130 189 190 191 function List_autosize_resize(event, ui) { 192 if (List_autosize.length == 0) return; 193 for (i = 0; i < List_autosize.length; i++) { 194 Autosize_resize(jQuery(List_autosize[i])); 195 } 196 197 } 131 198 //============================================================== 132 199 jQuery(document).ready( … … 139 206 jQuery(window).resize( 140 207 function (event, ui) { 141 if (List_autosize.length == 0) return; 142 for (i = 0; i < List_autosize.length; i++) { 143 Autosize_resize(jQuery(List_autosize[i])); 144 } 208 List_autosize_resize(event, ui); 145 209 146 210 }); … … 151 215 if (List_autosize.length == 0) return; 152 216 for (i = 0; i < List_autosize.length; i++) { 153 Autosize_resize(jQuery(List_autosize[i])); 217 Autosize_resize(jQuery(List_autosize[i])); 154 218 } 155 219 … … 251 315 jQuery(bp1).trigger('ON'); 252 316 } 317 if (typeof cl_visible == "undefined") return; 318 if (!cl_visible == true) { return true; } 253 319 var chk = eval(user_status + "_enabled"); 254 if (!cl_visible == true) { return true; }255 320 if (chk == "") { return true; } 256 321 … … 1236 1301 info_description.bottom -= info_img.top; 1237 1302 } 1238 // if (msie == true) info_description.bottom -= 4;1303 // if (msie == true) info_description.bottom -= 4; 1239 1304 1240 1305 info_description.height = info_description.bottom - info_description.top; … … 1366 1431 // Add 10 testing debugs to start with 1367 1432 jQuery(window).load(function () { 1433 DEBUG = (typeof DEBUG != "undefined") ? DEBUG : "false"; 1368 1434 if (DEBUG == "true") { 1369 1435 for (var i = 0; i < 10; i++) { -
extensions/Autosize/js/conflit.js
r8792 r8864 1 1 //==== cl_conflit remplace $(... avec jQuery( ==== 2 3 2 //=================================================== 4 3 var detect = navigator.userAgent.toLowerCase(); … … 7 6 //============================================================================== 8 7 browser = detect_browser(); 9 10 8 function detect_browser() { 11 9 12 10 mybrowser = { 13 11 browser: "", … … 19 17 firefox: false, 20 18 msie: false, 21 netscape: false 19 netscape: false, 20 seamonkey: false 22 21 } 23 22 if (checkIt('konqueror')) { mybrowser.Konqueror = true; lbrowser = "konqueror"; OS = "Linux"; } 23 else if (checkIt('seamonkey')) { mybrowser.seamonkey = true; lbrowser = "seamonkey"; } 24 24 else if (checkIt('chrome')) { mybrowser.chrome = true; lbrowser = "chrome"; } 25 25 else if (checkIt('safari')) { mybrowser.safari = true; lbrowser = "safari"; } … … 39 39 else OS = "an unknown operating system"; 40 40 } 41 mybrowser.version = version;41 mybrowser.version = version; 42 42 mybrowser.OS = OS; 43 43 mybrowser.browser = lbrowser; 44 44 return mybrowser 45 46 47 45 }; 48 49 50 51 46 function checkIt(string) { 52 47 place = detect.indexOf(string) + 1; … … 54 49 return place; 55 50 } 51 56 52 /* 57 53 58 54 */ 59 60 61 55 konqueror = mybrowser.konqueror || false; 62 56 chrome = mybrowser.chrome || false; … … 67 61 msie = mybrowser.msie || false; 68 62 netscape = mybrowser.netscape || false; 69 70 71 72 63 var time_out = 0; 73 64 //=================================================== 74 75 65 nbpa = 0; 76 66 var Fn; … … 188 178 }) 189 179 //============================================================= 190 191 180 // jQuery(window).resize(); 192 181 }); 193 //=============================================================194 182 // $ = _$2; ; 195 183 }); 196 197 198 199 184 //========================================================= 200 201 185 jQuery.fn.extend({ 186 $: function (el, nc) { 187 a = conflit(el, nc); 188 return a; 189 }, 202 190 203 191 //---------------- luciano ------------------------------- … … 481 469 } 482 470 //==================================== 483 test_conflit = false; 471 484 472 librairies = new Array; 485 473 $_ = $; … … 535 523 })(jQuery); 536 524 537 if (test_conflit != true) { 525 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") { 526 527 } else {} 538 528 //-------------------------------------------------------------- 539 529 $_0 = $; 540 541 530 function $(element, nc0) { 542 531 if (typeof jQuery.fn.infos != "function") … … 546 535 return a; 547 536 } 548 549 550 $.isFunction = function (value) { return jQuery.isFunction(value); } 551 $.inArray = function (a, b) { return jQuery.inArray(a, b); } 552 $.error = function (a , b , c) {jQuery.error(a , b , c);} 553 554 if (typeof ($.extend) != "function") { 555 $.extend = function (a,b) { 556 return jQuery.extend(a, b); 557 } ; 558 559 560 } 561 562 if (typeof ($.ajax) != "function") { 563 $.ajax = function (origSettings) { 564 jQuery.ajax(origSettings); 565 } 566 567 568 $.parseJSON = function (msg) { 569 return jQuery.parseJSON(msg); 570 } 571 572 } 573 //============================================ 574 /* url (String): URl de la page à charger 575 * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur. 576 * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées. 577 * type (String): (optionnel) format des données renvoyées à la fonction de callback 578 */ 579 if (typeof ($.get) != "function") { 580 $.get = function (a, b, c, d) { 581 return jQuery.get(a, b, c, d); 582 } 583 } 584 if (typeof ($.post) != "function") { 585 586 $.post = function (a, b, c, d) { 587 return jQuery.post(a, b, c, d); 588 } 589 ; 590 591 } 592 593 } 594 //-------------------------------------------------------------- 537 //=== ajout des fonctions jQuery === 538 jQuery.extend($, jQuery); 539 540 541 //-------------------------------------------------------------- 542 -
extensions/Autosize/main.inc.php
r8807 r8864 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 1.4.3 44 Version: 1.4.35 5 5 Description: Ajuste l'affichage des photos en fonction de la hauteur de la fenetre de navigation 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=448 -
extensions/Autosize/template/autosize.tpl
r8792 r8864 6 6 7 7 <script type="text/javascript"> 8 8 var src_img = '{$SRC_IMG}'; 9 9 var fade_in = '{$fade_in}'; 10 10 var cl_visible = "{$cl_visible}" =="true"; … … 46 46 var check_auto_w = '{$check_auto_w}'; 47 47 var check_desc_v = '{$check_desc_v}'; 48 48 </script> 49 49 {known_script id="Affiche_script" src=$AUTOSIZE_PATH|@cat:"js/Affiche_script.js"} 50 50 <link href="{$AUTOSIZE_PATH}css/autosize.css" rel="stylesheet" type="text/css" /> -
extensions/Autosize/template/picture.tpl
r7805 r8864 20 20 21 21 </script> 22 22 <form method="post"> 23 <input id="ret_autosize" type="hidden" value="" /> 24 <input id="src_img_h" type="hidden" value="" /> 25 <input id="src_img_w" type="hidden" value="" /> 26 </form>
Note: See TracChangeset
for help on using the changeset viewer.