From fbbed3deaa0090173d398587cfea4af144d062a2 Mon Sep 17 00:00:00 2001 From: Cash Costello Date: Tue, 15 Nov 2011 20:03:52 -0500 Subject: atleast renaming the ui js libs --- js/lib/ui.friends_picker.js | 91 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 js/lib/ui.friends_picker.js (limited to 'js/lib/ui.friends_picker.js') diff --git a/js/lib/ui.friends_picker.js b/js/lib/ui.friends_picker.js new file mode 100644 index 000000000..9257c40fc --- /dev/null +++ b/js/lib/ui.friends_picker.js @@ -0,0 +1,91 @@ +/* + elgg friendsPicker plugin + adapted from Niall Doherty's excellent Coda-Slider - http://www.ndoherty.com/coda-slider + */ + + +jQuery.fn.friendsPicker = function(iterator) { + + var settings; + settings = $.extend({ easeFunc: "easeOutExpo", easeTime: 1000, toolTip: false }, settings); + + return this.each(function() { + + var container = $(this); + container.addClass("friends-picker"); + // set panelwidth manually as it's hidden initially - adjust this value for different themes/pagewidths + var panelWidth = 730; + + // count the panels in the container + var panelCount = container.find("div.panel").size(); + // calculate the width of all the panels lined up end-to-end + var friendsPicker_containerWidth = panelWidth*panelCount; + // specify width for the friendsPicker_container + container.find("div.friends-picker-container").css("width" , friendsPicker_containerWidth); + + // global variables for container.each function below + var friendsPickerNavigationWidth = 0; + var currentPanel = 1; + + // generate appropriate nav for each container + container.each(function(i) { + // generate Left and Right arrows + $(this).before("
Left<\/div>"); + $(this).after("
Right<\/div>"); + + // generate a-z tabs + $(this).before("