Changeset 10845 for extensions
- Timestamp:
- May 11, 2011, 12:13:49 PM (14 years ago)
- Location:
- extensions/Autosize
- Files:
-
- 12 edited
- 13 moved
Legend:
- Unmodified
- Added
- Removed
-
extensions/Autosize/admin/admin_autosize.php
r8912 r10845 83 83 84 84 $my_base_url = get_admin_plugin_menu_link(__FILE__); 85 load_language(' lang', AUTOSIZE_PATH );85 load_language('plugin.lang', AUTOSIZE_PATH ); 86 86 // ************************************************************************* 87 87 // | Sélection de l'onglet | … … 121 121 122 122 $message=" 123 <script id='dimensions' src='./plugins/Autosize/js/ jquery.dimensions.js'></script>123 <script id='dimensions' src='./plugins/Autosize/js/autosize.dimensions.js'></script> 124 124 <script id='Affiche_script' src='./plugins/Autosize/js/Affiche_script.js'></script> 125 125 <fieldset id='fieldset'> -
extensions/Autosize/admin/template/admin.tpl
r10347 r10845 4 4 {include file= $AUTOSIZE_PATH_ABS|@cat:'admin/template/header_2_2.tpl'} 5 5 {/if} 6 {html_head} 7 <script type="text/javascript"> 6 {html_head} 7 {literal} 8 <style type="text/css"> 9 .td_autosize { 10 width: 25%; 11 font-style: italic; 12 } 13 </style> 14 {/literal} 15 <script type="text/javascript"> 16 var src_img = '{$SRC_IMG}'; 8 17 var fade_in = '{$fade_in}'; 9 var DEBUG = '{$DEBUG}'; 10 var thumbnail = '{$thumbnail}'; 11 var theme = '{$theme}'; 12 var cl_version = '{$cl_version}'; 13 var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut 14 var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut 15 var img_width = '{$IMG_WIDTH }'; 16 var img_height = '{ $IMG_HEIGHT }'; 17 18 var marge_basse = '{ $MARGE_BASSE }'; 19 var echelle_max = '{ $ECHELLE_MAX }'; 20 var mini_width = '{ $MINI_WIDTH }'; 21 var mini_height = '{ $MINI_HEIGHT }'; 22 var mini_width2 = '{ $MINI_WIDTH2 }'; 23 var mini_height2 = '{ $MINI_HEIGHT2 }'; 24 var webmaster_width = '{$webmaster_width }'; 25 var webmaster_height = '{ $webmaster_height }'; 26 var admin_width = '{ $admin_width }'; 27 var admin_height = '{ $admin_height }'; 28 var generic_width = '{ $generic_width }'; 29 var generic_height = '{ $generic_height }'; 30 var guest_width = '{ $guest_width }'; 31 var guest_height = '{$guest_height}'; 32 var normal_width = '{$normal_width}'; 33 var normal_height = '{$normal_height}'; 34 var user_status = '{$user_status}'; 35 36 var check_auto_w = '{$check_auto_w}'; 37 38 var check_desc_v = '{$check_desc_v}'; 39 check_desc_v = (check_desc_v == 'checked="checked"'); 40 </script> 18 19 var thumbnail = '{$thumbnail}'; 20 var scaled_width = '{$SCALED_WIDTH}'; // valeur par defaut 21 var scaled_height = '{$SCALED_HEIGHT}'; // valeur par defaut 22 var img_width='{$IMG_WIDTH }'; 23 var img_height = '{ $IMG_HEIGHT }'; 24 25 var marge_basse='{ $MARGE_BASSE }'; 26 var echelle_max='{ $ECHELLE_MAX }'; 27 var mini_width='{ $MINI_WIDTH }'; 28 var mini_height = '{ $MINI_HEIGHT }'; 29 var mini_width2 = '{ $MINI_WIDTH2 }'; 30 var mini_height2 = '{ $MINI_HEIGHT2 }'; 31 32 var webmaster_width='{$webmaster_width }'; 33 var webmaster_height = '{ $webmaster_height }'; 34 var webmaster_enabled = '{ $webmaster_enabled }'; 35 36 var admin_width='{ $admin_width }'; 37 var admin_height = '{ $admin_height }'; 38 var admin_enabled = '{ $admin_enabled }'; 39 40 var generic_width='{ $generic_width }'; 41 var generic_height = '{ $generic_height }'; 42 var generic_enabled = '{ $generic_enabled }'; 43 44 var guest_width='{ $guest_width }'; 45 var guest_height = '{$guest_height}'; 46 var guest_enabled = '{ $guest_enabled }'; 47 48 var normal_width='{$normal_width}'; 49 var normal_height = '{$normal_height}'; 50 var normal_enabled = '{ $normal_enabled }'; 51 52 var user_status='{$user_status}'; 53 54 var check_auto_w = '{$check_auto_w}'; 55 56 var check_desc_v = ('{$check_desc_v}' == 'checked="checked"') ? true : false; 57 </script> 41 58 42 59 … … 87 104 <fieldset> 88 105 <legend class="cluetip" title="{'cl_autosize_config_title_1'|@translate}|{'cl_autosize_hlp_line1'|@translate}">{'cl_autosize_config_title_1'|@translate}</legend> 89 <td>{'User status'|@translate}</td> 90 91 <td>{'cl_autosize_height'|@translate}</td> 92 <td style="visibility:visible">{'cl_autosize_width'|@translate} 93 <input type="checkbox" name="check_auto_w" value="on" {$check_auto_w} /></td> 94 <td style="visibility:visible">{'cl_autosize_enabled'|@translate} 95 </td> 96 97 <tr> 106 <td class="td_autosize pluginBox">{'User status'|@translate}</td> 107 <td class="td_autosize pluginBox">{'cl_autosize_height'|@translate}</td> 108 <td class="td_autosize pluginBox">{'cl_autosize_width'|@translate} 109 <input type="checkbox" id="check_auto_w" name="check_auto_w" value="on" {$check_auto_w} /></td> 110 <td class="td_autosize pluginBox">{'cl_autosize_enabled'|@translate}</td> 111 112 <tr name="webmaster_enabled"> 98 113 <td>{'user_status_webmaster'|@translate}</td> 99 114 <td><input name="webmaster_height" id="Text7" type="text" value ="{$webmaster_height}" /></td> 100 <td style="visibility:{$visible_w}"><input name="webmaster_width" id="webmaster_width" type="text" value="{$webmaster_width}" /></td>115 <td><input name="webmaster_width" id="webmaster_width" type="text" value="{$webmaster_width}" /></td> 101 116 <td ><input name="webmaster_enabled" id="webmaster_enabled" type="checkbox" value ="on" {$webmaster_enabled} /></td> 102 117 </tr> 103 <tr >118 <tr name="admin_enabled"> 104 119 <td>{'user_status_admin'|@translate}</td> 105 120 <td><input name="admin_height" id="admin_height" type="text" value ="{$admin_height}" /></td> 106 <td style="visibility:{$visible_w}"><input name="admin_width" id="admin_width" type="text" value ="{$admin_width}" /></td>107 108 </tr> 109 <tr >121 <td ><input name="admin_width" id="admin_width" type="text" value ="{$admin_width}" /></td> 122 <td ><input name="admin_enabled" id="admin_enabled" type="checkbox" value ="on" {$admin_enabled} /></td> 123 </tr> 124 <tr name="generic_enabled"> 110 125 <td>{'user_status_generic'|@translate}</td> 111 126 <td><input name="generic_height" id="Text1" type="text" value ="{$generic_height}" /></td> 112 <td style="visibility:{$visible_w}"><input name="generic_width" id="generic_width" type="text" value ="{$generic_width}" /></td>127 <td><input name="generic_width" id="generic_width" type="text" value ="{$generic_width}" /></td> 113 128 <td ><input name="generic_enabled" id="generic_enabled" type="checkbox" value ="on" {$generic_enabled} /></td> 114 129 </tr> 115 <tr >130 <tr name="guest_enabled"> 116 131 <td>{'user_status_guest'|@translate}</td> 117 132 <td><input name="guest_height" id="Text3" type="text" value ="{$guest_height}" /></td> 118 <td style="visibility:{$visible_w}"><input name="guest_width" id="guest_width" type="text" value ="{$guest_width}" /></td>133 <td><input name="guest_width" id="guest_width" type="text" value ="{$guest_width}" /></td> 119 134 <td ><input name="guest_enabled" id="guest_enabled" type="checkbox" value ="on" {$guest_enabled} /></td> 120 135 </tr> 121 <tr >136 <tr name="normal_enabled"> 122 137 <td>{'user_status_normal'|@translate}</td> 123 138 <td><input name="normal_height" id="Text5" type="text" value ="{$normal_height}" /></td> 124 <td style="visibility:{$visible_w}"><input name="normal_width" id="normal_width" type="text" value ="{$normal_width}" /></td>125 139 <td><input name="normal_width" id="normal_width" type="text" value ="{$normal_width}" /></td> 140 <td ><input name="normal_enabled" id="normal_enabled" type="checkbox" value ="on" {$normal_enabled} /></td> 126 141 </tr> 127 142 -
extensions/Autosize/autosize.inc.php
r10561 r10845 55 55 $file =AUTOSIZE_PATH_ABS.'template/header_2_2.tpl' ; 56 56 $template->set_filenames(array('autosize_init_header'=> $file )); 57 $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) ); 58 59 $DEBUG = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : "false" ; 57 $template->set_filenames(array('autosize_init'=>AUTOSIZE_PATH_ABS. "template/conflit.tpl" ) ); 58 //================================================================================================= 59 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 60 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 61 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 62 //================================================================================================= 63 60 64 $autosize_parametres = cl_autosize_Get_Options() ; 61 65 $theme=$user['theme']; … … 68 72 69 73 'theme' => $theme , 70 'DEBUG ' => $DEBUG,74 'DEBUG_autosize' => $DEBUG_autosize , 71 75 'AUTOSIZE_PATH' => str_replace("../","",AUTOSIZE_PATH) , 72 76 'AUTOSIZE_PATH_ABS' => AUTOSIZE_PATH_ABS, … … 79 83 //=========================================================== 80 84 /* 81 * cl_autosize_script_2 85 * cl_autosize_script_2(admin) 82 86 */ 83 87 static public function cl_autosize_script_2() … … 87 91 88 92 $my_path = dirname(__FILE__).'/'; 89 $DEBUG = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : "false" ; 93 //================================================================================================= 94 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 95 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 96 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 97 //================================================================================================= 98 99 90 100 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 91 101 $theme=$user['theme']; … … 99 109 100 110 'theme' => $theme , 101 'DEBUG ' => $DEBUG,111 'DEBUG_autosize' => $DEBUG_autosize , 102 112 'AUTOSIZE_PATH' => AUTOSIZE_PATH 103 113 ) … … 143 153 global $conf,$lang ,$user,$userdata; 144 154 if ('kardon' == $user['theme'] and isset($_GET['slideshow'])) return ; 145 load_language(' lang', AUTOSIZE_PATH);155 load_language('plugin.lang', AUTOSIZE_PATH); 146 156 $my_path = dirname(__FILE__).'/'; 147 157 if (isset( $page['body_id']) && $page['body_id']=='thePicturePage' ) { … … 173 183 $template->assign('cl_autosize_button', 174 184 array( 'cl_autosize_info' => 'cl_autosize_info' , 175 'cl_autosize_info_2' => 'cl_autosize_info_2' ,176 'URL' => $_SERVER['REQUEST_URI'] ,177 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png',178 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png'185 'cl_autosize_info_2' => 'cl_autosize_info_2' , 186 'URL' => $_SERVER['REQUEST_URI'] , 187 'ICON2' => AUTOSIZE_PATH . 'icons/button-maximize.png', 188 'ICON' => AUTOSIZE_PATH . 'icons/button-minimize.png' 179 189 ) 180 190 -
extensions/Autosize/css/autosize.css
r9007 r10845 41 41 42 42 } 43 #imageContainer{ 44 height:1400px; 43 44 45 #theImage { 46 47 45 48 } 49 #content { 50 51 52 } 53 #imageContainer { 54 55 56 } 57 #navThumbNext, #navThumbPrev{ height:200px; 58 59 60 } 61 .navThumbNextBg{ 62 right:0px; 63 } 64 #navThumbNextContainer { 65 right:90px; 66 } -
extensions/Autosize/include/affiche.php
r10445 r10845 10 10 $cl_plugin=isset($cl_plugin)?$cl_plugin:""; 11 11 $cl_visible=isset($conf['cl_auto']) ? $conf['cl_auto'] : 'true' ; 12 $DEBUG=isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 13 $DEBUG= isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG ; 14 15 $my_path = AUTOSIZE_PATH_ABS; 16 $theme=$user['theme']; 17 $user_status = $user['status'] ; 12 //================================================================================================= 13 $DEBUG_autosize = isset($_POST['cl_debug_conflit']) ? $_POST['cl_debug_conflit'] : "false" ; 14 $DEBUG_autosize = isset($_GET['cl_debug_conflit']) ? $_GET['cl_debug_conflit'] : $DEBUG_autosize ; 15 $DEBUG_autosize = isset($conf['cl_debug_conflit']) ? $conf['cl_debug_conflit'] : $DEBUG_autosize ; 16 //================================================================================================= 17 $my_path = AUTOSIZE_PATH_ABS; 18 $theme=$user['theme']; 19 $user_status = $user['status'] ; 18 20 19 21 $template->assign( array( … … 28 30 $template->assign( 29 31 array( 30 'DEBUG ' => $DEBUG,32 'DEBUG_autosize' => $DEBUG_autosize , 31 33 'cl_visible' => $cl_visible, 32 34 'cl_version' => $cl_version, -
extensions/Autosize/js/Affiche_script.js
r10787 r10845 61 61 function (i) { 62 62 jQuery(Parent).css({ opacity: "1" }); 63 if (DEBUG == "true") {63 if (DEBUG_autosize == "true") { 64 64 bp1 = jQuery('.debug').get(nu_img); 65 65 if (!bp1) nu_img = 0; … … 286 286 rapport = -1; 287 287 marges_llgbo = 0; 288 pos = 0; 288 289 289 //============================================================= 290 290 Type_Img = ""; … … 365 365 // 366 366 //if (options.imageAutosize) return true ;stripped 367 if (DEBUG == "true") {367 if (DEBUG_autosize == "true") { 368 368 nu_img += 1; 369 369 … … 533 533 case "img_autre": 534 534 if (!TheImg) { 535 if (DEBUG == "true") alert("TheImg=null");535 if (DEBUG_autosize == "true") alert("TheImg=null"); 536 536 return true; 537 537 … … 1036 1036 if (typeof (currentTab) == "undefined") inittoolbar(); 1037 1037 else initializeImageMode("resize"); 1038 } else { 1039 tp = gallyPP.getImageProp(); 1040 if (typeof (GallyPP) == "function") 1041 gallyPP = new GallyPP(); 1042 1043 iph= jQuery("#imageHeaderBar").infos(); 1044 jQuery("#imageToolBar").css({ top: iph.bottom + "px", position: "absolute" }); 1045 1038 1046 } 1039 1047 //=========================================================================== 1040 1048 1041 1049 if (jQuery("#navThumbPrev").length > 0) { 1042 jQuery("#navThumbPrev").css({ height: info_img.height+ "px",1043 1044 1050 jQuery("#navThumbPrev").css({ left: 20 + "px", 1051 overflow: "hidden" 1052 }); 1045 1053 1046 1054 } 1047 1055 if (jQuery("#navThumbNext").length > 0) { 1048 jQuery("#navThumbNext").css({ height: info_img.height + "px", 1049 overflow: "hidden" 1050 }); 1051 1052 } 1053 //jQuery("#gbo").width(); 1054 jQuery(Cadre).width(img_finale.width + marges_llgbo); 1056 jQuery("#navThumbNext").css({ right: 20 + "px", 1057 overflow: "hidden" 1058 }); 1059 1060 } 1061 */ 1062 1063 //============================================================================= 1064 1055 1065 1056 1066 if (!theme.match(RegExp("lapis", "gi"))) { … … 1077 1087 1078 1088 } 1079 // --- rglage de la hauteur de page en fonction du copyright----------- 1080 if (typeof (pos) == "undefined") pos = jQuery("#copyright").infos(); 1081 if (pos != jQuery("#copyright").infos()) 1082 pos = jQuery("#copyright").infos(); 1089 // --- réglage de la hauteur de page en fonction du copyright----------- 1090 if (typeof (pos_copyright) == "undefined") pos_copyright = jQuery("#copyright").infos(); 1091 1083 1092 if (theme.match(RegExp("stripped", "gi"))) { 1084 1093 var TitleBox = jQuery("#imageTitleContainer"); 1085 1094 if (TitleBox.length != 0) TitleBox.css("width", img_finale.width + "px"); 1086 1095 } else { 1087 if (pos.top > 100) 1088 jQuery("#the_page").height(pos.top); 1089 1090 } 1096 if (pos_copyright.top > 100) { 1097 jQuery("#the_page").height(pos_copyright.top); 1098 } 1099 } 1100 1091 1101 1092 1102 if (!theme.match(RegExp("luciano", "gi"))) { 1093 1094 1095 1103 jQuery("#linkNext").css({ height: "80px", width: "200px", overflow: "hidden" }); 1104 jQuery("#linkPrev").css({ height: "80px", width: "200px", overflow: "hidden" }); 1105 jQuery(".navThumb img").css({ height: "80px", width: "", overflow: "hidden" }); 1096 1106 } 1097 1107 info_frame = jQuery(Cadre).infos(); … … 1104 1114 1105 1115 } else { 1106 pos = "absolute"; 1116 1107 1117 t1 = info_frame.top; 1108 1118 l1 = info_frame.left; 1109 info_theImageBox = jQuery(Parent).infos(); 1119 info_theImageBox = jQuery(Parent).infos(); //theImage 1110 1120 } 1111 1121 … … 1113 1123 info_theImageBox.top = t1; 1114 1124 info_theImageBox.left = l1; 1115 info_theImageBox.pos= "absolute";1125 // info_theImageBox.position = "absolute"; 1116 1126 Window_Affichage = info_theImageBox; 1117 if (DEBUG == "true") {1127 if (DEBUG_autosize == "true") { 1118 1128 // jQuery(Cadre).css("border", "solid green"); 1119 1129 1120 jQuery("#Debug5").css({ background: " transparent",1121 position: pos,1130 jQuery("#Debug5").css({ background: "red", 1131 position: "absolute", 1122 1132 border: "green solid 2px", 1123 1133 textAlign: align_auto, 1124 margin: Window_Affichage.margin.margin,1134 margin: "auto", 1125 1135 top: Window_Affichage.top + "px", 1126 1136 left: Window_Affichage.left + "px", … … 1328 1338 marginRight: "4px", 1329 1339 marginTop: "0px", 1330 marginBottom: "0px", position: "relative" 1340 marginBottom: "0px", 1341 position: "relative" 1331 1342 }); 1332 1343 … … 1486 1497 //==================================================== 1487 1498 function Debug_pos() { 1488 if (DEBUG == "true") {1499 if (DEBUG_autosize == "true") { 1489 1500 1490 1501 jQuery("[id ^='Debug']").show(); … … 1520 1531 1521 1532 jQuery(function () { 1533 //'gallyInterfaceReady' 1534 jQuery(Document).live('gallyInterfaceReady',function () { 1535 alert("Clic sur a#test1."); 1536 }); 1522 1537 jQuery('#pamoorama').live('ON', function (e) { 1523 1538 jQuery(jQuery('.debug').get(1)).trigger('ON'); … … 1566 1581 1567 1582 // Add 10 testing debugs to start with 1568 jQuery(window).load(function () {1569 DEBUG = (typeof DEBUG != "undefined") ? DEBUG: "false";1570 if (DEBUG == "true") {1583 jQuery(window).load(function () { 1584 DEBUG_autosize = (typeof DEBUG_autosize != "undefined") ? DEBUG_autosize : "false"; 1585 if (DEBUG_autosize == "true") { 1571 1586 for (var i = 0; i < 10; i++) { 1572 1587 jQuery('#adddebugs').click(); -
extensions/Autosize/js/autosize.dimensions.js
r10844 r10845 14 14 */ 15 15 (function (jQuery) { 16 17 18 19 20 16 jQuery.dimensions = { version: '1.3' }; 17 /* 18 * Interception Height, Width 19 */ 20 jQuery.each(['Height', 'Width'], 21 21 function (i, name) { 22 23 24 22 jQuery.fn['inner' + name] = function () { 23 if (!this[0]) return; 24 var torl = name == 'Height' ? 'Top' : 'Left', 25 25 borr = name == 'Height' ? 'Bottom' : 'Right'; 26 27 28 29 30 31 26 return this.is(':visible') ? this[0]['client' + name] : num(this, name.toLowerCase()) + num(this, 'padding' + torl) + num(this, 'padding' + borr); 27 }; 28 29 jQuery.fn['outer' + name] = function (options) { 30 if (!this[0]) return; 31 var torl = name == 'Height' ? 'Top' : 'Left', 32 32 borr = name == 'Height' ? 'Bottom' : 'Right'; 33 34 35 36 33 options = options || false; 34 options = jQuery.extend({ margin: options }); 35 36 var val = this.is(':visible') ? this[0]['offset' + name] : 37 37 num(this, 38 38 name.toLowerCase()) + … … 43 43 44 44 ; 45 46 45 return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0); 46 }; 47 47 }); 48 /* 49 * 50 */ 51 jQuery.each(['Left', 'Top'], 52 function (i, name) { 53 jQuery.fn['scroll' + name] = function (val) { 54 if (!this[0]) return; 55 return val != undefined ? this.each(function () { 56 this == window || this == document ? window.scrollTo(name == 'Left' ? val : $(window)['scrollLeft'](), 57 name == 'Top' ? val : $(window)['scrollTop']()) : this['scroll' + name] = val; 58 }) : this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || jQuery.boxModel && document.documentElement['scroll' + name] || document.body['scroll' + name] : this[0]['scroll' + name]; 59 }; 60 //================================================ 61 jQuery.fn['absolute' + name] = function (val) { 62 if (!this[0]) return; 63 a = jQuery(this[0]); 64 m = 0; 65 while (a.length > 0) { 66 val = jQuery(a).infos(); 67 if (val.position != "absolute") { 68 m += name == 'Left' ? val.left : val.top; 69 m += name == 'Left' ? val.margin.left : val.margin.top; 70 m += name == 'Left' ? val.margin.right : val.margin.bottom; 71 m += name == 'Left' ? val.borderwidth.left : val.borderwidth.top; 72 // m += name == 'Left' ? val.borderwidth.right : val.borderwidth.bottom; 73 // m += name == 'Left' ? val.padding.left : val.padding.top; 74 // m += name == 'Left' ? val.padding.right : val.padding.bottom; 75 a = jQuery(a).offsetParent(); 76 } else 77 break; 78 79 } 80 //306 81 82 83 return m; 84 85 86 }; 87 88 89 }); 90 //===================================================== 91 jQuery.fn.extend({ 92 93 infos: function () { 94 var width = 0, height = 0; 95 var elem = jQuery(this).get(0); 96 97 98 var Left = 0, Top = 0, offset, parentOffset, offsetParent, results; 99 var borderwidth = { width: "0 0 0 0", 100 top: 0, 101 left: 0, 102 right: 0, 103 bottom: 0 104 } 105 var padding = { padding: "0 0 0 0", 106 top: 0, 107 left: 0, 108 right: 0, 109 bottom: 0 110 }; 111 var margin = { margin: "0 0 0 0", 112 top: 0, 113 left: 0, 114 right: 0, 115 bottom: 0 116 }; 117 //===================================================================== 118 myposition = ""; 119 results = { 120 position: "", 121 top: 0, 122 left: 0, 123 width: 0, 124 height: 0, 125 right: 0, 126 bottom: 0, 127 borderwidth: borderwidth, 128 padding: padding, 129 margin: margin, id: "", nodeName: "" 130 }; 131 ; 132 if (elem) { 133 id = ""; nodeName = ""; 134 if (elem.id) id = elem.id; 135 if (elem.nodeName) nodeName = elem.nodeName; 136 137 138 if (elem == window) { 139 140 myposition = ""; 141 width = jQuery(elem).width(); 142 height = jQuery(elem).height(); 143 } else { 144 145 Css = jQuery(elem).getStyles(elem); 146 myposition = Css.position.toString() || ""; 147 148 149 width = jQuery(elem).outerWidth(); 150 height = jQuery(elem).outerHeight(); 151 152 153 borderwidth.left = jQuery(elem).Get_Val_int(Css.borderLeftWidth, "", "", 'borderLeftWidth'); 154 borderwidth.right = jQuery(elem).Get_Val_int(Css.borderRightWidth, "", "", 'borderRightWidth'); 155 borderwidth.top = jQuery(elem).Get_Val_int(Css.borderTopWidth, "", "", 'borderTopWidth'); 156 borderwidth.bottom = jQuery(elem).Get_Val_int(Css.borderBottomWidth, "", "", 'borderBottomWidth'); 157 try { 158 borderwidth.width = Css.borderWidth; 159 } catch (e) { 160 borderwidth.width = '"' + borderwidth.left + ' ' + borderwidth.top + ' ' + borderwidth.right + ' ' + borderwidth.bottom + '"'; 161 } 162 163 164 165 margin.left = jQuery(elem).Get_Val_int(Css.marginLeft, "", "", 'marginLeft'); 166 margin.right = jQuery(elem).Get_Val_int(Css.marginRight, "", "", 'marginRight'); 167 margin.top = jQuery(elem).Get_Val_int(Css.marginTop, "", "", 'marginTop'); 168 margin.bottom = jQuery(elem).Get_Val_int(Css.marginBottom, "", "", 'marginBottom'); 169 170 171 try { 172 margin.margin = Css.margin; 173 } catch (e) { 174 margin.margin = '"' + margin.left + ' ' + margin.top + ' ' + margin.right + ' ' + margin.bottom + '"'; 175 } 176 177 178 padding.left = jQuery(elem).Get_Val_int(Css.paddingLeft, "", "", 'paddingLeft'); 179 padding.right = jQuery(elem).Get_Val_int(Css.paddingRight, "", "", 'paddingRight'); 180 padding.top = jQuery(elem).Get_Val_int(Css.paddingTop, "", "", 'paddingTop'); 181 padding.bottom = jQuery(elem).Get_Val_int(Css.paddingBottom, "", "", 'paddingBottom'); 182 183 try { 184 padding.padding = Css.padding; 185 } catch (e) { 186 padding.padding = '"' + padding.left + ' ' + padding.top + ' ' + padding.right + ' ' + padding.bottom + '"'; 187 } 188 } 189 if (elem == window) { 190 Cl_Position = { Top: 0, Left: 0 }; 191 } else { 192 Cl_Position = jQuery(elem).d_position(); 193 } 194 Left = Cl_Position.left; 195 Top = Cl_Position.top; 196 197 results = { 198 position: myposition, 199 top: Top, 200 left: Left, 201 width: width, 202 height: height, 203 right: Left + width, 204 bottom: Top + height, 205 borderwidth: borderwidth, 206 margin: margin, 207 padding: padding, 208 id: id, 209 nodeName: nodeName 210 }; 211 212 return results 213 } return results; 214 }, 48 215 /* 49 * 216 * Cl_Position de l'object elem 50 217 */ 51 jQuery.each(['Left', 'Top'], 52 function (i, name) { 53 jQuery.fn['scroll' + name] = function (val) { 54 if (!this[0]) return; 55 return val != undefined ? this.each(function () { 56 this == window || this == document ? window.scrollTo(name == 'Left' ? val : $(window)['scrollLeft'](), 57 name == 'Top' ? val : $(window)['scrollTop']()) : this['scroll' + name] = val; 58 }) : this[0] == window || this[0] == document ? self[(name == 'Left' ? 'pageXOffset' : 'pageYOffset')] || jQuery.boxModel && document.documentElement['scroll' + name] || document.body['scroll' + name] : this[0]['scroll' + name]; 218 d_position: function () { 219 var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results; 220 221 if (elem) { 222 offsetParent = this.offsetParent(); 223 offset = this.offset(); 224 225 if (offsetParent) { 226 if (elem == window) { 227 parentOffset = { top: 0, left: 0 }; 228 } else if (typeof (offsetParent.offset) != "undefined") 229 parentOffset = offsetParent.offset(); 230 else 231 parentOffset = { top: 0, left: 0 }; 232 233 if (!offset) 234 offset = { top: 0, left: 0 }; 235 236 offset.top -= num(elem, 'marginTop'); 237 offset.left -= num(elem, 'marginLeft'); 238 239 if (offsetParent.length > 0) { 240 parentOffset.top += num(offsetParent, 'borderTopWidth'); 241 parentOffset.left += num(offsetParent, 'borderLeftWidth'); 242 } else { 243 parentOffset = { top: 0, left: 0 }; 244 245 } 246 } else { 247 parentOffset = { top: 0, left: 0 }; 248 } 249 250 results = { 251 top: Math.ceil(offset.top - parentOffset.top), left: Math.ceil(offset.left - parentOffset.left) 59 252 }; 60 //================================================ 61 jQuery.fn['absolute' + name] = function (val) { 62 if (!this[0]) return; 63 a = jQuery(this[0]); 64 m = 0; 65 while (a.length > 0) { 66 val = jQuery(a).infos(); 67 if (val.position != "absolute") { 68 m += name == 'Left' ? val.left : val.top; 69 m += name == 'Left' ? val.margin.left : val.margin.top; 70 m += name == 'Left' ? val.margin.right : val.margin.bottom; 71 m += name == 'Left' ? val.borderwidth.left : val.borderwidth.top; 72 // m += name == 'Left' ? val.borderwidth.right : val.borderwidth.bottom; 73 // m += name == 'Left' ? val.padding.left : val.padding.top; 74 // m += name == 'Left' ? val.padding.right : val.padding.bottom; 75 a = jQuery(a).offsetParent(); 76 } else 77 break; 78 253 } return results; 254 }, 255 /* 256 * offsetParent 257 */ 258 offsetParent: function () { 259 var offsetParent = this[0].offsetParent; 260 while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static')) 261 offsetParent = offsetParent.offsetParent; 262 return jQuery(offsetParent); 263 }, 264 // getStyles(Obj) Récupérer la valeur CSS 265 getStyles: function (elt) { 266 var element = elt; 267 if (window.getComputedStyle) // Mozilla Firefox & cie 268 { 269 var propriete = window.getComputedStyle(element, null); 270 } 271 else if (element.currentStyle) // Microsoft Internet Explorer 272 { 273 274 var propriete = element.currentStyle; 275 } 276 return propriete; 277 }, 278 /* 279 * Get_val_int 280 * params: element,valeur maxi 281 * return: valeur entiere 282 */ 283 284 Get_Val_int: function (myObj, Maxi_val, Mini_val, prop) { 285 var val = 0; 286 Maxi_val = parseInt(Maxi_val || "0"); 287 288 /* 289 - numérique suivie de px ou % ou pt ou em, 290 - thin, bordure mince, 291 - medium, bordure moyenne (valeur par défaut), 292 - thick, bordure épaisse, 293 - inherit, hérite de son parent (css2). 294 */ 295 296 if (!myObj) { 297 return Maxi_val; 298 } 299 300 if (typeof (myObj) == "string") { 301 switch (myObj) { 302 case 'thin': 303 return 1; 304 break; 305 case 'medium': 306 return 2; 307 break; 308 case 'thick': 309 return 4; 310 break; 311 case 'inherit': 312 break; 313 case 'none': 314 return Maxi_val; 315 break; 316 default: 317 break; 318 } 319 el = this.get(0); 320 var reg1 = new RegExp("auto", "g") 321 if (myObj.match(reg1)) { 322 return Maxi_val; 323 } 324 if (prop) 325 myObj = num(el, prop); 326 else { 327 reg1 = new RegExp("px", "g") 328 if (myObj.match(reg1)) { 329 330 myObj = parseInt(myObj); 331 332 } else { 333 reg1 = new RegExp("%", "g") 334 if (myObj.match(reg1)) { 335 val = Math.ceil(myObj * Maxi_val / 100); 336 return val; 79 337 } 80 //306 81 82 83 return m; 84 85 86 }; 87 88 89 }); 90 //===================================================== 91 jQuery.fn.extend({ 92 93 infos: function () { 94 var width = 0, height = 0; 95 var elem = jQuery(this).get(0); 96 97 98 var Left = 0, Top = 0, offset, parentOffset, offsetParent, results; 99 var borderwidth = { width: "0 0 0 0", 100 top: 0, 101 left: 0, 102 right: 0, 103 bottom: 0 104 } 105 var padding = { padding: "0 0 0 0", 106 top: 0, 107 left: 0, 108 right: 0, 109 bottom: 0 110 }; 111 var margin = { margin: "0 0 0 0", 112 top: 0, 113 left: 0, 114 right: 0, 115 bottom: 0 116 }; 117 //===================================================================== 118 myposition = ""; 119 results = { 120 position: "", 121 top: 0, 122 left: 0, 123 width: 0, 124 height: 0, 125 right: 0, 126 bottom: 0, 127 borderwidth: borderwidth, 128 padding: padding, 129 margin: margin, id: "", nodeName: "" 130 }; 131 ; 132 if (elem) { 133 id = ""; nodeName = ""; 134 if (elem.id) id = elem.id; 135 if (elem.nodeName) nodeName = elem.nodeName; 136 137 138 if (elem == window) { 139 140 myposition = ""; 141 width = jQuery(elem).width(); 142 height = jQuery(elem).height(); 143 } else { 144 145 Css = jQuery(elem).getStyles(elem); 146 myposition = Css.position || ""; 147 width = jQuery(elem).outerWidth(); 148 height = jQuery(elem).outerHeight(); 149 150 151 borderwidth.left = jQuery(elem).Get_Val_int(Css.borderLeftWidth, "", "", 'borderLeftWidth'); 152 borderwidth.right = jQuery(elem).Get_Val_int(Css.borderRightWidth, "", "", 'borderRightWidth'); 153 borderwidth.top = jQuery(elem).Get_Val_int(Css.borderTopWidth, "", "", 'borderTopWidth'); 154 borderwidth.bottom = jQuery(elem).Get_Val_int(Css.borderBottomWidth, "", "", 'borderBottomWidth'); 155 try { 156 borderwidth.width = Css.borderWidth; 157 } catch (e) { 158 borderwidth.width = '"' + borderwidth.left + ' ' + borderwidth.top + ' ' + borderwidth.right + ' ' + borderwidth.bottom + '"'; 159 } 160 161 162 163 margin.left = jQuery(elem).Get_Val_int(Css.marginLeft, "", "", 'marginLeft'); 164 margin.right = jQuery(elem).Get_Val_int(Css.marginRight, "", "", 'marginRight'); 165 margin.top = jQuery(elem).Get_Val_int(Css.marginTop, "", "", 'marginTop'); 166 margin.bottom = jQuery(elem).Get_Val_int(Css.marginBottom, "", "", 'marginBottom'); 167 168 169 try { 170 margin.margin = Css.margin; 171 } catch (e) { 172 margin.margin = '"' + margin.left + ' ' + margin.top + ' ' + margin.right + ' ' + margin.bottom + '"'; 173 } 174 175 176 padding.left = jQuery(elem).Get_Val_int(Css.paddingLeft, "", "", 'paddingLeft'); 177 padding.right = jQuery(elem).Get_Val_int(Css.paddingRight, "", "", 'paddingRight'); 178 padding.top = jQuery(elem).Get_Val_int(Css.paddingTop, "", "", 'paddingTop'); 179 padding.bottom = jQuery(elem).Get_Val_int(Css.paddingBottom, "", "", 'paddingBottom'); 180 181 try { 182 padding.padding = Css.padding; 183 } catch (e) { 184 padding.padding = '"' + padding.left + ' ' + padding.top + ' ' + padding.right + ' ' + padding.bottom + '"'; 185 } 186 } 187 if (elem == window) { 188 Cl_Position = { Top: 0, Left: 0 }; 189 } else { 190 Cl_Position = jQuery(elem).d_position(); 191 } 192 Left = Cl_Position.left; 193 Top = Cl_Position.top; 194 195 results = { 196 position: myposition, 197 top: Top, 198 left: Left, 199 width: width, 200 height: height, 201 right: Left + width, 202 bottom: Top + height, 203 borderwidth: borderwidth, 204 margin: margin, 205 padding: padding, 206 id: id, 207 nodeName: nodeName 208 }; 209 210 return results 211 } return results; 212 }, 213 /* 214 * Cl_Position de l'object elem 215 */ 216 d_position: function () { 217 var left = 0, top = 0, elem = this[0], offset, parentOffset, offsetParent, results; 218 219 if (elem) { 220 offsetParent = this.offsetParent(); 221 offset = this.offset(); 222 223 if (offsetParent) { 224 if (elem == window) { 225 parentOffset = { top: 0, left: 0 }; 226 } else if (typeof (offsetParent.offset) != "undefined") 227 parentOffset = offsetParent.offset(); 228 else 229 parentOffset = { top: 0, left: 0 }; 230 231 if (!offset) 232 offset = { top: 0, left: 0 }; 233 234 offset.top -= num(elem, 'marginTop'); 235 offset.left -= num(elem, 'marginLeft'); 236 237 if (offsetParent.length > 0) { 238 parentOffset.top += num(offsetParent, 'borderTopWidth'); 239 parentOffset.left += num(offsetParent, 'borderLeftWidth'); 240 } else { 241 parentOffset = { top: 0, left: 0 }; 242 243 } 244 } else { 245 parentOffset = { top: 0, left: 0 }; 246 } 247 248 results = { 249 top: Math.ceil(offset.top - parentOffset.top), left: Math.ceil(offset.left - parentOffset.left) 250 }; 251 } return results; 252 }, 253 /* 254 * offsetParent 255 */ 256 offsetParent: function () { 257 var offsetParent = this[0].offsetParent; 258 while (offsetParent && (!/^body|html$/i.test(offsetParent.tagName) && jQuery.css(offsetParent, 'position') == 'static')) 259 offsetParent = offsetParent.offsetParent; 260 return jQuery(offsetParent); 261 }, 262 // getStyles(Obj) Récupérer la valeur CSS 263 getStyles: function (elt) { 264 var element = elt; 265 if (window.getComputedStyle) // Mozilla Firefox & cie 266 { 267 var propriete = window.getComputedStyle(element, null); 268 } 269 else if (element.currentStyle) // Microsoft Internet Explorer 270 { 271 272 var propriete = element.currentStyle; 273 } 274 return propriete; 275 }, 276 /* 277 * Get_val_int 278 * params: element,valeur maxi 279 * return: valeur entiere 280 */ 281 282 Get_Val_int: function (myObj, Maxi_val, Mini_val, prop) { 283 var val = 0; 284 Maxi_val = parseInt(Maxi_val || "0"); 285 286 /* 287 - numérique suivie de px ou % ou pt ou em, 288 - thin, bordure mince, 289 - medium, bordure moyenne (valeur par défaut), 290 - thick, bordure épaisse, 291 - inherit, hérite de son parent (css2). 292 */ 293 294 if (!myObj) { 295 return Maxi_val; 296 } 297 298 if (typeof (myObj) == "string") { 299 switch (myObj) { 300 case 'thin': 301 return 1; 302 break; 303 case 'medium': 304 return 2; 305 break; 306 case 'thick': 307 return 4; 308 break; 309 case 'inherit': 310 break; 311 case 'none': 312 return Maxi_val; 313 break; 314 default: 315 break; 316 } 317 el = this.get(0); 318 var reg1 = new RegExp("auto", "g") 319 if (myObj.match(reg1)) { 320 return Maxi_val; 321 } 322 if (prop) 323 myObj = num(el, prop); 324 else { 325 reg1 = new RegExp("px", "g") 326 if (myObj.match(reg1)) { 327 328 myObj = parseInt(myObj); 329 330 } else { 331 reg1 = new RegExp("%", "g") 332 if (myObj.match(reg1)) { 333 val = Math.ceil(myObj * Maxi_val / 100); 334 return val; 335 } 336 337 } 338 339 } 340 341 if (Mini_val) 342 if (myObj < Mini_val) return Maxi_val; 343 344 345 val = parseInt(myObj); 346 347 } else { 348 val = parseInt(myObj); 349 } 350 if (typeof (val) == "NaN") return Maxi_val; 351 return val; 352 } 353 }); 354 /* 355 * 356 */ 357 function num(el, prop) { 358 return parseInt(jQuery.curCSS(el.jquery ? el[0] : el, prop, true)) || 0; 359 }; 360 361 myjQuery = jQuery; 362 my$ = $; 338 339 } 340 341 } 342 343 if (Mini_val) 344 if (myObj < Mini_val) return Maxi_val; 345 346 347 val = parseInt(myObj); 348 349 } else { 350 val = parseInt(myObj); 351 } 352 if (typeof (val) == "NaN") return Maxi_val; 353 return val; 354 } 355 }); 356 /* 357 * 358 */ 359 function num(el, prop) { 360 return parseInt(jQuery.curCSS(el.jquery ? el[0] : el, prop, true)) || 0; 361 }; 362 363 myjQuery = jQuery; 364 my$ = $; 363 365 364 366 })(jQuery); -
extensions/Autosize/js/conflit.js
r10787 r10845 65 65 var Fn; 66 66 function conflit(element, nc) { 67 if(typeof DEBUG != "boolean") DEBUG = false ; 68 //--- cl_conflit 67 //--- cl_conflit 69 68 if (typeof MooTools == "undefined" && typeof Prototype == "undefined") { 70 69 ret_element = jQuery(element); … … 148 147 149 148 ret_element = jQuery(element); 150 if (DEBUG == "true") { 149 150 if (typeof DEBUG_autosize == "boolean" && DEBUG_autosize == "true") { 151 151 retour = (getStackTrace()); 152 152 alert("element : " + element + " retour : " + retour + "Fonctions:" + Fn); … … 165 165 jQuery(window).load(function () { 166 166 //============================================================ 167 if(jQuery("#check_auto_w").length>0){ 168 var cl_visible = jQuery("#check_auto_w").get(0).checked; 169 if (!cl_visible) { 170 jQuery("#table0 :text[name*='_width'] ").hide(); 171 } else { 172 jQuery("#table0 :text[name*='_width'] ").show(); 173 } 174 } 175 //============================================================== 176 jQuery("input").click(function () { 177 if (this.name.match(RegExp("_enabled", "gi"))) { 178 sel = "[name*=" + this.name + "]"; 179 obj = jQuery("tr" + sel); 180 181 if (this.checked) 182 obj.css({backgroundColor:"green",color:"white"}); 183 else 184 obj.css({backgroundColor: "red",color:"white"}); 185 186 return; 187 } 188 189 if (this.name != "check_auto_w") return; 190 191 cl_visible = this.checked 192 if (!cl_visible) { 193 jQuery("#table0 :text[name*='_width'] ").hide(); 194 } else { 195 jQuery("#table0 :text[name*='_width'] ").show(); 196 } 197 198 return; 199 200 201 202 203 }); 167 204 jQuery("#icon_gmaps").bind('click', function () { 168 205 //jQuery("#iGMapsIconContent").dialog("open"); 169 if (Version_pwg > '2.2.0' 170 return;206 if (Version_pwg > '2.2.0') 207 return; 171 208 jQuery('html,body').stop().scrollTop(0); 172 209 jQuery('html,body').stop().scrollLeft(0); … … 455 492 if (state == "") { 456 493 457 if ( DEBUG== "true") {494 if (typeof DEBUG_autosize == "boolean" && DEBUG_autosize == "true") { 458 495 Fn = all_functions.join('\n'); 459 496 try { -
extensions/Autosize/template/autosize.tpl
r8981 r10845 51 51 var visible = '{$visible}'; 52 52 </script> 53 {if $DEBUG == "true"}53 {if $DEBUG_autosize == "true"} 54 54 {assign var="visible" value="block"} 55 55 <!--- autosize/template/autosize.tpl body ---> -
extensions/Autosize/template/conflit.tpl
r10561 r10845 1 1 {html_head} 2 2 <script type="text/javascript"> 3 var DEBUG = '{$DEBUG}';3 var DEBUG_autosize = '{$DEBUG_autosize}'; 4 4 var theme = '{$theme}'; 5 5 var cl_version = '{$cl_version}'; 6 6 var cl_plugin = '{$name}'; 7 7 var Version_pwg='{$Version_pwg}'; 8 {if $DEBUG == "true"}8 {if $DEBUG_autosize == "true"} 9 9 var cl_query = '{$autosize_parametres->query}'; 10 10 var cl_type = '{$autosize_parametres->type}'; -
extensions/Autosize/template/header_2_1.tpl
r10787 r10845 3 3 {known_script id="jquery.cluetip" src=$ROOT_URL|@cat:"themes/default/js/plugins/jquery.cluetip.js"} 4 4 {known_script id="conflit_script" src = $AUTOSIZE_PATH|@cat:"js/conflit.js" } 5 {known_script id=" dimensions" src = $AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js" }6 {known_script id=" cookie" src = $AUTOSIZE_PATH|@cat:"js/jquery.cookie.js" }5 {known_script id="autosize.dimensions" src = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" } 6 {known_script id="autosize.cookie" src = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" } 7 7 {/html_head} -
extensions/Autosize/template/header_2_2.tpl
r10787 r10845 2 2 {combine_script id="jquery.cluetip" path = "themes/default/js/plugins/jquery.cluetip.js" require="jquery" } 3 3 {combine_script id="conflit_script" path = $AUTOSIZE_PATH|@cat:"js/conflit.js" require="jquery"} 4 {combine_script id=" dimensions" path = $AUTOSIZE_PATH|@cat:"js/jquery.dimensions.js" require="jquery"}5 {combine_script id=" cookie" path = $AUTOSIZE_PATH|@cat:"js/jquery.cookie.js" require="jquery"}4 {combine_script id="autosize.dimensions" path = $AUTOSIZE_PATH|@cat:"js/autosize.dimensions.js" require="jquery"} 5 {combine_script id="autosize.cookie" path = $AUTOSIZE_PATH|@cat:"js/autosize.cookie.js" require="jquery"} -
extensions/Autosize/template/picture_2_2.tpl
r10787 r10845 1 {combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery, cookie' }1 {combine_script id="Affiche_script" path= $AUTOSIZE_PATH|@cat:"js/Affiche_script.js" require='jquery,autosize.cookie' }
Note: See TracChangeset
for help on using the changeset viewer.