We use a plugin for jQuery called Interface
Elements<http://interface.eyecon.ro/>
and here is a demo of the re-ordering elements on a
page<http://interface.eyecon.ro/demos/sort.html>
.

Attached is a patch file for the tab-column/xhtml-theme/xhtml-theme.xsl, I
reference the jquery.js and interface.js from {$mediaPath}/common/jquery/,
so you will need to place those two files in that directory. I may have
hacked up the patch, had to remove some other stuff not related to
drag-and-drop, hopefully it works. This patch is for uPortal 2.6.1.

Parker




On Feb 19, 2008 1:05 PM, Jen Bourey <[EMAIL PROTECTED]> wrote:

> Hi Parker,
>
> Would you guys be willing to share the portlet re-ordering code you wrote?
> I haven't yet ironed out all the portlet drag and drop functionality, so it
> would be pretty useful in finishing the up3 theme!  The screenshot you sent
> looks very nice :)
>
> - Jen
>
>
> On Feb 19, 2008 2:58 PM, Parker Grimes <[EMAIL PROTECTED]> wrote:
>
> > I say +1 as well. We like jQuery much better than dojo, it is more light
> > weight which is always a plus for page load times. In fact, we replaced the
> > dojo portlet re-ordering with jQuery quite a while ago. I attached a
> > screenshot of it in action.
> >
> > Parker
> >
>
> --
> You are currently subscribed to [email protected] as: [EMAIL 
> PROTECTED]
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/uportal-dev
>
>

-- 
Join your friends and colleagues at JA-SIG 2008 - "Higher Education Solutions: 
The Community Source Way!"
April 27th - 30th, 2008 in St. Paul, Minnesota USA

Featuring CAS, DSpace, Fedora, Fluid, Internet2, Kuali, Sakai, uPortal, and 
more!
Information/Registration at: 
http://www.ja-sig.org/conferences/08spring/index.html

You are currently subscribed to [email protected] as: [EMAIL 
PROTECTED]
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/uportal-dev
Index: 
/home/grimesp/portalworkspace/up2/webpages/stylesheets/org/jasig/portal/layout/tab-column/xhtml-theme/xhtml-theme.xsl
===================================================================
--- 
/home/grimesp/portalworkspace/up2/webpages/stylesheets/org/jasig/portal/layout/tab-column/xhtml-theme/xhtml-theme.xsl
       (revision 175)
+++ 
/home/grimesp/portalworkspace/up2/webpages/stylesheets/org/jasig/portal/layout/tab-column/xhtml-theme/xhtml-theme.xsl
       (working copy)
@@ -70,6 +70,51 @@
                                                
dojo.require("portal.widget.PortletDragObject");
                                                dojo.hostenv.writeIncludes();
                                        </script>
+                                       <script 
src="{$mediaPath}/common/jquery/jquery.js" type="text/javascript"/>
+                                       <script 
src="{$mediaPath}/common/jquery/interface.js" type="text/javascript"/>
+                                       <script type="text/javascript">
+                                       $(document).ready(function(){           
                      
+                                       <xsl:for-each 
select="/layout/content/column">
+                                                       <xsl:for-each 
select="channel">
+                                                               <xsl:if 
test="not(@dlm:moveAllowed='false')">
+                                                                       
$('#portlet_<xsl:value-of 
select="@ID"/>').addClass('movable').children('.portlet-toolbar').css('cursor', 
'move');
+                                                               </xsl:if>
+                                                       </xsl:for-each>
+                                               </xsl:for-each>
+                                       $('[EMAIL PROTECTED]').each(function(i){
+                                           $(this).Sortable({
+                                                               accept : 
'movable',
+                                                               helperclass : 
'dropborder',
+                                                               opacity : 0.5,
+                                                               handle : 
'div.portlet-toolbar',
+                                                               onStart : 
function(){
+                                                                       
+                                                               },
+                                                               onStop : 
function(){
+                                                                       var 
sourceID = $(this).attr('id').split('_')[1];
+                                                                       var 
method = null;
+                                                                       var 
elementID = null;
+                                                                       if 
($(this).next('div').attr('id') != undefined) {
+                                                                               
method = 'insertBefore';
+                                                                               
elementID = $(this).next('div').attr('id').split('_')[1];
+                                                                       } else 
if ($(this).prev('div').attr('id') != undefined) {
+                                                                               
method = 'appendAfter';
+                                                                               
elementID = $(this).prev('div').attr('id').split('_')[1];
+                                                                       } else {
+                                                                               
method = 'insertBefore';
+                                                                               
elementID = $(this).parent().attr('id').split('_')[1];
+                                                                       }
+                                                                       
+                                                                       $.ajax({
+                                                                               
type: 'GET',
+                                                                               
url: 'ajax/preferences',
+                                                                               
data: 'action=movePortletHere&amp;method=' + method + '&amp;elementID=' + 
elementID + '&amp;sourceID=' + sourceID
+                                                                         });
+                                                               }
+                                                       });
+                                               });
+                                     });
+                                 </script>
                                </xsl:if>                               
                                
                        </head>

Reply via email to