Changeset 8629 for extensions/cl_conflit
- Timestamp:
- Jan 12, 2011, 3:23:39 PM (13 years ago)
- Location:
- extensions/cl_conflit
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/cl_conflit/conflit.inc.php
r8187 r8629 2 2 // +-----------------------------------------------------------------------+ 3 3 // | Piwigo - a PHP based picture gallery | 4 // | cl_conflit 4 // | cl_conflit | 5 5 // +-----------------------------------------------------------------------+ 6 6 // | Copyright(C) 2010 cljosse | … … 29 29 //============================================================ 30 30 /* 31 * cl_conflit_script 31 * cl_conflit_script_1 32 32 */ 33 static public function cl_conflit_script ()33 static public function cl_conflit_script_1() 34 34 { 35 global $template,$user,$conf,$picture ,$page,$cl_plugin; 36 35 global $template,$user,$conf,$picture ,$page,$cl_plugin; 36 if (isset( $page['body_id']) && $page['body_id']=='theAdminPage' ) return ; 37 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 38 if ($ma_page=='thePiwiShackControllerPage') return ; 37 39 $my_path = basename(dirname(__FILE__)).'/' ; 38 40 $my_path = dirname(__FILE__).'/'; 39 41 $template->set_filenames(array('cl_conflit_init'=>$my_path. "template/conflit.tpl" ) ); 40 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 41 $cl_conflit_parametres = cl_conflit_Get_Options() ; 42 43 42 $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ; 43 $cl_conflit_parametres = cl_conflit_Get_Options() ; 44 44 $theme=$user['theme']; 45 45 $url = get_root_url(); 46 46 $template->assign( 47 47 array( … … 50 50 'cl_version' => $cl_plugin['version'] , 51 51 'name' => $cl_plugin['name'] , 52 52 'MY_ROOT' => $url, 53 53 'theme' => $theme , 54 'DEBUG' => $ debug,55 'CONFLIT_ ROOT' => CONFLIT_PATH)54 'DEBUG' => $DEBUG , 55 'CONFLIT_PATH' => CONFLIT_PATH) 56 56 ); 57 58 if( $page['body_id'] == 'theAdminPage' ) return ; 57 59 58 return $template->parse( 'cl_conflit_init', false); 60 }// function cl_conflit_script 59 }// function cl_conflit_script_1 61 60 //================================================================================= 62 61 /* 63 * 62 * cl_conflit_script_2 64 63 */ 65 64 static public function cl_conflit_script_2() 66 65 { 67 66 global $template,$user,$conf,$picture ,$page,$cl_plugin; 68 69 $my_path = basename(dirname(__FILE__)).'/' ;70 67 $my_path = dirname(__FILE__).'/'; 71 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 72 73 $theme=$user['theme']; 68 $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ; 69 $ma_page=isset($page['body_id'])?$page['body_id']:"" ; 70 $theme=$user['theme']; 71 if ($ma_page=='thePiwiShackControllerPage') return ; 74 72 75 73 $template->assign( … … 77 75 'cl_version' => $cl_plugin['version'] , 78 76 'name' => $cl_plugin['name'] , 79 'ma_page' => $ page['body_id'],77 'ma_page' => $ma_page, 80 78 81 79 'theme' => $theme , 82 'DEBUG' => $ debug,83 'CONFLIT_ ROOT' => CONFLIT_PATH)80 'DEBUG' => $DEBUG , 81 'CONFLIT_PATH' => CONFLIT_PATH) 84 82 ); 85 83 86 $autoscript="<script type='text/javascript'> 87 88 if (typeof (save_framework) == 'function') 89 save_framework('".$page['body_id']."'); 90 </script>"; 91 $template->append('footer_elements',$autoscript); 92 return ; 93 94 84 $autoscript="<script type='text/javascript'> 85 /* cl_conflit_script_2 */ 86 if (typeof (save_framework) == 'function') 87 save_framework('".$page['body_id']."'); 88 </script>"; 89 $template->append('footer_elements',$autoscript); 90 return ; 95 91 }// function cl_conflit_script_2 96 92 97 //================================================================= 98 /* 99 * 100 */ 101 static public function cl_conflit_script_3($content) 102 { 103 global $template,$user,$conf,$picture ,$page,$cl_plugin; 104 105 $my_path = basename(dirname(__FILE__)).'/' ; 106 $my_path = dirname(__FILE__).'/'; 107 $debug = isset($conf['debug']) ? $conf['debug'] : false ; 108 109 $theme=$user['theme']; 110 111 $ThePicture = $template->get_template_vars('current'); 112 $tpl_name = $user['theme'] ; 113 if ( !empty($content) ) { return $content; } 114 if ($ThePicture['is_picture'] <> 1 ) { return $content; ; } 115 116 $cl_conflitjs = '<script type="text/javascript" charset="utf-8" src="'; 117 $autocss = $cl_conflitjs.'themes/default/js/jquery.packed.js"></script>'."\n"; 118 $template->append('head_elements',$autocss); 119 120 $autocss="<script type='text/javascript'> 121 // jQuery('#theImage').css({opacity:'0.0'}); 122 </script>"; 123 124 $template->append('footer_elements',"\n".$autocss); 125 return $content ; 126 127 128 }// function cl_conflit_script_3 93 //================================================ 129 94 /* 130 * 95 * cl_conflit_admin 131 96 */ 132 97 static public function cl_conflit_admin($menu) … … 184 149 185 150 } 186 187 188 189 190 151 ?> -
extensions/cl_conflit/include/constants.php
r7905 r8629 2 2 global $prefixeTable; 3 3 if (!defined('CL_CONFLIT_TABLE')) define('CL_CONFLIT_TABLE', $prefixeTable.'cl_conflit'); 4 $path = CONFLIT_PATH;4 $path = CONFLIT_PATH; 5 5 $plg_data = implode( '', file($path.'main.inc.php') ); 6 6 if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) ) -
extensions/cl_conflit/js/conflit.js
r8587 r8629 72 72 function conflit(element, nc) { 73 73 //--- cl_conflit 74 if (typeof MooTools=="undefined" && typeof Prototype=="undefined" ) {75 ret_element = jQuery(element);74 if (typeof MooTools=="undefined" && typeof Prototype=="undefined" ) { 75 ret_element = jQuery(element); 76 76 return ret_element; 77 77 } … … 100 100 { 101 101 102 ret_element = myjQuery().$Prototype(element);102 ret_element = myjQuery().$Prototype(element); 103 103 104 104 } … … 168 168 //====================================================== 169 169 jQuery(document).ready( 170 function (jQuery) { 171 jQuery(window).load(function () { 172 //============================================================ 173 jQuery("#icon_gmaps").bind('click', function () { 174 175 jQuery('html,body').stop().scrollTop(0); 176 jQuery('html,body').stop().scrollLeft(0); 177 jQuery(".ui-widget-overlay").css("opacity", "0.75"); 178 179 l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2; 180 h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2; 181 182 jQuery(".gmapsPopup").css("left", l1 + "px"); 183 jQuery(".gmapsPopup").css("top", h1 + "px"); 184 }) 185 //============================================================= 186 if (typeof (Parent) == "undefined") 187 Parent = "#theImage"; 188 info_image = jQuery(Parent).infos(); 189 p0 = jQuery(Parent); 190 if (p0.length > 0) { 191 //====================================================== 192 if (info_image.position != "static") { 193 try { 194 if (theme.match("gally", "gi")) { 195 if (typeof gallyPP != "undefined") { 196 197 } else if (jQuery.isFunction(inittoolbar)) { 198 if (typeof (currentTab) == "undefined") inittoolbar(); 199 else initializeImageMode("resize"); 200 }; 201 //==== compatibilité Gally/LLGBO === 202 //--- passage relative ==> static ===/ 203 jQuery(Parent).css({ position: "static" }); 204 jQuery("#imageToolBar").css({ position: "relative", top: "0px" }); 205 206 } 207 } catch (e) { 208 } 209 210 } 211 } 212 // jQuery(window).resize(); 213 }); 214 //============================================================= 215 // $ = _$2; ; 216 }); 170 function (jQuery) { 171 jQuery(window).load(function () { 172 //============================================================ 173 jQuery("#icon_gmaps").bind('click', function () { 174 175 jQuery('html,body').stop().scrollTop(0); 176 jQuery('html,body').stop().scrollLeft(0); 177 jQuery(".ui-widget-overlay").css("opacity", "0.75"); 178 179 l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2; 180 h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2; 181 182 jQuery(".gmapsPopup").css("left", l1 + "px"); 183 jQuery(".gmapsPopup").css("top", h1 + "px"); 184 }) 185 //============================================================= 186 187 // jQuery(window).resize(); 188 }); 189 //============================================================= 190 // $ = _$2; ; 191 }); 217 192 218 193 … … 222 197 jQuery.fn.extend({ 223 198 224 //---------------- luciano -------------------------------225 $Luciano: function (el, nc) {226 return document.id(el, nc, this.document);227 },228 //=============== PaMOOramics ===========================229 230 $Pamoorama: function (B) {199 //---------------- luciano ------------------------------- 200 $Luciano: function (el, nc) { 201 return document.id(el, nc, this.document); 202 }, 203 //=============== PaMOOramics =========================== 204 205 $Pamoorama: function (B) { 231 206 232 207 … … 448 423 449 424 states.push('paMOOramics'); 450 break;451 }452 //window_1290934905697_top453 if (fn.match(RegExp("window_..|WindowUtilities", "gi"))) {454 states.push('rv_gmaps');455 break;456 }457 if (fn.match(RegExp("that.overlayOpacity", "gi"))) {458 states.push('rv_gmaps');459 break;460 }461 if (fn.match(RegExp("For backward compatibility like win", "gi"))) {462 states.push('rv_gmaps');463 break;464 }465 if (fn.match(RegExp("overlay_modal|HTMLDivElement|constraintPad", "gi"))) {466 states.push('rv_gmaps');467 break;468 }425 break; 426 } 427 //window_1290934905697_top 428 if (fn.match(RegExp("window_..|WindowUtilities", "gi"))) { 429 states.push('rv_gmaps'); 430 break; 431 } 432 if (fn.match(RegExp("that.overlayOpacity", "gi"))) { 433 states.push('rv_gmaps'); 434 break; 435 } 436 if (fn.match(RegExp("For backward compatibility like win", "gi"))) { 437 states.push('rv_gmaps'); 438 break; 439 } 440 if (fn.match(RegExp("overlay_modal|HTMLDivElement|constraintPad", "gi"))) { 441 states.push('rv_gmaps'); 442 break; 443 } 469 444 470 445 if (fn.match(RegExp("__content|__method|observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) { … … 474 449 475 450 476 if (all_functions.length > 50) 477 break;451 if (all_functions.length > 50) 452 break; 478 453 479 454 … … 482 457 483 458 } 484 // state_ff + "|" +459 // state_ff + "|" + 485 460 state = states.join('\n'); 486 461 if (state == "") { … … 499 474 500 475 Fn = all_functions; 501 return { state: state, fn: callstack.join('\n'), fn1:fn2 };476 return { state: state, fn: callstack.join('\n'), fn1: fn2 }; 502 477 } 503 478 //==================================== 504 479 test_conflit = false; 505 librairies =new Array;480 librairies = new Array; 506 481 507 482 … … 509 484 $_ = $; 510 485 function save_framework(page) { 486 // theGategoryPage,theRegisterPage 487 // thePicturePage 488 // si admin.php page = "",theIdentificationPage 511 489 try { 512 490 Conflit = { version: cl_version, name: cl_plugin }; … … 514 492 515 493 } 516 $_2 = $; 494 if (typeof (Parent) == "undefined") 495 Parent = "#theImage"; 496 info_image = jQuery(Parent).infos(); 497 p0 = jQuery(Parent); 498 if (p0.length > 0) { 499 //====================================================== 500 if (info_image.position != "static") { 501 try { 502 if (theme.match("gally", "gi")) { 503 if (typeof gallyPP != "undefined") { 504 505 } else if (jQuery.isFunction(inittoolbar)) { 506 if (typeof (currentTab) == "undefined") inittoolbar(); 507 else initializeImageMode("resize"); 508 }; 509 //==== compatibilité Gally/LLGBO === 510 jQuery(Parent).css({ position: "static" }); 511 512 } 513 } catch (e) { 514 } 515 516 } 517 } 518 519 $_2 = $; 517 520 return 518 521 } 519 522 520 523 (function ($) { 521 $(document).ready(function () { 522 //================================================= 523 if (typeof jQuery.fn.infos !="function") 524 { 525 jQuery=myjQuery; 526 $=my$ ; 527 } 528 }); 524 $(document).ready(function () { 525 //================================================= 526 if (typeof jQuery.fn.infos != "function") { 527 jQuery = myjQuery; 528 $ = my$; 529 } 530 }); 529 531 530 532 })(jQuery); 531 533 532 if(test_conflit!=true) 533 { 534 //-------------------------------------------------------------- 535 $_0 = $; 536 537 function $(element, nc0) { 538 if (typeof jQuery.fn.infos !="function") 539 if (typeof myjQuery !="undefined") 540 jQuery=myjQuery; 541 a = conflit(element, nc0); 542 return a; 543 544 } 545 546 if (typeof ($.ajax) != "function") { 547 $.ajax = function (origSettings) { 548 jQuery.ajax(origSettings); 549 } 550 551 552 $.parseJSON = function (msg) { 553 return jQuery.parseJSON(msg); 554 } 555 556 557 } 558 //============================================ 559 /* url (String): URl de la page à charger 560 * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur. 561 * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées. 562 * type (String): (optionnel) format des données renvoyées à la fonction de callback 563 */ 564 if (typeof ($.get) != "function") { 565 $.get = function ( a, b, c, d) { 566 return jQuery.get(a, b, c,d ); 567 } 568 } 569 if (typeof ($.post) != "function") { 570 571 $.post = function (a, b, c,d) { 572 return jQuery.post(a, b, c, d); 573 } 574 ; 575 576 } 577 578 534 if (test_conflit != true) { 535 //-------------------------------------------------------------- 536 $_0 = $; 537 538 function $(element, nc0) { 539 if (typeof jQuery.fn.infos != "function") 540 if (typeof myjQuery != "undefined") 541 jQuery = myjQuery; 542 a = conflit(element, nc0); 543 return a; 544 } 545 546 if (typeof ($.ajax) != "function") { 547 $.ajax = function (origSettings) { 548 jQuery.ajax(origSettings); 549 } 550 551 552 $.parseJSON = function (msg) { 553 return jQuery.parseJSON(msg); 554 } 555 556 557 } 558 //============================================ 559 /* url (String): URl de la page à charger 560 * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur. 561 * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées. 562 * type (String): (optionnel) format des données renvoyées à la fonction de callback 563 */ 564 if (typeof ($.get) != "function") { 565 $.get = function (a, b, c, d) { 566 return jQuery.get(a, b, c, d); 567 } 568 } 569 if (typeof ($.post) != "function") { 570 571 $.post = function (a, b, c, d) { 572 return jQuery.post(a, b, c, d); 573 } 574 ; 575 576 } 579 577 580 578 } -
extensions/cl_conflit/js/jquery.dimensions.js
r8537 r8629 19 19 */ 20 20 jQuery.each(['Height', 'Width'], 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 21 function (i, name) { 22 jQuery.fn['inner' + name] = function () { 23 if (!this[0]) return; 24 var torl = name == 'Height' ? 'Top' : 'Left', 25 borr = name == 'Height' ? 'Bottom' : 'Right'; 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 borr = name == 'Height' ? 'Bottom' : 'Right'; 33 options = options || false; 34 options = jQuery.extend({ margin: options }); 35 36 var val = this.is(':visible') ? this[0]['offset' + name] : 37 num(this, 38 name.toLowerCase()) + 39 num(this, 'border' + torl + 'Width') + 40 num(this, 'border' + borr + 'Width') + 41 num(this, 'padding' + torl) + 42 num(this, 'padding' + borr) 43 44 ; 45 return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0); 46 }; 47 }); 48 48 /* 49 49 * 50 50 */ 51 51 jQuery.each(['Left', 'Top'], 52 53 54 55 56 57 58 59 60 61 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 }); 62 62 jQuery.fn.extend({ 63 63 -
extensions/cl_conflit/main.inc.php
r8537 r8629 2 2 /* 3 3 Plugin Name: cl_conflit 4 Version: 1.0. 64 Version: 1.0.7 5 5 Description: gestion des conflits entre jQuery et les autres librairies 6 6 Plugin URI: http://piwigo.org/ext/extension_view.php?eid=474 … … 12 12 if (!defined('CONFLIT_PATH')) 13 13 define( 'CONFLIT_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' ); 14 15 $path = CONFLIT_PATH; 16 17 //============================================================================ 18 include ($path."include/constants.php"); 19 //============================================================================ 20 include_once(CONFLIT_PATH.'conflit.inc.php'); 21 14 //================================================================== 15 include_once (CONFLIT_PATH."include/constants.php"); 16 include_once(CONFLIT_PATH.'conflit.inc.php'); 17 //================================================================== 22 18 $conflit_controler = new conflit_controler(); 23 19 add_event_handler('get_admin_plugin_menu_links', array(&$conflit_controler,'cl_conflit_admin') ); 24 20 25 add_event_handler('loc_after_page_header', array(&$conflit_controler, 'cl_conflit_script'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2); 21 22 23 add_event_handler('loc_after_page_header', array(&$conflit_controler, 'cl_conflit_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2); 26 24 add_event_handler('loc_end_page_tail',array(&$conflit_controler, 'cl_conflit_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL ); 27 add_event_handler('render_element_content',array(&$conflit_controler, 'cl_conflit_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 );28 29 30 25 ?> -
extensions/cl_conflit/template/conflit.tpl
r8187 r8629 1 1 {html_head} 2 <!--- Autosize/template/confilt.tpl (before)--->3 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" }4 {known_script id="conflit_script" src=$CONFLIT_ROOT|@cat:"js/conflit.js"}5 {known_script id=" dimensions" src=$CONFLIT_ROOT|@cat:"js/jquery.dimensions.js"}6 <!---FIN Autosize/template/confilt.tpl (before) --->{/html_head}2 <!--- Autosize/template/confilt.tpl ---> 3 {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" } 4 {known_script id="dimensions" src=$CONFLIT_PATH|@cat:"js/jquery.dimensions.js"} 5 {known_script id="conflit_script" src=$CONFLIT_PATH|@cat:"js/conflit.js"} 6 {/html_head} 7 7 <script type="text/javascript"> 8 8 var DEBUG = '{$DEBUG}'; … … 10 10 var cl_version = '{$cl_version}'; 11 11 var cl_plugin = '{$name}'; 12 {if $DEBUG == "true"} 12 13 var cl_query = '{$cl_conflit_parametres->query}'; 13 14 var cl_type = '{$cl_conflit_parametres->type}'; 14 15 var cl_plugins=new Array(); 15 {if $DEBUG}16 16 {if not empty($cl_plugins )} 17 17 {foreach from=$cl_plugins item=cl_plug }
Note: See TracChangeset
for help on using the changeset viewer.