Changeset 7872
- Timestamp:
- Nov 25, 2010, 12:48:36 PM (13 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/autosize.inc.php
r7820 r7872 223 223 }// function cl_autosize_script_2 224 224 //============================================================ 225 static public function cl_autosize_script() 225 /* 226 * 227 */ 228 static public function cl_autosize_script() 226 229 { 227 global $template,$user,$conf,$picture ,$page; 228 //userDefManage ?? 230 global $template,$user,$conf,$picture ,$page,$cl_version; 229 231 $my_path = basename(dirname(__FILE__)).'/' ; 230 232 $my_path = dirname(__FILE__).'/'; 231 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 232 $cl_conflit = isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ; 233 $template->set_filenames( 234 array('autosize_init'=>$my_path. "template/conflit.tpl" 235 ) 236 ); 237 238 239 $theme=$user['theme']; 233 $template->set_filenames(array('autosize_init'=>$my_path. "template/conflit.tpl" ) ); 234 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 235 $cl_conflit = isset($conf['cl_conflit']) ? $conf['cl_conflit'] : 'true' ; 236 $theme=$user['theme']; 240 237 241 238 $template->assign( 242 array( 239 array( 'version' => $cl_version['version'] , 243 240 'cl_conflit' => $cl_conflit , 244 241 'theme' => $theme , … … 247 244 ); 248 245 249 if( $page['body_id'] == 'theAdminPage' ) return ; 250 251 return $template->parse( 'autosize_init', false); 252 253 246 if( $page['body_id'] == 'theAdminPage' ) return ; 247 return $template->parse( 'autosize_init', false); 254 248 }// function cl_autosize_script 255 /* 256 * 257 */ 258 static public function cl_ajuste_data($content){ 249 //=============================================================== 250 /* 251 * 252 */ 253 static public function cl_ajuste_data($content){ 259 254 global $template,$user,$conf,$picture ; 260 255 $my_path = realpath(AUTOSIZE_PATH .'/'); … … 291 286 292 287 293 288 return $content; 294 289 /* 295 290 $template->assign( 296 291 array( 297 292 'AUTOSIZE_PATH' => $my_path, 298 299 293 ) 300 294 ); 301 295 302 296 $template->parse( 'autosize_cl_init', false); 303 return $content;297 return $content; 304 298 */ 305 299 -
extensions/Autosize/js/Affiche_script.js
r7867 r7872 25 25 function Wait_pamoorama() { 26 26 if (jQuery("#pamoorama").length) { 27 28 29 30 27 mypanorama = window.myPamoorama; 28 if (!mypanorama){ 29 setTimeout("Wait_pamoorama()", 500); 30 return false ; 31 31 } 32 32 if ( mypanorama.skipInit==false) { 33 33 setTimeout("Wait_pamoorama()", 500); 34 34 return false ; 35 35 } 36 37 info_pamoorama = jQuery("#pamoorama").infos(); 38 new_width= info_pamoorama.width ; 39 40 if ( Math.abs(new_width - myPamoorama.options.width)>10 ) { 36 info_pamoorama = jQuery("#pamoorama").infos(); 37 new_width= info_pamoorama.width ; 38 if ( Math.abs(new_width - myPamoorama.options.width)>10 ) { 41 39 setTimeout("Wait_pamoorama()", 500); 42 40 return false ; … … 46 44 jQuery('#pamoorama').trigger('ON'); 47 45 48 49 50 46 } 47 } 48 nu_img = 0; 51 49 52 50 //========================================================================== 53 function Wait_Affichage() { 54 jQuery("#theImage").css({ 55 opacity: 0 56 57 } 58 ) 59 if(!jQuery().newResize()) { 51 function Wait_Affichage() { 52 if(!jQuery().newResize()) { 60 53 setTimeout("Wait_Affichage()", 500); 61 return 62 } 63 64 fade_in = parseInt(fade_in); 54 return 55 } 56 57 fade_in = parseInt(fade_in); 58 59 jQuery(Parent).animate( 60 { opacity: 1 }, fade_in, "swing" 61 , function (i) { 62 if (DEBUG == "true") { 63 bp1 = jQuery('.debug').get(nu_img); 64 if (!bp1) nu_img = 0; 65 bp1 = jQuery('.debug').get(nu_img); 66 jQuery(bp1).trigger('ON'); 67 } 68 } 69 ); 70 71 return; 65 72 if (fade_in==0 ) 66 73 { 67 jQuery( "#theImage").css({74 jQuery(Parent).css({ 68 75 opacity: 1 69 76 … … 71 78 ) 72 79 }else{ 73 jQuery( "#theImage").animate(80 jQuery(Parent).animate( 74 81 { opacity: 1 }, fade_in , "swing" 75 82 ); 76 83 } 77 nu_img += 1; 78 79 bp1 = jQuery('.debug').get(nu_img); 80 if (!bp1) nu_img = 0; 81 bp1 = jQuery('.debug').get(nu_img); 82 83 jQuery(bp1).trigger('ON'); 84 85 86 84 87 } 85 88 … … 142 145 143 146 Info_the_page = jQuery("#the_page").infos(); 144 Zone_Affichage = jQuery("#theImage").infos(); 145 146 147 148 Parent = "#theImage"; 149 Zone_Affichage = jQuery(Parent).infos(); 150 if (Zone_Affichage.width == 0) 151 Parent = Parent + "Box"; 152 Zone_Affichage = jQuery(Parent).infos(); 147 153 // 148 154 var old_window = { width: 0, height: 0 }; 149 if (Info_description("theImage")) { 150 Bandeau_bas = Info_description("theImage"); 155 156 if (Info_description(Parent)) { 157 Bandeau_bas = Info_description(Parent); 151 158 Bandeau = Bandeau_bas.top; 159 } else { 160 152 161 } 153 162 Wait_Affichage(); … … 162 171 jQuery(window).resize( 163 172 function (event, ui) { 164 165 166 event = event || window.event; 167 168 if (event.type == "resize") { 169 myevent = arguments[0] = jQuery.event.fix(event || window.event); 170 myevent.currentTarget = this; 171 // Namespaced event handlers 172 var namespaces = myevent.type.split("."); 173 myevent.type = namespaces.shift(); 174 } 175 if (typeof (init_resize) == "undefined") init_resize = false; 176 177 new_window = jQuery(window).infos(); 178 init_resize = (new_window.width == old_window.width); 179 if (init_resize == false) { 180 init_resize = Resize(); 181 } 182 init_resize = (new_window.height == old_window.height) 183 if (init_resize == false) 184 init_resize = Resize(); ; 185 186 187 173 jQuery().newResize(); 188 174 }); 189 175 … … 192 178 var pos; 193 179 var set_p = false; 194 function Resize() {195 196 jQuery().newResize();197 198 199 }200 201 180 202 181 … … 239 218 newResize: function () { 240 219 // 220 if (DEBUG == "true") { 221 nu_img += 1; 222 223 bp1 = jQuery('.debug').get(nu_img); 224 if (!bp1) nu_img = 0; 225 bp1 = jQuery('.debug').get(nu_img); 226 227 jQuery(bp1).trigger('ON'); 228 } 241 229 var chk = eval(user_status + "_enabled"); 242 230 if (!cl_visible == true) { return true; } … … 252 240 253 241 254 255 var Cadre = jQuery("#theImage").get(0); 242 Parent = "#theImage"; 243 var Cadre = jQuery(Parent).get(0); 244 if (Cadre == null) { 245 Parent = "#theImageBox"; 246 Cadre = jQuery(Parent).get(0); 247 } 248 256 249 var info_Cadre = jQuery(Cadre).infos(); 257 250 //=============== Information cadre ====== … … 267 260 268 261 269 var Zone_Affichage = jQuery("#theImage").infos(); 270 271 var info_ToolBar = jQuery("#imageToolBar").infos(); 262 263 264 272 265 var info_imageInfoBar = jQuery("#imageInfoBar").infos(); 273 266 var info_theHeader = jQuery("#theHeader").infos(); 274 267 275 268 var Zone_Affichage = jQuery(Parent).infos(); 269 var info_ToolBar = jQuery("#imageToolBar").infos(); 276 270 var marge = 0; 277 271 if (info_ToolBar.width > 0) … … 283 277 if (info_content.width > 100) { 284 278 marge_left = 0; 285 marge_right = info_imageInfoBar.margin.left + info_imageInfoBar.margin.right;279 marge_right = (info_imageInfoBar.margin.left + info_imageInfoBar.margin.right); 286 280 winwidth = info_content.width; 287 281 marge_right = info_imageInfoBar.width + marge_right; … … 290 284 else 291 285 winwidth = Zone_Affichage.width; 286 287 288 marge_right -= Zone_Affichage.borderwidth.right; 289 marge_left += Zone_Affichage.borderwidth.left; 292 290 winwidth -= (marge_right + marge_left); 293 291 if (Type_Img == "pamoorama") { … … 349 347 case "img": 350 348 351 if (!TheImg) return ;349 if (!TheImg) return true; 352 350 if (theme.match(RegExp("luciano", "g"))) { 353 351 TheImg = jQuery("#the_page #theImg"); … … 359 357 break 360 358 case "img_autre": 361 if (!TheImg) return; 359 if (!TheImg) { 360 if (DEBUG == "true") alert("TheImg=null"); 361 return true; 362 363 } 362 364 info_theImage = jQuery(TheImg).infos(); 363 365 info_the_page = jQuery("#the_page").infos(); … … 458 460 info_Licence = jQuery(".licencetag").infos(); 459 461 460 jQuery( "#theImage#theImg IMG").css("marginTop", "0px")462 jQuery(Parent + " #theImg IMG").css("marginTop", "0px") 461 463 //========== Correction en fonction du thème ============================= 462 464 var correction = 0; … … 464 466 465 467 // correction = -info_Licence.padding.top; 466 if (Type_Img == 'img') 467 { 468 if (msie == true) correction = 20; 469 else correction = 30; 470 } 468 if (Type_Img == 'img') { 469 if (msie == true) correction = 20; 470 else correction = 30; 471 } 471 472 472 473 } else if (theme.match(RegExp("Pure", "g"))) { … … 489 490 490 491 Bandeau = Bandeau_t.bottom; 491 492 492 Zone_Affichage.height = winheight - Bandeau - Marge_Basse - correction; 493 var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom; 493 if (typeof (Bandeau_bas) != "undefined") { 494 var Image_height = Zone_Affichage.height - Bandeau_bas.height - Bandeau_bas.marge.top - Bandeau_bas.marge.bottom; 495 496 497 } else { 498 var Image_height = Zone_Affichage.height; 499 } 500 501 494 502 495 503 //============================================================= … … 534 542 widthmin = parseInt(width_user); 535 543 var marges = marges_llgbo; 536 widthmin -= info_img.borderwidth.left; 537 widthmin -= info_img.borderwidth.right; 538 544 if (typeof(info_img)!="undefined") 545 { 546 widthmin -= info_img.borderwidth.left||0; 547 widthmin -= info_img.borderwidth.right || 0; 548 } 539 549 widthmin -= marges; 540 550 if (Image_width > widthmin) { … … 620 630 621 631 } 622 // jQuery( "#" +Parent + " p:not(:contains(' ')) ").remove();632 // jQuery(Parent + " p:not(:contains(' ')) ").remove(); 623 633 a0 = jQuery("area[rel!=up][rel!=prev][rel!=next]"); 624 634 a1 = jQuery("area[rel=prev]"); … … 789 799 790 800 info_frame = jQuery(myPamoorama.frame).infos(); 791 /* myPamoorama.ratio = new_width / 200; 792 jQuery("#pamoorama_frame").width(myPamoorama.ratio); 793 jQuery("#pamoorama_frame").css("width", myPamoorama.ratio + "px"); 794 jQuery("#pamoorama_footer img").width(200) 795 jQuery("#pamoorama_footer img").css({ width: "200px", height: info_pamoorama_footer.height+"px" }); 796 jQuery("#pamoorama_footer").width(new_width) ; 797 jQuery("#pamoorama_footer").css({width:new_width+"px"}) 798 799 jQuery(TheImg).height(img_finale.height); 800 jQuery(TheImg).width(img_finale.width); 801 jQuery(TheImg).css("height", img_finale.height + "px "); 802 jQuery(TheImg).css("width", img_finale.width + "px "); 803 */ 801 804 802 zoom = Image_height / img_height; 805 806 803 807 804 … … 823 820 } 824 821 825 826 jQuery("#navThumbPrev").css({ overflow: "hidden" 827 }); 828 jQuery("#navThumbNext").css({ 829 overflow: "hidden" 830 }); 822 info_frame = Zone_Affichage; 823 824 jQuery("#navThumbPrev").css({ overflow: "hidden" }); 825 jQuery("#navThumbNext").css({ overflow: "hidden" }); 831 826 try { 832 827 if (theme.match(RegExp("gally", "gi"))) { … … 878 873 jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); 879 874 } 880 875 if (DEBUG == "true") { 876 // jQuery(Parent).height(info_frame.height +info_description.height +"px"); 877 // info_Cadre = jQuery(Parent).infos(); 878 879 // jQuery("#Debug3").css({ top: info_Cadre.top + "px", height: info_Cadre.height + "px" }); //blue 880 jQuery("#Debug5").css({ left: info_frame.left + "px", width: info_frame.width + "px", height: info_frame.height + "px" }); //red 881 jQuery("#Debug4").css({ top: info_frame.bottom - info_description.height + "px" }); //green 882 } 881 883 882 884 return true; … … 936 938 } 937 939 938 info_theImage = jQuery( "#theImage").infos();940 info_theImage = jQuery(Parent).infos(); 939 941 940 942 941 943 if (info_theImage.position == "relative") { 942 944 //--- passage relative ==> static ===/ 943 jQuery( "#theImage").css("position", "static");944 info_theImage = jQuery( "#theImage").infos();945 jQuery(Parent).css("position", "static"); 946 info_theImage = jQuery(Parent).infos(); 945 947 946 948 } 947 949 if (info_theImage.position == "absolute") { 948 950 //--- passage absolute ==> static ===/ 949 jQuery( "#theImage").css("position", "static");950 info_theImage = jQuery( "#theImage").infos();951 jQuery(Parent).css("position", "static"); 952 info_theImage = jQuery(Parent).infos(); 951 953 952 954 } … … 974 976 function Info_description(Parent) { 975 977 976 // jQuery( "#" +Parent + " p:not(:contains(' ')) ").remove();978 // jQuery(Parent + " p:not(:contains(' ')) ").remove(); 977 979 //============================================================================= 978 980 info_description = { top: 0, bottom: 0, height: 0 }; … … 984 986 } else if (jQuery("#pamoorama").length) { 985 987 Type_Img = "pamoorama"; 986 } else if (jQuery( "#theImageembed").length > 0) {988 } else if (jQuery(Parent +" embed").length > 0) { 987 989 Type_Img = "embed"; 988 990 } else if (jQuery("#map").length) { … … 991 993 } else if (jQuery("#Panorama").length) { 992 994 Type_Img = "panorama"; 993 } else if (jQuery( "#theImage").find("img").length > 0) {995 } else if (jQuery(Parent).find("img").length > 0) { 994 996 Type_Img = "img"; 997 } else if (jQuery(Parent+"Box").find("img").length > 0) { 998 Type_Img = "img"; 999 Parent = Parent + "Box"; 995 1000 } else if (jQuery("img").length > 0) { 996 1001 Type_Img = "img_autre"; … … 1001 1006 1002 1007 1003 Bandeau_t = Info_entete( "theImage")1008 Bandeau_t = Info_entete(Parent) 1004 1009 Bandeau = Bandeau_t.img_top; 1005 1010 llgboframe = jQuery("#gbo div:first"); … … 1017 1022 1018 1023 if (theme.match(RegExp("simple", "gi"))) { 1019 jQuery( "#" +Parent).css({ padding: "0px",1024 jQuery(Parent).css({ padding: "0px", 1020 1025 marginLeft: "0px", 1021 1026 marginRight: "auto", … … 1030 1035 } 1031 1036 1032 // jQuery( "#" +Parent + " p").css({ padding: "0px", margin: "0px " });1037 // jQuery(Parent + " p").css({ padding: "0px", margin: "0px " }); 1033 1038 if (theme.match(RegExp("luciano", "g"))) { 1034 TheImg = jQuery( "#" +Parent + " #theImg img");1039 TheImg = jQuery(Parent + " #theImg img"); 1035 1040 info_img = jQuery(TheImg).infos(); 1036 1041 … … 1062 1067 1063 1068 1064 } else if (jQuery( "#theImageembed").length > 0) {1069 } else if (jQuery(Parent +" embed").length > 0) { 1065 1070 1066 TheImg = jQuery( "#theImageembed");1071 TheImg = jQuery(Parent +" embed"); 1067 1072 info_img = jQuery(TheImg).infos(); 1068 1073 … … 1083 1088 1084 1089 } else { 1085 TheImg = jQuery( "#" +Parent + " img");1090 TheImg = jQuery(Parent + " img"); 1086 1091 TheImg = Get_Img_Maxi(TheImg); 1087 1092 info_img = jQuery(TheImg).infos(); … … 1128 1133 1129 1134 1130 jQuery( "#" +Parent + " p").each(function (i) {1135 jQuery(Parent + " p").each(function (i) { 1131 1136 para = jQuery(this).infos(); 1132 1137 if (para.height > 0) { … … 1140 1145 }); 1141 1146 //===================== Recherche lmt Bas =====(bleu debug3)==================== 1142 info_licencetag = jQuery( "#" +Parent + ".licencetag").infos();1147 info_licencetag = jQuery(Parent + ".licencetag").infos(); 1143 1148 jQuery(".licencetag").css("position", "static"); 1144 1149 … … 1161 1166 1162 1167 //======================================================== 1163 info_table = jQuery( "#" +Parent + " Table").infos();1168 info_table = jQuery(Parent + " Table").infos(); 1164 1169 if (info_table.height > 0) { 1165 1170 info_table.bottom += info_table.margin.top + info_table.margin.bottom; … … 1229 1234 css: { 1230 1235 color:"black", 1231 opacity: 0.5, 1232 filter: 'alpha(opacity:50)', 1236 opacity: "0.5", 1233 1237 position: "absolute", 1234 1238 height: infos.height||100 +"px", … … 1288 1292 jQuery('#pamoorama').live('ON', function (e) { 1289 1293 jQuery(jQuery('.debug').get(1)).trigger('ON'); 1290 Bandeau_bas = Info_description( 'theImage');1294 Bandeau_bas = Info_description(Parent); 1291 1295 Bandeau = Bandeau_bas.top; 1292 1296 }); … … 1326 1330 1327 1331 // Add 10 testing debugs to start with 1328 1332 1329 1333 if (DEBUG == "true") { 1330 1334 for (var i = 0; i < 10; i++) { 1331 1335 jQuery('#adddebugs').click(); 1332 1336 } 1333 jQuery(jQuery('. light').get(8)).click();1337 jQuery(jQuery('.debug').get(8)).click(); 1334 1338 1335 1339 } -
extensions/Autosize/js/conflit.js
r7867 r7872 15 15 // jQuery est chargé 16 16 } 17 17 try { 18 Conflit = { version: Version }; 19 } catch (e) { 20 21 } 18 22 //=================================================== 19 23 var detect = navigator.userAgent.toLowerCase(); … … 544 548 function save_framework(page) { 545 549 $_ = $; 550 Conflit = { version: Version }; 546 551 return 547 552 -
extensions/Autosize/main.inc.php
r7867 r7872 2 2 /* 3 3 Plugin Name: AutoSize 4 Version: 1.3. 7.44 Version: 1.3.8 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 … … 13 13 define( 'AUTOSIZE_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' ); 14 14 include_once(AUTOSIZE_PATH.'autosize.inc.php'); 15 global $cl_version,$cl_plugin ; 16 //=================================================================== 17 $path = AUTOSIZE_PATH; 18 $plg_data = implode( '', file($path.'main.inc.php') ); 19 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) 20 { 21 $plugin['name'] = trim( $val[1] ); 22 } 23 if (preg_match("|Version: (.*)|", $plg_data, $val)) 24 { 25 $plugin['version'] = trim($val[1]); 26 } 27 if ( preg_match("|Plugin URI: (.*)|", $plg_data, $val) ) 28 { 29 $plugin['uri'] = trim($val[1]); 30 } 31 if ($desc = load_language('description.txt', $path.'/', array('return' => true))) 32 { 33 $plugin['description'] = trim($desc); 34 } 35 elseif ( preg_match("|Description: (.*)|", $plg_data, $val) ) 36 { 37 $plugin['description'] = trim($val[1]); 38 } 39 if ( preg_match("|Author: (.*)|", $plg_data, $val) ) 40 { 41 $plugin['author'] = trim($val[1]); 42 } 43 if ( preg_match("|Author URI: (.*)|", $plg_data, $val) ) 44 { 45 $plugin['author uri'] = trim($val[1]); 46 } 47 if (!empty($plugin['uri']) and strpos($plugin['uri'] , 'extension_view.php?eid=')) 48 { 49 list( , $extension) = explode('extension_view.php?eid=', $plugin['uri']); 50 if (is_numeric($extension)) $plugin['extension'] = $extension; 51 } 52 // IMPORTANT SECURITY ! 53 $plugin = array_map('htmlspecialchars', $plugin); 54 $cl_version = $plugin; 55 //============================================================================ 15 56 $autosize_controler = new autosize_controler(); 16 57 17 58 add_event_handler('get_admin_plugin_menu_links', array(&$autosize_controler,'cl_autosize_admin') ); 18 59 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_affiche'), 40 ); 60 19 61 add_event_handler('loc_after_page_header', array(&$autosize_controler, 'cl_autosize_script'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2); 20 62 … … 23 65 add_event_handler('render_element_content', 24 66 array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 ); 67 25 68 //add_event_handler('loc_end_index',array(&$autosize_controler, 'cl_autosize_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 26 69 -
extensions/Autosize/template/conflit.tpl
r7805 r7872 1 1 {html_head} 2 2 <!--- Autosize/template/confilt.tpl (head) ---> 3 3 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" now=1} 4 4 {known_script id="dimensions" src=$AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js"} 5 5 {if $cl_conflit == 'true'} 6 7 6 {known_script id="conflit_script" src=$AUTOSIZE_PATH|@cat:"js/conflit.js"} 8 7 {/if} 9 8 10 9 … … 12 11 var DEBUG = '{$DEBUG}'; 13 12 var theme = '{$theme}'; 13 var Version = '{$version}'; 14 14 </script> 15 15 <!---FIN Autosize/template/confilt.tpl (/head) ---> 16 16 {/html_head} 17 <!--- Autosize/template/confilt.tpl (body) ---> 18 17 <!--- Autosize/template/confilt.tpl (body) ---> 19 18 <!---FIN Autosize/template/confilt.tpl (body) --->
Note: See TracChangeset
for help on using the changeset viewer.