From 53894a9dbe4f7a70794899292e5869303b402f3d Mon Sep 17 00:00:00 2001 From: pete Date: Fri, 4 Jul 2008 15:31:14 +0000 Subject: updated js git-svn-id: https://code.elgg.org/elgg/trunk@1295 36083f99-b078-4883-b0ff-0f9b5a30f544 --- javascript/initialise_elgg.js | 135 +++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 88 deletions(-) (limited to 'javascript') diff --git a/javascript/initialise_elgg.js b/javascript/initialise_elgg.js index bde196913..220c19c6b 100644 --- a/javascript/initialise_elgg.js +++ b/javascript/initialise_elgg.js @@ -71,102 +71,18 @@ $(document).ready(function () { accept: ".draggable_widget", hoverClass: 'droppable-hover' }); + +}); /* end document ready function */ + + - /* - // widget hover class - $("table.draggable_widget").bind("mouseenter mouseleave", function(e){ - $(this).toggleClass("draggable_widget_over"); - }); - -*/ -/* - - // remove widget button - $('img.remove_me').click(function () { - $(this.parentNode.parentNode.parentNode.parentNode.parentNode).fadeOut("medium", function () { - $(this).remove(); - // updating hidden fields with new widget order - var widgetNameMain = outputWidgetList('#main_widgets'); - document.getElementById('debugField1').value = widgetNameMain; - var widgetNameRight = outputWidgetList('#rightsidebar_widgets'); - document.getElementById('debugField2').value = widgetNameRight; - }); - return false; - }); -*/ - // define draggable widgets from gallery - //$("#widget_picker_gallery .draggable_widget").draggable({ - // helper: 'clone', - // containment: '#customise_editpanel', - // start: function(ev, ui) { - // $('#rightsidebar_widgets').droppable("enable"); - // $('#main_widgets').droppable("enable"); - // } - //}); - - // define what happens when new widgets are dragged from the gallery -/* - $("#rightsidebar_widgets").droppable({ - accept: ".draggable_widget", - hoverClass: 'droppable-hover', - drop: function(ev, ui) { - $(this).append($(ui.draggable).clone() ); - $(this).droppable("disable"); - - $('img.remove_me').click(function () { - $(this.parentNode.parentNode.parentNode.parentNode.parentNode).fadeOut("medium", function () { - $(this).remove(); - - var widgetNameRight = outputWidgetList('#rightsidebar_widgets'); - document.getElementById('debugField2').value = widgetNameRight; - }); - return false; - }); - - widget_moreinfo(); - - $els.sortable( "refresh" ); - - var widgetNameRight = outputWidgetList('#rightsidebar_widgets'); - document.getElementById('debugField2').value = widgetNameRight; - } - }); -*/ -/* - $("#main_widgets").droppable({ - accept: ".draggable_widget", - hoverClass: 'droppable-hover', - drop: function(ev, ui) { - $(this).append($(ui.draggable).clone() ); - $(this).droppable("disable"); - - $('img.remove_me').click(function () { - $(this.parentNode.parentNode.parentNode.parentNode.parentNode).fadeOut("medium", function () { - $(this).remove(); - - var widgetNameMain = outputWidgetList('#main_widgets'); - document.getElementById('debugField1').value = widgetNameMain; - }); - return false; - }); - - widget_moreinfo(); - - $els.sortable( "refresh" ); - - var widgetNameMain = outputWidgetList('#main_widgets'); - document.getElementById('debugField1').value = widgetNameMain; - } - }); -*/ -}); /* end document ready function */ jQuery.fn.makeDelimitedList = function(elementAttribute) { @@ -189,11 +105,15 @@ jQuery.fn.makeDelimitedList = function(elementAttribute) { } + + function outputWidgetList(forElement) { return( $("input[@name='handler'], input[@name='guid']", forElement ).makeDelimitedList("value") ); } + + // toggle widget box contents var toggleContent = function(e) { var targetContent = $('div.collapsable_box_content', this.parentNode.parentNode); @@ -213,6 +133,8 @@ var toggleContent = function(e) { }; + + // widget more info button function setupMoreInfoButton() { $('img.more_info').click(function () { @@ -226,6 +148,8 @@ function setupMoreInfoButton() { } + + function widget_moreinfo() { $("img.more_info").hover(function(e) { @@ -261,3 +185,38 @@ function widget_moreinfo() { }; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3