aboutsummaryrefslogtreecommitdiffstats
path: root/themes/default/js/plugins
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2010-03-13 00:00:52 +0000
committerplegall <plg@piwigo.org>2010-03-13 00:00:52 +0000
commit14778ce673277f2df41f963aa70df1cbed427294 (patch)
tree8c723d4d9827876dbf19d2bd581405fc50910860 /themes/default/js/plugins
parentc396f08708d431c6f7e8656eaca4fd8e440fdd39 (diff)
feature 1502: based on Dotclear model, P@t has reorganized the way Piwigo
manages template/theme in a simpler "theme only level" architecture. It supports multiple level inheritance. git-svn-id: http://piwigo.org/svn/trunk@5123 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'themes/default/js/plugins')
-rw-r--r--themes/default/js/plugins/jquery.autogrow-textarea.js47
-rw-r--r--themes/default/js/plugins/jquery.cluetip.js543
-rw-r--r--themes/default/js/plugins/jquery.cluetip.packed.js1
-rw-r--r--themes/default/js/plugins/jquery.fcbkcomplete.js588
-rw-r--r--themes/default/js/plugins/jquery.tipTip.minified.js27
5 files changed, 1206 insertions, 0 deletions
diff --git a/themes/default/js/plugins/jquery.autogrow-textarea.js b/themes/default/js/plugins/jquery.autogrow-textarea.js
new file mode 100644
index 000000000..2e85b98af
--- /dev/null
+++ b/themes/default/js/plugins/jquery.autogrow-textarea.js
@@ -0,0 +1,47 @@
+(function($) {
+
+ /*
+ * Auto-growing textareas; technique ripped from Facebook
+ */
+ $.fn.autogrow = function(options) {
+
+ this.filter('textarea').each(function() {
+
+ var $this = $(this),
+ minHeight = $this.height(),
+ lineHeight = $this.css('lineHeight');
+
+ var shadow = $('<div></div>').css({
+ position: 'absolute',
+ top: -10000,
+ left: -10000,
+ width: $(this).width(),
+ fontSize: $this.css('fontSize'),
+ fontFamily: $this.css('fontFamily'),
+ lineHeight: $this.css('lineHeight'),
+ resize: 'none'
+ }).appendTo(document.body);
+
+ var update = function() {
+
+ var val = this.value.replace(/</g, '&lt;')
+ .replace(/>/g, '&gt;')
+ .replace(/&/g, '&amp;')
+ .replace(/\n/g, '<br/>');
+
+ shadow.html(val);
+ $(this).css('height', Math.max(shadow.height() + 20, minHeight));
+
+ }
+
+ $(this).change(update).keyup(update).keydown(update);
+
+ update.apply(this);
+
+ });
+
+ return this;
+
+ }
+
+})(jQuery); \ No newline at end of file
diff --git a/themes/default/js/plugins/jquery.cluetip.js b/themes/default/js/plugins/jquery.cluetip.js
new file mode 100644
index 000000000..83727910c
--- /dev/null
+++ b/themes/default/js/plugins/jquery.cluetip.js
@@ -0,0 +1,543 @@
+/*
+ * jQuery clueTip plugin
+ * Version 0.9.8 (05/22/2008)
+ * @requires jQuery v1.1.4+
+ * @requires Dimensions plugin (for jQuery versions < 1.2.5)
+ *
+ * Dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ *
+ */
+;(function($) {
+/*
+ * @name clueTip
+ * @type jQuery
+ * @cat Plugins/tooltip
+ * @return jQuery
+ * @author Karl Swedberg
+ *
+ * @credit Inspired by Cody Lindley's jTip (http://www.codylindley.com)
+ * @credit Thanks to the following people for their many and varied contributions:
+ Shelane Enos, Glen Lipka, Hector Santos, Torben Schreiter, Dan G. Switzer, Jörn Zaefferer
+ * @credit Thanks to Jonathan Chaffer, as always, for help with the hard parts. :-)
+ */
+
+ /**
+ *
+ * Displays a highly customizable tooltip when the user hovers (default) or clicks (optional) the matched element.
+ * By default, the clueTip plugin loads a page indicated by the "rel" attribute via ajax and displays its contents.
+ * If a "title" attribute is specified, its value is used as the clueTip's heading.
+ * The attribute to be used for both the body and the heading of the clueTip is user-configurable.
+ * Optionally, the clueTip's body can display content from an element on the same page.
+ * * Just indicate the element's id (e.g. "#some-id") in the rel attribute.
+ * Optionally, the clueTip's body can display content from the title attribute, when a delimiter is indicated.
+ * * The string before the first instance of the delimiter is set as the clueTip's heading.
+ * * All subsequent strings are wrapped in separate DIVs and placed in the clueTip's body.
+ * The clueTip plugin allows for many, many more options. Pleasee see the examples and the option descriptions below...
+ *
+ *
+ * @example $('#tip).cluetip();
+ * @desc This is the most basic clueTip. It displays a 275px-wide clueTip on mouseover of the element with an ID of "tip." On mouseout of the element, the clueTip is hidden.
+ *
+ *
+ * @example $('a.clue').cluetip({
+ * hoverClass: 'highlight',
+ * sticky: true,
+ * closePosition: 'bottom',
+ * closeText: '<img src="cross.png" alt="close" />',
+ * truncate: 60,
+ * ajaxSettings: {
+ * type: 'POST'
+ * }
+ * });
+ * @desc Displays a clueTip on mouseover of all <a> elements with class="clue". The hovered element gets a class of "highlight" added to it (so that it can be styled appropriately. This is esp. useful for non-anchor elements.). The clueTip is "sticky," which means that it will not be hidden until the user either clicks on its "close" text/graphic or displays another clueTip. The "close" text/graphic is set to diplay at the bottom of the clueTip (default is top) and display an image rather than the default "Close" text. Moreover, the body of the clueTip is truncated to the first 60 characters, which are followed by an ellipsis (...). Finally, the clueTip retrieves the content using POST rather than the $.ajax method's default "GET."
+ *
+ * More examples can be found at http://plugins.learningjquery.com/cluetip/demo/
+ *
+ * Full list of options/settings can be found at the bottom of this file and at http://plugins.learningjquery.com/cluetip/
+ */
+
+ var $cluetip, $cluetipInner, $cluetipOuter, $cluetipTitle, $cluetipArrows, $dropShadow, imgCount;
+ $.fn.cluetip = function(js, options) {
+ if (typeof js == 'object') {
+ options = js;
+ js = null;
+ }
+ return this.each(function(index) {
+ var $this = $(this);
+
+ // support metadata plugin (v1.0 and 2.0)
+ var opts = $.extend(false, {}, $.fn.cluetip.defaults, options || {}, $.metadata ? $this.metadata() : $.meta ? $this.data() : {});
+
+ // start out with no contents (for ajax activation)
+ var cluetipContents = false;
+ var cluezIndex = parseInt(opts.cluezIndex, 10)-1;
+ var isActive = false, closeOnDelay = 0;
+
+ // create the cluetip divs
+ if (!$('#cluetip').length) {
+ $cluetipInner = $('<div id="cluetip-inner"></div>');
+ $cluetipTitle = $('<h3 id="cluetip-title"></h3>');
+ $cluetipOuter = $('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);
+ $cluetip = $('<div id="cluetip"></div>').css({zIndex: opts.cluezIndex})
+ .append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide();
+ $('<div id="cluetip-waitimage"></div>').css({position: 'absolute', zIndex: cluezIndex-1})
+ .insertBefore('#cluetip').hide();
+ $cluetip.css({position: 'absolute', zIndex: cluezIndex});
+ $cluetipOuter.css({position: 'relative', zIndex: cluezIndex+1});
+ $cluetipArrows = $('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex: cluezIndex+1}).appendTo('#cluetip');
+ }
+ var dropShadowSteps = (opts.dropShadow) ? +opts.dropShadowSteps : 0;
+ if (!$dropShadow) {
+ $dropShadow = $([]);
+ for (var i=0; i < dropShadowSteps; i++) {
+ $dropShadow = $dropShadow.add($('<div></div>').css({zIndex: cluezIndex-i-1, opacity:.1, top: 1+i, left: 1+i}));
+ };
+ $dropShadow.css({position: 'absolute', backgroundColor: '#000'})
+ .prependTo($cluetip);
+ }
+ var tipAttribute = $this.attr(opts.attribute), ctClass = opts.cluetipClass;
+ if (!tipAttribute && !opts.splitTitle && !js) return true;
+ // if hideLocal is set to true, on DOM ready hide the local content that will be displayed in the clueTip
+ if (opts.local && opts.hideLocal) { $(tipAttribute + ':first').hide(); }
+ var tOffset = parseInt(opts.topOffset, 10), lOffset = parseInt(opts.leftOffset, 10);
+ // vertical measurement variables
+ var tipHeight, wHeight;
+ var defHeight = isNaN(parseInt(opts.height, 10)) ? 'auto' : (/\D/g).test(opts.height) ? opts.height : opts.height + 'px';
+ var sTop, linkTop, posY, tipY, mouseY, baseline;
+ // horizontal measurement variables
+ var tipInnerWidth = isNaN(parseInt(opts.width, 10)) ? 275 : parseInt(opts.width, 10);
+ var tipWidth = tipInnerWidth + (parseInt($cluetip.css('paddingLeft'))||0) + (parseInt($cluetip.css('paddingRight'))||0) + dropShadowSteps;
+ var linkWidth = this.offsetWidth;
+ var linkLeft, posX, tipX, mouseX, winWidth;
+
+ // parse the title
+ var tipParts;
+ var tipTitle = (opts.attribute != 'title') ? $this.attr(opts.titleAttribute) : '';
+ if (opts.splitTitle) {
+ if(tipTitle == undefined) {tipTitle = '';}
+ tipParts = tipTitle.split(opts.splitTitle);
+ tipTitle = tipParts.shift();
+ }
+ var localContent;
+
+/***************************************
+* ACTIVATION
+****************************************/
+
+//activate clueTip
+ var activate = function(event) {
+ if (!opts.onActivate($this)) {
+ return false;
+ }
+ isActive = true;
+ $cluetip.removeClass().css({width: tipInnerWidth});
+ if (tipAttribute == $this.attr('href')) {
+ $this.css('cursor', opts.cursor);
+ }
+ $this.attr('title','');
+ if (opts.hoverClass) {
+ $this.addClass(opts.hoverClass);
+ }
+ linkTop = posY = $this.offset().top;
+ linkLeft = $this.offset().left;
+ mouseX = event.pageX;
+ mouseY = event.pageY;
+ if ($this[0].tagName.toLowerCase() != 'area') {
+ sTop = $(document).scrollTop();
+ winWidth = $(window).width();
+ }
+// position clueTip horizontally
+ if (opts.positionBy == 'fixed') {
+ posX = linkWidth + linkLeft + lOffset;
+ $cluetip.css({left: posX});
+ } else {
+ posX = (linkWidth > linkLeft && linkLeft > tipWidth)
+ || linkLeft + linkWidth + tipWidth + lOffset > winWidth
+ ? linkLeft - tipWidth - lOffset
+ : linkWidth + linkLeft + lOffset;
+ if ($this[0].tagName.toLowerCase() == 'area' || opts.positionBy == 'mouse' || linkWidth + tipWidth > winWidth) { // position by mouse
+ if (mouseX + 20 + tipWidth > winWidth) {
+ $cluetip.addClass(' cluetip-' + ctClass);
+ posX = (mouseX - tipWidth - lOffset) >= 0 ? mouseX - tipWidth - lOffset - parseInt($cluetip.css('marginLeft'),10) + parseInt($cluetipInner.css('marginRight'),10) : mouseX - (tipWidth/2);
+ } else {
+ posX = mouseX + lOffset;
+ }
+ }
+ var pY = posX < 0 ? event.pageY + tOffset : event.pageY;
+ $cluetip.css({left: (posX > 0 && opts.positionBy != 'bottomTop') ? posX : (mouseX + (tipWidth/2) > winWidth) ? winWidth/2 - tipWidth/2 : Math.max(mouseX - (tipWidth/2),0)});
+ }
+ wHeight = $(window).height();
+
+/***************************************
+* load a string from cluetip method's first argument
+***************************************/
+ if (js) {
+ $cluetipInner.html(js);
+ cluetipShow(pY);
+ }
+/***************************************
+* load the title attribute only (or user-selected attribute).
+* clueTip title is the string before the first delimiter
+* subsequent delimiters place clueTip body text on separate lines
+***************************************/
+
+ else if (tipParts) {
+ var tpl = tipParts.length;
+ for (var i=0; i < tpl; i++){
+ if (i == 0) {
+ $cluetipInner.html(tipParts[i]);
+ } else {
+ $cluetipInner.append('<div class="split-body">' + tipParts[i] + '</div>');
+ }
+ };
+ cluetipShow(pY);
+ }
+/***************************************
+* load external file via ajax
+***************************************/
+
+ else if (!opts.local && tipAttribute.indexOf('#') != 0) {
+ if (cluetipContents && opts.ajaxCache) {
+ $cluetipInner.html(cluetipContents);
+ cluetipShow(pY);
+ }
+ else {
+ var ajaxSettings = opts.ajaxSettings;
+ ajaxSettings.url = tipAttribute;
+ ajaxSettings.beforeSend = function() {
+ $cluetipOuter.children().empty();
+ if (opts.waitImage) {
+ $('#cluetip-waitimage')
+ .css({top: mouseY+20, left: mouseX+20})
+ .show();
+ }
+ };
+ ajaxSettings.error = function() {
+ if (isActive) {
+ $cluetipInner.html('<i>sorry, the contents could not be loaded</i>');
+ }
+ };
+ ajaxSettings.success = function(data) {
+ cluetipContents = opts.ajaxProcess(data);
+ if (isActive) {
+ $cluetipInner.html(cluetipContents);
+ }
+ };
+ ajaxSettings.complete = function() {
+ imgCount = $('#cluetip-inner img').length;
+ if (imgCount && !$.browser.opera) {
+ $('#cluetip-inner img').load(function() {
+ imgCount--;
+ if (imgCount<1) {
+ $('#cluetip-waitimage').hide();
+ if (isActive) cluetipShow(pY);
+ }
+ });
+ } else {
+ $('#cluetip-waitimage').hide();
+ if (isActive) cluetipShow(pY);
+ }
+ };
+ $.ajax(ajaxSettings);
+ }
+
+/***************************************
+* load an element from the same page
+***************************************/
+ } else if (opts.local){
+ var $localContent = $(tipAttribute + ':first');
+ var localCluetip = $.fn.wrapInner ? $localContent.wrapInner('<div></div>').children().clone(true) : $localContent.html();
+ $.fn.wrapInner ? $cluetipInner.empty().append(localCluetip) : $cluetipInner.html(localCluetip);
+ cluetipShow(pY);
+ }
+ };
+
+// get dimensions and options for cluetip and prepare it to be shown
+ var cluetipShow = function(bpY) {
+ $cluetip.addClass('cluetip-' + ctClass);
+
+ if (opts.truncate) {
+ var $truncloaded = $cluetipInner.text().slice(0,opts.truncate) + '...';
+ $cluetipInner.html($truncloaded);
+ }
+ function doNothing() {}; //empty function
+ tipTitle ? $cluetipTitle.show().html(tipTitle) : (opts.showTitle) ? $cluetipTitle.show().html('&nbsp;') : $cluetipTitle.hide();
+ if (opts.sticky) {
+ var $closeLink = $('<div id="cluetip-close"><a href="#">' + opts.closeText + '</a></div>');
+ (opts.closePosition == 'bottom') ? $closeLink.appendTo($cluetipInner) : (opts.closePosition == 'title') ? $closeLink.prependTo($cluetipTitle) : $closeLink.prependTo($cluetipInner);
+ $closeLink.click(function() {
+ cluetipClose();
+ return false;
+ });
+ if (opts.mouseOutClose) {
+ if ($.fn.hoverIntent && opts.hoverIntent) {
+ $cluetip.hoverIntent({
+ over: doNothing,
+ timeout: opts.hoverIntent.timeout,
+ out: function() { $closeLink.trigger('click'); }
+ });
+ } else {
+ $cluetip.hover(doNothing,
+ function() {$closeLink.trigger('click'); });
+ }
+ } else {
+ $cluetip.unbind('mouseout');
+ }
+ }
+// now that content is loaded, finish the positioning
+ var direction = '';
+ $cluetipOuter.css({overflow: defHeight == 'auto' ? 'visible' : 'auto', height: defHeight});
+ tipHeight = defHeight == 'auto' ? Math.max($cluetip.outerHeight(),$cluetip.height()) : parseInt(defHeight,10);
+ tipY = posY;
+ baseline = sTop + wHeight;
+ if (opts.positionBy == 'fixed') {
+ tipY = posY - opts.dropShadowSteps + tOffset;
+ } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX) || opts.positionBy == 'bottomTop') {
+ if (posY + tipHeight + tOffset > baseline && mouseY - sTop > tipHeight + tOffset) {
+ tipY = mouseY - tipHeight - tOffset;
+ direction = 'top';
+ } else {
+ tipY = mouseY + tOffset;
+ direction = 'bottom';
+ }
+ } else if ( posY + tipHeight + tOffset > baseline ) {
+ tipY = (tipHeight >= wHeight) ? sTop : baseline - tipHeight - tOffset;
+ } else if ($this.css('display') == 'block' || $this[0].tagName.toLowerCase() == 'area' || opts.positionBy == "mouse") {
+ tipY = bpY - tOffset;
+ } else {
+ tipY = posY - opts.dropShadowSteps;
+ }
+ if (direction == '') {
+ posX < linkLeft ? direction = 'left' : direction = 'right';
+ }
+ $cluetip.css({top: tipY + 'px'}).removeClass().addClass('clue-' + direction + '-' + ctClass).addClass(' cluetip-' + ctClass);
+ if (opts.arrows) { // set up arrow positioning to align with element
+ var bgY = (posY - tipY - opts.dropShadowSteps);
+ $cluetipArrows.css({top: (/(left|right)/.test(direction) && posX >=0 && bgY > 0) ? bgY + 'px' : /(left|right)/.test(direction) ? 0 : ''}).show();
+ } else {
+ $cluetipArrows.hide();
+ }
+
+// (first hide, then) ***SHOW THE CLUETIP***
+ $dropShadow.hide();
+ $cluetip.hide()[opts.fx.open](opts.fx.open != 'show' && opts.fx.openSpeed);
+ if (opts.dropShadow) $dropShadow.css({height: tipHeight, width: tipInnerWidth}).show();
+ if ($.fn.bgiframe) { $cluetip.bgiframe(); }
+ // trigger the optional onShow function
+ if (opts.delayedClose > 0) {
+ closeOnDelay = setTimeout(cluetipClose, opts.delayedClose);
+ }
+ opts.onShow($cluetip, $cluetipInner);
+
+ };
+
+/***************************************
+ =INACTIVATION
+-------------------------------------- */
+ var inactivate = function() {
+ isActive = false;
+ $('#cluetip-waitimage').hide();
+ if (!opts.sticky || (/click|toggle/).test(opts.activation) ) {
+ cluetipClose();
+clearTimeout(closeOnDelay);
+ };
+ if (opts.hoverClass) {
+ $this.removeClass(opts.hoverClass);
+ }
+ $('.cluetip-clicked').removeClass('cluetip-clicked');
+ };
+// close cluetip and reset some things
+ var cluetipClose = function() {
+ $cluetipOuter
+ .parent().hide().removeClass().end()
+ .children().empty();
+ if (tipTitle) {
+ $this.attr(opts.titleAttribute, tipTitle);
+ }
+ $this.css('cursor','');
+ if (opts.arrows) $cluetipArrows.css({top: ''});
+ };
+
+/***************************************
+ =BIND EVENTS
+-------------------------------------- */
+ // activate by click
+ if ( (/click|toggle/).test(opts.activation) ) {
+ $this.click(function(event) {
+ if ($cluetip.is(':hidden') || !$this.is('.cluetip-clicked')) {
+ activate(event);
+ $('.cluetip-clicked').removeClass('cluetip-clicked');
+ $this.addClass('cluetip-clicked');
+
+ } else {
+ inactivate(event);
+
+ }
+ this.blur();
+ return false;
+ });
+ // activate by focus; inactivate by blur
+ } else if (opts.activation == 'focus') {
+ $this.focus(function(event) {
+ activate(event);
+ });
+ $this.blur(function(event) {
+ inactivate(event);
+ });
+ // activate by hover
+ // clicking is returned false if cluetip url is same as href url
+ } else {
+ $this.click(function() {
+ if ($this.attr('href') && $this.attr('href') == tipAttribute && !opts.clickThrough) {
+ return false;
+ }
+ });
+ //set up mouse tracking
+ var mouseTracks = function(evt) {
+ if (opts.tracking == true) {
+ var trackX = posX - evt.pageX;
+ var trackY = tipY ? tipY - evt.pageY : posY - evt.pageY;
+ $this.mousemove(function(evt) {
+ $cluetip.css({left: evt.pageX + trackX, top: evt.pageY + trackY });
+ });
+ }
+ };
+ if ($.fn.hoverIntent && opts.hoverIntent) {
+ $this.mouseover(function() {$this.attr('title',''); })
+ .hoverIntent({
+ sensitivity: opts.hoverIntent.sensitivity,
+ interval: opts.hoverIntent.interval,
+ over: function(event) {
+ activate(event);
+ mouseTracks(event);
+ },
+ timeout: opts.hoverIntent.timeout,
+ out: function(event) {inactivate(event); $this.unbind('mousemove');}
+ });
+ } else {
+ $this.hover(function(event) {
+ activate(event);
+ mouseTracks(event);
+ }, function(event) {
+ inactivate(event);
+ $this.unbind('mousemove');
+ });
+ }
+ }
+ });
+ };
+
+/*
+ * options for clueTip
+ *
+ * each one can be explicitly overridden by changing its value.
+ * for example: $.fn.cluetip.defaults.width = 200;
+ * would change the default width for all clueTips to 200.
+ *
+ * each one can also be overridden by passing an options map to the cluetip method.
+ * for example: $('a.example').cluetip({width: 200});
+ * would change the default width to 200 for clueTips invoked by a link with class of "example"
+ *
+ */
+
+ $.fn.cluetip.defaults = { // set up default options
+ width: 275, // The width of the clueTip
+ height: 'auto', // The height of the clueTip
+ cluezIndex: 97, // Sets the z-index style property of the clueTip
+ positionBy: 'auto', // Sets the type of positioning: 'auto', 'mouse','bottomTop', 'fixed'
+ topOffset: 15, // Number of px to offset clueTip from top of invoking element
+ leftOffset: 15, // Number of px to offset clueTip from left of invoking element
+ local: false, // Whether to use content from the same page for the clueTip's body
+ hideLocal: true, // If local option is set to true, this determines whether local content
+ // to be shown in clueTip should be hidden at its original location
+ attribute: 'rel', // the attribute to be used for fetching the clueTip's body content
+ titleAttribute: 'title', // the attribute to be used for fetching the clueTip's title
+ splitTitle: '', // A character used to split the title attribute into the clueTip title and divs
+ // within the clueTip body. more info below [6]
+ showTitle: true, // show title bar of the clueTip, even if title attribute not set
+ cluetipClass: 'default',// class added to outermost clueTip div in the form of 'cluetip-' + clueTipClass.
+ hoverClass: '', // class applied to the invoking element onmouseover and removed onmouseout
+ waitImage: true, // whether to show a "loading" img, which is set in jquery.cluetip.css
+ cursor: 'help',
+ arrows: false, // if true, displays arrow on appropriate side of clueTip
+ dropShadow: true, // set to false if you don't want the drop-shadow effect on the clueTip
+ dropShadowSteps: 6, // adjusts the size of the drop shadow
+ sticky: false, // keep visible until manually closed
+ mouseOutClose: false, // close when clueTip is moused out
+ activation: 'hover', // set to 'click' to force user to click to show clueTip
+ // set to 'focus' to show on focus of a form element and hide on blur
+ clickThrough: false, // if true, and activation is not 'click', then clicking on link will take user to the link's href,
+ // even if href and tipAttribute are equal
+ tracking: false, // if true, clueTip will track mouse movement (experimental)
+ delayedClose: 0, // close clueTip on a timed delay (experimental)
+ closePosition: 'top', // location of close text for sticky cluetips; can be 'top' or 'bottom' or 'title'
+ closeText: 'Close', // text (or HTML) to to be clicked to close sticky clueTips
+ truncate: 0, // number of characters to truncate clueTip's contents. if 0, no truncation occurs
+
+ // effect and speed for opening clueTips
+ fx: {
+ open: 'show', // can be 'show' or 'slideDown' or 'fadeIn'
+ openSpeed: ''
+ },
+
+ // settings for when hoverIntent plugin is used
+ hoverIntent: {
+ sensitivity: 3,
+ interval: 50,
+ timeout: 0
+ },
+
+ // function to run just before clueTip is shown.
+ onActivate: function(e) {return true;},
+
+ // function to run just after clueTip is shown.
+ onShow: function(ct, c){},
+
+ // whether to cache results of ajax request to avoid unnecessary hits to server
+ ajaxCache: true,
+
+ // process data retrieved via xhr before it's displayed
+ ajaxProcess: function(data) {
+ data = data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g, '').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');
+ return data;
+ },
+
+ // can pass in standard $.ajax() parameters, not including error, complete, success, and url
+ ajaxSettings: {
+ dataType: 'html'
+ },
+ debug: false
+ };
+
+
+/*
+ * Global defaults for clueTips. Apply to all calls to the clueTip plugin.
+ *
+ * @example $.cluetip.setup({
+ * insertionType: 'prependTo',
+ * insertionElement: '#container'
+ * });
+ *
+ * @property
+ * @name $.cluetip.setup
+ * @type Map
+ * @cat Plugins/tooltip
+ * @option String insertionType: Default is 'appendTo'. Determines the method to be used for inserting the clueTip into the DOM. Permitted values are 'appendTo', 'prependTo', 'insertBefore', and 'insertAfter'
+ * @option String insertionElement: Default is 'body'. Determines which element in the DOM the plugin will reference when inserting the clueTip.
+ *
+ */
+
+ var insertionType = 'appendTo', insertionElement = 'body';
+ $.cluetip = {};
+ $.cluetip.setup = function(options) {
+ if (options && options.insertionType && (options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)) {
+ insertionType = options.insertionType;
+ }
+ if (options && options.insertionElement) {
+ insertionElement = options.insertionElement;
+ }
+ };
+
+})(jQuery);
diff --git a/themes/default/js/plugins/jquery.cluetip.packed.js b/themes/default/js/plugins/jquery.cluetip.packed.js
new file mode 100644
index 000000000..99b15f30c
--- /dev/null
+++ b/themes/default/js/plugins/jquery.cluetip.packed.js
@@ -0,0 +1 @@
+;(function($){var $cluetip,$cluetipInner,$cluetipOuter,$cluetipTitle,$cluetipArrows,$dropShadow,imgCount;$.fn.cluetip=function(js,options){if(typeof js=='object'){options=js;js=null}return this.each(function(index){var $this=$(this);var opts=$.extend(false,{},$.fn.cluetip.defaults,options||{},$.metadata?$this.metadata():$.meta?$this.data():{});var cluetipContents=false;var cluezIndex=parseInt(opts.cluezIndex,10)-1;var isActive=false,closeOnDelay=0;if(!$('#cluetip').length){$cluetipInner=$('<div id="cluetip-inner"></div>');$cluetipTitle=$('<h3 id="cluetip-title"></h3>');$cluetipOuter=$('<div id="cluetip-outer"></div>').append($cluetipInner).prepend($cluetipTitle);$cluetip=$('<div id="cluetip"></div>').css({zIndex:opts.cluezIndex}).append($cluetipOuter).append('<div id="cluetip-extra"></div>')[insertionType](insertionElement).hide();$('<div id="cluetip-waitimage"></div>').css({position:'absolute',zIndex:cluezIndex-1}).insertBefore('#cluetip').hide();$cluetip.css({position:'absolute',zIndex:cluezIndex});$cluetipOuter.css({position:'relative',zIndex:cluezIndex+1});$cluetipArrows=$('<div id="cluetip-arrows" class="cluetip-arrows"></div>').css({zIndex:cluezIndex+1}).appendTo('#cluetip')}var dropShadowSteps=(opts.dropShadow)?+opts.dropShadowSteps:0;if(!$dropShadow){$dropShadow=$([]);for(var i=0;i<dropShadowSteps;i++){$dropShadow=$dropShadow.add($('<div></div>').css({zIndex:cluezIndex-i-1,opacity:.1,top:1+i,left:1+i}))};$dropShadow.css({position:'absolute',backgroundColor:'#000'}).prependTo($cluetip)}var tipAttribute=$this.attr(opts.attribute),ctClass=opts.cluetipClass;if(!tipAttribute&&!opts.splitTitle&&!js)return true;if(opts.local&&opts.hideLocal){$(tipAttribute+':first').hide()}var tOffset=parseInt(opts.topOffset,10),lOffset=parseInt(opts.leftOffset,10);var tipHeight,wHeight;var defHeight=isNaN(parseInt(opts.height,10))?'auto':(/\D/g).test(opts.height)?opts.height:opts.height+'px';var sTop,linkTop,posY,tipY,mouseY,baseline;var tipInnerWidth=isNaN(parseInt(opts.width,10))?275:parseInt(opts.width,10);var tipWidth=tipInnerWidth+(parseInt($cluetip.css('paddingLeft'))||0)+(parseInt($cluetip.css('paddingRight'))||0)+dropShadowSteps;var linkWidth=this.offsetWidth;var linkLeft,posX,tipX,mouseX,winWidth;var tipParts;var tipTitle=(opts.attribute!='title')?$this.attr(opts.titleAttribute):'';if(opts.splitTitle){if(tipTitle==undefined){tipTitle=''}tipParts=tipTitle.split(opts.splitTitle);tipTitle=tipParts.shift()}var localContent;var activate=function(event){if(!opts.onActivate($this)){return false}isActive=true;$cluetip.removeClass().css({width:tipInnerWidth});if(tipAttribute==$this.attr('href')){$this.css('cursor',opts.cursor)}$this.attr('title','');if(opts.hoverClass){$this.addClass(opts.hoverClass)}linkTop=posY=$this.offset().top;linkLeft=$this.offset().left;mouseX=event.pageX;mouseY=event.pageY;if($this[0].tagName.toLowerCase()!='area'){sTop=$(document).scrollTop();winWidth=$(window).width()}if(opts.positionBy=='fixed'){posX=linkWidth+linkLeft+lOffset;$cluetip.css({left:posX})}else{posX=(linkWidth>linkLeft&&linkLeft>tipWidth)||linkLeft+linkWidth+tipWidth+lOffset>winWidth?linkLeft-tipWidth-lOffset:linkWidth+linkLeft+lOffset;if($this[0].tagName.toLowerCase()=='area'||opts.positionBy=='mouse'||linkWidth+tipWidth>winWidth){if(mouseX+20+tipWidth>winWidth){$cluetip.addClass(' cluetip-'+ctClass);posX=(mouseX-tipWidth-lOffset)>=0?mouseX-tipWidth-lOffset-parseInt($cluetip.css('marginLeft'),10)+parseInt($cluetipInner.css('marginRight'),10):mouseX-(tipWidth/2)}else{posX=mouseX+lOffset}}var pY=posX<0?event.pageY+tOffset:event.pageY;$cluetip.css({left:(posX>0&&opts.positionBy!='bottomTop')?posX:(mouseX+(tipWidth/2)>winWidth)?winWidth/2-tipWidth/2:Math.max(mouseX-(tipWidth/2),0)})}wHeight=$(window).height();if(js){$cluetipInner.html(js);cluetipShow(pY)}else if(tipParts){var tpl=tipParts.length;for(var i=0;i<tpl;i++){if(i==0){$cluetipInner.html(tipParts[i])}else{$cluetipInner.append('<div class="split-body">'+tipParts[i]+'</div>')}};cluetipShow(pY)}else if(!opts.local&&tipAttribute.indexOf('#')!=0){if(cluetipContents&&opts.ajaxCache){$cluetipInner.html(cluetipContents);cluetipShow(pY)}else{var ajaxSettings=opts.ajaxSettings;ajaxSettings.url=tipAttribute;ajaxSettings.beforeSend=function(){$cluetipOuter.children().empty();if(opts.waitImage){$('#cluetip-waitimage').css({top:mouseY+20,left:mouseX+20}).show()}};ajaxSettings.error=function(){if(isActive){$cluetipInner.html('<i>sorry, the contents could not be loaded</i>')}};ajaxSettings.success=function(data){cluetipContents=opts.ajaxProcess(data);if(isActive){$cluetipInner.html(cluetipContents)}};ajaxSettings.complete=function(){imgCount=$('#cluetip-inner img').length;if(imgCount&&!$.browser.opera){$('#cluetip-inner img').load(function(){imgCount--;if(imgCount<1){$('#cluetip-waitimage').hide();if(isActive)cluetipShow(pY)}})}else{$('#cluetip-waitimage').hide();if(isActive)cluetipShow(pY)}};$.ajax(ajaxSettings)}}else if(opts.local){var $localContent=$(tipAttribute+':first');var localCluetip=$.fn.wrapInner?$localContent.wrapInner('<div></div>').children().clone(true):$localContent.html();$.fn.wrapInner?$cluetipInner.empty().append(localCluetip):$cluetipInner.html(localCluetip);cluetipShow(pY)}};var cluetipShow=function(bpY){$cluetip.addClass('cluetip-'+ctClass);if(opts.truncate){var $truncloaded=$cluetipInner.text().slice(0,opts.truncate)+'...';$cluetipInner.html($truncloaded)}function doNothing(){};tipTitle?$cluetipTitle.show().html(tipTitle):(opts.showTitle)?$cluetipTitle.show().html('&nbsp;'):$cluetipTitle.hide();if(opts.sticky){var $closeLink=$('<div id="cluetip-close"><a href="#">'+opts.closeText+'</a></div>');(opts.closePosition=='bottom')?$closeLink.appendTo($cluetipInner):(opts.closePosition=='title')?$closeLink.prependTo($cluetipTitle):$closeLink.prependTo($cluetipInner);$closeLink.click(function(){cluetipClose();return false});if(opts.mouseOutClose){if($.fn.hoverIntent&&opts.hoverIntent){$cluetip.hoverIntent({over:doNothing,timeout:opts.hoverIntent.timeout,out:function(){$closeLink.trigger('click')}})}else{$cluetip.hover(doNothing,function(){$closeLink.trigger('click')})}}else{$cluetip.unbind('mouseout')}}var direction='';$cluetipOuter.css({overflow:defHeight=='auto'?'visible':'auto',height:defHeight});tipHeight=defHeight=='auto'?Math.max($cluetip.outerHeight(),$cluetip.height()):parseInt(defHeight,10);tipY=posY;baseline=sTop+wHeight;if(opts.positionBy=='fixed'){tipY=posY-opts.dropShadowSteps+tOffset}else if((posX<mouseX&&Math.max(posX,0)+tipWidth>mouseX)||opts.positionBy=='bottomTop'){if(posY+tipHeight+tOffset>baseline&&mouseY-sTop>tipHeight+tOffset){tipY=mouseY-tipHeight-tOffset;direction='top'}else{tipY=mouseY+tOffset;direction='bottom'}}else if(posY+tipHeight+tOffset>baseline){tipY=(tipHeight>=wHeight)?sTop:baseline-tipHeight-tOffset}else if($this.css('display')=='block'||$this[0].tagName.toLowerCase()=='area'||opts.positionBy=="mouse"){tipY=bpY-tOffset}else{tipY=posY-opts.dropShadowSteps}if(direction==''){posX<linkLeft?direction='left':direction='right'}$cluetip.css({top:tipY+'px'}).removeClass().addClass('clue-'+direction+'-'+ctClass).addClass(' cluetip-'+ctClass);if(opts.arrows){var bgY=(posY-tipY-opts.dropShadowSteps);$cluetipArrows.css({top:(/(left|right)/.test(direction)&&posX>=0&&bgY>0)?bgY+'px':/(left|right)/.test(direction)?0:''}).show()}else{$cluetipArrows.hide()}$dropShadow.hide();$cluetip.hide()[opts.fx.open](opts.fx.open!='show'&&opts.fx.openSpeed);if(opts.dropShadow)$dropShadow.css({height:tipHeight,width:tipInnerWidth}).show();if($.fn.bgiframe){$cluetip.bgiframe()}if(opts.delayedClose>0){closeOnDelay=setTimeout(cluetipClose,opts.delayedClose)}opts.onShow($cluetip,$cluetipInner)};var inactivate=function(){isActive=false;$('#cluetip-waitimage').hide();if(!opts.sticky||(/click|toggle/).test(opts.activation)){cluetipClose();clearTimeout(closeOnDelay)};if(opts.hoverClass){$this.removeClass(opts.hoverClass)}$('.cluetip-clicked').removeClass('cluetip-clicked')};var cluetipClose=function(){$cluetipOuter.parent().hide().removeClass().end().children().empty();if(tipTitle){$this.attr(opts.titleAttribute,tipTitle)}$this.css('cursor','');if(opts.arrows)$cluetipArrows.css({top:''})};if((/click|toggle/).test(opts.activation)){$this.click(function(event){if($cluetip.is(':hidden')||!$this.is('.cluetip-clicked')){activate(event);$('.cluetip-clicked').removeClass('cluetip-clicked');$this.addClass('cluetip-clicked')}else{inactivate(event)}this.blur();return false})}else if(opts.activation=='focus'){$this.focus(function(event){activate(event)});$this.blur(function(event){inactivate(event)})}else{$this.click(function(){if($this.attr('href')&&$this.attr('href')==tipAttribute&&!opts.clickThrough){return false}});var mouseTracks=function(evt){if(opts.tracking==true){var trackX=posX-evt.pageX;var trackY=tipY?tipY-evt.pageY:posY-evt.pageY;$this.mousemove(function(evt){$cluetip.css({left:evt.pageX+trackX,top:evt.pageY+trackY})})}};if($.fn.hoverIntent&&opts.hoverIntent){$this.mouseover(function(){$this.attr('title','')}).hoverIntent({sensitivity:opts.hoverIntent.sensitivity,interval:opts.hoverIntent.interval,over:function(event){activate(event);mouseTracks(event)},timeout:opts.hoverIntent.timeout,out:function(event){inactivate(event);$this.unbind('mousemove')}})}else{$this.hover(function(event){activate(event);mouseTracks(event)},function(event){inactivate(event);$this.unbind('mousemove')})}}})};$.fn.cluetip.defaults={width:275,height:'auto',cluezIndex:97,positionBy:'auto',topOffset:15,leftOffset:15,local:false,hideLocal:true,attribute:'rel',titleAttribute:'title',splitTitle:'',showTitle:true,cluetipClass:'default',hoverClass:'',waitImage:true,cursor:'help',arrows:false,dropShadow:true,dropShadowSteps:6,sticky:false,mouseOutClose:false,activation:'hover',clickThrough:false,tracking:false,delayedClose:0,closePosition:'top',closeText:'Close',truncate:0,fx:{open:'show',openSpeed:''},hoverIntent:{sensitivity:3,interval:50,timeout:0},onActivate:function(e){return true},onShow:function(ct,c){},ajaxCache:true,ajaxProcess:function(data){data=data.replace(/<s(cript|tyle)(.|\s)*?\/s(cript|tyle)>/g,'').replace(/<(link|title)(.|\s)*?\/(link|title)>/g,'');return data},ajaxSettings:{dataType:'html'},debug:false};var insertionType='appendTo',insertionElement='body';$.cluetip={};$.cluetip.setup=function(options){if(options&&options.insertionType&&(options.insertionType).match(/appendTo|prependTo|insertBefore|insertAfter/)){insertionType=options.insertionType}if(options&&options.insertionElement){insertionElement=options.insertionElement}}})(jQuery); \ No newline at end of file
diff --git a/themes/default/js/plugins/jquery.fcbkcomplete.js b/themes/default/js/plugins/jquery.fcbkcomplete.js
new file mode 100644
index 000000000..86b3b6ab2
--- /dev/null
+++ b/themes/default/js/plugins/jquery.fcbkcomplete.js
@@ -0,0 +1,588 @@
+/*
+ FCBKcomplete 2.7
+ - Jquery version required: 1.2.x, 1.3.x, 1.4.x
+
+ Changelog:
+ - 2.00 new version of fcbkcomplete
+
+ - 2.01 fixed bugs & added features
+ fixed filter bug for preadded items
+ focus on the input after selecting tag
+ the element removed pressing backspace when the element is selected
+ input tag in the control has a border in IE7
+ added iterate over each match and apply the plugin separately
+ set focus on the input after selecting tag
+
+ - 2.02 fixed fist element selected bug
+ fixed defaultfilter error bug
+
+ - 2.5 removed selected="selected" attribute due ie bug
+ element search algorithm changed
+ better performance fix added
+ fixed many small bugs
+ onselect event added
+ onremove event added
+
+ - 2.6 ie6/7 support fix added
+ added new public method addItem due request
+ added new options "firstselected" that you can set true/false to select first element on dropdown list
+ autoexpand input element added
+ removeItem bug fixed
+ and many more bug fixed
+ fixed public method to use it $("elem").trigger("addItem",[{"title": "test", "value": "test"}]);
+
+- 2.7 jquery 1.4 compability
+ item lock possability added by adding locked class to preadded option <option value="value" class="selected locked">text</option>
+ maximum item that can be added to the list
+ */
+/* Coded by: emposha <admin@emposha.com> */
+/* Copyright: Emposha.com <http://www.emposha.com/> - Distributed under MIT - Keep this message! */
+/*
+ * json_url - url to fetch json object
+ * cache - use cache
+ * height - maximum number of element shown before scroll will apear
+ * newel - show typed text like a element
+ * firstselected - automaticly select first element from dropdown
+ * filter_case - case sensitive filter
+ * filter_selected - filter selected items from list
+ * complete_text - text for complete page
+ * maxshownitems - maximum numbers that will be shown at dropdown list (less better performance)
+ * onselect - fire event on item select
+ * onremove - fire event on item remove
+ * maxitimes - maximum items that can be added
+ */
+jQuery(function($){
+ $.fn.fcbkcomplete = function(opt){
+ return this.each(function(){
+ function init(){
+ createFCBK();
+ preSet();
+ addInput(0);
+ }
+
+ function createFCBK(){
+ element.hide();
+ element.attr("multiple", "multiple");
+ if (element.attr("name").indexOf("[]") == -1) {
+ element.attr("name", element.attr("name") + "[]");
+ }
+
+ holder = $(document.createElement("ul"));
+ holder.attr("class", "holder");
+ element.after(holder);
+
+ complete = $(document.createElement("div"));
+ complete.addClass("facebook-auto");
+ complete.append('<div class="default">' + options.complete_text + "</div>");
+
+ if (browser_msie) {
+ complete.append('<iframe class="ie6fix" scrolling="no" frameborder="0"></iframe>');
+ browser_msie_frame = complete.children('.ie6fix');
+ }
+
+ feed = $(document.createElement("ul"));
+ feed.attr("id", elemid + "_feed");
+
+ complete.prepend(feed);
+ holder.after(complete);
+ feed.css("width", complete.width());
+ }
+
+ function preSet(){
+ element.children("option").each(function(i, option){
+ option = $(option);
+ if (option.hasClass("selected")) {
+ addItem(option.text(), option.val(), true, option.hasClass("locked"));
+ option.attr("selected", "selected");
+ }
+ else {
+ option.removeAttr("selected");
+ }
+
+ cache.push({
+ caption: option.text(),
+ value: option.val()
+ });
+ search_string += "" + (cache.length - 1) + ":" + option.text() + ";";
+ });
+ }
+
+ //public method to add new item
+ $(this).bind("addItem", function(event, data){
+ addItem(data.title, data.value);
+ });
+
+ function addItem(title, value, preadded, locked){
+ if (!maxItems()) {
+ return false;
+ }
+ var li = document.createElement("li");
+ var txt = document.createTextNode(title);
+ var aclose = document.createElement("a");
+ var liclass = "bit-box" + (locked ? " locked" : "");
+ $(li).attr({
+ "class": liclass,
+ "rel": value
+ });
+ $(li).prepend(txt);
+ $(aclose).attr({
+ "class": "closebutton",
+ "href": "#"
+ });
+
+ li.appendChild(aclose);
+ holder.append(li);
+
+ $(aclose).click(function(){
+ removeItem($(this).parent("li"));
+ return false;
+ });
+
+ if (!preadded) {
+ $("#" + elemid + "_annoninput").remove();
+ var _item;
+ addInput(1);
+ if (element.children("option[value=" + value + "]").length) {
+ _item = element.children("option[value=" + value + "]");
+ _item.get(0).setAttribute("selected", "selected");
+ if (!_item.hasClass("selected")) {
+ _item.addClass("selected");
+ }
+ }
+ else {
+ var _item = $(document.createElement("option"));
+ _item.attr("value", value).get(0).setAttribute("selected", "selected");
+ _item.attr("value", value).addClass("selected");
+ _item.text(title);
+ element.append(_item);
+ }
+ if (options.onselect.length) {
+ funCall(options.onselect, _item)
+ }
+ }
+ holder.children("li.bit-box.deleted").removeClass("deleted");
+ feed.hide();
+ browser_msie ? browser_msie_frame.hide() : '';
+ }
+
+ function removeItem(item){
+ var parent = item.parent("li");
+ if (!parent.hasClass('locked')) {
+ parent.fadeOut("fast");
+ if (options.onremove.length) {
+ var _item = element.children("option[value=" + item.attr("rel") + "]");
+ funCall(options.onremove, _item)
+ }
+ element.children("option[value=" + item.attr("rel") + "]").removeAttr("selected");
+ element.children("option[value=" + item.attr("rel") + "]").removeClass("selected");
+ item.remove();
+ deleting = 0;
+ }
+ }
+
+ function addInput(focusme){
+ var li = $(document.createElement("li"));
+ var input = $(document.createElement("input"));
+
+ li.attr({
+ "class": "bit-input",
+ "id": elemid + "_annoninput"
+ });
+ input.attr({
+ "type": "text",
+ "class": "maininput",
+ "size": "1"
+ });
+ holder.append(li.append(input));
+
+ input.focus(function(){
+ complete.fadeIn("fast");
+ });
+
+ input.blur(function(){
+ complete.fadeOut("fast");
+ });
+
+ holder.click(function(){
+ input.focus();
+ if (feed.length && input.val().length) {
+ feed.show();
+ }
+ else {
+ feed.hide();
+ browser_msie ? browser_msie_frame.hide() : '';
+ complete.children(".default").show();
+ }
+ });
+
+ input.keypress(function(event){
+ if (event.keyCode == 13) {
+ return false;
+ }
+ //auto expand input
+ input.attr("size", input.val().length + 1);
+ });
+
+ input.keydown(function(event){
+ //prevent to enter some bad chars when input is empty
+ if (event.keyCode == 191) {
+ event.preventDefault();
+ return false;
+ }
+ });
+
+ input.keyup(function(event){
+ var etext = xssPrevent(input.val());
+
+ if (event.keyCode == 8 && etext.length == 0) {
+ feed.hide();
+ browser_msie ? browser_msie_frame.hide() : '';
+ if (!holder.children("li.bit-box:last").hasClass('locked')) {
+ if (holder.children("li.bit-box.deleted").length == 0) {
+ holder.children("li.bit-box:last").addClass("deleted");
+ return false;
+ }
+ else {
+ if (deleting) {
+ return;
+ }
+ deleting = 1;
+ holder.children("li.bit-box.deleted").fadeOut("fast", function(){
+ removeItem($(this));
+ return false;
+ });
+ }
+ }
+ }
+
+ if (event.keyCode != 40 && event.keyCode != 38 && etext.length != 0) {
+ counter = 0;
+
+ if (options.json_url) {
+ if (options.cache && json_cache) {
+ addMembers(etext);
+ bindEvents();
+ }
+ else {
+ $.getJSON(options.json_url + "?tag=" + etext, null, function(data){
+ addMembers(etext, data);
+ json_cache = true;
+ bindEvents();
+ });
+ }
+ }
+ else {
+ addMembers(etext);
+ bindEvents();
+ }
+ complete.children(".default").hide();
+ feed.show();
+ }
+ });
+ if (focusme) {
+ setTimeout(function(){
+ input.focus();
+ complete.children(".default").show();
+ }, 1);
+ }
+ }
+
+ function addMembers(etext, data){
+ feed.html('');
+
+ if (!options.cache) {
+ cache = new Array();
+ search_string = "";
+ }
+
+ addTextItem(etext);
+
+ if (data != null && data.length) {
+ $.each(data, function(i, val){
+ cache.push({
+ caption: val.caption,
+ value: val.value
+ });
+ search_string += "" + (cache.length - 1) + ":" + val.caption + ";";
+ });
+ }
+
+ var maximum = options.maxshownitems < cache.length ? options.maxshownitems : cache.length;
+ var filter = "i";
+ if (options.filter_case) {
+ filter = "";
+ }
+
+ var myregexp, match;
+ try {
+ myregexp = eval('/(?:^|;)\\s*(\\d+)\\s*:[^;]*?' + etext + '[^;]*/g' + filter);
+ match = myregexp.exec(search_string);
+ }
+ catch (ex) {
+ };
+
+ var content = '';
+ while (match != null && maximum > 0) {
+ var id = match[1];
+ var object = cache[id];
+ if (options.filter_selected && element.children("option[value=" + object.value + "]").hasClass("selected")) {
+ //nothing here...
+ }
+ else {
+ content += '<li rel="' + object.value + '">' + itemIllumination(object.caption, etext) + '</li>';
+ counter++;
+ maximum--;
+ }
+ match = myregexp.exec(search_string);
+ }
+ feed.append(content);
+
+ if (options.firstselected) {
+ focuson = feed.children("li:visible:first");
+ focuson.addClass("auto-focus");
+ }
+
+ if (counter > options.height) {
+ feed.css({
+ "height": (options.height * 24) + "px",
+ "overflow": "auto"
+ });
+ if (browser_msie) {
+ browser_msie_frame.css({
+ "height": (options.height * 24) + "px",
+ "width": feed.width() + "px"
+ }).show();
+ }
+ }
+ else {
+ feed.css("height", "auto");
+ if (browser_msie) {
+ browser_msie_frame.css({
+ "height": feed.height() + "px",
+ "width": feed.width() + "px"
+ }).show();
+ }
+ }
+ }
+
+ function itemIllumination(text, etext){
+ if (options.filter_case) {
+ try {
+ eval("var text = text.replace(/(.*)(" + etext + ")(.*)/gi,'$1<em>$2</em>$3');");
+ }
+ catch (ex) {
+ };
+ }
+ else {
+ try {
+ eval("var text = text.replace(/(.*)(" + etext.toLowerCase() + ")(.*)/gi,'$1<em>$2</em>$3');");
+ }
+ catch (ex) {
+ };
+ }
+ return text;
+ }
+
+ function bindFeedEvent(){
+ feed.children("li").mouseover(function(){
+ feed.children("li").removeClass("auto-focus");
+ $(this).addClass("auto-focus");
+ focuson = $(this);
+ });
+
+ feed.children("li").mouseout(function(){
+ $(this).removeClass("auto-focus");
+ focuson = null;
+ });
+ }
+
+ function removeFeedEvent(){
+ feed.children("li").unbind("mouseover");
+ feed.children("li").unbind("mouseout");
+ feed.mousemove(function(){
+ bindFeedEvent();
+ feed.unbind("mousemove");
+ });
+ }
+
+ function bindEvents(){
+ var maininput = $("#" + elemid + "_annoninput").children(".maininput");
+ bindFeedEvent();
+ feed.children("li").unbind("mousedown");
+ feed.children("li").mousedown(function(){
+ var option = $(this);
+ addItem(option.text(), option.attr("rel"));
+ feed.hide();
+ browser_msie ? browser_msie_frame.hide() : '';
+ complete.hide();
+ });
+
+ maininput.unbind("keydown");
+ maininput.keydown(function(event){
+ if (event.keyCode == 191) {
+ event.preventDefault();
+ return false;
+ }
+
+ if (event.keyCode != 8) {
+ holder.children("li.bit-box.deleted").removeClass("deleted");
+ }
+
+ if (event.keyCode == 13 && checkFocusOn()) {
+ var option = focuson;
+ addItem(option.text(), option.attr("rel"));
+ complete.hide();
+ event.preventDefault();
+ focuson = null;
+ return false;
+ }
+
+ if (event.keyCode == 13 && !checkFocusOn()) {
+ if (options.newel) {
+ var value = xssPrevent($(this).val());
+ addItem(value, value);
+ complete.hide();
+ event.preventDefault();
+ focuson = null;
+ }
+ return false;
+ }
+
+ if (event.keyCode == 40) {
+ removeFeedEvent();
+ if (focuson == null || focuson.length == 0) {
+ focuson = feed.children("li:visible:first");
+ feed.get(0).scrollTop = 0;
+ }
+ else {
+ focuson.removeClass("auto-focus");
+ focuson = focuson.nextAll("li:visible:first");
+ var prev = parseInt(focuson.prevAll("li:visible").length, 10);
+ var next = parseInt(focuson.nextAll("li:visible").length, 10);
+ if ((prev > Math.round(options.height / 2) || next <= Math.round(options.height / 2)) && typeof(focuson.get(0)) != "undefined") {
+ feed.get(0).scrollTop = parseInt(focuson.get(0).scrollHeight, 10) * (prev - Math.round(options.height / 2));
+ }
+ }
+ feed.children("li").removeClass("auto-focus");
+ focuson.addClass("auto-focus");
+ }
+ if (event.keyCode == 38) {
+ removeFeedEvent();
+ if (focuson == null || focuson.length == 0) {
+ focuson = feed.children("li:visible:last");
+ feed.get(0).scrollTop = parseInt(focuson.get(0).scrollHeight, 10) * (parseInt(feed.children("li:visible").length, 10) - Math.round(options.height / 2));
+ }
+ else {
+ focuson.removeClass("auto-focus");
+ focuson = focuson.prevAll("li:visible:first");
+ var prev = parseInt(focuson.prevAll("li:visible").length, 10);
+ var next = parseInt(focuson.nextAll("li:visible").length, 10);
+ if ((next > Math.round(options.height / 2) || prev <= Math.round(options.height / 2)) && typeof(focuson.get(0)) != "undefined") {
+ feed.get(0).scrollTop = parseInt(focuson.get(0).scrollHeight, 10) * (prev - Math.round(options.height / 2));
+ }
+ }
+ feed.children("li").removeClass("auto-focus");
+ focuson.addClass("auto-focus");
+ }
+ });
+ }
+
+ function maxItems(){
+ if (options.maxitems != 0) {
+ if (holder.children("li.bit-box").length < options.maxitems) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+ }
+
+ function addTextItem(value){
+ if (options.newel && maxItems()) {
+ feed.children("li[fckb=1]").remove();
+ if (value.length == 0) {
+ return;
+ }
+ var li = $(document.createElement("li"));
+ li.attr({
+ "rel": value,
+ "fckb": "1"
+ }).html(value);
+ feed.prepend(li);
+ counter++;
+ }
+ else {
+ return;
+ }
+ }
+
+ function funCall(func, item){
+ var _object = "";
+ for (i = 0; i < item.get(0).attributes.length; i++) {
+ if (item.get(0).attributes[i].nodeValue != null) {
+ _object += "\"_" + item.get(0).attributes[i].nodeName + "\": \"" + item.get(0).attributes[i].nodeValue + "\",";
+ }
+ }
+ _object = "{" + _object + " notinuse: 0}";
+ try {
+ eval(func + "(" + _object + ")");
+ }
+ catch (ex) {
+ };
+ }
+
+ function checkFocusOn(){
+ if (focuson == null) {
+ return false;
+ }
+ if (focuson.length == 0) {
+ return false;
+ }
+ return true;
+ }
+
+ function xssPrevent(string){
+ string = string.replace(/[\"\'][\s]*javascript:(.*)[\"\']/g, "\"\"");
+ string = string.replace(/script(.*)/g, "");
+ string = string.replace(/eval\((.*)\)/g, "");
+ string = string.replace('/([\x00-\x08,\x0b-\x0c,\x0e-\x19])/', '');
+ return string;
+ }
+
+ var options = $.extend({
+ json_url: null,
+ cache: false,
+ height: "10",
+ newel: false,
+ firstselected: false,
+ filter_case: false,
+ filter_hide: false,
+ complete_text: "Start to type...",
+ maxshownitems: 30,
+ maxitems: 0,
+ onselect: "",
+ onremove: ""
+ }, opt);
+
+ //system variables
+ var holder = null;
+ var feed = null;
+ var complete = null;
+ var counter = 0;
+ var cache = new Array();
+ var json_cache = false;
+ var search_string = "";
+ var focuson = null;
+ var deleting = 0;
+ var browser_msie = "\v" == "v";
+ var browser_msie_frame;
+
+ var element = $(this);
+ var elemid = element.attr("id");
+ init();
+
+ return this;
+ });
+ };
+});
diff --git a/themes/default/js/plugins/jquery.tipTip.minified.js b/themes/default/js/plugins/jquery.tipTip.minified.js
new file mode 100644
index 000000000..62b7cfde0
--- /dev/null
+++ b/themes/default/js/plugins/jquery.tipTip.minified.js
@@ -0,0 +1,27 @@
+ /*
+ * TipTip
+ * Copyright 2010 Drew Wilson
+ * www.drewwilson.com
+ * code.drewwilson.com/entry/tiptip-jquery-plugin
+ *
+ * Version 1.2 - Updated: Jan. 13, 2010
+ *
+ * This Plug-In will create a custom tooltip to replace the default
+ * browser tooltip. It is extremely lightweight and very smart in
+ * that it detects the edges of the browser window and will make sure
+ * the tooltip stays within the current window size. As a result the
+ * tooltip will adjust itself to be displayed above, below, to the left
+ * or to the right depending on what is necessary to stay within the
+ * browser window. It is completely customizable as well via CSS.
+ *
+ * This TipTip jQuery plug-in is dual licensed under the MIT and GPL licenses:
+ * http://www.opensource.org/licenses/mit-license.php
+ * http://www.gnu.org/licenses/gpl.html
+ */
+(function($){$.fn.tipTip=function(options){var defaults={maxWidth:"200px",edgeOffset:3,delay:400,fadeIn:200,fadeOut:200,enter:function(){},exit:function(){}};var opts=$.extend(defaults,options);if($("#tiptip_holder").length<=0){var tiptip_holder=$('<div id="tiptip_holder" style="max-width:'+opts.maxWidth+';"></div>');var tiptip_content=$('<div id="tiptip_content"></div>');var tiptip_arrow=$('<div id="tiptip_arrow"></div>');$("body").append(tiptip_holder.html(tiptip_content).prepend(tiptip_arrow.html('<div id="tiptip_arrow_inner"></div>')));}else{var tiptip_holder=$("#tiptip_holder");var tiptip_content=$("#tiptip_content");var tiptip_arrow=$("#tiptip_arrow");}
+return this.each(function(){var org_elem=$(this);var org_title=org_elem.attr("title");if(org_title!=""){org_elem.removeAttr("title");var timeout=false;org_elem.hover(function(){opts.enter.call(this);tiptip_content.html(org_title);tiptip_holder.hide().removeAttr("class").css("margin","0");tiptip_arrow.removeAttr("style");var top=parseInt(org_elem.offset()['top']);var left=parseInt(org_elem.offset()['left']);var org_width=parseInt(org_elem.outerWidth());var org_height=parseInt(org_elem.outerHeight());var tip_w=tiptip_holder.outerWidth();var tip_h=tiptip_holder.outerHeight();var w_compare=Math.round((org_width-tip_w)/2);var h_compare=Math.round((org_height-tip_h)/2);var marg_left=Math.round(left+w_compare);var marg_top=Math.round(top+org_height+opts.edgeOffset);var t_class="";var arrow_top="";var arrow_left=Math.round(tip_w-12)/2;if(w_compare<0){if((w_compare+left)<parseInt($(window).scrollLeft())){t_class="_right";arrow_top=Math.round(tip_h-13)/2;arrow_left=-12;marg_left=Math.round(left+org_width+opts.edgeOffset);marg_top=Math.round(top+h_compare);}else if((tip_w+left)>parseInt($(window).width())){t_class="_left";arrow_top=Math.round(tip_h-13)/2;arrow_left=Math.round(tip_w);marg_left=Math.round(left-(tip_w+opts.edgeOffset+5));marg_top=Math.round(top+h_compare);}}
+if((top+org_height+opts.edgeOffset+tip_h+8)>parseInt($(window).height()+$(window).scrollTop())){t_class=t_class+"_top";arrow_top=tip_h;marg_top=Math.round(top-(tip_h+5+opts.edgeOffset));}else if(((top+org_height)-(opts.edgeOffset+tip_h))<0||t_class==""){t_class=t_class+"_bottom";arrow_top=-12;marg_top=Math.round(top+org_height+opts.edgeOffset);}
+if(t_class=="_right_top"||t_class=="_left_top"){marg_top=marg_top+5;}else if(t_class=="_right_bottom"||t_class=="_left_bottom"){marg_top=marg_top-5;}
+if(t_class=="_left_top"||t_class=="_left_bottom"){marg_left=marg_left+5;}
+tiptip_arrow.css({"margin-left":arrow_left+"px","margin-top":arrow_top+"px"});tiptip_holder.css({"margin-left":marg_left+"px","margin-top":marg_top+"px"}).attr("class","tip"+t_class);if(timeout){clearTimeout(timeout);}
+timeout=setTimeout(function(){tiptip_holder.stop(true,true).fadeIn(opts.fadeIn);},opts.delay);},function(){opts.exit.call(this);if(timeout){clearTimeout(timeout);}tiptip_holder.fadeOut(opts.fadeOut);});}});}})(jQuery); \ No newline at end of file