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/autocomplete.js | 14 ------ js/lib/avatar_cropper.js | 76 ---------------------------- js/lib/friends_picker.js | 91 ---------------------------------- js/lib/ui.autocomplete.js | 14 ++++++ js/lib/ui.avatar_cropper.js | 76 ++++++++++++++++++++++++++++ js/lib/ui.friends_picker.js | 91 ++++++++++++++++++++++++++++++++++ js/lib/ui.userpicker.js | 117 ++++++++++++++++++++++++++++++++++++++++++++ js/lib/userpicker.js | 117 -------------------------------------------- 8 files changed, 298 insertions(+), 298 deletions(-) delete mode 100644 js/lib/autocomplete.js delete mode 100644 js/lib/avatar_cropper.js delete mode 100644 js/lib/friends_picker.js create mode 100644 js/lib/ui.autocomplete.js create mode 100644 js/lib/ui.avatar_cropper.js create mode 100644 js/lib/ui.friends_picker.js create mode 100644 js/lib/ui.userpicker.js delete mode 100644 js/lib/userpicker.js (limited to 'js/lib') diff --git a/js/lib/autocomplete.js b/js/lib/autocomplete.js deleted file mode 100644 index 46d72d146..000000000 --- a/js/lib/autocomplete.js +++ /dev/null @@ -1,14 +0,0 @@ -/** - * - */ -elgg.provide('elgg.autocomplete'); - -elgg.autocomplete.init = function() { - $('.elgg-input-autocomplete').autocomplete({ - source: elgg.autocomplete.url, //gets set by input/autocomplete view - minLength: 2, - html: "html" - }) -}; - -elgg.register_hook_handler('init', 'system', elgg.autocomplete.init); \ No newline at end of file diff --git a/js/lib/avatar_cropper.js b/js/lib/avatar_cropper.js deleted file mode 100644 index fc32a0832..000000000 --- a/js/lib/avatar_cropper.js +++ /dev/null @@ -1,76 +0,0 @@ -/** - * Avatar cropping - */ - -elgg.provide('elgg.avatarCropper'); - -/** - * Register the avatar cropper. - * - * If the hidden inputs have the coordinates from a previous cropping, begin - * the selection and preview with that displayed. - */ -elgg.avatarCropper.init = function() { - var params = { - selectionOpacity: 0, - aspectRatio: '1:1', - onSelectEnd: elgg.avatarCropper.selectChange, - onSelectChange: elgg.avatarCropper.preview - }; - - if ($('input[name=x2]').val()) { - params.x1 = $('input[name=x1]').val(); - params.x2 = $('input[name=x2]').val(); - params.y1 = $('input[name=y1]').val(); - params.y2 = $('input[name=y2]').val(); - } - - $('#user-avatar-cropper').imgAreaSelect(params); - - if ($('input[name=x2]').val()) { - var ias = $('#user-avatar-cropper').imgAreaSelect({instance: true}); - var selection = ias.getSelection(); - elgg.avatarCropper.preview($('#user-avatar-cropper'), selection); - } -}; - -/** - * Handler for changing select area. - * - * @param {Object} reference to the image - * @param {Object} imgareaselect selection object - * @return void - */ -elgg.avatarCropper.preview = function(img, selection) { - // catch for the first click on the image - if (selection.width == 0 || selection.height == 0) { - return; - } - - var origWidth = $("#user-avatar-cropper").width(); - var origHeight = $("#user-avatar-cropper").height(); - var scaleX = 100 / selection.width; - var scaleY = 100 / selection.height; - $('#user-avatar-preview > img').css({ - width: Math.round(scaleX * origWidth) + 'px', - height: Math.round(scaleY * origHeight) + 'px', - marginLeft: '-' + Math.round(scaleX * selection.x1) + 'px', - marginTop: '-' + Math.round(scaleY * selection.y1) + 'px' - }); -}; - -/** - * Handler for updating the form inputs after select ends - * - * @param {Object} reference to the image - * @param {Object} imgareaselect selection object - * @return void - */ -elgg.avatarCropper.selectChange = function(img, selection) { - $('input[name=x1]').val(selection.x1); - $('input[name=x2]').val(selection.x2); - $('input[name=y1]').val(selection.y1); - $('input[name=y2]').val(selection.y2); -}; - -elgg.register_hook_handler('init', 'system', elgg.avatarCropper.init); \ No newline at end of file diff --git a/js/lib/friends_picker.js b/js/lib/friends_picker.js deleted file mode 100644 index 9257c40fc..000000000 --- a/js/lib/friends_picker.js +++ /dev/null @@ -1,91 +0,0 @@ -/* - 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("