From 811215c4855d6698324e33f981db8d9a7eb8db46 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 6 Oct 2008 12:37:31 +0000 Subject: Elgg Javascript now goes through the views system git-svn-id: https://code.elgg.org/elgg/trunk@2185 36083f99-b078-4883-b0ff-0f9b5a30f544 --- views/default/js/friendsPickerv1.php | 94 +++++++++++++ views/default/js/initialise_elgg.php | 253 +++++++++++++++++++++++++++++++++++ 2 files changed, 347 insertions(+) create mode 100644 views/default/js/friendsPickerv1.php create mode 100644 views/default/js/initialise_elgg.php (limited to 'views/default/js') diff --git a/views/default/js/friendsPickerv1.php b/views/default/js/friendsPickerv1.php new file mode 100644 index 000000000..73e98af15 --- /dev/null +++ b/views/default/js/friendsPickerv1.php @@ -0,0 +1,94 @@ +/* + 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("friendsPicker"); + // set panelwidth manually as it's hidden initially + var panelWidth = 685; + + // 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.friendsPicker_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("