r252696 - slc.linkcollection/branches/plone4/slc/linkcollection/browser

"Cillian de Roiste" <svn-changes-z4DKO/[email protected]> Thu, 21 Nov 2013 14:39:41 +0000 (UTC)
Newsgroups gmane.comp.web.zope.plone.collective.cvs
Message-ID <[email protected]>
Author: cillian
Date: Thu Nov 21 14:39:41 2013
New Revision: 252696

Modified:
   slc.linkcollection/branches/plone4/slc/linkcollection/browser/linkcollection.js
Log:
Use jq instead of jQuery throughout, this helps with compatility and shouldn't do any harm

This fixes a jQuery error triggered when using
wildcard.foldercontents, since that includes a newer version of jQuery.


Modified: slc.linkcollection/branches/plone4/slc/linkcollection/browser/linkcollection.js
==============================================================================
--- slc.linkcollection/branches/plone4/slc/linkcollection/browser/linkcollection.js	(original)
+++ slc.linkcollection/branches/plone4/slc/linkcollection/browser/linkcollection.js	Thu Nov 21 14:39:41 2013
@@ -41,25 +41,25 @@
     return false;
 }
 
-jQuery(function() {
-    var elems = jQuery("h2.linkcollection");
-    jQuery("h2.linkcollection").nextAll().andSelf().wrapAll('<div id="tabs" />');
-    jQuery("<ul id='slc-linkcollection-list' class='navigationLinkBox'></ul>").prependTo("#tabs");
+jq(function() {
+    var elems = jq("h2.linkcollection");
+    jq("h2.linkcollection").nextAll().andSelf().wrapAll('<div id="tabs" />');
+    jq("<ul id='slc-linkcollection-list' class='navigationLinkBox'></ul>").prependTo("#tabs");
     for (var i=0;i<elems.length;i++)
     {
-        var listel = jQuery("<li>")[0];
-        var linkel = jQuery("<a href='#tabs-" + i + "' class='linkcollectionAnchor'></a>)")[0];
-        jQuery(linkel).append(jQuery(elems[i]).text());
-        jQuery(listel).append(linkel);
-        jQuery("#tabs ul#slc-linkcollection-list").append(listel);
-        jQuery(elems[i]).nextUntil("h2.linkcollection").andSelf().wrapAll("<div class='paneContent' id='tabs-" + i + "' />");
+        var listel = jq("<li>")[0];
+        var linkel = jq("<a href='#tabs-" + i + "' class='linkcollectionAnchor'></a>)")[0];
+        jq(linkel).append(jq(elems[i]).text());
+        jq(listel).append(linkel);
+        jq("#tabs ul#slc-linkcollection-list").append(listel);
+        jq(elems[i]).nextUntil("h2.linkcollection").andSelf().wrapAll("<div class='paneContent' id='tabs-" + i + "' />");
     }
-    jQuery('#tabs div.paneContent').wrapAll("<div class='panes' />");
-    jQuery('#tabs').before('<a name="linkcollectionNavi"></a>');
-    var actual_url = jQuery('#actual-url').text();
-    jQuery('#tabs').after('<span class="linkToTopAnchor"><a href="' + actual_url + '#linkcollectionNavi" class="solitaryLink linkcollectionAnchor" i18n:translate="label_go_up">Go up</a></span>');
-    jQuery('#tabs').after('<div class="visualClear"></div>');
-    jQuery("ul.navigationLinkBox").tabs('div.panes > div.paneContent');
+    jq('#tabs div.paneContent').wrapAll("<div class='panes' />");
+    jq('#tabs').before('<a name="linkcollectionNavi"></a>');
+    var actual_url = jq('#actual-url').text();
+    jq('#tabs').after('<span class="linkToTopAnchor"><a href="' + actual_url + '#linkcollectionNavi" class="solitaryLink linkcollectionAnchor" i18n:translate="label_go_up">Go up</a></span>');
+    jq('#tabs').after('<div class="visualClear"></div>');
+    jq("ul.navigationLinkBox").tabs('div.panes > div.paneContent');
 });
 
 var jump=function(e)
@@ -67,12 +67,12 @@
     //prevent the "normal" behaviour which would be a "hard" jump
     e.preventDefault();
     //Get the target
-    var target = jQuery("#tabs");
+    var target = jq("#tabs");
     //perform animated scrolling
-    jQuery('html,body').animate(
+    jq('html,body').animate(
     {
       //get top-position of target-element and set it as scroll target
-      scrollTop: jQuery(target).offset().top
+      scrollTop: jq(target).offset().top
       //scrolldelay: 2 seconds
     },500,function()
     {
@@ -80,9 +80,9 @@
     });
 }
 
-jQuery(document).ready(function()
+jq(document).ready(function()
 {
-    jQuery('a[href*=#].linkcollectionAnchor').bind("click", jump);
+    jq('a[href*=#].linkcollectionAnchor').bind("click", jump);
     return false;
 });
 

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk