Not signed in (Sign In)

Categories

Vanilla 1.1.5 is a product of Lussumo. More Information: Documentation, Community Support.

Help keep Vanilla free:
Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    •  
      CommentAuthorFyorl
    • CommentTimeJan 24th 2008 edited
     # 1
    This short extension utilises the Mootools javascript library to allow users to collapse or re-open panel items. It uses cookies to store the user's current configuration so that their panel items will remain in whatever state they left them in until the user decides to change it.

    As of version 2.0, this extension can now be configured via the Settings tab by any user with the 'Can change Application Settings' permission.

    This extension also makes use of the Mootools extension for greater efficiency.

    Because it uses Mootools there are some known incompatibilities with extensions that employ the Scriptaculous library. When used with the Mootools extension, it is compatible with YellowFade but remains incompatible with Notify. These things should be remedied with the next Mootools extension release.

    Also, since it targets the panel elements specifically, it may be incompatible with certain themes. Support for other themes is trivial to implement and will be added upon request.

    As of version 2.3 it is compatible with the Organic theme.

    Thanks to fery and skube for suggesting and refining the idea.
  1.  # 2
    Uploaded version 1.1 of Collapsible Panel.
    •  
      CommentAuthorFyorl
    • CommentTimeJan 24th 2008
     # 3
    Now the cookies will persist even if you close your browser.
    •  
      CommentAuthorskube
    • CommentTimeJan 25th 2008
     # 4
    After much troubleshooting, I discovered the Notify extension was causing a conflict or somehow preventing the Collapsible Panel to work.
    •  
      CommentAuthorskube
    • CommentTimeJan 25th 2008 edited
     # 5
    Also, since some extensions do not follow the standard panel layout (Category Filter, Statistics, Live Search, etc) this will not affect them. I suppose it would be an easy tweak to include these anomalies in the slidepanel.js.

    EDIT: I changed the selectors to be more encompassing, basically changed
    var PanelItems = $$('#Panel ul li h2');
    to
    var PanelItems = $$('#Panel h2');

    Which seemed to catch more items in the Panel
    •  
      CommentAuthorskube
    • CommentTimeJan 25th 2008 edited
     # 6
    I've found that the Panel items collapse on the index and categories.php page, but they do not collapse on the post.php or comments.php page.

    EDIT: Iget a JS errorError:
    el has no properties
    Source File: vanilla/extensions/CollapsiblePanel/slidepanel.js
    Line: 30


    I added an if(el) {...} to sidepanel.js and everything seems fine.
    • CommentAuthorfysicsluvr
    • CommentTimeJan 25th 2008
     # 7
    could this be extended to be able to collapse the entire panel? like so the panel becomes thinner off to the side...
    •  
      CommentAuthorskube
    • CommentTimeJan 25th 2008 edited
     # 8
    There is a PanelHider Extension if you want to hide the Panel completely. Looks like it may not be finished though...
    •  
      CommentAuthorjimw
    • CommentTimeJan 26th 2008
     # 9
    The PanelHider Extension works for me with the latest version of vanilla. What problems are you having?
    •  
      CommentAuthorskube
    • CommentTimeJan 26th 2008
     # 10
    I am not using PanelHider, I was just going by what it said on the PanelHider Add-on page. The first sentence: "This extension is not yet functional." :)
    •  
      CommentAuthorjimw
    • CommentTimeJan 26th 2008
     # 11
    After installing, I realized since it wasn't working, I needed Mootools. I activated that but nothing. Then I realized I had to deactivate Notify. I did and still it didn't work. I get the js error:

    item.setStyle is not a function
    http://localhost/Vanilla.1/extensions/CollapsiblePanel/slidepanel.js
    Line 9

    I am using FF on a local install with the Blogger theme. I looked but couldn't find any settings to check off. Are there any?
    •  
      CommentAuthorFyorl
    • CommentTimeJan 26th 2008
     # 12
    Thanks for that debugging skube, I've been a bit busy recently. I'll try to get those changes included and any further bugfixes by tomorrow. I'll install Notify too and try to work out the compatibility issues.

    @jimw: There are no settings, the actual PHP part of the extenson that hooks into Vanilla's API is about four lines. Also, you shouldn't need the Mootools extension for this to work (it's recommended though). The extension includes a fallback script that includes all the Mootools pars that it needs. If I had to guess I would say that the error comes from the theme you're using. I forgot to specify the required theme for this extension. The Javascript is quite specific in what elements it targets so chances are it's not finding the panel items successfully. I should be able to get a version out that's compatible with the Blogger theme.
  2.  # 13
    Uploaded version 1.2 of Collapsible Panel.
    •  
      CommentAuthorFyorl
    • CommentTimeJan 27th 2008
     # 14
    OK, implemented skube's bugfixes.

    The problem with Notify arises because of the prototype/scriptaculous that it uses. Mootools basically cannot be used with those. Changing the order of the scripts will allow one thing to work but will kill the other.

    The only solution I can think of is to have the Mootools extension remove the prototype/scriptaculous scripts from the header and also replace any dependant scripts with ones that work with Mootools instead. Obviously this will have to be done on a case-by-case basis and may be difficult to maintain what with updates and all but I can see no other way.

    I will start working on rewriting the notify script and any core vanilla scripts that use it (the only one I can think of is on the role page with the drag n' drop stuff). I'll also make sure I try to keep a list on the Mootools extension's page of which extensions are affected.

    jQuery extensions should be unaffected as jQuery handily has a built-in 'compatibility mode' which allows it to change its functions' namespaces so they don't overwrite others or get overwritten.
    •  
      CommentAuthorØ
    • CommentTimeJan 27th 2008
     # 15
    That's a pretty cool extension, both useful and elegant. However I have a small problem (or mostly a request) with Nuggets.

    Would there be a way to disable the collapsible menu for specific nuggets? I'd like to show some custom items by default, especially Google Ads or widgets from other sites.
    •  
      CommentAuthorskube
    • CommentTimeJan 28th 2008 edited
     # 16
    If your nugget has a title in the header (within the h2), you could do what I did and skip specific headers. So in the /CollipsiblePanel/slidepanel.js, add the following within the PanelItems.each(function(item)){:
    if(item.getText()=='Your Nugget Title') return;
    Ok, this is a definite hack and disables the option of hiding it by always leaving it open.

    I'm sure Fyorl can figure out something better...
    •  
      CommentAuthorFyorl
    • CommentTimeJan 28th 2008
     # 17
    If you want I'll add a way to configure it with a list of items you want opened by default. I'll also give the option to have everything opened or closed by default. The question is whether you'd like a nice frontend for it or are happy editing some PHP variables.
    •  
      CommentAuthorØ
    • CommentTimeJan 28th 2008
     # 18
    Sure, some settings for each panel item would be great... But your hack is exactly what I was thinking about. Thanks :)
    •  
      CommentAuthorskube
    • CommentTimeJan 28th 2008
     # 19
    Also, I don't know if you can do anything about it, but I was using Nuggets to put a random photo into the side panel. For some reason however, the photo would only show 45px if it was set to open position. It didn't matter the height of the photo, it was always 45px tall initially. If you collapse and then expand the widget, the entire photo would then display. I couldn't figure out why, thus I ended up forcing it always open.
  3.  # 20
    Version number changed from 1.2 to 2.0.
  4.  # 21
    Uploaded version 2.0 of Collapsible Panel.
    •  
      CommentAuthorFyorl
    • CommentTimeJan 28th 2008
     # 22
    New Description, contains some useful info.

    I'll take a look at the problem with the images when I have some more time skube but thanks for the heads-up.
    •  
      CommentAuthorØ
    • CommentTimeJan 29th 2008
     # 23
    Wow, quick update and neat settings interface, thanks a lot!

    Now if you're still ready for some coding frenzy... I've got something for you :P

    I was playing with Discussion Overview and various addons, trying to turn Vanilla into a kind of blog/forum hybrid, then suddenly thought collapsible categories with Discussion Overview would be freaking awesome.

    Does it sound possible? Something like a simple button next to the category title, allowing to collapse/expand the discussions under the category, working the same way than Collapsible Panel. I guess it would make happy everyone who keeps asking for categories on the front page and make an interesting discussions list alternative (and it would make me very happy too.)
    •  
      CommentAuthorFyorl
    • CommentTimeJan 29th 2008
     # 24
    If the HTML's already there then making things collapsible is pretty easy (especially with Mootools). From what I can see, Discussion Overview only shows the most recent post in each category so I don't see much point to expanding/collapsing one row. If Discussion Overview showed, say, the 10 most recent posts then I could employ a pretty cool Accordion effect.
    •  
      CommentAuthorØ
    • CommentTimeJan 29th 2008
     # 25
    In fact it shows the ten most recent posts in each category (and there's a setting for the number of posts). The reason why I'd like to make the discussions collapsible in overview mode is because the "block category" option looks quite blunt in my opinion, a bit like if it was about saying "this category sucks, please block it".

    Gently collapsing discussions sounds (and looks) way more friendly than "blocking" in my opinion. And the block option doesn't seem to work with Discussion Overview anyway...

    In my case I intend to use Discussion Overview to display different categories with role-based access: one for official announcements, several allowing comments but no new discussion, one allowing everything, etc. Compared to the "classic" Vanilla setup, the front page would display the five most recent posts of each of the ten (or around ten) categories. That's also why collapsing would make navigation easier for people who don't want a loooong home page.
    •  
      CommentAuthorFyorl
    • CommentTimeJan 29th 2008
     # 26
    Seems perfectly possible. So you want to allow people to see the first 5 (configurable) most recent posts in a category block but have each of those category blocks collapsible. Presumably you want to prevent people from seeing the categories they cannot view (read access).

    Would you like the same setup as with Collapsible Panels in that their settings would be saved or would you prefer a simpler, Accordion effect which only allows one category to be open at any one time?
    •  
      CommentAuthorØ
    • CommentTimeJan 30th 2008
     # 27
    I was thinking about the five latest posts for each category because I've read in another thread that someone had major speed issues with displaying lots of discussions with Discussion Overview. He really had too much categories and his home page was huge, but in my case the number of categories could grow up quite easily, so I wanted to display a minimal amount of discussions just in case. A configurable amount of discussions would be useful, of course.

    As you said, categories not supposed to be seen shouldn't appear (I've tried CategoryRoles for the more specific access settings and it works fine.)

    About the accordion effect, maybe it could be a user preference. It sounds nice, but if for example a user is especially interested in two categories, he would have to read them one after the other constantly. Collapsed items staying collapsed and expanded items staying expanded sounds more navigation-friendly.

    There would still be some "View all" links for each category block, allowing to go directly to a category's page. Another feature (but this could be a different extension) would be to add a "Browse next category" link at the end of each category page, a bit like Next Unread Discussion but for categories. This way people wouldn't have to come back to the home page to check all posts in a given category.

    Thanks for your time!
    •  
      CommentAuthorØ
    • CommentTimeFeb 1st 2008
     # 28
    Hi Fyorl, I've just noticed there seems to be a problem with Collapsible Panel and the categories settings page. Dragging & dropping doesn't work when Collapsible Panel is enabled, and Firebug gives me a couple of errors when I try to re-order categories. Sorry I can't paste them here, I don't have access to my local installation right now.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 1st 2008
     # 29
    Yup, that's the scriptaculous incompatibility again. I'll try to have that fixed in the next Mootools release.
  5.  # 30
    with this extension, if i try an preview a post i get this error

    "Fatal error: Call to a member function on a non-object in /home/virtual/site448/fst/var/www/html/extensions/CollapsiblePanel/default.php on line 31"
  6.  # 31
    bump, anyone?
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 5th 2008
     # 32
    OK well that's a bit weird. I'll have a look into it first chance I get.
  7.  # 33
    thanks, let me know if you need more info from me

    FIXED BY UPDATING TO THE NEWEST PREVIEW POST EXTENSION
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 34
    Huh? That's weird...

    I'll ignore the error for now as I can't reproduce it. Line 31 shouldn't cause any problems really.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 35
    Progress Update: After much digging, the compatibility issues with Mootools and Scriptaculous only occur with CollapsiblePanel because of its use of the 'Hash' plugin. Some slight modifications to change the namespace should be all that's necessary to rectify these issues.
  8.  # 36
    Uploaded version 2.1 of Collapsible Panel.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 37
    The Hash.Cookie problem is fixed but there are still errors occurring when prototype is present. I have no idea what's causing these errors as they seem to occur in the prototype.js file.
    •  
      CommentAuthorØ
    • CommentTimeFeb 6th 2008
     # 38
    I get this error with Firebug:

    MooHash is not defined
    [Break on this error] var HashCookie = new MooHash.Cookie('CP_Settings', {duration: 3650});
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 39
    Ah yes, I forgot to mention that you'll also need to update the Mootools extension and delete all the files in its cache folder.
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 40
    If you don't use the Mootools extension, I'll just quickly update the fallback script to use the new namespace.
  9.  # 41
    Uploaded version 2.1 of Collapsible Panel.
    •  
      CommentAuthorØ
    • CommentTimeFeb 6th 2008
     # 42
    Ok, I'm not sure what I exactly did, but after clearing Firefox & Mootools' cache and numerous reinstallations of both Collapsible Panel & Mootools, everything seems to work fine, including the categories re-ordering (but only with Mootools enabled).

    I'll try to re-enable my other extensions one after the other to see if something breaks. Thanks for the fix :)
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 43
    Yeah, weirdly enough, the category/role re-ordering will still work. It's only the collapsible panel script that will die on those pages.
    •  
      CommentAuthorØ
    • CommentTimeFeb 6th 2008
     # 44
    Well, now it seems activating Mootools breaks Collapsible Panel, and that's the reason why categories re-orderning was working... I'm quite lost here :/
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 6th 2008
     # 45
    Well I have it running fine on my server with Mootools 1.1 activated. It only breaks on the re-ordering pages as far as I can tell.

    I guess this is just another item on The List of Reasons Why I Hate Javascript.
  10.  # 46
    another problem im having is that the extension causes a huge gap in threads between the Discussion title and the first post. As i open or collapse the panels, it moves the gap taller or shorter. I hope i explained this well. Let me know if you need a screenshot or something. This only happens on IE btw. works great on firefox and safari
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 7th 2008 edited
     # 47
    Hmm I don't think that's anything to do with me, it's just IE's crappy rendering. Are you using the default theme?
  11.  # 48
    yes default theme
    •  
      CommentAuthorFyorl
    • CommentTimeFeb 7th 2008 edited
     # 49
    Mootools 1.2 is out. That rewrites the sorting javascript used on the Roles and Categories page of the settings. It removes Prototype from the head completely so it should also be faster on those pages.

    Funnily enough the code needed to implement the same functionality is greater when using the Mootools framework than it is when using the Prototype framework. I put that down to some string hacking I had to do and that Mootools itself is a lighter framework than Prototype.

    @just a novice: I'm not sure if I'll be able to fix those issues with Internet Explorer as it's just down to IE's poor, standards-non-compliant rendering. The extension doesn't touch the HTML in the panel or the CSS, the javascript just modifies the height attribute as far as I can tell.

    Can anyone else confirm these issues in Internet Explorer? I can technically test it myself but running IE on Linux is a bit shaky and I'm having some issues with it right now.
  12.  # 50
    It would be nice for it to render correctly in IE, but its not that big of a deal.

    Problems i had were autocomplete whisper did not work with this extension as well as drag and drop categories. Installed Mootools 1.2 and Collapsible panel 2.1 and now the errors are fixed, but collapsible panel doesnt work.