jesuswordsonly/plugins/system/jceutilities/js/jceutilities-217.js

9 lines
20 KiB
JavaScript
Raw Normal View History

2023-09-01 01:05:29 +00:00
/*
* JCE Utilities 2.1.7
*
* Copyright (c) 2007 - 2008 Ryan Demmer (www.joomlacontenteditor.net)
* Licensed under the GPL (http://www.gnu.org/licenses/licenses.html#GPL)license.
* JCE Tooltips based on Mootools Tips plugin - http://www.mootools.net
* JCE Lightbox plugin based on Slimbox - http://www.digitalia.be/software/slimbox - and Thickbox - http://jquery.com/demo/thickbox/
*/
jQuery.noConflict();(function($){$.jceUtilities=function(options){return $.jceUtilities.init(options)};$.jceUtilities.init=function(options){this.options=$.extend({popup:{legacy:0,overlay:1,overlayopacity:0.8,overlaycolor:'#000000',resize:1,icons:1,fadespeed:500,scalespeed:500,width:640,height:480,theme:'standard',themecustom:'',themepath:'plugins/system/jceutilities/themes',hideobjects:1,scrollpopup:1},tooltip:{classname:'tooltip',opacity:1,speed:150,position:'br',offsets:{'x':16,'y':16}},pngfix:1,wmode:0,imgpath:'plugins/system/jceutilities/img'},options);$.jceUtilities.tooltip.init(this.options.tooltip);$.jceUtilities.popup.init(this.options.popup);if(this.options.pngfix==1&&$.browser.ie&&$.browser.version<7){this.pngFix()}};$.jceUtilities.cleanupEventStr=function(s){s=""+s;s=s.replace('function anonymous()\n{\n','');s=s.replace('\n}','');s=s.replace(/^return true;/gi,'');return s};$.jceUtilities.parseQuery=function(query){var params={},kv,k,v;if(!query){return params}var pairs=query.split(/[;&]/);for(var i=0;i<pairs.length;i++){kv=pairs[i].split('=');if(!kv||kv.length!=2){continue}k=unescape(kv[0]);v=unescape(kv[1]);v=v.replace(/\+/g,' ');params[k]=v}return params};$.jceUtilities.pngFix=function(){var s,bg;$('img[@src*=".png"]',document.body).each(function(){this.css('filter','progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+this.src+'\', sizingMethod=\'\')');this.src=$.jceUtilities.getSite()+'plugins/system/jceutilities/img/blank.gif'});$('*',document.body).each(function(){s=$(this).css('background-image');if(s&&/\.(png)/i.test(s)){bg=/url\("(.*)"\)/.exec(s)[1];$(this).css('background-image','none');$(this).css('filter',"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+bg+"',sizingMethod='scale')")}})};$.jceUtilities.wmode=function(){$('object').not('#jcepopup-object').each(function(){if(this.classid.toLowerCase()=='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'||this.type.toLowerCase()=='application/x-shockwave-flash'){if(!this.wmode||this.wmode.toLowerCase()=='window'){this.wmode='opaque';if(typeof this.outerHTML=='undefined'){$(this).replaceWith($(this).clone(true))}else{this.outerHTML=this.outerHTML}}}});$('embed[type="application/x-shockwave-flash"]').each(function(){var wm=$(this).attr('wmode');if(!wm||wm.toLowerCase()=='window'){$(this).attr('wmode','opaque');if(typeof this.outerHTML=='undefined'){$(this).replaceWith($(this).clone(true))}else{this.outerHTML=this.outerHTML}}})};$.jceUtilities.getSite=function(){var src;$('script[@src*="plugins/system/jceutilities/js/jceutilities"]').each(function(){src=this.src});return src.substring(0,src.lastIndexOf('plugins/system/jceutilities/js'))||''};$.jceUtilities.tooltip={init:function(options){var t=this;this.options=$.extend({},options);$('.jcetooltip, .jce_tooltip').each(function(){$(this).bind('mouseover',function(){t.show(this)});$(this).bind('mousemove',function(e){t.locate(e)});$(this).bind('mouseout',function(){t.hide(this)}).bind('blur',function(){t.hide(this)})})},show:function(el){var d=document,text=el.title||'',title='';if(/::/.test(text)){var parts=text.split('::');title=$.trim(parts[0]);text=$.trim(parts[1])}this.tip=d.createElement('div');this.tip.title=el.title;$(el).attr('title','');if(title){$(this.tip).append('<h4>'+title+'</h4>')}$(this.tip).append('<p>'+text+'</p>');$(this.tip).addClass(this.options.classname).css('position','absolute').appendTo('body').hide();$(this.tip).animate({'opacity':this.options.opacity},this.options.speed).show();this.exists=true},locate:function(e){if(this.exists){var o=this.options.offsets;var page={'x':e.clientX+$(window).scrollLeft(),'y':e.clientY+$(window).scrollTop()};var tip={'x':this.tip.offsetWidth,'y':this.tip.offsetHeight};var pos={'x':e.clientX+o.x,'y':e.clientY+o.y};switch(this.options.position){case'tl':pos.x=(page.x-tip.x)-o.x;pos.y=(page.y-tip.y)-o.y;break;case'tr':pos.x=page.x+o.x;pos.y=(page.y-tip.y)-o.y;break;case'tc':pos.x=(page.x-Math.round((tip.x/2)))+o.x;pos.y=(page.y-tip.y)-o.y;break;case'bl':pos.x=(page.x-tip.x)-o.x;pos.y=(page.y+tip.y)-o.y;break;case'br':pos.x=page.x+o.x;pos.y=p