Index: extensions/cl_conflit/conflit.inc.php
===================================================================
--- extensions/cl_conflit/conflit.inc.php (revision 8587)
+++ extensions/cl_conflit/conflit.inc.php (revision 8629)
@@ -2,5 +2,5 @@
// +-----------------------------------------------------------------------+
// | Piwigo - a PHP based picture gallery |
-// | cl_conflit |
+// | cl_conflit |
// +-----------------------------------------------------------------------+
// | Copyright(C) 2010 cljosse |
@@ -29,19 +29,19 @@
//============================================================
/*
- * cl_conflit_script
+ * cl_conflit_script_1
*/
- static public function cl_conflit_script()
+ static public function cl_conflit_script_1()
{
- global $template,$user,$conf,$picture ,$page,$cl_plugin;
-
+ global $template,$user,$conf,$picture ,$page,$cl_plugin;
+ if (isset( $page['body_id']) && $page['body_id']=='theAdminPage' ) return ;
+ $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
+ if ($ma_page=='thePiwiShackControllerPage') return ;
$my_path = basename(dirname(__FILE__)).'/' ;
$my_path = dirname(__FILE__).'/';
$template->set_filenames(array('cl_conflit_init'=>$my_path. "template/conflit.tpl" ) );
- $debug = isset($conf['debug']) ? $conf['debug'] : false ;
-$cl_conflit_parametres = cl_conflit_Get_Options() ;
-
-
+ $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ;
+ $cl_conflit_parametres = cl_conflit_Get_Options() ;
$theme=$user['theme'];
-
+ $url = get_root_url();
$template->assign(
array(
@@ -50,26 +50,24 @@
'cl_version' => $cl_plugin['version'] ,
'name' => $cl_plugin['name'] ,
-
+ 'MY_ROOT' => $url,
'theme' => $theme ,
- 'DEBUG' => $debug ,
- 'CONFLIT_ROOT' => CONFLIT_PATH)
+ 'DEBUG' => $DEBUG ,
+ 'CONFLIT_PATH' => CONFLIT_PATH)
);
-
- if( $page['body_id'] == 'theAdminPage' ) return ;
+
return $template->parse( 'cl_conflit_init', false);
- }// function cl_conflit_script
+ }// function cl_conflit_script_1
//=================================================================================
/*
- *
+ * cl_conflit_script_2
*/
static public function cl_conflit_script_2()
{
global $template,$user,$conf,$picture ,$page,$cl_plugin;
-
- $my_path = basename(dirname(__FILE__)).'/' ;
$my_path = dirname(__FILE__).'/';
- $debug = isset($conf['debug']) ? $conf['debug'] : false ;
-
- $theme=$user['theme'];
+ $DEBUG = isset($conf['cl_debug']) ? $conf['cl_debug'] : "false" ;
+ $ma_page=isset($page['body_id'])?$page['body_id']:"" ;
+ $theme=$user['theme'];
+ if ($ma_page=='thePiwiShackControllerPage') return ;
$template->assign(
@@ -77,56 +75,23 @@
'cl_version' => $cl_plugin['version'] ,
'name' => $cl_plugin['name'] ,
- 'ma_page' => $page['body_id'],
+ 'ma_page' => $ma_page,
'theme' => $theme ,
- 'DEBUG' => $debug ,
- 'CONFLIT_ROOT' => CONFLIT_PATH)
+ 'DEBUG' => $DEBUG ,
+ 'CONFLIT_PATH' => CONFLIT_PATH)
);
- $autoscript="";
- $template->append('footer_elements',$autoscript);
- return ;
-
-
+ $autoscript="";
+ $template->append('footer_elements',$autoscript);
+ return ;
}// function cl_conflit_script_2
- //=================================================================
- /*
- *
- */
- static public function cl_conflit_script_3($content)
- {
- global $template,$user,$conf,$picture ,$page,$cl_plugin;
-
- $my_path = basename(dirname(__FILE__)).'/' ;
- $my_path = dirname(__FILE__).'/';
- $debug = isset($conf['debug']) ? $conf['debug'] : false ;
-
- $theme=$user['theme'];
-
-$ThePicture = $template->get_template_vars('current');
-$tpl_name = $user['theme'] ;
-if ( !empty($content) ) { return $content; }
-if ($ThePicture['is_picture'] <> 1 ) { return $content; ; }
-
- $cl_conflitjs = ''."\n";
- $template->append('head_elements',$autocss);
-
- $autocss="";
-
- $template->append('footer_elements',"\n".$autocss);
- return $content ;
-
-
- }// function cl_conflit_script_3
+ //================================================
/*
- *
+ * cl_conflit_admin
*/
static public function cl_conflit_admin($menu)
@@ -184,7 +149,3 @@
}
-
-
-
-
?>
Index: extensions/cl_conflit/include/constants.php
===================================================================
--- extensions/cl_conflit/include/constants.php (revision 8587)
+++ extensions/cl_conflit/include/constants.php (revision 8629)
@@ -2,5 +2,5 @@
global $prefixeTable;
if (!defined('CL_CONFLIT_TABLE')) define('CL_CONFLIT_TABLE', $prefixeTable.'cl_conflit');
-$path = CONFLIT_PATH;
+ $path = CONFLIT_PATH;
$plg_data = implode( '', file($path.'main.inc.php') );
if ( preg_match("|Plugin Name: (.*)|", $plg_data, $val) )
Index: extensions/cl_conflit/js/conflit.js
===================================================================
--- extensions/cl_conflit/js/conflit.js (revision 8587)
+++ extensions/cl_conflit/js/conflit.js (revision 8629)
@@ -72,6 +72,6 @@
function conflit(element, nc) {
//--- cl_conflit
-if (typeof MooTools=="undefined" && typeof Prototype=="undefined" ) {
- ret_element = jQuery(element);
+ if (typeof MooTools=="undefined" && typeof Prototype=="undefined" ) {
+ ret_element = jQuery(element);
return ret_element;
}
@@ -100,5 +100,5 @@
{
- ret_element = myjQuery().$Prototype(element);
+ ret_element = myjQuery().$Prototype(element);
}
@@ -168,51 +168,26 @@
//======================================================
jQuery(document).ready(
- function (jQuery) {
- jQuery(window).load(function () {
- //============================================================
- jQuery("#icon_gmaps").bind('click', function () {
-
- jQuery('html,body').stop().scrollTop(0);
- jQuery('html,body').stop().scrollLeft(0);
- jQuery(".ui-widget-overlay").css("opacity", "0.75");
-
- l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2;
- h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2;
-
- jQuery(".gmapsPopup").css("left", l1 + "px");
- jQuery(".gmapsPopup").css("top", h1 + "px");
- })
- //=============================================================
- if (typeof (Parent) == "undefined")
- Parent = "#theImage";
- info_image = jQuery(Parent).infos();
- p0 = jQuery(Parent);
- if (p0.length > 0) {
- //======================================================
- if (info_image.position != "static") {
- try {
- if (theme.match("gally", "gi")) {
- if (typeof gallyPP != "undefined") {
-
- } else if (jQuery.isFunction(inittoolbar)) {
- if (typeof (currentTab) == "undefined") inittoolbar();
- else initializeImageMode("resize");
- };
- //==== compatibilité Gally/LLGBO ===
- //--- passage relative ==> static ===/
- jQuery(Parent).css({ position: "static" });
- jQuery("#imageToolBar").css({ position: "relative", top: "0px" });
-
- }
- } catch (e) {
- }
-
- }
- }
- // jQuery(window).resize();
- });
- //=============================================================
- // $ = _$2; ;
- });
+ function (jQuery) {
+ jQuery(window).load(function () {
+ //============================================================
+ jQuery("#icon_gmaps").bind('click', function () {
+
+ jQuery('html,body').stop().scrollTop(0);
+ jQuery('html,body').stop().scrollLeft(0);
+ jQuery(".ui-widget-overlay").css("opacity", "0.75");
+
+ l1 = (jQuery(window).width() - (jQuery(".gmapsPopup").width())) / 2;
+ h1 = (jQuery(window).height() - (jQuery(".gmapsPopup").height())) / 2;
+
+ jQuery(".gmapsPopup").css("left", l1 + "px");
+ jQuery(".gmapsPopup").css("top", h1 + "px");
+ })
+ //=============================================================
+
+ // jQuery(window).resize();
+ });
+ //=============================================================
+ // $ = _$2; ;
+ });
@@ -222,11 +197,11 @@
jQuery.fn.extend({
-//---------------- luciano -------------------------------
-$Luciano: function (el, nc) {
-return document.id(el, nc, this.document);
-},
-//=============== PaMOOramics ===========================
-
-$Pamoorama: function (B) {
+ //---------------- luciano -------------------------------
+ $Luciano: function (el, nc) {
+ return document.id(el, nc, this.document);
+ },
+ //=============== PaMOOramics ===========================
+
+ $Pamoorama: function (B) {
@@ -448,23 +423,23 @@
states.push('paMOOramics');
- break;
- }
- //window_1290934905697_top
- if (fn.match(RegExp("window_..|WindowUtilities", "gi"))) {
- states.push('rv_gmaps');
- break;
- }
- if (fn.match(RegExp("that.overlayOpacity", "gi"))) {
- states.push('rv_gmaps');
- break;
- }
- if (fn.match(RegExp("For backward compatibility like win", "gi"))) {
- states.push('rv_gmaps');
- break;
- }
- if (fn.match(RegExp("overlay_modal|HTMLDivElement|constraintPad", "gi"))) {
- states.push('rv_gmaps');
- break;
- }
+ break;
+ }
+ //window_1290934905697_top
+ if (fn.match(RegExp("window_..|WindowUtilities", "gi"))) {
+ states.push('rv_gmaps');
+ break;
+ }
+ if (fn.match(RegExp("that.overlayOpacity", "gi"))) {
+ states.push('rv_gmaps');
+ break;
+ }
+ if (fn.match(RegExp("For backward compatibility like win", "gi"))) {
+ states.push('rv_gmaps');
+ break;
+ }
+ if (fn.match(RegExp("overlay_modal|HTMLDivElement|constraintPad", "gi"))) {
+ states.push('rv_gmaps');
+ break;
+ }
if (fn.match(RegExp("__content|__method|observe|responder|stopobserving|fireContentLoadedEvent", "gi"))) {
@@ -474,6 +449,6 @@
- if (all_functions.length > 50)
- break;
+ if (all_functions.length > 50)
+ break;
@@ -482,5 +457,5 @@
}
- // state_ff + "|" +
+ // state_ff + "|" +
state = states.join('\n');
if (state == "") {
@@ -499,9 +474,9 @@
Fn = all_functions;
- return { state: state, fn: callstack.join('\n'),fn1:fn2 };
+ return { state: state, fn: callstack.join('\n'), fn1: fn2 };
}
//====================================
test_conflit = false;
- librairies =new Array;
+librairies = new Array;
@@ -509,4 +484,7 @@
$_ = $;
function save_framework(page) {
+ // theGategoryPage,theRegisterPage
+ // thePicturePage
+ // si admin.php page = "",theIdentificationPage
try {
Conflit = { version: cl_version, name: cl_plugin };
@@ -514,67 +492,87 @@
}
- $_2 = $;
+ if (typeof (Parent) == "undefined")
+ Parent = "#theImage";
+ info_image = jQuery(Parent).infos();
+ p0 = jQuery(Parent);
+ if (p0.length > 0) {
+ //======================================================
+ if (info_image.position != "static") {
+ try {
+ if (theme.match("gally", "gi")) {
+ if (typeof gallyPP != "undefined") {
+
+ } else if (jQuery.isFunction(inittoolbar)) {
+ if (typeof (currentTab) == "undefined") inittoolbar();
+ else initializeImageMode("resize");
+ };
+ //==== compatibilité Gally/LLGBO ===
+ jQuery(Parent).css({ position: "static" });
+
+ }
+ } catch (e) {
+ }
+
+ }
+ }
+
+ $_2 = $;
return
- }
+}
(function ($) {
- $(document).ready(function () {
- //=================================================
- if (typeof jQuery.fn.infos !="function")
- {
- jQuery=myjQuery;
- $=my$ ;
- }
- });
+ $(document).ready(function () {
+ //=================================================
+ if (typeof jQuery.fn.infos != "function") {
+ jQuery = myjQuery;
+ $ = my$;
+ }
+ });
})(jQuery);
-if(test_conflit!=true)
-{
-//--------------------------------------------------------------
-$_0 = $;
-
- function $(element, nc0) {
- if (typeof jQuery.fn.infos !="function")
- if (typeof myjQuery !="undefined")
- jQuery=myjQuery;
- a = conflit(element, nc0);
- return a;
-
- }
-
- if (typeof ($.ajax) != "function") {
- $.ajax = function (origSettings) {
- jQuery.ajax(origSettings);
- }
-
-
- $.parseJSON = function (msg) {
- return jQuery.parseJSON(msg);
- }
-
-
- }
- //============================================
- /* url (String): URl de la page à charger
- * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
- * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
- * type (String): (optionnel) format des données renvoyées à la fonction de callback
- */
- if (typeof ($.get) != "function") {
- $.get = function ( a, b, c, d) {
- return jQuery.get(a, b, c,d );
- }
- }
- if (typeof ($.post) != "function") {
-
- $.post = function (a, b, c,d) {
- return jQuery.post(a, b, c, d);
- }
- ;
-
- }
-
-
+if (test_conflit != true) {
+ //--------------------------------------------------------------
+ $_0 = $;
+
+ function $(element, nc0) {
+ if (typeof jQuery.fn.infos != "function")
+ if (typeof myjQuery != "undefined")
+ jQuery = myjQuery;
+ a = conflit(element, nc0);
+ return a;
+ }
+
+ if (typeof ($.ajax) != "function") {
+ $.ajax = function (origSettings) {
+ jQuery.ajax(origSettings);
+ }
+
+
+ $.parseJSON = function (msg) {
+ return jQuery.parseJSON(msg);
+ }
+
+
+ }
+ //============================================
+ /* url (String): URl de la page à charger
+ * params (Map): (optionnel) paires de clé/valeur qui seront envoyées au serveur.
+ * callback (Fonction): (optionnel) fonction qui sera éxécutée quand les données sera chargées.
+ * type (String): (optionnel) format des données renvoyées à la fonction de callback
+ */
+ if (typeof ($.get) != "function") {
+ $.get = function (a, b, c, d) {
+ return jQuery.get(a, b, c, d);
+ }
+ }
+ if (typeof ($.post) != "function") {
+
+ $.post = function (a, b, c, d) {
+ return jQuery.post(a, b, c, d);
+ }
+ ;
+
+ }
}
Index: extensions/cl_conflit/js/jquery.dimensions.js
===================================================================
--- extensions/cl_conflit/js/jquery.dimensions.js (revision 8587)
+++ extensions/cl_conflit/js/jquery.dimensions.js (revision 8629)
@@ -19,45 +19,45 @@
*/
jQuery.each(['Height', 'Width'],
- function (i, name) {
- jQuery.fn['inner' + name] = function () {
- if (!this[0]) return;
- var torl = name == 'Height' ? 'Top' : 'Left',
- borr = name == 'Height' ? 'Bottom' : 'Right';
- return this.is(':visible') ? this[0]['client' + name] : num(this, name.toLowerCase()) + num(this, 'padding' + torl) + num(this, 'padding' + borr);
- };
-
- jQuery.fn['outer' + name] = function (options) {
- if (!this[0]) return;
- var torl = name == 'Height' ? 'Top' : 'Left',
- borr = name == 'Height' ? 'Bottom' : 'Right';
- options = options || false;
- options = jQuery.extend({ margin: options });
-
- var val = this.is(':visible') ? this[0]['offset' + name] :
- num(this,
- name.toLowerCase()) +
- num(this, 'border' + torl + 'Width') +
- num(this, 'border' + borr + 'Width') +
- num(this, 'padding' + torl) +
- num(this, 'padding' + borr)
-
- ;
- return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
- };
- });
+ function (i, name) {
+ jQuery.fn['inner' + name] = function () {
+ if (!this[0]) return;
+ var torl = name == 'Height' ? 'Top' : 'Left',
+ borr = name == 'Height' ? 'Bottom' : 'Right';
+ return this.is(':visible') ? this[0]['client' + name] : num(this, name.toLowerCase()) + num(this, 'padding' + torl) + num(this, 'padding' + borr);
+ };
+
+ jQuery.fn['outer' + name] = function (options) {
+ if (!this[0]) return;
+ var torl = name == 'Height' ? 'Top' : 'Left',
+ borr = name == 'Height' ? 'Bottom' : 'Right';
+ options = options || false;
+ options = jQuery.extend({ margin: options });
+
+ var val = this.is(':visible') ? this[0]['offset' + name] :
+ num(this,
+ name.toLowerCase()) +
+ num(this, 'border' + torl + 'Width') +
+ num(this, 'border' + borr + 'Width') +
+ num(this, 'padding' + torl) +
+ num(this, 'padding' + borr)
+
+ ;
+ return val + (options.margin ? (num(this, 'margin' + torl) + num(this, 'margin' + borr)) : 0);
+ };
+ });
/*
*
*/
jQuery.each(['Left', 'Top'],
- function (i, name) {
- jQuery.fn['scroll' + name] = function (val) {
- if (!this[0]) return;
- return val != undefined ? this.each(function () {
- this == window || this == document ? window.scrollTo(name == 'Left' ? val : $(window)['scrollLeft'](),
- name == 'Top' ? val : $(window)['scrollTop']()) : this['scroll' + name] = val;
- }) : 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];
- };
-
- });
+ function (i, name) {
+ jQuery.fn['scroll' + name] = function (val) {
+ if (!this[0]) return;
+ return val != undefined ? this.each(function () {
+ this == window || this == document ? window.scrollTo(name == 'Left' ? val : $(window)['scrollLeft'](),
+ name == 'Top' ? val : $(window)['scrollTop']()) : this['scroll' + name] = val;
+ }) : 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];
+ };
+
+ });
jQuery.fn.extend({
Index: extensions/cl_conflit/main.inc.php
===================================================================
--- extensions/cl_conflit/main.inc.php (revision 8587)
+++ extensions/cl_conflit/main.inc.php (revision 8629)
@@ -2,5 +2,5 @@
/*
Plugin Name: cl_conflit
-Version: 1.0.6
+Version: 1.0.7
Description: gestion des conflits entre jQuery et les autres librairies
Plugin URI: http://piwigo.org/ext/extension_view.php?eid=474
@@ -12,19 +12,14 @@
if (!defined('CONFLIT_PATH'))
define( 'CONFLIT_PATH', PHPWG_PLUGINS_PATH.basename(dirname(__FILE__)).'/' );
-
- $path = CONFLIT_PATH;
-
-//============================================================================
- include ($path."include/constants.php");
-//============================================================================
-include_once(CONFLIT_PATH.'conflit.inc.php');
-
+//==================================================================
+ include_once (CONFLIT_PATH."include/constants.php");
+ include_once(CONFLIT_PATH.'conflit.inc.php');
+//==================================================================
$conflit_controler = new conflit_controler();
add_event_handler('get_admin_plugin_menu_links', array(&$conflit_controler,'cl_conflit_admin') );
-add_event_handler('loc_after_page_header', array(&$conflit_controler, 'cl_conflit_script'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2);
+
+
+add_event_handler('loc_after_page_header', array(&$conflit_controler, 'cl_conflit_script_1'), EVENT_HANDLER_PRIORITY_NEUTRAL+20 , 2);
add_event_handler('loc_end_page_tail',array(&$conflit_controler, 'cl_conflit_script_2'), EVENT_HANDLER_PRIORITY_NEUTRAL );
-add_event_handler('render_element_content',array(&$conflit_controler, 'cl_conflit_script_3'), EVENT_HANDLER_PRIORITY_NEUTRAL-1, 2 );
-
-
?>
Index: extensions/cl_conflit/template/conflit.tpl
===================================================================
--- extensions/cl_conflit/template/conflit.tpl (revision 8587)
+++ extensions/cl_conflit/template/conflit.tpl (revision 8629)
@@ -1,8 +1,8 @@
{html_head}
-
-{known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" }
-{known_script id="conflit_script" src=$CONFLIT_ROOT|@cat:"js/conflit.js"}
- {known_script id="dimensions" src=$CONFLIT_ROOT|@cat:"js/jquery.dimensions.js"}
- {/html_head}
+
+ {known_script id="jquery" src=$ROOT_URL|@cat:"themes/default/js/jquery.packed.js" }
+ {known_script id="dimensions" src=$CONFLIT_PATH|@cat:"js/jquery.dimensions.js"}
+ {known_script id="conflit_script" src=$CONFLIT_PATH|@cat:"js/conflit.js"}
+{/html_head}