Last modified: 2014-01-10 07:47:31 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T49660, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 47660 - Keep CategoryTree expanded after navigation
Keep CategoryTree expanded after navigation
Status: UNCONFIRMED
Product: MediaWiki extensions
Classification: Unclassified
CategoryTree (Other open bugs)
unspecified
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 47845 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-25 17:20 UTC by jesus.perez
Modified: 2014-01-10 07:47 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description jesus.perez 2013-04-25 17:20:53 UTC
Hello,

I have installed CategoryTree in my SidebarMediaWiki. I expand tree manually and when I change to another page tree appears collapsed. I'd wish tree appears always expanded automaticly. How can I do?

Thank you.
Regards.
Comment 1 Andre Klapper 2013-04-26 09:10:28 UTC
Which MediaWiki version is this about (see Special:Version)?
Comment 2 jesus.perez 2013-04-26 09:30:52 UTC
Hello,

I have installed MediaWiki 1.19.0, Semantic MediaWiki (Version 1.8.0.4), Semantic Forms (Version 2.5.2) and CategoryTree: Dynamically navigate the category structure by Daniel Kinzler.

Thank you.
Regards.
Comment 3 Andre Klapper 2013-04-26 11:25:18 UTC
(In reply to comment #2)
> I have installed MediaWiki 1.19.0

Urgh. I hope you manually applied all security patches that are in 1.19.5 and really don't run an ancient, insecure 1.19.0.

> CategoryTree

Which version? The REL1_19 branch? Or git master (which might not work)?

This is all info that is helpful in general in bug reports. :)
Comment 4 jesus.perez 2013-04-26 13:27:33 UTC
Hello,

There isn't specify version (http://www.mediawiki.org/wiki/Extension:CategoryTree).

Actually there are two avalaible versions:

1.20.4 – 2013-04-15
1.19.5 – 2013-04-15

Are there problems with upgrade 1.19.5 from 1.19.0?

Thank you.
Comment 5 Andre Klapper 2013-04-26 15:16:56 UTC
(In reply to comment #4)
> There isn't specify version
> (http://www.mediawiki.org/wiki/Extension:CategoryTree).

Where there? Exact steps would be helpful, otherwise I can only guess.
"Download snapshot (Git master)" downloads git master. Which is 1.21 and might not be compatible with 1.19. However I have the feeling that the documentation for downloading from branches is close to non-existing, so I could understand...

> Are there problems with upgrade 1.19.5 from 1.19.0?

Please ask on https://www.mediawiki.org/wiki/Project:Support_desk - this is offtopic for this bug report.
Comment 6 Sam Reed (reedy) 2013-04-29 20:51:49 UTC
*** Bug 47845 has been marked as a duplicate of this bug. ***
Comment 7 satyamcompany 2013-04-29 21:09:07 UTC
(In reply to comment #6)
> *** Bug 47845 has been marked as a duplicate of this bug. ***
When I am going down in one category and subcategories (depth 5-6), after
loading the specified category , the category tree is folded again. Is there
any chance the tree stays opened? Please reply ASAP... How to keep nodes
expaneded even after clicking any category from the tree?Any code changes to be
done in Categorytree extension? It would be great to have the tree expanded to
the current page after clicking any article , so that the users can get a quick
impression about the location of the current article in the overall context? I
am using Vector skin in Media 1.20.3?

Can anyone tell what code changes need to be done ?I referred to some websites
but was of no help.
http://edutechwiki.unige.ch/fr/Accueil
http://clc-wiki.net/wiki/Main_Page
http://wikispooks.com/wiki/Main_Page
I am not technically sound,so please mention code changes if any is there.
Comment 8 jesus.perez 2013-05-10 09:18:38 UTC
Hello,

I'm reading again this bug and I think I didn't write it correctly.

I have installed the following code (http://www.mediawiki.org/wiki/Manual:Interface/Sidebar#content_of_sidebar_and_toolbox_.28javascript.29) because I work with Monobook style in my Wiki but it doesn't run.

Make Expanding/Collapsing Sidebar for all users | only monobook [edit]
 
If you use the monobook-style and don't want to miss the expandable Menubar from e.g. Vector-Skin, paste the following code in MediaWiki:Common.js of your wiki.
 

///////////////////////////////////////////////////////
// Codesnippet to make your sidebaritems expandable  //
// Use this code ONLY for monobook-Style.            //
///////////////////////////////////////////////////////
 
$(document).ready(function(){
 
  //set the default expanded Items by their headline
  var defaultExpandItems= ['Navigation', 'Orga'];
  //set the basic-name for the cookies, which save the current state of expanding
  var expandCookieName = "disdance_project_wiki_nav_expanded_";
 
  var maxHeights=[]
  var expandeds=[];
  var labels=[];
  initNav();
});
 
function initNav(){
    $('#p-logo').css({'position':'relative', 'display':'block'});;
    $('.generated-sidebar h5,#p-tb h5 ').each(function(i){
 
          var id = $(this).parent().attr('id');           
          maxHeights[id]=$(this).next('div').height();
          var str = $(this).html();
          labels[id]=str;     
 
          if ($.cookie(expandCookieName+id)=='false'  ){               
                expandeds[id]=false;
                minimize( $(this));
 
         } else if ($.cookie(expandCookieName+id)=='true'  ){
                expandeds[id]=true;
                maximize( $(this));
 
         } else if (defaultExpandItems.indexOf(str)==-1){
                expandeds[id]=false;
                minimize( $(this));
         } else {
                expandeds[id]=true;
                maximize( $(this));
         }
         $(this).css({'cursor':'pointer'});
         $(this).click(toggleNav);
    });
}
 
function minimize(target){
    var id=$(target).parent().attr('id');
    //You can change the expires-parameter to save the Cookie longer/shorter than 7 days like in this Code
    $.cookie(expandCookieName+id,'false', { expires: 7});
    var str = labels[id]+"  ►";
    $(target).next('div').animate({'height':'0px'});
    $(target).html(str);    
}
 
function maximize(target){
    var id=$(target).parent().attr('id');
    //You can change the expires-parameter to save the Cookie longer/shorter than 7 days like in this Code
    $.cookie(expandCookieName+id,'true', { expires: 7});
    var str = labels[id]+"  ▼";
    var  newHeight = maxHeights[id];
    $(target).next('div').animate({'height':newHeight+'px'});
    $(target).html(str);    
}
 
function toggleNav(e){
    var id=$(e.target).parent().attr('id');
    expandeds[id]=!expandeds[id];
    if(expandeds[id]==true){ 
       maximize(e.target);
    } 
    else{ 
       minimize(e.target);
    }
} 
 
///////////////////////////////////////////////////////
///////////////////////////////////////////////////////

Thank you.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links